Author: jimtabor
Date: Sat Jan 30 07:41:39 2010
New Revision: 45341
URL:
http://svn.reactos.org/svn/reactos?rev=45341&view=rev
Log:
[User32]
- More movement to WND support.
Modified:
trunk/reactos/dll/win32/user32/windows/paint.c
Modified: trunk/reactos/dll/win32/user32/windows/paint.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/p…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/paint.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/paint.c [iso-8859-1] Sat Jan 30 07:41:39 2010
@@ -37,9 +37,20 @@
static HBITMAP hHatch;
const DWORD HatchBitmap[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
+BOOL WINAPI MirrorRgn(HWND hwnd, HRGN hrgn);
BOOL WINAPI PolyPatBlt(HDC,DWORD,PPATRECT,INT,ULONG);
/* FUNCTIONS *****************************************************************/
+
+INT
+WINAPI
+MirrorWindowRect( PWND pWnd, LPRECT lprc)
+{
+ INT Ret = pWnd->rcWindow.right - pWnd->rcWindow.left - lprc->left;
+ lprc->left = pWnd->rcWindow.right - pWnd->rcWindow.left - lprc->right;
+ lprc->right = Ret;
+ return Ret;
+}
VOID
CreateFrameBrushes(VOID)
@@ -91,7 +102,24 @@
LPRECT Rect,
BOOL Erase)
{
- return NtUserGetUpdateRect(Wnd, Rect, Erase);
+ PWND pWnd;
+
+ pWnd = ValidateHwnd(Wnd);
+ if (!pWnd)
+ return FALSE;
+/*
+ if ( pWnd->hrgnUpdate ||
+ pWnd->state &
(WNDS_SENDERASEBACKGROUND|WNDS_SENDNCPAINT|WNDS_UPDATEDIRTY|WNDS_PAINTNOTPROCESSED))
+ {*/
+ return NtUserGetUpdateRect(Wnd, Rect, Erase);
+/* }
+
+ if (Rect)
+ { // Did the Rgn update? No! Back set and shutup!
+ Rect->left = Rect->right = Rect->top = Rect->bottom = 0;
+ }
+ return FALSE; // msdn: "If there is no update region, the return value is
zero."
+*/
}
@@ -105,7 +133,25 @@
HRGN hRgn,
BOOL bErase)
{
- return NtUserGetUpdateRgn(hWnd, hRgn, bErase);
+ PWND pWnd;
+
+ if (!hRgn)
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return ERROR;
+ }
+
+ pWnd = ValidateHwnd(hWnd);
+ if (!pWnd)
+ return ERROR;
+/*
+ if ( pWnd->hrgnUpdate ||
+ pWnd->state &
(WNDS_SENDERASEBACKGROUND|WNDS_SENDNCPAINT|WNDS_UPDATEDIRTY|WNDS_PAINTNOTPROCESSED))
+ {*/
+ return NtUserGetUpdateRgn(hWnd, hRgn, bErase);
+/* }
+ SetRectRgn(hRgn, 0, 0, 0, 0);
+ return NULLREGION;*/
}
@@ -224,7 +270,31 @@
HWND hWnd,
HRGN hRgn)
{
- return (int)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)hRgn,
TWOPARAM_ROUTINE_GETWINDOWRGN);
+ PWND pWnd;
+ int Ret;
+
+ if (!hRgn)
+ return ERROR;
+
+ pWnd = ValidateHwnd(hWnd);
+
+ if (!pWnd) // || !pwnd->hrgnClip || pwnd->state2 &
WNDS2_MAXIMIZEDMONITORREGION)
+ return ERROR;
+/*
+ Ret = CombineRgn(hRgn, pWnd->hrgnClip, NULL, RGN_COPY);
+
+ if (!Ret)
+ return ERROR;
+
+ if (pWnd->fnid != FNID_DESKTOP)
+ Ret = OffsetRgn(hRgn, -pWnd->rcWindow.left, -pWnd->rcWindow.top);
+
+ if (pWnd->ExStyle & WS_EX_LAYOUTRTL)
+ MirrorRgn(hWnd, hRgn);
+*/
+ Ret = (int)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)hRgn,
TWOPARAM_ROUTINE_GETWINDOWRGN);
+
+ return Ret;
}
/*
@@ -236,7 +306,31 @@
HWND hWnd,
LPRECT lprc)
{
- return (int)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)lprc,
TWOPARAM_ROUTINE_GETWINDOWRGNBOX);
+ PWND pWnd;
+ int Ret;
+
+ if (!lprc)
+ return ERROR;
+
+ pWnd = ValidateHwnd(hWnd);
+
+ if (!pWnd) // || !pwnd->hrgnClip || pwnd->state2 &
WNDS2_MAXIMIZEDMONITORREGION)
+ return ERROR;
+/*
+ Ret = GetRgnBox(pWnd->hrgnClip, lprc);
+
+ if (!Ret)
+ return ERROR;
+
+ if (pWnd->fnid != FNID_DESKTOP)
+ Ret = OffsetRect(lprc, -pWnd->rcWindow.left, -pWnd->rcWindow.top);
+
+ if (pWnd->ExStyle & WS_EX_LAYOUTRTL)
+ MirrorWindowRect(pWnd, lprc);
+*/
+ Ret = (int)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)lprc,
TWOPARAM_ROUTINE_GETWINDOWRGNBOX);
+
+ return Ret;
}