From 025c424479aa7a3c38156bf64db35c34b5cea32c Mon Sep 17 00:00:00 2001 From: James Tabor Date: Wed, 9 Jan 2008 04:15:42 +0000 Subject: [PATCH] Update SetMetaRgn, UpdateColors, ResizePalette and add support for windows client info gdi. svn path=/trunk/; revision=31679 --- reactos/dll/win32/gdi32/misc/stubs.c | 57 ----------------------- reactos/dll/win32/gdi32/objects/palette.c | 27 ++++++++++- reactos/dll/win32/gdi32/objects/region.c | 36 ++++++++++++++ reactos/include/reactos/win32k/ntgdityp.h | 10 ++++ 4 files changed, 72 insertions(+), 58 deletions(-) diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index 52b341530c9..53ef5a6dd87 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -184,18 +184,6 @@ GetBoundsRect( } -/* - * @implemented - */ -int -STDCALL -GetMetaRgn(HDC hdc, - HRGN hrgn) -{ - return NtGdiGetRandomRgn(hdc,hrgn,2); -} - - /* * @unimplemented */ @@ -213,7 +201,6 @@ GetMetaFileBitsEx( } - /* * @unimplemented */ @@ -243,35 +230,6 @@ PlayMetaFile( return FALSE; } -/* - * @unimplemented - */ -BOOL -STDCALL -ResizePalette( - HPALETTE a0, - UINT a1 - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - -/* - * @unimplemented - */ -int -STDCALL -SetMetaRgn( - HDC hdc - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - /* * @implemented */ @@ -316,21 +274,6 @@ SetMetaFileBitsEx( return 0; } -/* - * @unimplemented - */ -BOOL -STDCALL -UpdateColors( - HDC hdc - ) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - /* * @unimplemented */ diff --git a/reactos/dll/win32/gdi32/objects/palette.c b/reactos/dll/win32/gdi32/objects/palette.c index ed7a3ce1e0f..6a588acc033 100644 --- a/reactos/dll/win32/gdi32/objects/palette.c +++ b/reactos/dll/win32/gdi32/objects/palette.c @@ -89,7 +89,19 @@ RealizePalette(HDC hDC) /* [in] Handle of device context */ return UserRealizePalette(hDC); } - +/* + * @implemented + */ +BOOL +STDCALL +ResizePalette( + HPALETTE hPalette, + UINT nEntries + ) +{ + return NtGdiResizePalette(hPalette, nEntries); +} + /* * @implemented */ @@ -110,4 +122,17 @@ SetDIBColorTable(HDC hDC, return retValue; } +/* + * @implemented + */ +BOOL +STDCALL +UpdateColors( + HDC hdc + ) +{ + ((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0; + return NtGdiUpdateColors(hdc); +} + /* EOF */ diff --git a/reactos/dll/win32/gdi32/objects/region.c b/reactos/dll/win32/gdi32/objects/region.c index 6c6f4706a8f..e32abac26f0 100644 --- a/reactos/dll/win32/gdi32/objects/region.c +++ b/reactos/dll/win32/gdi32/objects/region.c @@ -240,6 +240,17 @@ GetClipRgn( return Ret; } +/* + * @implemented + */ +int +STDCALL +GetMetaRgn(HDC hdc, + HRGN hrgn) +{ + return NtGdiGetRandomRgn(hdc,hrgn,2); +} + /* * @implemented */ @@ -313,3 +324,28 @@ SetRectRgn(HRGN hrgn, #endif } +/* + * @implemented + */ +int +STDCALL +SetMetaRgn( HDC hDC ) +{ + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_DC) + return NtGdiSetMetaRgn(hDC); +#if 0 + PLDC pLDC = GdiGetLDC(hDC); + if ( pLDC && GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_METADC ) + { + if (pLDC->iType == LDC_EMFLDC || EMFDRV_SetMetaRgn(hDC)) + { + return NtGdiSetMetaRgn(hDC); + } + else + SetLastError(ERROR_INVALID_HANDLE); + } +#endif + return 0; +} + + diff --git a/reactos/include/reactos/win32k/ntgdityp.h b/reactos/include/reactos/win32k/ntgdityp.h index 7dcc3333eff..a0db30d156f 100644 --- a/reactos/include/reactos/win32k/ntgdityp.h +++ b/reactos/include/reactos/win32k/ntgdityp.h @@ -357,6 +357,16 @@ typedef struct _PATRECT RECT r; HBRUSH hBrush; } PATRECT, * PPATRECT; + +typedef struct _W32CLIENTINFO +{ + ULONG CI_flags; + ULONG cSpins; + ULONG ulWindowsVersion; + ULONG ulAppCompatFlags; + ULONG ulAppCompatFlags2; + ULONG W32ClientInfo[57]; +} W32CLIENTINFO, *PW32CLIENTINFO; #endif typedef struct _GDIBSPPATBLT