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