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

Last change on this file since 1525 was 1525, checked in by cbratschi, 26 years ago

button, static, scroll and dialog fixes

File size: 8.4 KB
Line 
1/* $Id: dc.h,v 1.6 1999-10-30 18:40:44 cbratschi 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
19
20#ifdef INCLUDED_BY_DC
21/*********************/
22typedef struct
23{
24 HDC hdc;
25 BOOL fErase;
26 RECT rcPaint;
27 BOOL fRestore;
28 BOOL IncUpdate;
29 BYTE rgbReserved[32];
30} PAINTSTRUCT_W, *PPAINTSTRUCT_W, *LPPAINTSTRUCT_W;
31
32#define PS_SOLID_W 0x00000000
33#define PS_DASH_W 0x00000001
34#define PS_DOT_W 0x00000002
35#define PS_DASHDOT_W 0x00000003
36#define PS_DASHDOTDOT_W 0x00000004
37#define PS_NULL_W 0x00000005
38#define PS_INSIDEFRAME_W 0x00000006
39#define PS_USERSTYLE_W 0x00000007
40#define PS_ALTERNATE_W 0x00000008
41#define PS_STYLE_MASK_W 0x0000000f
42
43typedef struct
44{
45 UINT lopnStyle;
46 POINT lopnWidth;
47 ULONG lopnColor;
48} LOGPEN_W, *LPLOGPEN_W;
49
50typedef struct tagEXTLOGPEN
51{
52 DWORD elpPenStyle;
53 DWORD elpWidth;
54 DWORD elpBrushStyle;
55 DWORD elpColor;
56 DWORD elpNumEntries;
57 DWORD elpStyleEntry[1];
58} EXTLOGPEN_W, *PEXTLOGPEN_W, *NPEXTLOGPEN_W, *LPEXTLOGPEN_W;
59
60typedef struct
61{
62 UINT lbStyle;
63 ULONG lbColor;
64 INT lbHatch;
65} LOGBRUSH_W, *LPLOGBRUSH_W;
66
67typedef struct _penobject
68{
69 ULONG filler[9];
70 union {
71 struct {
72 PEXTLOGPEN_W pExtLogPen;
73 LOGBRUSH_W logbrush;
74 LOGPEN_W logpen;
75 } ExtPen;
76 struct {
77 LOGPEN_W logpen;
78 } Pen;
79 };
80} tPenObject, *pPenObject;
81
82/* DC Graphics Mode */
83#define GM_COMPATIBLE_W 1
84#define GM_ADVANCED_W 2
85
86#define DCX_WINDOW_W 0x00000001L
87#define DCX_CACHE_W 0x00000002L
88#define DCX_NORESETATTRS_W 0x00000004L
89#define DCX_CLIPCHILDREN_W 0x00000008L
90#define DCX_CLIPSIBLINGS_W 0x00000010L
91#define DCX_PARENTCLIP_W 0x00000020L
92#define DCX_EXCLUDERGN_W 0x00000040L
93#define DCX_INTERSECTRGN_W 0x00000080L
94#define DCX_EXCLUDEUPDATE_W 0x00000100L
95#define DCX_INTERSECTUPDATE_W 0x00000200L
96#define DCX_LOCKWINDOWUPDATE_W 0x00000400L
97#define DCX_VALIDATE_W 0x00200000L
98
99#define RDW_INVALIDATE_W 0x0001
100#define RDW_INTERNALPAINT_W 0x0002
101#define RDW_ERASE_W 0x0004
102#define RDW_VALIDATE_W 0x0008
103#define RDW_NOINTERNALPAINT_W 0x0010
104#define RDW_NOERASE_W 0x0020
105#define RDW_NOCHILDREN_W 0x0040
106#define RDW_ALLCHILDREN_W 0x0080
107#define RDW_UPDATENOW_W 0x0100
108#define RDW_ERASENOW_W 0x0200
109#define RDW_FRAME_W 0x0400
110#define RDW_NOFRAME_W 0x0800
111
112typedef struct _RGNDATAHEADER_W {
113 DWORD dwSize;
114 DWORD iType;
115 DWORD nCount;
116 DWORD nRgnSize;
117 RECT rcBound;
118} RGNDATAHEADER_W, *LPRGNDATAHEADER_W;
119
120typedef struct _RGNDATA_W {
121 RGNDATAHEADER_W rdh;
122 char Buffer[1];
123} RGNDATA_W , *PRGNDATA_W , *LPRGNDATA_W ;
124
125
126/* Xform FLAGS */
127#define MWT_IDENTITY_W 1
128#define MWT_LEFTMULTIPLY_W 2
129#define MWT_RIGHTMULTIPLY_W 3
130
131/* Mapping Modes */
132#define MM_TEXT_W 1
133#define MM_LOMETRIC_W 2
134#define MM_HIMETRIC_W 3
135#define MM_LOENGLISH_W 4
136#define MM_HIENGLISH_W 5
137#define MM_TWIPS_W 6
138#define MM_ISOTROPIC_W 7
139#define MM_ANISOTROPIC_W 8
140
141#define RGN_OR_W 2
142
143/* Window scrolling */
144#define SW_SCROLLCHILDREN_W 0x0001
145#define SW_INVALIDATE_W 0x0002
146#define SW_ERASE_W 0x0004
147#define SW_SMOOTHSCROLL_W 0x0010
148
149/*********************/
150
151#ifndef OPEN32API
152#define OPEN32API _System
153#endif
154
155
156BOOL APIENTRY _GpiEnableYInversion (HPS hps, LONG lHeight);
157
158inline BOOL APIENTRY GpiEnableYInversion (HPS hps, LONG lHeight)
159{
160 BOOL yyrc;
161 USHORT sel = RestoreOS2FS();
162
163 yyrc = _GpiEnableYInversion(hps, lHeight);
164 SetFS(sel);
165
166 return yyrc;
167}
168
169//LONG APIENTRY GpiQueryYInversion (HPS hps);
170
171PVOID APIENTRY _GpiAllocateDCData (HPS GpiH, ULONG size);
172
173inline PVOID APIENTRY GpiAllocateDCData (HPS GpiH, ULONG size)
174{
175 PVOID yyrc;
176 USHORT sel = RestoreOS2FS();
177
178 yyrc = _GpiAllocateDCData(GpiH, size);
179 SetFS(sel);
180
181 return yyrc;
182}
183
184PVOID APIENTRY _GpiQueryDCData (HPS hps);
185
186inline PVOID APIENTRY GpiQueryDCData (HPS hps)
187{
188 PVOID yyrc;
189 USHORT sel = RestoreOS2FS();
190
191 yyrc = _GpiQueryDCData(hps);
192 SetFS(sel);
193
194 return yyrc;
195}
196
197HDC OPEN32API _HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a);
198
199inline HDC OPEN32API HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a)
200{
201 HDC yyrc;
202 USHORT sel = RestoreOS2FS();
203
204 yyrc = _HPSToHDC(hwnd, hps, hdc, a);
205 SetFS(sel);
206
207 return yyrc;
208}
209
210void OPEN32API _DeleteHDC (HDC hdc);
211
212inline void OPEN32API DeleteHDC (HDC hdc)
213{
214 USHORT sel = RestoreOS2FS();
215
216 _DeleteHDC(hdc);
217 SetFS(sel);
218}
219
220BOOL OPEN32API _O32_EndPaint (HWND hwnd, const PAINTSTRUCT_W *lpps);
221
222inline BOOL O32_EndPaint(HWND a, CONST PAINTSTRUCT_W *b)
223{
224 BOOL yyrc;
225 USHORT sel = RestoreOS2FS();
226
227 yyrc = _O32_EndPaint(a, b);
228 SetFS(sel);
229
230 return yyrc;
231}
232
233int OPEN32API _O32_GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase);
234
235inline int O32_GetUpdateRgn(HWND a, HRGN b, BOOL c)
236{
237 int yyrc;
238 USHORT sel = RestoreOS2FS();
239
240 yyrc = _O32_GetUpdateRgn(a, b, c);
241 SetFS(sel);
242
243 return yyrc;
244}
245
246ULONG OPEN32API _O32_GetRegionData (HRGN hrgn, ULONG count, PRGNDATA_W pData);
247
248inline DWORD O32_GetRegionData(HRGN a, DWORD b, PRGNDATA_W c)
249{
250 DWORD yyrc;
251 USHORT sel = RestoreOS2FS();
252
253 yyrc = _O32_GetRegionData(a, b, c);
254 SetFS(sel);
255
256 return yyrc;
257}
258
259BOOL OPEN32API _O32_DeleteObject (LHANDLE hgdiobj);
260
261inline BOOL O32_DeleteObject(HANDLE a)
262{
263 BOOL yyrc;
264 USHORT sel = RestoreOS2FS();
265
266 yyrc = _O32_DeleteObject(a);
267 SetFS(sel);
268
269 return yyrc;
270}
271
272int OPEN32API _O32_ReleaseDC (HWND hwnd, HDC hdc);
273
274inline int O32_ReleaseDC(HWND a, HDC b)
275{
276 int yyrc;
277 USHORT sel = RestoreOS2FS();
278
279 yyrc = _O32_ReleaseDC(a, b);
280 SetFS(sel);
281
282 return yyrc;
283}
284
285VOID OPEN32API _O32_SetLastError( DWORD );
286
287inline VOID O32_SetLastError(DWORD a)
288{
289 USHORT sel = RestoreOS2FS();
290
291 _O32_SetLastError(a);
292 SetFS(sel);
293}
294
295BOOL OPEN32API _O32_SetRectRgn (HRGN dest, int left, int top, int right, int bottom);
296
297inline BOOL O32_SetRectRgn(HRGN a, int b, int c, int d, int e)
298{
299 BOOL yyrc;
300 USHORT sel = RestoreOS2FS();
301
302 yyrc = _O32_SetRectRgn(a, b, c, d, e);
303 SetFS(sel);
304
305 return yyrc;
306}
307
308int OPEN32API _O32_CombineRgn (HRGN dest, HRGN src1, HRGN src2, int mode);
309
310inline int O32_CombineRgn(HRGN a, HRGN b, HRGN c, int d)
311{
312 int yyrc;
313 USHORT sel = RestoreOS2FS();
314
315 yyrc = _O32_CombineRgn(a, b, c, d);
316 SetFS(sel);
317
318 return yyrc;
319}
320
321HRGN OPEN32API _O32_CreateRectRgn (int left, int top, int right, int bottom);
322
323inline HRGN O32_CreateRectRgn(int a, int b, int c, int d)
324{
325 HRGN yyrc;
326 USHORT sel = RestoreOS2FS();
327
328 yyrc = _O32_CreateRectRgn(a, b, c, d);
329 SetFS(sel);
330
331 return yyrc;
332}
333
334BOOL OPEN32API _O32_CreateCaret (HWND hwnd, HBITMAP hbm, int width, int height);
335
336inline BOOL O32_CreateCaret(HWND a, HBITMAP b, int c, int d)
337{
338 BOOL yyrc;
339 USHORT sel = RestoreOS2FS();
340
341 yyrc = _O32_CreateCaret(a, b, c, d);
342 SetFS(sel);
343
344 return yyrc;
345}
346
347BOOL APIENTRY __DestroyCaret (void);
348
349inline BOOL APIENTRY _DestroyCaret (void)
350{
351 BOOL yyrc;
352 USHORT sel = RestoreOS2FS();
353
354 yyrc = __DestroyCaret();
355 SetFS(sel);
356
357 return yyrc;
358}
359
360UINT APIENTRY __GetCaretBlinkTime (void);
361
362inline UINT APIENTRY _GetCaretBlinkTime (void)
363{
364 UINT yyrc;
365 USHORT sel = RestoreOS2FS();
366
367 yyrc = __GetCaretBlinkTime();
368 SetFS(sel);
369
370 return yyrc;
371}
372
373BOOL APIENTRY __HideCaret (HWND hwnd);
374
375inline BOOL APIENTRY _HideCaret (HWND hwnd)
376{
377 BOOL yyrc;
378 USHORT sel = RestoreOS2FS();
379
380 yyrc = __HideCaret(hwnd);
381 SetFS(sel);
382
383 return yyrc;
384}
385
386BOOL APIENTRY __SetCaretBlinkTime (UINT mSecs);
387
388inline BOOL APIENTRY _SetCaretBlinkTime (UINT mSecs)
389{
390 BOOL yyrc;
391 USHORT sel = RestoreOS2FS();
392
393 yyrc = __SetCaretBlinkTime(mSecs);
394 SetFS(sel);
395
396 return yyrc;
397}
398
399BOOL APIENTRY __ShowCaret (HWND hwnd);
400
401inline BOOL APIENTRY _ShowCaret (HWND hwnd)
402{
403 BOOL yyrc;
404 USHORT sel = RestoreOS2FS();
405
406 yyrc = __ShowCaret(hwnd);
407 SetFS(sel);
408
409 return yyrc;
410}
411
412#endif //INCLUDED_BY_DC
413
414#endif //__DC_H__
415
Note: See TracBrowser for help on using the repository browser.