--- trunk/reactos/subsys/win32k/objects/color.c 2005-05-27 19:43:07 UTC (rev 15548)
+++ trunk/reactos/subsys/win32k/objects/color.c 2005-05-27 20:07:48 UTC (rev 15549)
@@ -31,6 +31,9 @@
#endif
//static HPALETTE hLastRealizedPalette = 0; // UnrealizeObject() needs it
+
+static UINT SystemPaletteUse = SYSPAL_STATIC; /* currently not considered */
+
const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] =
{
// first 10 entries in the system palette
@@ -286,9 +289,8 @@
}
UINT STDCALL NtGdiGetSystemPaletteUse(HDC hDC)
-{
- DPRINT1("NtGdiGetSystemPaletteUse is unimplemented\n");
- return 0;
+{
+ return SystemPaletteUse;
}
/*!
@@ -520,8 +522,27 @@
UINT STDCALL
NtGdiSetSystemPaletteUse(HDC hDC, UINT Usage)
{
- UNIMPLEMENTED;
- return 0;
+ UINT old = SystemPaletteUse;
+
+ /* Device doesn't support colour palettes */
+ if (!(NtGdiGetDeviceCaps(hDC, RASTERCAPS) & RC_PALETTE)) {
+ return SYSPAL_ERROR;
+ }
+
+ switch (Usage)
+ {
+ case SYSPAL_NOSTATIC:
+ case SYSPAL_NOSTATIC256:
+ case SYSPAL_STATIC:
+ SystemPaletteUse = Usage;
+ break;
+
+ default:
+ old=SYSPAL_ERROR;
+ break;
+ }
+
+ return old;
}
BOOL STDCALL
--- trunk/reactos/w32api/include/wingdi.h 2005-05-27 19:43:07 UTC (rev 15548)
+++ trunk/reactos/w32api/include/wingdi.h 2005-05-27 20:07:48 UTC (rev 15549)
@@ -8,6 +8,12 @@
extern "C" {
#endif
+/* Get/SetSystemPaletteUse() values */
+#define SYSPAL_ERROR 0
+#define SYSPAL_STATIC 1
+#define SYSPAL_NOSTATIC 2
+#define SYSPAL_NOSTATIC256 3
+
#define WINGDIAPI
#define BI_RGB 0
#define BI_RLE8 1