source: Include/api_gdi.sbp@ 121

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

#51対応

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