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
//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
@ -287,8 +290,7 @@ UINT STDCALL NtGdiGetSystemPaletteEntries(HDC hDC,
UINT STDCALL NtGdiGetSystemPaletteUse(HDC hDC)
{
DPRINT1("NtGdiGetSystemPaletteUse is unimplemented\n");
return 0;
return SystemPaletteUse;
}
/*!
@ -520,8 +522,27 @@ UINT STDCALL NtGdiSetPaletteEntries(HPALETTE hpal,
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

View file

@ -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