- Rewritten painting implementation (not complete yet, but better then the current).

- Bug fixes.

svn path=/trunk/; revision=6691
This commit is contained in:
Filip Navara 2003-11-18 20:49:39 +00:00
parent cb10422980
commit 1ccabd4c8e
40 changed files with 995 additions and 1286 deletions

View file

@ -10,7 +10,6 @@ NtUserGetClassLong(HWND hWnd, DWORD Offset, BOOL Ansi);
LONG STDCALL
NtUserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi);
INT STDCALL
NtUserReleaseDC(HWND hWnd, HDC hDc);
@ -861,12 +860,8 @@ NtUserGetTitleBarInfo(
DWORD Unknown0,
DWORD Unknown1);
DWORD
STDCALL
NtUserGetUpdateRect(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2);
BOOL STDCALL
NtUserGetUpdateRect(HWND hWnd, LPRECT lpRect, BOOL fErase);
int
STDCALL

View file

@ -323,14 +323,7 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn)
return 0;
}
/* FIXME: This works on Windows, but not on ReactOS! */
#ifdef __REACTOS__
hDC = GetDCEx(hWnd, (hRgn > (HRGN)1) ? hRgn : 0,
/*DCX_USESTYLE*/0x10000 | DCX_WINDOW |
((hRgn > (HRGN)1) ? (DCX_INTERSECTRGN | DCX_KEEPCLIPRGN) : 0));
#else
hDC = GetDCEx(hWnd, hRgn, DCX_WINDOW | DCX_INTERSECTRGN | 0x10000);
#endif
if (hDC == 0)
{
return 0;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: bitblt.c,v 1.28 2003/10/29 08:38:55 gvg Exp $
/* $Id: bitblt.c,v 1.29 2003/11/18 20:49:39 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -40,7 +40,6 @@
#include <include/object.h>
#include <include/dib.h>
#include <include/surface.h>
#include <include/copybits.h>
#include <include/inteng.h>
//#define NDEBUG

View file

@ -1,5 +1,5 @@
#ifndef __SUBSYS_WIN32K_INCLUDE_CALLBACK_H
#define __SUBSYS_WIN32K_INCLUDE_CALLBACK_H
#ifndef _WIN32K_CALLBACK_H
#define _WIN32K_CALLBACK_H
LRESULT STDCALL
IntCallWindowProc(WNDPROC Proc,
@ -23,9 +23,11 @@ IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
UINT Msg,
ULONG_PTR CompletionCallbackContext,
LRESULT Result);
LRESULT STDCALL
IntSendNCCALCSIZEMessage(HWND Wnd, BOOL Validate, PRECT Rect,
NCCALCSIZE_PARAMS* Params);
LRESULT STDCALL
IntSendGETMINMAXINFOMessage(HWND Wnd, MINMAXINFO* MinMaxInfo);
@ -47,4 +49,4 @@ IntLoadSysMenuTemplate();
BOOL STDCALL
IntLoadDefaultCursors();
#endif /* __SUBSYS_WIN32K_INCLUDE_CALLBACK_H */
#endif /* _WIN32K_CALLBACK_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_CARET_H
#define __WIN32K_CARET_H
#ifndef _WIN32K_CARET_H
#define _WIN32K_CARET_H
#include <ddk/ntddk.h>
#include <napi/win32.h>
@ -33,6 +33,6 @@ IntSwitchCaretShowing(PVOID Info);
VOID FASTCALL
IntDrawCaret(HWND hWnd);
#endif /* __WIN32K_CARET_H */
#endif /* _WIN32K_CARET_H */
/* EOF */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_CLASS_H
#define __WIN32K_CLASS_H
#ifndef _WIN32K_CLASS_H
#define _WIN32K_CLASS_H
#include <windows.h>
#include <ddk/ntddk.h>
@ -54,6 +54,6 @@ struct _WINDOW_OBJECT;
ULONG FASTCALL
IntGetClassLong(struct _WINDOW_OBJECT *WindowObject, ULONG Offset, BOOL Ansi);
#endif /* __WIN32K_CLASS_H */
#endif /* _WIN32K_CLASS_H */
/* EOF */

View file

@ -1,6 +1,11 @@
#ifndef _WIN32K_COLOR_H
#define _WIN32K_COLOR_H
const PALETTEENTRY* FASTCALL COLOR_GetSystemPaletteTemplate (VOID);
COLORREF STDCALL COLOR_LookupNearestColor (PALETTEENTRY* palPalEntry, INT size, COLORREF color);
INT STDCALL COLOR_PaletteLookupExactIndex (PALETTEENTRY* palPalEntry, INT size, COLORREF col);
INT STDCALL COLOR_PaletteLookupPixel(PALETTEENTRY *palPalEntry, INT size, PXLATEOBJ XlateObj, COLORREF col, BOOL skipReserved);
ULONG FASTCALL NtGdiGetSysColor(int nIndex);
HBRUSH STDCALL NtGdiGetSysColorBrush(int nIndex);
#endif /* _WIN32K_COLOR_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_DCE_H
#define __WIN32K_DCE_H
#ifndef _WIN32K_DCE_H
#define _WIN32K_DCE_H
/* Ported from WINE by Jason Filby */
@ -54,4 +54,4 @@ HWND FASTCALL IntWindowFromDC(HDC hDc);
PDCE FASTCALL DceFreeDCE(PDCE dce);
void FASTCALL DceFreeWindowDCE(PWINDOW_OBJECT Window);
#endif
#endif /* _WIN32K_DCE_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_DIB_H
#define __WIN32K_DIB_H
#ifndef _WIN32K_DIB_H
#define _WIN32K_DIB_H
#include <win32k/dc.h>
@ -21,4 +21,4 @@ DIBColorTableToPaletteEntries(PPALETTEENTRY palEntries, const RGBQUAD *DIBColorT
HPALETTE FASTCALL
BuildDIBPalette (PBITMAPINFO bmi, PINT paletteType);
#endif /* __WIN32K_DIB_H */
#endif /* _WIN32K_DIB_H */

View file

@ -1,7 +1,7 @@
#ifndef __WIN32K_ENG_H
#define __WIN32K_ENG_H
#ifndef _WIN32K_ENG_H
#define _WIN32K_ENG_H
BOOL STDCALL EngIntersectRect (PRECTL prcDst, PRECTL prcSrc1, PRECTL prcSrc2);
VOID FASTCALL EngDeleteXlate (XLATEOBJ *XlateObj);
#endif /* __WIN32K_ENG_H */
#endif /* _WIN32K_ENG_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_ERROR_H
#define __WIN32K_ERROR_H
#ifndef _WIN32K_ERROR_H
#define _WIN32K_ERROR_H
VOID FASTCALL
SetLastNtError(
@ -12,6 +12,6 @@ SetLastWin32Error(
NTSTATUS FASTCALL
GetLastNtError();
#endif /* __WIN32K_ERROR_H */
#endif /* _WIN32K_ERROR_H */
/* EOF */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_GUICHECK_H
#define __WIN32K_GUICHECK_H
#ifndef _WIN32K_GUICHECK_H
#define _WIN32K_GUICHECK_H
#include <windows.h>
#include <ddk/ntddk.h>
@ -7,6 +7,6 @@
VOID FASTCALL
IntGraphicsCheck(BOOL Create);
#endif /* __WIN32K_GUICHECK_H */
#endif /* _WIN32K_GUICHECK_H */
/* EOF */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_HOTKEY_H
#define __WIN32K_HOTKEY_H
#ifndef _WIN32K_HOTKEY_H
#define _WIN32K_HOTKEY_H
#include <windows.h>
#include <ddk/ntddk.h>
@ -36,6 +36,6 @@ UnregisterWindowHotKeys(PWINDOW_OBJECT Window);
VOID
UnregisterThreadHotKeys(struct _ETHREAD *Thread);
#endif /* __WIN32K_HOTKEY_H */
#endif /* _WIN32K_HOTKEY_H */
/* EOF */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_INPUT_H
#define __WIN32K_INPUT_H
#ifndef _WIN32K_INPUT_H
#define _WIN32K_INPUT_H
#include <internal/kbd.h>
@ -9,4 +9,4 @@ PUSER_MESSAGE_QUEUE W32kGetPrimitiveMessageQueue(VOID);
PKBDTABLES W32kGetDefaultKeyLayout(VOID);
VOID FASTCALL W32kKeyProcessMessage(LPMSG Msg, PKBDTABLES KeyLayout);
#endif /* __WIN32K_INPUT_H */
#endif /* _WIN32K_INPUT_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_INTENG_H
#define __WIN32K_INTENG_H
#ifndef _WIN32K_INTENG_H
#define _WIN32K_INTENG_H
/* Definitions of IntEngXxx functions */
@ -38,4 +38,4 @@ BOOL STDCALL IntEngPolyline(SURFOBJ *DestSurf,
CLIPOBJ* STDCALL IntEngCreateClipRegion(ULONG count,
PRECTL pRect,
RECTL rcBounds);
#endif
#endif /* _WIN32K_INTENG_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_MENU_H
#define __WIN32K_MENU_H
#ifndef _WIN32K_MENU_H
#define _WIN32K_MENU_H
#include <ddk/ntddk.h>
#include <napi/win32.h>
@ -285,6 +285,4 @@ NtUserTrackPopupMenuEx(
HWND hwnd,
LPTPMPARAMS lptpm);
#endif /* __WIN32K_MENU_H */
/* EOF */
#endif /* _WIN32K_MENU_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_MOUSE_H
#define __WIN32K_MOUSE_H
#ifndef _WIN32K_MOUSE_H
#define _WIN32K_MOUSE_H
#include "../eng/misc.h"
#include <include/winsta.h>
@ -14,4 +14,4 @@ VOID FASTCALL EnableMouse(HDC hDisplayDC);
VOID MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount);
#endif /* __WIN32K_MOUSE_H */
#endif /* _WIN32K_MOUSE_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_MSGQUEUE_H
#define __WIN32K_MSGQUEUE_H
#ifndef _WIN32K_MSGQUEUE_H
#define _WIN32K_MSGQUEUE_H
#include <windows.h>
@ -138,6 +138,6 @@ inline VOID MsqClearQueueBits( PUSER_MESSAGE_QUEUE queue, WORD bits );
#define MAKE_LONG(x, y) ((((y) & 0xFFFF) << 16) | ((x) & 0xFFFF))
#endif /* __WIN32K_MSGQUEUE_H */
#endif /* _WIN32K_MSGQUEUE_H */
/* EOF */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_OBJECT_H
#define __WIN32K_OBJECT_H
#ifndef _WIN32K_OBJECT_H
#define _WIN32K_OBJECT_H
#include <windows.h>
#include <win32k/gdiobj.h>
@ -139,6 +139,6 @@ HBITMAP
FASTCALL
BitmapToSurf ( PBITMAPOBJ BitmapObj );
#endif /* __WIN32K_OBJECT_H */
#endif /* _WIN32K_OBJECT_H */
/* EOF */

View file

@ -1,7 +1,7 @@
#ifndef __WIN32K_PAINT_H
#define __WIN32K_PAINT_H
#ifndef _WIN32K_PAINT_H
#define _WIN32K_PAINT_H
BOOL STDCALL FillSolid (SURFOBJ* Surface, RECTL* Dimensions, ULONG iColor);
BOOL STDCALL FillPolygon ( DC* dc, SURFOBJ* SurfObj, BRUSHOBJ* BrushObj, MIX RopMode, CONST PPOINT Points, INT Count, RECTL BoundRect );
#endif /* __WIN32K_PAINT_H */
#endif /* _WIN32K_PAINT_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_PAINTING_H
#define __WIN32K_PAINTING_H
#ifndef _WIN32K_PAINTING_H
#define _WIN32K_PAINTING_H
#include <windows.h>
#include <ddk/ntddk.h>
@ -7,31 +7,11 @@
#include <include/msgqueue.h>
#include <include/window.h>
/* PaintRedrawWindow() control flags */
#define RDW_EX_USEHRGN 0x0001
#define RDW_EX_DELETEHRGN 0x0002
#define RDW_EX_XYWINDOW 0x0004
#define RDW_EX_TOPFRAME 0x0010
#define RDW_EX_DELAY_NCPAINT 0x0020
/* Update non-client region flags. */
#define UNC_DELAY_NCPAINT (0x00000001)
#define UNC_IN_BEGINPAINT (0x00000002)
#define UNC_CHECK (0x00000004)
#define UNC_REGION (0x00000008)
#define UNC_ENTIRE (0x00000010)
#define UNC_UPDATE (0x00000020)
HWND STDCALL
PaintingFindWinToRepaint(HWND hWnd, PW32THREAD Thread);
BOOL STDCALL
PaintRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn,
ULONG Flags, ULONG ExFlags);
BOOL STDCALL
PaintHaveToDelayNCPaint(PWINDOW_OBJECT Window, ULONG Flags);
HRGN STDCALL
PaintUpdateNCRegion(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags);
BOOL FASTCALL
IntRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags);
BOOL FASTCALL
IntGetPaintMessage(PWINDOW_OBJECT Window, PW32THREAD Thread, MSG *Message);
BOOL STDCALL
NtUserValidateRgn(HWND hWnd, HRGN hRgn);
#endif /* __WIN32K_PAINTING_H */
#endif /* _WIN32K_PAINTING_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_PALETTE_H
#define __WIN32K_PALETTE_H
#ifndef _WIN32K_PALETTE_H
#define _WIN32K_PALETTE_H
#define PALETTE_FIXED 0x0001 /* read-only colormap - have to use XAllocColor (if not virtual) */
#define PALETTE_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */
@ -42,4 +42,4 @@ INT FASTCALL PALETTE_ToPhysical (PDC dc, COLORREF color);
PPALETTEENTRY FASTCALL ReturnSystemPalette (VOID);
#endif /* __WIN32K_PALETTE_H */
#endif /* _WIN32K_PALETTE_H */

View file

@ -1,3 +1,6 @@
#ifndef _WIN32K_PATH_H
#define _WIN32K_PATH_H
BOOL FASTCALL PATH_Arc (PDC dc, INT x1, INT y1, INT x2, INT y2, INT xStart, INT yStart, INT xEnd, INT yEnd);
BOOL FASTCALL PATH_AssignGdiPath (GdiPath *pPathDest, const GdiPath *pPathSrc);
VOID FASTCALL PATH_DestroyGdiPath (GdiPath *pPath);
@ -27,3 +30,5 @@ BOOL FASTCALL PATH_PathToRegion(const GdiPath *pPath, INT nPolyFillMode, HRGN *p
BOOL FASTCALL PATH_ReserveEntries (GdiPath *pPath, INT numEntries);
VOID FASTCALL PATH_ScaleNormalizedPoint (FLOAT_POINT corners[], double x, double y, POINT *pPoint);
#endif
#endif /* _WIN32K_PATH_H */

View file

@ -3,5 +3,3 @@
#endif /* _WIN32K_PROP_H */
/* EOF */

View file

@ -1,3 +1,6 @@
#ifndef _WIN32K_RECT_H
#define _WIN32K_RECT_H
BOOL STDCALL
NtGdiUnionRect(PRECT Dest, const RECT* Src1, const RECT* Src2);
BOOL STDCALL
@ -10,3 +13,5 @@ BOOL STDCALL
NtGdiIntersectRect(PRECT Dest, const RECT* Src1, const RECT* Src2);
BOOL STDCALL
NtGdiOffsetRect(LPRECT Rect, int x, int y);
#endif /* _WIN32K_RECT_H */

View file

@ -1,2 +1,7 @@
#ifndef _WIN32K_SCROLL_H
#define _WIN32K_SCROLL_H
DWORD FASTCALL IntCreateScrollBar(PWINDOW_OBJECT Window, LONG idObject);
BOOL FASTCALL IntDestroyScrollBar(PWINDOW_OBJECT Window, LONG idObject);
#endif /* _WIN32K_SCROLL_H */

View file

@ -1,7 +1,7 @@
#ifndef __WIN32K_SURFACE_H
#define __WIN32K_SURFACE_H
#ifndef _WIN32K_SURFACE_H
#define _WIN32K_SURFACE_H
INT FASTCALL BitsPerFormat (ULONG Format);
ULONG FASTCALL BitmapFormat (WORD Bits, DWORD Compression);
#endif /* __WIN32K_SURFACE_H */
#endif /* _WIN32K_SURFACE_H */

View file

@ -1 +1,6 @@
#ifndef _WIN32K_TEXT_H
#define _WIN32K_TEXT_H
BOOL FASTCALL InitFontSupport(VOID);
#endif /* _WIN32K_TEXT_H */

View file

@ -1,5 +1,5 @@
#ifndef _SUBSYS_WIN32K_INCLUDE_TIMER_H
#define _SUBSYS_WIN32K_INCLUDE_TIMER_H
#ifndef _WIN32K_TIMER_H
#define _WIN32K_TIMER_H
typedef struct _MSG_TIMER_ENTRY{
LIST_ENTRY ListEntry;
@ -14,4 +14,4 @@ VOID FASTCALL RemoveTimersThread(HANDLE ThreadID);
PMSG_TIMER_ENTRY FASTCALL IntRemoveTimer(HWND hWnd, UINT_PTR IDEvent, HANDLE ThreadID, BOOL SysTimer);
UINT_PTR FASTCALL IntSetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc, BOOL SystemTimer);
#endif /* ndef _SUBSYS_WIN32K_INCLUDE_TIMER_H */
#endif /* _WIN32K_TIMER_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_WINDOW_H
#define __WIN32K_WINDOW_H
#ifndef _WIN32K_WINDOW_H
#define _WIN32K_WINDOW_H
struct _PROPERTY;
struct _WINDOW_OBJECT;
@ -94,15 +94,20 @@ typedef struct _WINDOW_OBJECT
/* Window flags. */
#define WINDOWOBJECT_NEED_SIZE (0x00000001)
/* Not used anymore: define WINDOWOBJECT_NEED_BEGINPAINT (0x00000002) */
#define WINDOWOBJECT_NEED_ERASEBACKGRD (0x00000004)
#define WINDOWOBJECT_NEED_NCPAINT (0x00000008)
#define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000010)
#define WINDOWOBJECT_NEED_ERASEBKGND (0x00000002)
#define WINDOWOBJECT_NEED_NCPAINT (0x00000004)
#define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000008)
#define WINDOWOBJECT_RESTOREMAX (0x00000020)
inline BOOL IntIsDesktopWindow(PWINDOW_OBJECT WindowObject);
inline BOOL IntIsBroadcastHwnd( HWND hwnd );
inline BOOL IntIsBroadcastHwnd(HWND hwnd);
BOOL FASTCALL
IntIsWindow(HWND hWnd);
HWND* FASTCALL
IntWinListChildren(PWINDOW_OBJECT Window);
BOOLEAN FASTCALL
IntWndBelongsToThread(PWINDOW_OBJECT Window, PW32THREAD ThreadData);
@ -160,12 +165,6 @@ IntUnlinkWindow(PWINDOW_OBJECT Wnd);
VOID FASTCALL
IntLinkWindow(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndParent, PWINDOW_OBJECT WndPrevSibling);
ULONG
UserHasDlgFrameStyle(ULONG Style, ULONG ExStyle);
ULONG
UserHasThickFrameStyle(ULONG Style, ULONG ExStyle);
PWINDOW_OBJECT FASTCALL
IntGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
@ -194,6 +193,6 @@ DWORD IntRemoveWndProcHandle(WNDPROC Handle);
DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
#endif /* __WIN32K_WINDOW_H */
#endif /* _WIN32K_WINDOW_H */
/* EOF */

View file

@ -1,3 +1,6 @@
#ifndef _WIN32K_WINPOS_H
#define _WIN32K_WINPOS_H
/* Undocumented flags. */
#define SWP_NOCLIENTMOVE 0x0800
#define SWP_NOCLIENTSIZE 0x1000
@ -18,3 +21,5 @@ USHORT STDCALL
WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, POINT WinPoint,
PWINDOW_OBJECT* Window);
VOID FASTCALL WinPosActivateOtherWindow(PWINDOW_OBJECT Window);
#endif /* _WIN32K_WINPOS_H */

View file

@ -1,5 +1,5 @@
#ifndef __WIN32K_WINSTA_H
#define __WIN32K_WINSTA_H
#ifndef _WIN32K_WINSTA_H
#define _WIN32K_WINSTA_H
#include <windows.h>
#include <ddk/ntddk.h>
@ -61,6 +61,6 @@ IntSetCaptureWindow(struct _WINDOW_OBJECT* Window);
BOOL FASTCALL
IntGetWindowStationObject(PWINSTATION_OBJECT Object);
#endif /* __WIN32K_WINSTA_H */
#endif /* _WIN32K_WINSTA_H */
/* EOF */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: message.c,v 1.31 2003/11/11 20:28:21 gvg Exp $
/* $Id: message.c,v 1.32 2003/11/18 20:49:39 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -205,39 +205,10 @@ IntPeekMessage(LPMSG Msg,
/* Check for paint messages. */
if (ThreadQueue->PaintPosted)
{
PWINDOW_OBJECT WindowObject;
Msg->hwnd = PaintingFindWinToRepaint(Wnd, PsGetWin32Thread());
Msg->message = WM_PAINT;
Msg->wParam = Msg->lParam = 0;
WindowObject = IntGetWindowObject(Msg->hwnd);
if (WindowObject != NULL)
{
if (WindowObject->Style & WS_MINIMIZE &&
(HICON)NtUserGetClassLong(Msg->hwnd, GCL_HICON, FALSE) != NULL)
{
Msg->message = WM_PAINTICON;
Msg->wParam = 1;
}
if (Msg->hwnd == NULL || Msg->hwnd == Wnd ||
IntIsChildWindow(Wnd, Msg->hwnd))
{
if (WindowObject->Flags & WINDOWOBJECT_NEED_INTERNALPAINT &&
WindowObject->UpdateRegion == NULL)
{
WindowObject->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
if (RemoveMessages)
{
MsqDecPaintCountQueue(WindowObject->MessageQueue);
}
}
}
IntReleaseWindowObject(WindowObject);
}
return TRUE;
if (IntGetPaintMessage(Wnd, PsGetWin32Thread(), Msg))
{
return TRUE;
}
}
return FALSE;

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.34 2003/11/10 17:44:49 weiden Exp $
/* $Id: stubs.c,v 1.35 2003/11/18 20:49:39 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -637,18 +637,6 @@ NtUserGetTitleBarInfo(
return 0;
}
DWORD
STDCALL
NtUserGetUpdateRect(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2)
{
UNIMPLEMENTED
return 0;
}
DWORD
STDCALL
NtUserImpersonateDdeClientWindow(

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: vis.c,v 1.7 2003/09/09 09:39:21 gvg Exp $
* $Id: vis.c,v 1.8 2003/11/18 20:49:39 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -221,7 +221,6 @@ VIS_RepaintDesktop(HWND Desktop, HRGN RepaintRgn)
NtUserReleaseDC(Desktop, dc);
}
static VOID FASTCALL
GetUncoveredArea(HRGN Uncovered, PWINDOW_OBJECT Parent, PWINDOW_OBJECT TargetChild,
BOOL IncludeTarget)
@ -249,7 +248,6 @@ GetUncoveredArea(HRGN Uncovered, PWINDOW_OBJECT Parent, PWINDOW_OBJECT TargetChi
}
ExReleaseFastMutexUnsafe(&Parent->ChildrenListLock);
}
VOID FASTCALL
VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
@ -303,9 +301,10 @@ VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
RgnType = NtGdiCombineRgn(DirtyRgn, DirtyRgn, ExposedWindow, RGN_AND);
if (NULLREGION != RgnType && ERROR != RgnType)
{
PaintRedrawWindow(Sibling, NULL, DirtyRgn,
RDW_INVALIDATE | RDW_FRAME | RDW_ERASE
| RDW_ALLCHILDREN, RDW_EX_XYWINDOW);
NtGdiOffsetRgn(DirtyRgn, -Sibling->ClientRect.left, -Sibling->ClientRect.top);
IntRedrawWindow(Sibling, NULL, DirtyRgn,
RDW_INVALIDATE | RDW_FRAME | RDW_ERASE
| RDW_ALLCHILDREN);
}
Covered = UnsafeIntCreateRectRgnIndirect(&Sibling->WindowRect);
NtGdiCombineRgn(Uncovered, Uncovered, Covered, RGN_DIFF);
@ -329,9 +328,11 @@ VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
RgnType = NtGdiCombineRgn(DirtyRgn, DirtyRgn, ExposedWindow, RGN_AND);
if (NULLREGION != RgnType && ERROR != RgnType)
{
PaintRedrawWindow(Parent, NULL, DirtyRgn,
RDW_INVALIDATE | RDW_FRAME | RDW_ERASE
| RDW_NOCHILDREN, RDW_EX_XYWINDOW);
NtGdiOffsetRgn(DirtyRgn, -Parent->ClientRect.left,
-Parent->ClientRect.top);
IntRedrawWindow(Parent, NULL, DirtyRgn,
RDW_INVALIDATE | RDW_FRAME | RDW_ERASE
| RDW_NOCHILDREN);
}
NtGdiDeleteObject(ExposedWindow);
NtGdiDeleteObject(DirtyRgn);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: windc.c,v 1.34 2003/10/22 13:34:25 gvg Exp $
/* $Id: windc.c,v 1.35 2003/11/18 20:49:39 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -433,6 +433,20 @@ NtUserGetDCEx(HWND hWnd, HANDLE ClipRegion, ULONG Flags)
Dce->hClipRgn = NULL;
}
if (0 != (Flags & DCX_INTERSECTUPDATE) && NULL == ClipRegion)
{
Dce->hClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
if (Dce->hClipRgn)
{
if (Window->UpdateRegion)
NtGdiCombineRgn(Dce->hClipRgn, Window->UpdateRegion, NULL, RGN_COPY);
NtGdiOffsetRgn(Dce->hClipRgn,
Window->WindowRect.left - Window->ClientRect.left,
Window->WindowRect.top - Window->ClientRect.top);
}
Flags &= DCX_INTERSECTRGN;
}
if (NULL != ClipRegion)
{
Dce->hClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: window.c,v 1.135 2003/11/12 05:40:59 royce Exp $
/* $Id: window.c,v 1.136 2003/11/18 20:49:39 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -245,45 +245,37 @@ IntReleaseWindowObject(PWINDOW_OBJECT Window)
}
/*
* IntBuildChildWindowArray
* IntWinListChildren
*
* Compile a list of all child window handles from given window.
*
* Remarks
* This function is similar to Wine WIN_ListChildren, but has different
* syntax.
* This function is similar to Wine WIN_ListChildren. The caller
* must free the returned list with ExFreePool.
*/
BOOL FASTCALL
IntBuildChildWindowArray(PWINDOW_OBJECT Window, HWND **Children, unsigned *NumChildren)
HWND* FASTCALL
IntWinListChildren(PWINDOW_OBJECT Window)
{
PWINDOW_OBJECT Child;
UINT Index;
*Children = NULL;
*NumChildren = 0;
HWND *List;
UINT Index, NumChildren = 0;
ExAcquireFastMutexUnsafe(&Window->ChildrenListLock);
Child = Window->FirstChild;
while (Child)
{
(*NumChildren)++;
Child = Child->NextSibling;
}
for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
++NumChildren;
if (*NumChildren != 0)
if (NumChildren != 0)
{
*Children = ExAllocatePoolWithTag(PagedPool, *NumChildren * sizeof(HWND), TAG_WNAM);
if (*Children != NULL)
List = ExAllocatePool(PagedPool, (NumChildren + 1) * sizeof(HWND));
if (List != NULL)
{
for (Child = Window->FirstChild, Index = 0;
Child != NULL;
Child = Child->NextSibling, ++Index)
{
(*Children)[Index] = Child->Self;
}
ASSERT(Index == *NumChildren);
List[Index] = Child->Self;
List[Index] = NULL;
}
else
{
@ -293,10 +285,9 @@ IntBuildChildWindowArray(PWINDOW_OBJECT Window, HWND **Children, unsigned *NumCh
ExReleaseFastMutexUnsafe(&Window->ChildrenListLock);
return ((*NumChildren != 0) && (*Children != NULL));
return (NumChildren > 0) ? List : NULL;
}
/***********************************************************************
* IntDestroyWindow
*
@ -308,8 +299,7 @@ static LRESULT IntDestroyWindow(PWINDOW_OBJECT Window,
BOOLEAN SendMessages)
{
HWND *Children;
unsigned NumChildren;
unsigned Index;
HWND *ChildHandle;
PWINDOW_OBJECT Child;
if (! IntWndBelongsToThread(Window, ThreadData))
@ -319,33 +309,23 @@ static LRESULT IntDestroyWindow(PWINDOW_OBJECT Window,
}
/* free child windows */
if (IntBuildChildWindowArray(Window, &Children, &NumChildren))
Children = IntWinListChildren(Window);
if (Children)
{
DbgPrint("NumChildren: %d\n", NumChildren);
for (Index = NumChildren; 0 < Index; Index--)
for (ChildHandle = Children; *ChildHandle; ++ChildHandle)
{
Child = IntGetProcessWindowObject(ProcessData, Children[Index - 1]);
DbgPrint("Child %d: %x\n", Index - 1, Child);
Child = IntGetProcessWindowObject(ProcessData, *ChildHandle);
if (NULL != Child)
{
if (IntWndBelongsToThread(Child, ThreadData))
{
DbgPrint("Destroying\n");
IntDestroyWindow(Child, ProcessData, ThreadData, SendMessages);
DbgPrint("End Destroying\n");
}
{
if (IntWndBelongsToThread(Child, ThreadData))
IntDestroyWindow(Child, ProcessData, ThreadData, SendMessages);
#if 0 /* FIXME */
else
{
SendMessageW( list[i], WM_WINE_DESTROYWINDOW, 0, 0 );
}
else
SendMessageW( list[i], WM_WINE_DESTROYWINDOW, 0, 0 );
#endif
}
}
if (0 != NumChildren)
{
ExFreePool(Children);
}
}
ExFreePool(Children);
}
if (SendMessages)
@ -354,9 +334,9 @@ static LRESULT IntDestroyWindow(PWINDOW_OBJECT Window,
* Clear the update region to make sure no WM_PAINT messages will be
* generated for this window while processing the WM_NCDESTROY.
*/
PaintRedrawWindow(Window, NULL, 0,
RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_NOCHILDREN,
0);
IntRedrawWindow(Window, NULL, 0,
RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE |
RDW_NOINTERNALPAINT | RDW_NOCHILDREN);
/*
* Send the WM_NCDESTROY to the window being destroyed.
@ -486,7 +466,7 @@ IntCreateDesktopWindow(PWINSTATION_OBJECT WindowStation,
WindowObject->Class = DesktopClass;
WindowObject->ExStyle = 0;
WindowObject->Style = WS_VISIBLE;
WindowObject->Flags |= WINDOWOBJECT_NEED_ERASEBACKGRD;
WindowObject->Flags = 0;
WindowObject->x = 0;
WindowObject->y = 0;
WindowObject->Width = Width;
@ -1838,16 +1818,16 @@ NtUserDestroyWindow(HWND Wnd)
{
int i;
BOOL GotOne = FALSE;
HWND *list;
UINT NumChildren;
HWND *Children;
HWND *ChildHandle;
PWINDOW_OBJECT Child;
if (IntBuildChildWindowArray(IntGetWindowObject(IntGetDesktopWindow()),
&list, &NumChildren))
Children = IntWinListChildren(IntGetWindowObject(IntGetDesktopWindow());
if (Children)
{
for (i = 0; i < NumChildren; i++)
for (ChildHandle = Children; *ChildHandle; ++ChildHandle)
{
Child = IntGetWindowObject(list[i]);
Child = IntGetWindowObject(*ChildHandle);
if (Child->Owner != Window)
{
continue;
@ -1855,7 +1835,7 @@ NtUserDestroyWindow(HWND Wnd)
if (IntWndBelongsToThread(Child, PsGetWin32Thread()))
{
IntReleaseWindowObject(Child);
NtUserDestroyWindow(list[i]);
NtUserDestroyWindow(*ChildHandle);
GotOne = TRUE;
continue;
}
@ -1866,7 +1846,7 @@ NtUserDestroyWindow(HWND Wnd)
}
IntReleaseWindowObject(Child);
}
ExFreePool(list);
ExFreePool(Children);
}
if (! GotOne)
{
@ -3064,61 +3044,6 @@ NtUserRealChildWindowFromPoint(DWORD Unknown0,
}
/*
* @implemented
*/
BOOL
STDCALL
NtUserRedrawWindow
(
HWND hWnd,
CONST RECT *lprcUpdate,
HRGN hrgnUpdate,
UINT flags
)
{
RECT SafeUpdateRect;
NTSTATUS Status;
PWINDOW_OBJECT Wnd;
if (!(Wnd = IntGetWindowObject(hWnd)))
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return FALSE;
}
if(NULL != lprcUpdate)
{
Status = MmCopyFromCaller(&SafeUpdateRect, (PRECT)lprcUpdate, sizeof(RECT));
if(!NT_SUCCESS(Status))
{
/* FIXME: set last error */
return FALSE;
}
}
Status = PaintRedrawWindow
(
Wnd,
NULL == lprcUpdate ? NULL : &SafeUpdateRect,
hrgnUpdate,
flags,
0
);
if(!NT_SUCCESS(Status))
{
/* FIXME: set last error */
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/
@ -3454,23 +3379,6 @@ NtUserShowWindowAsync(DWORD Unknown0,
}
/*
* @implemented
*/
BOOL STDCALL
NtUserUpdateWindow(HWND hWnd)
{
PWINDOW_OBJECT pWindow = IntGetWindowObject( hWnd);
if (!pWindow)
return FALSE;
if (pWindow->UpdateRegion)
NtUserSendMessage( hWnd, WM_PAINT,0,0);
IntReleaseWindowObject(pWindow);
return TRUE;
}
/*
* @unimplemented
*/

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: winpos.c,v 1.40 2003/10/29 16:24:59 navaraf Exp $
/* $Id: winpos.c,v 1.41 2003/11/18 20:49:39 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -900,7 +900,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
HRGN ClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(ClipRgn, CopyRgn, NULL, RGN_COPY);
Dc = NtUserGetDCEx(Wnd, ClipRgn, DCX_WINDOW | DCX_CACHE |
DCX_KEEPCLIPRGN | DCX_INTERSECTRGN | DCX_CLIPSIBLINGS );
DCX_INTERSECTRGN | DCX_CLIPSIBLINGS );
NtGdiBitBlt(Dc, CopyRect.left, CopyRect.top, CopyRect.right - CopyRect.left,
CopyRect.bottom - CopyRect.top, Dc,
CopyRect.left + (OldWindowRect.left - NewWindowRect.left),
@ -922,19 +922,17 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
RgnType = NtGdiCombineRgn(DirtyRgn, VisAfter, CopyRgn, RGN_DIFF);
if (ERROR != RgnType && NULLREGION != RgnType)
{
PaintRedrawWindow(Window, NULL, DirtyRgn,
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE |
RDW_ALLCHILDREN | RDW_ERASENOW,
RDW_EX_XYWINDOW | RDW_EX_USEHRGN);
IntRedrawWindow(Window, NULL, DirtyRgn,
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE |
RDW_ALLCHILDREN | RDW_ERASENOW);
}
NtGdiDeleteObject(DirtyRgn);
}
else
{
PaintRedrawWindow(Window, NULL, NULL,
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE |
RDW_ALLCHILDREN | RDW_ERASENOW,
RDW_EX_XYWINDOW | RDW_EX_USEHRGN);
IntRedrawWindow(Window, NULL, NULL,
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE |
RDW_ALLCHILDREN | RDW_ERASENOW);
}
}
@ -999,18 +997,13 @@ WinPosShowWindow(HWND Wnd, INT Cmd)
{
BOOLEAN WasVisible;
PWINDOW_OBJECT Window;
NTSTATUS Status;
UINT Swp = 0;
RECT NewPos;
RECT NewPos = {0, 0, 0, 0};
BOOLEAN ShowFlag;
HRGN VisibleRgn;
/* HRGN VisibleRgn;*/
Status =
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
Wnd,
otWindow,
(PVOID*)&Window);
if (!NT_SUCCESS(Status))
Window = IntGetWindowObject(Wnd);
if (!Window)
{
return(FALSE);
}
@ -1101,60 +1094,50 @@ WinPosShowWindow(HWND Wnd, INT Cmd)
*/
}
if (Window->Style & WS_CHILD &&
!IntIsWindowVisible(Window->Parent->Self) &&
(Swp & (SWP_NOSIZE | SWP_NOMOVE)) == (SWP_NOSIZE | SWP_NOMOVE))
/* We can't activate a child window */
if ((Window->Style & WS_CHILD) &&
!(Window->ExStyle & WS_EX_MDICHILD))
{
if (Cmd == SW_HIDE)
Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
}
WinPosSetWindowPos(Wnd, HWND_TOP, NewPos.left, NewPos.top,
NewPos.right, NewPos.bottom, LOWORD(Swp));
if (Cmd == SW_HIDE)
{
/* FIXME: This will cause the window to be activated irrespective
* of whether it is owned by the same thread. Has to be done
* asynchronously.
*/
if (Wnd == IntGetActiveWindow())
{
WinPosActivateOtherWindow(Window);
}
/* Revert focus to parent */
if (Wnd == IntGetFocusWindow() ||
IntIsChildWindow(Wnd, IntGetFocusWindow()))
{
VisibleRgn = VIS_ComputeVisibleRegion(PsGetWin32Thread()->Desktop, Window,
FALSE, FALSE, FALSE);
Window->Style &= ~WS_VISIBLE;
VIS_WindowLayoutChanged(PsGetWin32Thread()->Desktop, Window, VisibleRgn);
NtGdiDeleteObject(VisibleRgn);
}
else
{
Window->Style |= WS_VISIBLE;
IntSetFocusWindow(Window->Parent->Self);
}
}
else
if (!IntIsWindow(Wnd))
{
if (Window->Style & WS_CHILD &&
!(Window->ExStyle & WS_EX_MDICHILD))
{
Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
}
if (!(Swp & MINMAX_NOSWP))
{
WinPosSetWindowPos(Wnd, HWND_TOP, NewPos.left, NewPos.top,
NewPos.right, NewPos.bottom, LOWORD(Swp));
if (Cmd == SW_HIDE)
{
/* Hide the window. */
if (Wnd == IntGetActiveWindow())
{
WinPosActivateOtherWindow(Window);
}
/* Revert focus to parent. */
if (Wnd == IntGetFocusWindow() ||
IntIsChildWindow(Wnd, IntGetFocusWindow()))
{
IntSetFocusWindow(Window->Parent->Self);
}
}
}
/* FIXME: Check for window destruction. */
/* Show title for minimized windows. */
if (Window->Style & WS_MINIMIZE)
{
WinPosShowIconTitle(Window, TRUE);
}
IntReleaseWindowObject(Window);
return WasVisible;
}
else if (Window->Style & WS_MINIMIZE)
{
WinPosShowIconTitle(Window, TRUE);
}
if (Window->Flags & WINDOWOBJECT_NEED_SIZE)
{
WPARAM wParam = SIZE_RESTORED;
/* should happen only in CreateWindowEx() */
int wParam = SIZE_RESTORED;
Window->Flags &= ~WINDOWOBJECT_NEED_SIZE;
if (Window->Style & WS_MAXIMIZE)
@ -1182,8 +1165,8 @@ WinPosShowWindow(HWND Wnd, INT Cmd)
WinPosChangeActiveWindow(Wnd, FALSE);
}
ObmDereferenceObject(Window);
return(WasVisible);
IntReleaseWindowObject(Window);
return WasVisible;
}
BOOL STATIC FASTCALL

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: region.c,v 1.38 2003/11/08 22:54:26 navaraf Exp $ */
/* $Id: region.c,v 1.39 2003/11/18 20:49:39 navaraf Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <ddk/ntddk.h>
@ -101,6 +101,33 @@ typedef struct _POINTBLOCK {
struct _POINTBLOCK *next;
} POINTBLOCK;
/*
* This function is left there for debugging purposes.
*/
VOID FASTCALL
IntDumpRegion(HRGN hRgn)
{
ROSRGNDATA *Data;
Data = RGNDATA_LockRgn(hRgn);
if (Data == NULL)
{
DbgPrint("IntDumpRegion called with invalid region!\n");
return;
}
DbgPrint("IntDumpRegion(%x): %d,%d-%d,%d %d\n",
hRgn,
Data->rdh.rcBound.left,
Data->rdh.rcBound.top,
Data->rdh.rcBound.right,
Data->rdh.rcBound.bottom,
Data->rdh.iType);
RGNDATA_UnlockRgn(hRgn);
}
static BOOL FASTCALL REGION_CopyRegion(PROSRGNDATA dst, PROSRGNDATA src)
{
if(dst != src) // don't want to copy to itself