gdi32: Add a null driver entry point for UnrealizePalette.
This commit is contained in:
parent
31e6f4bc0d
commit
2c16ab2ae2
|
@ -714,6 +714,11 @@ static BOOL CDECL nulldrv_SwapBuffers( PHYSDEV dev )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL CDECL nulldrv_UnrealizePalette( HPALETTE palette )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static BOOL CDECL nulldrv_wglCopyContext( HGLRC ctx_src, HGLRC ctx_dst, UINT mask )
|
static BOOL CDECL nulldrv_wglCopyContext( HGLRC ctx_src, HGLRC ctx_dst, UINT mask )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -895,7 +900,7 @@ const DC_FUNCTIONS null_driver =
|
||||||
nulldrv_StrokeAndFillPath, /* pStrokeAndFillPath */
|
nulldrv_StrokeAndFillPath, /* pStrokeAndFillPath */
|
||||||
nulldrv_StrokePath, /* pStrokePath */
|
nulldrv_StrokePath, /* pStrokePath */
|
||||||
nulldrv_SwapBuffers, /* pSwapBuffers */
|
nulldrv_SwapBuffers, /* pSwapBuffers */
|
||||||
NULL, /* pUnrealizePalette */
|
nulldrv_UnrealizePalette, /* pUnrealizePalette */
|
||||||
nulldrv_WidenPath, /* pWidenPath */
|
nulldrv_WidenPath, /* pWidenPath */
|
||||||
nulldrv_wglCopyContext, /* pwglCopyContext */
|
nulldrv_wglCopyContext, /* pwglCopyContext */
|
||||||
nulldrv_wglCreateContext, /* pwglCreateContext */
|
nulldrv_wglCreateContext, /* pwglCreateContext */
|
||||||
|
|
|
@ -38,10 +38,12 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(palette);
|
WINE_DEFAULT_DEBUG_CHANNEL(palette);
|
||||||
|
|
||||||
|
typedef BOOL (CDECL *unrealize_function)(HPALETTE);
|
||||||
|
|
||||||
typedef struct tagPALETTEOBJ
|
typedef struct tagPALETTEOBJ
|
||||||
{
|
{
|
||||||
GDIOBJHDR header;
|
GDIOBJHDR header;
|
||||||
const DC_FUNCTIONS *funcs; /* DC function table */
|
unrealize_function unrealize;
|
||||||
WORD version; /* palette version */
|
WORD version; /* palette version */
|
||||||
WORD count; /* count of palette entries */
|
WORD count; /* count of palette entries */
|
||||||
PALETTEENTRY *entries;
|
PALETTEENTRY *entries;
|
||||||
|
@ -152,7 +154,7 @@ HPALETTE WINAPI CreatePalette(
|
||||||
size = sizeof(LOGPALETTE) + (palette->palNumEntries - 1) * sizeof(PALETTEENTRY);
|
size = sizeof(LOGPALETTE) + (palette->palNumEntries - 1) * sizeof(PALETTEENTRY);
|
||||||
|
|
||||||
if (!(palettePtr = HeapAlloc( GetProcessHeap(), 0, sizeof(*palettePtr) ))) return 0;
|
if (!(palettePtr = HeapAlloc( GetProcessHeap(), 0, sizeof(*palettePtr) ))) return 0;
|
||||||
palettePtr->funcs = NULL;
|
palettePtr->unrealize = NULL;
|
||||||
palettePtr->version = palette->palVersion;
|
palettePtr->version = palette->palVersion;
|
||||||
palettePtr->count = palette->palNumEntries;
|
palettePtr->count = palette->palNumEntries;
|
||||||
size = palettePtr->count * sizeof(*palettePtr->entries);
|
size = palettePtr->count * sizeof(*palettePtr->entries);
|
||||||
|
@ -410,7 +412,6 @@ BOOL WINAPI AnimatePalette(
|
||||||
PALETTEOBJ * palPtr;
|
PALETTEOBJ * palPtr;
|
||||||
UINT pal_entries;
|
UINT pal_entries;
|
||||||
const PALETTEENTRY *pptr = PaletteColors;
|
const PALETTEENTRY *pptr = PaletteColors;
|
||||||
const DC_FUNCTIONS *funcs;
|
|
||||||
|
|
||||||
palPtr = GDI_GetObjPtr( hPal, OBJ_PAL );
|
palPtr = GDI_GetObjPtr( hPal, OBJ_PAL );
|
||||||
if (!palPtr) return 0;
|
if (!palPtr) return 0;
|
||||||
|
@ -436,9 +437,8 @@ BOOL WINAPI AnimatePalette(
|
||||||
TRACE("Not animating entry %d -- not PC_RESERVED\n", StartIndex);
|
TRACE("Not animating entry %d -- not PC_RESERVED\n", StartIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
funcs = palPtr->funcs;
|
|
||||||
GDI_ReleaseObj( hPal );
|
GDI_ReleaseObj( hPal );
|
||||||
if (funcs && funcs->pRealizePalette) funcs->pRealizePalette( NULL, hPal, hPal == hPrimaryPalette );
|
/* FIXME: check for palette selected in active window */
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -650,10 +650,10 @@ static BOOL PALETTE_UnrealizeObject( HGDIOBJ handle )
|
||||||
|
|
||||||
if (palette)
|
if (palette)
|
||||||
{
|
{
|
||||||
const DC_FUNCTIONS *funcs = palette->funcs;
|
unrealize_function unrealize = palette->unrealize;
|
||||||
palette->funcs = NULL;
|
palette->unrealize = NULL;
|
||||||
GDI_ReleaseObj( handle );
|
GDI_ReleaseObj( handle );
|
||||||
if (funcs && funcs->pUnrealizePalette) funcs->pUnrealizePalette( handle );
|
if (unrealize) unrealize( handle );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InterlockedCompareExchangePointer( (void **)&hLastRealizedPalette, 0, handle ) == handle)
|
if (InterlockedCompareExchangePointer( (void **)&hLastRealizedPalette, 0, handle ) == handle)
|
||||||
|
@ -733,7 +733,7 @@ UINT WINAPI GDIRealizePalette( HDC hdc )
|
||||||
{
|
{
|
||||||
realized = physdev->funcs->pRealizePalette( physdev, dc->hPalette,
|
realized = physdev->funcs->pRealizePalette( physdev, dc->hPalette,
|
||||||
(dc->hPalette == hPrimaryPalette) );
|
(dc->hPalette == hPrimaryPalette) );
|
||||||
palPtr->funcs = dc->funcs;
|
palPtr->unrealize = physdev->funcs->pUnrealizePalette;
|
||||||
GDI_ReleaseObj( dc->hPalette );
|
GDI_ReleaseObj( dc->hPalette );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue