source: Include/api_gdi.sbp@ 123

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

(拡張)メタファイル関数(全部)・構造体(一部)、BITMAPV4HEADERとそれに関連する型などの宣言

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