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

Last change on this file since 22012 was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

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