1 | /* $Id: gpih.h 18 2001-01-01 15:30:29Z umoeller $ */
|
---|
2 |
|
---|
3 |
|
---|
4 | /*
|
---|
5 | *@@sourcefile gpih.h:
|
---|
6 | * header file for gpih.c (GPI helper functions). See remarks there.
|
---|
7 | *
|
---|
8 | * Note: Version numbering in this file relates to XWorkplace version
|
---|
9 | * numbering.
|
---|
10 | *
|
---|
11 | *@@include #define INCL_GPILOGCOLORTABLE // for some funcs
|
---|
12 | *@@include #include <os2.h>
|
---|
13 | *@@include #include "gpih.h"
|
---|
14 | */
|
---|
15 |
|
---|
16 | /*
|
---|
17 | * Copyright (C) 1997-2000 Ulrich Mller.
|
---|
18 | * This file is part of the "XWorkplace helpers" source package.
|
---|
19 | * This is free software; you can redistribute it and/or modify
|
---|
20 | * it under the terms of the GNU General Public License as published
|
---|
21 | * by the Free Software Foundation, in version 2 as it comes in the
|
---|
22 | * "COPYING" file of the XWorkplace main distribution.
|
---|
23 | * This program is distributed in the hope that it will be useful,
|
---|
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
26 | * GNU General Public License for more details.
|
---|
27 | */
|
---|
28 |
|
---|
29 | #if __cplusplus
|
---|
30 | extern "C" {
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #ifndef GPIH_HEADER_INCLUDED
|
---|
34 | #define GPIH_HEADER_INCLUDED
|
---|
35 |
|
---|
36 | /* ******************************************************************
|
---|
37 | *
|
---|
38 | * Device helpers
|
---|
39 | *
|
---|
40 | ********************************************************************/
|
---|
41 |
|
---|
42 | ULONG gpihQueryDisplayCaps(ULONG ulIndex);
|
---|
43 |
|
---|
44 | /* ******************************************************************
|
---|
45 | *
|
---|
46 | * Color helpers
|
---|
47 | *
|
---|
48 | ********************************************************************/
|
---|
49 |
|
---|
50 | // common RGB colors
|
---|
51 | #define RGBCOL_BLACK 0x00000000
|
---|
52 | #define RGBCOL_WHITE 0x00FFFFFF
|
---|
53 |
|
---|
54 | #define RGBCOL_RED 0x00FF0000
|
---|
55 | #define RGBCOL_PINK 0x00FF00FF
|
---|
56 | #define RGBCOL_BLUE 0x000000FF
|
---|
57 | #define RGBCOL_CYAN 0x0000FFFF
|
---|
58 | #define RGBCOL_GREEN 0x0000FF00
|
---|
59 | #define RGBCOL_YELLOW 0x00FFFF00
|
---|
60 | #define RGBCOL_GRAY 0x00CCCCCC
|
---|
61 |
|
---|
62 | #define RGBCOL_DARKRED 0x00800000
|
---|
63 | #define RGBCOL_DARKPINK 0x00800080
|
---|
64 | #define RGBCOL_DARKBLUE 0x00000080
|
---|
65 | #define RGBCOL_DARKCYAN 0x00008080
|
---|
66 | #define RGBCOL_DARKGREEN 0x00008000
|
---|
67 | #define RGBCOL_DARKYELLOW 0x00808000
|
---|
68 | #define RGBCOL_DARKGRAY 0x00808080
|
---|
69 |
|
---|
70 | VOID gpihManipulateRGB(PLONG plColor,
|
---|
71 | BYTE bMultiplier,
|
---|
72 | BYTE bDivisor);
|
---|
73 |
|
---|
74 | #ifdef INCL_GPILOGCOLORTABLE
|
---|
75 |
|
---|
76 | /*
|
---|
77 | *@@ gpihSwitchToRGB:
|
---|
78 | * this switches the given HPS into RGB mode.
|
---|
79 | * Requires INCL_GPILOGCOLORTABLE.
|
---|
80 | */
|
---|
81 |
|
---|
82 | #define gpihSwitchToRGB(hps) \
|
---|
83 | GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, NULL);
|
---|
84 |
|
---|
85 | #endif
|
---|
86 |
|
---|
87 | /* ******************************************************************
|
---|
88 | *
|
---|
89 | * Drawing primitives helpers
|
---|
90 | *
|
---|
91 | ********************************************************************/
|
---|
92 |
|
---|
93 | VOID gpihDrawRect(HPS hps, PRECTL prcl);
|
---|
94 |
|
---|
95 | VOID gpihBox(HPS hps,
|
---|
96 | LONG lControl,
|
---|
97 | PRECTL prcl,
|
---|
98 | LONG lColor);
|
---|
99 |
|
---|
100 | VOID gpihMarker(HPS hps,
|
---|
101 | LONG x,
|
---|
102 | LONG y,
|
---|
103 | ULONG ulWidth,
|
---|
104 | LONG lColor);
|
---|
105 |
|
---|
106 | VOID gpihDrawThickFrame(HPS hps,
|
---|
107 | PRECTL prcl,
|
---|
108 | ULONG ulWidth);
|
---|
109 |
|
---|
110 | VOID APIENTRY gpihDraw3DFrame(HPS hps,
|
---|
111 | PRECTL prcl,
|
---|
112 | USHORT usWidth,
|
---|
113 | LONG lColorLeft,
|
---|
114 | LONG lColorRight);
|
---|
115 | typedef VOID APIENTRY GPIHDRAW3DFRAME(HPS hps,
|
---|
116 | PRECTL prcl,
|
---|
117 | USHORT usWidth,
|
---|
118 | LONG lColorLeft,
|
---|
119 | LONG lColorRight);
|
---|
120 | typedef GPIHDRAW3DFRAME *PGPIHDRAW3DFRAME;
|
---|
121 |
|
---|
122 | LONG gpihCharStringPosAt(HPS hps,
|
---|
123 | PPOINTL pptlStart,
|
---|
124 | PRECTL prclRect,
|
---|
125 | ULONG flOptions,
|
---|
126 | LONG lCount,
|
---|
127 | PCH pchString);
|
---|
128 |
|
---|
129 | /* ******************************************************************
|
---|
130 | *
|
---|
131 | * Font helpers
|
---|
132 | *
|
---|
133 | ********************************************************************/
|
---|
134 |
|
---|
135 | BOOL gpihSplitPresFont(PSZ pszFontNameSize,
|
---|
136 | PULONG pulSize,
|
---|
137 | PSZ *ppszFaceName);
|
---|
138 |
|
---|
139 | LONG gpihFindFont(HPS hps,
|
---|
140 | LONG lSize,
|
---|
141 | BOOL fFamily,
|
---|
142 | PSZ pszName,
|
---|
143 | USHORT usFormat,
|
---|
144 | PFONTMETRICS pFontMetrics);
|
---|
145 |
|
---|
146 | LONG gpihFindPresFont(HWND hwnd,
|
---|
147 | BOOL fInherit,
|
---|
148 | HPS hps,
|
---|
149 | PSZ pszDefaultFont,
|
---|
150 | PFONTMETRICS pFontMetrics,
|
---|
151 | PLONG plSize);
|
---|
152 |
|
---|
153 | BOOL gpihSetPointSize(HPS hps,
|
---|
154 | LONG lPointSize);
|
---|
155 |
|
---|
156 | LONG gpihQueryLineSpacing(HPS hps);
|
---|
157 |
|
---|
158 | /* ******************************************************************
|
---|
159 | *
|
---|
160 | * Bitmap helpers
|
---|
161 | *
|
---|
162 | ********************************************************************/
|
---|
163 |
|
---|
164 | BOOL gpihCreateMemPS(HAB hab,
|
---|
165 | PSIZEL psizlPage,
|
---|
166 | HDC *hdcMem,
|
---|
167 | HPS *hpsMem);
|
---|
168 |
|
---|
169 | HBITMAP gpihCreateBitmap(HPS hpsMem,
|
---|
170 | ULONG cx,
|
---|
171 | ULONG cy);
|
---|
172 |
|
---|
173 | HBITMAP gpihCreateBmpFromPS(HAB hab,
|
---|
174 | HPS hpsScreen,
|
---|
175 | PRECTL prcl);
|
---|
176 |
|
---|
177 | HBITMAP gpihCreateHalftonedBitmap(HAB hab,
|
---|
178 | HBITMAP hbmSource,
|
---|
179 | LONG lColorGray);
|
---|
180 |
|
---|
181 | HBITMAP gpihLoadBitmapFile(HPS hps,
|
---|
182 | PSZ pszBmpFile,
|
---|
183 | PULONG pulError);
|
---|
184 |
|
---|
185 | LONG gpihStretchBitmap(HPS hpsTarget,
|
---|
186 | HBITMAP hbmSource,
|
---|
187 | PRECTL prclSource,
|
---|
188 | PRECTL prclTarget,
|
---|
189 | BOOL fProportional);
|
---|
190 |
|
---|
191 | BOOL gpihIcon2Bitmap(HPS hpsMem,
|
---|
192 | HPOINTER hptr,
|
---|
193 | LONG lBkgndColor,
|
---|
194 | ULONG ulIconSize);
|
---|
195 |
|
---|
196 | #endif
|
---|
197 |
|
---|
198 | #if __cplusplus
|
---|
199 | }
|
---|
200 | #endif
|
---|
201 |
|
---|