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

Last change on this file since 5655 was 5164, checked in by sandervl, 25 years ago

workaround for window origin changes

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