source: trunk/src/gdi32/oslibgpi.h@ 4012

Last change on this file since 4012 was 4012, checked in by cbratschi, 25 years ago

activated WinDrawText

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