Commit a0b32d7c authored by Alexandre Julliard's avatar Alexandre Julliard

Added internal 32-bit versions of GDISelectPalette and

GDIRealizePalette.
parent 0e79a412
......@@ -21,6 +21,7 @@
#include "winbase.h"
#include "wingdi.h"
#include "wine/wingdi16.h"
#include "gdi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(gdi);
......@@ -1594,6 +1595,24 @@ HPALETTE16 WINAPI CreatePalette16( const LOGPALETTE* palette )
/***********************************************************************
* GDISelectPalette (GDI.361)
*/
HPALETTE16 WINAPI GDISelectPalette16( HDC16 hdc, HPALETTE16 hpalette, WORD wBkg )
{
return HPALETTE_16( GDISelectPalette( HDC_32(hdc), HPALETTE_32(hpalette), wBkg ));
}
/***********************************************************************
* GDIRealizePalette (GDI.362)
*/
UINT16 WINAPI GDIRealizePalette16( HDC16 hdc )
{
return GDIRealizePalette( HDC_32(hdc) );
}
/***********************************************************************
* GetPaletteEntries (GDI.363)
*/
UINT16 WINAPI GetPaletteEntries16( HPALETTE16 hpalette, UINT16 start,
......
......@@ -455,6 +455,10 @@ extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCSTR filename);
/* region.c */
extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT x, INT y );
/* palette.c */
extern HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg);
extern UINT WINAPI GDIRealizePalette( HDC hdc );
#define WINE_GGO_GRAY16_BITMAP 0x7f
#endif /* __WINE_GDI_H */
......@@ -433,7 +433,7 @@ void WINAPI SetDCState16( HDC16 hdc, HDC16 hdcs )
SelectObject( hdc, dcs->hPen );
SetBkColor( hdc, dcs->backgroundColor);
SetTextColor( hdc, dcs->textColor);
GDISelectPalette16( hdc, dcs->hPalette, FALSE );
GDISelectPalette( hdc, dcs->hPalette, FALSE );
GDI_ReleaseObj( hdcs );
GDI_ReleaseObj( hdc );
}
......
......@@ -53,8 +53,8 @@ static const struct gdi_obj_funcs palette_funcs =
/* Pointers to USER implementation of SelectPalette/RealizePalette */
/* they will be patched by USER on startup */
FARPROC pfnSelectPalette = NULL;
FARPROC pfnRealizePalette = NULL;
HPALETTE (WINAPI *pfnSelectPalette)(HDC hdc, HPALETTE hpal, WORD bkgnd ) = NULL;
UINT (WINAPI *pfnRealizePalette)(HDC hdc) = NULL;
static UINT SystemPaletteUse = SYSPAL_STATIC; /* currently not considered */
......@@ -657,11 +657,11 @@ static BOOL PALETTE_DeleteObject( HGDIOBJ handle, void *obj )
/***********************************************************************
* GDISelectPalette (GDI.361)
* GDISelectPalette (Not a Windows API)
*/
HPALETTE16 WINAPI GDISelectPalette16( HDC16 hdc, HPALETTE16 hpal, WORD wBkg)
HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg)
{
HPALETTE16 prev;
HPALETTE prev;
DC *dc;
TRACE("%04x %04x\n", hdc, hpal );
......@@ -681,9 +681,9 @@ HPALETTE16 WINAPI GDISelectPalette16( HDC16 hdc, HPALETTE16 hpal, WORD wBkg)
/***********************************************************************
* GDIRealizePalette (GDI.362)
* GDIRealizePalette (Not a Windows API)
*/
UINT16 WINAPI GDIRealizePalette16( HDC16 hdc )
UINT WINAPI GDIRealizePalette( HDC hdc )
{
UINT realized = 0;
DC* dc = DC_GetDCPtr( hdc );
......@@ -694,11 +694,10 @@ UINT16 WINAPI GDIRealizePalette16( HDC16 hdc )
if( dc->hPalette == GetStockObject( DEFAULT_PALETTE ))
{
GDI_ReleaseObj( hdc );
return RealizeDefaultPalette16( hdc );
if (dc->funcs->pRealizeDefaultPalette)
realized = dc->funcs->pRealizeDefaultPalette( dc->physDev );
}
if(dc->hPalette != hLastRealizedPalette )
else if(dc->hPalette != hLastRealizedPalette )
{
if (dc->funcs->pRealizePalette)
realized = dc->funcs->pRealizePalette( dc->physDev, dc->hPalette,
......@@ -707,10 +706,10 @@ UINT16 WINAPI GDIRealizePalette16( HDC16 hdc )
pLastRealizedDC = dc->funcs;
}
else TRACE(" skipping (hLastRealizedPalette = %04x)\n", hLastRealizedPalette);
GDI_ReleaseObj( hdc );
GDI_ReleaseObj( hdc );
TRACE(" realized %i colors.\n", realized );
return (UINT16)realized;
return realized;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment