source: trunk/src/gdi32/oslibgpi.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: 10.4 KB
Line 
1/* $Id: oslibgpi.h,v 1.12 2004-01-11 11:42:20 sandervl Exp $ */
2
3/*
4 * GPI interface code
5 *
6 * Copyright 1999 Christoph Bratschi (cbratschi@datacomm.ch)
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11#ifndef __OSLIBGPI_H__
12#define __OSLIBGPI_H__
13
14#include <dcdata.h>
15
16#ifdef DEBUG
17void dprintfOrigin(HDC hdc);
18#else
19#define dprintfOrigin(a)
20#endif
21
22#define APIENTRYOS2 _System
23
24PVOID APIENTRYOS2 _GpiQueryDCData(ULONG hps);
25
26inline PVOID OSLibGpiQueryDCData(ULONG hps)
27{
28 PVOID yyrc;
29 USHORT sel = RestoreOS2FS();
30
31 yyrc = _GpiQueryDCData(hps);
32 SetFS(sel);
33
34 return yyrc;
35}
36
37BOOL APIENTRYOS2 _GpiEnableYInversion(ULONG hps, LONG lHeight);
38
39inline BOOL GpiEnableYInversion(ULONG hps, LONG lHeight)
40{
41 BOOL yyrc;
42 USHORT sel = RestoreOS2FS();
43
44 yyrc = _GpiEnableYInversion(hps, lHeight);
45 SetFS(sel);
46
47 return yyrc;
48}
49
50BOOL APIENTRYOS2 _GpiQueryYInversion(ULONG hps);
51
52inline BOOL GpiQueryYInversion(ULONG hps)
53{
54 BOOL yyrc;
55 USHORT sel = RestoreOS2FS();
56
57 yyrc = _GpiQueryYInversion(hps);
58 SetFS(sel);
59
60 return yyrc;
61}
62
63typedef struct
64{
65 LONG xLeft;
66 LONG yBottom;
67 LONG xRight;
68 LONG yTop;
69} RECTLOS2, *PRECTLOS2;
70
71typedef struct //same as Win32 POINT
72{
73 LONG x;
74 LONG y;
75} POINTLOS2, *PPOINTLOS2;
76
77#define MapWin32ToOS2Rect(rectWin32,rectOS2) \
78{ \
79 (rectOS2).xLeft = (rectWin32).left; \
80 (rectOS2).yBottom = (rectWin32).bottom; \
81 (rectOS2).xRight = (rectWin32).right; \
82 (rectOS2).yTop = (rectWin32).top; \
83}
84
85#define MapOS2ToWin32Rect(rectOS2,rectWin32) \
86{ \
87 (rectWin32).left = (rectOS2).xLeft; \
88 (rectWin32).bottom = (rectOS2).yBottom; \
89 (rectWin32).right = (rectOS2).xRight; \
90 (rectWin32).top = (rectOS2).yTop; \
91}
92
93BOOL excludeBottomRightPoint(PVOID pHps,PPOINTLOS2 pptl);
94BOOL includeBottomRightPoint(PVOID pHps,PPOINTLOS2 pptl);
95BOOL getAlignUpdateCP(PVOID pHps);
96INT getWorldYDeltaFor1Pixel(PVOID pHps);
97INT getWorldXDeltaFor1Pixel(PVOID pHps);
98BOOL getInPath(PVOID pHps);
99VOID setInPath(PVOID pHps,BOOL inPath);
100BOOL getIsWideLine(PVOID pHps);
101BOOL getIsTopTop(PVOID pHps);
102ULONG getMapMode(PVOID pHps);
103
104BOOL OSLibGpiQueryCurrentPosition(PVOID pHps,PPOINTLOS2 ptl);
105BOOL OSLibGpiSetCurrentPosition(PVOID pHps,PPOINTLOS2 ptl);
106
107BOOL ReallySetCharAttrs(PVOID pHps);
108
109BOOL OSLibGpiLoadFonts(LPSTR lpszFontFile);
110BOOL OSLibGpiUnloadFonts(LPSTR lpszFontFile);
111
112BOOL OSLibGpiQueryFontName(LPSTR lpszFileName, LPSTR lpszFamily, LPSTR lpszFace, int cbString);
113
114#define CHSOS_OPAQUE 0x0001L
115#define CHSOS_VECTOR 0x0002L
116#define CHSOS_LEAVEPOS 0x0008L
117#define CHSOS_CLIP 0x0010L
118#define CHSOS_UNDERSCORE 0x0200L
119#define CHSOS_STRIKEOUT 0x0400L
120
121#define GPIOS_ERROR 0L
122#define GPIOS_OK 1L
123#define GPIOS_ALTERROR (-1L)
124
125BOOL OSLibGpiCharStringPosAt(PVOID pHps,PPOINTLOS2 ptl,PRECTLOS2 rct,ULONG flOptions,LONG lCount,LPCSTR pchString,CONST INT *alAdx);
126BOOL OSLibGpiQueryCharStringPosAt(PVOID pHps,PPOINTLOS2 ptl,ULONG flOptions,LONG lCount,LPCSTR pchString,CONST INT *alAdx,PPOINTLOS2 aptlPos);
127
128#define TAOS_NORMAL_HORIZ 0x0001
129#define TAOS_LEFT 0x0002
130#define TAOS_CENTER 0x0003
131#define TAOS_RIGHT 0x0004
132#define TAOS_STANDARD_HORIZ 0x0005
133#define TAOS_NORMAL_VERT 0x0100
134#define TAOS_TOP 0x0200
135#define TAOS_HALF 0x0300
136#define TAOS_BASE 0x0400
137#define TAOS_BOTTOM 0x0500
138#define TAOS_STANDARD_VERT 0x0600
139
140BOOL OSLibGpiSetTextAlignment(PVOID pHps,LONG lHoriz,LONG lVert);
141BOOL OSLibGpiQueryTextAlignment(PVOID pHps,PLONG plHoriz,PLONG plVert);
142
143LONG OSLibGpiQueryTabbedTextExtent(pDCData pHps,INT lCount,LPCSTR pchString,INT lTabCount,PINT puTabStops);
144LONG OSLibGpiTabbedCharStringAt(PVOID pHps,PPOINTLOS2 pPtStart,PRECTLOS2 prclRect,ULONG flOptions,INT lCount,LPCSTR pchString,INT lTabCount,PINT puTabStops,INT lTabOrigin);
145
146#define TXTBOXOS_TOPLEFT 0L
147#define TXTBOXOS_BOTTOMLEFT 1L
148#define TXTBOXOS_TOPRIGHT 2L
149#define TXTBOXOS_BOTTOMRIGHT 3L
150#define TXTBOXOS_CONCAT 4L
151#define TXTBOXOS_COUNT 5L
152
153BOOL OSLibGpiQueryTextBox(pDCData pHps,LONG lCount1,LPCSTR pchString,LONG lCount2,PPOINTLOS2 aptlPoints);
154
155VOID calcDimensions(POINTLOS2 box[],PPOINTLOS2 point);
156
157#define BMOS_ERROR (-1L)
158#define BMOS_DEFAULT 0L
159#define BMOS_OR 1L
160#define BMOS_OVERPAINT 2L
161#define BMOS_LEAVEALONE 5L
162
163LONG OSLibGpiQueryBackMix(PVOID pHps);
164
165#define MMOS_TEXT 1
166#define MMOS_LOMETRIC 2
167#define MMOS_HIMETRIC 3
168#define MMOS_LOENGLISH 4
169#define MMOS_HIENGLISH 5
170#define MMOS_TWIPS 6
171#define MMOS_ISOTROPIC 7
172#define MMOS_ANISOTROPIC 8
173
174BOOL doesYAxisGrowNorth(PVOID pHps);
175
176#define DTOS_LEFT 0x00000000
177#define DTOS_QUERYEXTENT 0x00000002
178#define DTOS_UNDERSCORE 0x00000010
179#define DTOS_STRIKEOUT 0x00000020
180#define DTOS_TEXTATTRS 0x00000040
181#define DTOS_EXTERNALLEADING 0x00000080
182#define DTOS_CENTER 0x00000100
183#define DTOS_RIGHT 0x00000200
184#define DTOS_TOP 0x00000000
185#define DTOS_VCENTER 0x00000400
186#define DTOS_BOTTOM 0x00000800
187#define DTOS_HALFTONE 0x00001000
188#define DTOS_MNEMONIC 0x00002000
189#define DTOS_WORDBREAK 0x00004000
190#define DTOS_ERASERECT 0x00008000
191
192#define DTOS_SYSTEMFONT 0x00000001
193#define DTOS_SINGLELINE 0x00010000
194#define DTOS_MULTILINE 0x00020000
195#define DTOS_NOCLIP 0x00040000
196#define DTOS_OPAQUE 0x00080000
197#define DTOS_AMPERSAND 0x00100000
198#define DTOS_VERTICALEXTENT 0x00200000
199#define DTOS_INVERTCHAR 0x20000000
200#define DTOS_WORLDRECT 0x40000000
201#define DTOS_INVERT 0x80000000
202
203LONG OSLibWinDrawTabbedText(PVOID pHps,LONG cchText,LONG lTabs,LPCSTR lpchText,PVOID prcl,LONG clrFore,LONG clrBack,ULONG flCmd);
204
205int OSLibGpiQueryFontMaxHeight(HDC hdc);
206
207BOOL OSLibGpiMove(PVOID pHps,PPOINTLOS2 pptlPoint);
208BOOL OSLibGpiLine(PVOID pHps,PPOINTLOS2 pptlEndPoint);
209
210BOOL OSLibGpiEndPath(PVOID pHps);
211
212BOOL drawLinePointCircle(PVOID pHps,INT width,INT height,LONG color);
213BOOL drawLinePoint(PVOID pHps,PPOINTLOS2 pt,LONG color);
214
215ULONG SYSTEM OSLibGpiQueryCp(HDC hdc);
216BOOL SYSTEM OSLibGpiSetCp(HDC hdc, ULONG codepage);
217
218#define OSLIB_CAPS_HORIZONTAL_RESOLUTION 8L /* pels per meter */
219#define OSLIB_CAPS_VERTICAL_RESOLUTION 9L /* pels per meter */
220
221BOOL OSLibDevQueryCaps(pDCData hHps, LONG lStart, LONG lCount, LONG *alArray);
222
223 // from pmddi.h:
224 /* CopyClipRegion */
225
226 #define COPYCRGN_ALLINTERSECT 0L
227 #define COPYCRGN_VISRGN 1L
228 #define COPYCRGN_CLIPRGN 2L
229
230 /* SetupDC */
231
232 #define SETUPDC_VISRGN 0x00000001L
233 #define SETUPDC_ORIGIN 0x00000002L
234 #define SETUPDC_ACCUMBOUNDSON 0x00000004L
235 #define SETUPDC_ACCUMBOUNDSOFF 0x00000008L
236 #define SETUPDC_RECALCCLIP 0x00000010L
237 #define SETUPDC_SETOWNER 0x00000020L
238 #define SETUPDC_CLEANDC 0x00000040L
239
240ULONG APIENTRY Gre32Entry4(ULONG,ULONG,ULONG,ULONG);
241
242inline ULONG APIENTRY _Gre32Entry4 (ULONG a, ULONG b, ULONG c, ULONG d)
243{
244 ULONG yyrc;
245 USHORT sel = RestoreOS2FS();
246
247 yyrc = Gre32Entry4(a,b,c,d);
248 SetFS(sel);
249
250 return yyrc;
251}
252
253ULONG APIENTRY Gre32Entry5(ULONG,ULONG,ULONG,ULONG,ULONG);
254
255inline ULONG APIENTRY _Gre32Entry5 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e)
256{
257 ULONG yyrc;
258 USHORT sel = RestoreOS2FS();
259
260 yyrc = Gre32Entry5(a,b,c,d,e);
261 SetFS(sel);
262
263 return yyrc;
264}
265
266
267ULONG APIENTRY Gre32Entry6(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
268
269inline ULONG APIENTRY _Gre32Entry6 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f)
270{
271 ULONG yyrc;
272 USHORT sel = RestoreOS2FS();
273
274 yyrc = Gre32Entry6(a,b,c,d,e,f);
275 SetFS(sel);
276
277 return yyrc;
278}
279
280ULONG APIENTRY Gre32Entry7(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
281
282inline ULONG APIENTRY _Gre32Entry7 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f, ULONG g)
283{
284 ULONG yyrc;
285 USHORT sel = RestoreOS2FS();
286
287 yyrc = Gre32Entry7(a,b,c,d,e,f,g);
288 SetFS(sel);
289
290 return yyrc;
291}
292
293ULONG APIENTRY Gre32Entry8(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
294
295inline ULONG APIENTRY _Gre32Entry8 (ULONG a, ULONG b, ULONG c, ULONG d, ULONG e, ULONG f, ULONG g, ULONG h)
296{
297 ULONG yyrc;
298 USHORT sel = RestoreOS2FS();
299
300 yyrc = Gre32Entry8(a,b,c,d,e,f,g,h);
301 SetFS(sel);
302
303 return yyrc;
304}
305
306
307 #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)
308 #define GreCreateRectRegion(a,b,c) (HRGN) _Gre32Entry5((ULONG)(HDC)(a),(ULONG)(PRECTL)(b),(ULONG)(LONG)(c),0L,0x00004062L)
309 #define GreGetPageUnits(a,b) (LONG) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PULONG)(b),0L,0x00004083L)
310 #define GreCopyClipRegion(a,b,c,d) (INT) _Gre32Entry6((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(PRECTL)(c),(ULONG)(ULONG)(d),0L,0x00004080L)
311 #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)
312 #define GreDestroyRegion(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(HRGN)(b),0L,0x00004063L)
313 #define GreGetDCOrigin(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PPOINTL)(b),0L,0x000040BAL)
314 #define GreDeviceSetDCOrigin(a,b) (BOOL) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PPOINTL)(b),0L,0x000040BBL)
315 #define GreSelectClipRegion(a,b,c) (INT) _Gre32Entry5((ULONG)(HDC)(a),(ULONG)(HRGN)(b),(ULONG)(PHRGN)(c),0L,0x00004074L)
316 #define GreIntersectClipRectangle(a,b) (INT) _Gre32Entry4((ULONG)(HDC)(a),(ULONG)(PRECTL)(b),0L,0x00004075L)
317
318#ifndef _OS2WIN_H
319#define OPEN32API _System
320
321BOOL OPEN32API _O32_LPtoDP( HDC, PPOINT, int );
322
323inline BOOL O32_LPtoDP(HDC a, PPOINT b, int c)
324{
325 BOOL yyrc;
326 USHORT sel = RestoreOS2FS();
327
328 yyrc = _O32_LPtoDP(a, b, c);
329 SetFS(sel);
330
331 return yyrc;
332}
333BOOL OPEN32API _O32_DPtoLP( HDC, PPOINT, int );
334
335inline BOOL O32_DPtoLP(HDC a, PPOINT b, int c)
336{
337 BOOL yyrc;
338 USHORT sel = RestoreOS2FS();
339
340 yyrc = _O32_DPtoLP(a, b, c);
341 SetFS(sel);
342
343 return yyrc;
344}
345
346#endif
347#endif
Note: See TracBrowser for help on using the repository browser.