mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 09:13:37 +00:00
Extended SetSystemPaletteUse to deal with error conditions.
This commit is contained in:
parent
043680c140
commit
6f929659bd
|
@ -1386,10 +1386,11 @@ typedef struct
|
|||
#define TT_POLYGON_TYPE 24
|
||||
|
||||
/* Get/SetSystemPaletteUse() values */
|
||||
#define SYSPAL_ERROR 0
|
||||
#define SYSPAL_STATIC 1
|
||||
#define SYSPAL_NOSTATIC 2
|
||||
|
||||
#define SYSPAL_ERROR 0
|
||||
#define SYSPAL_STATIC 1
|
||||
#define SYSPAL_NOSTATIC 2
|
||||
#define SYSPAL_NOSTATIC256 3
|
||||
|
||||
#ifndef _PALETTEENTRY_DEFINED
|
||||
#define _PALETTEENTRY_DEFINED
|
||||
typedef struct tagPALETTEENTRY
|
||||
|
|
|
@ -454,9 +454,21 @@ UINT WINAPI SetSystemPaletteUse(
|
|||
UINT use) /* [in] Palette-usage flag */
|
||||
{
|
||||
UINT old = SystemPaletteUse;
|
||||
FIXME("(%p,%04x): stub\n", hdc, use );
|
||||
SystemPaletteUse = use;
|
||||
return old;
|
||||
|
||||
/* Device doesn't support colour palettes */
|
||||
if (!(GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE)) {
|
||||
return SYSPAL_ERROR;
|
||||
}
|
||||
|
||||
switch (use) {
|
||||
case SYSPAL_NOSTATIC:
|
||||
case SYSPAL_NOSTATIC256: /* WINVER >= 0x0500 */
|
||||
case SYSPAL_STATIC:
|
||||
SystemPaletteUse = use;
|
||||
return old;
|
||||
default:
|
||||
return SYSPAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue