WinG fixes.

This commit is contained in:
Brad Pepers 1999-02-09 15:37:16 +00:00 committed by Alexandre Julliard
parent b3a99de50d
commit 0bdff36d38
7 changed files with 228 additions and 225 deletions

View file

@ -18,9 +18,12 @@
#include "x11drv.h" #include "x11drv.h"
#include "bitmap.h" #include "bitmap.h"
#include "palette.h"
#include "dc.h" #include "dc.h"
#include "debug.h" #include "debug.h"
#include "gdi.h" #include "gdi.h"
#include "heap.h"
#include "selectors.h"
#include "monitor.h" #include "monitor.h"
#include "wintypes.h" #include "wintypes.h"
#include "xmalloc.h" #include "xmalloc.h"
@ -30,8 +33,6 @@ typedef enum WING_DITHER_TYPE
WING_DISPERSED_4x4, WING_DISPERSED_8x8, WING_CLUSTERED_4x4 WING_DISPERSED_4x4, WING_DISPERSED_8x8, WING_CLUSTERED_4x4
} WING_DITHER_TYPE; } WING_DITHER_TYPE;
static int __WinGOK = -1;
/* /*
* WinG DIB bitmaps can be selected into DC and then scribbled upon * WinG DIB bitmaps can be selected into DC and then scribbled upon
* by GDI functions. They can also be changed directly. This gives us * by GDI functions. They can also be changed directly. This gives us
@ -45,198 +46,85 @@ static int __WinGOK = -1;
* 961208 - AK * 961208 - AK
*/ */
static BITMAPINFOHEADER __bmpiWinG = { 0, 1, -1, 1, 8, BI_RGB, 1, 0, 0, 0, 0 };
static void __initWinG(void)
{
if( __WinGOK < 0 )
{
#ifdef HAVE_LIBXXSHM
Status s = TSXShmQueryExtension(display);
if( s )
{
int i = TSXShmPixmapFormat(display);
if( i == ZPixmap && MONITOR_GetDepth(&MONITOR_PrimaryMonitor) == 8 )
{
__WinGOK = 1;
return;
}
}
#endif /* defined(HAVE_LIBXXSHM) */
FIXME(wing,"WinG: incorrect depth or unsupported card.\n");
__WinGOK = 0;
}
}
/*********************************************************************** /***********************************************************************
* WinGCreateDC16 (WING.1001) * WinGCreateDC16 (WING.1001)
*/ */
HDC16 WINAPI WinGCreateDC16(void) HDC16 WINAPI WinGCreateDC16(void)
{ {
__initWinG(); TRACE(wing, "(void)\n");
if( __WinGOK > 0 )
return CreateCompatibleDC16(0); return CreateCompatibleDC16(0);
return (HDC16)NULL;
} }
/*********************************************************************** /***********************************************************************
* WinGRecommendDIBFormat16 (WING.1002) * WinGRecommendDIBFormat16 (WING.1002)
*/ */
BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *fmt) BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *bmpi)
{ {
FIXME(wing,"(%p): stub\n", fmt); TRACE(wing, "(%p)\n", bmpi);
if (!bmpi)
return FALSE;
bmpi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmpi->bmiHeader.biWidth = 320;
bmpi->bmiHeader.biHeight = -1;
bmpi->bmiHeader.biPlanes = 1;
bmpi->bmiHeader.biBitCount = MONITOR_GetDepth(&MONITOR_PrimaryMonitor);
bmpi->bmiHeader.biCompression = BI_RGB;
bmpi->bmiHeader.biSizeImage = 0;
bmpi->bmiHeader.biXPelsPerMeter = 0;
bmpi->bmiHeader.biYPelsPerMeter = 0;
bmpi->bmiHeader.biClrUsed = 0;
bmpi->bmiHeader.biClrImportant = 0;
if( __WinGOK > 0 && fmt )
{
memcpy(&fmt->bmiHeader, &__bmpiWinG, sizeof(BITMAPINFOHEADER));
return TRUE; return TRUE;
} }
return FALSE;
}
/*********************************************************************** /***********************************************************************
* WinGCreateBitmap16 (WING.1003) * WinGCreateBitmap16 (WING.1003)
*/ */
HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header, HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 hdc, BITMAPINFO *bmpi,
void **bits) SEGPTR *bits)
{ {
FIXME(wing,"(%x,%p,%p): empty stub! (expect failure)\n", TRACE(wing, "(%d,%p,%p)\n", hdc, bmpi, bits);
winDC, header, bits); TRACE(wing, ": create %ldx%ldx%d bitmap\n", bmpi->bmiHeader.biWidth,
if( __WinGOK > 0 && header ) bmpi->bmiHeader.biHeight, bmpi->bmiHeader.biPlanes);
{ return CreateDIBSection16(hdc, bmpi, 0, bits, 0, 0);
BITMAPINFOHEADER* bmpi = &header->bmiHeader;
FIXME(wing,"bytes=%i,planes=%i,bpp=%i,x=%i,y=%i,rle=0x%08x,size=%i\n",
(int)bmpi->biSize, bmpi->biPlanes, bmpi->biBitCount,
(int)bmpi->biWidth, (int)bmpi->biHeight,
(unsigned)bmpi->biCompression, (int)bmpi->biSizeImage);
#ifdef PRELIMINARY_WING16_SUPPORT
if( bmpi->biPlanes == __bmpiWinG.biPlanes && bmpi->biBitCount == __bmpiWinG.biBitCount &&
bmpi->biCompression == __bmpiWinG.biCompression && (int)bmpi->biHeight < 0 &&
bmpi->biWidth )
{
unsigned bytes = (bmpi->biWidth + bmpi->biWidth % 2)*(-bmpi->biHeight) * bmpi->biBitCount/8;
int key = shmget(IPC_PRIVATE, bytes, IPC_CREAT | 0x01FF);
if( key )
{
/* Create the BITMAPOBJ
*
* FIXME: A facility to manage shared memory structures
* which would clean up when Wine crashes. Perhaps a part of
* IPC code can be adapted. Otherwise this code leaves a lot
* of junk in shared memory.
*/
HBITMAP16 hbitmap = GDI_AllocObject( sizeof(BITMAPOBJ), BITMAP_MAGIC );
if (hbitmap)
{
#ifdef HAVE_LIBXXSHM
__ShmBitmapCtl* p = (__ShmBitmapCtl*)xmalloc(sizeof(__ShmBitmapCtl));
#endif /* defined(HAVE_LIBXXSHM) */
BITMAPOBJ* bmpObjPtr = (BITMAPOBJ *) GDI_HEAP_LOCK( hbitmap );
bmpObjPtr->size.cx = 0;
bmpObjPtr->size.cy = 0;
bmpObjPtr->bitmap.bmType = 0;
bmpObjPtr->bitmap.bmWidth = (INT16)abs(bmpi->biWidth);
bmpObjPtr->bitmap.bmHeight = -(INT16)bmpi->biHeight;
bmpObjPtr->bitmap.bmPlanes = (BYTE)bmpi->biPlanes;
bmpObjPtr->bitmap.bmBitsPixel = (BYTE)bmpi->biBitCount;
bmpObjPtr->bitmap.bmWidthBytes =
(INT16)BITMAP_WIDTH_BYTES( bmpObjPtr->bitmap.bmWidth, bmpi->biBitCount );
#ifdef HAVE_LIBXXSHM
bmpObjPtr->bitmap.bmBits = (SEGPTR)p;
p->si.shmid = key;
p->si.shmaddr = shmat(key, NULL, 0);
p->si.readOnly = False;
if( p->si.shmaddr )
{
WORD sel = 0;
TSXShmAttach(display, &p->si);
bmpObjPtr->pixmap = TSXShmCreatePixmap(display, rootWindow,
p->si.shmaddr, &p->si, bmpObjPtr->bitmap.bmWidth,
bmpObjPtr->bitmap.bmHeight, bmpi->biBitCount );
if( bmpObjPtr->pixmap )
{
sel = SELECTOR_AllocBlock( p->si.shmaddr, bytes,
SEGMENT_DATA, FALSE, FALSE);
if (sel) p->bits = PTR_SEG_OFF_TO_SEGPTR(sel,0);
else TSXFreePixmap( display, bmpObjPtr->pixmap );
}
if( !sel )
{
shmdt( p->si.shmaddr );
p->si.shmaddr = NULL;
}
} }
if( !p->si.shmaddr )
{
GDI_FreeObject( hbitmap );
hbitmap = 0;
}
#else /* defined(HAVE_LIBXXSHM) */
bmpObjPtr->bitmap.bmBits = (SEGPTR) NULL;
bmpObjPtr->pixmap = NULL;
#endif /* defined(HAVE_LIBXXSHM) */
}
GDI_HEAP_UNLOCK( hbitmap );
return hbitmap;
}
}
#endif /* defined(PRELIMINARY_WING16_SUPPORT) */
}
return 0;
}
/*********************************************************************** /***********************************************************************
* WinGGetDIBPointer (WING.1004) * WinGGetDIBPointer (WING.1004)
*/ */
SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi) SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi)
{ {
#ifdef PRELIMINARY_WING16_SUPPORT
#ifdef HAVE_LIBXXSHM
BITMAPOBJ* bmp = (BITMAPOBJ *) GDI_GetObjPtr( hWinGBitmap, BITMAP_MAGIC ); BITMAPOBJ* bmp = (BITMAPOBJ *) GDI_GetObjPtr( hWinGBitmap, BITMAP_MAGIC );
if( bmp ) TRACE(wing, "(%d,%p)\n", hWinGBitmap, bmpi);
{ if (!bmp) return (SEGPTR)NULL;
__ShmBitmapCtl* p = (__ShmBitmapCtl*)bmp->bitmap.bmBits;
if( p ) if (bmpi)
{ FIXME(wing, ": Todo - implement setting BITMAPINFO\n");
if( bmpi ) memcpy( bmpi, &__bmpiWinG, sizeof(BITMAPINFOHEADER));
GDI_HEAP_UNLOCK( hWinGBitmap ); return PTR_SEG_OFF_TO_SEGPTR(bmp->dib->selector, 0);
return p->bits;
}
}
#endif /* defined(HAVE_LIBXXSHM) */
#endif /* defined(PRELIMINARY_WING16_SUPPORT) */
return (SEGPTR)NULL;
} }
/*********************************************************************** /***********************************************************************
* WinGSetDIBColorTable (WING.1004) * WinGSetDIBColorTable (WING.1004)
*/ */
UINT16 WINAPI WinGSetDIBColorTable16(HDC16 hWinGDC, UINT16 start, UINT16 num, UINT16 WINAPI WinGSetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
RGBQUAD* pColor) RGBQUAD *colors)
{ {
FIXME(wing,"(%x,%d,%d,%p): empty stub!\n",hWinGDC,start,num,pColor); TRACE(wing, "(%d,%d,%d,%p)\n", hdc, start, num, colors);
return num; return SetDIBColorTable16(hdc, start, num, colors);
} }
/*********************************************************************** /***********************************************************************
* WinGGetDIBColorTable16 (WING.1005) * WinGGetDIBColorTable16 (WING.1005)
*/ */
UINT16 WINAPI WinGGetDIBColorTable16(HDC16 winDC, UINT16 start, UINT16 WINAPI WinGGetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
UINT16 num, RGBQUAD* colors) RGBQUAD *colors)
{ {
FIXME(wing,"(%x,%d,%d,%p): empty stub!\n",winDC,start,num,colors); TRACE(wing, "(%d,%d,%d,%p)\n", hdc, start, num, colors);
return 0; return GetDIBColorTable16(hdc, start, num, colors);
} }
/*********************************************************************** /***********************************************************************
@ -244,18 +132,18 @@ UINT16 WINAPI WinGGetDIBColorTable16(HDC16 winDC, UINT16 start,
*/ */
HPALETTE16 WINAPI WinGCreateHalfTonePalette16(void) HPALETTE16 WINAPI WinGCreateHalfTonePalette16(void)
{ {
FIXME(wing,"(void): empty stub!\n"); TRACE(wing, "(void)\n");
return 0; return CreateHalftonePalette16(GetDC16(0));
} }
/*********************************************************************** /***********************************************************************
* WinGCreateHalfToneBrush16 (WING.1008) * WinGCreateHalfToneBrush16 (WING.1008)
*/ */
HPALETTE16 WINAPI WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col, HBRUSH16 WINAPI WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col,
WING_DITHER_TYPE type) WING_DITHER_TYPE type)
{ {
FIXME(wing,"(...): empty stub!\n"); TRACE(wing, "(%d,%ld,%d)\n", winDC, col, type);
return 0; return CreateSolidBrush16(col);
} }
/*********************************************************************** /***********************************************************************
@ -266,8 +154,9 @@ BOOL16 WINAPI WinGStretchBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
HDC16 srcDC, INT16 xSrc, INT16 ySrc, HDC16 srcDC, INT16 xSrc, INT16 ySrc,
INT16 widSrc, INT16 heiSrc) INT16 widSrc, INT16 heiSrc)
{ {
TRACE(wing, "(%d,%d,...)\n", destDC, srcDC);
return StretchBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC, xSrc, ySrc, widSrc, heiSrc, SRCCOPY); return StretchBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC,
xSrc, ySrc, widSrc, heiSrc, SRCCOPY);
} }
/*********************************************************************** /***********************************************************************
@ -277,31 +166,7 @@ BOOL16 WINAPI WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
INT16 widDest, INT16 heiDest, HDC16 srcDC, INT16 widDest, INT16 heiDest, HDC16 srcDC,
INT16 xSrc, INT16 ySrc) INT16 xSrc, INT16 ySrc)
{ {
/* destDC is a display DC, srcDC is a memory DC */ TRACE(wing, "(%d,%d,...)\n", destDC, srcDC);
return BitBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC,
DC *dcDst, *dcSrc; xSrc, ySrc, SRCCOPY);
X11DRV_PDEVICE *physDevDst, *physDevSrc;
if (!(dcDst = (DC *)GDI_GetObjPtr( destDC, DC_MAGIC ))) return FALSE;
if (!(dcSrc = (DC *) GDI_GetObjPtr( srcDC, DC_MAGIC ))) return FALSE;
physDevDst = (X11DRV_PDEVICE *)dcDst->physDev;
physDevSrc = (X11DRV_PDEVICE *)dcSrc->physDev;
if (dcDst->w.flags & DC_DIRTY) CLIPPING_UpdateGCRegion( dcDst );
xSrc = dcSrc->w.DCOrgX + XLPTODP( dcSrc, xSrc );
ySrc = dcSrc->w.DCOrgY + YLPTODP( dcSrc, ySrc );
xDest = dcDst->w.DCOrgX + XLPTODP( dcDst, xDest );
yDest = dcDst->w.DCOrgY + YLPTODP( dcDst, yDest );
widDest = widDest * dcDst->vportExtX / dcDst->wndExtX;
heiDest = heiDest * dcDst->vportExtY / dcDst->wndExtY;
TSXSetFunction( display, physDevDst->gc, GXcopy );
TSXCopyArea( display, physDevSrc->drawable,
physDevDst->drawable, physDevDst->gc,
xSrc, ySrc, widDest, heiDest, xDest, yDest );
return TRUE;
} }

