diff options
author | Jaroslav Hensl <emulator@emulace.cz> | 2023-04-10 14:53:37 +0200 |
---|---|---|
committer | Jaroslav Hensl <emulator@emulace.cz> | 2023-04-10 14:53:37 +0200 |
commit | 503e91046f60a86823629d43e64e2d0fcc006549 (patch) | |
tree | 7f4815da1ae1a94ede4d35aeb32b7ec2b32427e2 /ddk | |
download | vmdisp9x-503e91046f60a86823629d43e64e2d0fcc006549.tar.gz |
public release
Diffstat (limited to 'ddk')
-rw-r--r-- | ddk/dibeng.def | 49 | ||||
-rw-r--r-- | ddk/dibeng.h | 248 | ||||
-rw-r--r-- | ddk/dibeng.lbc | 46 | ||||
-rw-r--r-- | ddk/gdidefs.h | 828 | ||||
-rw-r--r-- | ddk/minivdd.h | 114 | ||||
-rw-r--r-- | ddk/valmode.h | 20 |
6 files changed, 1305 insertions, 0 deletions
diff --git a/ddk/dibeng.def b/ddk/dibeng.def new file mode 100644 index 0000000..f53ea67 --- /dev/null +++ b/ddk/dibeng.def @@ -0,0 +1,49 @@ +EXPORTS
+LIBRARY DIBENG
+ DIB_BitBlt @1
+ DIB_ColorInfo @2
+ DIB_Control @3
+ DIB_Disable @4
+ DIB_Enable @5
+ DIB_EnumDFonts @6
+ DIB_EnumObj @7
+ DIB_Output @8
+ DIB_Pixel @9
+ DIB_RealizeObject @10
+ DIB_StrBlt @11
+ DIB_ScanLR @12
+ DIB_DeviceMode @13
+ DIB_ExtTextOut @14
+ DIB_GetCharWidth @15
+ DIB_DeviceBitmap @16
+ DIB_FastBorder @17
+ DIB_SetAttribute @18
+ DIB_DibBlt @19
+ DIB_CreateDIBitmap @20
+ DIB_DibToDevice @21
+ DIB_SetPalette @22
+ DIB_GetPalette @23
+ DIB_SetPaletteTranslate @24
+ DIB_GetPaletteTranslate @25
+ DIB_UpdateColors @26
+ DIB_StretchBlt @27
+ DIB_StretchDIBits @28
+ DIB_SelectBitmap @29
+ DIB_BitmapBits @30
+ DIB_Inquire @101
+ DIB_SetCursorExt @102
+ DIB_MoveCursorExt @103
+ DIB_CheckCursorExt @104
+ DIB_BeginAccess @105
+ DIB_EndAccess @106
+ CreateDIBPDevice @300
+ DIB_RealizeObjectExt @400
+ DIB_DibBltExt @401
+ DIB_EnumObjExt @402
+ DIB_ExtTextOutExt @403
+ DIB_UpdateColorsExt @404
+ DIB_SetPaletteExt @405
+ DIB_GetPaletteExt @406
+ DIB_SetPaletteTranslateExt @407
+ DIB_GetPaletteTranslateExt @408
+
diff --git a/ddk/dibeng.h b/ddk/dibeng.h new file mode 100644 index 0000000..259a58c --- /dev/null +++ b/ddk/dibeng.h @@ -0,0 +1,248 @@ +/* DIB Engine interface. */
+
+#define BRUSHSIZE 8
+#define VER_DIBENG 0x400
+#define TYPE_DIBENG 0x5250 /* 'RP' */
+
+#define deCursorExclude deBeginAccess
+#define deCursorUnexclude deEndAccess
+
+/* DIB Engine PDevice structure. The deType field will be 'DI' when GDI
+ * calls the Engine; deType will be null or a selector if a minidriver is
+ * calls the DIB Engine.
+ */
+typedef struct {
+ WORD deType; /* TYPE_DIBENG or zero. */
+ WORD deWidth; /* DIB width in pixels. */
+ WORD deHeight; /* DIB height in pixels. */
+ WORD deWidthBytes; /* Scanline length in bytes. */
+ BYTE dePlanes; /* Number of bit planes. */
+ BYTE deBitsPixel; /* Number of bits per pixel. */
+ DWORD deReserved1; /* Not used. */
+ DWORD deDeltaScan; /* Scanline delta, can be negative.*/
+ LPBYTE delpPDevice; /* Associated PDevice pointer. */
+ DWORD deBitsOffset; /* 48-bit pointer to */
+ WORD deBitsSelector; /* DIB bits storage. */
+ WORD deFlags; /* More flags. */
+ WORD deVersion; /* Major/minor (0400h = 4.0). */
+ LPBITMAPINFO deBitmapInfo; /* Bitmapinfo header pointer. */
+ void (WINAPI *deBeginAccess)(); /* Surface access begin callback. */
+ void (WINAPI *deEndAccess)(); /* Surface access end callback. */
+ DWORD deDriverReserved; /* Reserved for minidrivers. */
+} DIBENGINE, FAR *LPDIBENGINE;
+
+/* if pdType is zero, structure is identical to PBITMAP */
+typedef struct tagPDEVICE {
+ short pdType;
+} PDEVICE;
+
+/* DIBEngine.deFlags */
+#define MINIDRIVER 0x0001 /* Mini display driver. */
+#define PALETTIZED 0x0002 /* Has a palette. */
+#define SELECTEDDIB 0x0004 /* DIB Section. */
+#define OFFSCREEN 0x0008 /* Offscreen surface in VRAM. */
+#define BUSY 0x0010 /* Busy. */
+#define NOT_FRAMEBUFFER 0x0020 /* No FB access (like 8514/A). */
+#define FIVE6FIVE 0x0040 /* 5-6-5 16bpp mode. */
+#define NON64KBANK 0x0080 /* Bank size != 64K. */
+#define VRAM 0x8000 /* Have VRAM access. */
+#define BANKEDVRAM 0x4000 /* VFlatD simulating LFB. */
+#define BANKEDSCAN 0x2000 /* VFlatD with scanlines crossing banks. */
+#define PALETTE_XLAT 0x1000 /* Bkgnd palette translation. */
+#define VGADITHER 0x0800 /* Dither to VGA colors. */
+#define CTCHANGE 0x0400 /* Color table changed/ */
+#define DITHER256 0x0200 /* Dither to 256 colors. */
+
+#define BUSY_BIT 4 /* Number of bit to test for busy. */
+
+/* DIB_Brush??.dp??BrushFlags */
+#define COLORSOLID 0x01 /* Color part solid. */
+#define MONOSOLID 0x02 /* Mono part solid. */
+#define PATTERNMONO 0x04 /* Brush originated from mono bitmap. */
+#define MONOVALID 0x08 /* Mono part valid. */
+#define MASKVALID 0x10 /* Mask valid. */
+#define PRIVATEDATA 0x20 /* Vendor defined bit. */
+
+/* Fake typedefs to avoid conflicts between windows.h and gdidefs.h. */
+typedef LPVOID LPPDEVICE;
+typedef LPVOID LPPPEN;
+typedef LPVOID LPPBRUSH;
+typedef LPVOID LPBRUSH;
+typedef LPVOID LPPCOLOR;
+typedef LPINT LPSHORT;
+
+/* DIB Engine functions. */
+/* NB: Based on DDK documentation which may be inaccurate. */
+//extern void WINAPI DIB_Control( void );
+extern LONG WINAPI DIB_Control(LPVOID lpDevice, UINT function, LPVOID lpInput, LPVOID lpOutput);
+extern WORD WINAPI DIB_EnumObjExt( LPPDEVICE lpDestDev, WORD wStyle, FARPROC lpCallbackFunc,
+ LPVOID lpClientData, LPPDEVICE lpDisplayDev );
+extern VOID WINAPI DIB_CheckCursorExt( LPPDEVICE lpDevice );
+extern WORD WINAPI DIB_Output( LPPDEVICE lpDestDev, WORD wStyle, WORD wCount,
+ LPPOINT lpPoints, LPPPEN lpPPen, LPPBRUSH lpPBrush,
+ LPDRAWMODE lpDrawMode, LPRECT lpClipRect);
+extern DWORD WINAPI DIB_RealizeObject( LPPDEVICE lpDestDev, WORD wStyle, LPVOID lpInObj,
+ LPVOID lpOutObj, LPTEXTXFORM lpTextXForm );
+extern WORD WINAPI DIB_RealizeObjectExt( LPPDEVICE lpDestDev, WORD wStyle, LPVOID lpInObj,
+ LPVOID lpOutObj, LPTEXTXFORM lpTextXForm,
+ LPPDEVICE lpDisplayDev );
+extern BOOL WINAPI DIB_BitBlt( LPPDEVICE lpDestDev, WORD wDestX, WORD wDestY, LPPDEVICE lpSrcDev,
+ WORD wSrcX, WORD wSrcY, WORD wXext, WORD wYext, DWORD dwRop3,
+ LPBRUSH lpPBrush, LPDRAWMODE lpDrawMode );
+extern BOOL WINAPI DIB_BitmapBits( LPPDEVICE lpDevice, DWORD fFlags, DWORD dwCount, LPSTR lpBits );
+extern VOID WINAPI DIB_DibBlt( LPPDEVICE lpBitmap, WORD fGet, WORD iStart, WORD cScans, LPSTR lpDIBits,
+ LPBITMAPINFO lpBitmapInfo, LPDRAWMODE lpDrawMode, LPINT lpTranslate );
+extern WORD WINAPI DIB_DibToDevice( LPPDEVICE lpDestDev, WORD X, WORD Y, WORD iScan, WORD cScans,
+ LPRECT lpClipRect, LPDRAWMODE lpDrawMode, LPSTR lpDIBits,
+ LPBITMAPINFO lpBitmapInfo, LPINT lpTranslate );
+extern DWORD WINAPI DIB_Pixel( LPPDEVICE lpDestDev, WORD X, WORD Y, DWORD dwPhysColor, LPDRAWMODE lpDrawMode );
+extern WORD WINAPI DIB_ScanLR( LPPDEVICE lpDestDev, WORD X, WORD Y, DWORD dwPhysColor, WORD wStyle );
+extern BOOL WINAPI DIB_SelectBitmap(LPPDEVICE lpDevice, LPBITMAP lpPrevBitmap, LPBITMAP lpBitmap, DWORD fFlags );
+extern BOOL WINAPI DIB_StretchBlt( LPPDEVICE lpDestDev, WORD wDestX, WORD wDestY, WORD wDestWidth,
+ WORD wDestHeight, LPPDEVICE lpSrcDev, WORD wSrcX, WORD wSrcY,
+ WORD wSrcWidth, WORD wtSrcHeight, DWORD dwRop3, LPBRUSH lpPBrush,
+ LPDRAWMODE lpDrawMode, LPRECT lpClipRect );
+extern BOOL WINAPI DIB_StretchDIBits( LPPDEVICE lpDestDev, WORD fGet, WORD wDestX, WORD wDestY, WORD wDestWidth,
+ WORD wDestHeight, WORD wSrcX, WORD wSrcY, WORD wSrcWidth, WORD wSrcHeight,
+ VOID *lpBits, LPBITMAPINFO lpInfo, LPINT lpTranslate, DWORD dwRop3,
+ LPBRUSH lpPBrush, LPDRAWMODE lpDrawMode, LPRECT lpClipRect );
+extern DWORD WINAPI DIB_ExtTextOut( LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, LPRECT lpClipRect,
+ LPSTR lpString, int wCount, LPFONTINFO lpFontInfo, LPDRAWMODE lpDrawMode,
+ LPTEXTXFORM lpTextXForm, LPSHORT lpCharWidths, LPRECT lpOpaqueRect, WORD wOptions );
+extern DWORD WINAPI DIB_ExtTextOutExt( LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, LPRECT lpClipRect,
+ LPSTR lpString, WORD wCount, LPFONTINFO lpFontInfo, LPDRAWMODE lpDrawMode,
+ LPTEXTXFORM lpTextXForm, LPSHORT lpCharWidths, LPRECT lpOpaqueRect,
+ WORD wOptions, LPVOID *lpDrawTextBitmap, LPVOID *lpDrawRect );
+extern WORD WINAPI DIB_GetCharWidth( LPPDEVICE lpDestDev, LPWORD lpBuffer, WORD wFirstChar, WORD wLastChar,
+ LPFONTINFO lpFontInfo, LPDRAWMODE lpDrawMode, LPTEXTXFORM lpFontTrans );
+
+extern DWORD WINAPI DIB_StrBlt( LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, LPRECT lpClipRect, LPSTR lpString,
+ WORD wCount, LPFONTINFO lpFontInfo, LPDRAWMODE lpDrawMode, LPTEXTXFORM lpTextXForm );
+extern DWORD WINAPI DIB_ColorInfo( LPPDEVICE lpDestDev, DWORD dwColorin, LPPCOLOR lpPColor );
+extern VOID WINAPI DIB_GetPalette( WORD nStartIndex, WORD nNumEntries, RGBQUAD lpPalette );
+extern VOID WINAPI DIB_GetPaletteExt( WORD nStartIndex, WORD nNumEntries, RGBQUAD lpPalette, LPPDEVICE lpDIBEngine );
+extern VOID WINAPI DIB_GetPaletteTranslate( LPWORD lpIndexes );
+extern VOID WINAPI DIB_GetPaletteTranslateExt( LPWORD lpIndexes, LPPDEVICE lpDIBEngine );
+extern VOID WINAPI DIB_SetPalette( WORD nStartIndex, WORD nNumEntries, LPVOID lpPalette );
+extern VOID WINAPI DIB_SetPaletteExt( WORD nStartIndex, WORD nNumEntries, LPVOID lpPalette, LPPDEVICE lpDIBEngine );
+extern VOID WINAPI DIB_SetPaletteTranslate( LPWORD lpIndexes );
+extern VOID WINAPI DIB_SetPaletteTranslateExt( LPWORD lpIndexes, LPPDEVICE lpDIBEngine );
+extern VOID WINAPI DIB_UpdateColorsExt( WORD wStartX, WORD wStart, WORD wExtX, WORD wExtY,
+ LPWORD lpTranslate, LPPDEVICE lpDIBEngine );
+extern VOID WINAPI DIB_SetCursorExt( LPPDEVICE lpDevice, LPVOID lpCursorShape );
+extern VOID WINAPI DIB_CheckCursorExt( LPPDEVICE lpDevice );
+extern VOID WINAPI DIB_MoveCursorExt( LPPDEVICE lpDevice, WORD absX, WORD absY );
+extern VOID WINAPI DIB_Inquire( LPVOID lpCursorInfo );
+extern VOID WINAPI DIB_BeginAccess( LPPDEVICE lpDevice, WORD wLeft, WORD wTop, WORD wRight, WORD wBottom, WORD wFlags );
+extern VOID WINAPI DIB_EndAccess( LPPDEVICE lpDevice, WORD wFlags );
+extern WORD WINAPI DIB_CreateDIBitmap( void );
+extern WORD WINAPI DIB_DeviceBitmap( LPPDEVICE lpDestDev, WORD wCommand, LPBITMAP lpBitmap, LPSTR lpBits );
+extern WORD WINAPI DIB_DeviceMode( HWND hWnd, HINSTANCE hInst, LPVOID lpDeviceType, LPVOID lpOutputFile );
+extern UINT WINAPI DIB_Enable( LPPDEVICE lpDevice, WORD wStyle, LPSTR lpDeviceType, LPSTR lpOutputFile, LPVOID lpStuff );
+extern VOID WINAPI DIB_Disable( LPPDEVICE lpDestDev );
+extern WORD WINAPI DIB_EnumDFonts( LPPDEVICE lpDestDev, LPSTR lpFaceName, FARPROC lpCallbackFunc, LPVOID lpClientData );
+extern WORD WINAPI DIB_SetAttribute( LPPDEVICE lpDevice, WORD wStateNum, WORD wIndex, DWORD dwAttribute );
+
+
+/* WARNING: CreateDIBPDevice returns the result in EAX, not DX:AX! */
+extern DWORD WINAPI CreateDIBPDevice( LPBITMAPINFO lpInfo, LPPDEVICE lpDevice, LPVOID lpBits, WORD wFlags );
+
+#define FB_ACCESS 0x0001
+#define CURSOREXCLUDE 0x0008
+
+#define GREY_BIT 0x40 /* Physical color MSB. */
+
+/* DIB Engine Color Table entry. A lot like RGBQUAD. */
+typedef struct {
+ BYTE dceBlue;
+ BYTE dceGreen;
+ BYTE dceRed;
+ BYTE dceFlags;
+} DIBColorEntry;
+
+/* DIBColorEntry.dceFlags */
+#define NONSTATIC 0x80
+#define MAPTOWHITE 0x01
+
+
+/* DIB Engine Physical Object Definitions */
+
+typedef struct {
+ WORD dpPenStyle;
+ BYTE dpPenFlags;
+ BYTE dpPenBpp;
+ DWORD dpPenMono;
+ DWORD dpPenColor;
+} DIB_Pen;
+
+typedef struct {
+ BYTE dp1BrushFlags; /* Accelerator for solids */
+ BYTE dp1BrushBpp; /* Brush Bits per pixel format */
+ WORD dp1BrushStyle; /* Style of the brush */
+ DWORD dp1FgColor; /* Physical fg color */
+ WORD dp1Hatch; /* Hatching style */
+ DWORD dp1BgColor; /* Physical bg color */
+ BYTE dp1BrushMono[BRUSHSIZE*4]; /* Mono portion */
+ BYTE dp1BrushMask[BRUSHSIZE*4]; /* transparency mask (hatch pattern) */
+ BYTE dp1BrushBits[BRUSHSIZE*4]; /* 8 rows, 8 columns of 1 bit/pixel */
+} DIB_Brush1;
+
+typedef struct {
+ BYTE dp4BrushFlags; /* Accelerator for solids */
+ BYTE dp4BrushBpp; /* Brush Bits per pixel format */
+ WORD dp4BrushStyle; /* Style of the brush */
+ DWORD dp4FgColor; /* Physical fg color */
+ WORD dp4Hatch; /* Hatching style */
+ DWORD dp4BgColor; /* Physical bg color */
+ BYTE dp4BrushMono[BRUSHSIZE*4]; /* Mono portion */
+ BYTE dp4BrushMask[BRUSHSIZE*4]; /* transparency mask (hatch pattern) */
+ BYTE dp4BrushBits[BRUSHSIZE*4]; /* 8 rows, 8 columns of 4 bit/pixel */
+} DIB_Brush4;
+
+typedef struct {
+ BYTE dp8BrushFlags; /* Accelerator for solids */
+ BYTE dp8BrushBpp; /* Brush Bits per pixel format */
+ WORD dp8BrushStyle; /* Style of the brush */
+ DWORD dp8FgColor; /* Physical fg color */
+ WORD dp8Hatch; /* Hatching style */
+ DWORD dp8BgColor; /* Physical bg color */
+ BYTE dp8BrushMono[BRUSHSIZE*4]; /* Mono portion */
+ BYTE dp8BrushMask[BRUSHSIZE*4]; /* transparency mask (hatch pattern) */
+ BYTE dp8BrushBits[BRUSHSIZE*8]; /* 8 rows,8 columns of 8 bit/pixel */
+} DIB_Brush8;
+
+typedef struct {
+ BYTE dp16BrushFlags; /* Accelerator for solids */
+ BYTE dp16BrushBpp; /* Brush Bits per pixel format */
+ WORD dp16BrushStyle; /* Style of the brush */
+ DWORD dp16FgColor; /* Physical fg color */
+ WORD dp16Hatch; /* Hatching style */
+ DWORD dp16BgColor; /* Physical bg color */
+ BYTE dp16BrushMono[BRUSHSIZE*4]; /* Mono portion */
+ BYTE dp16BrushMask[BRUSHSIZE*4]; /* transparency mask (hatch pattern) */
+ BYTE dp16BrushBits[BRUSHSIZE*16];/* 8 rows,8 columns of 16 bit/pixel */
+} DIB_Brush16;
+
+typedef struct {
+ BYTE dp24BrushFlags; /* Accelerator for solids */
+ BYTE dp24BrushBpp; /* Brush Bits per pixel format */
+ WORD dp24BrushStyle; /* Style of the brush */
+ DWORD dp24FgColor; /* Physical fg color */
+ WORD dp24Hatch; /* Hatching style */
+ DWORD dp24BgColor; /* Physical bg color */
+ BYTE dp24BrushMono[BRUSHSIZE*4]; /* Mono portion */
+ BYTE dp24BrushMask[BRUSHSIZE*4]; /* transparency mask (hatch pattern) */
+ BYTE dp24BrushBits[BRUSHSIZE*24];/* 8 rows,8 columns of 24 bit/pixel */
+} DIB_Brush24;
+
+typedef struct {
+ BYTE dp32BrushFlags; /* Accelerator for solids */
+ BYTE dp32BrushBpp; /* Brush Bits per pixel format */
+ WORD dp32BrushStyle; /* Style of the brush */
+ DWORD dp32FgColor; /* Physical fg color */
+ WORD dp32Hatch; /* Hatching style */
+ DWORD dp32BgColor; /* Physical bg color */
+ BYTE dp32BrushMono[BRUSHSIZE*4]; /* Mono portion */
+ BYTE dp32BrushMask[BRUSHSIZE*4]; /* transparency mask (hatch pattern) */
+ BYTE dp32BrushBits[BRUSHSIZE*32];/* 8 rows,8 columns of 32 bit/pixel */
+} DIB_Brush32;
diff --git a/ddk/dibeng.lbc b/ddk/dibeng.lbc new file mode 100644 index 0000000..75e59cf --- /dev/null +++ b/ddk/dibeng.lbc @@ -0,0 +1,46 @@ +++DIB_BitBlt.DIBENG.1
+++DIB_ColorInfo.DIBENG.2
+++DIB_Control.DIBENG.3
+++DIB_Disable.DIBENG.4
+++DIB_Enable.DIBENG.5
+++DIB_EnumDFonts.DIBENG.6
+++DIB_EnumObj.DIBENG.7
+++DIB_Output.DIBENG.8
+++DIB_Pixel.DIBENG.9
+++DIB_RealizeObject.DIBENG.10
+++DIB_StrBlt.DIBENG.11
+++DIB_ScanLR.DIBENG.12
+++DIB_DeviceMode.DIBENG.13
+++DIB_ExtTextOut.DIBENG.14
+++DIB_GetCharWidth.DIBENG.15
+++DIB_DeviceBitmap.DIBENG.16
+++DIB_FastBorder.DIBENG.17
+++DIB_SetAttribute.DIBENG.18
+++DIB_DibBlt.DIBENG.19
+++DIB_CreateDIBitmap.DIBENG.20
+++DIB_DibToDevice.DIBENG.21
+++DIB_SetPalette.DIBENG.22
+++DIB_GetPalette.DIBENG.23
+++DIB_SetPaletteTranslate.DIBENG.24
+++DIB_GetPaletteTranslate.DIBENG.25
+++DIB_UpdateColors.DIBENG.26
+++DIB_StretchBlt.DIBENG.27
+++DIB_StretchDIBits.DIBENG.28
+++DIB_SelectBitmap.DIBENG.29
+++DIB_BitmapBits.DIBENG.30
+++DIB_Inquire.DIBENG.101
+++DIB_SetCursorExt.DIBENG.102
+++DIB_MoveCursorExt.DIBENG.103
+++DIB_CheckCursorExt.DIBENG.104
+++DIB_BeginAccess.DIBENG.105
+++DIB_EndAccess.DIBENG.106
+++CreateDIBPDevice.DIBENG.300
+++DIB_RealizeObjectExt.DIBENG.400
+++DIB_DibBltExt.DIBENG.401
+++DIB_EnumObjExt.DIBENG.402
+++DIB_ExtTextOutExt.DIBENG.403
+++DIB_UpdateColorsExt.DIBENG.404
+++DIB_SetPaletteExt.DIBENG.405
+++DIB_GetPaletteExt.DIBENG.406
+++DIB_SetPaletteTranslateExt.DIBENG.407
+++DIB_GetPaletteTranslateExt.DIBENG.408
diff --git a/ddk/gdidefs.h b/ddk/gdidefs.h new file mode 100644 index 0000000..0f16bf7 --- /dev/null +++ b/ddk/gdidefs.h @@ -0,0 +1,828 @@ +
+/* Definitions for GDI drivers. */
+
+/* Physical Bitmap structure. */
+typedef struct {
+ short int bmType;
+ unsigned short int bmWidth;
+ unsigned short int bmHeight;
+ unsigned short int bmWidthBytes;
+ BYTE bmPlanes;
+ BYTE bmBitsPixel;
+ BYTE FAR *bmBits;
+ unsigned long int bmWidthPlanes;
+ BYTE FAR *bmlpPDevice;
+ unsigned short int bmSegmentIndex;
+ unsigned short int bmScanSegment;
+ unsigned short int bmFillBytes;
+ unsigned short int futureUse4;
+ unsigned short int futureUse5;
+} BITMAP;
+
+/* DIB structs also defined in windows.h. */
+typedef struct {
+ DWORD bcSize;
+ WORD bcWidth;
+ WORD bcHeight;
+ WORD bcPlanes;
+ WORD bcBitCount;
+} BITMAPCOREHEADER;
+typedef BITMAPCOREHEADER FAR *LPBITMAPCOREHEADER;
+typedef BITMAPCOREHEADER *PBITMAPCOREHEADER;
+
+typedef struct {
+ DWORD biSize;
+ DWORD biWidth;
+ DWORD biHeight;
+ WORD biPlanes;
+ WORD biBitCount;
+ DWORD biCompression;
+ DWORD biSizeImage;
+ DWORD biXPelsPerMeter;
+ DWORD biYPelsPerMeter;
+ DWORD biClrUsed;
+ DWORD biClrImportant;
+} BITMAPINFOHEADER;
+
+typedef BITMAPINFOHEADER FAR *LPBITMAPINFOHEADER;
+typedef BITMAPINFOHEADER *PBITMAPINFOHEADER;
+
+typedef struct {
+ BYTE rgbtBlue;
+ BYTE rgbtGreen;
+ BYTE rgbtRed;
+} RGBTRIPLE;
+
+typedef struct {
+ BYTE rgbBlue;
+ BYTE rgbGreen;
+ BYTE rgbRed;
+ BYTE rgbReserved;
+} RGBQUAD;
+
+/* ICM Color Definitions */
+typedef long FXPT16DOT16, FAR *LPFXPT16DOT16;
+typedef long FXPT2DOT30, FAR *LPFXPT2DOT30;
+
+typedef struct tagCIEXYZ
+{
+ FXPT2DOT30 ciexyzX;
+ FXPT2DOT30 ciexyzY;
+ FXPT2DOT30 ciexyzZ;
+} CIEXYZ;
+typedef CIEXYZ FAR *LPCIEXYZ;
+
+typedef struct tagICEXYZTRIPLE
+{
+ CIEXYZ ciexyzRed;
+ CIEXYZ ciexyzGreen;
+ CIEXYZ ciexyzBlue;
+} CIEXYZTRIPLE;
+typedef CIEXYZTRIPLE FAR *LPCIEXYZTRIPLE;
+
+typedef struct {
+ BITMAPCOREHEADER bmciHeader;
+ RGBQUAD bmciColors[1];
+} BITMAPCOREINFO;
+
+typedef BITMAPCOREINFO FAR *LPBITMAPCOREINFO;
+typedef BITMAPCOREINFO *PBITMAPCOREINFO;
+
+typedef struct {
+ BITMAPINFOHEADER bmiHeader;
+ RGBQUAD bmiColors[1];
+} BITMAPINFO;
+
+typedef BITMAPINFO FAR *LPBITMAPINFO;
+typedef BITMAPINFO *PBITMAPINFO;
+
+typedef struct {
+ DWORD bV4Size;
+ LONG bV4Width;
+ LONG bV4Height;
+ WORD bV4Planes;
+ WORD bV4BitCount;
+ DWORD bV4V4Compression;
+ DWORD bV4SizeImage;
+ LONG bV4XPelsPerMeter;
+ LONG bV4YPelsPerMeter;
+ DWORD bV4ClrUsed;
+ DWORD bV4ClrImportant;
+ DWORD bV4RedMask;
+ DWORD bV4GreenMask;
+ DWORD bV4BlueMask;
+ DWORD bV4AlphaMask;
+ DWORD bV4CSType;
+ CIEXYZTRIPLE bV4Endpoints;
+ DWORD bV4GammaRed;
+ DWORD bV4GammaGreen;
+ DWORD bV4GammaBlue;
+} BITMAPV4HEADER, FAR *LPBITMAPV4HEADER, *PBITMAPV4HEADER;
+
+typedef struct {
+ BITMAPV4HEADER bmv4Header;
+ RGBQUAD bmv4Colors[1];
+} BITMAPV4INFO;
+
+typedef BITMAPV4INFO FAR *LPBITMAPV4INFO;
+typedef BITMAPV4INFO *PBITMAPV4INFO;
+
+/* currently, if the low byte of biCompression is non zero,
+ * it must be one of following */
+
+#define BI_RGB 0x00
+#define BI_RLE8 0x01
+#define BI_RLE4 0x02
+#define BI_BITFIELDS 0x03
+
+#define BITMAP_SELECTED 0x01
+#define BITMAP_64K 0x01
+
+#define DIBSIGNATURE 0x4944
+
+/* Point types are optional. */
+#ifndef NOPTRC
+
+typedef struct {
+ short int xcoord;
+ short int ycoord;
+} PTTYPE;
+typedef PTTYPE *PPOINT;
+typedef PTTYPE FAR *LPPOINT;
+
+#define POINT PTTYPE
+
+typedef struct {
+ short int left;
+ short int top;
+ short int right;
+ short int bottom;
+} RECT;
+typedef RECT *PRECT;
+
+#endif
+
+typedef struct {
+ PTTYPE min;
+ PTTYPE ext;
+} BOXTYPE;
+typedef RECT FAR *LPRECT;
+
+/* Object definitions used by GDI support routines written in C */
+
+#define OBJ_PEN 1
+#define OBJ_BRUSH 2
+#define OBJ_FONT 3
+
+typedef struct {
+ unsigned short int lbStyle;
+ unsigned long int lbColor;
+ unsigned short int lbHatch;
+ unsigned long int lbBkColor;
+ unsigned long int lbhcmXform;
+} LOGBRUSH;
+
+#define lbPattern lbColor
+
+/* Brush Style definitions. */
+#define BS_SOLID 0
+#define BS_HOLLOW 1
+#define BS_HATCHED 2
+#define BS_PATTERN 3
+
+#define MaxBrushStyle 3
+
+/* Hatch Style definitions. */
+#define HS_HORIZONTAL 0 /* ----- */
+#define HS_VERTICAL 1 /* ||||| */
+#define HS_FDIAGONAL 2 /* ///// */
+#define HS_BDIAGONAL 3 /* \\\\\ */
+#define HS_CROSS 4 /* +++++ */
+#define HS_DIAGCROSS 5 /* xxxxx */
+
+#define MaxHatchStyle 5
+
+
+/* Logical Pen Structure. */
+typedef struct {
+ unsigned short int lopnStyle;
+ PTTYPE lopnWidth;
+ unsigned long int lopnColor;
+ unsigned short int lopnStyle2;
+ unsigned long int lopnhcmXform;
+} LOGPEN;
+
+/* Line Style definitions. */
+#define LS_SOLID 0
+#define LS_DASHED 1
+#define LS_DOTTED 2
+#define LS_DOTDASHED 3
+#define LS_DASHDOTDOT 4
+#define LS_NOLINE 5
+#define LS_INSIDEFRAME 6
+#define MaxLineStyle LS_NOLINE
+
+#define LS_ENDCAP_FLAT 0x01
+#define LS_ENDCAP_ROUND 0x02
+#define LS_ENDCAP_SQUARE 0x04
+#define LS_JOIN_BEVEL 0x08
+#define LS_JOIN_MITER 0x10
+#define LS_JOIN_ROUND 0x20
+
+
+/* The size to allocate for the lfFaceName field in the logical font. */
+#ifndef LF_FACESIZE
+#define LF_FACESIZE 32
+#endif
+
+/* Various constants for defining a logical font. */
+#define OUT_DEFAULT_PRECIS 0
+#define OUT_STRING_PRECIS 1
+#define OUT_CHARACTER_PRECIS 2
+#define OUT_STROKE_PRECIS 3
+#define OUT_TT_PRECIS 4
+#define OUT_DEVICE_PRECIS 5
+#define OUT_RASTER_PRECIS 6
+#define OUT_TT_ONLY_PRECIS 7
+
+#define CLIP_DEFAULT_PRECIS 0
+#define CLIP_CHARACTER_PRECIS 1
+#define CLIP_STROKE_PRECIS 2
+#define CLIP_MASK 0x0F
+#define CLIP_LH_ANGLES 0x10
+#define CLIP_TT_ALWAYS 0x20
+#define CLIP_EMBEDDED 0x80
+
+#define DEFAULT_QUALITY 0
+#define DRAFT_QUALITY 1
+#define PROOF_QUALITY 2
+
+#define DEFAULT_PITCH 0
+#define FIXED_PITCH 1
+#define VARIABLE_PITCH 2
+
+#define ANSI_CHARSET 0
+#define DEFAULT_CHARSET 1
+#define SYMBOL_CHARSET 2
+#define MAC_CHARSET 77
+#define SHIFTJIS_CHARSET 128
+#define HANGEUL_CHARSET 129
+#define CHINESEBIG5_CHARSET 136
+#define OEM_CHARSET 255
+
+
+/* GDI font families. */
+#define FF_DONTCARE (0<<4) /* Don't care or don't know. */
+#define FF_ROMAN (1<<4) /* Variable stroke width, serifed. */
+ /* Times Roman, Century Schoolbook, etc.*/
+#define FF_SWISS (2<<4) /* Variable stroke width, sans-serifed. */
+ /* Helvetica, Swiss, etc. */
+#define FF_MODERN (3<<4) /* Constant stroke width, serifed or sans-serifed. */
+ /* Pica, Elite, Courier, etc. */
+#define FF_SCRIPT (4<<4) /* Cursive, etc. */
+#define FF_DECORATIVE (5<<4) /* Old English, etc. */
+
+
+/* Font weights lightest to heaviest. */
+#define FW_DONTCARE 0
+#define FW_THIN 100
+#define FW_EXTRALIGHT 200
+#define FW_LIGHT 300
+#define FW_NORMAL 400
+#define FW_MEDIUM 500
+#define FW_SEMIBOLD 600
+#define FW_BOLD 700
+#define FW_EXTRABOLD 800
+#define FW_HEAVY 900
+
+#define FW_ULTRALIGHT FW_EXTRALIGHT
+#define FW_REGULAR FW_NORMAL
+#define FW_DEMIBOLD FW_SEMIBOLD
+#define FW_ULTRABOLD FW_EXTRABOLD
+#define FW_BLACK FW_HEAVY
+
+/* Enumeration font types. */
+#define RASTER_FONTTYPE 1
+#define DEVICE_FONTTYPE 2
+
+
+
+typedef struct {
+ short int lfHeight;
+ short int lfWidth;
+ short int lfEscapement;
+ short int lfOrientation;
+ short int lfWeight;
+ BYTE lfItalic;
+ BYTE lfUnderline;
+ BYTE lfStrikeOut;
+ BYTE lfCharSet;
+ BYTE lfOutPrecision;
+ BYTE lfClipPrecision;
+ BYTE lfQuality;
+ BYTE lfPitchAndFamily;
+ BYTE lfFaceName[LF_FACESIZE];
+} LOGFONT;
+
+
+#define InquireInfo 0x01 /* Inquire Device GDI Info */
+#define EnableDevice 0x00 /* Enable Device */
+#define InfoContext 0x8000 /* Inquire/Enable for info context */
+
+/* Device Technology types */
+#define DT_PLOTTER 0 /* Vector plotter */
+#define DT_RASDISPLAY 1 /* Raster display */
+#define DT_RASPRINTER 2 /* Raster printer */
+#define DT_RASCAMERA 3 /* Raster camera */
+#define DT_CHARSTREAM 4 /* Character-stream, PLP */
+#define DT_METAFILE 5 /* Metafile, VDM */
+#define DT_DISPFILE 6 /* Display-file */
+#define DT_JUMBO 11 /* SPAG LJ cool thing */
+
+/* Curve Capabilities */
+#define CC_NONE 0x0000 /* Curves not supported */
+#define CC_CIRCLES 0x0001 /* Can do circles */
+#define CC_PIE 0x0002 /* Can do pie wedges */
+#define CC_CHORD 0x0004 /* Can do chord arcs */
+#define CC_ELLIPSES 0x0008 /* Can do ellipese */
+#define CC_WIDE 0x0010 /* Can do wide lines */
+#define CC_STYLED 0x0020 /* Can do styled lines */
+#define CC_WIDESTYLED 0x0040 /* Can do wide styled lines*/
+#define CC_INTERIORS 0x0080 /* Can do interiors */
+#define CC_ROUNDRECT 0x0100 /* Can do round rectangles */
+#define CC_POLYBEZIER 0x0200 /* Can do polybeziers */
+
+/* Line Capabilities */
+#define LC_NONE 0x0000 /* Lines not supported */
+#define LC_POLYSCANLINE 0x0001 /* Poly Scanlines supported*/
+#define LC_POLYLINE 0x0002 /* Can do polylines */
+#define LC_MARKER 0x0004 /* Can do markers */
+#define LC_POLYMARKER 0x0008 /* Can do polymarkers */
+#define LC_WIDE 0x0010 /* Can do wide lines */
+#define LC_STYLED 0x0020 /* Can do styled lines */
+#define LC_WIDESTYLED 0x0040 /* Can do wide styled lines*/
+#define LC_INTERIORS 0x0080 /* Can do interiors */
+
+/* Polygonal Capabilities */
+#define PC_NONE 0x0000 /* Polygonals not supported*/
+#define PC_ALTPOLYGON 0x0001 /* Can do even odd polygons*/
+#define PC_POLYGON 0x0001 /* old name for ALTPOLYGON */
+#define PC_RECTANGLE 0x0002 /* Can do rectangles */
+#define PC_WINDPOLYGON 0x0004 /* Can do winding polygons */
+#define PC_TRAPEZOID 0x0004 /* old name for WINDPOLYGON*/
+#define PC_SCANLINE 0x0008 /* Can do scanlines */
+#define PC_WIDE 0x0010 /* Can do wide borders */
+#define PC_STYLED 0x0020 /* Can do styled borders */
+#define PC_WIDESTYLED 0x0040 /* Can do wide styled borders*/
+#define PC_INTERIORS 0x0080 /* Can do interiors */
+#define PC_POLYPOLYGON 0x0100 /* Can do PolyPolygons */
+
+/* Clipping Capabilities */
+#define CP_NONE 0x0000 /* no clipping of Output */
+#define CP_RECTANGLE 0x0001 /* Output clipped to Rects */
+#define CP_REGION 0x0002 /* not supported */
+#define CP_REGION32 0x0004 /* Output clipped to regions */
+
+/* Text Capabilities */
+#define TC_OP_CHARACTER 0x0001 /* Can do OutputPrecision CHARACTER */
+#define TC_OP_STROKE 0x0002 /* Can do OutputPrecision STROKE */
+#define TC_CP_STROKE 0x0004 /* Can do ClipPrecision STROKE */
+#define TC_CR_90 0x0008 /* Can do CharRotAbility 90 */
+#define TC_CR_ANY 0x0010 /* Can do CharRotAbility ANY */
+#define TC_SF_X_YINDEP 0x0020 /* Can do ScaleFreedom X_YINDEPENDENT */
+#define TC_SA_DOUBLE 0x0040 /* Can do ScaleAbility DOUBLE */
+#define TC_SA_INTEGER 0x0080 /* Can do ScaleAbility INTEGER */
+#define TC_SA_CONTIN 0x0100 /* Can do ScaleAbility CONTINUOUS */
+#define TC_EA_DOUBLE 0x0200 /* Can do EmboldenAbility DOUBLE */
+#define TC_IA_ABLE 0x0400 /* Can do ItalisizeAbility ABLE */
+#define TC_UA_ABLE 0x0800 /* Can do UnderlineAbility ABLE */
+#define TC_SO_ABLE 0x1000 /* Can do StrikeOutAbility ABLE */
+#define TC_RA_ABLE 0x2000 /* Can do RasterFontAble ABLE */
+#define TC_VA_ABLE 0x4000 /* Can do VectorFontAble ABLE */
+#define TC_RESERVED 0x8000 /* Reserved. Must be returned zero. */
+
+/* Raster Capabilities */
+#define RC_NONE 0x0000 /* No Raster Capabilities */
+#define RC_BITBLT 0x0001 /* Can do bitblt */
+#define RC_BANDING 0x0002 /* Requires banding support */
+#define RC_SCALING 0x0004 /* does scaling while banding */
+#define RC_BITMAP64 0x0008 /* supports >64k bitmaps */
+#define RC_GDI20_OUTPUT 0x0010 /* has 2.0 output calls */
+#define RC_GDI20_STATE 0x0020 /* dc has a state block */
+#define RC_SAVEBITMAP 0x0040 /* can save bitmaps locally */
+#define RC_DI_BITMAP 0x0080 /* can do DIBs */
+#define RC_PALETTE 0x0100 /* can do color pal management */
+#define RC_DIBTODEV 0x0200 /* can do SetDIBitsToDevice */
+#define RC_BIGFONT 0x0400 /* can do BIGFONTs */
+#define RC_STRETCHBLT 0x0800 /* can do StretchBlt */
+#define RC_FLOODFILL 0x1000 /* can do FloodFill */
+#define RC_STRETCHDIB 0x2000 /* can do StretchDIBits */
+#define RC_OP_DX_OUTPUT 0x4000 /* can do smart ExtTextOut w/dx */
+#define RC_DEVBITS 0x8000 /* supports device bitmaps */
+
+/* DC Management Flags */
+#define DC_SPDevice 0000001 /* Seperate PDevice required per device/filename */
+#define DC_1PDevice 0000002 /* Only 1 PDevice allowed per device/filename */
+#define DC_IgnoreDFNP 0000004 /* Ignore device/filename pairs when matching */
+
+/* dpCaps1 capability bits */
+#define C1_TRANSPARENT 0x0001 /* supports transparency */
+#define TC_TT_ABLE 0x0002 /* can do TT through DDI or brute */
+#define C1_TT_CR_ANY 0x0004 /* can do rotated TT fonts */
+#define C1_EMF_COMPLIANT 0x0008 /* Win95 - supports metafile spooling */
+#define C1_DIBENGINE 0x0010 /* DIB Engine compliant driver */
+#define C1_GAMMA_RAMP 0x0020 /* supports gamma ramp setting */
+#define C1_ICM 0x0040 /* does some form of ICM support */
+#define C1_REINIT_ABLE 0x0080 /* Driver supports ReEnable */
+#define C1_GLYPH_INDEX 0x0100 /* Driver supports glyph index fonts */
+#define C1_BIT_PACKED 0x0200 /* Supports bit-packed glyphs */
+#define C1_BYTE_PACKED 0x0400 /* Supports byte-packed glyphs */
+#define C1_COLORCURSOR 0x0800 /* Driver supports color_cursors and async SetCursor */
+#define C1_CMYK_ABLE 0x1000 /* Driver supports CMYK ColorRefs */
+#define C1_SLOW_CARD 0x2000 /* Little or no acceleration (VGA, etc.)*/
+
+/* dpCapsFE capability bits */
+#define FEC_TT_DBCS 0x0020 /* can output DBCS TT fonts correctly */
+#define FEC_WIFE_ABLE 0x0080 /* can handle WIFE font as Engine font */
+
+typedef struct {
+ short int dpVersion;
+ short int dpTechnology;
+ short int dpHorzSize;
+ short int dpVertSize;
+ short int dpHorzRes;
+ short int dpVertRes;
+ short int dpBitsPixel;
+ short int dpPlanes;
+ short int dpNumBrushes;
+ short int dpNumPens;
+ short int dpCapsFE;
+ short int dpNumFonts;
+ short int dpNumColors;
+ short int dpDEVICEsize;
+ unsigned short int dpCurves;
+ unsigned short int dpLines;
+ unsigned short int dpPolygonals;
+ unsigned short int dpText;
+ unsigned short int dpClip;
+ unsigned short int dpRaster;
+ short int dpAspectX;
+ short int dpAspectY;
+ short int dpAspectXY;
+ short int dpStyleLen;
+ PTTYPE dpMLoWin;
+ PTTYPE dpMLoVpt;
+ PTTYPE dpMHiWin;
+ PTTYPE dpMHiVpt;
+ PTTYPE dpELoWin;
+ PTTYPE dpELoVpt;
+ PTTYPE dpEHiWin;
+ PTTYPE dpEHiVpt;
+ PTTYPE dpTwpWin;
+ PTTYPE dpTwpVpt;
+ short int dpLogPixelsX;
+ short int dpLogPixelsY;
+ short int dpDCManage;
+ unsigned short int dpCaps1;
+ short int futureuse4;
+ short int futureuse5;
+ short int futureuse6;
+ short int futureuse7;
+ WORD dpNumPalReg;
+ WORD dpPalReserved;
+ WORD dpColorRes;
+} GDIINFO;
+
+/* This bit in the dfType field signals that the dfBitsOffset field is an
+ absolute memory address and should not be altered. */
+#define PF_BITS_IS_ADDRESS 4
+
+/* This bit in the dfType field signals that the font is device realized. */
+#define PF_DEVICE_REALIZED 0x80
+
+/* These bits in the dfType give the fonttype -
+ raster, vector, other1, other2. */
+#define PF_RASTER_TYPE 0
+#define PF_VECTOR_TYPE 1
+#define PF_OTHER1_TYPE 2
+#define PF_OTHER2_TYPE 3
+#define PF_GLYPH_INDEX 0x20
+#define PF_WIFE_TYPE 0x08
+
+/* Glyph types for EngineGetGlyphBmp */
+#define EGB_BITMAP 1
+#define EGB_OUTLINE 2
+#define EGB_GRAY2_BITMAP 8
+#define EGB_GRAY4_BITMAP 9
+#define EGB_GRAY8_BITMAP 10
+
+
+/* The size to allocate for the dfMaps field in the physical font. */
+#ifndef DF_MAPSIZE
+#define DF_MAPSIZE 1
+#endif
+
+/* Font structure. */
+typedef struct {
+ short int dfType;
+ short int dfPoints;
+ short int dfVertRes;
+ short int dfHorizRes;
+ short int dfAscent;
+ short int dfInternalLeading;
+ short int dfExternalLeading;
+ BYTE dfItalic;
+ BYTE dfUnderline;
+ BYTE dfStrikeOut;
+ short int dfWeight;
+ BYTE dfCharSet;
+ short int dfPixWidth;
+ short int dfPixHeight;
+ BYTE dfPitchAndFamily;
+ short int dfAvgWidth;
+ short int dfMaxWidth;
+ BYTE dfFirstChar;
+ BYTE dfLastChar;
+ BYTE dfDefaultChar;
+ BYTE dfBreakChar;
+ short int dfWidthBytes;
+ unsigned long int dfDevice;
+ unsigned long int dfFace;
+ unsigned long int dfBitsPointer;
+ unsigned long int dfBitsOffset;
+ BYTE dfReservedByte;
+ unsigned short dfMaps[DF_MAPSIZE];
+} FONTINFO;
+
+
+typedef struct {
+ short int erType;
+ short int erPoints;
+ short int erVertRes;
+ short int erHorizRes;
+ short int erAscent;
+ short int erInternalLeading;
+ short int erExternalLeading;
+ BYTE erItalic;
+ BYTE erUnderline;
+ BYTE erStrikeOut;
+ short int erWeight;
+ BYTE erCharSet;
+ short int erPixWidth;
+ short int erPixHeight;
+ BYTE erPitchAndFamily;
+ short int erAvgWidth;
+ short int erMaxWidth;
+ BYTE erFirstChar;
+ BYTE erLastChar;
+ BYTE erDefaultChar;
+ BYTE erBreakChar;
+ short int erWidthBytes;
+ unsigned long int erDevice;
+ unsigned long int erFace;
+ unsigned long int erBitsPointer;
+ unsigned long int erBitsOffset;
+ BYTE erReservedByte;
+ short int erUnderlinePos;
+ short int erUnderlineThick;
+ short int erStrikeoutPos;
+ short int erStrikeoutThick;
+} SCALABLEFONTINFO;
+
+
+typedef struct {
+ short int ftHeight;
+ short int ftWidth;
+ short int ftEscapement;
+ short int ftOrientation;
+ short int ftWeight;
+ BYTE ftItalic;
+ BYTE ftUnderline;
+ BYTE ftStrikeOut;
+ BYTE ftOutPrecision;
+ BYTE ftClipPrecision;
+ unsigned short int ftAccelerator;
+ short int ftOverhang;
+} TEXTXFORM;
+
+
+typedef struct {
+ short int tmHeight;
+ short int tmAscent;
+ short int tmDescent;
+ short int tmInternalLeading;
+ short int tmExternalLeading;
+ short int tmAveCharWidth;
+ short int tmMaxCharWidth;
+ short int tmWeight;
+ BYTE tmItalic;
+ BYTE tmUnderlined;
+ BYTE tmStruckOut;
+ BYTE tmFirstChar;
+ BYTE tmLastChar;
+ BYTE tmDefaultChar;
+ BYTE tmBreakChar;
+ BYTE tmPitchAndFamily;
+ BYTE tmCharSet;
+ short int tmOverhang;
+ short int tmDigitizedAspectX;
+ short int tmDigitizedAspectY;
+} TEXTMETRIC;
+
+typedef struct {
+ short int Rop2;
+ short int bkMode;
+ unsigned long int bkColor;
+ unsigned long int TextColor;
+ short int TBreakExtra;
+ short int BreakExtra;
+ short int BreakErr;
+ short int BreakRem;
+ short int BreakCount;
+ short int CharExtra;
+ unsigned long int LbkColor;
+ unsigned long int LTextColor;
+ DWORD ICMCXform;
+ short StretchBltMode;
+ DWORD eMiterLimit;
+} DRAWMODE;
+
+
+/* Background Mode definitions. */
+#define TRANSPARENT 1
+#define OPAQUE 2
+
+#define BKMODE_TRANSPARENT 1
+#define BKMODE_OPAQUE 2
+#define BKMODE_LEVEL1 3
+#define BKMODE_LEVEL2 4
+#define BKMODE_LEVEL3 5
+#define BKMODE_TRANSLATE 6
+
+/* StretchBlt Mode definitions. */
+#define STRETCH_ANDSCANS 1
+#define STRETCH_ORSCANS 2
+#define STRETCH_DELETESCANS 3
+#define STRETCH_HALFTONE 4
+
+#define SBM_BLACKONWHITE STRETCH_ANDSCANS
+#define SBM_WHITEONBLACK STRETCH_ORSCANS
+#define SBM_COLORONCOLOR STRETCH_DELETESCANS
+#define SBM_HALFTONE STRETCH_HALFTONE
+
+typedef struct {
+ short int scnPntCnt;
+ short int scnPntTop;
+ short int scnPntBottom;
+ short int scnPntX[2];
+ short int scnPntCntToo;
+} SCAN, FAR* LPSCAN;
+
+typedef struct {
+ DWORD cbSize;
+ LPVOID lpDestDev;
+ DWORD nEscape;
+ DWORD cbInput;
+ LPVOID lpInput;
+ POINT ptOrigin;
+ DWORD dwUniq;
+ RECT rcBBox;
+ DWORD cScans;
+ LPSCAN lpScan;
+} DRAWESCAPE, FAR* LPDRAWESCAPE;
+
+typedef struct {
+ WORD id;
+ WORD cbSize;
+ LPRECT lprcClip;
+ DWORD dwUniq;
+ RECT rcBBox;
+ DWORD cScans;
+ LPSCAN lpScan;
+} REGION, FAR* LPREGION;
+
+
+/* Output Style definitions. */
+
+#define OS_POLYBEZIER 1
+#define OS_ARC 3
+#define OS_SCANLINES 4
+#define OS_POLYSCANLINE 5
+#define OS_RECTANGLE 6
+#define OS_ELLIPSE 7
+#define OS_MARKER 8
+#define OS_POLYLINE 18
+#define OS_TRAPEZOID 20
+#define OS_WINDPOLYGON OS_TRAPEZOID
+#define OS_POLYGON 22
+#define OS_ALTPOLYGON OS_POLYGON
+#define OS_PIE 23
+#define OS_POLYMARKER 24
+#define OS_CHORD 39
+#define OS_CIRCLE 55
+
+#define OS_POLYPOLYGON 0x4000 /* ORed with OS_WIND/ALTPOLYGON. */
+
+#define OS_BEGINNSCAN 80
+#define OS_ENDNSCAN 81
+
+#define OEM_FAILED 0x80000000L
+
+#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 SETPRINTERDC 9 /* DDK: between GDI and Driver. */
+#define SETABORTPROC 9 /* SDK: between application and GDI. */
+#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
+#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 GETVERSION 36
+#define POSTSCRIPT_DATA 37
+#define POSTSCRIPT_IGNORE 38
+#define QUERYROPSUPPORT 40
+#define GETDEVICEUNITS 42
+#define RESETDEVICE 128
+#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 QUERYDIBSUPPORT 3073
+#define QDI_SETDIBITS 0x0001
+#define QDI_GETDIBITS 0x0002
+#define QDI_DIBTOSCREEN 0x0004
+#define QDI_STRETCHDIB 0x0008
+#define DCICOMMAND 3075
+#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 OPENCHANNEL 4110
+#define DOWNLOADHEADER 4111
+#define CLOSECHANNEL 4112
+#define SETGDIXFORM 4113
+#define RESETPAGE 4114
+#define POSTSCRIPT_PASSTHROUGH 4115
+#define ENCAPSULATED_POSTSCRIPT 4116
+
+
+typedef FONTINFO FAR *LPFONTINFO;
+typedef DRAWMODE FAR *LPDRAWMODE;
+typedef TEXTXFORM FAR *LPTEXTXFORM;
+typedef TEXTMETRIC FAR *LPTEXTMETRIC;
+typedef LOGFONT FAR *LPLOGFONT;
+typedef LOGPEN FAR *LPLOGPEN;
+typedef LOGBRUSH FAR *LPLOGBRUSH;
+typedef BITMAP FAR *LPBITMAP;
+typedef FARPROC FAR *LPFARPROC;
+typedef GDIINFO FAR *LPGDIINFO;
+typedef SCALABLEFONTINFO FAR * LPSCALABLEFONTINFO;
+
diff --git a/ddk/minivdd.h b/ddk/minivdd.h new file mode 100644 index 0000000..6fa7d4e --- /dev/null +++ b/ddk/minivdd.h @@ -0,0 +1,114 @@ +
+/* Functions callable via VDD's API entry point, usually called by display
+ * drivers.
+ */
+#define MINIVDD_SVC_BASE_OFFSET 0x80
+#define VDD_DRIVER_REGISTER (0 + MINIVDD_SVC_BASE_OFFSET)
+#define VDD_DRIVER_UNREGISTER (1 + MINIVDD_SVC_BASE_OFFSET)
+#define VDD_SAVE_DRIVER_STATE (2 + MINIVDD_SVC_BASE_OFFSET)
+#define VDD_REGISTER_DISPLAY_DRIVER_INFO (3 + MINIVDD_SVC_BASE_OFFSET)
+#define VDD_REGISTER_SSB_FLAGS (4 + MINIVDD_SVC_BASE_OFFSET)
+#define VDD_GET_DISPLAY_CONFIG (5 + MINIVDD_SVC_BASE_OFFSET)
+#define VDD_PRE_MODE_CHANGE (6 + MINIVDD_SVC_BASE_OFFSET)
+#define VDD_POST_MODE_CHANGE (7 + MINIVDD_SVC_BASE_OFFSET)
+#define VDD_SET_USER_FLAGS (8 + MINIVDD_SVC_BASE_OFFSET)
+#define VDD_SET_BUSY_FLAG_ADDR (9 + MINIVDD_SVC_BASE_OFFSET)
+
+/* The DISPLAYINFO structure for querying Registry information. */
+typedef struct {
+ WORD diHdrSize;
+ WORD diInfoFlags;
+ DWORD diDevNodeHandle;
+ char diDriverName[16];
+ WORD diXRes;
+ WORD diYRes;
+ WORD diDPI;
+ BYTE diPlanes;
+ BYTE diBpp;
+ WORD diRefreshRateMax;
+ WORD diRefreshRateMin;
+ WORD diLowHorz;
+ WORD diHighHorz;
+ WORD diLowVert;
+ WORD diHighVert;
+ DWORD diMonitorDevNodeHandle;
+ BYTE diHorzSyncPolarity;
+ BYTE diVertSyncPolarity;
+} DISPLAYINFO;
+
+/* diInfoFlags */
+#define RETURNED_DATA_IS_STALE 0x001 /* VDD couldn't read Registry, data could be old. */
+#define MINIVDD_FAILED_TO_LOAD 0x002 /* MiniVDD did not load, probably bad config. */
+#define MINIVDD_CHIP_ID_DIDNT_MATCH 0x004 /* ChipID mismatch, probably bad config. */
+#define REGISTRY_BPP_NOT_VALID 0x008 /* BPP could not be read from Registry. */
+#define REGISTRY_RESOLUTION_NOT_VALID 0x010 /* Resolution could not be read from Registry. */
+#define REGISTRY_DPI_NOT_VALID 0x020 /* DPI could not be read from Registry. */
+#define MONITOR_DEVNODE_NOT_ACTIVE 0x040 /* Devnode not there, no refresh rate data. */
+#define MONITOR_INFO_NOT_VALID 0x080 /* Refresh rate data could not be read. */
+#define MONITOR_INFO_DISABLED_BY_USER 0x100 /* Refresh rate data not valid. */
+#define REFRESH_RATE_MAX_ONLY 0x200 /* Only diRefreshRateMax is valid. */
+#define CARD_VDD_LOADED_OK 0x400 /* Second MiniVDD loaded fine. */
+
+/* Funcrions callable in a mini-VDD. */
+#define REGISTER_DISPLAY_DRIVER 0
+#define GET_VDD_BANK 1
+#define SET_VDD_BANK 2
+#define RESET_BANK 3
+#define PRE_HIRES_TO_VGA 4
+#define POST_HIRES_TO_VGA 5
+#define PRE_VGA_TO_HIRES 6
+#define POST_VGA_TO_HIRES 7
+#define SAVE_REGISTERS 8
+#define RESTORE_REGISTERS 9
+#define MODIFY_REGISTER_STATE 10
+#define ACCESS_VGA_MEMORY_MODE 11
+#define ACCESS_LINEAR_MEMORY_MODE 12
+#define ENABLE_TRAPS 13
+#define DISABLE_TRAPS 14
+#define MAKE_HARDWARE_NOT_BUSY 15
+#define VIRTUALIZE_CRTC_IN 16
+#define VIRTUALIZE_CRTC_OUT 17
+#define VIRTUALIZE_SEQUENCER_IN 18
+#define VIRTUALIZE_SEQUENCER_OUT 19
+#define VIRTUALIZE_GCR_IN 20
+#define VIRTUALIZE_GCR_OUT 21
+#define SET_LATCH_BANK 22
+#define RESET_LATCH_BANK 23
+#define SAVE_LATCHES 24
+#define RESTORE_LATCHES 25
+#define DISPLAY_DRIVER_DISABLING 26
+#define SELECT_PLANE 27
+#define PRE_CRTC_MODE_CHANGE 28
+#define POST_CRTC_MODE_CHANGE 29
+#define VIRTUALIZE_DAC_OUT 30
+#define VIRTUALIZE_DAC_IN 31
+#define GET_CURRENT_BANK_WRITE 32
+#define GET_CURRENT_BANK_READ 33
+#define SET_BANK 34
+#define CHECK_HIRES_MODE 35
+#define GET_TOTAL_VRAM_SIZE 36
+#define GET_BANK_SIZE 37
+#define SET_HIRES_MODE 38
+#define PRE_HIRES_SAVE_RESTORE 39
+#define POST_HIRES_SAVE_RESTORE 40
+#define VESA_SUPPORT 41
+#define GET_CHIP_ID 42
+#define CHECK_SCREEN_SWITCH_OK 43
+#define VIRTUALIZE_BLTER_IO 44
+#define SAVE_MESSAGE_MODE_STATE 45
+#define SAVE_FORCED_PLANAR_STATE 46
+#define VESA_CALL_POST_PROCESSING 47
+#define PRE_INT_10_MODE_SET 48
+
+#define NBR_MINI_VDD_FUNCTIONS 49
+
+/* Port sizes. */
+#define BYTE_LENGTHED 1
+#define WORD_LENGTHED 2
+
+/* Flag bits. */
+#define GOING_TO_WINDOWS_MODE 1
+#define GOING_TO_VGA_MODE 2
+#define DISPLAY_DRIVER_DISABLED 4
+#define IN_WINDOWS_HIRES_MODE 8
+
diff --git a/ddk/valmode.h b/ddk/valmode.h new file mode 100644 index 0000000..0fccdcb --- /dev/null +++ b/ddk/valmode.h @@ -0,0 +1,20 @@ +
+/* Return values for ValidateMode. */
+#define VALMODE_YES 0 /* Mode is good. */
+#define VALMODE_NO_WRONGDRV 1 /* Hardware not supported by driver. */
+#define VALMODE_NO_NOMEM 2 /* Insufficient video memory. */
+#define VALMODE_NO_NODAC 3 /* DAC cannot handle bit depth. */
+#define VALMODE_NO_UNKNOWN 4 /* Some other problem. */
+
+
+/* Structure describing a display mode. */
+typedef struct {
+ UINT dvmSize; /* Size of this struct. */
+ UINT dvmBpp; /* Mode color depth. */
+ int dvmXRes; /* Mode X resolution. */
+ int dvmYRes; /* Mode Y resolution. */
+} DISPVALMODE;
+
+/* Must be exported by name from driver. Recommended ordinal is 700. */
+extern UINT WINAPI ValidateMode( DISPVALMODE FAR *lpMode );
+
|