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

Last change on this file since 10367 was 10316, checked in by sandervl, 22 years ago

Visible & Clip region changes

File size: 9.5 KB
Line 
1/* $Id: dc.h,v 1.18 2003-11-12 14:10:19 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);
18BOOL setPageXForm(Win32BaseWindow *wnd, struct _DCData * pHps);
19
20void selectClientArea(Win32BaseWindow *wnd, HDC hdc);
21
22BOOL GetOS2UpdateRect(Win32BaseWindow *window,LPRECT pRect);
23
24int WIN32API GetUpdateRgnFrame(HWND hwnd, HRGN hrgn);
25
26#ifdef DEBUG
27void dprintfOrigin(HDC hdc);
28#else
29#define dprintfOrigin(a)
30#endif
31
32#ifdef INCLUDED_BY_DC
33/*********************/
34
35typedef struct _penobject
36{
37 ULONG filler[9];
38 union {
39 struct {
40 PEXTLOGPEN_W pExtLogPen;
41 LOGBRUSH_W logbrush;
42 LOGPEN_W logpen;
43 } ExtPen;
44 struct {
45 LOGPEN_W logpen;
46 } Pen;
47 };
48} tPenObject, *pPenObject;
49
50
51/*********************/
52
53#ifndef OPEN32API
54#define OPEN32API _System
55#endif
56
57
58BOOL APIENTRY _GpiEnableYInversion (HPS hps, LONG lHeight);
59
60inline BOOL APIENTRY GpiEnableYInversion (HPS hps, LONG lHeight)
61{
62 BOOL yyrc;
63 USHORT sel = RestoreOS2FS();
64
65 yyrc = _GpiEnableYInversion(hps, lHeight);
66 SetFS(sel);
67
68 return yyrc;
69}
70
71LONG APIENTRY _GpiQueryYInversion(ULONG hps);
72
73inline LONG GpiQueryYInversion(ULONG hps)
74{
75 LONG yyrc;
76 USHORT sel = RestoreOS2FS();
77
78 yyrc = _GpiQueryYInversion(hps);
79 SetFS(sel);
80
81 return yyrc;
82}
83
84PVOID APIENTRY _GpiAllocateDCData (HPS GpiH, ULONG size);
85
86inline PVOID APIENTRY GpiAllocateDCData (HPS GpiH, ULONG size)
87{
88 PVOID yyrc;
89 USHORT sel = RestoreOS2FS();
90
91 yyrc = _GpiAllocateDCData(GpiH, size);
92 SetFS(sel);
93
94 return yyrc;
95}
96
97PVOID APIENTRY _GpiQueryDCData (HPS hps);
98
99inline PVOID APIENTRY GpiQueryDCData (HPS hps)
100{
101 PVOID yyrc;
102 USHORT sel = RestoreOS2FS();
103
104 yyrc = _GpiQueryDCData(hps);
105 SetFS(sel);
106
107 return yyrc;
108}
109
110HDC OPEN32API _HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a);
111
112inline HDC OPEN32API HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a)
113{
114 HDC yyrc;
115 USHORT sel = RestoreOS2FS();
116
117 yyrc = _HPSToHDC(hwnd, hps, hdc, a);
118 SetFS(sel);
119
120 return yyrc;
121}
122
123void OPEN32API _DeleteHDC (HDC hdc);
124
125inline void OPEN32API DeleteHDC (HDC hdc)
126{
127 USHORT sel = RestoreOS2FS();
128
129 _DeleteHDC(hdc);
130 SetFS(sel);
131}
132
133BOOL OPEN32API _O32_EndPaint (HWND hwnd, const PAINTSTRUCT_W *lpps);
134
135inline BOOL O32_EndPaint(HWND a, CONST PAINTSTRUCT_W *b)
136{
137 BOOL yyrc;
138 USHORT sel = RestoreOS2FS();
139
140 yyrc = _O32_EndPaint(a, b);
141 SetFS(sel);
142
143 return yyrc;
144}
145
146int OPEN32API _O32_GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase);
147
148inline int O32_GetUpdateRgn(HWND a, HRGN b, BOOL c)
149{
150 int yyrc;
151 USHORT sel = RestoreOS2FS();
152
153 yyrc = _O32_GetUpdateRgn(a, b, c);
154 SetFS(sel);
155
156 return yyrc;
157}
158
159
160BOOL OPEN32API _O32_DeleteObject (LHANDLE hgdiobj);
161
162inline BOOL O32_DeleteObject(HANDLE a)
163{
164 BOOL yyrc;
165 USHORT sel = RestoreOS2FS();
166
167 yyrc = _O32_DeleteObject(a);
168 SetFS(sel);
169
170 return yyrc;
171}
172
173int OPEN32API _O32_ReleaseDC (HWND hwnd, HDC hdc);
174
175inline int O32_ReleaseDC(HWND a, HDC b)
176{
177 int yyrc;
178 USHORT sel = RestoreOS2FS();
179
180 yyrc = _O32_ReleaseDC(a, b);
181 SetFS(sel);
182
183 return yyrc;
184}
185
186VOID OPEN32API _O32_SetLastError( DWORD );
187
188inline VOID O32_SetLastError(DWORD a)
189{
190 USHORT sel = RestoreOS2FS();
191
192 _O32_SetLastError(a);
193 SetFS(sel);
194}
195
196BOOL OPEN32API _O32_ExcludeUpdateRgn( HDC, HWND );
197
198inline BOOL O32_ExcludeUpdateRgn(HDC a, HWND b)
199{
200 BOOL yyrc;
201 USHORT sel = RestoreOS2FS();
202
203 yyrc = _O32_ExcludeUpdateRgn(a, b);
204 SetFS(sel);
205
206 return yyrc;
207}
208
209BOOL OPEN32API _O32_CreateCaret (HWND hwnd, HBITMAP hbm, int width, int height);
210
211inline BOOL O32_CreateCaret(HWND a, HBITMAP b, int c, int d)
212{
213 BOOL yyrc;
214 USHORT sel = RestoreOS2FS();
215
216 yyrc = _O32_CreateCaret(a, b, c, d);
217 SetFS(sel);
218
219 return yyrc;
220}
221
222BOOL OPEN32API _O32_SelectClipRgn(HDC hdc,HRGN hrgn);
223
224inline BOOL O32_SelectClipRgn(HDC hdc,HRGN hrgn)
225{
226 BOOL yyrc;
227 USHORT sel = RestoreOS2FS();
228
229 yyrc = _O32_SelectClipRgn(hdc,hrgn);
230 SetFS(sel);
231
232 return yyrc;
233}
234
235BOOL APIENTRY __DestroyCaret (void);
236
237inline BOOL APIENTRY _DestroyCaret (void)
238{
239 BOOL yyrc;
240 USHORT sel = RestoreOS2FS();
241
242 yyrc = __DestroyCaret();
243 SetFS(sel);
244
245 return yyrc;
246}
247
248UINT APIENTRY __GetCaretBlinkTime (void);
249
250inline UINT APIENTRY _GetCaretBlinkTime (void)
251{
252 UINT yyrc;
253 USHORT sel = RestoreOS2FS();
254
255 yyrc = __GetCaretBlinkTime();
256 SetFS(sel);
257
258 return yyrc;
259}
260
261BOOL APIENTRY __HideCaret (HWND hwnd);
262
263inline BOOL APIENTRY _HideCaret (HWND hwnd)
264{
265 BOOL yyrc;
266 USHORT sel = RestoreOS2FS();
267
268 yyrc = __HideCaret(hwnd);
269 SetFS(sel);
270
271 return yyrc;
272}
273
274BOOL APIENTRY __SetCaretBlinkTime (UINT mSecs);
275
276inline BOOL APIENTRY _SetCaretBlinkTime (UINT mSecs)
277{
278 BOOL yyrc;
279 USHORT sel = RestoreOS2FS();
280
281 yyrc = __SetCaretBlinkTime(mSecs);
282 SetFS(sel);
283
284 return yyrc;
285}
286
287BOOL APIENTRY __ShowCaret (HWND hwnd);
288
289inline BOOL APIENTRY _ShowCaret (HWND hwnd)
290{
291 BOOL yyrc;
292 USHORT sel = RestoreOS2FS();
293
294 yyrc = __ShowCaret(hwnd);
295 SetFS(sel);
296
297 return yyrc;
298}
299
300
301int APIENTRY _O32_GetClipRgn( HDC, HRGN );
302
303inline int O32_GetClipRgn(HDC a, HRGN b)
304{
305 int yyrc;
306 USHORT sel = RestoreOS2FS();
307
308 yyrc = _O32_GetClipRgn(a, b);
309 SetFS(sel);
310
311 return yyrc;
312}
313
314int APIENTRY _O32_ExcludeClipRect(HDC a, int b, int c, int d, int e);
315
316inline int O32_ExcludeClipRect(HDC a, int b, int c, int d, int e)
317{
318 int yyrc;
319 USHORT sel = RestoreOS2FS();
320
321 yyrc = _O32_ExcludeClipRect(a, b, c, d, e);
322 SetFS(sel);
323
324 return yyrc;
325}
326
327int APIENTRY _O32_IntersectClipRect(HDC a, int b, int c, int d, int e);
328
329inline int O32_IntersectClipRect(HDC a, int b, int c, int d, int e)
330{
331 int yyrc;
332 USHORT sel = RestoreOS2FS();
333
334 yyrc = _O32_IntersectClipRect(a, b, c, d, e);
335 SetFS(sel);
336
337 return yyrc;
338}
339
340int APIENTRY _O32_ExtSelectClipRgn(HDC a, HRGN b, int c);
341
342inline int O32_ExtSelectClipRgn(HDC a, HRGN b, int c)
343{
344 int yyrc;
345 USHORT sel = RestoreOS2FS();
346
347 yyrc = _O32_ExtSelectClipRgn(a, b, c);
348 SetFS(sel);
349
350 return yyrc;
351}
352
353int APIENTRY _O32_OffsetClipRgn(HDC a, int b, int c);
354
355inline int O32_OffsetClipRgn(HDC a, int b, int c)
356{
357 int yyrc;
358 USHORT sel = RestoreOS2FS();
359
360 yyrc = _O32_OffsetClipRgn(a, b, c);
361 SetFS(sel);
362
363 return yyrc;
364}
365
366 // from pmddi.h:
367 /* CopyClipRegion */
368
369 #define COPYCRGN_ALLINTERSECT 0L
370 #define COPYCRGN_VISRGN 1L
371 #define COPYCRGN_CLIPRGN 2L
372
373 /* SetupDC */
374
375 #define SETUPDC_VISRGN 0x00000001L
376 #define SETUPDC_ORIGIN 0x00000002L
377 #define SETUPDC_ACCUMBOUNDSON 0x00000004L
378 #define SETUPDC_ACCUMBOUNDSOFF 0x00000008L
379 #define SETUPDC_RECALCCLIP 0x00000010L
380 #define SETUPDC_SETOWNER 0x00000020L
381 #define SETUPDC_CLEANDC 0x00000040L
382
383ULONG APIENTRY Gre32Entry4(ULONG,ULONG,ULONG,ULONG);
384
385inline ULONG APIENTRY _Gre32Entry4 (ULONG a, ULONG b, ULONG c, ULONG d)
386{
387 ULONG yyrc;
388 USHORT sel = RestoreOS2FS();
389
390 yyrc = Gre32Entry4(a,b,c,d);
391 SetFS(sel);
392
393 return yyrc;
394}
395
396ULONG APIENTRY Gre32Entry5(ULONG,ULONG,ULONG,ULONG,ULONG);
397
398inline ULONG APIENTRY _Gre32Entry5 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e)
399{
400 ULONG yyrc;
401 USHORT sel = RestoreOS2FS();
402
403 yyrc = Gre32Entry5(a,b,c,d,e);
404 SetFS(sel);
405
406 return yyrc;
407}
408
409
410ULONG APIENTRY Gre32Entry6(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
411
412inline ULONG APIENTRY _Gre32Entry6 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f)
413{
414 ULONG yyrc;
415 USHORT sel = RestoreOS2FS();
416
417 yyrc = Gre32Entry6(a,b,c,d,e,f);
418 SetFS(sel);
419
420 return yyrc;
421}
422
423ULONG APIENTRY Gre32Entry7(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
424
425inline ULONG APIENTRY _Gre32Entry7 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f, ULONG g)
426{
427 ULONG yyrc;
428 USHORT sel = RestoreOS2FS();
429
430 yyrc = Gre32Entry7(a,b,c,d,e,f,g);
431 SetFS(sel);
432
433 return yyrc;
434}
435
436ULONG APIENTRY Gre32Entry8(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
437
438inline ULONG APIENTRY _Gre32Entry8 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f, ULONG g, ULONG h)
439{
440 ULONG yyrc;
441 USHORT sel = RestoreOS2FS();
442
443 yyrc = Gre32Entry8(a,b,c,d,e,f,g,h);
444 SetFS(sel);
445
446 return yyrc;
447}
448
449
450 #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)
451 #define GreCreateRectRegion(a,b,c) (HRGN) _Gre32Entry5((ULONG)(HDC)(a),(ULONG)(PRECTL)(b),(ULONG)(LONG)(c),0L,0x00004062L)
452 #define GreGetPageUnits(a,b) (LONG) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PULONG)(b),0L,0x00004083L)
453 #define GreCopyClipRegion(a,b,c,d) (INT) _Gre32Entry6((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(PRECTL)(c),(ULONG)(ULONG)(d),0L,0x00004080L)
454 #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)
455 #define GreDestroyRegion(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(HRGN)(b),0L,0x00004063L)
456 #define GreGetDCOrigin(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PPOINTL)(b),0L,0x000040BAL)
457 #define GreDeviceSetDCOrigin(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PPOINTL)(b),0L,0x000040BBL)
458 #define GreSelectClipRegion(a,b,c) (INT) _Gre32Entry5((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(PHRGN)(c),0L,0x00004074L)
459 #define GreIntersectClipRectangle(a,b) (INT) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PRECTL)(b),0L,0x00004075L)
460
461#endif //INCLUDED_BY_DC
462
463#endif //__DC_H__
464
Note: See TracBrowser for help on using the repository browser.