View file

@ -350,7 +350,7 @@ file gdi.exe
526 stub GetMiterLimit 526 stub GetMiterLimit
527 stub SetMiterLimit 527 stub SetMiterLimit
528 stub GDIParametersInfo 528 stub GDIParametersInfo
529 stub CreateHalftonePalette 529 pascal16 CreateHalftonePalette(word) CreateHalftonePalette16
# Stubs for Hebrew version # Stubs for Hebrew version
530 pascal16 GDI_530() stub_GDI_530 530 pascal16 GDI_530() stub_GDI_530
531 pascal16 GDI_531() stub_GDI_531 531 pascal16 GDI_531() stub_GDI_531

View file

@ -27,6 +27,9 @@ typedef struct
/* Cached XImage */ /* Cached XImage */
XImage *image; XImage *image;
/* Selector for 16-bit access to bits */
WORD selector;
} DIBSECTIONOBJ; } DIBSECTIONOBJ;
/* Flags used for BitmapBits. We only use the first two at the moment */ /* Flags used for BitmapBits. We only use the first two at the moment */

View file

@ -24,4 +24,7 @@ extern int PALETTE_GetObject( PALETTEOBJ * palette, int count, LPSTR buffer );
extern BOOL32 PALETTE_DeleteObject( HPALETTE16 hpalette, PALETTEOBJ *palette ); extern BOOL32 PALETTE_DeleteObject( HPALETTE16 hpalette, PALETTEOBJ *palette );
extern BOOL32 PALETTE_UnrealizeObject( HPALETTE16 hpalette, PALETTEOBJ *palette); extern BOOL32 PALETTE_UnrealizeObject( HPALETTE16 hpalette, PALETTEOBJ *palette);
extern HPALETTE16 WINAPI CreateHalftonePalette16(HDC16 hdc);
extern HPALETTE32 WINAPI CreateHalftonePalette32(HDC32 hdc);
#endif /* __WINE_PALETTE_H */ #endif /* __WINE_PALETTE_H */

