1 | /* $Id: oslibgpi.h,v 1.5 2000-04-03 18:29:05 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 | /* DC Graphics Mode */
|
---|
15 | #define GM_COMPATIBLE_W 1
|
---|
16 | #define GM_ADVANCED_W 2
|
---|
17 |
|
---|
18 | #define APIENTRYOS2 _System
|
---|
19 |
|
---|
20 | PVOID APIENTRYOS2 _GpiQueryDCData(ULONG hps);
|
---|
21 |
|
---|
22 | inline PVOID OSLibGpiQueryDCData(ULONG hps)
|
---|
23 | {
|
---|
24 | PVOID yyrc;
|
---|
25 | USHORT sel = RestoreOS2FS();
|
---|
26 |
|
---|
27 | yyrc = _GpiQueryDCData(hps);
|
---|
28 | SetFS(sel);
|
---|
29 |
|
---|
30 | return yyrc;
|
---|
31 | }
|
---|
32 |
|
---|
33 | BOOL APIENTRYOS2 _GpiEnableYInversion(ULONG hps, LONG lHeight);
|
---|
34 |
|
---|
35 | inline BOOL GpiEnableYInversion(ULONG hps, LONG lHeight)
|
---|
36 | {
|
---|
37 | BOOL yyrc;
|
---|
38 | USHORT sel = RestoreOS2FS();
|
---|
39 |
|
---|
40 | yyrc = _GpiEnableYInversion(hps, lHeight);
|
---|
41 | SetFS(sel);
|
---|
42 |
|
---|
43 | return yyrc;
|
---|
44 | }
|
---|
45 |
|
---|
46 | BOOL APIENTRYOS2 _GpiQueryYInversion(ULONG hps);
|
---|
47 |
|
---|
48 | inline BOOL GpiQueryYInversion(ULONG hps)
|
---|
49 | {
|
---|
50 | BOOL yyrc;
|
---|
51 | USHORT sel = RestoreOS2FS();
|
---|
52 |
|
---|
53 | yyrc = _GpiQueryYInversion(hps);
|
---|
54 | SetFS(sel);
|
---|
55 |
|
---|
56 | return yyrc;
|
---|
57 | }
|
---|
58 |
|
---|
59 | typedef struct
|
---|
60 | {
|
---|
61 | LONG xLeft;
|
---|
62 | LONG yBottom;
|
---|
63 | LONG xRight;
|
---|
64 | LONG yTop;
|
---|
65 | } RECTLOS2, *PRECTLOS2;
|
---|
66 |
|
---|
67 | typedef struct //same as Win32 POINT
|
---|
68 | {
|
---|
69 | LONG x;
|
---|
70 | LONG y;
|
---|
71 | } POINTLOS2, *PPOINTLOS2;
|
---|
72 |
|
---|
73 | #define MapWin32ToOS2Rect(rectWin32,rectOS2) \
|
---|
74 | { \
|
---|
75 | (rectOS2).xLeft = (rectWin32).left; \
|
---|
76 | (rectOS2).yBottom = (rectWin32).bottom; \
|
---|
77 | (rectOS2).xRight = (rectWin32).right; \
|
---|
78 | (rectOS2).yTop = (rectWin32).top; \
|
---|
79 | }
|
---|
80 |
|
---|
81 | #define MapOS2ToWin32Rect(rectOS2,rectWin32) \
|
---|
82 | { \
|
---|
83 | (rectWin32).left = (rectOS2).xLeft; \
|
---|
84 | (rectWin32).bottom = (rectOS2).yBottom; \
|
---|
85 | (rectWin32).right = (rectOS2).xRight; \
|
---|
86 | (rectWin32).top = (rectOS2).yTop; \
|
---|
87 | }
|
---|
88 |
|
---|
89 | BOOL excludeBottomRightPoint(PVOID pHps,PPOINTLOS2 pptl);
|
---|
90 | BOOL getAlignUpdateCP(PVOID pHps);
|
---|
91 | INT getWorldYDeltaFor1Pixel(PVOID pHps);
|
---|
92 | INT getWorldXDeltaFor1Pixel(PVOID pHps);
|
---|
93 | BOOL getInPath(PVOID pHps);
|
---|
94 | VOID setInPath(PVOID pHps,BOOL inPath);
|
---|
95 | BOOL getIsWideLine(PVOID pHps);
|
---|
96 | BOOL getIsTopTop(PVOID pHps);
|
---|
97 | ULONG getMapMode(PVOID pHps);
|
---|
98 |
|
---|
99 | BOOL OSLibGpiQueryCurrentPosition(PVOID pHps,PPOINTLOS2 ptl);
|
---|
100 | BOOL OSLibGpiSetCurrentPosition(PVOID pHps,PPOINTLOS2 ptl);
|
---|
101 |
|
---|
102 | #define CHSOS_OPAQUE 0x0001L
|
---|
103 | #define CHSOS_VECTOR 0x0002L
|
---|
104 | #define CHSOS_LEAVEPOS 0x0008L
|
---|
105 | #define CHSOS_CLIP 0x0010L
|
---|
106 | #define CHSOS_UNDERSCORE 0x0200L
|
---|
107 | #define CHSOS_STRIKEOUT 0x0400L
|
---|
108 |
|
---|
109 | #define GPIOS_ERROR 0L
|
---|
110 | #define GPIOS_OK 1L
|
---|
111 | #define GPIOS_ALTERROR (-1L)
|
---|
112 |
|
---|
113 | BOOL OSLibGpiCharStringPosAt(PVOID pHps,PPOINTLOS2 ptl,PRECTLOS2 rct,ULONG flOptions,LONG lCount,LPCSTR pchString,CONST INT *alAdx);
|
---|
114 | BOOL OSLibGpiQueryCharStringPosAt(PVOID pHps,PPOINTLOS2 ptl,ULONG flOptions,LONG lCount,LPCSTR pchString,CONST INT *alAdx,PPOINTLOS2 aptlPos);
|
---|
115 |
|
---|
116 | #define TAOS_NORMAL_HORIZ 0x0001
|
---|
117 | #define TAOS_LEFT 0x0002
|
---|
118 | #define TAOS_CENTER 0x0003
|
---|
119 | #define TAOS_RIGHT 0x0004
|
---|
120 | #define TAOS_STANDARD_HORIZ 0x0005
|
---|
121 | #define TAOS_NORMAL_VERT 0x0100
|
---|
122 | #define TAOS_TOP 0x0200
|
---|
123 | #define TAOS_HALF 0x0300
|
---|
124 | #define TAOS_BASE 0x0400
|
---|
125 | #define TAOS_BOTTOM 0x0500
|
---|
126 | #define TAOS_STANDARD_VERT 0x0600
|
---|
127 |
|
---|
128 | BOOL OSLibGpiSetTextAlignment(PVOID pHps,LONG lHoriz,LONG lVert);
|
---|
129 | BOOL OSLibGpiQueryTextAlignment(PVOID pHps,PLONG plHoriz,PLONG plVert);
|
---|
130 |
|
---|
131 | LONG OSLibGpiQueryTabbedTextExtent(PVOID pHps,INT lCount,LPCSTR pchString,INT lTabCount,PINT puTabStops);
|
---|
132 | LONG OSLibGpiTabbedCharStringAt(PVOID pHps,PPOINTLOS2 pPtStart,PRECTLOS2 prclRect,ULONG flOptions,INT lCount,LPCSTR pchString,INT lTabCount,PINT puTabStops,INT lTabOrigin);
|
---|
133 |
|
---|
134 | #define TXTBOXOS_TOPLEFT 0L
|
---|
135 | #define TXTBOXOS_BOTTOMLEFT 1L
|
---|
136 | #define TXTBOXOS_TOPRIGHT 2L
|
---|
137 | #define TXTBOXOS_BOTTOMRIGHT 3L
|
---|
138 | #define TXTBOXOS_CONCAT 4L
|
---|
139 | #define TXTBOXOS_COUNT 5L
|
---|
140 |
|
---|
141 | BOOL OSLibGpiQueryTextBox(PVOID pHps,LONG lCount1,LPCSTR pchString,LONG lCount2,PPOINTLOS2 aptlPoints);
|
---|
142 |
|
---|
143 | VOID calcDimensions(POINTLOS2 box[],PPOINTLOS2 point);
|
---|
144 |
|
---|
145 | #define DTOS_LEFT 0x00000000
|
---|
146 | #define DTOS_QUERYEXTENT 0x00000002
|
---|
147 | #define DTOS_UNDERSCORE 0x00000010
|
---|
148 | #define DTOS_STRIKEOUT 0x00000020
|
---|
149 | #define DTOS_TEXTATTRS 0x00000040
|
---|
150 | #define DTOS_EXTERNALLEADING 0x00000080
|
---|
151 | #define DTOS_CENTER 0x00000100
|
---|
152 | #define DTOS_RIGHT 0x00000200
|
---|
153 | #define DTOS_TOP 0x00000000
|
---|
154 | #define DTOS_VCENTER 0x00000400
|
---|
155 | #define DTOS_BOTTOM 0x00000800
|
---|
156 | #define DTOS_HALFTONE 0x00001000
|
---|
157 | #define DTOS_MNEMONIC 0x00002000
|
---|
158 | #define DTOS_WORDBREAK 0x00004000
|
---|
159 | #define DTOS_ERASERECT 0x00008000
|
---|
160 |
|
---|
161 | #define BMOS_ERROR (-1L)
|
---|
162 | #define BMOS_DEFAULT 0L
|
---|
163 | #define BMOS_OR 1L
|
---|
164 | #define BMOS_OVERPAINT 2L
|
---|
165 | #define BMOS_LEAVEALONE 5L
|
---|
166 |
|
---|
167 | LONG OSLibGpiQueryBackMix(PVOID pHps);
|
---|
168 |
|
---|
169 | #define MMOS_TEXT 1
|
---|
170 | #define MMOS_LOMETRIC 2
|
---|
171 | #define MMOS_HIMETRIC 3
|
---|
172 | #define MMOS_LOENGLISH 4
|
---|
173 | #define MMOS_HIENGLISH 5
|
---|
174 | #define MMOS_TWIPS 6
|
---|
175 | #define MMOS_ISOTROPIC 7
|
---|
176 | #define MMOS_ANISOTROPIC 8
|
---|
177 |
|
---|
178 | BOOL doesYAxisGrowNorth(PVOID pHps);
|
---|
179 |
|
---|
180 | LONG OSLibWinDrawTabbedText(PVOID pHps,LONG cchText,LONG lTabs,LPCSTR lpchText,PVOID prcl,LONG clrFore,LONG clrBack,ULONG flCmd);
|
---|
181 |
|
---|
182 |
|
---|
183 | BOOL OSLibGpiMove(PVOID pHps,PPOINTLOS2 pptlPoint);
|
---|
184 | LONG OSLibGpiLine(PVOID pHps,PPOINTLOS2 pptlEndPoint);
|
---|
185 |
|
---|
186 | BOOL OSLibGpiEndPath(PVOID pHps);
|
---|
187 |
|
---|
188 | BOOL drawLinePointCircle(PVOID pHps,INT width,INT height,LONG color);
|
---|
189 | BOOL drawLinePoint(PVOID pHps,PPOINTLOS2 pt,LONG color);
|
---|
190 |
|
---|
191 | ULONG OSLibGpiQueryCp(HDC hdc);
|
---|
192 | BOOL OSLibGpiSetCp(HDC hdc, ULONG codepage);
|
---|
193 |
|
---|
194 | #endif
|
---|