Commit f359c7f6 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use NtUserSelectPalette instead of GDISelectPalette.

parent 41eac6e2
......@@ -2097,8 +2097,7 @@ static UINT WINAPI realize_palette( HDC hdc )
/* Pointers to USER implementation of SelectPalette/RealizePalette */
/* they will be patched by USER on startup */
extern HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg );
HPALETTE (WINAPI *pfnSelectPalette)( HDC hdc, HPALETTE hpal, WORD bkgnd ) = GDISelectPalette;
HPALETTE (WINAPI *pfnSelectPalette)( HDC hdc, HPALETTE hpal, WORD bkgnd ) = NtUserSelectPalette;
UINT (WINAPI *pfnRealizePalette)( HDC hdc ) = realize_palette;
/***********************************************************************
......
......@@ -481,7 +481,7 @@ static BOOL reset_dc_state( HDC hdc )
NtGdiSelectFont( hdc, get_stock_object( SYSTEM_FONT ));
NtGdiSelectPen( hdc, get_stock_object( BLACK_PEN ));
NtGdiSetVirtualResolution( hdc, 0, 0, 0, 0 );
GDISelectPalette( hdc, get_stock_object( DEFAULT_PALETTE ), FALSE );
NtUserSelectPalette( hdc, get_stock_object( DEFAULT_PALETTE ), FALSE );
NtGdiSetBoundsRect( hdc, NULL, DCB_DISABLE );
NtGdiAbortPath( hdc );
......@@ -689,7 +689,7 @@ BOOL WINAPI NtGdiRestoreDC( HDC hdc, INT level )
NtGdiSelectPen( hdc, dcs->hPen );
set_bk_color( dc, dcs->attr->background_color);
set_text_color( dc, dcs->attr->text_color);
GDISelectPalette( hdc, dcs->hPalette, FALSE );
NtUserSelectPalette( hdc, dcs->hPalette, FALSE );
dc->saved_dc = dcs->saved_dc;
dcs->saved_dc = 0;
......
......@@ -1183,12 +1183,12 @@ static struct unix_funcs unix_funcs =
NtUserIsClipboardFormatAvailable,
NtUserMapVirtualKeyEx,
NtUserScrollDC,
NtUserSelectPalette,
NtUserShowCursor,
NtUserToUnicodeEx,
NtUserUnregisterHotKey,
NtUserVkKeyScanEx,
GDISelectPalette,
GetDCHook,
MirrorRgn,
SetDCHook,
......
......@@ -399,7 +399,6 @@ extern BOOL PATH_RestorePath( DC *dst, DC *src ) DECLSPEC_HIDDEN;
extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut ) DECLSPEC_HIDDEN;
/* palette.c */
extern HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg) DECLSPEC_HIDDEN;
extern HPALETTE PALETTE_Init(void) DECLSPEC_HIDDEN;
extern UINT get_palette_entries( HPALETTE hpalette, UINT start, UINT count,
PALETTEENTRY *entries ) DECLSPEC_HIDDEN;
......
......@@ -513,15 +513,17 @@ static BOOL PALETTE_DeleteObject( HGDIOBJ handle )
/***********************************************************************
* GDISelectPalette (Not a Windows API)
* NtUserSelectPalette (win32u.@)
*/
HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg)
HPALETTE WINAPI NtUserSelectPalette( HDC hdc, HPALETTE hpal, WORD bkg )
{
HPALETTE ret = 0;
DC *dc;
TRACE("%p %p\n", hdc, hpal );
/* FIXME: move primary palette handling from user32 */
if (get_gdi_object_type(hpal) != NTGDI_OBJ_PAL)
{
WARN("invalid selected palette %p\n",hpal);
......@@ -531,7 +533,7 @@ HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg)
{
ret = dc->hPalette;
dc->hPalette = hpal;
if (!wBkg) hPrimaryPalette = hpal;
if (!bkg) hPrimaryPalette = hpal;
release_dc_ptr( dc );
}
return ret;
......
......@@ -1157,7 +1157,7 @@
@ stub NtUserSBGetParms
@ stdcall NtUserScrollDC(long long long ptr ptr long ptr)
@ stub NtUserScrollWindowEx
@ stub NtUserSelectPalette
@ stdcall NtUserSelectPalette(long long long)
@ stub NtUserSendEventMessage
@ stub NtUserSendInput
@ stub NtUserSendInteractiveControlHapticsReport
......@@ -1324,7 +1324,6 @@
@ stdcall GetDCHook(long ptr)
@ stdcall SetDCHook(long ptr long)
@ stdcall SetHookFlags(long long)
@ stdcall GDISelectPalette(long long long)
@ cdecl __wine_make_gdi_object_system(long long)
@ cdecl __wine_set_visible_region(long long ptr ptr ptr)
......
......@@ -215,6 +215,7 @@ struct unix_funcs
UINT (WINAPI *pNtUserMapVirtualKeyEx)( UINT code, UINT type, HKL layout );
BOOL (WINAPI *pNtUserScrollDC)( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip,
HRGN ret_update_rgn, RECT *update_rect );
HPALETTE (WINAPI *pNtUserSelectPalette)( HDC hdc, HPALETTE hpal, WORD bkg );
INT (WINAPI *pNtUserShowCursor)( BOOL show );
INT (WINAPI *pNtUserToUnicodeEx)( UINT virt, UINT scan, const BYTE *state,
WCHAR *str, int size, UINT flags, HKL layout );
......@@ -222,7 +223,6 @@ struct unix_funcs
WORD (WINAPI *pNtUserVkKeyScanEx)( WCHAR chr, HKL layout );
/* Wine-specific functions */
HPALETTE (WINAPI *pGDISelectPalette)( HDC hdc, HPALETTE hpal, WORD bkg );
DWORD_PTR (WINAPI *pGetDCHook)( HDC hdc, DCHOOKPROC *proc );
BOOL (WINAPI *pMirrorRgn)( HWND hwnd, HRGN hrgn );
BOOL (WINAPI *pSetDCHook)( HDC hdc, DCHOOKPROC proc, DWORD_PTR data );
......@@ -241,8 +241,6 @@ struct unix_funcs
struct window_surface *surface );
};
HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg );
extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN;
extern void wrappers_init( unixlib_handle_t handle ) DECLSPEC_HIDDEN;
......
......@@ -681,6 +681,11 @@ BOOL WINAPI NtUserScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const R
return unix_funcs->pNtUserScrollDC( hdc, dx, dy, scroll, clip, ret_update_rgn, update_rect );
}
HPALETTE WINAPI NtUserSelectPalette( HDC hdc, HPALETTE hpal, WORD bkg )
{
return unix_funcs->pNtUserSelectPalette( hdc, hpal, bkg );
}
INT WINAPI NtUserShowCursor( BOOL show )
{
return unix_funcs->pNtUserShowCursor( show );
......@@ -702,11 +707,6 @@ WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout )
return unix_funcs->pNtUserVkKeyScanEx( chr, layout );
}
HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD bkg )
{
return unix_funcs->pGDISelectPalette( hdc, hpal, bkg );
}
DWORD_PTR WINAPI GetDCHook( HDC hdc, DCHOOKPROC *proc )
{
return unix_funcs->pGetDCHook( hdc, proc );
......
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