1 | /* $Id: gpih.h 25 2001-01-17 17:34:55Z 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 | BOOL gpihSwitchToRGB(HPS hps);
|
---|
75 | typedef BOOL XWPENTRY GPIHSWITCHTORGB(HPS hps);
|
---|
76 | typedef GPIHSWITCHTORGB *PGPIHSWITCHTORGB;
|
---|
77 |
|
---|
78 | /* ******************************************************************
|
---|
79 | *
|
---|
80 | * Drawing primitives helpers
|
---|
81 | *
|
---|
82 | ********************************************************************/
|
---|
83 |
|
---|
84 | VOID gpihDrawRect(HPS hps, PRECTL prcl);
|
---|
85 |
|
---|
86 | VOID gpihBox(HPS hps,
|
---|
87 | LONG lControl,
|
---|
88 | PRECTL prcl);
|
---|
89 |
|
---|
90 | VOID gpihMarker(HPS hps,
|
---|
91 | LONG x,
|
---|
92 | LONG y,
|
---|
93 | ULONG ulWidth);
|
---|
94 |
|
---|
95 | VOID gpihDrawThickFrame(HPS hps,
|
---|
96 | PRECTL prcl,
|
---|
97 | ULONG ulWidth);
|
---|
98 |
|
---|
99 | VOID XWPENTRY gpihDraw3DFrame(HPS hps,
|
---|
100 | PRECTL prcl,
|
---|
101 | USHORT usWidth,
|
---|
102 | LONG lColorLeft,
|
---|
103 | LONG lColorRight);
|
---|
104 | typedef VOID XWPENTRY GPIHDRAW3DFRAME(HPS hps,
|
---|
105 | PRECTL prcl,
|
---|
106 | USHORT usWidth,
|
---|
107 | LONG lColorLeft,
|
---|
108 | LONG lColorRight);
|
---|
109 | typedef GPIHDRAW3DFRAME *PGPIHDRAW3DFRAME;
|
---|
110 |
|
---|
111 | LONG gpihCharStringPosAt(HPS hps,
|
---|
112 | PPOINTL pptlStart,
|
---|
113 | PRECTL prclRect,
|
---|
114 | ULONG flOptions,
|
---|
115 | LONG lCount,
|
---|
116 | PCH pchString);
|
---|
117 |
|
---|
118 | /* ******************************************************************
|
---|
119 | *
|
---|
120 | * Font helpers
|
---|
121 | *
|
---|
122 | ********************************************************************/
|
---|
123 |
|
---|
124 | BOOL gpihSplitPresFont(PSZ pszFontNameSize,
|
---|
125 | PULONG pulSize,
|
---|
126 | PSZ *ppszFaceName);
|
---|
127 |
|
---|
128 | LONG gpihFindFont(HPS hps,
|
---|
129 | LONG lSize,
|
---|
130 | BOOL fFamily,
|
---|
131 | PSZ pszName,
|
---|
132 | USHORT usFormat,
|
---|
133 | PFONTMETRICS pFontMetrics);
|
---|
134 |
|
---|
135 | LONG gpihFindPresFont(HWND hwnd,
|
---|
136 | BOOL fInherit,
|
---|
137 | HPS hps,
|
---|
138 | PSZ pszDefaultFont,
|
---|
139 | PFONTMETRICS pFontMetrics,
|
---|
140 | PLONG plSize);
|
---|
141 |
|
---|
142 | BOOL gpihSetPointSize(HPS hps,
|
---|
143 | LONG lPointSize);
|
---|
144 |
|
---|
145 | LONG gpihQueryLineSpacing(HPS hps);
|
---|
146 |
|
---|
147 | /* ******************************************************************
|
---|
148 | *
|
---|
149 | * Bitmap helpers
|
---|
150 | *
|
---|
151 | ********************************************************************/
|
---|
152 |
|
---|
153 | BOOL gpihCreateMemPS(HAB hab,
|
---|
154 | PSIZEL psizlPage,
|
---|
155 | HDC *hdcMem,
|
---|
156 | HPS *hpsMem);
|
---|
157 |
|
---|
158 | HBITMAP gpihCreateBitmap(HPS hpsMem,
|
---|
159 | ULONG cx,
|
---|
160 | ULONG cy);
|
---|
161 |
|
---|
162 | HBITMAP gpihCreateBmpFromPS(HAB hab,
|
---|
163 | HPS hpsScreen,
|
---|
164 | PRECTL prcl);
|
---|
165 |
|
---|
166 | HBITMAP gpihCreateHalftonedBitmap(HAB hab,
|
---|
167 | HBITMAP hbmSource,
|
---|
168 | LONG lColorGray);
|
---|
169 |
|
---|
170 | HBITMAP gpihLoadBitmapFile(HPS hps,
|
---|
171 | PSZ pszBmpFile,
|
---|
172 | PULONG pulError);
|
---|
173 |
|
---|
174 | LONG gpihStretchBitmap(HPS hpsTarget,
|
---|
175 | HBITMAP hbmSource,
|
---|
176 | PRECTL prclSource,
|
---|
177 | PRECTL prclTarget,
|
---|
178 | BOOL fProportional);
|
---|
179 |
|
---|
180 | BOOL gpihIcon2Bitmap(HPS hpsMem,
|
---|
181 | HPOINTER hptr,
|
---|
182 | LONG lBkgndColor,
|
---|
183 | ULONG ulIconSize);
|
---|
184 |
|
---|
185 | #endif
|
---|
186 |
|
---|
187 | #if __cplusplus
|
---|
188 | }
|
---|
189 | #endif
|
---|
190 |
|
---|