Hello! License: LGPL, X11 Changelog: Michael Stefaniuc <mstefani@redhat.com> - Convert HPALETTE to a void* bye michael -- Michael Stefaniuc Tel.: +49-711-96437-199 System Administration Fax.: +49-711-96437-111 Red Hat GmbH Email: mstefani@redhat.com Hauptstaetterstr. 58 http://www.redhat.de/ D-70178 Stuttgart
Index: dlls/msvideo/drawdib.c =================================================================== RCS file: /home/wine/wine/dlls/msvideo/drawdib.c,v retrieving revision 1.13 diff -u -r1.13 drawdib.c --- dlls/msvideo/drawdib.c 31 May 2002 23:25:49 -0000 1.13 +++ dlls/msvideo/drawdib.c 15 Aug 2002 19:05:56 -0000 @@ -414,7 +414,7 @@ * DrawDibSetPalette [MSVIDEO.110] */ BOOL16 VFWAPI DrawDibSetPalette16(HDRAWDIB16 hdd, HPALETTE16 hpal) { - return DrawDibSetPalette(hdd,hpal); + return DrawDibSetPalette(hdd, HPALETTE_32(hpal)); } /*********************************************************************** @@ -436,7 +436,7 @@ * DrawDibGetPalette [MSVIDEO.108] */ HPALETTE16 VFWAPI DrawDibGetPalette16(HDRAWDIB16 hdd) { - return (HPALETTE16)DrawDibGetPalette(hdd); + return HPALETTE_16(DrawDibGetPalette(hdd)); } /*********************************************************************** Index: dlls/msvideo/vfw16.h =================================================================== RCS file: /home/wine/wine/dlls/msvideo/vfw16.h,v retrieving revision 1.3 diff -u -r1.3 vfw16.h --- dlls/msvideo/vfw16.h 9 Mar 2002 23:39:09 -0000 1.3 +++ dlls/msvideo/vfw16.h 15 Aug 2002 19:05:56 -0000 @@ -117,6 +117,10 @@ HIC16 VFWAPI ICOpenFunction16(DWORD,DWORD,UINT16,FARPROC16); LRESULT VFWAPI ICSendMessage16(HIC16,UINT16,DWORD,DWORD); +/* handle <-> handle16 conversions */ +#define HPALETTE_32(h16) ((HPALETTE)(ULONG_PTR)(h16)) +#define HPALETTE_16(h32) (LOWORD(h32)) + #ifdef __cplusplus } #endif /* __cplusplus */ Index: graphics/x11drv/palette.c =================================================================== RCS file: /home/wine/wine/graphics/x11drv/palette.c,v retrieving revision 1.34 diff -u -r1.34 palette.c --- graphics/x11drv/palette.c 2 Jun 2002 21:40:24 -0000 1.34 +++ graphics/x11drv/palette.c 15 Aug 2002 19:05:59 -0000 @@ -829,7 +829,7 @@ { DC *dc = physDev ? physDev->dc : NULL; WORD index = 0; - HPALETTE16 hPal = (dc)? dc->hPalette: GetStockObject(DEFAULT_PALETTE); + HPALETTE hPal = (dc)? dc->hPalette: GetStockObject(DEFAULT_PALETTE); unsigned char spec_type = color >> 24; PALETTEOBJ* palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hPal, PALETTE_MAGIC ); Index: include/windef.h =================================================================== RCS file: /home/wine/wine/include/windef.h,v retrieving revision 1.68 diff -u -r1.68 windef.h --- include/windef.h 29 Jul 2002 00:14:59 -0000 1.68 +++ include/windef.h 15 Aug 2002 19:05:59 -0000 @@ -87,7 +87,7 @@ DECLARE_OLD_HANDLE(HMENU); DECLARE_HANDLE(HMETAFILE); DECLARE_HANDLE(HMONITOR); -DECLARE_OLD_HANDLE(HPALETTE); +DECLARE_HANDLE(HPALETTE); DECLARE_OLD_HANDLE(HPEN); DECLARE_OLD_HANDLE(HRGN); DECLARE_OLD_HANDLE(HRSRC); Index: objects/dc.c =================================================================== RCS file: /home/wine/wine/objects/dc.c,v retrieving revision 1.79 diff -u -r1.79 dc.c --- objects/dc.c 2 Aug 2002 01:01:09 -0000 1.79 +++ objects/dc.c 15 Aug 2002 19:05:59 -0000 @@ -33,6 +33,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(dc); +#define HPALETTE_16(h32) (LOWORD(h32)) + /* ### start build ### */ extern WORD CALLBACK GDI_CallTo16_word_wwll(FARPROC16,WORD,WORD,LONG,LONG); /* ### stop build ### */ @@ -433,7 +435,7 @@ SelectObject( hdc, dcs->hPen ); SetBkColor( hdc, dcs->backgroundColor); SetTextColor( hdc, dcs->textColor); - GDISelectPalette16( hdc, dcs->hPalette, FALSE ); + GDISelectPalette16( hdc, HPALETTE_16(dcs->hPalette), FALSE ); GDI_ReleaseObj( hdcs ); GDI_ReleaseObj( hdc ); } Index: objects/palette.c =================================================================== RCS file: /home/wine/wine/objects/palette.c,v retrieving revision 1.47 diff -u -r1.47 palette.c --- objects/palette.c 31 Jul 2002 19:26:05 -0000 1.47 +++ objects/palette.c 15 Aug 2002 19:05:59 -0000 @@ -37,6 +37,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(palette); +/* handle <-> handle16 conversions */ +#define HPALETTE_32(h16) ((HPALETTE)(ULONG_PTR)(h16)) +#define HPALETTE_16(h32) (LOWORD(h32)) + static INT PALETTE_GetObject( HGDIOBJ handle, void *obj, INT count, LPVOID buffer ); static BOOL PALETTE_UnrealizeObject( HGDIOBJ handle, void *obj ); static BOOL PALETTE_DeleteObject( HGDIOBJ handle, void *obj ); @@ -144,7 +148,7 @@ */ HPALETTE16 WINAPI CreatePalette16( const LOGPALETTE* palette ) { - return CreatePalette( palette ); + return HPALETTE_16(CreatePalette( palette )); } @@ -190,7 +194,7 @@ HPALETTE16 WINAPI CreateHalftonePalette16( HDC16 hdc) /* [in] Handle to device context */ { - return CreateHalftonePalette(hdc); + return HPALETTE_16(CreateHalftonePalette(hdc)); } @@ -295,7 +299,7 @@ UINT16 WINAPI GetPaletteEntries16( HPALETTE16 hpalette, UINT16 start, UINT16 count, LPPALETTEENTRY entries ) { - return GetPaletteEntries( hpalette, start, count, entries ); + return GetPaletteEntries( HPALETTE_32(hpalette), start, count, entries ); } @@ -355,7 +359,7 @@ UINT16 WINAPI SetPaletteEntries16( HPALETTE16 hpalette, UINT16 start, UINT16 count, const PALETTEENTRY *entries ) { - return SetPaletteEntries( hpalette, start, count, entries ); + return SetPaletteEntries( HPALETTE_32(hpalette), start, count, entries ); } @@ -403,7 +407,7 @@ */ BOOL16 WINAPI ResizePalette16( HPALETTE16 hPal, UINT16 cEntries ) { - return ResizePalette( hPal, cEntries ); + return ResizePalette( HPALETTE_32(hPal), cEntries ); } @@ -470,7 +474,7 @@ void WINAPI AnimatePalette16( HPALETTE16 hPal, UINT16 StartIndex, UINT16 NumEntries, const PALETTEENTRY* PaletteColors) { - AnimatePalette( hPal, StartIndex, NumEntries, PaletteColors ); + AnimatePalette( HPALETTE_32(hPal), StartIndex, NumEntries, PaletteColors ); } @@ -595,7 +599,7 @@ */ UINT16 WINAPI GetNearestPaletteIndex16( HPALETTE16 hpalette, COLORREF color ) { - return GetNearestPaletteIndex( hpalette, color ); + return GetNearestPaletteIndex( HPALETTE_32(hpalette), color ); } @@ -767,20 +771,21 @@ /*********************************************************************** * GDISelectPalette (GDI.361) */ -HPALETTE16 WINAPI GDISelectPalette16( HDC16 hdc, HPALETTE16 hpal, WORD wBkg) +HPALETTE16 WINAPI GDISelectPalette16( HDC16 hdc, HPALETTE16 hpal16, WORD wBkg) { + HPALETTE hpal = HPALETTE_32(hpal16); HPALETTE16 prev; DC *dc; - TRACE("%04x %04x\n", hdc, hpal ); + TRACE("%04x %04x\n", hdc, hpal16 ); if (GetObjectType(hpal) != OBJ_PAL) { - WARN("invalid selected palette %04x\n",hpal); + WARN("invalid selected palette %08x\n",hpal); return 0; } if (!(dc = DC_GetDCPtr( hdc ))) return 0; - prev = dc->hPalette; + prev = HPALETTE_16(dc->hPalette); dc->hPalette = hpal; GDI_ReleaseObj( hdc ); if (!wBkg) hPrimaryPalette = hpal; @@ -867,7 +872,7 @@ HPALETTE hPal, /* [in] Handle of logical color palette */ BOOL bForceBackground) /* [in] Foreground/background mode */ { - return pfnSelectPalette( hDC, hPal, bForceBackground ); + return (HPALETTE) pfnSelectPalette( hDC, hPal, bForceBackground ); } Index: dlls/msvideo/msvideo_main.c =================================================================== RCS file: /home/wine/wine/dlls/msvideo/msvideo_main.c,v retrieving revision 1.35 diff -u -r1.35 msvideo_main.c --- dlls/msvideo/msvideo_main.c 9 Aug 2002 01:02:25 -0000 1.35 +++ dlls/msvideo/msvideo_main.c 15 Aug 2002 20:45:12 -0000 @@ -765,7 +765,7 @@ ret = icdb16; COPY(icdb,dwFlags); - COPY(icdb,hpal); + icdb->hpal = HPALETTE_32(icdb16->hpal); COPY(icdb,hwnd); COPY(icdb,hdc); COPY(icdb,xDst);
Attachment:
pgp00034.pgp
Description: PGP signature