source: Include/api_gdi.sbp@ 127

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

#51完了

File size: 47.4 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 CreateFontIndirectA Lib "gdi32" (ByRef lf As LOGFONTA) As HFONT
663Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (ByRef lf As LOGFONT) As HFONT
664
665Declare Function CreateHatchBrush Lib "gdi32" (fnStyle As Long, clrref As COLORREF) As HBRUSH
666Declare Function CreatePatternBrush Lib "gdi32" (hbmp As HBITMAP) As HBRUSH
667
668Const PS_SOLID = 0
669Const PS_DASH = 1
670Const PS_DOT = 2
671Const PS_DASHDOT = 3
672Const PS_DASHDOTDOT = 4
673Const PS_NULL = 5
674Const PS_INSIDEFRAME = 6
675Const PS_USERSTYLE = 7
676Const PS_ALTERNATE = 8
677Declare Function CreatePen Lib "gdi32" (nPenStyle As Long, nWidth As Long, crColor As COLORREF) As HPEN
678
679Type LOGPEN
680 lopnStyle As DWord
681 lopnWidth As POINTAPI
682 lopnColor As COLORREF
683End Type
684Declare Function CreatePenIndirect Lib "gdi32" (ByRef lplgpn As LOGPEN) As HPEN
685
686Declare Function CreatePolygonRgn Lib "gdi32" (ByRef lpPoints As POINTAPI, cPoints As Long, fnPolyFillMode As Long) As HRGN
687Declare Function CreateRectRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As HRGN
688Declare Function CreateRectRgnIndirect Lib "gdi32" (ByRef lpRect As RECT) As HRGN
689Declare Function CreateRoundRectRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nWidthEllipse As Long, nHeightEllipse As Long) As HRGN
690Declare Function CreateSolidBrush Lib "gdi32" (crColor As COLORREF) As HBRUSH
691Declare Function DeleteDC Lib "gdi32" (hdc As HDC) As BOOL
692Declare Function DeleteEnhMetaFile Lib "gdi32" (hemf As HENHMETAFILE) As BOOL
693Declare Function DeleteMetaFile Lib "gdi32" (hmf As HMETAFILE) As BOOL
694Declare Function DeleteObject Lib "gdi32" (hObject As HANDLE) As BOOL
695Declare Function DPtoLP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As BOOL
696Declare Function Ellipse Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, RightRect As Long, nBottomRect As Long) As BOOL
697Declare Function EndDoc Lib "gdi32" (hdc As HDC) As Long
698Declare Function EndPage Lib "gdi32" (hdc As HDC) As Long
699Declare Function EndPath Lib "gdi32" (hdc As HDC) As BOOL
700Declare Function EnumEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, pEnhMetaFunc As ENHMFENUMPROC, pData As VoidPtr, ByRef Rect As RECT) As BOOL
701Declare Function EnumMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE, pMetaFunc As MFENUMPROC, lParam As LPARAM) As BOOL
702Declare Function EqualRgn Lib "gdi32" (hSrcRgn1 As HRGN, hSrcRgn2 As HRGN) As BOOL
703Declare Function ExcludeClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
704
705Const FLOODFILLBORDER = 0
706Const FLOODFILLSURFACE = 1
707Declare Function ExtFloodFill Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, crColor As COLORREF, fuFillType As DWord) As BOOL
708
709Const PS_COSMETIC = &H00000000
710Const PS_GEOMETRIC = &H00010000
711Const PS_ENDCAP_ROUND = &H00000000
712Const PS_ENDCAP_SQUARE = &H00000100
713Const PS_ENDCAP_FLAT = &H00000200
714Const PS_JOIN_ROUND = &H00000000
715Const PS_JOIN_BEVEL = &H00001000
716Const PS_JOIN_MITER = &H00002000
717Declare Function ExtCreatePen Lib "gdi32" (dwPenStyle As DWord, dwWidth As DWord, ByRef lplb As LOGBRUSH, dwStyleCount As DWord, lpStyle As *DWord) As HPEN
718
719Declare Function ExtSelectClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, fnMode As Long) As Long
720Declare 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
721Declare 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
722#ifdef UNICODE
723Declare 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
724#else
725Declare 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
726#endif
727Declare Function FillPath Lib "gdi32" (hdc As HDC) As Long
728Declare Function FillRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH) As Long
729Declare Function FrameRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH, nWidth As Long, nHeight As Long) As Long
730Declare Function GdiComment Lib "gdi32" (hdc As HDC, cbSize As DWord, lpData As *Byte) As BOOL
731Declare Function GetBitmapBits Lib "gdi32" (hbmp As HBITMAP, cbBuffer As Long, lpvBits As VoidPtr) As Long
732Declare Function GetBkColor Lib "gdi32" (hdc As HDC) As DWord
733Declare Function GetBkMode Lib "gdi32" (hdc As HDC) As Long
734Declare Function GetBrushOrgEx Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI) As Long
735Declare Function GetCharWidth32 Lib "gdi32" Alias "GetCharWidth32A" (hdc As HDC, iFirstChar As Long, iLastChar As Long, lpBuffer As DWordPtr) As Long
736Declare Function GetClipBox Lib "gdi32" (hdc As HDC, ByRef lpRect As RECT) As Long
737Declare Function GetClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
738Declare Function GetCurrentObject Lib "gdi32" (hdc As HDC, dwObjectType As DWord) As HANDLE
739Declare Function GetCurrentPositionEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
740
741Const DRIVERVERSION = 0
742Const TECHNOLOGY = 2
743Const HORZSIZE = 4
744Const VERTSIZE = 6
745Const HORZRES = 8
746Const VERTRES = 10
747Const BITSPIXEL = 12
748Const PLANES = 14
749Const NUMBRUSHES = 16
750Const NUMPENS = 18
751Const NUMMARKERS = 20
752Const NUMFONTS = 22
753Const NUMCOLORS = 24
754Const PDEVICESIZE = 26
755Const CURVECAPS = 28
756Const LINECAPS = 30
757Const POLYGONALCAPS = 32
758Const TEXTCAPS = 34
759Const CLIPCAPS = 36
760Const RASTERCAPS = 38
761Const ASPECTX = 40
762Const ASPECTY = 42
763Const ASPECTXY = 44
764Const SHADEBLENDCAPS = 45
765Const LOGPIXELSX = 88
766Const LOGPIXELSY = 90
767Const SIZEPALETTE = 104
768Const NUMRESERVED = 106
769Const COLORRES = 108
770Const PHYSICALWIDTH = 110
771Const PHYSICALHEIGHT = 111
772Const PHYSICALOFFSETX = 112
773Const PHYSICALOFFSETY = 113
774Const SCALINGFACTORX = 114
775Const SCALINGFACTORY = 115
776Const VREFRESH = 116
777Const DESKTOPVERTRES = 117
778Const DESKTOPHORZRES = 118
779Const BLTALIGNMENT = 119
780Const DT_PLOTTER = 0 ' Device Technologies
781Const DT_RASDISPLAY = 1
782Const DT_RASPRINTER = 2
783Const DT_RASCAMERA = 3
784Const DT_CHARSTREAM = 4
785Const DT_METAFILE = 5
786Const DT_DISPFILE = 6
787Const CC_NONE = 0 ' Curve Capabilities
788Const CC_CIRCLES = 1
789Const CC_PIE = 2
790Const CC_CHORD = 4
791Const CC_ELLIPSES = 8
792Const CC_WIDE = 16
793Const CC_STYLED = 32
794Const CC_WIDESTYLED = 64
795Const CC_INTERIORS = 128
796Const CC_ROUNDRECT = 256
797Const LC_NONE = 0 ' Line Capabilities
798Const LC_POLYLINE = 2
799Const LC_MARKER = 4
800Const LC_POLYMARKER = 8
801Const LC_WIDE = 16
802Const LC_STYLED = 32
803Const LC_WIDESTYLED = 64
804Const LC_INTERIORS = 128
805Const PC_NONE = 0 ' Polygonal Capabilities
806Const PC_POLYGON = 1
807Const PC_RECTANGLE = 2
808Const PC_WINDPOLYGON = 4
809Const PC_TRAPEZOID = 4
810Const PC_SCANLINE = 8
811Const PC_WIDE = 16
812Const PC_STYLED = 32
813Const PC_WIDESTYLED = 64
814Const PC_INTERIORS = 128
815Const PC_POLYPOLYGON = 256
816Const PC_PATHS = 512
817Const CP_NONE = 0 ' Clipping Capabilities
818Const CP_RECTANGLE = 1
819Const CP_REGION = 2
820Const TC_OP_CHARACTER = &H00000001 ' Text Capabilities
821Const TC_OP_STROKE = &H00000002
822Const TC_CP_STROKE = &H00000004
823Const TC_CR_90 = &H00000008
824Const TC_CR_ANY = &H00000010
825Const TC_SF_X_YINDEP = &H00000020
826Const TC_SA_DOUBLE = &H00000040
827Const TC_SA_INTEGER = &H00000080
828Const TC_SA_CONTIN = &H00000100
829Const TC_EA_DOUBLE = &H00000200
830Const TC_IA_ABLE = &H00000400
831Const TC_UA_ABLE = &H00000800
832Const TC_SO_ABLE = &H00001000
833Const TC_RA_ABLE = &H00002000
834Const TC_VA_ABLE = &H00004000
835Const TC_RESERVED = &H00008000
836Const TC_SCROLLBLT = &H00010000
837Const RC_BITBLT = 1 ' Raster Capabilities
838Const RC_BANDING = 2
839Const RC_SCALING = 4
840Const RC_BITMAP64 = 8
841Const RC_GDI20_OUTPUT = &H0010
842Const RC_GDI20_STATE = &H0020
843Const RC_SAVEBITMAP = &H0040
844Const RC_DI_BITMAP = &H0080
845Const RC_PALETTE = &H0100
846Const RC_DIBTODEV = &H0200
847Const RC_BIGFONT = &H0400
848Const RC_STRETCHBLT = &H0800
849Const RC_FLOODFILL = &H1000
850Const RC_STRETCHDIB = &H2000
851Const RC_OP_DX_OUTPUT = &H4000
852Const RC_DEVBITS = &H8000
853Const SB_NONE = &H00000000 ' Shading and blending caps
854Const SB_CONST_ALPHA = &H00000001
855Const SB_PIXEL_ALPHA = &H00000002
856Const SB_PREMULT_ALPHA = &H00000004
857Const SB_GRAD_RECT = &H00000010
858Declare Function GetDeviceCaps Lib "gdi32" (hdc As HDC, nIndex As Long) As Long
859
860Declare 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
861Declare Function GetEnhMetaFile Lib "gdi32" Alias "GetEnhMetaFileA" (pszMetaFile As PCSTR) As HENHMETAFILE
862Declare Function GetEnhMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte) As DWord
863Declare Function GetEnhMetaFileDescription Lib "gdi32" Alias "GetEnhMetaFileDescriptionA" (hemf As HENHMETAFILE, cbBuffer As DWord, pszDescription As PTSTR) As DWord
864Declare Function GetEnhMetaFileHeader Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, ByRef emh As ENHMETAHEADER) As DWord
865Declare Function GetEnhMetaFilePaletteEntries Lib "gdi32" (hemf As HENHMETAFILE, cEntries As DWord, ByRef pe As PALETTEENTRY) As DWord
866
867Const MM_TEXT = 1
868Const MM_LOMETRIC = 2
869Const MM_HIMETRIC = 3
870Const MM_LOENGLISH = 4
871Const MM_HIENGLISH = 5
872Const MM_TWIPS = 6
873Const MM_ISOTROPIC = 7
874Const MM_ANISOTROPIC = 8
875Declare Function GetMapMode Lib "gdi32" (hdc As HDC) As Long
876Declare Function GetMetaFileBitsEx Lib "gdi32" (hmf As HMETAFILE, nSize As DWord, pvData As VoidPtr) As DWord
877Declare Function GetMiterLimit Lib "gdi32" (hdc As HDC, peLimit As SinglePtr) As Long
878Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (hgdiobj As HANDLE, cbBuffer As Long, ByRef lpvObject As Any) As Long
879Declare Function GetObjectType Lib "gdi32" (hObject As HANDLE) As Long
880
881Const PT_CLOSEFIGURE = &H01
882Const PT_LINETO = &H02
883Const PT_BEZIERTO = &H04
884Const PT_MOVETO = &H06
885Declare Function GetPath Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, lpTypes As BytePtr, nSize As Long) As Long
886
887Declare Function GetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long) As DWord
888Declare Function GetPolyFillMode Lib "gdi32" (hdc As HDC) As Long
889Declare Function GetRgnBox Lib "gdi32" (hRgn As HRGN, ByRef lpRect As RECT) As Long
890Declare Function GetROP2 Lib "gdi32" (hdc As HDC) As Long
891
892Const WHITE_BRUSH = 0
893Const LTGRAY_BRUSH = 1
894Const GRAY_BRUSH = 2
895Const DKGRAY_BRUSH = 3
896Const BLACK_BRUSH = 4
897Const NULL_BRUSH = 5
898Const HOLLOW_BRUSH = NULL_BRUSH
899Const WHITE_PEN = 6
900Const BLACK_PEN = 7
901Const NULL_PEN = 8
902Const OEM_FIXED_FONT = 10
903Const ANSI_FIXED_FONT = 11
904Const ANSI_VAR_FONT = 12
905Const SYSTEM_FONT = 13
906Const DEVICE_DEFAULT_FONT = 14
907Const DEFAULT_PALETTE = 15
908Const SYSTEM_FIXED_FONT = 16
909Declare Function GetStockObject Lib "gdi32" (fnObject As Long) As HANDLE
910
911Declare Function GetStretchBltMode Lib "gdi32" (hdc As HDC) As Long
912
913Const TA_NOUPDATECP = 0
914Const TA_UPDATECP = 1
915Const TA_LEFT = 0
916Const TA_RIGHT = 2
917Const TA_CENTER = 6
918Const TA_TOP = 0
919Const TA_BOTTOM = 8
920Const TA_BASELINE = 24
921Const TA_RTLREADING = 256
922Declare Function GetTextAlign Lib "gdi32" (hdc As HDC) As DWord
923
924Declare Function GetTextColor Lib "gdi32" (hdc As HDC) As DWord
925Declare Function GetTextExtentPoint32A Lib "gdi32" (hdc As HDC, pString As PCSTR, cbString As Long, ByRef Size As SIZE) As Long
926Declare Function GetTextExtentPoint32W Lib "gdi32" (hdc As HDC, pString As PCWSTR, cbString As Long, ByRef Size As SIZE) As Long
927#ifdef UNICODE
928Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32W" (hdc As HDC, pString As PCTSTR, cbString As Long, ByRef Size As SIZE) As Long
929#else
930Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (hdc As HDC, pString As PCTSTR, cbString As Long, ByRef Size As SIZE) As Long
931#endif
932
933Const TMPF_FIXED_PITCH = &H01
934Const TMPF_VECTOR = &H02
935Const TMPF_DEVICE = &H08
936Const TMPF_TRUETYPE = &H04
937Type TEXTMETRIC
938 tmHeight As Long
939 tmAscent As Long
940 tmDescent As Long
941 tmInternalLeading As Long
942 tmExternalLeading As Long
943 tmAveCharWidth As Long
944 tmMaxCharWidth As Long
945 tmWeight As Long
946 tmOverhang As Long
947 tmDigitizedAspectX As Long
948 tmDigitizedAspectY As Long
949 tmFirstChar As Byte
950 tmLastChar As Byte
951 tmDefaultChar As Byte
952 tmBreakChar As Byte
953 tmItalic As Byte
954 tmUnderlined As Byte
955 tmStruckOut As Byte
956 tmPitchAndFamily As Byte
957 tmCharSet As Byte
958End Type
959Declare Function GetTextMetrics Lib "gdi32" Alias "GetTextMetricsA" (hdc As HDC, ByRef lptm As TEXTMETRIC) As Long
960
961Declare Function GetViewportExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long
962Declare Function GetViewportOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
963Declare Function GetWindowExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long
964Declare Function GetWindowOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
965Declare Function GetWinMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte, fnMapMode As Long, hdcRef As HDC) As DWord
966Declare Function IntersectClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
967Declare Function InvertRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
968Declare Function LineTo Lib "gdi32" (hdc As HDC, nXEnd As Long, nYEnd As Long) As Long
969Declare Function LPtoDP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As Long
970Declare Function MoveToEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
971Declare Function OffsetRgn Lib "gdi32" (hRgn As HRGN, nXOffset As Long, nYOffset As Long) As Long
972Declare Function OffsetClipRgn Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long) As Long
973Declare Function OffsetViewportOrgEx Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long, ByRef lpPoint As POINTAPI) As Long
974Declare Function OffsetWindowOrgEx Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long, ByRef lpPoint As POINTAPI) As Long
975Declare Function PaintRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
976Declare Function PatBlt Lib "gdi32" (hdc As HDC, nXLeft As Long, nYLeft As Long, nWidth As Long, nHeight As Long, dwRop As DWord) As Long
977Declare Function PathToRegion Lib "gdi32" (hdc As HDC) As HRGN
978Declare 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
979Declare Function PlayEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, ByRef Rect As RECT) As Long
980Declare Function PlayEnhMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef EnhMetaRecord As ENHMETARECORD, nHandles As DWord) As BOOL
981Declare Function PlayMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE) As BOOL
982Declare Function PlayMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef MetaRecord As METARECORD, nHandles As DWord) As BOOL
983Declare 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
984Declare Function PolyBezier Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
985Declare Function PolyBezierTo Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
986Declare Function Polygon Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, cPoints As Long) As Long
987Declare Function Polyline Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
988Declare Function PolylineTo Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
989Declare Function PtInRegion Lib "gdi32" (hRgn As HRGN, x As Long, y As Long) As Long
990Declare Function PtVisible Lib "gdi32" (hdc As HDC, x As Long, y As Long) As Long
991Declare Function RealizePalette Lib "gdi32" (hdc As HDC) As Long
992Declare Function Rectangle Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
993Declare Function RectInRegion Lib "gdi32" (hRgn As HRGN, ByRef lpRect As RECT) As Long
994Declare Function RectVisible Lib "gdi32" (hdc As HDC, ByRef lpRect As RECT) As Long
995Declare Function ResetDC Lib "gdi32" Alias "ResetDCA" (hdc As HDC, ByRef lpInitData As DEVMODE) As HDC
996Declare Function RestoreDC Lib "gdi32" (hdc As HDC, nSavedDC As Long) As Long
997Declare 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
998Declare Function SaveDC Lib "gdi32" (hdc As HDC) As Long
999Declare 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
1000Declare 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
1001Declare Function SelectClipPath Lib "gdi32" (hdc As HDC, iMode As Long) As Long
1002Declare Function SelectClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
1003Declare Function SelectObject Lib "gdi32" (hdc As HDC, hObject As HANDLE) As HANDLE
1004Declare Function SelectPalette Lib "gdi32" (hdc As HDC, hpal As HPALETTE, bForceBackground As BOOL) As HPALETTE
1005Declare Function SetBkColor Lib "gdi32" (hdc As HDC, crColor As DWord) As DWord
1006
1007Const TRANSPARENT = 1
1008Const OPAQUE = 2
1009Declare Function SetBkMode Lib "gdi32" (hdc As HDC, iBkMode As Long) As Long
1010
1011Declare Function SetBrushOrgEx Lib "gdi32" (hdc As HDC, nXOrg As Long, nYOrg As Long, ByRef lppt As POINTAPI) As Long
1012Declare 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
1013Declare Function SetEnhMetaFileBits Lib "gdi32" (cbBuffer As DWord, pData As *Byte) As HENHMETAFILE
1014Declare Function SetMapMode Lib "gdi32" (hdc As HDC, fnMapMode As Long) As Long
1015Declare Function SetMetaFileBitsEx Lib "gdi32" (nSize As DWord, pData As *Byte) As HMETAFILE
1016Declare Function SetMiterLimit Lib "gdi32" (hdc As HDC, eNewLimit As Single, peOldLimit As SinglePtr) As Long
1017Declare Function SetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long, crColor As DWord) As DWord
1018Declare Function SetPolyFillMode Lib "gdi32" (hdc As HDC, iPolyFillMode As Long) As Long
1019Declare Function SetRectRgn Lib "gdi32" (hRgn As HRGN, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
1020Declare Function SetROP2 Lib "gdi32" (hdc As HDC, fnDrawMode As Long) As Long
1021
1022Const BLACKONWHITE = 1
1023Const WHITEONBLACK = 2
1024Const COLORONCOLOR = 3
1025Const HALFTONE = 4
1026Const STRETCH_ANDSCANS = BLACKONWHITE
1027Const STRETCH_ORSCANS = WHITEONBLACK
1028Const STRETCH_DELETESCANS = COLORONCOLOR
1029Const STRETCH_HALFTONE = HALFTONE
1030Declare Function SetStretchBltMode Lib "gdi32" (hdc As HDC, iStretchMode As Long) As Long
1031
1032Declare Function SetTextAlign Lib "gdi32" (hdc As HDC, fMode As DWord) As DWord
1033Declare Function SetTextColor Lib "gdi32" (hdc As HDC, crColor As DWord) As DWord
1034Declare Function SetViewportExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long
1035Declare Function SetViewportOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1036Declare Function SetWindowExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long
1037Declare Function SetWindowOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1038Declare Function SetWinMetaFileBits Lib "gdi32" (cbBuffer As DWord, pbBuffer As *Byte, hdcRef As HDC, ByRef mfp As METAFILEPICT) As HENHMETAFILE
1039Declare Function StartDoc Lib "gdi32" Alias "StartDocA" (hdc As HDC, ByRef ref_di As DOCINFO) As Long
1040Declare Function StartPage Lib "gdi32" (hdc As HDC) As Long
1041Declare 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
1042Declare 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
1043Declare Function StrokeAndFillPath Lib "gdi32" (hdc As HDC) As Long
1044Declare Function StrokePath Lib "gdi32" (DC As DWord) As Long
1045Declare Function TextOutA Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCSTR, cbString As Long) As Long
1046Declare Function TextOutW Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCWSTR, cbString As Long) As Long
1047#ifdef UNICODE
1048Declare Function TextOut Lib "gdi32" Alias "TextOutW" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCTSTR, cbString As Long) As Long
1049#else
1050Declare Function TextOut Lib "gdi32" Alias "TextOutA" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCTSTR, cbString As Long) As Long
1051#endif
1052
1053/* Pixel Format */
1054Type PIXELFORMATDESCRIPTOR
1055 nSize As Word
1056 nVersion As Word
1057 dwFlags As DWord
1058 iPixelType As Byte
1059 cColorBits As Byte
1060 cRedBits As Byte
1061 cRedShift As Byte
1062 cGreenBits As Byte
1063 cGreenShift As Byte
1064 cBlueBits As Byte
1065 cBlueShift As Byte
1066 cAlphaBits As Byte
1067 cAlphaShift As Byte
1068 cAccumBits As Byte
1069 cAccumRedBits As Byte
1070 cAccumGreenBits As Byte
1071 cAccumBlueBits As Byte
1072 cAccumAlphaBits As Byte
1073 cDepthBits As Byte
1074 cStencilBits As Byte
1075 cAuxBuffers As Byte
1076 iLayerType As Byte
1077 bReserved As Byte
1078 dwLayerMask As DWord
1079 dwVisibleMask As DWord
1080 dwDamageMask As DWord
1081End Type
1082TypeDef PPIXELFORMATDESCRIPTOR = *PIXELFORMATDESCRIPTOR
1083TypeDef LPPIXELFORMATDESCRIPTOR = *PIXELFORMATDESCRIPTOR
1084
1085Const PFD_TYPE_RGBA = 0
1086Const PFD_TYPE_COLORINDEX = 1
1087
1088Const PFD_MAIN_PLANE = 0
1089Const PFD_OVERLAY_PLANE = 1
1090Const PFD_UNDERLAY_PLANE = (-1)
1091
1092Const PFD_DOUBLEBUFFER = &H00000001
1093Const PFD_STEREO = &H00000002
1094Const PFD_DRAW_TO_WINDOW = &H00000004
1095Const PFD_DRAW_TO_BITMAP = &H00000008
1096Const PFD_SUPPORT_GDI = &H00000010
1097Const PFD_SUPPORT_OPENGL = &H00000020
1098Const PFD_GENERIC_FORMAT = &H00000040
1099Const PFD_NEED_PALETTE = &H00000080
1100Const PFD_NEED_SYSTEM_PALETTE = &H00000100
1101Const PFD_SWAP_EXCHANGE = &H00000200
1102Const PFD_SWAP_COPY = &H00000400
1103Const PFD_SWAP_LAYER_BUFFERS = &H00000800
1104Const PFD_GENERIC_ACCELERATED = &H00001000
1105Const PFD_SUPPORT_DIRECTDRAW = &H00002000
1106
1107Const PFD_DEPTH_DONTCARE = &H20000000
1108Const PFD_DOUBLEBUFFER_DONTCARE = &H40000000
1109Const PFD_STEREO_DONTCARE = &H80000000
1110
1111Declare Function ChoosePixelFormat Lib "gdi32" (hdc As HDC, ByRef lppfd As PIXELFORMATDESCRIPTOR) As Long
1112Declare Function DescribePixelFormat Lib "gdi32" (hdc As HDC, n As Long, u As DWord, ByRef lppfd As PIXELFORMATDESCRIPTOR) As Long
1113Declare Function GetPixelFormat Lib "gdi32" (hdc As HDC) As Long
1114Declare Function SetPixelFormat Lib "gdi32" (hdc As HDC, i As Long, ByRef lppfd As PIXELFORMATDESCRIPTOR) As BOOL
1115
1116
1117/* OpenGL Support */
1118Type _System_DeclareHandle_HGLRC:unused As DWord:End Type
1119TypeDef HGLRC = *_System_DeclareHandle_HGLRC
1120
1121Declare Function wglCopyContext Lib "opengl32" (hglrcSource As HGLRC, hglrcDest As HGLRC, mask As DWord) As BOOL
1122Declare Function wglCreateContext Lib "opengl32" (hdc As HDC) As HGLRC
1123Declare Function wglCreateLayerContext Lib "opengl32" (hdc As HDC, iLayerPlane As Long) As HGLRC
1124Declare Function wglDeleteContext Lib "opengl32" (hglrc As HGLRC) As BOOL
1125Declare Function wglGetCurrentContext Lib "opengl32" () As HGLRC
1126Declare Function wglGetCurrentDC Lib "opengl32" () As HDC
1127Declare Function wglGetProcAddress Lib "opengl32" (lpstr As LPSTR) As PROC
1128Declare Function wglMakeCurrent Lib "opengl32" (hdc As HDC, hglrc As HGLRC) As BOOL
1129Declare Function wglShareLists Lib "opengl32" (hglrc1 As HGLRC, hglrc2 As HGLRC) As BOOL
1130Declare Function wglUseFontBitmaps Lib "opengl32" Alias "wglUseFontBitmapsA" (hdc As HDC, first As DWord, count As DWord, listbase As DWord) As BOOL
1131Declare Function SwapBuffers Lib "gdi32" (hdc As HDC) As BOOL
1132
1133Type POINTFLOAT
1134 x As Single
1135 y As Single
1136End Type
1137TypeDef PPOINTFLOAT = *POINTFLOAT
1138
1139Type GLYPHMETRICSFLOAT
1140 gmfBlackBoxX As Single
1141 gmfBlackBoxY As Single
1142 gmfptGlyphOrigin As POINTFLOAT
1143 gmfCellIncX As Single
1144 gmfCellIncY As Single
1145End Type
1146TypeDef PGLYPHMETRICSFLOAT = *GLYPHMETRICSFLOAT
1147TypeDef LPGLYPHMETRICSFLOAT = *GLYPHMETRICSFLOAT
1148
1149Const WGL_FONT_LINES = 0
1150Const WGL_FONT_POLYGONS = 1
1151
1152Declare 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
1153
1154Type LAYERPLANEDESCRIPTOR
1155 nSize As Word
1156 nVersion As Word
1157 dwFlags As DWord
1158 iPixelType As Byte
1159 cColorBits As Byte
1160 cRedBits As Byte
1161 cRedShift As Byte
1162 cGreenBits As Byte
1163 cGreenShift As Byte
1164 cBlueBits As Byte
1165 cBlueShift As Byte
1166 cAlphaBits As Byte
1167 cAlphaShift As Byte
1168 cAccumBits As Byte
1169 cAccumRedBits As Byte
1170 cAccumGreenBits As Byte
1171 cAccumBlueBits As Byte
1172 cAccumAlphaBits As Byte
1173 cDepthBits As Byte
1174 cStencilBits As Byte
1175 cAuxBuffers As Byte
1176 iLayerPlane As Byte
1177 bReserved As Byte
1178 crTransparent As COLORREF
1179End Type
1180TypeDef PLAYERPLANEDESCRIPTOR = *LAYERPLANEDESCRIPTOR
1181TypeDef LPLAYERPLANEDESCRIPTOR = *LAYERPLANEDESCRIPTOR
1182
1183Const LPD_DOUBLEBUFFER = &H00000001
1184Const LPD_STEREO = &H00000002
1185Const LPD_SUPPORT_GDI = &H00000010
1186Const LPD_SUPPORT_OPENGL = &H00000020
1187Const LPD_SHARE_DEPTH = &H00000040
1188Const LPD_SHARE_STENCIL = &H00000080
1189Const LPD_SHARE_ACCUM = &H00000100
1190Const LPD_SWAP_EXCHANGE = &H00000200
1191Const LPD_SWAP_COPY = &H00000400
1192Const LPD_TRANSPARENT = &H00001000
1193Const LPD_TYPE_RGBA = 0
1194Const LPD_TYPE_COLORINDEX = 1
1195
1196Const WGL_SWAP_MAIN_PLANE = &H00000001
1197Const WGL_SWAP_OVERLAY1 = &H00000002
1198Const WGL_SWAP_OVERLAY2 = &H00000004
1199Const WGL_SWAP_OVERLAY3 = &H00000008
1200Const WGL_SWAP_OVERLAY4 = &H00000010
1201Const WGL_SWAP_OVERLAY5 = &H00000020
1202Const WGL_SWAP_OVERLAY6 = &H00000040
1203Const WGL_SWAP_OVERLAY7 = &H00000080
1204Const WGL_SWAP_OVERLAY8 = &H00000100
1205Const WGL_SWAP_OVERLAY9 = &H00000200
1206Const WGL_SWAP_OVERLAY10 = &H00000400
1207Const WGL_SWAP_OVERLAY11 = &H00000800
1208Const WGL_SWAP_OVERLAY12 = &H00001000
1209Const WGL_SWAP_OVERLAY13 = &H00002000
1210Const WGL_SWAP_OVERLAY14 = &H00004000
1211Const WGL_SWAP_OVERLAY15 = &H00008000
1212Const WGL_SWAP_UNDERLAY1 = &H00010000
1213Const WGL_SWAP_UNDERLAY2 = &H00020000
1214Const WGL_SWAP_UNDERLAY3 = &H00040000
1215Const WGL_SWAP_UNDERLAY4 = &H00080000
1216Const WGL_SWAP_UNDERLAY5 = &H00100000
1217Const WGL_SWAP_UNDERLAY6 = &H00200000
1218Const WGL_SWAP_UNDERLAY7 = &H00400000
1219Const WGL_SWAP_UNDERLAY8 = &H00800000
1220Const WGL_SWAP_UNDERLAY9 = &H01000000
1221Const WGL_SWAP_UNDERLAY10 = &H02000000
1222Const WGL_SWAP_UNDERLAY11 = &H04000000
1223Const WGL_SWAP_UNDERLAY12 = &H08000000
1224Const WGL_SWAP_UNDERLAY13 = &H10000000
1225Const WGL_SWAP_UNDERLAY14 = &H20000000
1226Const WGL_SWAP_UNDERLAY15 = &H40000000
1227
1228Declare Function wglDescribeLayerPlane Lib "opengl32" (hdc As HDC, iPixelFormat As Long, iLayerPlane As Long, nByte As DWord, ByRef lplpd As LAYERPLANEDESCRIPTOR) As BOOL
1229Declare Function wglSetLayerPaletteEntries Lib "opengl32" (hdc As HDC, iLayerPlane As Long, iStart As Long, cEntries As Long, lpcr As *COLORREF) As Long
1230Declare Function wglGetLayerPaletteEntries Lib "opengl32" (hdc As HDC, iLayerPlane As Long, iStart As Long, cEntries As Long, lpcr As *COLORREF) As Long
1231Declare Function wglRealizeLayerPalette Lib "opengl32" (hdc As HDC, iLayerPlane As Long, bRealize As BOOL) As BOOL
1232Declare Function wglSwapLayerBuffers Lib "opengl32" (hdc As HDC, fuPlanes As DWord) As BOOL
1233
1234Type WGLSWAP
1235 hdc As HDC
1236 uiFlags As DWord
1237End Type
1238TypeDef PWGLSWAP = *WGLSWAP
1239TypeDef LPWGLSWAP = *WGLSWAP
1240
1241Const WGL_SWAPMULTIPLE_MAX = 16
1242
1243'Declare Function wglSwapMultipleBuffers Lib "opengl32" (u As DWord, lpwglswap As *WGLSWAP) As DWord
1244
1245#endif '_INC_GDI
Note: See TracBrowser for help on using the repository browser.