source: trunk/src/user32/dc.h@ 3721

Last change on this file since 3721 was 3679, checked in by sandervl, 25 years ago

lots of fixes + changes (see ChangeLog)

File size: 13.4 KB
Line 
1/* $Id: dc.h,v 1.14 2000-06-08 18:10:09 sandervl Exp $ */
2/*
3 * public dc functions
4 *
5 *
6 * Copyright 1999 Daniela Engert (dani@ngrt.de)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#ifndef __DC_H__
13#define __DC_H__
14
15extern BOOL isYup (struct _DCData *pHps);
16extern HDC sendEraseBkgnd (Win32BaseWindow *wnd);
17extern void releaseOwnDC (HDC hps);
18
19BOOL GetOS2UpdateRect(Win32BaseWindow *window,LPRECT pRect);
20
21#ifdef INCLUDED_BY_DC
22/*********************/
23typedef struct
24{
25 HDC hdc;
26 BOOL fErase;
27 RECT rcPaint;
28 BOOL fRestore;
29 BOOL IncUpdate;
30 BYTE rgbReserved[32];
31} PAINTSTRUCT_W, *PPAINTSTRUCT_W, *LPPAINTSTRUCT_W;
32
33#define PS_SOLID_W 0x00000000
34#define PS_DASH_W 0x00000001
35#define PS_DOT_W 0x00000002
36#define PS_DASHDOT_W 0x00000003
37#define PS_DASHDOTDOT_W 0x00000004
38#define PS_NULL_W 0x00000005
39#define PS_INSIDEFRAME_W 0x00000006
40#define PS_USERSTYLE_W 0x00000007
41#define PS_ALTERNATE_W 0x00000008
42#define PS_STYLE_MASK_W 0x0000000f
43
44typedef struct
45{
46 UINT lopnStyle;
47 POINT lopnWidth;
48 ULONG lopnColor;
49} LOGPEN_W, *LPLOGPEN_W;
50
51typedef struct tagEXTLOGPEN
52{
53 DWORD elpPenStyle;
54 DWORD elpWidth;
55 DWORD elpBrushStyle;
56 DWORD elpColor;
57 DWORD elpNumEntries;
58 DWORD elpStyleEntry[1];
59} EXTLOGPEN_W, *PEXTLOGPEN_W, *NPEXTLOGPEN_W, *LPEXTLOGPEN_W;
60
61typedef struct
62{
63 UINT lbStyle;
64 ULONG lbColor;
65 INT lbHatch;
66} LOGBRUSH_W, *LPLOGBRUSH_W;
67
68typedef struct _penobject
69{
70 ULONG filler[9];
71 union {
72 struct {
73 PEXTLOGPEN_W pExtLogPen;
74 LOGBRUSH_W logbrush;
75 LOGPEN_W logpen;
76 } ExtPen;
77 struct {
78 LOGPEN_W logpen;
79 } Pen;
80 };
81} tPenObject, *pPenObject;
82
83/* DC Graphics Mode */
84#define GM_COMPATIBLE_W 1
85#define GM_ADVANCED_W 2
86
87#define DCX_WINDOW_W 0x00000001L
88#define DCX_CACHE_W 0x00000002L
89#define DCX_NORESETATTRS_W 0x00000004L
90#define DCX_CLIPCHILDREN_W 0x00000008L
91#define DCX_CLIPSIBLINGS_W 0x00000010L
92#define DCX_PARENTCLIP_W 0x00000020L
93#define DCX_EXCLUDERGN_W 0x00000040L
94#define DCX_INTERSECTRGN_W 0x00000080L
95#define DCX_EXCLUDEUPDATE_W 0x00000100L
96#define DCX_INTERSECTUPDATE_W 0x00000200L
97#define DCX_LOCKWINDOWUPDATE_W 0x00000400L
98#define DCX_USESTYLE_W 0x00010000L
99#define DCX_VALIDATE_W 0x00200000L
100
101#define RDW_INVALIDATE_W 0x0001
102#define RDW_INTERNALPAINT_W 0x0002
103#define RDW_ERASE_W 0x0004
104#define RDW_VALIDATE_W 0x0008
105#define RDW_NOINTERNALPAINT_W 0x0010
106#define RDW_NOERASE_W 0x0020
107#define RDW_NOCHILDREN_W 0x0040
108#define RDW_ALLCHILDREN_W 0x0080
109#define RDW_UPDATENOW_W 0x0100
110#define RDW_ERASENOW_W 0x0200
111#define RDW_FRAME_W 0x0400
112#define RDW_NOFRAME_W 0x0800
113
114typedef struct _RGNDATAHEADER_W {
115 DWORD dwSize;
116 DWORD iType;
117 DWORD nCount;
118 DWORD nRgnSize;
119 RECT rcBound;
120} RGNDATAHEADER_W, *LPRGNDATAHEADER_W;
121
122typedef struct _RGNDATA_W {
123 RGNDATAHEADER_W rdh;
124 char Buffer[1];
125} RGNDATA_W , *PRGNDATA_W , *LPRGNDATA_W ;
126
127
128/* Xform FLAGS */
129#define MWT_IDENTITY_W 1
130#define MWT_LEFTMULTIPLY_W 2
131#define MWT_RIGHTMULTIPLY_W 3
132
133/* Mapping Modes */
134#define MM_TEXT_W 1
135#define MM_LOMETRIC_W 2
136#define MM_HIMETRIC_W 3
137#define MM_LOENGLISH_W 4
138#define MM_HIENGLISH_W 5
139#define MM_TWIPS_W 6
140#define MM_ISOTROPIC_W 7
141#define MM_ANISOTROPIC_W 8
142
143#define RGN_OR_W 2
144
145/* Window scrolling */
146#define SW_SCROLLCHILDREN_W 0x0001
147#define SW_INVALIDATE_W 0x0002
148#define SW_ERASE_W 0x0004
149#define SW_SMOOTHSCROLL_W 0x0010
150
151/*********************/
152
153#ifndef OPEN32API
154#define OPEN32API _System
155#endif
156
157
158BOOL APIENTRY _GpiEnableYInversion (HPS hps, LONG lHeight);
159
160inline BOOL APIENTRY GpiEnableYInversion (HPS hps, LONG lHeight)
161{
162 BOOL yyrc;
163 USHORT sel = RestoreOS2FS();
164
165 yyrc = _GpiEnableYInversion(hps, lHeight);
166 SetFS(sel);
167
168 return yyrc;
169}
170
171LONG APIENTRY _GpiQueryYInversion(ULONG hps);
172
173inline LONG GpiQueryYInversion(ULONG hps)
174{
175 LONG yyrc;
176 USHORT sel = RestoreOS2FS();
177
178 yyrc = _GpiQueryYInversion(hps);
179 SetFS(sel);
180
181 return yyrc;
182}
183
184PVOID APIENTRY _GpiAllocateDCData (HPS GpiH, ULONG size);
185
186inline PVOID APIENTRY GpiAllocateDCData (HPS GpiH, ULONG size)
187{
188 PVOID yyrc;
189 USHORT sel = RestoreOS2FS();
190
191 yyrc = _GpiAllocateDCData(GpiH, size);
192 SetFS(sel);
193
194 return yyrc;
195}
196
197PVOID APIENTRY _GpiQueryDCData (HPS hps);
198
199inline PVOID APIENTRY GpiQueryDCData (HPS hps)
200{
201 PVOID yyrc;
202 USHORT sel = RestoreOS2FS();
203
204 yyrc = _GpiQueryDCData(hps);
205 SetFS(sel);
206
207 return yyrc;
208}
209
210HDC OPEN32API _HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a);
211
212inline HDC OPEN32API HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a)
213{
214 HDC yyrc;
215 USHORT sel = RestoreOS2FS();
216
217 yyrc = _HPSToHDC(hwnd, hps, hdc, a);
218 SetFS(sel);
219
220 return yyrc;
221}
222
223void OPEN32API _DeleteHDC (HDC hdc);
224
225inline void OPEN32API DeleteHDC (HDC hdc)
226{
227 USHORT sel = RestoreOS2FS();
228
229 _DeleteHDC(hdc);
230 SetFS(sel);
231}
232
233BOOL OPEN32API _O32_EndPaint (HWND hwnd, const PAINTSTRUCT_W *lpps);
234
235inline BOOL O32_EndPaint(HWND a, CONST PAINTSTRUCT_W *b)
236{
237 BOOL yyrc;
238 USHORT sel = RestoreOS2FS();
239
240 yyrc = _O32_EndPaint(a, b);
241 SetFS(sel);
242
243 return yyrc;
244}
245
246int OPEN32API _O32_GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase);
247
248inline int O32_GetUpdateRgn(HWND a, HRGN b, BOOL c)
249{
250 int yyrc;
251 USHORT sel = RestoreOS2FS();
252
253 yyrc = _O32_GetUpdateRgn(a, b, c);
254 SetFS(sel);
255
256 return yyrc;
257}
258
259ULONG OPEN32API _O32_GetRegionData (HRGN hrgn, ULONG count, PRGNDATA_W pData);
260
261inline DWORD O32_GetRegionData(HRGN a, DWORD b, PRGNDATA_W c)
262{
263 DWORD yyrc;
264 USHORT sel = RestoreOS2FS();
265
266 yyrc = _O32_GetRegionData(a, b, c);
267 SetFS(sel);
268
269 return yyrc;
270}
271
272BOOL OPEN32API _O32_DeleteObject (LHANDLE hgdiobj);
273
274inline BOOL O32_DeleteObject(HANDLE a)
275{
276 BOOL yyrc;
277 USHORT sel = RestoreOS2FS();
278
279 yyrc = _O32_DeleteObject(a);
280 SetFS(sel);
281
282 return yyrc;
283}
284
285int OPEN32API _O32_ReleaseDC (HWND hwnd, HDC hdc);
286
287inline int O32_ReleaseDC(HWND a, HDC b)
288{
289 int yyrc;
290 USHORT sel = RestoreOS2FS();
291
292 yyrc = _O32_ReleaseDC(a, b);
293 SetFS(sel);
294
295 return yyrc;
296}
297
298VOID OPEN32API _O32_SetLastError( DWORD );
299
300inline VOID O32_SetLastError(DWORD a)
301{
302 USHORT sel = RestoreOS2FS();
303
304 _O32_SetLastError(a);
305 SetFS(sel);
306}
307
308BOOL OPEN32API _O32_SetRectRgn (HRGN dest, int left, int top, int right, int bottom);
309
310inline BOOL O32_SetRectRgn(HRGN a, int b, int c, int d, int e)
311{
312 BOOL yyrc;
313 USHORT sel = RestoreOS2FS();
314
315 yyrc = _O32_SetRectRgn(a, b, c, d, e);
316 SetFS(sel);
317
318 return yyrc;
319}
320
321int OPEN32API _O32_CombineRgn (HRGN dest, HRGN src1, HRGN src2, int mode);
322
323inline int O32_CombineRgn(HRGN a, HRGN b, HRGN c, int d)
324{
325 int yyrc;
326 USHORT sel = RestoreOS2FS();
327
328 yyrc = _O32_CombineRgn(a, b, c, d);
329 SetFS(sel);
330
331 return yyrc;
332}
333
334HRGN OPEN32API _O32_CreateRectRgn (int left, int top, int right, int bottom);
335
336inline HRGN O32_CreateRectRgn(int a, int b, int c, int d)
337{
338 HRGN yyrc;
339 USHORT sel = RestoreOS2FS();
340
341 yyrc = _O32_CreateRectRgn(a, b, c, d);
342 SetFS(sel);
343
344 return yyrc;
345}
346
347BOOL OPEN32API _O32_ExcludeUpdateRgn( HDC, HWND );
348
349inline BOOL O32_ExcludeUpdateRgn(HDC a, HWND b)
350{
351 BOOL yyrc;
352 USHORT sel = RestoreOS2FS();
353
354 yyrc = _O32_ExcludeUpdateRgn(a, b);
355 SetFS(sel);
356
357 return yyrc;
358}
359
360BOOL OPEN32API _O32_CreateCaret (HWND hwnd, HBITMAP hbm, int width, int height);
361
362inline BOOL O32_CreateCaret(HWND a, HBITMAP b, int c, int d)
363{
364 BOOL yyrc;
365 USHORT sel = RestoreOS2FS();
366
367 yyrc = _O32_CreateCaret(a, b, c, d);
368 SetFS(sel);
369
370 return yyrc;
371}
372
373BOOL OPEN32API _O32_SelectClipRgn(HDC hdc,HRGN hrgn);
374
375inline BOOL O32_SelectClipRgn(HDC hdc,HRGN hrgn)
376{
377 BOOL yyrc;
378 USHORT sel = RestoreOS2FS();
379
380 yyrc = _O32_SelectClipRgn(hdc,hrgn);
381 SetFS(sel);
382
383 return yyrc;
384}
385
386BOOL APIENTRY __DestroyCaret (void);
387
388inline BOOL APIENTRY _DestroyCaret (void)
389{
390 BOOL yyrc;
391 USHORT sel = RestoreOS2FS();
392
393 yyrc = __DestroyCaret();
394 SetFS(sel);
395
396 return yyrc;
397}
398
399UINT APIENTRY __GetCaretBlinkTime (void);
400
401inline UINT APIENTRY _GetCaretBlinkTime (void)
402{
403 UINT yyrc;
404 USHORT sel = RestoreOS2FS();
405
406 yyrc = __GetCaretBlinkTime();
407 SetFS(sel);
408
409 return yyrc;
410}
411
412BOOL APIENTRY __HideCaret (HWND hwnd);
413
414inline BOOL APIENTRY _HideCaret (HWND hwnd)
415{
416 BOOL yyrc;
417 USHORT sel = RestoreOS2FS();
418
419 yyrc = __HideCaret(hwnd);
420 SetFS(sel);
421
422 return yyrc;
423}
424
425BOOL APIENTRY __SetCaretBlinkTime (UINT mSecs);
426
427inline BOOL APIENTRY _SetCaretBlinkTime (UINT mSecs)
428{
429 BOOL yyrc;
430 USHORT sel = RestoreOS2FS();
431
432 yyrc = __SetCaretBlinkTime(mSecs);
433 SetFS(sel);
434
435 return yyrc;
436}
437
438BOOL APIENTRY __ShowCaret (HWND hwnd);
439
440inline BOOL APIENTRY _ShowCaret (HWND hwnd)
441{
442 BOOL yyrc;
443 USHORT sel = RestoreOS2FS();
444
445 yyrc = __ShowCaret(hwnd);
446 SetFS(sel);
447
448 return yyrc;
449}
450
451
452int APIENTRY _O32_GetClipRgn( HDC, HRGN );
453
454inline int O32_GetClipRgn(HDC a, HRGN b)
455{
456 int yyrc;
457 USHORT sel = RestoreOS2FS();
458
459 yyrc = _O32_GetClipRgn(a, b);
460 SetFS(sel);
461
462 return yyrc;
463}
464
465int APIENTRY _O32_ExcludeClipRect(HDC a, int b, int c, int d, int e);
466
467inline int O32_ExcludeClipRect(HDC a, int b, int c, int d, int e)
468{
469 int yyrc;
470 USHORT sel = RestoreOS2FS();
471
472 yyrc = _O32_ExcludeClipRect(a, b, c, d, e);
473 SetFS(sel);
474
475 return yyrc;
476}
477
478int APIENTRY _O32_IntersectClipRect(HDC a, int b, int c, int d, int e);
479
480inline int O32_IntersectClipRect(HDC a, int b, int c, int d, int e)
481{
482 int yyrc;
483 USHORT sel = RestoreOS2FS();
484
485 yyrc = _O32_IntersectClipRect(a, b, c, d, e);
486 SetFS(sel);
487
488 return yyrc;
489}
490
491int APIENTRY _O32_ExtSelectClipRgn(HDC a, HRGN b, int c);
492
493inline int O32_ExtSelectClipRgn(HDC a, HRGN b, int c)
494{
495 int yyrc;
496 USHORT sel = RestoreOS2FS();
497
498 yyrc = _O32_ExtSelectClipRgn(a, b, c);
499 SetFS(sel);
500
501 return yyrc;
502}
503
504int APIENTRY _O32_OffsetClipRgn(HDC a, int b, int c);
505
506inline int O32_OffsetClipRgn(HDC a, int b, int c)
507{
508 int yyrc;
509 USHORT sel = RestoreOS2FS();
510
511 yyrc = _O32_OffsetClipRgn(a, b, c);
512 SetFS(sel);
513
514 return yyrc;
515}
516
517 // from pmddi.h:
518 /* CopyClipRegion */
519
520 #define COPYCRGN_ALLINTERSECT 0L
521 #define COPYCRGN_VISRGN 1L
522 #define COPYCRGN_CLIPRGN 2L
523
524 /* SetupDC */
525
526 #define SETUPDC_VISRGN 0x00000001L
527 #define SETUPDC_ORIGIN 0x00000002L
528 #define SETUPDC_ACCUMBOUNDSON 0x00000004L
529 #define SETUPDC_ACCUMBOUNDSOFF 0x00000008L
530 #define SETUPDC_RECALCCLIP 0x00000010L
531 #define SETUPDC_SETOWNER 0x00000020L
532 #define SETUPDC_CLEANDC 0x00000040L
533
534ULONG APIENTRY Gre32Entry4(ULONG,ULONG,ULONG,ULONG);
535
536inline ULONG APIENTRY _Gre32Entry4 (ULONG a, ULONG b, ULONG c, ULONG d)
537{
538 ULONG yyrc;
539 USHORT sel = RestoreOS2FS();
540
541 yyrc = Gre32Entry4(a,b,c,d);
542 SetFS(sel);
543
544 return yyrc;
545}
546
547ULONG APIENTRY Gre32Entry5(ULONG,ULONG,ULONG,ULONG,ULONG);
548
549inline ULONG APIENTRY _Gre32Entry5 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e)
550{
551 ULONG yyrc;
552 USHORT sel = RestoreOS2FS();
553
554 yyrc = Gre32Entry5(a,b,c,d,e);
555 SetFS(sel);
556
557 return yyrc;
558}
559
560
561ULONG APIENTRY Gre32Entry6(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
562
563inline ULONG APIENTRY _Gre32Entry6 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f)
564{
565 ULONG yyrc;
566 USHORT sel = RestoreOS2FS();
567
568 yyrc = Gre32Entry6(a,b,c,d,e,f);
569 SetFS(sel);
570
571 return yyrc;
572}
573
574ULONG APIENTRY Gre32Entry7(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
575
576inline ULONG APIENTRY _Gre32Entry7 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f, ULONG g)
577{
578 ULONG yyrc;
579 USHORT sel = RestoreOS2FS();
580
581 yyrc = Gre32Entry7(a,b,c,d,e,f,g);
582 SetFS(sel);
583
584 return yyrc;
585}
586
587ULONG APIENTRY Gre32Entry8(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
588
589inline ULONG APIENTRY _Gre32Entry8 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f, ULONG g, ULONG h)
590{
591 ULONG yyrc;
592 USHORT sel = RestoreOS2FS();
593
594 yyrc = Gre32Entry8(a,b,c,d,e,f,g,h);
595 SetFS(sel);
596
597 return yyrc;
598}
599
600
601 #define GreSetupDC(a,b,c,d,e,f) (BOOL) _Gre32Entry8((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(LONG)(c),(ULONG)(LONG)(d),(ULONG)(PRECTL)(e),(ULONG)(ULONG)(f),0L,0x00004081L)
602 #define GreCreateRectRegion(a,b,c) (HRGN) _Gre32Entry5((ULONG)(HDC)(a),(ULONG)(PRECTL)(b),(ULONG)(LONG)(c),0L,0x00004062L)
603 #define GreGetPageUnits(a,b) (LONG) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PULONG)(b),0L,0x00004083L)
604 #define GreCopyClipRegion(a,b,c,d) (INT) _Gre32Entry6((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(PRECTL)(c),(ULONG)(ULONG)(d),0L,0x00004080L)
605 #define GreCombineRegion(a,b,c,d,e) (INT) _Gre32Entry7((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(HRGN)(c),(ULONG)(HRGN)(d),(ULONG)(ULONG)(e),0L,0x00004065L)
606 #define GreDestroyRegion(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(HRGN)(b),0L,0x00004063L)
607 #define GreGetDCOrigin(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PPOINTL)(b),0L,0x000040BAL)
608 #define GreDeviceSetDCOrigin(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PPOINTL)(b),0L,0x000040BBL)
609 #define GreSelectClipRegion(a,b,c) (INT) _Gre32Entry5((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(PHRGN)(c),0L,0x00004074L)
610 #define GreIntersectClipRectangle(a,b) (INT) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PRECTL)(b),0L,0x00004075L)
611
612#endif //INCLUDED_BY_DC
613
614#endif //__DC_H__
615
Note: See TracBrowser for help on using the repository browser.