ScummVM API documentation
wingdi.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BAGEL_MFC_WINGDI_H
23 #define BAGEL_MFC_WINGDI_H
24 
25 #include "bagel/mfc/minwindef.h"
26 
27 namespace Bagel {
28 namespace MFC {
29 
30 class CDC;
31 
32 #define PALETTEINDEX(i) ((COLORREF)(0x01000000 | (uint32)(uint16)(i)))
33 
34 /*
35  * Class styles
36  */
37 #define CS_VREDRAW 0x0001
38 #define CS_HREDRAW 0x0002
39 #define CS_DBLCLKS 0x0008
40 #define CS_OWNDC 0x0020
41 #define CS_CLASSDC 0x0040
42 #define CS_PARENTDC 0x0080
43 #define CS_NOCLOSE 0x0200
44 #define CS_SAVEBITS 0x0800
45 #define CS_BYTEALIGNCLIENT 0x1000
46 #define CS_BYTEALIGNWINDOW 0x2000
47 #define CS_GLOBALCLASS 0x4000
48 
49 /* Device Parameters for GetDeviceCaps() */
50 #define DRIVERVERSION 0 /* Device driver version */
51 #define TECHNOLOGY 2 /* Device classification */
52 #define HORZSIZE 4 /* Horizontal size in millimeters */
53 #define VERTSIZE 6 /* Vertical size in millimeters */
54 #define HORZRES 8 /* Horizontal width in pixels */
55 #define VERTRES 10 /* Vertical height in pixels */
56 #define BITSPIXEL 12 /* Number of bits per pixel */
57 #define PLANES 14 /* Number of planes */
58 #define NUMBRUSHES 16 /* Number of brushes the device has */
59 #define NUMPENS 18 /* Number of pens the device has */
60 #define NUMMARKERS 20 /* Number of markers the device has */
61 #define NUMFONTS 22 /* Number of fonts the device has */
62 #define NUMCOLORS 24 /* Number of colors the device supports */
63 #define PDEVICESIZE 26 /* Size required for device descriptor */
64 #define CURVECAPS 28 /* Curve capabilities */
65 #define LINECAPS 30 /* Line capabilities */
66 #define POLYGONALCAPS 32 /* Polygonal capabilities */
67 #define TEXTCAPS 34 /* Text capabilities */
68 #define CLIPCAPS 36 /* Clipping capabilities */
69 #define RASTERCAPS 38 /* Bitblt capabilities */
70 #define ASPECTX 40 /* Length of the X leg */
71 #define ASPECTY 42 /* Length of the Y leg */
72 #define ASPECTXY 44 /* Length of the hypotenuse */
73 
74 #define LOGPIXELSX 88 /* Logical pixels/inch in X */
75 #define LOGPIXELSY 90 /* Logical pixels/inch in Y */
76 
77 #define SIZEPALETTE 104 /* Number of entries in physical palette */
78 #define NUMRESERVED 106 /* Number of reserved entries in palette */
79 #define COLORRES 108 /* Actual color resolution */
80 
81 // Printing related DeviceCaps. These replace the appropriate Escapes
82 
83 #define PHYSICALWIDTH 110 /* Physical Width in device units */
84 #define PHYSICALHEIGHT 111 /* Physical Height in device units */
85 #define PHYSICALOFFSETX 112 /* Physical Printable Area x margin */
86 #define PHYSICALOFFSETY 113 /* Physical Printable Area y margin */
87 #define SCALINGFACTORX 114 /* Scaling factor x */
88 #define SCALINGFACTORY 115 /* Scaling factor y */
89 
90 // Display driver specific
91 
92 #define VREFRESH 116 /* Current vertical refresh rate of the */
93 /* display device (for displays only) in Hz*/
94 #define DESKTOPVERTRES 117 /* Horizontal width of entire desktop in */
95 /* pixels */
96 #define DESKTOPHORZRES 118 /* Vertical height of entire desktop in */
97 /* pixels */
98 #define BLTALIGNMENT 119 /* Preferred blt alignment */
99 #define SHADEBLENDCAPS 120 /* Shading and blending caps */
100 #define COLORMGMTCAPS 121 /* Color Management caps */
101 
102 
103 /* Raster Capabilities */
104 #define RC_NONE
105 #define RC_BITBLT 1 /* Can do standard BLT. */
106 #define RC_BANDING 2 /* Device requires banding support */
107 #define RC_SCALING 4 /* Device requires scaling support */
108 #define RC_BITMAP64 8 /* Device can support >64K bitmap */
109 #define RC_GDI20_OUTPUT 0x0010 /* has 2.0 output calls */
110 #define RC_GDI20_STATE 0x0020
111 #define RC_SAVEBITMAP 0x0040
112 #define RC_DI_BITMAP 0x0080 /* supports DIB to memory */
113 #define RC_PALETTE 0x0100 /* supports a palette */
114 #define RC_DIBTODEV 0x0200 /* supports DIBitsToDevice */
115 #define RC_BIGFONT 0x0400 /* supports >64K fonts */
116 #define RC_STRETCHBLT 0x0800 /* supports StretchBlt */
117 #define RC_FLOODFILL 0x1000 /* supports FloodFill */
118 #define RC_STRETCHDIB 0x2000 /* supports StretchDIBits */
119 #define RC_OP_DX_OUTPUT 0x4000
120 #define RC_DEVBITS 0x8000
121 
122 /* Ternary raster operations */
123 #define SRCCOPY (uint32)0x00CC0020 /* dest = source */
124 #define SRCPAINT (uint32)0x00EE0086 /* dest = source OR dest */
125 #define SRCAND (uint32)0x008800C6 /* dest = source AND dest */
126 #define SRCINVERT (uint32)0x00660046 /* dest = source XOR dest */
127 #define SRCERASE (uint32)0x00440328 /* dest = source AND (NOT dest ) */
128 #define NOTSRCCOPY (uint32)0x00330008 /* dest = (NOT source) */
129 #define NOTSRCERASE (uint32)0x001100A6 /* dest = (NOT src) AND (NOT dest) */
130 #define MERGECOPY (uint32)0x00C000CA /* dest = (source AND pattern) */
131 #define MERGEPAINT (uint32)0x00BB0226 /* dest = (NOT source) OR dest */
132 #define PATCOPY (uint32)0x00F00021 /* dest = pattern */
133 #define PATPAINT (uint32)0x00FB0A09 /* dest = DPSnoo */
134 #define PATINVERT (uint32)0x005A0049 /* dest = pattern XOR dest */
135 #define DSTINVERT (uint32)0x00550009 /* dest = (NOT dest) */
136 #define BLACKNESS (uint32)0x00000042 /* dest = BLACK */
137 #define WHITENESS (uint32)0x00FF0062 /* dest = WHITE */
138 #define NOMIRRORBITMAP (uint32)0x80000000 /* Do not Mirror the bitmap in this call */
139 #define CAPTUREBLT (uint32)0x40000000 /* Include layered windows */
140 
141 /* StretchBlt() Modes */
142 #define BLACKONWHITE 1
143 #define WHITEONBLACK 2
144 #define COLORONCOLOR 3
145 #define HALFTONE 4
146 #define MAXSTRETCHBLTMODE 4
147 
148 /* DIB color table identifiers */
149 #define DIB_RGB_COLORS 0 /* color table in RGBs */
150 #define DIB_PAL_COLORS 1 /* color table in palette indices */
151 
152 /* constants for CreateDIBitmap */
153 #define CBM_INIT 0x04L /* initialize bitmap */
154 
155 /*
156  * ShowWindow() Commands
157  */
158 #define SW_HIDE 0
159 #define SW_SHOWNORMAL 1
160 #define SW_NORMAL 1
161 #define SW_SHOWMINIMIZED 2
162 #define SW_SHOWMAXIMIZED 3
163 #define SW_MAXIMIZE 3
164 #define SW_SHOWNOACTIVATE 4
165 #define SW_SHOW 5
166 #define SW_MINIMIZE 6
167 #define SW_SHOWMINNOACTIVE 7
168 #define SW_SHOWNA 8
169 #define SW_RESTORE 9
170 #define SW_SHOWDEFAULT 10
171 #define SW_FORCEMINIMIZE 11
172 #define SW_MAX 11
173 
174 /* GetWindowWord */
175 #define GWW_HINSTANCE (-6)
176 
177 /* Font Families */
178 #define FF_DONTCARE (0<<4) /* Don't care or don't know. */
179 #define FF_ROMAN (1<<4) /* Variable stroke width, serifed. */
180 /* Times Roman, Century Schoolbook, etc. */
181 #define FF_SWISS (2<<4) /* Variable stroke width, sans-serifed. */
182 /* Helvetica, Swiss, etc. */
183 #define FF_MODERN (3<<4) /* Constant stroke width, serifed or sans-serifed. */
184 /* Pica, Elite, Courier, etc. */
185 #define FF_SCRIPT (4<<4) /* Cursive, etc. */
186 #define FF_DECORATIVE (5<<4) /* Old English, etc. */
187 
188 /* Font Weights */
189 enum FontWeight {
190  FW_DONTCARE = 0,
191  FW_THIN = 100,
192  FW_EXTRALIGHT = 200,
193  FW_LIGHT = 300,
194  FW_NORMAL = 400,
195  FW_MEDIUM = 500,
196  FW_SEMIBOLD = 600,
197  FW_BOLD = 700,
198  FW_EXTRABOLD = 800,
199  FW_HEAVY = 900,
200 
201  FW_ULTRALIGHT = FW_EXTRALIGHT,
202  FW_REGULAR = FW_NORMAL,
203  FW_DEMIBOLD = FW_SEMIBOLD,
204  FW_ULTRABOLD = FW_EXTRABOLD,
205  FW_BLACK = FW_HEAVY
206 };
207 
208 
209 #define OUT_DEFAULT_PRECIS 0
210 #define OUT_STRING_PRECIS 1
211 #define OUT_CHARACTER_PRECIS 2
212 #define OUT_STROKE_PRECIS 3
213 #define OUT_TT_PRECIS 4
214 #define OUT_DEVICE_PRECIS 5
215 #define OUT_RASTER_PRECIS 6
216 #define OUT_TT_ONLY_PRECIS 7
217 #define OUT_OUTLINE_PRECIS 8
218 #define OUT_SCREEN_OUTLINE_PRECIS 9
219 #define OUT_PS_ONLY_PRECIS 10
220 
221 #define DEFAULT_QUALITY 0
222 #define DRAFT_QUALITY 1
223 #define PROOF_QUALITY 2
224 #define NONANTIALIASED_QUALITY 3
225 #define ANTIALIASED_QUALITY 4
226 
227 /* Background Modes */
228 #define TRANSPARENT 1
229 #define OPAQUE 2
230 #define BKMODE_LAST 2
231 
232 /*
233  * Button Control Styles
234  */
235 #define BS_PUSHBUTTON 0x00000000L
236 #define BS_DEFPUSHBUTTON 0x00000001L
237 #define BS_CHECKBOX 0x00000002L
238 #define BS_AUTOCHECKBOX 0x00000003L
239 #define BS_RADIOBUTTON 0x00000004L
240 #define BS_3STATE 0x00000005L
241 #define BS_AUTO3STATE 0x00000006L
242 #define BS_GROUPBOX 0x00000007L
243 #define BS_USERBUTTON 0x00000008L
244 #define BS_AUTORADIOBUTTON 0x00000009L
245 #define BS_PUSHBOX 0x0000000AL
246 #define BS_OWNERDRAW 0x0000000BL
247 #define BS_TYPEMASK 0x0000000FL
248 #define BS_LEFTTEXT 0x00000020L
249 #define BS_TEXT 0x00000000L
250 #define BS_ICON 0x00000040L
251 #define BS_BITMAP 0x00000080L
252 #define BS_LEFT 0x00000100L
253 #define BS_RIGHT 0x00000200L
254 #define BS_CENTER 0x00000300L
255 #define BS_TOP 0x00000400L
256 #define BS_BOTTOM 0x00000800L
257 #define BS_VCENTER 0x00000C00L
258 #define BS_PUSHLIKE 0x00001000L
259 #define BS_MULTILINE 0x00002000L
260 #define BS_NOTIFY 0x00004000L
261 #define BS_FLAT 0x00008000L
262 #define BS_RIGHTBUTTON BS_LEFTTEXT
263 
264 /*
265  * Standard Cursor IDs
266  */
267 #define MAKEINTRESOURCE(i) ((char *)((uintptr)((uint16)(i))))
268 #define IDC_NONE 0
269 
270 #define IDC_ARROW MAKEINTRESOURCE(32512)
271 #define IDC_IBEAM MAKEINTRESOURCE(32513)
272 #define IDC_WAIT MAKEINTRESOURCE(32514)
273 #define IDC_CROSS MAKEINTRESOURCE(32515)
274 #define IDC_UPARROW MAKEINTRESOURCE(32516)
275 #define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
276 #define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
277 #define IDC_SIZENWSE MAKEINTRESOURCE(32642)
278 #define IDC_SIZENESW MAKEINTRESOURCE(32643)
279 #define IDC_SIZEWE MAKEINTRESOURCE(32644)
280 #define IDC_SIZENS MAKEINTRESOURCE(32645)
281 #define IDC_SIZEALL MAKEINTRESOURCE(32646)
282 #define IDC_NO MAKEINTRESOURCE(32648) /*not in win3.1 */
283 #define IDC_HAND MAKEINTRESOURCE(32649)
284 #define IDC_APPSTARTING MAKEINTRESOURCE(32650) /*not in win3.1 */
285 #define IDC_HELP MAKEINTRESOURCE(32651)
286 
287 
288 /*
289  * Owner draw state
290  */
291 enum {
292  ODS_SELECTED = 0x0001,
293  ODS_ENABLED = 0x0002,
294  ODS_DISABLED = 0x0004,
295  ODS_GRAYED = ODS_DISABLED,
296  ODS_CHECKED = 0x0008,
297  ODS_FOCUS = 0x0010,
298  ODS_DEFAULT = 0x0020,
299  ODS_COMBOBOXEDIT = 0x1000,
300  ODS_HOTLIGHT = 0x0040,
301  ODS_INACTIVE = 0x0080,
302  ODS_NOACCEL = 0x0100,
303  ODS_NOFOCUSRECT = 0x0200
304 };
305 
306 enum {
307  BST_UNCHECKED = 0,
308  BST_CHECKED = 1,
309  BST_INDETERMINATE = 2,
310  BST_PUSHED = 4,
311  BST_FOCUS = 8
312 };
313 
314 /* Stock Logical Objects */
315 #define WHITE_BRUSH 0
316 #define LTGRAY_BRUSH 1
317 #define GRAY_BRUSH 2
318 #define DKGRAY_BRUSH 3
319 #define BLACK_BRUSH 4
320 #define NULL_BRUSH 5
321 #define HOLLOW_BRUSH NULL_BRUSH
322 #define WHITE_PEN 6
323 #define BLACK_PEN 7
324 #define NULL_PEN 8
325 #define OEM_FIXED_FONT 10
326 #define ANSI_FIXED_FONT 11
327 #define ANSI_VAR_FONT 12
328 #define SYSTEM_FONT 13
329 #define DEVICE_DEFAULT_FONT 14
330 #define DEFAULT_PALETTE 15
331 #define SYSTEM_FIXED_FONT 16
332 
333 
334 /* Pen Styles */
335 #define PS_SOLID 0
336 #define PS_DASH 1 /* ------- */
337 #define PS_DOT 2 /* ....... */
338 #define PS_DASHDOT 3 /* _._._._ */
339 #define PS_DASHDOTDOT 4 /* _.._.._ */
340 #define PS_NULL 5
341 #define PS_INSIDEFRAME 6
342 #define PS_USERSTYLE 7
343 #define PS_ALTERNATE 8
344 #define PS_STYLE_MASK 0x0000000F
345 
346 
347 /*
348  * Button Control Messages
349  */
350 #define BM_GETCHECK 0x00F0
351 #define BM_SETCHECK 0x00F1
352 #define BM_GETSTATE 0x00F2
353 #define BM_SETSTATE 0x00F3
354 #define BM_SETSTYLE 0x00F4
355 #define BM_CLICK 0x00F5
356 #define BM_GETIMAGE 0x00F6
357 #define BM_SETIMAGE 0x00F7
358 #define BM_SETDONTCLICK 0x00F8
359 
360  /*
361  * Owner draw control types
362  */
363 #define ODT_MENU 1
364 #define ODT_LISTBOX 2
365 #define ODT_COMBOBOX 3
366 #define ODT_BUTTON 4
367 #define ODT_STATIC 5
368 
369 /*
370  * Owner draw actions
371  */
372 #define ODA_DRAWENTIRE 0x0001
373 #define ODA_SELECT 0x0002
374 #define ODA_FOCUS 0x0004
375 
376 
377 /*
378  * Color Types
379  */
380 #define CTLCOLOR_MSGBOX 0
381 #define CTLCOLOR_EDIT 1
382 #define CTLCOLOR_LISTBOX 2
383 #define CTLCOLOR_BTN 3
384 #define CTLCOLOR_DLG 4
385 #define CTLCOLOR_SCROLLBAR 5
386 #define CTLCOLOR_STATIC 6
387 #define CTLCOLOR_MAX 7
388 
389 #define COLOR_SCROLLBAR 0
390 #define COLOR_BACKGROUND 1
391 #define COLOR_ACTIVECAPTION 2
392 #define COLOR_INACTIVECAPTION 3
393 #define COLOR_MENU 4
394 #define COLOR_WINDOW 5
395 #define COLOR_WINDOWFRAME 6
396 #define COLOR_MENUTEXT 7
397 #define COLOR_WINDOWTEXT 8
398 #define COLOR_CAPTIONTEXT 9
399 #define COLOR_ACTIVEBORDER 10
400 #define COLOR_INACTIVEBORDER 11
401 #define COLOR_APPWORKSPACE 12
402 #define COLOR_HIGHLIGHT 13
403 #define COLOR_HIGHLIGHTTEXT 14
404 #define COLOR_BTNFACE 15
405 #define COLOR_BTNSHADOW 16
406 #define COLOR_GRAYTEXT 17
407 #define COLOR_BTNTEXT 18
408 #define COLOR_INACTIVECAPTIONTEXT 19
409 #define COLOR_BTNHIGHLIGHT 20
410 #define COLOR_3DDKSHADOW 21
411 #define COLOR_3DLIGHT 22
412 #define COLOR_INFOTEXT 23
413 #define COLOR_INFOBK 24
414 #define COLOR_HOTLIGHT 26
415 #define COLOR_GRADIENTACTIVECAPTION 27
416 #define COLOR_GRADIENTINACTIVECAPTION 28
417 #define COLOR_MENUHILIGHT 29
418 #define COLOR_MENUBAR 30
419 #define COLOR_DESKTOP COLOR_BACKGROUND
420 #define COLOR_3DFACE COLOR_BTNFACE
421 #define COLOR_3DSHADOW COLOR_BTNSHADOW
422 #define COLOR_3DHIGHLIGHT COLOR_BTNHIGHLIGHT
423 #define COLOR_3DHILIGHT COLOR_BTNHIGHLIGHT
424 #define COLOR_BTNHILIGHT COLOR_BTNHIGHLIGHT
425 
426 /* StretchBlt() Modes */
427 #define BLACKONWHITE 1
428 #define WHITEONBLACK 2
429 #define COLORONCOLOR 3
430 #define HALFTONE 4
431 #define MAXSTRETCHBLTMODE 4
432 #define STRETCH_ANDSCANS BLACKONWHITE
433 #define STRETCH_ORSCANS WHITEONBLACK
434 #define STRETCH_DELETESCANS COLORONCOLOR
435 #define STRETCH_HALFTONE HALFTONE
436 
437 /* Binary raster ops */
438 #define R2_BLACK 1 /* 0 */
439 #define R2_NOTMERGEPEN 2 /* DPon */
440 #define R2_MASKNOTPEN 3 /* DPna */
441 #define R2_NOTCOPYPEN 4 /* PN */
442 #define R2_MASKPENNOT 5 /* PDna */
443 #define R2_NOT 6 /* Dn */
444 #define R2_XORPEN 7 /* DPx */
445 #define R2_NOTMASKPEN 8 /* DPan */
446 #define R2_MASKPEN 9 /* DPa */
447 #define R2_NOTXORPEN 10 /* DPxn */
448 #define R2_NOP 11 /* D */
449 #define R2_MERGENOTPEN 12 /* DPno */
450 #define R2_COPYPEN 13 /* P */
451 #define R2_MERGEPENNOT 14 /* PDno */
452 #define R2_MERGEPEN 15 /* DPo */
453 #define R2_WHITE 16 /* 1 */
454 #define R2_LAST 16
455 
456 /* Brush Styles */
457 #define BS_SOLID 0
458 #define BS_NULL 1
459 #define BS_HOLLOW BS_NULL
460 #define BS_HATCHED 2
461 #define BS_PATTERN 3
462 #define BS_INDEXED 4
463 #define BS_DIBPATTERN 5
464 #define BS_DIBPATTERNPT 6
465 #define BS_PATTERN8X8 7
466 #define BS_DIBPATTERN8X8 8
467 #define BS_MONOPATTERN 9
468 
469 /* palette entry flags */
470 #define PC_RESERVED 0x01 /* palette index used for animation */
471 #define PC_EXPLICIT 0x02 /* palette index is explicit to device */
472 #define PC_NOCOLLAPSE 0x04 /* do not match color to system palette */
473 
474 /*
475  * DrawText() Format Flags
476  */
477 #define DT_TOP 0x00000000
478 #define DT_LEFT 0x00000000
479 #define DT_CENTER 0x00000001
480 #define DT_RIGHT 0x00000002
481 #define DT_VCENTER 0x00000004
482 #define DT_BOTTOM 0x00000008
483 #define DT_WORDBREAK 0x00000010
484 #define DT_SINGLELINE 0x00000020
485 #define DT_EXPANDTABS 0x00000040
486 #define DT_TABSTOP 0x00000080
487 #define DT_NOCLIP 0x00000100
488 #define DT_EXTERNALLEADING 0x00000200
489 #define DT_CALCRECT 0x00000400
490 #define DT_NOPREFIX 0x00000800
491 #define DT_INTERNAL 0x00001000
492 
493 /* Text Alignment Options */
494 #define TA_NOUPDATECP 0
495 #define TA_UPDATECP 1
496 
497 #define TA_LEFT 0
498 #define TA_RIGHT 2
499 #define TA_CENTER 6
500 
501 #define TA_TOP 0
502 #define TA_BOTTOM 8
503 #define TA_BASELINE 24
504 
505 /*
506  * Menu flags for Add/Check/EnableMenuItem()
507  */
508 #define MF_INSERT 0x00000000L
509 #define MF_CHANGE 0x00000080L
510 #define MF_APPEND 0x00000100L
511 #define MF_DELETE 0x00000200L
512 #define MF_REMOVE 0x00001000L
513 
514 #define MF_BYCOMMAND 0x00000000L
515 #define MF_BYPOSITION 0x00000400L
516 #define MF_SEPARATOR 0x00000800L
517 #define MF_ENABLED 0x00000000L
518 #define MF_GRAYED 0x00000001L
519 #define MF_DISABLED 0x00000002L
520 #define MF_UNCHECKED 0x00000000L
521 #define MF_CHECKED 0x00000008L
522 #define MF_USECHECKBITMAPS 0x00000200L
523 #define MF_STRING 0x00000000L
524 #define MF_BITMAP 0x00000004L
525 #define MF_OWNERDRAW 0x00000100L
526 #define MF_POPUP 0x00000010L
527 #define MF_MENUBARBREAK 0x00000020L
528 #define MF_MENUBREAK 0x00000040L
529 #define MF_UNHILITE 0x00000000L
530 #define MF_HILITE 0x00000080L
531 
532 // CBrush hatch styles
533 #define HS_HORIZONTAL 0
534 #define HS_VERTICAL 1
535 #define HS_FDIAGONAL 2
536 #define HS_BDIAGONAL 3
537 #define HS_CROSS 4
538 #define HS_DIAGCROSS 5
539 
540 // Constants for the biCompression field
541 #define BI_RGB 0L
542 
543 /* tmPitchAndFamily flags */
544 #define TMPF_FIXED_PITCH 0x01
545 #define TMPF_VECTOR 0x02
546 #define TMPF_DEVICE 0x08
547 #define TMPF_TRUETYPE 0x04
548 
549 #define ANSI_CHARSET 0
550 
551 /* 3D border styles */
552 #define BDR_RAISEDOUTER 0x0001
553 #define BDR_SUNKENOUTER 0x0002
554 #define BDR_RAISEDINNER 0x0004
555 #define BDR_SUNKENINNER 0x0008
556 
557 #define BDR_OUTER (BDR_RAISEDOUTER | BDR_SUNKENOUTER)
558 #define BDR_INNER (BDR_RAISEDINNER | BDR_SUNKENINNER)
559 #define BDR_RAISED (BDR_RAISEDOUTER | BDR_RAISEDINNER)
560 #define BDR_SUNKEN (BDR_SUNKENOUTER | BDR_SUNKENINNER)
561 
562 
563 #define EDGE_RAISED (BDR_RAISEDOUTER | BDR_RAISEDINNER)
564 #define EDGE_SUNKEN (BDR_SUNKENOUTER | BDR_SUNKENINNER)
565 #define EDGE_ETCHED (BDR_SUNKENOUTER | BDR_RAISEDINNER)
566 #define EDGE_BUMP (BDR_RAISEDOUTER | BDR_SUNKENINNER)
567 
568 /* Border flags */
569 #define BF_LEFT 0x0001
570 #define BF_TOP 0x0002
571 #define BF_RIGHT 0x0004
572 #define BF_BOTTOM 0x0008
573 
574 #define BF_TOPLEFT (BF_TOP | BF_LEFT)
575 #define BF_TOPRIGHT (BF_TOP | BF_RIGHT)
576 #define BF_BOTTOMLEFT (BF_BOTTOM | BF_LEFT)
577 #define BF_BOTTOMRIGHT (BF_BOTTOM | BF_RIGHT)
578 #define BF_RECT (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM)
579 
580 #define BF_DIAGONAL 0x0010
581 
582 
583 // For diagonal lines, the BF_RECT flags specify the end point of the
584 // vector bounded by the rectangle parameter.
585 #define BF_DIAGONAL_ENDTOPRIGHT (BF_DIAGONAL | BF_TOP | BF_RIGHT)
586 #define BF_DIAGONAL_ENDTOPLEFT (BF_DIAGONAL | BF_TOP | BF_LEFT)
587 #define BF_DIAGONAL_ENDBOTTOMLEFT (BF_DIAGONAL | BF_BOTTOM | BF_LEFT)
588 #define BF_DIAGONAL_ENDBOTTOMRIGHT (BF_DIAGONAL | BF_BOTTOM | BF_RIGHT)
589 
590 
591 #define BF_MIDDLE 0x0800 /* Fill in the middle */
592 #define BF_SOFT 0x1000 /* For softer buttons */
593 #define BF_ADJUST 0x2000 /* Calculate the space left over */
594 #define BF_FLAT 0x4000 /* For flat rather than 3D borders */
595 #define BF_MONO 0x8000 /* For monochrome borders */
596 
597 /*
598  * WM_NCHITTEST and MOUSEHOOKSTRUCT Mouse Position Codes
599  */
600 #define HTERROR (-2)
601 #define HTTRANSPARENT (-1)
602 #define HTNOWHERE 0
603 #define HTCLIENT 1
604 #define HTCAPTION 2
605 #define HTSYSMENU 3
606 #define HTGROWBOX 4
607 #define HTSIZE HTGROWBOX
608 #define HTMENU 5
609 #define HTHSCROLL 6
610 #define HTVSCROLL 7
611 #define HTMINBUTTON 8
612 #define HTMAXBUTTON 9
613 #define HTLEFT 10
614 #define HTRIGHT 11
615 #define HTTOP 12
616 #define HTTOPLEFT 13
617 #define HTTOPRIGHT 14
618 #define HTBOTTOM 15
619 #define HTBOTTOMLEFT 16
620 #define HTBOTTOMRIGHT 17
621 #define HTBORDER 18
622 #define HTREDUCE HTMINBUTTON
623 #define HTZOOM HTMAXBUTTON
624 #define HTSIZEFIRST HTLEFT
625 #define HTSIZELAST HTBOTTOMRIGHT
626 
627 
628 typedef struct tagBITMAPINFOHEADER {
629  uint32 biSize;
630  long biWidth;
631  long biHeight;
632  uint16 biPlanes;
633  uint16 biBitCount;
634  uint32 biCompression;
635  uint32 biSizeImage;
636  long biXPelsPerMeter;
637  long biYPelsPerMeter;
638  uint32 biClrUsed;
639  uint32 biClrImportant;
642 
643 typedef struct tagRGBQUAD {
644  byte rgbBlue;
645  byte rgbGreen;
646  byte rgbRed;
647  byte rgbReserved;
648 } RGBQUAD;
649 
650 typedef struct tagBITMAPINFO {
651  BITMAPINFOHEADER bmiHeader;
652  RGBQUAD bmiColors[1];
654 
655 /* Bitmap Header Definition */
656 typedef struct tagBITMAP {
657  int bmType;
658  int bmWidth;
659  int bmHeight;
660  int bmWidthBytes;
661  uint16 bmPlanes;
662  uint16 bmBitsPixel;
663  void * bmBits;
664 } BITMAP, *PBITMAP, NEAR *NPBITMAP, FAR *LPBITMAP;
665 
666 typedef struct tagBITMAPCOREHEADER {
667  uint32 bcSize; /* used to get to color table */
668  uint16 bcWidth;
669  uint16 bcHeight;
670  uint16 bcPlanes;
671  uint16 bcBitCount;
673 
674 typedef struct tagRGBTRIPLE {
675  byte rgbtBlue;
676  byte rgbtGreen;
677  byte rgbtRed;
679 
680 typedef struct tagBITMAPCOREINFO {
681  BITMAPCOREHEADER bmciHeader;
682  RGBTRIPLE bmciColors[1];
684 
685 typedef struct tagPALETTEENTRY {
686  byte peRed;
687  byte peGreen;
688  byte peBlue;
689  byte peFlags;
691 
692 typedef struct tagLOGPALETTE {
693  uint16 palVersion;
694  uint16 palNumEntries;
695  PALETTEENTRY palPalEntry[1];
697 
698 
699 /*
700  * MEASUREITEMSTRUCT for ownerdraw
701  */
702 typedef struct tagMEASUREITEMSTRUCT {
703  unsigned int CtlType;
704  unsigned int CtlID;
705  unsigned int itemID;
706  unsigned int itemWidth;
707  unsigned int itemHeight;
708  uintptr itemData;
710 
711 /*
712  * DRAWITEMSTRUCT for ownerdraw
713  */
714 typedef struct tagDRAWITEMSTRUCT {
715  unsigned int CtlType;
716  unsigned int CtlID;
717  unsigned int itemID;
718  unsigned int itemAction;
719  unsigned int itemState;
720  HWND hwndItem;
721  HDC hDC;
722  RECT rcItem;
723  uintptr itemData;
725 
726 /* Logical Brush (or Pattern) */
727 typedef struct tagLOGBRUSH {
728  unsigned int lbStyle;
729  COLORREF lbColor;
730  uintptr lbHatch;
731 } LOGBRUSH, *PLOGBRUSH, NEAR *NPLOGBRUSH, FAR *LPLOGBRUSH;
732 
733 extern int GetDeviceCaps(HDC hdc, int index);
734 extern HDC CreateCompatibleDC(HDC hdc);
735 extern int ReleaseDC(HWND hWnd, HDC hDC);
736 extern bool DeleteDC(HDC hdc);
737 extern bool DeleteObject(HGDIOBJ ho);
738 extern HDC GetDC(HWND hWnd);
739 extern int GetObject(HANDLE h, int c, void *pv);
740 extern HDC BeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
741 extern bool EndPaint(HWND hWnd, const PAINTSTRUCT *lpPaint);
742 
743 extern intptr DialogBoxParam(HINSTANCE hInstance,
744  const char *lpTemplateName, HWND hWndParent,
745  DLGPROC lpDialogFunc, LPARAM dwInitParam);
746 extern bool IsWindow(HWND hWnd);
747 extern bool SetWindowText(HWND hWnd, const char *lpszString);
748 extern int GetWindowText(HWND hWnd, char *lpszStringBuf, int nMaxCount);
749 extern bool ScreenToClient(HWND hWnd, LPPOINT lpPoint);
750 
751 HBITMAP CreateDIBitmap(HDC hdc, CONST BITMAPINFOHEADER *pbmih,
752  uint32 flInit, CONST void *pjBits, CONST BITMAPINFO *pbmi, unsigned int iUsage);
753 extern int GetDIBits(HDC hdc, HBITMAP hbm, unsigned int start, unsigned int cLines,
754  void *lpvBits, LPBITMAPINFO lpbmi, unsigned int usage);
755 
756 extern HGDIOBJ SelectObject(HDC hdc, HGDIOBJ h);
757 extern HGDIOBJ GetStockObject(int i);
758 extern HPALETTE SelectPalette(HDC hdc, HPALETTE hPal, bool bForceBkgd);
759 extern unsigned int RealizePalette(HDC hdc);
760 extern bool BitBlt(HDC hdc, int xDest, int yDest, int width, int height,
761  HDC hdcSrc, int xSrc, int ySrc, uint32 rop);
762 extern bool StretchBlt(HDC hdcDest, int xDest, int yDest,
763  int wDest, int hDest, HDC hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, uint32 rop);
764 extern int SetStretchBltMode(HDC hdc, int mode);
765 extern int StretchDIBits(HDC hdc, int xDest, int yDest, int DestWidth, int DestHeight,
766  int xSrc, int ySrc, int SrcWidth, int SrcHeight,
767  CONST void *lpBits, CONST BITMAPINFO *lpbmi, unsigned int iUsage, uint32 rop);
768 extern int GetTextExtent(HDC hdc, const char *text, size_t len);
769 extern bool GetTextMetrics(HDC hdc, LPTEXTMETRIC lptm);
770 extern intptr GetWindowWord(HWND hWnd, int nIndex);
771 extern int AddFontResource(const char *fontName);
772 extern bool RemoveFontResource(const char *fontName);
773 extern int SetScrollPos(HWND hWnd, int nBar,
774  int nPos, bool bRedraw);
775 extern void SetScrollRange(HWND hWnd, int nBar,
776  int nMinPos, int nMaxPos, bool bRedraw);
777 
778 extern bool ClipCursor(const RECT *lpRect);
779 extern bool GetCursorPos(LPPOINT lpPoint);
780 extern bool SetCursorPos(int x, int y);
781 extern bool SetCapture(HWND hWnd);
782 extern bool ReleaseCapture();
783 extern HWND GetCapture();
784 extern HCURSOR LoadCursor(HINSTANCE hInstance,
785  const char *lpCursorName);
786 extern HCURSOR SetCursor(HCURSOR hCursor);
787 extern int ShowCursor(bool bShow);
788 
789 typedef void (CALLBACK *LINEDDAPROC)(int x, int y, CDC *cdc);
790 extern bool LineDDA(int x0, int y0, int x1, int y1,
791  LINEDDAPROC lpProc, CDC *cdc);
792 
793 extern byte GetRValue(COLORREF color);
794 extern byte GetGValue(COLORREF color);
795 extern byte GetBValue(COLORREF color);
796 
797 extern HWND GetDlgItem(HWND hDlg, int nIDDlgItem);
798 extern bool EndDialog(HWND hDlg, intptr nResult);
799 extern bool SetDlgItemInt(HWND hDlg, int nIDDlgItem,
800  unsigned int uValue, bool bSigned);
801 extern bool CheckRadioButton(HWND hDlg, int nIDFirstButton,
802  int nIDLastButton, int nIDCheckButton);
803 
804 extern uint32 GetSysColor(int nIndex);
805 extern HBRUSH GetSysColorBrush(int nIndex);
806 extern bool DestroyMenu(HMENU hMenu);
807 extern void SetActiveWindow(HWND hWnd);
808 
809 } // namespace MFC
810 } // namespace Bagel
811 
812 #endif
Definition: wingdi.h:643
Definition: wingdi.h:650
Definition: wingdi.h:680
Definition: wingdi.h:702
Definition: wingdi.h:714
Definition: wingdi.h:656
Definition: afxwin.h:1125
Definition: minwindef.h:86
Definition: wingdi.h:666
Definition: minwindef.h:160
Definition: minwindef.h:238
Definition: minwindef.h:150
Definition: wingdi.h:628
Definition: winnt.h:655
Definition: wingdi.h:674
Definition: minwindef.h:178
Definition: afxwin.h:27
Definition: wingdi.h:727
Definition: wingdi.h:692
Definition: wingdi.h:685
Definition: afxwin.h:708