[User32]
authorJames Tabor <james.tabor@reactos.org>
Fri, 29 Jan 2010 00:58:19 +0000 (00:58 +0000)
committerJames Tabor <james.tabor@reactos.org>
Fri, 29 Jan 2010 00:58:19 +0000 (00:58 +0000)
- Make ValidateRect a direct call, update related. Update UpdateWindow and some code sorting. Getting ready for WND switch.

svn path=/trunk/; revision=45307

reactos/dll/win32/user32/include/ntwrapper.h
reactos/dll/win32/user32/user32.pspec
reactos/dll/win32/user32/windows/paint.c

index e73305e..a021b89 100644 (file)
@@ -503,3 +503,8 @@ InvalidateRect(HWND hWnd, CONST RECT* lpRect, BOOL bErase)
 {
     return NtUserInvalidateRect(hWnd, lpRect, bErase);
 }
+
+EXTINLINE BOOL WINAPI ValidateRect( HWND hWnd, CONST RECT *lpRect)
+{
+   return NtUserValidateRect(hWnd, lpRect);
+}
index ccec803..45eb26b 100644 (file)
 @ stub UserLpkTabbedTextOut
 @ stdcall UserRealizePalette(long)
 @ stdcall UserRegisterWowHandlers(ptr ptr)
-@ stdcall ValidateRect(long ptr) ; Direct call NtUserValidateRect
+@ stdcall ValidateRect(long ptr) NtUserValidateRect
 @ stdcall ValidateRgn(long long)
 @ stdcall VkKeyScanA(long)
 @ stdcall VkKeyScanExA(long long)
index 6209593..49e0e1c 100644 (file)
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id$
- *
+/*
  * PROJECT:         ReactOS user32.dll
- * FILE:            lib/user32/windows/paint.c
+ * FILE:            dll/win32/user32/windows/paint.c
  * PURPOSE:         Input
  * PROGRAMMER:      Casper S. Hornstrup (chorns@users.sourceforge.net)
  * UPDATE HISTORY:
@@ -114,8 +113,14 @@ GetUpdateRgn(
  * @implemented
  */
 BOOL WINAPI
-ScrollDC(HDC hDC, int dx, int dy, CONST RECT *lprcScroll, CONST RECT *lprcClip,
-   HRGN hrgnUpdate, LPRECT lprcUpdate)
+ScrollDC(
+   HDC hDC,
+   int dx,
+   int dy,
+   CONST RECT *lprcScroll,
+   CONST RECT *lprcClip,
+   HRGN hrgnUpdate,
+   LPRECT lprcUpdate)
 {
    if (hDC == NULL) return FALSE;
 
@@ -127,8 +132,13 @@ ScrollDC(HDC hDC, int dx, int dy, CONST RECT *lprcScroll, CONST RECT *lprcClip,
       return TRUE;
    }
 
-   return NtUserScrollDC(hDC, dx, dy, lprcScroll, lprcClip, hrgnUpdate,
-      lprcUpdate);
+   return NtUserScrollDC( hDC,
+                          dx,
+                          dy,
+                          lprcScroll,
+                          lprcClip,
+                          hrgnUpdate,
+                          lprcUpdate);
 }
 
 /*
@@ -179,25 +189,21 @@ WINAPI
 UpdateWindow(
   HWND hWnd)
 {
-  return RedrawWindow( hWnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN );
-}
-
+  PWND pWnd = ValidateHwnd(hWnd);
 
+  if (!pWnd)
+     return FALSE;
 /*
- * @implemented
- */
-BOOL
-WINAPI
-ValidateRect(
-  HWND hWnd,
-  CONST RECT *lpRect)
-{
-  /* FIXME: should RDW_NOCHILDREN be included too? Ros used to,
-     but Wine dont so i removed it... */
-  return RedrawWindow(hWnd, lpRect, 0, RDW_VALIDATE);
+  if ( pWnd->hrgnUpdate ||
+       pWnd->state & WNDS_INTERNALPAINT ||
+       pWnd->spwndChild )
+  {*/
+     return RedrawWindow( hWnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN );
+//     return NtUserCallHwndLock(hWnd, HWNDLOCK_ROUTINE_UPDATEWINDOW);
+/*  }
+  return TRUE;*/
 }
 
-
 /*
  * @implemented
  */
@@ -210,9 +216,9 @@ ValidateRgn(
   /* FIXME: should RDW_NOCHILDREN be included too? Ros used to,
      but Wine dont so i removed it... */
   return RedrawWindow( hWnd, NULL, hRgn, RDW_VALIDATE );
+//  return NtUserCallHwndParamLock(hWnd, (DWORD)hRgn, TWOPARAM_ROUTINE_VALIDATERGN);
 }
 
-
 /*
  * @implemented
  */
@@ -225,7 +231,6 @@ GetWindowRgn(
   return (int)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)hRgn, TWOPARAM_ROUTINE_GETWINDOWRGN);
 }
 
-
 /*
  * @implemented
  */