Implement NtGdiGetSystemPaletteUse and NtGdiSetSystemPaletteUse

this code have been taken from wine 

svn path=/trunk/; revision=15549
This commit is contained in:
Magnus Olsen 2005-05-27 20:07:48 +00:00
parent 0b6337b3d8
commit c44e26473a
2 changed files with 32 additions and 5 deletions

View file

@ -31,6 +31,9 @@ static HPALETTE hPrimaryPalette = 0; // used for WM_PALETTECHANGED
#endif #endif
//static HPALETTE hLastRealizedPalette = 0; // UnrealizeObject() needs it //static HPALETTE hLastRealizedPalette = 0; // UnrealizeObject() needs it
static UINT SystemPaletteUse = SYSPAL_STATIC; /* currently not considered */
const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] = const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] =
{ {
// first 10 entries in the system palette // first 10 entries in the system palette
@ -286,9 +289,8 @@ UINT STDCALL NtGdiGetSystemPaletteEntries(HDC hDC,
} }
UINT STDCALL NtGdiGetSystemPaletteUse(HDC hDC) UINT STDCALL NtGdiGetSystemPaletteUse(HDC hDC)
{ {
DPRINT1("NtGdiGetSystemPaletteUse is unimplemented\n"); return SystemPaletteUse;
return 0;
} }
/*! /*!
@ -520,8 +522,27 @@ UINT STDCALL NtGdiSetPaletteEntries(HPALETTE hpal,
UINT STDCALL UINT STDCALL
NtGdiSetSystemPaletteUse(HDC hDC, UINT Usage) NtGdiSetSystemPaletteUse(HDC hDC, UINT Usage)
{ {
UNIMPLEMENTED; UINT old = SystemPaletteUse;
return 0;
/* 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 BOOL STDCALL

View file

@ -8,6 +8,12 @@
extern "C" { extern "C" {
#endif #endif
/* Get/SetSystemPaletteUse() values */
#define SYSPAL_ERROR 0
#define SYSPAL_STATIC 1
#define SYSPAL_NOSTATIC 2
#define SYSPAL_NOSTATIC256 3
#define WINGDIAPI #define WINGDIAPI
#define BI_RGB 0 #define BI_RGB 0
#define BI_RLE8 1 #define BI_RLE8 1