source: Include/api_gdi.sbp@ 141

Last change on this file since 141 was 141, checked in by イグトランス (egtra), 17 years ago

#50 API宣言の変更完了

File size: 50.7 KB
Line 
1' api_gdi.sbp - Graphics Device Integerface API
2
3
4#ifndef _INC_GDI
5#define _INC_GDI
6
7#ifdef UNICODE
8Const _FuncName_CopyEnhMetaFile = "CopyEnhMetaFileW"
9Const _FuncName_CopyMetaFile = "CopyMetaFileW"
10Const _FuncName_CreateDC = "CreateDCW"
11Const _FuncName_CreateEnhMetaFile = "CreateEnhMetaFileW"
12Const _FuncName_CreateMetaFile = "CreateMetaFileW"
13Const _FuncName_CreateFont = "CreateFontW"
14Const _FuncName_CreateFontIndirect = "CreateFontIndirectW"
15Const _FuncName_GetEnhMetaFile = "GetEnhMetaFileW"
16Const _FuncName_GetEnhMetaFileDescription = "GetEnhMetaFileDescriptionW"
17Const _FuncName_GetObject = "GetObjectW"
18Const _FuncName_GetTextMetrics = "GetTextMetricsW"
19Const _FuncName_ResetDC = "ResetDCW"
20Const _FuncName_StartDoc = "StartDocW"
21Const _FuncName_wglUseFontBitmaps = "wglUseFontBitmapsW"
22Const _FuncName_wglUseFontOutlines = "wglUseFontOutlinesW"
23#else
24Const _FuncName_CopyEnhMetaFile = "CopyEnhMetaFileA"
25Const _FuncName_CopyMetaFile = "CopyMetaFileA"
26Const _FuncName_CreateDC = "CreateDCA"
27Const _FuncName_CreateEnhMetaFile = "CreateEnhMetaFileA"
28Const _FuncName_CreateMetaFile = "CreateMetaFileA"
29Const _FuncName_CreateFont = "CreateFontA"
30Const _FuncName_CreateFontIndirect = "CreateFontIndirectA"
31Const _FuncName_GetEnhMetaFile = "GetEnhMetaFileA"
32Const _FuncName_GetEnhMetaFileDescription = "GetEnhMetaFileDescriptionA"
33Const _FuncName_GetObject = "GetObjectA"
34Const _FuncName_GetTextMetrics = "GetTextMetricsA"
35Const _FuncName_ResetDC = "ResetDCA"
36Const _FuncName_StartDoc = "StartDocA"
37Const _FuncName_wglUseFontBitmaps = "wglUseFontBitmapsA"
38Const _FuncName_wglUseFontOutlines = "wglUseFontOutlinesA"
39#endif
40
41Const CLR_INVALID = &HFFFFFFFF
42Const GDI_ERROR = &HFFFFFFFF
43
44TypeDef BCHAR = TBYTE
45
46Type _System_DeclareHandle_HPALETTE:unused As DWord:End Type
47TypeDef HPALETTE = *_System_DeclareHandle_HPALETTE
48
49' Point/Rectangle/Size struct
50Type POINTAPI
51 x As Long
52 y As Long
53End Type
54
55Type RECT
56 left As Long
57 top As Long
58 right As Long
59 bottom As Long
60End Type
61
62Type SIZE
63 cx As Long
64 cy As Long
65End Type
66
67' Metafile and EnhancedMetafile
68Type EMR
69 iType As DWord
70 nSize As DWord
71End Type
72
73Type Align(2) METAHEADER
74 mtType As Word
75 mtHeaderSize As Word
76 mtVersion As Word
77 mtSize As DWord
78 mtNoObjects As Word
79 mtMaxRecord As DWord
80 mtNoParameters As Word
81End Type
82TypeDef PMETAHEADER = *METAHEADER
83
84Type ENHMETAHEADER
85 iType As DWord
86 nSize As DWord
87 rclBounds As RECT
88 rclFrame As RECT
89 dSignature As DWord
90 nVersion As DWord
91 nBytes As DWord
92 nRecords As DWord
93 nHandles As Word
94 sReserved As Word
95 nDescription As DWord
96 offDescription As DWord
97 nPalEntries As DWord
98 szlDevice As SIZE
99 szlMillimeters As SIZE
100 cbPixelFormat As DWord
101 offPixelFormat As DWord
102 bOpenGL As DWord
103'#if WINVER >= 0x0500
104 'szlMicrometers As SIZE
105'#endif
106End Type
107TypeDef PENHMETAHEADER = *ENHMETAHEADER
108
109Type HANDLETABLE
110 objectHandle[ELM(1)] As HGDIOBJ
111End Type
112
113Type METARECORD
114 rdSize As DWord
115 rdFunction As Word
116 rdParm[ELM(1)] As Word
117End Type
118
119Type ENHMETARECORD
120 iType As DWord
121 nSize As DWord
122 dParm[ELM(1)] As DWord
123End Type
124
125Type METAFILEPICT
126 mm As Long
127 xExt As Long
128 yExt As Long
129 hMF As HMETAFILE
130End Type
131
132TypeDef ENHMFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef EMFR As ENHMETARECORD, nObj As Long, lpData As LPARAM) As Long
133TypeDef MFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef MFR As METARECORD, nObj As Long, lpClientData As LPARAM)
134
135
136' RGB Color
137Const RGB(r, g, b) = ((r) As Long) Or (((g) As Long) <<8) Or (((b) As Long) <<16)
138Const PALETTERGB(r, g, b) = (&h02000000 Or RGB(r,g,b))
139Const PALETTEINDEX(i) = ((&h01000000 Or (i) As Word As DWord) As COLORREF)
140
141Const GetRValue(rgb) = (rgb And &hff)
142Const GetGValue(rgb) = ((rgb >> 8) And &hff)
143Const GetBValue(rgb) = ((rgb >> 16) And &hff)
144
145Type RGBQUAD
146 rgbBlue As Byte
147 rgbGreen As Byte
148 rgbRed As Byte
149 rgbReserved As Byte
150End Type
151
152Type Align(1) RGBTRIPLE
153 rgbtBlue As Byte
154 rgbtGreen As Byte
155 rgbtRed As Byte
156End Type
157
158' CMYK Color
159Const GetKValue(cmyk) = ((cmyk) As Byte)
160Const GetYValue(cmyk) = (((cmyk) >> 8) As Byte)
161Const GetMValue(cmyk) = (((cmyk) >> 16) As Byte)
162Const GetCValue(cmyk) = (((cmyk) >> 24) As Byte)
163
164Const CMYK(c, m, y, k) = (( _
165 ((k) As Byte) Or _
166 ((y) As Byte As Word << 8) Or _
167 ((m) As Byte As DWord << 16) Or _
168 ((c) As Byte As DWord << 24)) As COLORREF)
169
170' ICM Color
171TypeDef FXPT16DOT16 = Long
172TypeDef FXPT2DOT30 = Long
173
174TypeDef LCSCSTYPE = Long
175TypeDef LCSGAMUTMATCH = Long
176
177Type LOGCOLORSPACEA
178 lcsSignature As DWord
179 lcsVersion As DWord
180 lcsSize As DWord
181 lcsCSType As LCSCSTYPE
182 lcsIntent As LCSGAMUTMATCH
183 lcsEndpoints As CIEXYZTRIPLE
184 lcsGammaRed As DWord
185 lcsGammaGreen As DWord
186 lcsGammaBlue As DWord
187 lcsFilename[MAX_PATH] As SByte
188End Type
189Type LOGCOLORSPACEW
190 lcsSignature As DWord
191 lcsVersion As DWord
192 lcsSize As DWord
193 lcsCSType As LCSCSTYPE
194 lcsIntent As LCSGAMUTMATCH
195 lcsEndpoints As CIEXYZTRIPLE
196 lcsGammaRed As DWord
197 lcsGammaGreen As DWord
198 lcsGammaBlue As DWord
199 lcsFilename[ELM(MAX_PATH)] As WCHAR
200End Type
201#ifdef UNICODE
202TypeDef LOGCOLORSPACE = LOGCOLORSPACEW
203#else
204TypeDef LOGCOLORSPACE = LOGCOLORSPACEA
205#endif
206
207Type CIEXYZ
208 ciexyzX As FXPT2DOT30
209 ciexyzY As FXPT2DOT30
210 ciexyzZ As FXPT2DOT30
211End Type
212
213Type CIEXYZTRIPLE
214 ciexyzRed As CIEXYZ
215 ciexyzGreen As CIEXYZ
216 ciexyzBlue As CIEXYZ
217End Type
218
219
220
221' raster operations
222Const SRCCOPY = &H00CC0020
223Const SRCPAINT = &H00EE0086
224Const SRCAND = &H008800C6
225Const SRCINVERT = &H00660046
226Const SRCERASE = &H00440328
227Const NOTSRCCOPY = &H00330008
228Const NOTSRCERASE = &H001100A6
229Const MERGECOPY = &H00C000CA
230Const MERGEPAINT = &H00BB0226
231Const PATCOPY = &H00F00021
232Const PATPAINT = &H00FB0A09
233Const PATINVERT = &H005A0049
234Const DSTINVERT = &H00550009
235Const BLACKNESS = &H00000042
236Const WHITENESS = &H00FF0062
237
238
239' Object types
240Const OBJ_PEN = 1
241Const OBJ_BRUSH = 2
242Const OBJ_DC = 3
243Const OBJ_METADC = 4
244Const OBJ_PAL = 5
245Const OBJ_FONT = 6
246Const OBJ_BITMAP = 7
247Const OBJ_REGION = 8
248Const OBJ_METAFILE = 9
249Const OBJ_MEMDC = 10
250Const OBJ_EXTPEN = 11
251Const OBJ_ENHMETADC = 12
252Const OBJ_ENHMETAFILE = 13
253
254
255' Bitmap Header Definition
256Type BITMAP
257 bmType As Long
258 bmWidth As Long
259 bmHeight As Long
260 bmWidthBytes As Long
261 bmPlanes As Word
262 bmBitsPixel As Word
263 bmBits As VoidPtr
264End Type
265
266Type BITMAPCOREHEADER
267 bcSize As DWord
268 bcWidth As Word
269 bcHeight As Word
270 bcPlanes As Word
271 bcBitCount As Word
272End Type
273
274Type BITMAPCOREINFO
275 bmciHeader As BITMAPCOREHEADER
276 bmciColors[ELM(1)] As RGBTRIPLE
277End Type
278
279' structures for defining DIBs
280Const BI_RGB = 0
281Const BI_RLE8 = 1
282Const BI_RLE4 = 2
283Const BI_BITFIELDS = 3
284Const BI_JPEG = 4
285Const BI_PNG = 5
286
287Type BITMAPINFOHEADER
288 biSize As DWord
289 biWidth As Long
290 biHeight As Long
291 biPlanes As Word
292 biBitCount As Word
293 biCompression As DWord
294 biSizeImage As DWord
295 biXPelsPerMeter As Long
296 biYPelsPerMeter As Long
297 biClrUsed As DWord
298 biClrImportant As DWord
299End Type
300
301Type BITMAPINFO
302 bmiHeader As BITMAPINFOHEADER
303 bmiColors[ELM(1)] As RGBQUAD '以前はbmpColors[255] As RGBQUADだったことに注意
304End Type
305
306
307' Bitmap file header struct
308Type Align(2) BITMAPFILEHEADER
309 bfType As Word
310 bfSize As DWord
311 bfReserved1 As Word
312 bfReserved2 As Word
313 bfOffBits As DWord
314End Type
315
316Type BITMAPV4HEADER
317 bV4Size As DWord
318 bV4Width As Long
319 bV4Height As Long
320 bV4Planes As Word
321 bV4BitCount As Word
322 bV4V4Compression As DWord
323 bV4SizeImage As DWord
324 bV4XPelsPerMeter As Long
325 bV4YPelsPerMeter As Long
326 bV4ClrUsed As DWord
327 bV4ClrImportant As DWord
328 bV4RedMask As DWord
329 bV4GreenMask As DWord
330 bV4BlueMask As DWord
331 bV4AlphaMask As DWord
332 bV4CSType As DWord
333 bV4Endpoints As CIEXYZTRIPLE
334 bV4GammaRed As DWord
335 bV4GammaGreen As DWord
336 bV4GammaBlue As DWord
337End Type
338
339' Region flags
340Const NULLREGION = 1
341Const SIMPLEREGION = 2
342Const COMPLEXREGION = 3
343
344
345' Poly fill mode
346Const ALTERNATE = 1
347Const WINDING = 2
348
349
350' Device mode
351Const DM_ORIENTATION = &H00000001
352Const DM_PAPERSIZE = &H00000002
353Const DM_PAPERLENGTH = &H00000004
354Const DM_PAPERWIDTH = &H00000008
355Const DM_SCALE = &H00000010
356Const DM_POSITION = &H00000020
357Const DM_COPIES = &H00000100
358Const DM_DEFAULTSOURCE = &H00000200
359Const DM_PRINTQUALITY = &H00000400
360Const DM_COLOR = &H00000800
361Const DM_DUPLEX = &H00001000
362Const DM_YRESOLUTION = &H00002000
363Const DM_TTOPTION = &H00004000
364Const DM_COLLATE = &H00008000
365Const DM_FORMNAME = &H00010000
366Const DM_LOGPIXELS = &H00020000
367Const DM_BITSPERPEL = &H00040000
368Const DM_PELSWIDTH = &H00080000
369Const DM_PELSHEIGHT = &H00100000
370Const DM_DISPLAYFLAGS = &H00200000
371Const DM_DISPLAYFREQUENCY = &H00400000
372Const DMORIENT_PORTRAIT = 1
373Const DMORIENT_LANDSCAPE = 2
374Const DMPAPER_LETTER = 1
375Const DMPAPER_LETTERSMALL = 2
376Const DMPAPER_TABLOID = 3
377Const DMPAPER_LEDGER = 4
378Const DMPAPER_LEGAL = 5
379Const DMPAPER_STATEMENT = 6
380Const DMPAPER_EXECUTIVE = 7
381Const DMPAPER_A3 = 8
382Const DMPAPER_A4 = 9
383Const DMPAPER_A4SMALL = 10
384Const DMPAPER_A5 = 11
385Const DMPAPER_B4 = 12
386Const DMPAPER_B5 = 13
387Const DMPAPER_FOLIO = 14
388Const DMPAPER_QUARTO = 15
389Const DMPAPER_10X14 = 16
390Const DMPAPER_11X17 = 17
391Const DMPAPER_NOTE = 18
392Const DMPAPER_ENV_9 = 19
393Const DMPAPER_ENV_10 = 20
394Const DMPAPER_ENV_11 = 21
395Const DMPAPER_ENV_12 = 22
396Const DMPAPER_ENV_14 = 23
397Const DMPAPER_CSHEET = 24
398Const DMPAPER_DSHEET = 25
399Const DMPAPER_ESHEET = 26
400Const DMPAPER_ENV_DL = 27
401Const DMPAPER_ENV_C5 = 28
402Const DMPAPER_ENV_C3 = 29
403Const DMPAPER_ENV_C4 = 30
404Const DMPAPER_ENV_C6 = 31
405Const DMPAPER_ENV_C65 = 32
406Const DMPAPER_ENV_B4 = 33
407Const DMPAPER_ENV_B5 = 34
408Const DMPAPER_ENV_B6 = 35
409Const DMPAPER_ENV_ITALY = 36
410Const DMPAPER_ENV_MONARCH = 37
411Const DMPAPER_ENV_PERSONAL = 38
412Const DMPAPER_FANFOLD_US = 39
413Const DMPAPER_FANFOLD_STD_GERMAN = 40
414Const DMPAPER_FANFOLD_LGL_GERMAN = 41
415Const DMRES_DRAFT = -1
416Const DMRES_LOW = -2
417Const DMRES_MEDIUM = -3
418Const DMRES_HIGH = -4
419Const DMCOLOR_MONOCHROME = 1
420Const DMCOLOR_COLOR = 2
421Const DMDUP_SIMPLEX = 1
422Const DMDUP_VERTICAL = 2
423Const DMDUP_HORIZONTAL = 3
424Const DMTT_BITMAP = 1
425Const DMTT_DOWNLOAD = 2
426Const DMTT_SUBDEV = 3
427Const DMCOLLATE_FALSE = 0
428Const DMCOLLATE_TRUE = 1
429
430Const CCHDEVICENAME = 32
431Const CCHFORMNAME = 32
432Type DEVMODEW
433 dmDeviceName[ELM(CCHDEVICENAME)] As WCHAR
434 dmSpecVersion As Word
435 dmDriverVersion As Word
436 dmSize As Word
437 dmDriverExtra As Word
438 dmFields As DWord
439 dmOrientation As Integer
440 dmPaperSize As Integer
441 dmPaperLength As Integer
442 dmPaperWidth As Integer
443 dmScale As Integer
444 dmCopies As Integer
445 dmDefaultSource As Integer
446 dmPrintQuality As Integer
447 dmColor As Integer
448 dmDuplex As Integer
449 dmYResolution As Integer
450 dmTTOption As Integer
451 dmCollate As Integer
452 dmFormName[ELM(CCHFORMNAME)] As WCHAR
453 dmLogPixels As Word
454 dmBitsPerPel As DWord
455 dmPelsWidth As DWord
456 dmPelsHeight As DWord
457 dmDisplayFlags As DWord
458 dmDisplayFrequency As DWord
459 dmICMMethod As DWord
460 dmICMIntent As DWord
461 dmMediaType As DWord
462 dmDitherType As DWord
463 dmReserved1 As DWord
464 dmReserved2 As DWord
465 dmPanningWidth As DWord
466 dmPanningHeight As DWord
467End Type
468Type DEVMODEA
469 dmDeviceName[ELM(CCHDEVICENAME)] As SByte
470 dmSpecVersion As Word
471 dmDriverVersion As Word
472 dmSize As Word
473 dmDriverExtra As Word
474 dmFields As DWord
475 dmOrientation As Integer
476 dmPaperSize As Integer
477 dmPaperLength As Integer
478 dmPaperWidth As Integer
479 dmScale As Integer
480 dmCopies As Integer
481 dmDefaultSource As Integer
482 dmPrintQuality As Integer
483 dmColor As Integer
484 dmDuplex As Integer
485 dmYResolution As Integer
486 dmTTOption As Integer
487 dmCollate As Integer
488 dmFormName[ELM(CCHFORMNAME)] As SByte
489 dmLogPixels As Word
490 dmBitsPerPel As DWord
491 dmPelsWidth As DWord
492 dmPelsHeight As DWord
493 dmDisplayFlags As DWord
494 dmDisplayFrequency As DWord
495 dmICMMethod As DWord
496 dmICMIntent As DWord
497 dmMediaType As DWord
498 dmDitherType As DWord
499 dmReserved1 As DWord
500 dmReserved2 As DWord
501 dmPanningWidth As DWord
502 dmPanningHeight As DWord
503End Type
504#ifdef UNICODE
505TypeDef DEVMODE = DEVMODEW
506#else
507TypeDef DEVMODE = DEVMODEA
508#endif
509
510' Binary raster ops
511Const R2_BLACK = 1
512Const R2_NOTMERGEPEN = 2
513Const R2_MASKNOTPEN = 3
514Const R2_NOTCOPYPEN = 4
515Const R2_MASKPENNOT = 5
516Const R2_NOT = 6
517Const R2_XORPEN = 7
518Const R2_NOTMASKPEN = 8
519Const R2_MASKPEN = 9
520Const R2_NOTXORPEN = 10
521Const R2_NOP = 11
522Const R2_MERGENOTPEN = 12
523Const R2_COPYPEN = 13
524Const R2_MERGEPENNOT = 14
525Const R2_MERGEPEN = 15
526Const R2_WHITE = 16
527
528
529Type RGNDATAHEADER
530 dwSize As DWord
531 iType As DWord
532 nCount As DWord
533 nRgnSize As DWord
534 rcBound As RECT
535End Type
536Type RGNDATA
537 rdh As RGNDATAHEADER
538 Buffer As Byte
539End Type
540
541Type PALETTEENTRY
542 peRed As Byte
543 peGreen As Byte
544 peBlue As Byte
545 peFlags As Byte
546End Type
547
548Type DOCINFOW
549 cbSize As Long
550 lpszDocName As LPCWSTR
551 lpszOutput As LPCWSTR
552 lpszDatatype As LPCWSTR
553 fwType As DWord
554End Type
555Type DOCINFOA
556 cbSize As Long
557 lpszDocName As LPCSTR
558 lpszOutput As LPCSTR
559 lpszDatatype As LPCSTR
560 fwType As DWord
561End Type
562#ifdef UNICODE
563TypeDef DOCINFO = DOCINFOW
564#else
565TypeDef DOCINFO = DOCINFOA
566#endif
567
568'-------------------
569' GDI API Functions
570'-------------------
571
572Declare Function AbortPath Lib "gdi32" (hdc As HDC) As BOOL
573Declare Function Arc Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nXStartArc As Long, nYStartArc As Long, nXEndArc As Long, nYEndArc As Long) As BOOL
574Declare Function BeginPath Lib "gdi32" (hdc As HDC) As BOOL
575Declare Function BitBlt Lib "gdi32" (hdcDest As HDC, nXDest As Long, nYDest As Long, nWidth As Long, nHeight As Long, hdcSrc As HDC, nXSrc As Long, nYSrc As Long, dwRop As DWord) As BOOL
576Declare Function CancelDC Lib "gdi32" (hdc As HDC) As BOOL
577Declare Function Chord Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nXRadial1 As Long, nYRadial1 As Long, nXRadial2 As Long, nYRadial2 As Long) As BOOL
578Declare Function CloseEnhMetaFile Lib "gdi32" (hdc As HDC) As HENHMETAFILE
579Declare Function CloseFigure Lib "gdi32" (hdc As HDC) As BOOL
580Declare Function CloseMetaFile Lib "gdi32" (hdc As HDC) As HMETAFILE
581
582Const RGN_AND = 1
583Const RGN_OR = 2
584Const RGN_XOR = 3
585Const RGN_DIFF = 4
586Const RGN_COPY = 5
587Declare Function CombineRgn Lib "gdi32" (hrgnDest As HRGN, hrgnSrc1 As HRGN, hrgnSrc2 As HRGN, fnCombineMode As Long) As Long
588Declare Function CopyEnhMetaFile Lib "gdi32" Alias _FuncName_CopyEnhMetaFile (hemfSrc As HENHMETAFILE, pszFile As PCTSTR) As HENHMETAFILE
589Declare Function CopyMetaFile Lib "gdi32" Alias _FuncName_CopyMetaFile (hmfSrc As HMETAFILE, pszFile As PCTSTR) As HMETAFILE
590Declare Function CreateBitmap Lib "gdi32" (nWidth As Long, nHeight As Long, cPlanes As Long, cBitsPerPel As Long, lpvBits As VoidPtr) As HBITMAP
591Declare Function CreateBitmapIndirect Lib "gdi32" (ByRef bm As BITMAP) As HBITMAP
592
593Const BS_SOLID = 0
594Const BS_NULL = 1
595Const BS_HOLLOW = BS_NULL
596Const BS_HATCHED = 2
597Const BS_PATTERN = 3
598Const BS_INDEXED = 4
599Const BS_DIBPATTERN = 5
600Const BS_DIBPATTERNPT = 6
601Const BS_PATTERN8X8 = 7
602Const BS_DIBPATTERN8X8 = 8
603Const BS_MONOPATTERN = 9
604Const DIB_RGB_COLORS = 0
605Const DIB_PAL_COLORS = 1
606Const HS_HORIZONTAL = 0
607Const HS_VERTICAL = 1
608Const HS_FDIAGONAL = 2
609Const HS_BDIAGONAL = 3
610Const HS_CROSS = 4
611Const HS_DIAGCROSS = 5
612Type LOGBRUSH
613 lbStyle As Long
614 lbColor As Long
615 lbHatch As Long
616End Type
617Declare Function CreateBrushIndirect Lib "gdi32" (ByRef lplb As LOGBRUSH) As HBRUSH
618
619Declare Function CreateCompatibleBitmap Lib "gdi32" (hdc As HDC, nWidth As Long, nHeight As Long) As HBITMAP
620Declare Function CreateCompatibleDC Lib "gdi32" (hdc As HDC) As HDC
621Declare Function CreateDC Lib "gdi32" Alias _FuncName_CreateDC (pszDriver As PCTSTR, pszDevice As PCTSTR, pszOutput As PCTSTR, ByRef InitData As DEVMODE) As HDC
622
623Const CBM_INIT = &H04
624Declare Function CreateDIBitmap Lib "gdi32" (hdc As HDC, ByRef bmih As BITMAPINFOHEADER, fdwInit As Long, lpbInit As VoidPtr, ByRef bmi As BITMAPINFO, fuUsage As Long) As HBITMAP
625
626Declare Function CreateDIBPatternBrushPt Lib "gdi32" (lpPackedDIB As VoidPtr, iUsage As Long) As HBRUSH
627Declare Function CreateDIBSection Lib "gdi32" (hdc As HDC, ByRef BmpInfo As BITMAPINFO, iUsage As DWord, ppvBits As *VoidPtr, hSection As HANDLE, dwOffset As DWord) As HBITMAP
628Declare Function CreateEllipticRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As HRGN
629Declare Function CreateEllipticRgnIndirect Lib "gdi32" (ByRef lpRect As RECT) As HRGN
630Declare Function CreateEnhMetaFile Lib "gdi32" Alias _FuncName_CreateEnhMetaFile (hdcRef As HDC, pFileName As PCTSTR, ByRef Rect As RECT, pDescription As PCTSTR) As HDC
631Declare Function CreateMetaFile Lib "gdi32" Alias _FuncName_CreateMetaFile (pFileName As PCTSTR) As HDC
632
633Const FW_DONTCARE = 0
634Const FW_THIN = 100
635Const FW_EXTRALIGHT = 200
636Const FW_LIGHT = 300
637Const FW_NORMAL = 400
638Const FW_MEDIUM = 500
639Const FW_SEMIBOLD = 600
640Const FW_BOLD = 700
641Const FW_EXTRABOLD = 800
642Const FW_HEAVY = 900
643Const FW_ULTRALIGHT = FW_EXTRALIGHT
644Const FW_REGULAR = FW_NORMAL
645Const FW_DEMIBOLD = FW_SEMIBOLD
646Const FW_ULTRABOLD = FW_EXTRABOLD
647Const FW_BLACK = FW_HEAVY
648
649Const ANSI_CHARSET = 0
650Const DEFAULT_CHARSET = 1
651Const SYMBOL_CHARSET = 2
652Const SHIFTJIS_CHARSET = 128
653Const HANGEUL_CHARSET = 129
654Const HANGUL_CHARSET = 129
655Const GB2312_CHARSET = 134
656Const CHINESEBIG5_CHARSET = 136
657Const OEM_CHARSET = 255
658Const JOHAB_CHARSET = 130
659Const HEBREW_CHARSET = 177
660Const ARABIC_CHARSET = 178
661Const GREEK_CHARSET = 161
662Const TURKISH_CHARSET = 162
663Const VIETNAMESE_CHARSET = 163
664Const THAI_CHARSET = 222
665Const EASTEUROPE_CHARSET = 238
666Const RUSSIAN_CHARSET = 204
667Const MAC_CHARSET = 77
668Const BALTIC_CHARSET = 186
669
670Const OUT_DEFAULT_PRECIS = 0
671Const OUT_STRING_PRECIS = 1
672Const OUT_CHARACTER_PRECIS = 2
673Const OUT_STROKE_PRECIS = 3
674Const OUT_TT_PRECIS = 4
675Const OUT_DEVICE_PRECIS = 5
676Const OUT_RASTER_PRECIS = 6
677Const OUT_TT_ONLY_PRECIS = 7
678Const OUT_OUTLINE_PRECIS = 8
679Const OUT_SCREEN_OUTLINE_PRECIS = 9
680
681Const CLIP_DEFAULT_PRECIS = 0
682Const CLIP_CHARACTER_PRECIS = 1
683Const CLIP_STROKE_PRECIS = 2
684Const CLIP_MASK = &Hf
685Const CLIP_LH_ANGLES = &H00010000
686Const CLIP_TT_ALWAYS = &H00020000
687Const CLIP_EMBEDDED = &H00080000
688
689Const DEFAULT_QUALITY = 0
690Const DRAFT_QUALITY = 1
691Const PROOF_QUALITY = 2
692Const NONANTIALIASED_QUALITY =3
693Const ANTIALIASED_QUALITY = 4
694
695Const DEFAULT_PITCH = 0
696Const FIXED_PITCH = 1
697Const VARIABLE_PITCH = 2
698
699Const FF_DONTCARE = 0
700Const FF_ROMAN = &H00010000
701Const FF_SWISS = &H00020000
702Const FF_MODERN = &H00030000
703Const FF_SCRIPT = &H00040000
704Const FF_DECORATIVE = &H00050000
705Declare Function CreateFont Lib "gdi32" Alias _FuncName_CreateFont (nHeight As Long, nWidth As Long, nEscapement As Long, nOrientation As Long, fnWeight As Long, fdwItalic As DWord, fdwUnderline As DWord, fdwStrikeOut As DWord, fdwCharSet As DWord, fdwOutputPrecision As DWord, fdwClipPrecision As DWord, fdwQuality As DWord, fdwPitchAndFamily As DWord, lpszFace As PCTSTR) As HFONT
706
707Const LF_FACESIZE = 32
708Type LOGFONTA
709 lfHeight As Long
710 lfWidth As Long
711 lfEscapement As Long
712 lfOrientation As Long
713 lfWeight As Long
714 lfItalic As Byte
715 lfUnderline As Byte
716 lfStrikeOut As Byte
717 lfCharSet As Byte
718 lfOutPrecision As Byte
719 lfClipPrecision As Byte
720 lfQuality As Byte
721 lfPitchAndFamily As Byte
722 lfFaceName[ELM(LF_FACESIZE)] As SByte
723End Type
724Type LOGFONTW
725 lfHeight As Long
726 lfWidth As Long
727 lfEscapement As Long
728 lfOrientation As Long
729 lfWeight As Long
730 lfItalic As Byte
731 lfUnderline As Byte
732 lfStrikeOut As Byte
733 lfCharSet As Byte
734 lfOutPrecision As Byte
735 lfClipPrecision As Byte
736 lfQuality As Byte
737 lfPitchAndFamily As Byte
738 lfFaceName[ELM(LF_FACESIZE)] As WCHAR
739End Type
740#ifdef UNICODE
741TypeDef LOGFONT = LOGFONTW
742#else
743TypeDef LOGFONT = LOGFONTA
744#endif
745Declare Function CreateFontIndirectA Lib "gdi32" (ByRef lf As LOGFONTA) As HFONT
746Declare Function CreateFontIndirect Lib "gdi32" Alias _FuncName_CreateFontIndirect (ByRef lf As LOGFONT) As HFONT
747
748Declare Function CreateHatchBrush Lib "gdi32" (fnStyle As Long, clrref As COLORREF) As HBRUSH
749Declare Function CreatePatternBrush Lib "gdi32" (hbmp As HBITMAP) As HBRUSH
750
751Const PS_SOLID = 0
752Const PS_DASH = 1
753Const PS_DOT = 2
754Const PS_DASHDOT = 3
755Const PS_DASHDOTDOT = 4
756Const PS_NULL = 5
757Const PS_INSIDEFRAME = 6
758Const PS_USERSTYLE = 7
759Const PS_ALTERNATE = 8
760Declare Function CreatePen Lib "gdi32" (nPenStyle As Long, nWidth As Long, crColor As COLORREF) As HPEN
761
762Type LOGPEN
763 lopnStyle As DWord
764 lopnWidth As POINTAPI
765 lopnColor As COLORREF
766End Type
767Declare Function CreatePenIndirect Lib "gdi32" (ByRef lplgpn As LOGPEN) As HPEN
768
769Declare Function CreatePolygonRgn Lib "gdi32" (ByRef lpPoints As POINTAPI, cPoints As Long, fnPolyFillMode As Long) As HRGN
770Declare Function CreateRectRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As HRGN
771Declare Function CreateRectRgnIndirect Lib "gdi32" (ByRef lpRect As RECT) As HRGN
772Declare Function CreateRoundRectRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nWidthEllipse As Long, nHeightEllipse As Long) As HRGN
773Declare Function CreateSolidBrush Lib "gdi32" (crColor As COLORREF) As HBRUSH
774Declare Function DeleteDC Lib "gdi32" (hdc As HDC) As BOOL
775Declare Function DeleteEnhMetaFile Lib "gdi32" (hemf As HENHMETAFILE) As BOOL
776Declare Function DeleteMetaFile Lib "gdi32" (hmf As HMETAFILE) As BOOL
777Declare Function DeleteObject Lib "gdi32" (hObject As HANDLE) As BOOL
778Declare Function DPtoLP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As BOOL
779Declare Function Ellipse Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, RightRect As Long, nBottomRect As Long) As BOOL
780Declare Function EndDoc Lib "gdi32" (hdc As HDC) As Long
781Declare Function EndPage Lib "gdi32" (hdc As HDC) As Long
782Declare Function EndPath Lib "gdi32" (hdc As HDC) As BOOL
783Declare Function EnumEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, pEnhMetaFunc As ENHMFENUMPROC, pData As VoidPtr, ByRef Rect As RECT) As BOOL
784Declare Function EnumMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE, pMetaFunc As MFENUMPROC, lParam As LPARAM) As BOOL
785Declare Function EqualRgn Lib "gdi32" (hSrcRgn1 As HRGN, hSrcRgn2 As HRGN) As BOOL
786Declare Function ExcludeClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
787
788Const FLOODFILLBORDER = 0
789Const FLOODFILLSURFACE = 1
790Declare Function ExtFloodFill Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, crColor As COLORREF, fuFillType As DWord) As BOOL
791
792Const PS_COSMETIC = &H00000000
793Const PS_GEOMETRIC = &H00010000
794Const PS_ENDCAP_ROUND = &H00000000
795Const PS_ENDCAP_SQUARE = &H00000100
796Const PS_ENDCAP_FLAT = &H00000200
797Const PS_JOIN_ROUND = &H00000000
798Const PS_JOIN_BEVEL = &H00001000
799Const PS_JOIN_MITER = &H00002000
800Declare Function ExtCreatePen Lib "gdi32" (dwPenStyle As DWord, dwWidth As DWord, ByRef lplb As LOGBRUSH, dwStyleCount As DWord, lpStyle As *DWord) As HPEN
801
802Declare Function ExtSelectClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, fnMode As Long) As Long
803Declare Function ExtTextOutA Lib "gdi32" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, lpString As PCSTR, cbCount As Long, pDx As *Long) As Long
804Declare Function ExtTextOutW Lib "gdi32" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, lpString As PCWSTR, cbCount As Long, pDx As *Long) As Long
805#ifdef UNICODE
806Declare Function ExtTextOut Lib "gdi32" Alias "ExtTextOutW" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, pString As PCWSTR, cbCount As Long, pDx As *Long) As Long
807#else
808Declare Function ExtTextOut Lib "gdi32" Alias "ExtTextOutA" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, pString As PCSTR, cbCount As Long, pDx As *Long) As Long
809#endif
810Declare Function FillPath Lib "gdi32" (hdc As HDC) As Long
811Declare Function FillRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH) As Long
812Declare Function FrameRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH, nWidth As Long, nHeight As Long) As Long
813Declare Function GdiComment Lib "gdi32" (hdc As HDC, cbSize As DWord, lpData As *Byte) As BOOL
814Declare Function GetBitmapBits Lib "gdi32" (hbmp As HBITMAP, cbBuffer As Long, lpvBits As VoidPtr) As Long
815Declare Function GetBkColor Lib "gdi32" (hdc As HDC) As DWord
816Declare Function GetBkMode Lib "gdi32" (hdc As HDC) As Long
817Declare Function GetBrushOrgEx Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI) As Long
818' only WinNT
819'Declare Function GetCharWidth32 Lib "gdi32" Alias "GetCharWidth32A" (hdc As HDC, iFirstChar As DWord, iLastChar As DWord, pBuffer As *DWord) As Long
820Declare Function GetClipBox Lib "gdi32" (hdc As HDC, ByRef lpRect As RECT) As Long
821Declare Function GetClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
822Declare Function GetCurrentObject Lib "gdi32" (hdc As HDC, dwObjectType As DWord) As HANDLE
823Declare Function GetCurrentPositionEx Lib "gdi32" (hdc As HDC, ByRef Point As POINTAPI) As Long
824
825Const DRIVERVERSION = 0
826Const TECHNOLOGY = 2
827Const HORZSIZE = 4
828Const VERTSIZE = 6
829Const HORZRES = 8
830Const VERTRES = 10
831Const BITSPIXEL = 12
832Const PLANES = 14
833Const NUMBRUSHES = 16
834Const NUMPENS = 18
835Const NUMMARKERS = 20
836Const NUMFONTS = 22
837Const NUMCOLORS = 24
838Const PDEVICESIZE = 26
839Const CURVECAPS = 28
840Const LINECAPS = 30
841Const POLYGONALCAPS = 32
842Const TEXTCAPS = 34
843Const CLIPCAPS = 36
844Const RASTERCAPS = 38
845Const ASPECTX = 40
846Const ASPECTY = 42
847Const ASPECTXY = 44
848Const SHADEBLENDCAPS = 45
849Const LOGPIXELSX = 88
850Const LOGPIXELSY = 90
851Const SIZEPALETTE = 104
852Const NUMRESERVED = 106
853Const COLORRES = 108
854Const PHYSICALWIDTH = 110
855Const PHYSICALHEIGHT = 111
856Const PHYSICALOFFSETX = 112
857Const PHYSICALOFFSETY = 113
858Const SCALINGFACTORX = 114
859Const SCALINGFACTORY = 115
860Const VREFRESH = 116
861Const DESKTOPVERTRES = 117
862Const DESKTOPHORZRES = 118
863Const BLTALIGNMENT = 119
864Const DT_PLOTTER = 0 ' Device Technologies
865Const DT_RASDISPLAY = 1
866Const DT_RASPRINTER = 2
867Const DT_RASCAMERA = 3
868Const DT_CHARSTREAM = 4
869Const DT_METAFILE = 5
870Const DT_DISPFILE = 6
871Const CC_NONE = 0 ' Curve Capabilities
872Const CC_CIRCLES = 1
873Const CC_PIE = 2
874Const CC_CHORD = 4
875Const CC_ELLIPSES = 8
876Const CC_WIDE = 16
877Const CC_STYLED = 32
878Const CC_WIDESTYLED = 64
879Const CC_INTERIORS = 128
880Const CC_ROUNDRECT = 256
881Const LC_NONE = 0 ' Line Capabilities
882Const LC_POLYLINE = 2
883Const LC_MARKER = 4
884Const LC_POLYMARKER = 8
885Const LC_WIDE = 16
886Const LC_STYLED = 32
887Const LC_WIDESTYLED = 64
888Const LC_INTERIORS = 128
889Const PC_NONE = 0 ' Polygonal Capabilities
890Const PC_POLYGON = 1
891Const PC_RECTANGLE = 2
892Const PC_WINDPOLYGON = 4
893Const PC_TRAPEZOID = 4
894Const PC_SCANLINE = 8
895Const PC_WIDE = 16
896Const PC_STYLED = 32
897Const PC_WIDESTYLED = 64
898Const PC_INTERIORS = 128
899Const PC_POLYPOLYGON = 256
900Const PC_PATHS = 512
901Const CP_NONE = 0 ' Clipping Capabilities
902Const CP_RECTANGLE = 1
903Const CP_REGION = 2
904Const TC_OP_CHARACTER = &H00000001 ' Text Capabilities
905Const TC_OP_STROKE = &H00000002
906Const TC_CP_STROKE = &H00000004
907Const TC_CR_90 = &H00000008
908Const TC_CR_ANY = &H00000010
909Const TC_SF_X_YINDEP = &H00000020
910Const TC_SA_DOUBLE = &H00000040
911Const TC_SA_INTEGER = &H00000080
912Const TC_SA_CONTIN = &H00000100
913Const TC_EA_DOUBLE = &H00000200
914Const TC_IA_ABLE = &H00000400
915Const TC_UA_ABLE = &H00000800
916Const TC_SO_ABLE = &H00001000
917Const TC_RA_ABLE = &H00002000
918Const TC_VA_ABLE = &H00004000
919Const TC_RESERVED = &H00008000
920Const TC_SCROLLBLT = &H00010000
921Const RC_BITBLT = 1 ' Raster Capabilities
922Const RC_BANDING = 2
923Const RC_SCALING = 4
924Const RC_BITMAP64 = 8
925Const RC_GDI20_OUTPUT = &H0010
926Const RC_GDI20_STATE = &H0020
927Const RC_SAVEBITMAP = &H0040
928Const RC_DI_BITMAP = &H0080
929Const RC_PALETTE = &H0100
930Const RC_DIBTODEV = &H0200
931Const RC_BIGFONT = &H0400
932Const RC_STRETCHBLT = &H0800
933Const RC_FLOODFILL = &H1000
934Const RC_STRETCHDIB = &H2000
935Const RC_OP_DX_OUTPUT = &H4000
936Const RC_DEVBITS = &H8000
937Const SB_NONE = &H00000000 ' Shading and blending caps
938Const SB_CONST_ALPHA = &H00000001
939Const SB_PIXEL_ALPHA = &H00000002
940Const SB_PREMULT_ALPHA = &H00000004
941Const SB_GRAD_RECT = &H00000010
942Declare Function GetDeviceCaps Lib "gdi32" (hdc As HDC, nIndex As Long) As Long
943
944Declare Function GetDIBits Lib "gdi32" (hdc As HDC, hbmp As HBITMAP, uStartScan As DWord, cScanLines As DWord, lpvBits As VoidPtr, ByRef lpbi As BITMAPINFO, uUsage As DWord) As Long
945Declare Function GetEnhMetaFile Lib "gdi32" Alias _FuncName_GetEnhMetaFile (pszMetaFile As PCTSTR) As HENHMETAFILE
946Declare Function GetEnhMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte) As DWord
947Declare Function GetEnhMetaFileDescription Lib "gdi32" Alias _FuncName_GetEnhMetaFileDescription (hemf As HENHMETAFILE, cbBuffer As DWord, pszDescription As PTSTR) As DWord
948Declare Function GetEnhMetaFileHeader Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, ByRef emh As ENHMETAHEADER) As DWord
949Declare Function GetEnhMetaFilePaletteEntries Lib "gdi32" (hemf As HENHMETAFILE, cEntries As DWord, ByRef pe As PALETTEENTRY) As DWord
950
951Const MM_TEXT = 1
952Const MM_LOMETRIC = 2
953Const MM_HIMETRIC = 3
954Const MM_LOENGLISH = 4
955Const MM_HIENGLISH = 5
956Const MM_TWIPS = 6
957Const MM_ISOTROPIC = 7
958Const MM_ANISOTROPIC = 8
959Declare Function GetMapMode Lib "gdi32" (hdc As HDC) As Long
960Declare Function GetMetaFileBitsEx Lib "gdi32" (hmf As HMETAFILE, nSize As DWord, pvData As VoidPtr) As DWord
961Declare Function GetMiterLimit Lib "gdi32" (hdc As HDC, peLimit As SinglePtr) As Long
962Declare Function GetObject Lib "gdi32" Alias _FuncName_GetObject (hgdiobj As HANDLE, cbBuffer As Long, ByRef pvObject As Any) As Long
963Declare Function GetObjectType Lib "gdi32" (hObject As HANDLE) As Long
964
965Const PT_CLOSEFIGURE = &H01
966Const PT_LINETO = &H02
967Const PT_BEZIERTO = &H04
968Const PT_MOVETO = &H06
969Declare Function GetPath Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, lpTypes As BytePtr, nSize As Long) As Long
970
971Declare Function GetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long) As DWord
972Declare Function GetPolyFillMode Lib "gdi32" (hdc As HDC) As Long
973Declare Function GetRgnBox Lib "gdi32" (hRgn As HRGN, ByRef lpRect As RECT) As Long
974Declare Function GetROP2 Lib "gdi32" (hdc As HDC) As Long
975
976Const WHITE_BRUSH = 0
977Const LTGRAY_BRUSH = 1
978Const GRAY_BRUSH = 2
979Const DKGRAY_BRUSH = 3
980Const BLACK_BRUSH = 4
981Const NULL_BRUSH = 5
982Const HOLLOW_BRUSH = NULL_BRUSH
983Const WHITE_PEN = 6
984Const BLACK_PEN = 7
985Const NULL_PEN = 8
986Const OEM_FIXED_FONT = 10
987Const ANSI_FIXED_FONT = 11
988Const ANSI_VAR_FONT = 12
989Const SYSTEM_FONT = 13
990Const DEVICE_DEFAULT_FONT = 14
991Const DEFAULT_PALETTE = 15
992Const SYSTEM_FIXED_FONT = 16
993Declare Function GetStockObject Lib "gdi32" (fnObject As Long) As HANDLE
994
995Declare Function GetStretchBltMode Lib "gdi32" (hdc As HDC) As Long
996
997Const TA_NOUPDATECP = 0
998Const TA_UPDATECP = 1
999Const TA_LEFT = 0
1000Const TA_RIGHT = 2
1001Const TA_CENTER = 6
1002Const TA_TOP = 0
1003Const TA_BOTTOM = 8
1004Const TA_BASELINE = 24
1005Const TA_RTLREADING = 256
1006Declare Function GetTextAlign Lib "gdi32" (hdc As HDC) As DWord
1007
1008Declare Function GetTextColor Lib "gdi32" (hdc As HDC) As DWord
1009Declare Function GetTextExtentPoint32A Lib "gdi32" (hdc As HDC, pString As PCSTR, cbString As Long, ByRef Size As SIZE) As Long
1010Declare Function GetTextExtentPoint32W Lib "gdi32" (hdc As HDC, pString As PCWSTR, cbString As Long, ByRef Size As SIZE) As Long
1011#ifdef UNICODE
1012Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32W" (hdc As HDC, pString As PCWSTR, cbString As Long, ByRef Size As SIZE) As Long
1013#else
1014Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (hdc As HDC, pString As PCSTR, cbString As Long, ByRef Size As SIZE) As Long
1015#endif
1016
1017Const TMPF_FIXED_PITCH = &H01
1018Const TMPF_VECTOR = &H02
1019Const TMPF_DEVICE = &H08
1020Const TMPF_TRUETYPE = &H04
1021Type TEXTMETRICW
1022 tmHeight As Long
1023 tmAscent As Long
1024 tmDescent As Long
1025 tmInternalLeading As Long
1026 tmExternalLeading As Long
1027 tmAveCharWidth As Long
1028 tmMaxCharWidth As Long
1029 tmWeight As Long
1030 tmOverhang As Long
1031 tmDigitizedAspectX As Long
1032 tmDigitizedAspectY As Long
1033 tmFirstChar As WCHAR
1034 tmLastChar As WCHAR
1035 tmDefaultChar As WCHAR
1036 tmBreakChar As WCHAR
1037 tmItalic As Byte
1038 tmUnderlined As Byte
1039 tmStruckOut As Byte
1040 tmPitchAndFamily As Byte
1041 tmCharSet As Byte
1042End Type
1043Type TEXTMETRICA
1044 tmHeight As Long
1045 tmAscent As Long
1046 tmDescent As Long
1047 tmInternalLeading As Long
1048 tmExternalLeading As Long
1049 tmAveCharWidth As Long
1050 tmMaxCharWidth As Long
1051 tmWeight As Long
1052 tmOverhang As Long
1053 tmDigitizedAspectX As Long
1054 tmDigitizedAspectY As Long
1055 tmFirstChar As SByte
1056 tmLastChar As SByte
1057 tmDefaultChar As SByte
1058 tmBreakChar As SByte
1059 tmItalic As Byte
1060 tmUnderlined As Byte
1061 tmStruckOut As Byte
1062 tmPitchAndFamily As Byte
1063 tmCharSet As Byte
1064End Type
1065#ifdef UNICODE
1066TypeDef TEXTMETRIC = TEXTMETRICW
1067#else
1068TypeDef TEXTMETRIC = TEXTMETRICA
1069#endif
1070Declare Function GetTextMetrics Lib "gdi32" Alias _FuncName_GetTextMetrics (hdc As HDC, ByRef tm As TEXTMETRIC) As Long
1071
1072Declare Function GetViewportExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long
1073Declare Function GetViewportOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
1074Declare Function GetWindowExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long
1075Declare Function GetWindowOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
1076Declare Function GetWinMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte, fnMapMode As Long, hdcRef As HDC) As DWord
1077Declare Function IntersectClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
1078Declare Function InvertRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
1079Declare Function LineTo Lib "gdi32" (hdc As HDC, nXEnd As Long, nYEnd As Long) As Long
1080Declare Function LPtoDP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As Long
1081Declare Function MoveToEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1082Declare Function OffsetRgn Lib "gdi32" (hRgn As HRGN, nXOffset As Long, nYOffset As Long) As Long
1083Declare Function OffsetClipRgn Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long) As Long
1084Declare Function OffsetViewportOrgEx Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long, ByRef lpPoint As POINTAPI) As Long
1085Declare Function OffsetWindowOrgEx Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long, ByRef lpPoint As POINTAPI) As Long
1086Declare Function PaintRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
1087Declare Function PatBlt Lib "gdi32" (hdc As HDC, nXLeft As Long, nYLeft As Long, nWidth As Long, nHeight As Long, dwRop As DWord) As Long
1088Declare Function PathToRegion Lib "gdi32" (hdc As HDC) As HRGN
1089Declare Function Pie Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nXRadial1 As Long, nYRadial1 As Long, nXRadial2 As Long, nYRadial2 As Long) As Long
1090Declare Function PlayEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, ByRef Rect As RECT) As Long
1091Declare Function PlayEnhMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef EnhMetaRecord As ENHMETARECORD, nHandles As DWord) As BOOL
1092Declare Function PlayMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE) As BOOL
1093Declare Function PlayMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef MetaRecord As METARECORD, nHandles As DWord) As BOOL
1094Declare Function PlgBlt Lib "gdi32" (hdcDest As HDC, ByRef lpPoint As POINTAPI, hdcSrc As HDC, nXSrc As Long, nYSrc As Long, nWidth As Long, nHeight As Long, hbmMask As HBITMAP, xMask As Long, yMask As Long) As Long
1095Declare Function PolyBezier Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
1096Declare Function PolyBezierTo Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
1097Declare Function Polygon Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, cPoints As Long) As Long
1098Declare Function Polyline Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
1099Declare Function PolylineTo Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
1100Declare Function PtInRegion Lib "gdi32" (hRgn As HRGN, x As Long, y As Long) As Long
1101Declare Function PtVisible Lib "gdi32" (hdc As HDC, x As Long, y As Long) As Long
1102Declare Function RealizePalette Lib "gdi32" (hdc As HDC) As Long
1103Declare Function Rectangle Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
1104Declare Function RectInRegion Lib "gdi32" (hRgn As HRGN, ByRef lpRect As RECT) As Long
1105Declare Function RectVisible Lib "gdi32" (hdc As HDC, ByRef lpRect As RECT) As Long
1106Declare Function ResetDC Lib "gdi32" Alias _FuncName_ResetDC (hdc As HDC, ByRef InitData As DEVMODE) As HDC
1107Declare Function RestoreDC Lib "gdi32" (hdc As HDC, nSavedDC As Long) As Long
1108Declare Function RoundRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nWidth As Long, nHeight As Long) As Long
1109Declare Function SaveDC Lib "gdi32" (hdc As HDC) As Long
1110Declare Function ScaleViewportExtEx Lib "gdi32" (hdc As HDC, Xnum As Long, Xdenom As Long, Ynum As Long, Ydenom As Long, ByRef lpSize As SIZE) As Long
1111Declare Function ScaleWindowExtEx Lib "gdi32" (hdc As HDC, Xnum As Long, Xdenom As Long, Ynum As Long, Ydenom As Long, ByRef lpSize As SIZE) As Long
1112Declare Function SelectClipPath Lib "gdi32" (hdc As HDC, iMode As Long) As Long
1113Declare Function SelectClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
1114Declare Function SelectObject Lib "gdi32" (hdc As HDC, hObject As HANDLE) As HANDLE
1115Declare Function SelectPalette Lib "gdi32" (hdc As HDC, hpal As HPALETTE, bForceBackground As BOOL) As HPALETTE
1116Declare Function SetBkColor Lib "gdi32" (hdc As HDC, crColor As DWord) As DWord
1117
1118Const TRANSPARENT = 1
1119Const OPAQUE = 2
1120Declare Function SetBkMode Lib "gdi32" (hdc As HDC, iBkMode As Long) As Long
1121
1122Declare Function SetBrushOrgEx Lib "gdi32" (hdc As HDC, nXOrg As Long, nYOrg As Long, ByRef lppt As POINTAPI) As Long
1123Declare Function SetDIBits Lib "gdi32" (hdc As HDC, hbmp As HBITMAP, uStartScan As DWord, cScanLines As DWord, lpvBits As VoidPtr, ByRef lpbmi As BITMAPINFO, fuColorUse As DWord) As Long
1124Declare Function SetEnhMetaFileBits Lib "gdi32" (cbBuffer As DWord, pData As *Byte) As HENHMETAFILE
1125Declare Function SetMapMode Lib "gdi32" (hdc As HDC, fnMapMode As Long) As Long
1126Declare Function SetMetaFileBitsEx Lib "gdi32" (nSize As DWord, pData As *Byte) As HMETAFILE
1127Declare Function SetMiterLimit Lib "gdi32" (hdc As HDC, eNewLimit As Single, peOldLimit As SinglePtr) As Long
1128Declare Function SetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long, crColor As DWord) As DWord
1129Declare Function SetPolyFillMode Lib "gdi32" (hdc As HDC, iPolyFillMode As Long) As Long
1130Declare Function SetRectRgn Lib "gdi32" (hRgn As HRGN, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
1131Declare Function SetROP2 Lib "gdi32" (hdc As HDC, fnDrawMode As Long) As Long
1132
1133Const BLACKONWHITE = 1
1134Const WHITEONBLACK = 2
1135Const COLORONCOLOR = 3
1136Const HALFTONE = 4
1137Const STRETCH_ANDSCANS = BLACKONWHITE
1138Const STRETCH_ORSCANS = WHITEONBLACK
1139Const STRETCH_DELETESCANS = COLORONCOLOR
1140Const STRETCH_HALFTONE = HALFTONE
1141Declare Function SetStretchBltMode Lib "gdi32" (hdc As HDC, iStretchMode As Long) As Long
1142
1143Declare Function SetTextAlign Lib "gdi32" (hdc As HDC, fMode As DWord) As DWord
1144Declare Function SetTextColor Lib "gdi32" (hdc As HDC, crColor As DWord) As DWord
1145Declare Function SetViewportExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long
1146Declare Function SetViewportOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1147Declare Function SetWindowExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long
1148Declare Function SetWindowOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1149Declare Function SetWinMetaFileBits Lib "gdi32" (cbBuffer As DWord, pbBuffer As *Byte, hdcRef As HDC, ByRef mfp As METAFILEPICT) As HENHMETAFILE
1150Declare Function StartDoc Lib "gdi32" Alias _FuncName_StartDoc (hdc As HDC, ByRef di As DOCINFO) As Long
1151Declare Function StartPage Lib "gdi32" (hdc As HDC) As Long
1152Declare Function StretchBlt Lib "gdi32" (hdcDest As HDC, nXOriginDest As Long, nYOriginDest As Long, nWidthDest As Long, nHeightDest As Long, hdcSrc As HDC, nXOriginSrc As Long, nYOriginSrc As Long, nWidthSrc As Long, nHeightSrc As Long, dwRop As DWord) As Long
1153Declare Function StretchDIBits Lib "gdi32" (hdc As HDC, XDest As Long, YDest As Long, nDestWidth As Long, nDestHeight As Long, XSrc As Long, YSrc As Long, nSrcWidth As Long, nSrcHeight As Long, lpBits As VoidPtr, ByRef lpBitsInfo As BITMAPINFO, iUsage As Long, dwRop As DWord) As Long
1154Declare Function StrokeAndFillPath Lib "gdi32" (hdc As HDC) As Long
1155Declare Function StrokePath Lib "gdi32" (DC As DWord) As Long
1156Declare Function TextOutA Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCSTR, cbString As Long) As Long
1157Declare Function TextOutW Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCWSTR, cbString As Long) As Long
1158#ifdef UNICODE
1159Declare Function TextOut Lib "gdi32" Alias "TextOutW" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCWSTR, cbString As Long) As Long
1160#else
1161Declare Function TextOut Lib "gdi32" Alias "TextOutA" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCSTR, cbString As Long) As Long
1162#endif
1163
1164/* Pixel Format */
1165Type PIXELFORMATDESCRIPTOR
1166 nSize As Word
1167 nVersion As Word
1168 dwFlags As DWord
1169 iPixelType As Byte
1170 cColorBits As Byte
1171 cRedBits As Byte
1172 cRedShift As Byte
1173 cGreenBits As Byte
1174 cGreenShift As Byte
1175 cBlueBits As Byte
1176 cBlueShift As Byte
1177 cAlphaBits As Byte
1178 cAlphaShift As Byte
1179 cAccumBits As Byte
1180 cAccumRedBits As Byte
1181 cAccumGreenBits As Byte
1182 cAccumBlueBits As Byte
1183 cAccumAlphaBits As Byte
1184 cDepthBits As Byte
1185 cStencilBits As Byte
1186 cAuxBuffers As Byte
1187 iLayerType As Byte
1188 bReserved As Byte
1189 dwLayerMask As DWord
1190 dwVisibleMask As DWord
1191 dwDamageMask As DWord
1192End Type
1193TypeDef PPIXELFORMATDESCRIPTOR = *PIXELFORMATDESCRIPTOR
1194TypeDef LPPIXELFORMATDESCRIPTOR = *PIXELFORMATDESCRIPTOR
1195
1196Const PFD_TYPE_RGBA = 0
1197Const PFD_TYPE_COLORINDEX = 1
1198
1199Const PFD_MAIN_PLANE = 0
1200Const PFD_OVERLAY_PLANE = 1
1201Const PFD_UNDERLAY_PLANE = (-1)
1202
1203Const PFD_DOUBLEBUFFER = &H00000001
1204Const PFD_STEREO = &H00000002
1205Const PFD_DRAW_TO_WINDOW = &H00000004
1206Const PFD_DRAW_TO_BITMAP = &H00000008
1207Const PFD_SUPPORT_GDI = &H00000010
1208Const PFD_SUPPORT_OPENGL = &H00000020
1209Const PFD_GENERIC_FORMAT = &H00000040
1210Const PFD_NEED_PALETTE = &H00000080
1211Const PFD_NEED_SYSTEM_PALETTE = &H00000100
1212Const PFD_SWAP_EXCHANGE = &H00000200
1213Const PFD_SWAP_COPY = &H00000400
1214Const PFD_SWAP_LAYER_BUFFERS = &H00000800
1215Const PFD_GENERIC_ACCELERATED = &H00001000
1216Const PFD_SUPPORT_DIRECTDRAW = &H00002000
1217
1218Const PFD_DEPTH_DONTCARE = &H20000000
1219Const PFD_DOUBLEBUFFER_DONTCARE = &H40000000
1220Const PFD_STEREO_DONTCARE = &H80000000
1221
1222Declare Function ChoosePixelFormat Lib "gdi32" (hdc As HDC, ByRef lppfd As PIXELFORMATDESCRIPTOR) As Long
1223Declare Function DescribePixelFormat Lib "gdi32" (hdc As HDC, n As Long, u As DWord, ByRef lppfd As PIXELFORMATDESCRIPTOR) As Long
1224Declare Function GetPixelFormat Lib "gdi32" (hdc As HDC) As Long
1225Declare Function SetPixelFormat Lib "gdi32" (hdc As HDC, i As Long, ByRef lppfd As PIXELFORMATDESCRIPTOR) As BOOL
1226
1227
1228/* OpenGL Support */
1229Type _System_DeclareHandle_HGLRC:unused As DWord:End Type
1230TypeDef HGLRC = *_System_DeclareHandle_HGLRC
1231
1232Declare Function wglCopyContext Lib "opengl32" (hglrcSource As HGLRC, hglrcDest As HGLRC, mask As DWord) As BOOL
1233Declare Function wglCreateContext Lib "opengl32" (hdc As HDC) As HGLRC
1234Declare Function wglCreateLayerContext Lib "opengl32" (hdc As HDC, iLayerPlane As Long) As HGLRC
1235Declare Function wglDeleteContext Lib "opengl32" (hglrc As HGLRC) As BOOL
1236Declare Function wglGetCurrentContext Lib "opengl32" () As HGLRC
1237Declare Function wglGetCurrentDC Lib "opengl32" () As HDC
1238Declare Function wglGetProcAddress Lib "opengl32" (lpstr As LPSTR) As PROC
1239Declare Function wglMakeCurrent Lib "opengl32" (hdc As HDC, hglrc As HGLRC) As BOOL
1240Declare Function wglShareLists Lib "opengl32" (hglrc1 As HGLRC, hglrc2 As HGLRC) As BOOL
1241Declare Function wglUseFontBitmaps Lib "opengl32" Alias _FuncName_wglUseFontBitmaps (hdc As HDC, first As DWord, count As DWord, listbase As DWord) As BOOL
1242Declare Function SwapBuffers Lib "gdi32" (hdc As HDC) As BOOL
1243
1244Type POINTFLOAT
1245 x As Single
1246 y As Single
1247End Type
1248TypeDef PPOINTFLOAT = *POINTFLOAT
1249
1250Type GLYPHMETRICSFLOAT
1251 gmfBlackBoxX As Single
1252 gmfBlackBoxY As Single
1253 gmfptGlyphOrigin As POINTFLOAT
1254 gmfCellIncX As Single
1255 gmfCellIncY As Single
1256End Type
1257TypeDef PGLYPHMETRICSFLOAT = *GLYPHMETRICSFLOAT
1258TypeDef LPGLYPHMETRICSFLOAT = *GLYPHMETRICSFLOAT
1259
1260Const WGL_FONT_LINES = 0
1261Const WGL_FONT_POLYGONS = 1
1262
1263Declare Function wglUseFontOutlines Lib "opengl32" Alias _FuncName_wglUseFontOutlines (hdc As HDC, first As DWord, count As DWord, listbase As DWord, deviation As Single, extrusion As Single, format As Long, ByRef lpgmf As GLYPHMETRICSFLOAT) As BOOL
1264
1265Type LAYERPLANEDESCRIPTOR
1266 nSize As Word
1267 nVersion As Word
1268 dwFlags As DWord
1269 iPixelType As Byte
1270 cColorBits As Byte
1271 cRedBits As Byte
1272 cRedShift As Byte
1273 cGreenBits As Byte
1274 cGreenShift As Byte
1275 cBlueBits As Byte
1276 cBlueShift As Byte
1277 cAlphaBits As Byte
1278 cAlphaShift As Byte
1279 cAccumBits As Byte
1280 cAccumRedBits As Byte
1281 cAccumGreenBits As Byte
1282 cAccumBlueBits As Byte
1283 cAccumAlphaBits As Byte
1284 cDepthBits As Byte
1285 cStencilBits As Byte
1286 cAuxBuffers As Byte
1287 iLayerPlane As Byte
1288 bReserved As Byte
1289 crTransparent As COLORREF
1290End Type
1291TypeDef PLAYERPLANEDESCRIPTOR = *LAYERPLANEDESCRIPTOR
1292TypeDef LPLAYERPLANEDESCRIPTOR = *LAYERPLANEDESCRIPTOR
1293
1294Const LPD_DOUBLEBUFFER = &H00000001
1295Const LPD_STEREO = &H00000002
1296Const LPD_SUPPORT_GDI = &H00000010
1297Const LPD_SUPPORT_OPENGL = &H00000020
1298Const LPD_SHARE_DEPTH = &H00000040
1299Const LPD_SHARE_STENCIL = &H00000080
1300Const LPD_SHARE_ACCUM = &H00000100
1301Const LPD_SWAP_EXCHANGE = &H00000200
1302Const LPD_SWAP_COPY = &H00000400
1303Const LPD_TRANSPARENT = &H00001000
1304Const LPD_TYPE_RGBA = 0
1305Const LPD_TYPE_COLORINDEX = 1
1306
1307Const WGL_SWAP_MAIN_PLANE = &H00000001
1308Const WGL_SWAP_OVERLAY1 = &H00000002
1309Const WGL_SWAP_OVERLAY2 = &H00000004
1310Const WGL_SWAP_OVERLAY3 = &H00000008
1311Const WGL_SWAP_OVERLAY4 = &H00000010
1312Const WGL_SWAP_OVERLAY5 = &H00000020
1313Const WGL_SWAP_OVERLAY6 = &H00000040
1314Const WGL_SWAP_OVERLAY7 = &H00000080
1315Const WGL_SWAP_OVERLAY8 = &H00000100
1316Const WGL_SWAP_OVERLAY9 = &H00000200
1317Const WGL_SWAP_OVERLAY10 = &H00000400
1318Const WGL_SWAP_OVERLAY11 = &H00000800
1319Const WGL_SWAP_OVERLAY12 = &H00001000
1320Const WGL_SWAP_OVERLAY13 = &H00002000
1321Const WGL_SWAP_OVERLAY14 = &H00004000
1322Const WGL_SWAP_OVERLAY15 = &H00008000
1323Const WGL_SWAP_UNDERLAY1 = &H00010000
1324Const WGL_SWAP_UNDERLAY2 = &H00020000
1325Const WGL_SWAP_UNDERLAY3 = &H00040000
1326Const WGL_SWAP_UNDERLAY4 = &H00080000
1327Const WGL_SWAP_UNDERLAY5 = &H00100000
1328Const WGL_SWAP_UNDERLAY6 = &H00200000
1329Const WGL_SWAP_UNDERLAY7 = &H00400000
1330Const WGL_SWAP_UNDERLAY8 = &H00800000
1331Const WGL_SWAP_UNDERLAY9 = &H01000000
1332Const WGL_SWAP_UNDERLAY10 = &H02000000
1333Const WGL_SWAP_UNDERLAY11 = &H04000000
1334Const WGL_SWAP_UNDERLAY12 = &H08000000
1335Const WGL_SWAP_UNDERLAY13 = &H10000000
1336Const WGL_SWAP_UNDERLAY14 = &H20000000
1337Const WGL_SWAP_UNDERLAY15 = &H40000000
1338
1339Declare Function wglDescribeLayerPlane Lib "opengl32" (hdc As HDC, iPixelFormat As Long, iLayerPlane As Long, nByte As DWord, ByRef lplpd As LAYERPLANEDESCRIPTOR) As BOOL
1340Declare Function wglSetLayerPaletteEntries Lib "opengl32" (hdc As HDC, iLayerPlane As Long, iStart As Long, cEntries As Long, lpcr As *COLORREF) As Long
1341Declare Function wglGetLayerPaletteEntries Lib "opengl32" (hdc As HDC, iLayerPlane As Long, iStart As Long, cEntries As Long, lpcr As *COLORREF) As Long
1342Declare Function wglRealizeLayerPalette Lib "opengl32" (hdc As HDC, iLayerPlane As Long, bRealize As BOOL) As BOOL
1343Declare Function wglSwapLayerBuffers Lib "opengl32" (hdc As HDC, fuPlanes As DWord) As BOOL
1344
1345Type WGLSWAP
1346 hdc As HDC
1347 uiFlags As DWord
1348End Type
1349TypeDef PWGLSWAP = *WGLSWAP
1350TypeDef LPWGLSWAP = *WGLSWAP
1351
1352Const WGL_SWAPMULTIPLE_MAX = 16
1353
1354'Declare Function wglSwapMultipleBuffers Lib "opengl32" (u As DWord, lpwglswap As *WGLSWAP) As DWord
1355
1356#endif '_INC_GDI
Note: See TracBrowser for help on using the repository browser.