Commit 31a044ef authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserEndPaint implementation from user32.

parent 0b0403ba
......@@ -253,7 +253,7 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
(btnPaintFunc[btn_type])( hWnd, hdc, ODA_DRAWENTIRE );
SetBkMode(hdc, nOldMode); /* reset painting mode */
}
if ( !wParam ) EndPaint( hWnd, &ps );
if (!wParam) NtUserEndPaint( hWnd, &ps );
break;
}
......
......@@ -832,8 +832,8 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
SelectObject( hDC, hPrevBrush );
}
if( !hParamDC )
EndPaint(lphc->self, &ps);
if (!hParamDC)
NtUserEndPaint( lphc->self, &ps );
return 0;
}
......
......@@ -381,7 +381,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
wine_dbgstr_rect(&ps.rcPaint));
DrawIcon( hdc, x, y, hIcon );
}
EndPaint( hwnd, &ps );
NtUserEndPaint( hwnd, &ps );
}
return 0;
}
......
......@@ -3776,7 +3776,7 @@ static void EDIT_WM_Paint(EDITSTATE *es, HDC hdc)
SelectObject(dc, old_font);
if (!hdc)
EndPaint(es->hwndSelf, &ps);
NtUserEndPaint( es->hwndSelf, &ps );
}
......
......@@ -3092,7 +3092,7 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
PAINTSTRUCT ps;
HDC hdc = ( wParam ) ? ((HDC)wParam) : NtUserBeginPaint( descr->self, &ps );
ret = LISTBOX_Paint( descr, hdc );
if( !wParam ) EndPaint( descr->self, &ps );
if (!wParam) NtUserEndPaint( descr->self, &ps );
}
return ret;
case WM_SIZE:
......
......@@ -3584,7 +3584,7 @@ LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM
NtUserBeginPaint( hwnd, &ps );
MENU_DrawPopupMenu( hwnd, ps.hdc,
(HMENU)GetWindowLongPtrW( hwnd, 0 ) );
EndPaint( hwnd, &ps );
NtUserEndPaint( hwnd, &ps );
return 0;
}
......
......@@ -551,19 +551,6 @@ static HWND fix_caret(HWND hWnd, const RECT *scroll_rect, INT dx, INT dy,
/***********************************************************************
* EndPaint (USER32.@)
*/
BOOL WINAPI EndPaint( HWND hwnd, const PAINTSTRUCT *lps )
{
ShowCaret( hwnd );
flush_window_surfaces( FALSE );
if (!lps) return FALSE;
release_dc( hwnd, lps->hdc, TRUE );
return TRUE;
}
/***********************************************************************
* GetDC (USER32.@)
*
* Get a device context.
......
......@@ -1523,7 +1523,7 @@ LRESULT WINAPI USER_ScrollBarProc( HWND hwnd, UINT message, WPARAM wParam, LPARA
PAINTSTRUCT ps;
HDC hdc = wParam ? (HDC)wParam : NtUserBeginPaint( hwnd, &ps );
SCROLL_DrawScrollBar( hwnd, hdc, SB_CTL, g_tracking_info.hit_test, &g_tracking_info, TRUE, TRUE );
if (!wParam) EndPaint(hwnd, &ps);
if (!wParam) NtUserEndPaint( hwnd, &ps );
}
break;
......
......@@ -385,7 +385,7 @@ LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
(staticPaintFunc[style])( hwnd, hdc, hbrush, full_style );
SelectClipRgn( hdc, hrgn );
if (hrgn) DeleteObject( hrgn );
if (!wParam) EndPaint(hwnd, &ps);
if (!wParam) NtUserEndPaint( hwnd, &ps );
}
break;
......
......@@ -211,7 +211,7 @@
@ stdcall EndDeferWindowPos(long)
@ stdcall EndDialog(long long)
@ stdcall EndMenu()
@ stdcall EndPaint(long ptr)
@ stdcall EndPaint(long ptr) NtUserEndPaint
@ stub EndTask
# @ stub EnterReaderModeHelper
@ stdcall EnumChildWindows(long ptr long)
......
......@@ -151,6 +151,7 @@ static const struct user_callbacks user_funcs =
SendMessageW,
SendNotifyMessageW,
SetWindowPos,
ShowCaret,
WaitForInputIdle,
notify_ime,
register_builtin_classes,
......
......@@ -926,3 +926,15 @@ HDC WINAPI NtUserBeginPaint( HWND hwnd, PAINTSTRUCT *ps )
ps->hdc = hdc;
return hdc;
}
/***********************************************************************
* NtUserEndPaint (win32u.@)
*/
BOOL WINAPI NtUserEndPaint( HWND hwnd, const PAINTSTRUCT *ps )
{
if (user_callbacks) user_callbacks->pShowCaret( hwnd );
flush_window_surfaces( FALSE );
if (!ps) return FALSE;
release_dc( hwnd, ps->hdc, TRUE );
return TRUE;
}
......@@ -1162,6 +1162,7 @@ static struct unix_funcs unix_funcs =
NtUserCountClipboardFormats,
NtUserDestroyCursor,
NtUserDrawIconEx,
NtUserEndPaint,
NtUserEnumDisplayDevices,
NtUserEnumDisplayMonitors,
NtUserEnumDisplaySettings,
......
......@@ -38,6 +38,7 @@ struct user_callbacks
LRESULT (WINAPI *pSendMessageW)( HWND, UINT, WPARAM, LPARAM );
BOOL (WINAPI *pSendNotifyMessageW)( HWND, UINT, WPARAM, LPARAM );
BOOL (WINAPI *pSetWindowPos)( HWND, HWND, INT, INT, INT, INT, UINT );
BOOL (WINAPI *pShowCaret)( HWND hwnd );
DWORD (WINAPI *pWaitForInputIdle)( HANDLE, DWORD );
void (CDECL *notify_ime)( HWND hwnd, UINT param );
void (CDECL *register_builtin_classes)(void);
......
......@@ -874,7 +874,7 @@
@ stub NtUserEnableWindowResizeOptimization
@ stub NtUserEndDeferWindowPosEx
@ stub NtUserEndMenu
@ stub NtUserEndPaint
@ stdcall NtUserEndPaint(long ptr)
@ stdcall NtUserEnumDisplayDevices(ptr long ptr long)
@ stdcall NtUserEnumDisplayMonitors(long ptr ptr long)
@ stdcall NtUserEnumDisplaySettings(ptr long ptr long)
......
......@@ -198,6 +198,7 @@ struct unix_funcs
BOOL (WINAPI *pNtUserDestroyCursor)( HCURSOR cursor, ULONG arg );
BOOL (WINAPI *pNtUserDrawIconEx)( HDC hdc, INT x0, INT y0, HICON icon, INT width,
INT height, UINT istep, HBRUSH hbr, UINT flags );
BOOL (WINAPI *pNtUserEndPaint)( HWND hwnd, const PAINTSTRUCT *ps );
NTSTATUS (WINAPI *pNtUserEnumDisplayDevices)( UNICODE_STRING *device, DWORD index,
DISPLAY_DEVICEW *info, DWORD flags );
BOOL (WINAPI *pNtUserEnumDisplayMonitors)( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp );
......
......@@ -149,6 +149,12 @@ INT WINAPI NtGdiEndPage( HDC hdc )
return unix_funcs->pNtGdiEndPage( hdc );
}
BOOL WINAPI NtUserEndPaint( HWND hwnd, const PAINTSTRUCT *ps )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserEndPaint( hwnd, ps );
}
BOOL WINAPI NtGdiEnumFonts( HDC hdc, ULONG type, ULONG win32_compat, ULONG face_name_len,
const WCHAR *face_name, ULONG charset, ULONG *count, void *buf )
{
......
......@@ -297,6 +297,7 @@ BOOL WINAPI NtUserDestroyAcceleratorTable( HACCEL handle );
BOOL WINAPI NtUserDestroyCursor( HCURSOR cursor, ULONG arg );
BOOL WINAPI NtUserDrawIconEx( HDC hdc, INT x0, INT y0, HICON icon, INT width,
INT height, UINT istep, HBRUSH hbr, UINT flags );
BOOL WINAPI NtUserEndPaint( HWND hwnd, const PAINTSTRUCT *ps );
NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
DISPLAY_DEVICEW *info, DWORD flags );
BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment