From 4d55d754555dbb63f6b97523930a0e781ece5ea4 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 16 Aug 2021 10:27:16 +0200 Subject: [PATCH] gdi32: Use ntgdi names for palette functions. Signed-off-by: Jacek Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/gdi32/enhmetafile.c | 4 ++-- dlls/gdi32/font.c | 2 +- dlls/gdi32/gdi32.spec | 16 ++++++------- dlls/gdi32/palette.c | 58 +++++++++++++++--------------------------------- include/ntgdi.h | 6 +++++ 5 files changed, 35 insertions(+), 51 deletions(-) diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c index b12db98d9e6..878c0de4006 100644 --- a/dlls/gdi32/enhmetafile.c +++ b/dlls/gdi32/enhmetafile.c @@ -1814,8 +1814,8 @@ BOOL WINAPI PlayEnhMetaFileRecord( { const EMRRESIZEPALETTE *lpResizePalette = (const EMRRESIZEPALETTE *)mr; - ResizePalette( (handletable->objectHandle)[lpResizePalette->ihPal], - (UINT)lpResizePalette->cEntries ); + NtGdiResizePalette( handletable->objectHandle[lpResizePalette->ihPal], + lpResizePalette->cEntries ); break; } diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 9563461ade2..3aafc6ef241 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5626,7 +5626,7 @@ BOOL CDECL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT if (flags & ETO_OPAQUE) { RECT rc = *rect; - HBRUSH brush = CreateSolidBrush( GetNearestColor( dev->hdc, dc->attr->background_color ) ); + HBRUSH brush = CreateSolidBrush( NtGdiGetNearestColor( dev->hdc, dc->attr->background_color )); if (brush) { diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 6b8ed856ffa..b0b649ffe3b 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -62,7 +62,7 @@ @ stdcall CreateFontIndirectExW(ptr) @ stdcall CreateFontIndirectW(ptr) @ stdcall CreateFontW(long long long long long long long long long long long long long wstr) -@ stdcall CreateHalftonePalette(long) +@ stdcall CreateHalftonePalette(long) NtGdiCreateHalftonePalette @ stdcall CreateHatchBrush(long long) @ stdcall CreateICA(str str str ptr) @ stdcall CreateICW(wstr wstr wstr ptr) @@ -318,8 +318,8 @@ @ stdcall GetMetaFileW(wstr) @ stdcall GetMetaRgn(long long) @ stdcall GetMiterLimit(long ptr) -@ stdcall GetNearestColor(long long) -@ stdcall GetNearestPaletteIndex(long long) +@ stdcall GetNearestColor(long long) NtGdiGetNearestColor +@ stdcall GetNearestPaletteIndex(long long) NtGdiGetNearestPaletteIndex @ stdcall GetObjectA(long long ptr) @ stdcall GetObjectType(long) @ stdcall GetObjectW(long long ptr) @@ -341,7 +341,7 @@ # @ stub GetStringBitmapA # @ stub GetStringBitmapW @ stdcall GetSystemPaletteEntries(long long long ptr) -@ stdcall GetSystemPaletteUse(long) +@ stdcall GetSystemPaletteUse(long) NtGdiGetSystemPaletteUse @ stdcall GetTextAlign(long) @ stdcall GetTextCharacterExtra(long) @ stdcall GetTextCharset(long) @@ -421,7 +421,7 @@ @ stdcall RemoveFontResourceW(wstr) @ stdcall ResetDCA(long ptr) @ stdcall ResetDCW(long ptr) -@ stdcall ResizePalette(long long) +@ stdcall ResizePalette(long long) NtGdiResizePalette @ stdcall RestoreDC(long long) @ stdcall RoundRect(long long long long long long long) @ stdcall SaveDC(long) @@ -497,7 +497,7 @@ @ stdcall SetICMProfileW(long wstr) @ stdcall SetLayout(long long) # @ stub SetLayoutWidth -@ stdcall SetMagicColors(ptr long long) +@ stdcall SetMagicColors(ptr long long) NtGdiSetMagicColors @ stdcall SetMapMode(long long) @ stdcall SetMapperFlags(long long) @ stdcall SetMetaFileBitsEx(long ptr) @@ -513,7 +513,7 @@ @ stdcall SetRectRgn(long long long long long) NtGdiSetRectRgn @ stdcall SetRelAbs(long long) @ stdcall SetStretchBltMode(long long) -@ stdcall SetSystemPaletteUse(long long) +@ stdcall SetSystemPaletteUse(long long) NtGdiSetSystemPaletteUse @ stdcall SetTextAlign(long long) @ stdcall SetTextCharacterExtra(long long) @ stdcall SetTextColor(long long) @@ -539,7 +539,7 @@ @ stdcall TranslateCharsetInfo(ptr ptr long) @ stub UnloadNetworkFonts @ stdcall UnrealizeObject(long) -@ stdcall UpdateColors(long) +@ stdcall UpdateColors(long) NtGdiUpdateColors @ stdcall UpdateICMRegKey(long str str long) UpdateICMRegKeyA @ stdcall UpdateICMRegKeyA(long str str long) @ stdcall UpdateICMRegKeyW(long wstr wstr long) diff --git a/dlls/gdi32/palette.c b/dlls/gdi32/palette.c index ae5a0b8bcc4..c92b4dfb9d5 100644 --- a/dlls/gdi32/palette.c +++ b/dlls/gdi32/palette.c @@ -129,7 +129,7 @@ HPALETTE WINAPI NtGdiCreatePaletteInternal( const LOGPALETTE *palette, UINT coun /*********************************************************************** - * CreateHalftonePalette [GDI32.@] + * NtGdiCreateHalftonePalette (win32u.@) * * Creates a halftone palette. * @@ -142,8 +142,7 @@ HPALETTE WINAPI NtGdiCreatePaletteInternal( const LOGPALETTE *palette, UINT coun * of greater that 256 color. On a 256 color device the halftone * palette will be different and this function will be incorrect */ -HPALETTE WINAPI CreateHalftonePalette( - HDC hdc) /* [in] Handle to device context */ +HPALETTE WINAPI NtGdiCreateHalftonePalette( HDC hdc ) { const RGBQUAD *entries = get_default_color_table( 8 ); char buffer[FIELD_OFFSET( LOGPALETTE, palPalEntry[256] )]; @@ -247,17 +246,11 @@ UINT WINAPI SetPaletteEntries( /*********************************************************************** - * ResizePalette [GDI32.@] + * NtGdiResizePalette (win32u.@) * * Resizes logical palette. - * - * RETURNS - * Success: TRUE - * Failure: FALSE */ -BOOL WINAPI ResizePalette( - HPALETTE hPal, /* [in] Handle of logical palette */ - UINT cEntries) /* [in] Number of entries in logical palette */ +BOOL WINAPI NtGdiResizePalette( HPALETTE hPal, UINT cEntries ) { PALETTEOBJ * palPtr = GDI_GetObjPtr( hPal, NTGDI_OBJ_PAL ); PALETTEENTRY *entries; @@ -339,7 +332,7 @@ BOOL WINAPI AnimatePalette( /*********************************************************************** - * SetSystemPaletteUse [GDI32.@] + * SetSystemPaletteUse (win32u.@) * * Specify whether the system palette contains 2 or 20 static colors. * @@ -347,9 +340,7 @@ BOOL WINAPI AnimatePalette( * Success: Previous system palette * Failure: SYSPAL_ERROR */ -UINT WINAPI SetSystemPaletteUse( - HDC hdc, /* [in] Handle of device context */ - UINT use) /* [in] Palette-usage flag */ +UINT WINAPI NtGdiSetSystemPaletteUse( HDC hdc, UINT use ) { UINT old = SystemPaletteUse; @@ -371,15 +362,11 @@ UINT WINAPI SetSystemPaletteUse( /*********************************************************************** - * GetSystemPaletteUse [GDI32.@] + * NtGdiGetSystemPaletteUse (win32u.@) * * Gets state of system palette. - * - * RETURNS - * Current state of system palette */ -UINT WINAPI GetSystemPaletteUse( - HDC hdc) /* [in] Handle of device context */ +UINT WINAPI NtGdiGetSystemPaletteUse( HDC hdc ) { return SystemPaletteUse; } @@ -447,7 +434,7 @@ UINT CDECL nulldrv_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, } /*********************************************************************** - * GetNearestPaletteIndex [GDI32.@] + * NtGdiGetNearestPaletteIndex (win32u.@) * * Gets palette index for color. * @@ -458,9 +445,7 @@ UINT CDECL nulldrv_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, * Success: Index of entry in logical palette * Failure: CLR_INVALID */ -UINT WINAPI GetNearestPaletteIndex( - HPALETTE hpalette, /* [in] Handle of logical color palette */ - COLORREF color) /* [in] Color to be matched */ +UINT WINAPI NtGdiGetNearestPaletteIndex( HPALETTE hpalette, COLORREF color ) { PALETTEOBJ* palObj = GDI_GetObjPtr( hpalette, NTGDI_OBJ_PAL ); UINT index = 0; @@ -506,7 +491,7 @@ COLORREF CDECL nulldrv_GetNearestColor( PHYSDEV dev, COLORREF color ) if (!hpal) hpal = GetStockObject( DEFAULT_PALETTE ); if (spec_type == 2) /* PALETTERGB */ - index = GetNearestPaletteIndex( hpal, color ); + index = NtGdiGetNearestPaletteIndex( hpal, color ); else /* PALETTEINDEX */ index = LOWORD(color); @@ -522,7 +507,7 @@ COLORREF CDECL nulldrv_GetNearestColor( PHYSDEV dev, COLORREF color ) /*********************************************************************** - * GetNearestColor [GDI32.@] + * NtGdiGetNearestColor (win32u.@) * * Gets a system color to match. * @@ -530,9 +515,7 @@ COLORREF CDECL nulldrv_GetNearestColor( PHYSDEV dev, COLORREF color ) * Success: Color from system palette that corresponds to given color * Failure: CLR_INVALID */ -COLORREF WINAPI GetNearestColor( - HDC hdc, /* [in] Handle of device context */ - COLORREF color) /* [in] Color to be matched */ +COLORREF WINAPI NtGdiGetNearestColor( HDC hdc, COLORREF color ) { COLORREF nearest = CLR_INVALID; DC *dc; @@ -672,16 +655,11 @@ typedef HWND (WINAPI *WindowFromDC_funcptr)( HDC ); typedef BOOL (WINAPI *RedrawWindow_funcptr)( HWND, const RECT *, HRGN, UINT ); /********************************************************************** - * UpdateColors [GDI32.@] + * NtGdiUpdateColors (win32u.@) * * Remaps current colors to logical palette. - * - * RETURNS - * Success: TRUE - * Failure: FALSE */ -BOOL WINAPI UpdateColors( - HDC hDC) /* [in] Handle of device context */ +BOOL WINAPI NtGdiUpdateColors( HDC hDC ) { HMODULE mod; int size = GetDeviceCaps( hDC, SIZEPALETTE ); @@ -710,10 +688,10 @@ BOOL WINAPI UpdateColors( } /********************************************************************* - * SetMagicColors (GDI32.@) + * NtGdiSetMagicColors (win32u.@) */ -BOOL WINAPI SetMagicColors(HDC hdc, ULONG u1, ULONG u2) +BOOL WINAPI NtGdiSetMagicColors( HDC hdc, DWORD magic, ULONG index ) { - FIXME("(%p 0x%08x 0x%08x): stub\n", hdc, u1, u2); + FIXME( "(%p 0x%08x 0x%08x): stub\n", hdc, magic, index ); return TRUE; } diff --git a/include/ntgdi.h b/include/ntgdi.h index 077f845512e..0e9d5cce59a 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -163,6 +163,7 @@ INT WINAPI NtGdiCombineRgn( HRGN dest, HRGN src1, HRGN src2, INT mode ); BOOL WINAPI NtGdiComputeXformCoefficients( HDC hdc ); HBITMAP WINAPI NtGdiCreateBitmap( INT width, INT height, UINT planes, UINT bpp, const void *bits ); +HPALETTE WINAPI NtGdiCreateHalftonePalette( HDC hdc ); HBRUSH WINAPI NtGdiCreateHatchBrushInternal( INT style, COLORREF color, BOOL pen ); HPALETTE WINAPI NtGdiCreatePaletteInternal( const LOGPALETTE *palette, UINT count ); BOOL WINAPI NtGdiEllipse( HDC hdc, INT left, INT top, INT right, INT bottom ); @@ -219,6 +220,7 @@ COLORREF WINAPI NtGdiGetPixel( HDC hdc, INT x, INT y ); INT WINAPI NtGdiGetRandomRgn( HDC hdc, HRGN region, INT code ); DWORD WINAPI NtGdiGetRegionData( HRGN hrgn, DWORD count, RGNDATA *data ); INT WINAPI NtGdiGetRgnBox( HRGN hrgn, RECT *rect ); +UINT WINAPI NtGdiGetSystemPaletteUse( HDC hdc ); UINT WINAPI NtGdiGetTextCharsetInfo( HDC hdc, FONTSIGNATURE *fs, DWORD flags ); INT WINAPI NtGdiGetTextFaceW( HDC hdc, INT count, WCHAR *name ); BOOL WINAPI NtGdiGetTextMetricsW( HDC hdc, TEXTMETRICW *metrics ); @@ -247,6 +249,7 @@ BOOL WINAPI NtGdiRectInRegion( HRGN hrgn, const RECT *rect ); BOOL WINAPI NtGdiRectVisible( HDC hdc, const RECT *rect ); BOOL WINAPI NtGdiRectangle( HDC hdc, INT left, INT top, INT right, INT bottom ); HDC WINAPI NtGdiResetDC( HDC hdc, const DEVMODEW *devmode ); +BOOL WINAPI NtGdiResizePalette( HPALETTE palette, UINT count ); BOOL WINAPI NtGdiRestoreDC( HDC hdc, INT level ); BOOL WINAPI NtGdiRoundRect( HDC hdc, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height ); @@ -271,11 +274,13 @@ INT WINAPI NtGdiSetDIBitsToDeviceInternal( HDC hdc, INT x_dst, INT y_dst, D BOOL xform_coords, HANDLE xform ); BOOL WINAPI NtGdiSetDeviceGammaRamp( HDC hdc, void *ptr ); DWORD WINAPI NtGdiSetLayout( HDC hdc, LONG wox, DWORD layout ); +BOOL WINAPI NtGdiSetMagicColors( HDC hdc, DWORD magic, ULONG index ); INT WINAPI NtGdiSetMetaRgn( HDC hdc ); BOOL WINAPI NtGdiSetMiterLimit( HDC hdc, FLOAT limit, FLOAT *prev_limit ); COLORREF WINAPI NtGdiSetPixel( HDC hdc, INT x, INT y, COLORREF color ); BOOL WINAPI NtGdiSetPixelFormat( HDC hdc, INT format ); BOOL WINAPI NtGdiSetRectRgn( HRGN hrgn, INT left, INT top, INT right, INT bottom ); +UINT WINAPI NtGdiSetSystemPaletteUse( HDC hdc, UINT use ); BOOL WINAPI NtGdiSetTextJustification( HDC hdc, INT extra, INT breaks ); BOOL WINAPI NtGdiSetVirtualResolution( HDC hdc, DWORD horz_res, DWORD vert_res, DWORD horz_size, DWORD vert_size ); @@ -294,6 +299,7 @@ BOOL WINAPI NtGdiStrokeAndFillPath( HDC hdc ); BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points_out, INT count, UINT mode ); BOOL WINAPI NtGdiUnrealizeObject( HGDIOBJ obj ); +BOOL WINAPI NtGdiUpdateColors( HDC hdc ); BOOL WINAPI NtGdiWidenPath( HDC hdc ); #endif /* _NTGDI_ */ -- 2.11.4.GIT