View file

@ -96,7 +96,125 @@ typedef struct tagCOLORADJUSTMENT
SHORT caColorfulness; SHORT caColorfulness;
SHORT caRedGreenTint; SHORT caRedGreenTint;
} COLORADJUSTMENT, *PCOLORADJUSTMENT, *LPCOLORADJUSTMENT; } COLORADJUSTMENT, *PCOLORADJUSTMENT, *LPCOLORADJUSTMENT;
#define DC_FIELDS 1
#define DC_PAPERS 2
#define DC_PAPERSIZE 3
#define DC_MINEXTENT 4
#define DC_MAXEXTENT 5
#define DC_BINS 6
#define DC_DUPLEX 7
#define DC_SIZE 8
#define DC_EXTRA 9
#define DC_VERSION 10
#define DC_DRIVER 11
#define DC_BINNAMES 12
#define DC_ENUMRESOLUTIONS 13
#define DC_FILEDEPENDENCIES 14
#define DC_TRUETYPE 15
#define DC_PAPERNAMES 16
#define DC_ORIENTATION 17
#define DC_COPIES 18
/* Flag returned from Escape QUERYDIBSUPPORT */
#define QDI_SETDIBITS 1
#define QDI_GETDIBITS 2
#define QDI_DIBTOSCREEN 4
#define QDI_STRETCHDIB 8
#define PR_JOBSTATUS 0x0000
/* GDI Escape commands */
#define NEWFRAME 1
#define ABORTDOC 2
#define NEXTBAND 3
#define SETCOLORTABLE 4
#define GETCOLORTABLE 5
#define FLUSHOUTPUT 6
#define DRAFTMODE 7
#define QUERYESCSUPPORT 8
#define SETABORTPROC 9
#define STARTDOC 10
#define ENDDOC 11
#define GETPHYSPAGESIZE 12
#define GETPRINTINGOFFSET 13
#define GETSCALINGFACTOR 14
#define MFCOMMENT 15
#define GETPENWIDTH 16
#define SETCOPYCOUNT 17
#define SELECTPAPERSOURCE 18
#define DEVICEDATA 19
#define PASSTHROUGH 19
#define GETTECHNOLGY 20
#define GETTECHNOLOGY 20 /* yes, both of them */
#define SETLINECAP 21
#define SETLINEJOIN 22
#define SETMITERLIMIT 23
#define BANDINFO 24
#define DRAWPATTERNRECT 25
#define GETVECTORPENSIZE 26
#define GETVECTORBRUSHSIZE 27
#define ENABLEDUPLEX 28
#define GETSETPAPERBINS 29
#define GETSETPRINTORIENT 30
#define ENUMPAPERBINS 31
#define SETDIBSCALING 32
#define EPSPRINTING 33
#define ENUMPAPERMETRICS 34
#define GETSETPAPERMETRICS 35
#define POSTSCRIPT_DATA 37
#define POSTSCRIPT_IGNORE 38
#define MOUSETRAILS 39
#define GETDEVICEUNITS 42
#define GETEXTENDEDTEXTMETRICS 256
#define GETEXTENTTABLE 257
#define GETPAIRKERNTABLE 258
#define GETTRACKKERNTABLE 259
#define EXTTEXTOUT 512
#define GETFACENAME 513
#define DOWNLOADFACE 514
#define ENABLERELATIVEWIDTHS 768
#define ENABLEPAIRKERNING 769
#define SETKERNTRACK 770
#define SETALLJUSTVALUES 771
#define SETCHARSET 772
#define STRETCHBLT 2048
#define GETSETSCREENPARAMS 3072
#define QUERYDIBSUPPORT 3073
#define BEGIN_PATH 4096
#define CLIP_TO_PATH 4097
#define END_PATH 4098
#define EXT_DEVICE_CAPS 4099
#define RESTORE_CTM 4100
#define SAVE_CTM 4101
#define SET_ARC_DIRECTION 4102
#define SET_BACKGROUND_COLOR 4103
#define SET_POLY_MODE 4104
#define SET_SCREEN_ANGLE 4105
#define SET_SPREAD 4106
#define TRANSFORM_CTM 4107
#define SET_CLIP_BOX 4108
#define SET_BOUNDS 4109
#define SET_MIRROR_MODE 4110
#define OPENCHANNEL 4110
#define DOWNLOADHEADER 4111
#define CLOSECHANNEL 4112
#define POSTSCRIPT_PASSTHROUGH 4115
#define ENCAPSULATED_POSTSCRIPT 4116
/* Spooler Error Codes */
#define SP_NOTREPORTED 0x4000
#define SP_ERROR (-1)
#define SP_APPABORT (-2)
#define SP_USERABORT (-3)
#define SP_OUTOFDISK (-4)
#define SP_OUTOFMEMORY (-5)
/* Raster operations */ /* Raster operations */
#define R2_BLACK 1 #define R2_BLACK 1
@ -1948,6 +2066,12 @@ typedef struct {
DECL_WINELIB_TYPE_AW(NONCLIENTMETRICS) DECL_WINELIB_TYPE_AW(NONCLIENTMETRICS)
DECL_WINELIB_TYPE_AW(LPNONCLIENTMETRICS) DECL_WINELIB_TYPE_AW(LPNONCLIENTMETRICS)
/* Flags for PolyDraw and GetPath */
#define PT_CLOSEFIGURE 0x0001
#define PT_LINETO 0x0002
#define PT_BEZIERTO 0x0004
#define PT_MOVETO 0x0006
#define RDH_RECTANGLES 1 #define RDH_RECTANGLES 1
typedef struct _RGNDATAHEADER { typedef struct _RGNDATAHEADER {
@ -2151,9 +2275,9 @@ HBRUSH16 WINAPI CreateDIBPatternBrush16(HGLOBAL16,UINT16);
HBRUSH32 WINAPI CreateDIBPatternBrush32(HGLOBAL32,UINT32); HBRUSH32 WINAPI CreateDIBPatternBrush32(HGLOBAL32,UINT32);
#define CreateDIBPatternBrush WINELIB_NAME(CreateDIBPatternBrush) #define CreateDIBPatternBrush WINELIB_NAME(CreateDIBPatternBrush)
HBITMAP16 WINAPI CreateDIBSection16 (HDC16, BITMAPINFO *, UINT16, HBITMAP16 WINAPI CreateDIBSection16 (HDC16, BITMAPINFO *, UINT16,
LPVOID **, HANDLE32, DWORD offset); SEGPTR *, HANDLE32, DWORD offset);
HBITMAP32 WINAPI CreateDIBSection32 (HDC32, BITMAPINFO *, UINT32, HBITMAP32 WINAPI CreateDIBSection32 (HDC32, BITMAPINFO *, UINT32,
LPVOID **, HANDLE32, DWORD offset); LPVOID *, HANDLE32, DWORD offset);
#define CreateDIBSection WINELIB_NAME(CreateDIBSection) #define CreateDIBSection WINELIB_NAME(CreateDIBSection)
HBITMAP16 WINAPI CreateDiscardableBitmap16(HDC16,INT16,INT16); HBITMAP16 WINAPI CreateDiscardableBitmap16(HDC16,INT16,INT16);
HBITMAP32 WINAPI CreateDiscardableBitmap32(HDC32,INT32,INT32); HBITMAP32 WINAPI CreateDiscardableBitmap32(HDC32,INT32,INT32);

View file

@ -124,7 +124,21 @@ HPALETTE32 WINAPI CreatePalette32(
/*********************************************************************** /***********************************************************************
* CreateHalftonePalette [GDI32.47] Creates a halftone palette * CreateHalftonePalette16 [GDI.?] Creates a halftone palette
*
* RETURNS
* Success: Handle to logical halftone palette
* Failure: 0
*/
HPALETTE16 WINAPI CreateHalftonePalette16(
HDC16 hdc) /* [in] Handle to device context */
{
return CreateHalftonePalette32(hdc);
}
/***********************************************************************
* CreateHalftonePalette32 [GDI32.47] Creates a halftone palette
* *
* RETURNS * RETURNS
* Success: Handle to logical halftone palette * Success: Handle to logical halftone palette
@ -132,46 +146,40 @@ HPALETTE32 WINAPI CreatePalette32(
* *
* FIXME: not truly tested * FIXME: not truly tested
*/ */
HPALETTE32 WINAPI CreateHalftonePalette(HDC32 hdc) /* [in] Handle to device context */ HPALETTE32 WINAPI CreateHalftonePalette32(
{ int r,g,b,i; HDC32 hdc) /* [in] Handle to device context */
HPALETTE32 hPalette = 0; {
int palNumEntries = 216 + NB_RESERVED_COLORS; int i, r, g, b;
struct {
const PALETTEENTRY* __sysPalTemplate = COLOR_GetSystemPaletteTemplate(); WORD Version;
WORD NumberOfEntries;
PALETTEENTRY aEntries[256];
} Palette = {
0x300, 256
};
LOGPALETTE * pLogPal = (LOGPALETTE*) HeapAlloc( GetProcessHeap(), 0, GetSystemPaletteEntries32(hdc, 0, 256, Palette.aEntries);
sizeof(LOGPALETTE) + (palNumEntries-1)*sizeof(PALETTEENTRY)); return CreatePalette32((LOGPALETTE *)&Palette);
TRACE(palette,"(0x%x)\n", hdc);
pLogPal->palVersion = 0x300; for (r = 0; r < 6; r++) {
pLogPal->palNumEntries = palNumEntries; for (g = 0; g < 6; g++) {
for (b = 0; b < 6; b++) {
for( i = 0; i < NB_RESERVED_COLORS; i ++ ) i = r + g*6 + b*36 + 10;
{ pLogPal->palPalEntry[i].peRed = __sysPalTemplate[i].peRed; Palette.aEntries[i].peRed = r * 51;
pLogPal->palPalEntry[i].peGreen = __sysPalTemplate[i].peGreen; Palette.aEntries[i].peGreen = g * 51;
pLogPal->palPalEntry[i].peBlue = __sysPalTemplate[i].peBlue; Palette.aEntries[i].peBlue = b * 51;
pLogPal->palPalEntry[i].peFlags = 0;
}
for (r=0; r<6; r++)
{ for (g=0; g<6; g++)
{ for (b=0; b<6; b++)
{ pLogPal->palPalEntry[NB_RESERVED_COLORS+r*36+g*6+b].peRed = r*51;
pLogPal->palPalEntry[NB_RESERVED_COLORS+r*36+g*6+b].peGreen = g*51;
pLogPal->palPalEntry[NB_RESERVED_COLORS+r*36+g*6+b].peBlue = b*51;
pLogPal->palPalEntry[NB_RESERVED_COLORS+r*36+g*6+b].peFlags = 0;
} }
} }
} }
hPalette = CreatePalette32 (pLogPal);
if (hPalette) for (i = 216; i < 246; i++) {
{ SelectPalette32 (hdc, hPalette, FALSE); int v = (i - 216) * 8;
Palette.aEntries[i].peRed = v;
Palette.aEntries[i].peGreen = v;
Palette.aEntries[i].peBlue = v;
} }
HeapFree (GetProcessHeap(), 0, pLogPal); return CreatePalette32((LOGPALETTE *)&Palette);
return hPalette;
} }

View file

@ -49,7 +49,7 @@ init MAIN_GdiInit
44 stdcall CreateFontIndirectA(ptr) CreateFontIndirect32A 44 stdcall CreateFontIndirectA(ptr) CreateFontIndirect32A
45 stdcall CreateFontIndirectW(ptr) CreateFontIndirect32W 45 stdcall CreateFontIndirectW(ptr) CreateFontIndirect32W
46 stdcall CreateFontW(long long long long long long long long long long long long long wstr) CreateFont32W 46 stdcall CreateFontW(long long long long long long long long long long long long long wstr) CreateFont32W
47 stdcall CreateHalftonePalette(long) CreateHalftonePalette 47 stdcall CreateHalftonePalette(long) CreateHalftonePalette32
48 stdcall CreateHatchBrush(long long) CreateHatchBrush32 48 stdcall CreateHatchBrush(long long) CreateHatchBrush32
49 stdcall CreateICA(str str str ptr) CreateIC32A 49 stdcall CreateICA(str str str ptr) CreateIC32A
50 stdcall CreateICW(wstr wstr wstr ptr) CreateIC32W 50 stdcall CreateICW(wstr wstr wstr ptr) CreateIC32W