PMGuide - Appendices: Difference between revisions
No edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{IBM-Reprint}} | |||
{{PMGuide}} | |||
This section contains several topics related to Presentation Manager programming. | This section contains several topics related to Presentation Manager programming. | ||
Line 78: | Line 80: | ||
For general bitmaps, which may be of arbitrary size, the preferred version is one matching the requested bitmap size; otherwise one matching the display size is selected. If neither is available, the device-independent version is used from which to scale a bitmap. | For general bitmaps, which may be of arbitrary size, the preferred version is one matching the requested bitmap size; otherwise one matching the display size is selected. If neither is available, the device-independent version is used from which to scale a bitmap. | ||
For both formats, the definition consists of two sections. The first section contains general information about the type, dimensions, and other attributes of the resource. The second section contains data describing the pels that make up the bitmap(s), and is in the format specified in [[Bitmap Data]]. | For both formats, the definition consists of two sections. The first section contains general information about the type, dimensions, and other attributes of the resource. The second section contains data describing the pels that make up the bitmap(s), and is in the format specified in [[#Bitmap Data|Bitmap Data]]. | ||
In the multiple-version format, the first section contains an array of [[BITMAPARRAYFILEHEADER]] or [[BITMAPARRAYFILEHEADER2]] structures. The device-independent version must be the first [[BITMAPARRAYFILEHEADER]] or [[BITMAPARRAYFILEHEADER2]] defined. | In the multiple-version format, the first section contains an array of [[BITMAPARRAYFILEHEADER]] or [[BITMAPARRAYFILEHEADER2]] structures. The device-independent version must be the first [[BITMAPARRAYFILEHEADER]] or [[BITMAPARRAYFILEHEADER2]] defined. |
Latest revision as of 04:12, 11 May 2025
Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation
This section contains several topics related to Presentation Manager programming.
Bitmap Formats
There are four standard bitmap formats. All device drivers must be able to translate between any of these formats and their own internal formats. The standard formats are:
- Bitcount 1, Planes 1
- Bitcount 4, Planes 1
- Bitcount 8, Planes 1
- Bitcount 24, Planes 1
These formats are chosen because they are identical or similar to all formats commonly used by raster devices. Only single-plane formats are standard, but it is very easy to convert these to any multiple-plane format used internally by a device.
Bitmap Data
The pel data is stored in the bitmap in the order that the coordinates appear on a display screen. That is, the pel in the lower-left corner is the first in the bitmap. Pels are scanned to the right, and upward, from that position. The bits of the first pel are stored, beginning with the most significant bits of the first byte. The data for pels in each scan line is packed together tightly, but all scan lines are padded at the end, so that each one begins on a ULONG boundary.
Bitmap Information Tables
Each standard-format bitmap must be accompanied by a bitmap information table. Because the standard-format bitmaps are intended to be traded between devices, the color indexes in the bitmap are meaningless without more information; for a description of this structure, see BITMAPINFO2.
Some functions use a structure that is similar to BITMAPINFO2 but does not have the color table array; for a description of this structure, see BITMAPINFOHEADER2. Wherever BITMAPINFO2 is shown, BITMAPINFO is also allowed. Similarly, wherever BITMAPINFOHEADER2 is shown, BITMAPINFOHEADER is also allowed.
Bitmap Example
To make the ordering of all the bytes clear, consider this simple example of a 5-by-3 array of colored pels:
Red Green Blue Red Green Blue Red Green Blue Red Green Blue Red Green Blue
ULONG ExampleBitmap[] = { 0x23,0x12,0x30,0x00, /* bottom line */ 0x31,0x23,0x10,0x00, /* middle line */ 0x12,0x31,0x20,0x00 /* top line */ }; #define BLACK 0x00000000L #define RED 0x00FF0000L #define GREEN 0x0000FF00L #define BLUE 0x000000FFL struct BitmapInfoTable ExampleInfo = { 5, /* width */ 3, /* height */ 1, /* planes */ 4, /* bitcount */ BLACK,RED,GREEN,BLUE, /* color table */ BLACK,BLACK,BLACK,BLACK, BLACK,BLACK,BLACK,BLACK, BLACK,BLACK,BLACK,BLACK };
Bitmap File Format
The operating system uses the same file format for bitmaps, icons, and pointers in resource files. In the following description, "bitmap" refers to bitmaps, icons, and pointers unless otherwise specified.
Two formats are supported. In the first, a single-size version of the bitmap is defined. This is used whatever the target device.
The second format allows multiple versions of the bitmap to be defined, including one or more device-independent versions, and a number of device-dependent versions, each intended for use with a particular device.
In the case of icons and pointers, when more than one version of the bitmap exists, the preferred version is one that matches the device size of the icon or pointer; otherwise, the device-independent version is used to scale a bitmap to the required size.
The operating system provides pointers that match the requirements of the display device in use, typically pointers are 32x32 pels, one bit per plane.
Icons provided with the operating system are designed to match the requirements of the most common display devices. The following versions of each icon are included in each file:
- 32x32 4 bpp (16 color)
- 40x40 4 bpp (16 color)
- 32x32 1 bpp (black and white)
- 20x20 1 bpp (black and white)
- 16x16 1 bpp (black and white)
The 32x32 versions are designed for VGA displays and for device-independent use. The 40x40 version is for 8514/A and XGA displays. The 20x20 and 16x16 are half-size icons designed for use as mini-icons.
For general bitmaps, which may be of arbitrary size, the preferred version is one matching the requested bitmap size; otherwise one matching the display size is selected. If neither is available, the device-independent version is used from which to scale a bitmap.
For both formats, the definition consists of two sections. The first section contains general information about the type, dimensions, and other attributes of the resource. The second section contains data describing the pels that make up the bitmap(s), and is in the format specified in Bitmap Data.
In the multiple-version format, the first section contains an array of BITMAPARRAYFILEHEADER or BITMAPARRAYFILEHEADER2 structures. The device-independent version must be the first BITMAPARRAYFILEHEADER or BITMAPARRAYFILEHEADER2 defined.
In the single-size format, the BITMAPARRAYFILEHEADER or BITMAPARRAYFILEHEADER2 structure is not present. The definition consists of one or two BITMAPFILEHEADER or BITMAPFILEHEADER2 structures.
For icons and pointers, the cy field in bmp is actually twice the pel height of the image that appears on the screen. This is because these types actually contain two full bitmap pel definitions. The first bitmap definition is the XOR mask, which contains invert information (0 = no invert, 1 = invert) for the pointer or icon. The second is the AND mask, which determines whether the pointer or the screen is shown (0 = black/white, 1 = screen/inverse screen).
For color icons or pointers, there are two bitmaps involved: one that is black and white and consists of an AND and an XOR mask, and one that is color that defines the color content.
The cy field in the BITMAPINFOHEADER2 structure for the color bitmap must be the real height, that is, half the value specified for the black and white bitmap. The cx must be the same.
The following table shows how these two bitmaps are used for a color icon or pointer:
XOR | AND | COLOR | Result |
---|---|---|---|
1 | 1 | x | Invert screen |
0 | 0 | x | Use color x |
0 | 1 | x | Transparency |
1 | 0 | x | Use color x |
For color icons or pointers, two BITMAPFILEHEADER or BITMAPFILEHEADER2 structures are therefore required:
BITMAPFILEHEADER2 with usType BFT_COLORICON or BFT_COLORPOINTER BITMAPINFOHEADER2 (part of BITMAPFILEHEADER2) Color table BITMAPFILEHEADER2 with same usType BITMAPINFOHEADER2 (part of BITMAPFILEHEADER2) Color table ** bits for one bitmap ** ** bits for other bitmap **
The usType for the first BITMAPFILEHEADER2 is either BFT_COLORICON or BFT_COLORPOINTER. This means that a second BITMAPFILEHEADER2 is present as part of the definition of a color icon or pointer. The first BITMAPFILEHEADER2 structure contains the information for the black and white AND and XOR masks, while the second BITMAPFILEHEADER2 structure contains the information for the color part of the pointer or icon.
BITMAPFILEHEADER and BITMAPINFOHEADER can occur in place of BITMAPFILEHEADER2 and BITMAPINFOHEADER2 in this example.
For the multiple version format, the file is as follows:
BITMAPARRAYFILEHEADER2 for device-independent version BITMAPFILEHEADER2 (part of BITMAPARRAYFILEHEADER2) BITMAPINFOHEADER2 (part of BITMAPFILEHEADER2) Color table BITMAPFILEHEADER2 ) BITMAPINFOHEADER2 ) only if this is a color icon or pointer Color table ) BITMAPARRAYFILEHEADER2 for first device-dependent version BITMAPFILEHEADER2 (part of BITMAPARRAYFILEHEADER2) BITMAPINFOHEADER2 (part of BITMAPFILEHEADER2) Color table BITMAPFILEHEADER2 ) BITMAPINFOHEADER2 ) only if this is a color icon or pointer Color table ) Further BITMAPARRAYFILEHEADER2 groups occur here as required for additional device-dependent versions ** bits for one bitmap ** ** bits for next bitmap ** And so on for as many bitmaps as necessary.
As before, BITMAPARRAYFILEHEADER, BITMAPFILEHEADER, and BITMAPINFOHEADER can occur in place of BITMAPARRAYFILEHEADER2, BITMAPFILEHEADER2, and BITMAPINFOHEADER2.
Code Pages
The initialization file contains country information relating to date, time, and numeric formats. It does not contain code-page information; this is obtained from the CONFIG.SYS file.
Applications start with the default code page. The default code page is set when the operating system is installed. It can be changed subsequently either by reinstalling the operating system or by editing the COUNTRY statement in the CONFIG.SYS file.
A GPI presentation space inherits the code page of the process that created it. The code page changes only when the process calls GpiSetCp.
See the printed version of the Presentation Manager Programming Reference for the ASCII and EBCDIC versions of the code pages.
Windowed PM Applications
Windowed PM applications allow the code-page calls to use any of the supported ASCII code pages. These are:
Character Set | Code Page |
---|---|
Canadian-French | 863 |
Desktop Publishing | 1004 |
Iceland | 861 |
Latin 1 Multilingual | 850 |
Latin 2 Multilingual | 852 |
Nordic | 865 |
Portuguese | 860 |
Turkey | 857 |
U.S. (IBM PC) | 437 |
Code page 1004 is compatible with Microsoft Windows.
The following EBCDIC code pages, based on character set 697, are also available for output:
Character Set | Code Page |
---|---|
Austrian/German | 273 |
Belgian | 274 |
Brazil | 275 |
Czechoslovakia | 870 |
Danish/Norwegian | 277 |
Finnish/Swedish | 278 |
French | 297 |
Hungary | 870 |
Iceland | 871 |
International | 500 |
Italian | 280 |
Poland | 870 |
Portuguese | 282 |
Spanish | 284 |
Turkey | 1026 |
U.K.-English | 285 |
U.S.-English | 037 |
Yugoslavia | 870 |
Note: Code pages 274 (Belgian) and 282 (Portuguese) can be used to provide access to old data.
The operating system provides the following additional code-page setting and query calls for the supported ASCII and EBCDIC code pages. These calls work independently of the CONFIG.SYS file:
- GpiSetCp: Sets the code page for GPI.
- GpiQueryCp: Queries the code page for GPI.
- GpiCreateLogFont: Creates fonts in a code page.
- WinSetCp: Sets the code page for a message queue.
- WinQueryCp: Queries the code page for a message queue.
- WinQueryCpList: Creates a list of code pages supported by the operating system.
Text entered in a dialog box is supplied to the application in the code page of the queue ("queue code page"). If possible, the code page of a resource (for example, a menu or dialog box) should match the code page of the queue. In general, code page 850 is the best choice for both an application and its resources.
Applications should be able to process data from a variety of sources. Because code page 850 contains most of the characters in other supported code pages, this is usually the best choice for the queue code page.
OS/2 Code Page Options for PM Applications
Application | Description | Notes |
---|---|---|
DosSetProcessCp | Set code page for this process (keyboard/display not changed). | Either of the two ASCII code pages specified in CONFIG.SYS. Code page 1004 is also supported. |
WinQueryCpList | Query list of supported code pages. | Any supported ASCII or EBCDIC code page as reported by WinQueryCpList. Code page 1004 is also supported. |
WinSetCp, WinQueryCp | Set or query code page for translating incoming messages (keystrokes). | Either of the two ASCII code pages specified in CONFIG.SYS. Code page 1004 is also supported. |
GpiSetCp, GpiQueryCp | Set or query default GPI code page. | Any supported ASCII or EBCDIC code page as reported by WinQueryCpList. Code page 1004 is also supported. |
GpiCreateLogFont | Create font in a code page. | Any supported ASCII or EBCDIC code page as reported by WinQueryCpList. Code page 1004 is also supported. |
WinCpTranslateChar, WinCpTranslateString | Convert character or string from one code page to another. | Any supported ASCII or EBCDIC code page as reported by WinQueryCpList. Code page 1004 is also supported. |
Components affected:
- CONFIG.SYS contains the default code page set by CODEPAGE=
- Keyboard
- Message queue
- Display
- Disk
- LAN or host
OS/2 Font Support for Multiple Code Pages
The operating system supports multiple code pages for text input and output. A single font resource is used to support all the code pages. This section describes the font resource format.
Font Code-Page Functions
Many of the characters required by each code page are common; for example, the first 128 characters of all the ASCII code pages are identical. This set of characters is called the Universal Glyph List (UGL). A code page is simply a set of pointers into the UGL.
As the characters in every font are in the same order, only one set of code-page translation tables is necessary.
Note: The fonts of Microsoft Windows support only code page 1004.
Font Layout
The following table lists the full character set in the order in which the characters occur in the multi-code-page font. Characters are listed in order of their universal glyph list (UGL) number; the graphic character global identifier (GCGID) and a description of each character are also given.
UGL | GCGID | Description |
---|---|---|
0 | S0000000 | Smiling face |
1 | S0100000 | Smiling face, reverse image |
2 | S0200000 | Heart suit symbol |
3 | S0300000 | Diamond suit symbol |
4 | S0400000 | Club suit symbol |
5 | S0500000 | Spade suit symbol |
6 | M5700000 | Bullet |
7 | M5700001 | Bullet, reverse image |
8 | M7500000 | Open circle |
9 | M7500002 | Open circle, reverse image |
10 | M2800000 | Male symbol |
11 | M2900000 | Female symbol |
12 | M9300000 | Musical note |
13 | M9100000 | Two musical notes |
14 | M6900000 | Sun symbol |
15 | M5900000 | Forward arrow indicator |
16 | M6300000 | Back arrow indicator |
17 | M7600000 | Up-down arrow |
18 | P3300000 | Double exclamation point |
19 | M2500000 | Paragraph symbol (USA) |
20 | M2400000 | Section symbol (USA), paragraph (Europe) |
21 | M7000000 | Solid horizontal rectangle |
22 | M7700000 | Up-down arrow, perpendicular |
23 | M3200000 | Up arrow |
24 | M3300000 | Down arrow |
25 | M3100000 | Right arrow |
26 | M3000000 | Left arrow |
27 | A4200000 | Right angle symbol |
28 | M7800000 | Left-right arrow |
29 | M6000000 | Solid triangle |
30 | V0400000 | Solid triangle, inverted |
31 | P0100000 | Space |
32 | P0200000 | Exclamation point |
33 | P0400000 | Quotation marks |
34 | M0100000 | Number sign |
35 | C0300000 | Dollar sign |
36 | M0200000 | Percent sign |
37 | M0300000 | Ampersand |
38 | P0500000 | Apostrophe |
39 | P0600000 | Left parenthesis |
40 | P0700000 | Right parenthesis |
41 | M0400000 | Asterisk |
42 | A0100000 | Plus sign |
43 | P0800000 | Comma |
44 | P1000000 | Hyphen/minus sign |
45 | P1100000 | Period/full stop |
46 | P1200000 | Slash |
47 | D1000000 | Zero |
48 | D0100000 | One |
49 | D0200000 | Two |
50 | D0300000 | Three |
51 | D0400000 | Four |
52 | D0500000 | Five |
53 | D0600000 | Six |
54 | D0700000 | Seven |
55 | D0800000 | Eight |
56 | D0900000 | Nine |
57 | P1300000 | Colon |
58 | P1400000 | Semicolon |
59 | A0300000 | Less than sign/greater than (arabic) |
60 | A0400000 | Equal Sign |
61 | A0500000 | Greater than sign/less than (arabic) |
62 | P1500000 | Question mark |
63 | M0500000 | At sign |
64 | A0200000 | A capital |
65 | B0200000 | B capital |
66 | C0200000 | C capital |
67 | D0200000 | D capital |
68 | E0200000 | E capital |
69 | F0200000 | F capital |
70 | G0200000 | G capital |
71 | H0200000 | H capital |
72 | I0200000 | I capital |
73 | J0200000 | J capital |
74 | K0200000 | K capital |
75 | L0200000 | L capital |
76 | M0200000 | M capital |
77 | N0200000 | N capital |
78 | O0200000 | O capital |
79 | P0200000 | P capital |
80 | Q0200000 | Q capital |
81 | R0200000 | R capital |
82 | S0200000 | S capital |
83 | T0200000 | T capital |
84 | U0200000 | U capital |
85 | V0200000 | V capital |
86 | W0200000 | W capital |
87 | X0200000 | X capital |
88 | Y0200000 | Y capital |
89 | Z0200000 | Z capital |
90 | M0600000 | Left bracket |
91 | M0700000 | Backslash |
92 | M0800000 | Right bracket |
93 | D1500000 | Circumflex Accent |
94 | P0900000 | Underline, continuous underscore |
95 | D1300000 | Grave accent |
96 | A0100000 | a small |
97 | B0100000 | b small |
98 | C0100000 | c small |
99 | D0100000 | d small |
100 | E0100000 | e small |
101 | F0100000 | f small |
102 | G0100000 | g small |
103 | H0100000 | h small |
104 | I0100000 | i small |
105 | J0100000 | j small |
106 | K0100000 | k small |
107 | L0100000 | l small |
108 | M0100000 | m small |
109 | N0100000 | n small |
110 | O0100000 | o small |
111 | P0100000 | p small |
112 | Q0100000 | q small |
113 | R0100000 | r small |
114 | S0100000 | s small |
115 | T0100000 | t small |
116 | U0100000 | u small |
117 | V0100000 | v small |
118 | W0100000 | w small |
119 | X0100000 | x small |
120 | Y0100000 | y small |
121 | Z0100000 | z small |
122 | M1100000 | Left brace |
123 | M1300000 | Vertical line, logical OR |
124 | M1400000 | Right brace |
125 | D1900000 | Tilde |
126 | M7900000 | Mouse |
127 | C4200000 | C cedilla capital |
128 | U1700000 | u diaeresis small |
129 | E1100000 | e acute small |
130 | A1500000 | a circumflex small |
131 | A1700000 | a diaeresis small |
132 | A1300000 | a grave small |
133 | A2700000 | a overcircle small |
134 | C4100000 | c cedilla small |
135 | E1500000 | e circumflex small |
136 | E1700000 | e diaeresis small |
137 | E1300000 | e grave small |
138 | I1700000 | i diaeresis small |
139 | I1500000 | i circumflex small |
140 | I1300000 | i grave small |
141 | A1800000 | A diaeresis capital |
142 | A2800000 | A overcircle capital |
143 | E1200000 | E acute capital |
144 | A5100000 | ae diphthong small |
145 | A5200000 | AE diphthong capital |
146 | O1500000 | o circumflex small |
147 | O1700000 | o diaeresis small |
148 | O1300000 | o grave small |
149 | U1500000 | u circumflex small |
150 | U1300000 | u grave small |
151 | Y1700000 | y diaeresis small |
152 | O1800000 | O diaeresis capital |
153 | U1800000 | U diaeresis capital |
154 | O6100000 | o slash small |
155 | C0200000 | Pound sterling sign |
156 | O6200000 | O slash capital |
157 | A0700000 | Multiply sign |
158 | C0700000 | Florin sign |
159 | A1100000 | a acute small |
160 | I1100000 | i acute small |
161 | O1100000 | o acute small |
162 | U1100000 | u acute small |
163 | N1900000 | n tilde small |
164 | N2000000 | N tilde capital |
165 | M2100000 | Ordinal indicator, feminine |
166 | M2000000 | Ordinal indicator, masculine |
167 | P1600000 | Question mark, inverted |
168 | M5300000 | Registered trademark symbol |
169 | M6600000 | Logical NOT, end of line symbol |
170 | F0100000 | One-half |
171 | F0400000 | One-quarter |
172 | P0300000 | Exclamation point, inverted |
173 | P1700000 | Left angled quotes |
174 | P1800000 | Right angled quotes |
175 | F1400000 | Fill character, light |
176 | F1500000 | Fill character, medium |
177 | F1600000 | Fill character, heavy |
178 | F1100000 | Center box bar vertical |
179 | F0900000 | Right middle box side |
180 | A1200000 | A acute capital |
181 | A1600000 | A circumflex capital |
182 | A1400000 | A grave capital |
183 | M5200000 | Copyright symbol |
184 | F2300000 | Right box side double |
185 | F2400000 | Center box bar vertical double |
186 | F2500000 | Upper right box corner double |
187 | F2600000 | Lower right box corner double |
188 | C0400000 | Cent sign |
189 | C0500000 | Yen sign |
190 | F0300000 | Upper right box corner |
191 | F0200000 | Lower left box corner |
192 | F0700000 | Middle box bottom |
193 | F0600000 | Middle box top |
194 | F0800000 | Left middle box side |
195 | F1000000 | Center box bar horizontal |
196 | F0500000 | Box intersection |
197 | A1900000 | a tilde small |
198 | A2000000 | A tilde capital |
199 | F3800000 | Lower left box corner double |
200 | F3900000 | Upper left box corner double |
201 | F4000000 | Middle box bottom double |
202 | F4100000 | Middle box top double |
203 | F4200000 | Left box side double |
204 | F4300000 | Center box bar horizontal double |
205 | F4400000 | Box intersection double |
206 | C0100000 | International currency symbol |
207 | D6300000 | eth Icelandic small |
208 | D6200000 | Eth stroke capital, Eth Icelandic capital |
209 | E1600000 | E circumflex capital |
210 | E1800000 | E diaeresis capital |
211 | E1400000 | E grave capital |
212 | I6100000 | i dotless small |
213 | I1200000 | I acute capital |
214 | I1600000 | I circumflex capital |
215 | I1800000 | I diaeresis capital |
216 | F0400000 | Lower right box corner |
217 | F0100000 | Upper left box corner |
218 | F6100000 | Solid fill character |
219 | F5700000 | Solid fill character, bottom half |
220 | M6500000 | Vertical line, broken |
221 | I1400000 | I grave capital |
222 | F6000000 | Solid fill character, top half |
223 | O1200000 | O acute capital |
224 | S6100000 | Sharp s small |
225 | O1600000 | O circumflex capital |
226 | O1400000 | O grave capital |
227 | O1900000 | o tilde small |
228 | O2000000 | O tilde capital |
229 | M1700000 | Micro symbol |
230 | T6300000 | Thorn Icelandic small |
231 | T6400000 | Thorn Icelandic capital |
232 | U1200000 | U acute capital |
233 | U1600000 | U circumflex capital |
234 | U1400000 | U grave capital |
235 | Y1100000 | y acute small |
236 | Y1200000 | Y acute capital |
237 | M1500000 | Overline |
238 | D1100000 | Acute accent |
239 | P3200000 | Syllable hyphen |
240 | A0200000 | Plus or minus sign |
241 | M1000000 | Double underscore |
242 | F0500000 | Three-quarters |
243 | M2500000 | Paragraph symbol (USA) |
244 | M2400000 | Section symbol (USA), paragraph (Europe) |
245 | A0600000 | Divide sign |
246 | D4100000 | Cedilla (or sedila) accent |
247 | M1900000 | Degree symbol |
248 | D1700000 | Diaeresis, umlaut accent |
249 | D6300000 | Middle dot |
250 | D0110000 | One superscript |
251 | D0310000 | Three superscript |
252 | D0210000 | Two superscript |
253 | M4700000 | Solid square, histogram, square bullet |
254 | P3000000 | Required space |
255 | C0600000 | Peseta sign |
256 | M6800000 | Start of line symbol |
257 | F1900000 | Right box side double to single |
258 | F2000000 | Right box side single to double |
259 | F2100000 | Upper right box corner single to double |
260 | F2200000 | Upper right box corner double to single |
261 | F2700000 | Lower right box corner single to double |
262 | F2800000 | Lower right box corner double to single |
263 | F3600000 | Left box side single to double |
264 | F3700000 | Left box side double to single |
265 | F4500000 | Middle box bottom single to double |
266 | F4600000 | Middle box bottom double to single |
267 | F4700000 | Middle box top double to single |
268 | F4800000 | Middle box top single to double |
269 | F4900000 | Lower left box corner double to single |
270 | F5000000 | Lower left box corner single to double |
271 | F5100000 | Upper left box corner single to double |
272 | F5200000 | Upper left box corner double to single |
273 | F5300000 | Box intersection single to double |
274 | F5400000 | Box intersection double to single |
275 | F5800000 | Solid fill character, left half |
276 | F5900000 | Solid fill character, right half |
277 | A0100000 | Alpha small |
278 | G0200000 | Gamma capital |
279 | P0100000 | Pi small |
280 | S0200000 | Sigma capital |
281 | S0100000 | Sigma small |
282 | T0100000 | Tau small |
283 | F0200000 | Phi capital |
284 | T6200000 | Theta capital |
285 | O3200000 | Omega capital |
286 | D0100000 | Delta small |
287 | A4500000 | Infinity symbol |
288 | F0100000 | Phi small |
289 | E0100000 | Epsilon small |
290 | A3800000 | Intersection, logical product |
291 | A4800000 | Identity symbol, almost equal |
292 | A5300000 | Greater than or equal sign |
293 | A5200000 | Less than or equal sign |
294 | S2600000 | Upper integral symbol section |
295 | S2700000 | Lower integral symbol section |
296 | A7000000 | Nearly equals symbol |
297 | A7900000 | Product dot |
298 | A8000000 | Radical symbol |
299 | N0110000 | n small superscript |
300 | D3100000 | Macron accent |
301 | D2300000 | Breve accent |
302 | D2900000 | Overdot accent (over small Alpha) |
303 | D2700000 | Overcircle accent |
304 | D2500000 | Double acute accent |
305 | D4300000 | Ogonek accent |
306 | D2100000 | Caron accent |
307 | P1900000 | Left single quote |
308 | P2000000 | Right single quote |
309 | P2100000 | Left double quotes |
310 | P2200000 | Right double quotes |
311 | S6800000 | Ndash |
312 | M9000000 | Mdash |
313 | D1500000 | Circumflex accent |
314 | D1900000 | Tilde accent |
315 | P2600000 | Single quote on baseline (German lower) |
316 | P2300000 | Left lower double quotes |
317 | V5200000 | Ellipsis |
318 | M3400000 | Dagger footnote indicator |
319 | M3500000 | Double dagger footnote indicator |
320 | D1501000 | Circumflex accent (over small alpha) |
321 | M5600000 | Permille symbol |
322 | S2200000 | S caron capital |
323 | P2700000 | French single open quote |
324 | O5200000 | OE ligature capital |
325 | D1901000 | Tilde accent (over small alpha) |
326 | M5400000 | Trademark symbol |
327 | S2100000 | s caron small |
328 | P2800000 | French single close quote |
329 | O5100000 | oe ligature small |
330 | Y1800000 | Y diaeresis capital |
331 | G2300000 | Breve Small |
332 | G2400000 | Breve Capital |
333 | I3000000 | Overdot Capital |
334 | S4100000 | Cedilla Small |
335 | S4200000 | Cedilla Capital |
336 | A2300000 | Breve Small |
337 | A2400000 | Breve Capital |
338 | A4300000 | Ogonek Small |
339 | A4400000 | Ogonek Capital |
340 | C1100000 | Acute Small |
341 | C1200000 | Acute Capital |
342 | C2100000 | Caron Small |
343 | C2200000 | Caron Capital |
344 | D2100000 | Caron Small |
345 | D2200000 | Caron Capital |
346 | D6100000 | Stroke Small |
347 | E2100000 | Caron Small |
348 | E2200000 | Caron Capital |
349 | E4300000 | Ogonek Small |
350 | E4400000 | Ogonek Capital |
351 | L1100000 | Acute Small |
352 | L1200000 | Acute Capital |
353 | L2100000 | Caron Small |
354 | L2200000 | Caron Capital |
355 | L6100000 | Stroke Small |
356 | L6200000 | Stroke Capital |
357 | N1100000 | Acute Small |
358 | N1200000 | Acute Capital |
359 | N2100000 | Caron Small |
360 | N2200000 | Caron Capital |
361 | O2500000 | Double Acute Small |
362 | O2600000 | Double Acute Capital |
363 | R1100000 | Acute Small |
364 | R1200000 | Acute Capital |
365 | R2100000 | Caron Small |
366 | R2200000 | Caron Capital |
367 | S1100000 | Acute Small |
368 | S1200000 | Acute Capital |
369 | T2100000 | Caron Small |
370 | T2200000 | Caron Capital |
371 | T4100000 | Cedilla Small |
372 | T4200000 | Cedilla Capital |
373 | U2500000 | Double Acute Small |
374 | U2600000 | Double Acute Capital |
375 | U2700000 | Overcircle Small |
376 | U2800000 | Overcircle Capital |
377 | Z1100000 | Acute Small |
378 | Z1200000 | Acute Capital |
379 | Z2100000 | Caron Small |
380 | Z2200000 | Caron Capital |
381 | Z2900000 | Overdot Small |
382 | Z3000000 | Overdot Capital |
Fonts Supplied with the OS/2 Operating System
OS/2 outline fonts and Presentation Manager bit map fonts are supplied by the operating system.
OS/2 Outline Fonts
The following Adobe Type 1 fonts are supplied with OS/2:
Family Name | Face Name |
---|---|
Times New Roman | Times New Roman |
Times New Roman Bold | |
Times New Roman Bold Italic | |
Times New Roman Italic | |
Helvetica | Helvetica |
Helvetica Bold | |
Helvetica Bold Italic | |
Helvetica Italic | |
Courier | Courier |
Courier Bold | |
Courier Bold Italic | |
Courier Italic | |
Symbol | Symbol |
The Courier, Tms Rmn, and Swiss family fonts that were supplied with OS/2 release 1.1 and 1.2 are no longer supplied. Using one of the old names results in one of the new fonts listed above being used, as follows:
- Roman/Tms Rmn: Times New Roman
- Swiss/Helv: Helvetica
These fonts are provided in an efficient binary format for use by the OS/2 Adobe Type Manager. They are also provided in standard Type 1 format (PFB and AFM) for use with the OS/2 PostScript printer device driver.
Presentation Manager Bit Map Fonts
The following tables list all system bit map fonts available using the Graphics Programming Interface. The first table applies to hardware that does not conform to the International Standards Organization (ISO) 9241. The second table lists the fonts supplied with OS/2 for IBM hardware that does conform to ISO 9241.
During system installation, the operating system determines the type of display adapter available on your computer and installs only the fonts which match the device resolution. Since additional device bit map fonts may be available on specific devices, you may have to install the correct bit map fonts if you change your display device after the operating system is installed.
Fonts Supplied for ISO 9241 Non-Conforming Hardware
The following information for each font is included in the table:
- **Points**: This is the point size of the font, on a device whose resolution matches that of the font (see Device below).
- **Ave Wid**: This is the average width in pels of alphabetic characters weighted according to US English letter frequencies.
- **Max Wid**: This is the maximum width in pels of all characters in the font. This field is not necessarily the maximum width of any character in the code page. It could be used to ensure that the horizontal space allocated on a display or printer is big enough to handle any character.
- **Height**: This is the height in pels of the font. This is the minimum number of rows of pels needed to output any character of the font on a given baseline. This field may be larger than necessary for a given code page. It could be used to ensure that the vertical space allocated on a display or printer is big enough to handle any character.
- **Device**: This is the X and Y resolution in pels per inch at which the font is intended to be used. Only those fonts which match the device resolution of the installed display driver are available on the system. If the installed display is changed, the install process will reinstall the proper font sets for the new adapter. The IBM devices whose device drivers report these resolutions are:
* 96 x 48 CGA * 96 x 72 EGA * 96 x 96 VGA and XGA (in 640 x 480 mode) * 120 x 120 8514/A and XGA (in 1024 x 768 mode)
Note: These values are approximate representations of the actual resolution, which in the case of displays depends on which monitor is attached. Consequently, the point size of characters on the screen is also approximate.
The following table applies to hardware that does not conform to ISO 9241:
Family | Face Name | Points | Ave Wid | Max Wid | Height | Device |
---|---|---|---|---|---|---|
Courier | Courier | 8 | 6 | 10 | 11 | 96x48 |
8 | 6 | 10 | 10 | 96x72 | ||
8 | 6 | 10 | 13 | 96x96 | ||
8 | 8 | 12 | 16 | 120x120 | ||
10 | 6 | 10 | 11 | 96x48 | ||
10 | 6 | 10 | 12 | 96x72 | ||
10 | 6 | 10 | 16 | 96x96 | ||
10 | 8 | 12 | 20 | 120x120 | ||
12 | 8 | 12 | 10 | 96x48 | ||
12 | 8 | 12 | 15 | 96x72 | ||
12 | 8 | 12 | 20 | 96x96 | ||
12 | 10 | 15 | 25 | 120x120 | ||
System Proportional | System Proportional | 8 | 6 | 10 | 11 | 96x48 |
10 | 6 | 10 | 12 | 96x96 | ||
10 | 6 | 13 | 16 | 96x96 | ||
10 | 6 | 13 | 20 | 120x120 | ||
11 | 10 | 13 | 13 | 120x120 | ||
System Monospaced | System Monospaced | 8 | 6 | 10 | 11 | 96x48 |
10 | 6 | 10 | 12 | 96x72 | ||
10 | 6 | 10 | 16 | 96x96 | ||
10 | 6 | 10 | 20 | 120x120 | ||
Helv | Helv | 8 | 6 | 13 | 11 | 96x48 |
8 | 6 | 13 | 10 | 96x72 | ||
8 | 6 | 13 | 13 | 96x96 | ||
8 | 8 | 14 | 16 | 120x120 | ||
10 | 6 | 15 | 11 | 96x48 | ||
10 | 6 | 14 | 12 | 96x72 | ||
10 | 6 | 14 | 16 | 96x96 | ||
10 | 8 | 20 | 20 | 120x120 | ||
12 | 8 | 17 | 10 | 96x48 | ||
12 | 8 | 17 | 15 | 96x72 | ||
12 | 8 | 17 | 20 | 96x96 | ||
12 | 10 | 21 | 25 | 120x120 | ||
18 | 11 | 26 | 15 | 96x48 | ||
18 | 10 | 26 | 22 | 96x72 | ||
18 | 11 | 26 | 29 | 96x96 | ||
18 | 13 | 34 | 36 | 120x120 | ||
24 | 14 | 35 | 19 | 96x48 | ||
24 | 14 | 35 | 28 | 96x72 | ||
24 | 14 | 35 | 37 | 96x96 | ||
24 | 18 | 56 | 49 | 120x120 | ||
Tms Rmn | Tms Rmn | 8 | 6 | 12 | 11 | 96x48 |
8 | 6 | 13 | 10 | 96x72 | ||
8 | 6 | 12 | 13 | 96x96 | ||
8 | 8 | 14 | 16 | 120x120 | ||
10 | 6 | 15 | 11 | 96x48 | ||
10 | 6 | 14 | 12 | 96x72 | ||
10 | 6 | 14 | 16 | 96x96 | ||
10 | 8 | 19 | 20 | 120x120 | ||
12 | 8 | 18 | 10 | 96x48 | ||
12 | 8 | 18 | 15 | 96x72 | ||
12 | 8 | 16 | 19 | 96x96 | ||
12 | 10 | 23 | 23 | 120x120 | ||
14 | 10 | 21 | 11 | 96x48 | ||
14 | 10 | 21 | 16 | 96x72 | ||
14 | 10 | 20 | 21 | 96x96 | ||
14 | 14 | 26 | 27 | 120x120 | ||
18 | 10 | 26 | 14 | 96x48 | ||
18 | 10 | 26 | 20 | 96x72 | ||
18 | 10 | 26 | 27 | 96x96 | ||
18 | 12 | 34 | 33 | 120x120 | ||
24 | 14 | 35 | 18 | 96x48 | ||
24 | 13 | 35 | 26 | 96x72 | ||
24 | 13 | 35 | 35 | 96x96 | ||
24 | 16 | 56 | 43 | 120x120 |
Fonts Supplied for ISO 9241 Conforming Hardware
The following table lists the fonts and sizes that have been tested and certified as passing the ISO 9241 black text on white background criteria for the three IBM displays that conform to the standard. These displays are:
- 9515 - A 14 inch XGA display.
- 9517 - A 17 inch XGA display.
- 9518 - A 14 inch VGA display.
See International Standards Organization (ISO) 9241 for information on ISO 9241.
The following information about each font is also included in the table:
- P: The point size of the font.
- AW: The average character width in pels in the font.
- MW: The maximum character width in pels in the font.
- HE: The height in pels of the font (maximum baseline extent).
- Device: The X and Y resolution in pels per inch on the device the font is intended to be used. The IBM devices whose device drivers report these resolutions are:
* 96 x 96 VGA and XGA (in 640 x 480 mode) * 120 x 120 XGA (in 1024 x 768 mode)
Family | Face Name | P | AW | MW | HE | Device | 9515 | 9517 | 9518 |
---|---|---|---|---|---|---|---|---|---|
Courier | Courier ISO | 8 | 8 | 8 | 13 | 96x96 | No | No | No |
8 | 10 | 10 | 16 | 120x120 | No | No | n/a | ||
9 | 8 | 8 | 15 | 96x96 | Yes | Yes | Yes | ||
10 | 10 | 10 | 16 | 96x96 | Yes | Yes | Yes | ||
10 | 12 | 12 | 20 | 120x120 | No | No | n/a | ||
12 | 12 | 12 | 20 | 96x96 | Yes | Yes | Yes | ||
12 | 15 | 15 | 25 | 120x120 | Yes | Yes | n/a | ||
Helv | Helv ISO | 8 | 5 | 13 | 13 | 96x96 | No | No | No |
8 | 7 | 14 | 16 | 120x120 | No | No | n/a | ||
9 | 6 | 13 | 15 | 96x96 | Yes | Yes | Yes | ||
9 | 8 | 20 | 21 | 120x120 | Yes | Yes | n/a | ||
10 | 7 | 14 | 16 | 96x96 | Yes | Yes | Yes | ||
10 | 9 | 20 | 21 | 120x120 | Yes | Yes | n/a | ||
12 | 9 | 17 | 20 | 96x96 | Yes | Yes | Yes | ||
12 | 10 | 21 | 25 | 120x120 | Yes | Yes | n/a | ||
14 | 10 | 21 | 24 | 96x96 | Yes | Yes | Yes | ||
14 | 12 | 26 | 29 | 120x120 | Yes | Yes | n/a | ||
18 | 12 | 26 | 29 | 96x96 | Yes | Yes | Yes | ||
18 | 15 | 34 | 36 | 120x120 | Yes | Yes | n/a | ||
24 | 14 | 34 | 36 | 96x96 | Yes | Yes | Yes | ||
24 | 19 | 45 | 46 | 120x120 | Yes | Yes | n/a | ||
Tms Rmn | Tms Rmn ISO | 8 | 5 | 12 | 13 | 96x96 | No | No | No |
8 | 7 | 15 | 16 | 120x120 | No | No | n/a | ||
9 | 6 | 12 | 15 | 96x96 | Yes | Yes | Yes | ||
10 | 7 | 14 | 16 | 96x96 | Yes | Yes | Yes | ||
10 | 8 | 17 | 19 | 120x120 | No | Yes | n/a | ||
12 | 8 | 16 | 19 | 96x96 | Yes | Yes | Yes | ||
12 | 10 | 23 | 22 | 120x120 | Yes | Yes | n/a | ||
14 | 9 | 23 | 22 | 96x96 | Yes | Yes | Yes | ||
14 | 11 | 26 | 27 | 120x120 | Yes | Yes | n/a | ||
18 | 11 | 26 | 27 | 96x96 | Yes | Yes | Yes | ||
18 | 14 | 34 | 34 | 120x120 | Yes | Yes | n/a | ||
24 | 14 | 34 | 34 | 96x96 | Yes | Yes | Yes | ||
24 | 17 | 46 | 43 | 120x120 | Yes | Yes | n/a | ||
System Proportional | System Proportional | 9 | 6 | 13 | 15 | 96x96 | Yes | Yes | Yes |
10 | 6 | 20 | 16 | 96x96 | Yes | Yes | Yes | ||
10 | 8 | 23 | 20 | 120x120 | No | Yes | n/a | ||
12 | 10 | 23 | 22 | 120x120 | Yes | Yes | n/a | ||
System Monospaced | System Monospaced | 10 | 8 | 8 | 16 | 96x96 | Yes | Yes | Yes |
10 | 10 | 10 | 21 | 120x120 | Yes | Yes | n/a |
See International Standards Organization (ISO) 9241 for more information on ISO 9241.
International Standards Organization (ISO) 9241
ISO 9241 is an international standard covering health and safety in the workplace for users of visual display terminals. Part 3 of this standard covers clarity and legibility of text displayed on computer screens; it places requirements on minimum sizes and luminance contrast. The presence of the FM_SEL_ISO9241_TESTED flag in the FONTMETRICS structure indicates that the font has been tested for ISO compliance.
Note: While the fonts were primarily tested for meeting the ISO standard, they have also been designed to meet the German standard DIN 66 234. Where the two standards differ, the fonts have been designed to meet the stricter requirement.
The FM_ISO_xxx flags indicate the results of the test on the three IBM displays that conform to the standard. These are the IBM 9515, 9517, and 9518 color displays at the supported resolutions of 640 x 480 and 1024 x 768. To determine whether a non-IBM display complies with ISO 9241, contact the manufacturer. The current display type can be established using VioGetConfig.
In order for applications to meet the standard, they have to ensure that they use only fonts that have been tested and passed. You can determine this by examining the new FM_SEL_ISO9241_TESTED flag in the fsSelection parameter in the FONTMETRICS structure, the FM_ISO_xxx flags, and the sXDeviceRes and sYDeviceRes fields in the structure.
See Fonts Supplied with the OS/2 Operating System for the table describing ISO 9241 compliant fonts.
Initialization File Information
Initialization files include information about printers, queues, and system preferences set by the user from the control panel. Applications can query this information by using the PrfQueryProfileData
, PrfQueryProfileInt
, PrfQueryProfileSize
, and PrfQueryProfileString
functions.
All data in initialization files is accessed by a two-level hierarchy of application name, and key name within an application. Presentation Manager system data is keyed off "applications" that have names starting with PM_
.
The application name/key name combinations that applications may need to use are listed below, together with the definition of the corresponding data.
Note: Information that is prefixed with PM_SPOOLERxxxx
can not always be modified directly: The spooler validates all attempts to write information to the INI file that it depends on.
- Application name
- "PM_ControlPanel"
- Key name
- "Beep"
- Type
- integer
- Content/value
- 1 or 0.
- Application name
- "PM_ControlPanel"
- Key name
- "LogoDisplayTime"
- Type
- integer
- Content/value
- -1 $\le$ time $\le$ 32767 milliseconds.
- Indefinite display: -1
- No display: 0
- Timed display: >0
- Application name
- "PM_ControlPanel"
- Key name
- "cxDoubleClick"
- Type
- integer
- Content/value
SV_CXDBLCLK
size in pels.
- Application name
- "PM_ControlPanel"
- Key name
- "cyDoubleClick"
- Type
- integer
- Content/value
SV_CYDBLCLK
size in pels.
- Application name
- "PM_ControlPanel"
- Key name
- "cxMotionStart"
- Type
- integer
- Content/value
SV_CXMOTIONSTART
size in pels.
- Application name
- "PM_ControlPanel"
- Key name
- "cyMotionStart"
- Type
- integer
- Content/value
SV_CYMOTIONSTART
size in pels.
- Application name
- "PM_National"
- Key name
- "iCountry"
- Type
- integer
- Content/value
- country code:
- Arabic: 785
- Australian: 61
- Belgian: 32
- Canadian-French: 2
- Danish: 45
- Finnish: 358
- French: 33
- German: 49
- Hebrew: 972
- Italian: 39
- Japanese: 81
- Korean: 82
- Latin-American: 3
- Netherlands: 31
- Norwegian: 47
- Portuguese: 351
- Simpl. Chinese: 86
- Spanish: 34
- Swedish: 46
- Swiss: 41
- Trad. Chinese: 88
- UK-English: 44
- US-English: 1
- Other country: 0.
- Application name
- "PM_National"
- Key name
- "iDate"
- Type
- integer
- Content/value
- 0=MDY; 1=DMY; 2=YMD.
- Application name
- "PM_National"
- Key name
- "iCurrency"
- Type
- integer
- Content/value
- Values have the following meanings:
- 0: Prefix, no separator
- 1: Suffix, no separator
- 2: Prefix, 1 character separator
- 3: Suffix, 1 character separator.
- Application name
- "PM_National"
- Key name
- "iDigits"
- Type
- integer
- Content/value
- n = number of decimal digits.
- Application name
- "PM_National"
- Key name
- "iTime"
- Type
- integer
- Content/value
- 0 = 12-hour clock; 1 = 24-hour clock.
- Application name
- "PM_National"
- Key name
- "iLzero"
- Type
- integer
- Content/value
- 0 = no leading zero; 1 = leading zero.
- Application name
- "PM_National"
- Key name
- "s1159"
- Type
- string
- Content/value
- "am" for example. 3 chars max.
- Application name
- "PM_National"
- Key name
- "s2359"
- Type
- string
- Content/value
- "pm" for example. 3 chars max.
- Application name
- "PM_National"
- Key name
- "sCurrency"
- Type
- string
- Content/value
- "$" for example. 3 chars max.
- Application name
- "PM_National"
- Key name
- "sThousand"
- Type
- string
- Content/value
- "," for example. 1 char max.
- Application name
- "PM_National"
- Key name
- "sDecimal"
- Type
- string
- Content/value
- "." for example. 1 char max.
- Application name
- "PM_National"
- Key name
- "sDate"
- Type
- string
- Content/value
- "/" for example. 1 char max.
- Application name
- "PM_National"
- Key name
- "sTime"
- Type
- string
- Content/value
- ":" for example. 1 char max.
- Application name
- "PM_National"
- Key name
- "sList"
- Type
- string
- Content/value
- "," for example. 1 char max.
- Application name
PM_Fonts
- Key name
<Font module name>
- Type
- string
- Content/value
fully-qualified drive:\path\filename.ext
.
- Application name
- "PM_SPOOLER"
- Key name
- "QUEUE"
- Type
- string
- Content/value
<Queue name>
;- where:
<Queue name>
is the name of the default queue (might be NULL).
This must be a key name for the PM_SPOOLER_QUEUE
application.
- Application name
- "PM_SPOOLER"
- Key name
- " PRINTER"
- Type
- string
- Content/value
<Printer name>
;- where:
<Printer name>
is the name of the default printer (might be NULL).
Note: Use the SplQueryDevice
and SplQueryQueue
functions to retrieve the spooler configuration data.
Interchange File Format
A metafile is a file in which graphics are stored. The file is application-created, and it contains the graphics orders generated from those GPI calls that are valid in a metafile. Metafiled graphics can be reused by the application that created them. They can also be made available to other applications at the same, or at a different, workstation.
This section describes the restrictions which apply when generating the metafile and gives detail of the overall structure. For the graphics orders descriptions, see "Graphics Orders" in the Graphics Programming Interface Programming Reference.
Metafile Restrictions
The following restrictions apply to the generation of all metafiles, and also to the generation of a PM_Q_STD print file to a device:
- If GpiWCBitBlt or GpiBitBlt is used to copy a bit map to a device context in an application, the application should not delete that bit map handle with GpiDeleteBitmap before the device context is closed (metafile is closed).
- GpiSetPS must not be used.
- GpiSetPageViewport is ignored.
The following section lists some general rules that must be followed when creating a metafile that is to be acceptable to SAA-conforming implementations, or replayed into a presentation space that is in draw-and-retain or retain mode (see "GpiSetDrawingMode" in Graphics Programming Interface Programming Reference).
- These items must be established or defaulted before any drawing occurs to the graphics presentation space, and not changed subsequently:
* The graphics field (GpiSetGraphicsField). For an SAA-conforming metafile, the graphics field must be defaulted or set to no clipping. * The code page for the default character set (GpiSetCp). * The color table or palette (GpiCreateLogColorTable or GpiCreatePalette). The size of the color table must not exceed 31KB (KB equals 1024 bytes). * The default viewing transform (GpiSetDefaultViewMatrix). * The setting of the draw controls (GpiSetDrawControl). DCTL_DISPLAY must be defaulted or set ON. * The default values of attributes (see "GpiSetDefAttrs" in the Graphics Programming Interface Programming Reference), viewing limits (see "GpiSetDefViewingLimits" in the Graphics Programming Interface Programming Reference), primitive tag (see "GpiSetDefTag" in the Graphics Programming Interface Programming Reference) and arc parameters (see "GpiSetDefArcParams" in the Graphics Programming Interface Programming Reference).
- These calls should not be used:
* GpiBitBlt * GpiDeleteSetId (note that this means that local identifiers cannot be used again within the picture) * GpiErase * GpiExcludeClipRectangle * GpiIntersectClipRectangle * GpiOffsetClipRegion * GpiPaintRegion * GpiResetPS * GpiSetClipRegion * GpiSetPel * GpiSetPS * DevEscape (for an escape which is metafiled).
- GpiCreateLogFont must not redefine a local identifier that has previously been used within the picture.
- The metafile context must not be reassociated.
- If a bit map is used as the source of a GpiWCBitBlt operation, or as an area-fill pattern, it must not be modified or deleted (GpiDeleteBitmap) before the metafile is closed.
- Only these foreground mixes must be used (see "GpiSetMix" in the Graphics Programming Interface Programming Reference):
* FM_DEFAULT * FM_OR * FM_OVERPAINT * FM_LEAVEALONE
- Only these background mixes must be used (see "GpiSetBackMix" in the Graphics Programming Interface Programming Reference):
* BM_DEFAULT * BM_OVERPAINT * BM_LEAVEALONE
- If palettes are used (see "GpiCreatePalette" in the Graphics Programming Interface Programming Reference): the palette that is metafiled is the one in force when the metafile device context is dissociated from the (final) presentation space. If the palette is changed during the course of the picture (using GpiSetPaletteEntries), it must therefore only be with incremental additions.
Note: There is no restriction concerning the use of primitives outside segments. These are metafiled in segment(s) with zero identifier.
Metafile Data Format
This section describes the format of the data in a metafile, as it would be stored in an OS/2 disk file.
Metafile data is stored as a sequence of structured fields. Each structured field starts with an eight-byte header consisting of a two-byte length field and a three-byte identifier field. These are followed by a one-byte flags field and a two-byte segment sequence number field.
The length field contains a count of the total number of bytes in the structured field, including the length field. The identifier field uniquely identifies the type of the structured field.
The flags and segment sequence number fields are always zero.
Following the header are positional parameters that are optional and dependent on the particular structured field.
Following the positional parameters are non-positional parameters called triplets. These are self-defining parameters and consist of a one-byte length field, followed by a one-byte identifier field, followed by the data of the parameter.
The length field contains a count of the total number of bytes in the triplet, including the length and identifier fields. The identifier field identifies uniquely the type of the triplet.
A metafile is structured into a number of different functional components; for example, document and graphics object. Each component comprises a number of structured fields, and is delimited by "begin-component" and "end-component" structured fields. Structured fields marked as required, inside an optional structured field bracket, are required if the containing bracket is present.
The graphics orders that describe a picture occur in the graphics data structured field. See Structured Field Formats for more information.
Structured Field Formats
Following is the format of the various structured fields:
Begin Document
Structured Field Introducer (BDT): required
- 0-1 Length 0xn+1E
- 2-4 BDT 0xD3A8A8
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Document name C'0000 0001'
- 8 Architecture version 0x00
- 9 Document security 0x00
Triplets (all required)
- 0 Length 0x05
- 1 Triplet Id 0x18
- 2 Interchange set type 0x03 (resource document)
- 3-4 Base set definition 0x0C00 (level 12, version 0)
- 0 Length 0x06
- 1 Triplet Id 0x01
- 2-5 GCID
- 0 Length 0xn+1
- 1 Triplet Id 0x65
- 2-n Comment, used for metafile description of up to 252 bytes.
Resource Files
This section describes the syntax for the resource language using railroad syntax and details the formats used. Resource files are used to build dialog templates, menu templates, accelerator tables, extended attribute association tables, keyboard scancode mapping tables, keyboard names, and fonts. These files must be compiled before they can be used by application programs.
How to Read the Syntax Definitions
Syntax is described using the following structure:
- Read the syntax diagrams from left to right, from top to bottom, following the path of the line.
- The `>>--` symbol indicates the beginning of a statement.
- The `-->` symbol indicates that the statement syntax continues on the next line.
- The `>---` symbol indicates that a statement is continued from the previous line.
- The `--><` symbol indicates the end of a statement.
- Diagrams of syntactical units other than complete statements start with the `>---` symbol and end with the `---<` symbol.
- Required items appear on the horizontal line (the main path):
>>--STATEMENT----required_item-------><
- Optional items appear below the main path:
>>--STATEMENT----------------------->< +---optional_item---+
- If a choice can be made from two or more items, they appear vertically in a stack. If one must be chosen, one item appears on the main path:
>>--STATEMENT--+--required_choice1--+--->< +--required_choice2--+
- If choosing one is optional, the entire stack appears below the main path:
>>--STATEMENT----------------------->< +--optional_choice1--+ +--optional_choice2--+
- An arrow returning to the left above the main path indicates an item that can be repeated:
+-----------------+ | | >>--STATEMENT----repeatable_item-+---><
- A repeat arrow above a stack indicates that a choice can be made from the stacked items, or a single choice can be repeated.
- Keywords appear in uppercase (e.g., `PARM1`) and must be spelled exactly as shown.
- Variables appear in lowercase letters (e.g., `parmx`) and represent user-supplied names or values.
- Punctuation marks, parentheses, arithmetic operators, or other symbols must be entered as shown.
Definitions Used in All Resources
The definitions used in all resources are outlined in the following sections.
Specification of Values
- Coordinates must be integers with no space between the sign and the value (e.g., `-1` is allowed, but `- 1` is not).
- Resource identifiers may be:
- Positive integers
- Names that resolve to positive integers
- Strings (for some resources)
- Real values containing a decimal point cannot be used.
Resource Load and Memory Options
The following options define when each resource is loaded and how memory is allocated:
- **LOADOPTION**: Resource loading options
- **PRELOAD**: Resource is loaded immediately - **LOADONCALL**: Resource is loaded when called
- **MEMOPTION**: Resource memory options
- **FIXED**: Resource remains at a fixed memory location - **MOVEABLE**: Resource can be moved to compact memory - **DISCARDABLE**: Resource can be discarded if no longer needed - **SEGALIGN**: Resources are aligned on 64K byte boundaries
Resource Script File Specification
The resource script file defines the names and attributes of resources to be added to the executable file of the application. It consists of one or more resource statements specifying the resource type and original file, if any. See the following sections for details:
- Single-Line Statements - User-Defined Resources - Directives - Multiple-Line Statements
Single-Line Statements
The general form for single-line statements is:
>>--resourcetype--nameid--+------------+--->--filename----->< +--loadoption--+ +--memoption--+
- **resourcetype (USHORT)**: One of the following keywords specifying the resource type:
- **BITMAP**: A custom bit map for screen display or menu items - **DEFAULTICON**: Installs the icon definition under the ICON EA of the program file (e.g., `DEFAULTICON <filename.ico>`) - **DLGINCLUDE**: Specifies the include file for dialogs in the resource file; `nameid` is not applicable - **FONT**: A file containing a font - **ICON**: A bit map defining the shape of an application’s icon - **POINTER**: A bit map defining the shape of the pointing device pointer
- **nameid (USHORT)**: A unique name or integer identifying the resource. For FONT, it must be a number, not a name.
- **loadoption (LOADOPTION)**: Defaults to LOADONCALL. See Resource Load and Memory Options.
- **memoption (MEMOPTION)**: Defaults to MOVEABLE and DISCARDABLE for POINTER, ICON, and FONT; MOVEABLE for BITMAP. FIXED overrides MOVEABLE and DISCARDABLE. SEGALIGN is optional and defaults to no alignment on 64KB boundaries.
- **filename (PCH)**: An ASCII string specifying the OS/2 file name. A full path is required if not in the current directory.
- Example**:
POINTER "pointer" point.cur POINTER "discardable pointer" DISCARDABLE point.cur POINTER 10 custom.cur ICON "desk" desk.ico ICON "discardable desk" DISCARDABLE desk.ico ICON 11 custom.ico BITMAP "disk" disk.bmp BITMAP "discardable disk" DISCARDABLE disk.bmp BITMAP 12 custom.bmp FONT 5 CMROMAN.FNT
User-Defined Resources
Applications can define custom resources of any data type. The statement format is:
>>--resource--typeID--nameID-------------->--filename----->< +--loadoption--+ +--memoption--+
- **typeID**: A unique name or integer (>255) identifying the resource type. Numbers 1–255 are reserved, and 1000 is for custom fonts.
- **nameID**: A unique name or integer identifying the resource.
- **loadoption (LOADOPTION)**: Defaults to LOADONCALL.
- **memoption (MEMOPTION)**: Defaults to MOVEABLE.
- **filename**: Either an OS/2 file name (with full path if needed) or a BEGIN/END data definition construct:
BEGIN data-definition [, data-definition] ... END
- Example**:
RESOURCE MYRES "array" BEGIN 13L, 26L END
When the resource compiler (RC.EXE) encounters font resources or custom resources with type-id 1000, it creates a font directory resource added to the output binary data.
- Example**:
RESOURCE MYRES "array" DATA.RES RESOURCE 300 14 CUSTOM.RES
RCDATA Statement
The RCDATA statement defines a simple data resource:
``` >>--RCDATA--id--+--loadoption--+--BEGIN--data-->--END-----><
+--memoption--+
```
- **id**: A unique name or integer identifying the resource. - **loadoption (LOADOPTION)**: Defaults to LOADONCALL. - **memoption (MEMOPTION)**: Defaults to MOVEABLE. - **data**: A number or string.
- Example**:
``` RCDATA 4 BEGIN
"Sample string." "TEST DATA." "A message."
END ```
Directives
Directives define actions to perform on the file before compilation, such as assigning values, including files, or controlling compilation.
- **#include filename** / **rcinclude filename**: Copies the contents of `filename` into the resource before compilation. `rcinclude` copies the entire file; `#include` copies only `#define` statements. If commenting out `rcinclude`, the open comment (`/*`) must be on the same line. `filename` is an ASCII string, requiring a full path if not in the current directory or INCLUDE environment variable path. Extensions `.I` and `.TMP` are reserved. Use double backslashes (`\\`) or a single forward slash (`/`) in paths.
- Example**:
```
- include "wincalls.h"
MENU PenSelect BEGIN
MENUITEM "black pen", BLACK_PEN
END ```
Files included with `#define` statements must not include casting for constants used in the resource script, as the compiler does not parse casting syntax:
```
- define IDBUTTON1 (USHORT) 3 /* Not allowed */
```
Use separate statements for C source compilation:
```
- define IDBUTTON1 3
- define CSRC_IDBUTTON1 ((USHORT)IDBUTTON1)
```
- **#define name value**: Assigns `value` to `name`, replacing all subsequent occurrences of `name`. `name` is any combination of letters, digits, or punctuation; `value` is an integer, string, or text.
- Example**:
```
- define nonzero 1
- define USERCLASS "MyControlClass"
```
- **#undef name**: Removes the definition of `name`, processing subsequent occurrences without replacement.
- Example**:
```
- undef nonzero
- undef USERCLASS
```
- **#ifdef name**: Conditionally compiles if `name` is defined, continuing with the next statement; otherwise, skips to the next `#endif`.
- Example**:
```
- ifdef Debug
FONT 4 errfont.fnt
- endif
```
- **#ifndef name**: Conditionally compiles if `name` is not defined, processing statements up to the next `#endif`, `#else`, or `#elif`, then skipping to after `#endif`. If defined, skips to the next `#endif`, `#else`, or `#elif`.
- Example**:
```
- ifndef Optimize
FONT 4 errfont.fnt
- endif
```
- **#if constant expression**: Conditionally compiles if `constant-expression` is nonzero, processing up to the next `#endif`, `#else`, or `#elif`, then skipping to after `#endif`. If zero, skips to the next `#endif`, `#else`, or `#elif`. `constant expression` is a defined name, integer, or expression with arithmetic/relational operators.
- Example**:
```
- if Version<3
FONT 4 errfont.fnt
- endif
```
- **#elif constant expression**: Marks an optional clause in a conditional block, compiling if `constant-expression` is nonzero, processing up to the next `#endif`, `#else`, or `#elif`, then skipping to after `#endif`. If zero, skips to the next `#endif`, `#else`, or `#elif`.
- Example**:
```
- if Version<3
FONT 4 italic.fnt
- elif Version<7
FONT 4 bold.fnt
- endif
```
- **#else**: Marks an optional clause in a conditional block, used as the last directive before `#endif`.
- Example**:
```
- ifdef Debug
FONT 4 italic.fnt
- else
FONT 4 bold.fnt
- endif
```
- **#endif**: Marks the end of a conditional block. One is required for each `#ifdef`, `#ifndef`, or `#if`.
Multiple-Line Statements
This section covers Code Page Flagging, Keyboard Resources, and the following statements:
- ACCELTABLE Statement - ASSOCTABLE Statement - MENU Statement - STRINGTABLE Statement - Dialog and Window Template Statements
Code Page Flagging
The CODEPAGE statement sets the code page for resources like ACCELTABLE, MENU, STRINGTABLE, DIALOGTEMPLATE, and WINDOWTEMPLATE. It cannot be encoded within other statements. All items following a CODEPAGE statement use that code page, which is encoded in the resource without checking. Supported code pages are 437, 850, 860, 863, and 865. If unspecified, code page 850 is assumed.
Keyboard Resources
- RT_FKALONG (=17)**, defined in BSEDOS.H, is recognized by the resource compiler (RC.EXE) as FKALONG. This type identifies a 256-byte table for primary or secondary scan-code mapping. The resource ID’s least significant byte indicates the type:
- 0: Primary scan-code mapping - 1: Secondary scan-code mapping
The other two bytes are 0 for primary mapping or the keyboard ID (from PMWINP.H) for secondary mapping. Both primary and secondary mapping tables are stored as resources, loaded at system initialization, and transferred to RING-0 byte arrays for interrupt handler access. A default primary table is used if the resource cannot be loaded.
ACCELTABLE Statement
The ACCELTABLE statement defines accelerator keys for quick task execution. The WinGetMsg function translates accelerator messages into WM_COMMAND, WM_HELP, or WM_SYSCOMMAND messages. The format is:
``` >>--ACCELTABLE--+--id--+-->--+--memoption--+-->--BEGIN----->
+------------------------------------+ | | +--keyval--+--cmd--+--acceloption--+-+-->--END-----><
```
- **id (USHORT)**: A unique integer (1–65535) or string in double quotes. - **memoption**: Optional keywords (FIXED, MOVEABLE, DISCARDABLE). - **keyval (USHORT)**: The accelerator character code (constant or quoted character). A quoted character assumes CHAR; a caret (^) with a quoted character specifies CONTROL. - **cmd (USHORT)**: The value of the WM_COMMAND, WM_HELP, or WM_SYSCOMMAND message. - **acceloption (BIT_16)**: Defines the accelerator type:
- ALT, CHAR, CONTROL, HELP, LONEKEY, SCANCODE, SHIFT, SYSCOMMAND, VIRTUALKEY - Only one of VIRTUALKEY, SCANCODE, LONEKEY, or CHAR can be specified. - SHIFT, CONTROL, and ALT require the corresponding key to be down. - SYSCOMMAND generates WM_SYSCOMMAND; HELP generates WM_HELP; otherwise, WM_COMMAND is used. - For conflicting accelerators (e.g., Shift-Enter vs. Enter), list the more restrictive one first.
- Example**:
``` ACCELTABLE "MainAcc" BEGIN
VK_F1, 101, HELP VK_F3, 102, SYSCOMMAND
END ```
This generates a WM_HELP (value 101) for F1 and a WM_SYSCOMMAND (value 102) for F3.
ASSOCTABLE Statement
The ASSOCTABLE statement defines extended attributes (EA) for an application:
``` >>--ASSOCTABLE--assoctableid-->--BEGIN----->
+-------------------------------------------+ | | +--assocname, extensions--+--flags--+--icon-+-->--END-----><
```
- **assoctableid**: A name or number identifying the resource. - **assocname**: The EA TYPE recognized by the program, matching the TYPE field in data files. - **extensions**: A 3-letter file extension identifying files without an EA TYPE (may be empty). - **flags**:
- **EAF_DEFAULTOWNER**: The default application for the file. - **EAF_UNCHANGEABLE**: The entry cannot be edited. - **EAF_REUSEICON**: Reuses the icon from the previous entry (no icon data defined). - Flags can be ORed together.
- **icon**: The filename of the icon for the file type (may be empty).
- Example**:
``` ASSOCTABLE 3000 BEGIN
"Product XYZ Spreadsheet", "xys", EAF_DEFAULTOWNER, xyzspr.ico "Product XYZ Chart", "xyc", EAF_DEFAULTOWNER | EAF_REUSEICON
END ```
Dialog and Window Template Statements
DLGTEMPLATE and WINDOWTEMPLATE statements create predefined window and dialog resource templates, treated identically by the resource compiler:
``` >>--+--DLGTEMPLATE--+--resourceid--+-->--+--loadoption--+-->--+--memoption--+-->--+--codepage--+-->--BEGIN--+--DIALOG statement--+-->--END-----><
+--WINDOWTEMPLATE--+ +--CONTROL statement--+ +--WINDOW statement--+
```
- **resourceid (USHORT)**: An integer (1–65535), a name resolving to an integer, or a unique string in double quotes. - **loadoption (LOADOPTION)**: Defaults to LOADONCALL. - **memoption (MEMOPTION)**: Defaults to MOVEABLE. - **codepage (USHORT)**: The code page of the template text. - Alternatively, `{` can replace BEGIN and `}` can replace END. - The DIALOG statement defines a dialog-box window:
``` >>--DIALOG--text, id, cx, cy, x, y--+--, style--+-->--+--, control--+-->--+--CTLDATA statement--+-->--+--PRESPARAMS statement--+-->--BEGIN--+--DIALOG statement--+-->--END-----><
+--, control--+ +--CONTROL statement--+ +--WINDOW statement--+
```
- The WINDOW and CONTROL statements define child windows:
``` >>--+--WINDOW--+--text, id, cx, cy, x, y, class--+-->--+--, style--+-->--+--, control--+-->--+--CTLDATA statement--+-->--+--PRESPARAMS statement--+-->--BEGIN--+--DIALOG statement--+-->--END-----><
+--CONTROL--+ +--, control--+ +--CONTROL statement--+ +--WINDOW statement--+
```
- **text (PCH)**: A string in double quotes for the title bar. Use `""` for double quotes in text. - **id (USHORT)**: Item identifier. - **x, y (SHORT)**: Coordinates of the lower-left corner in dialog coordinates, relative to the parent window, screen (FCF_SCREENALIGN), or pointer (FCF_MOUSEALIGN). - **cx, cy (SHORT)**: Width and height in dialog coordinates. - **class (PCH)**: The window/control class (fixed as WC_FRAME for DIALOG). - **style (ULONG)**: Additional styles (default: WS_SYNCPAINT | WS_CLIPSIBLINGS | WS_SAVEBITS | FS_DLGBORDER). Use `NOT` to remove FS_DLGBORDER or WS_SAVEBITS (e.g., `NOT FS_DLGBORDER | FS_BORDER`). - **control (ULONG)**: Frame creation flags (FCF_*). FCF_SHELLPOSITION has no effect in templates. - **CTLDATA**: Defines control-specific data (see Control Data Statement). - **PRESPARAMS**: Defines presentation parameters (see Presentation Parameters Statement). - **Note**: WINDOW and CONTROL are synonymous. Child windows are defined between BEGIN and END. Presentation parameters apply to the entire control.
MENU Statement
The MENU statement defines a menu resource for an action bar or menu:
``` >>--MENU--menuid--+--loadoption--+-->--+--memoption--+-->--+--codepage--+-->--BEGIN--+--MENUITEM statement--+-->--END-----><
+--PRESPARAMS statement--+ +--SUBMENU statement--+
```
- **menuid (USHORT)**: An integer (1–65535) or unique string in double quotes. - **loadoption (LOADOPTION)**: Defaults to LOADONCALL. - **memoption (MEMOPTION)**: Defaults to MOVEABLE. - **codepage (USHORT)**: The text code page. - **PRESPARAMS**: Defines presentation parameters. - **MENUITEM**: Defines menu items. - **SUBMENU**: Defines submenus.
- Example**:
``` MENU "sample" BEGIN
MENUITEM "~Alpha", 100, MIS_TEXT SUBMENU "~Beta", 101, MIS_TEXT BEGIN MENUITEM "~Green", 200, MIS_TEXT MENUITEM "~Blue", 201, MIS_TEXT, MIA_CHECKED END
END ```
Menu Item Statements
MENUITEM statements define menu items within a MENU statement:
``` >>--MENUITEM--+--string, cmd, styles, attributes--+-->--><
+--SEPARATOR--+
```
- **string (PCH)**: A string in double quotes. Use `""` for quotes. Ignored if styles lack MIS_TEXT (use `""`). Use `~` for mnemonics. For SUBMENU items, use `\a` for right-aligned or `\t` for left-aligned second-column text. - **cmd (USHORT)**: The WM_COMMAND, WM_HELP, or WM_SYSCOMMAND message value, unique within the menu. - **styles (USHORT)**: MIS_* constants ORed together (see Menu Item Styles). - **attributes (USHORT)**: MIA_* constants ORed together (see Menu Item Attributes). - **SEPARATOR**: Creates an inactive horizontal dividing bar (no text or cmd).
- Examples**:
``` MENUITEM "Alpha", 1, MIS_TEXT, MIA_ENABLED|MIA_CHECKED, 'A' MENUITEM "Beta", 2, MIS_TEXT,, 'B' MENUITEM SEPARATOR ```
SUBMENU statements define submenus within a MENU statement:
``` >>--SUBMENU--string, cmd, styles, attributes-->--+--PRESPARAMS statement--+-->--BEGIN--+--MENUITEM statement--+-->--END-----><
+--SUBMENU statement--+
```
- **string (PCH)**: As in MENUITEM. - **cmd (USHORT)**: As in MENUITEM. - **styles (USHORT)**: MIS_SUBMENU is ORed with specified styles. Defaults to MIS_TEXT | MIS_SUBMENU. - **attributes (USHORT)**: MIA_* constants ORed together.
- Example**:
``` MENU "chem" BEGIN
SUBMENU "~Elements", 2, MIS_TEXT BEGIN MENUITEM "~Oxygen", 200, MIS_TEXT MENUITEM "~Carbon", 201, MIS_TEXT, MIA_CHECKED MENUITEM "~Hydrogen", 202, MIS_TEXT END SUBMENU "~Compounds", 3, MIS_TEXT BEGIN MENUITEM "~Glucose", 301, MIS_TEXT MENUITEM "~Sucrose", 302, MIS_TEXT, MIA_CHECKED MENUITEM "~Lactose", 303, MIS_TEXT|MIS_BREAK MENUITEM "~Fructose", 304, MIS_TEXT END
END ```
Menu Template
Menu templates are data structures defining menus, loaded as resources, created dynamically, or embedded in dialog templates. Resource-loaded templates cannot reference bitmaps or owner-drawn items. Each record defines a menu item, with submenu templates following their parent item.
Template Format
- **Length (USHORT)**: Template length. - **Version (USHORT)**: 0 or 1. - **Code page (USHORT)**: Text code page (excludes submenus). - **Item offset (USHORT)**: Offset of items from template start. - **Count (USHORT)**: Number of menu items. - **Presentation parameters offset (USHORT)**: Offset for version 1 templates. - **Menu Items**:
- **Style (USHORT)**: MIS_* styles ORed together. - **Attributes (USHORT)**: MIA_* attributes ORed together. - **Item (USHORT)**: Application-provided identifier. - **Variable data**: - **MIS_TEXT**: Null-terminated text string. - **MIS_SUBMENU**: Menu template structure. - **MIS_BITMAP**: Null-terminated text string for resource identifier: - Null first byte: Application provides bitmap handle. - 0xFF, low byte, high byte: Resource identifier. - `#` followed by decimal text: Resource identifier. - If invalid, no resource is loaded.
STRINGTABLE Statement
The STRINGTABLE statement defines ASCII string resources, loaded using WinLoadString. Strings are null-terminated, up to 256 characters:
``` >>--STRINGTABLE--+--loadoption--+-->--+--memoption--+-->--BEGIN--string-definitions-->--END----->< ```
- String-definitions**:
```
+-----------------------------------+ | | +--integer--string-----------------+-->--><
```
- **loadoption (LOADOPTION)**: Defaults to LOADONCALL. - **memoption (MEMOPTION)**: Defaults to MOVEABLE and DISCARDABLE. - **string (PCH)**: A string in double quotes. Use `""` for quotes. Multi-line strings use quotes per line or only at the start/end for newlines. Use `\\` for `\`. Escape sequences:
- `\t`: Horizontal tab - `\a`: Bell (alert) - `\nnn`: ASCII character (octal) - `\xdd`: ASCII character (hexadecimal)
- Example**:
```
- define IDS_STRING1 1
- define IDS_STRING2 2
- define IDS_STRING3 3
STRINGTABLE BEGIN
IDS_STRING1, "The first two strings in this table are identical." IDS_STRING2, "The first two strings " "in this table are identical." IDS_STRING3, "This string will contain a newline character\n" "before it continues on this line."
END ```
Templates, Control Data, and Presentation Parameters
This section covers:
- Dialog Template - Dialog Coordinates - Dialog Template Format and Contents - Header - Items - Data Area - Control Data Statement - Presentation Parameters Statement - Parent/Child/Owner Relationship - Predefined Window Classes - Predefined Control Statements
Dialog Template
A dialog template defines a dialog box, loaded from resources or created dynamically. It supports windows of any class with child windows of any class. Standard dialogs use WC_FRAME with preregistered control classes, specifying all creation details.
Dialog Coordinates
Coordinates are in dialog coordinates: 1/4 the default character-cell width (horizontal) and 1/8 the default character-cell height (vertical). The origin is the bottom left of the dialog box.
Dialog Template Format and Contents
A dialog template includes:
- **Header**: Defines the template format and locations of other sections, summarizing control statuses. - **Items**: Defines each control in the dialog. - **Data Area**: Contains data values for controls, with pointers from items. Includes presentation parameters. Not necessarily contiguous, allowing user data.
- Notes**:
1. Lengths are in bytes. String lengths exclude null terminators. Presentation Interface uses length specifications, ignoring terminators when passing strings but including them when returning strings. 2. Offsets are in bytes from the template start.
Header
- **Template length (USHORT)**: Overall template length. - **Template type (USHORT)**: Format type (0). - **Code page (USHORT)**: Text code page. - **Items offset (USHORT)**: Offset of dialog items array. - **Reserved (USHORT)**: Must be 0. - **Focus item (USHORT)**: Index of the control to receive focus. If 0 or invalid, focus goes to the first focusable item. - **Reserved (USHORT)**: Must be 0.
Items
Items are an array defining the control window hierarchy. The first descriptor is the dialog box itself. Each descriptor includes:
- **Reserved (USHORT, BOOL16)**: Must be 0. - **Children (USHORT)**: Number of child windows (elements following in the array). - **Class name length (USHORT)**: Length of the window class name string. - **Class name offset (USHORT)**: Offset of the class name string. - **Text length (USHORT)**: Length of the text string (current, not maximum, for text-input controls). - **Text offset (USHORT)**: Offset of the text string. - **Style (ULONG, BOOL32)**: Window style (16 bits standard, 16 bits class-specific). - **x, y (SHORT)**: Origin in dialog coordinates, relative to the parent. - **cx, cy (SHORT)**: Size in dialog coordinates (>0). - **Identifier (USHORT)**: Application-defined identifier. - **Reserved (USHORT)**: Must be 0. - **Control data offset (USHORT)**: Offset of control-specific data (0 if none).
Data Area
Contains:
- **Text (PCH)**: Textual data for dialog items. - **Class name (PCH)**: Window class name. - **Presentation parameters (PRESPARAMS)**: See Presentation Parameters Statement. - **Control data (CTLDATA)**: See Control Data Statement.
Objects can be non-contiguous, allowing user data.
Control Data Statement
Defines control data for a control:
``` >>--CTLDATA--+--decimal value--+-->--><
+--hexadecimal value--+ +--string--+----------+
```
- Supports hexadecimal/decimal word constants or strings, separated by commas. - Can include a MENU keyword with a BEGIN/END menu template as control data.
Presentation Parameters Statement
Defines presentation parameters:
``` >>--PRESPARAMS--type--+--, value--+-->-->< ```
- **type (ULONG)**: Attribute type (see PARAM data type). Strings specify user types, converted to string atoms. - **value (LONG or PSZ)**: One or more values, depending on type. Quoted values are null-terminated strings; otherwise, converted to LONG.
- Examples**:
``` PRESPARAMS PP_BORDERCOLOR, 0x00ff00ffL PRESPARAMS PP_FONTNAMESIZE, "12.Helv" PRESPARAMS "my color", 0x00ff00ffL PRESPARAMS "my param", 0, 1, 2, 3, "Hi there" ```
Parent/Child/Owner Relationship
DLGTEMPLATE and WINDOWTEMPLATE support tree-structured relationships:
``` WINDOWTEMPLATE id BEGIN
WINDOW winTop BEGIN WINDOW wind1 WINDOW wind2 WINDOW wind3 BEGIN WINDOW wind4 END WINDOW wind5 END
END ```
- **winTop** has children **wind1**, **wind2**, **wind3**, and **wind5**. **wind3** has child **wind4**. - Parent and owner are the same, except for frame controls created by a frame window. - WINDOW statements can be CONTROL or DIALOG.
Predefined Window Classes
CONTROL statements support user-defined or OS/2 predefined classes:
- WC_FRAME: Application frame - WC_STATIC: Text and group boxes - WC_BUTTON: Push button, check box, radio button - WC_COMBOBOX: Entry field and list box - WC_ENTRYFIELD: Single-line entry field - WC_MLE: Multiple-line entry field - WC_LISTBOX: List box - WC_MENU: Action bar, menus, popup menus - WC_SCROLLBAR: Horizontal/vertical scroll bar - WC_TITLEBAR: Application title bar - WC_SPINBUTTON: Spin button entry field - WC_CONTAINER: Container list - WC_SLIDER: Horizontal/vertical slider - WC_VALUESET: Value set control - WC_NOTEBOOK: Notebook control
- Example**:
``` CONTROL "", 1, 10, 20, 60, 40, WC_LISTBOX, WS_VISIBLE ```
Predefined Control Statements
Special control statements define common controls:
``` >>--controltype--text, id, cx, cy, x, y--+--, style--+-->--BEGIN--+--DIALOG statement--+-->--END-----><
+--CONTROL statement--+ +--WINDOW statement--+
```
Exceptions (no text field, like LISTBOX):
- CONTAINER, LISTBOX, NOTEBOOK, SLIDER, SPINBUTTON, VALUESET
- **controltype**: Defines the control type. - **text (PCH)**: String in double quotes. Use `~` for mnemonics. Required for COMBOBOX (use `""` if empty). - **id (USHORT)**: Unique identifier. - **x, y (SHORT)**: Lower-left corner coordinates. - **cx, cy (SHORT)**: Width and height. - **style**: Combined with `|`. Supports `+` and `-` for x, y, cx, cy fields.
- Control Types**:
- **AUTOCHECKBOX**: WC_BUTTON, WS_TABSTOP | WS_VISIBLE | BS_AUTOCHECKBOX - **AUTORADIOBUTTON**: WC_BUTTON, BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE - **CHECKBOX**: WC_BUTTON, BS_CHECKBOX | WS_TABSTOP | WS_VISIBLE - **COMBOBOX**:
``` >>--COMBOBOX--"title", id, cx, cy, x, y--+--, style--+-->-->< ```
- WC_COMBOBOX, CBS_SIMPLE | WS_TABSTOP | WS_VISIBLE
- **CONTAINER**: WC_CONTAINER, WS_TABSTOP | WS_VISIBLE | CCS_SINGLESEL - **CTEXT**: WC_STATIC, SS_TEXT | DT_CENTER | WS_GROUP | WS_VISIBLE - **DEFPUSHBUTTON**: WC_BUTTON, BS_DEFAULT | BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE - **EDITTEXT**: WC_ENTRYFIELD, WS_TABSTOP | WS_VISIBLE | ES_AUTOSCROLL - **ENTRYFIELD**: WC_ENTRYFIELD, WS_TABSTOP | ES_LEFT | WS_VISIBLE - **FRAME**: WC_FRAME, WS_VISIBLE - **GROUPBOX**: WC_STATIC, SS_GROUPBOX | WS_TABSTOP | WS_VISIBLE - **ICON**: WC_STATIC, SS_ICON | WS_VISIBLE - **LISTBOX**:
``` >>--controltype--id, cx, cy, x, y--+--, style--+-->-->< ```
- WC_LISTBOX, WS_BORDER | WS_VISIBLE
- **LTEXT**: WC_STATIC, SS_TEXT | DT_LEFT | WS_GROUP | WS_VISIBLE - **MLE**: WC_MLE, WS_TABSTOP | WS_VISIBLE | MLS_BORDER - **NOTEBOOK**: WC_NOTEBOOK, WS_TABSTOP | WS_VISIBLE - **PUSHBUTTON**: WC_BUTTON, BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE - **RADIOBUTTON**: WC_BUTTON, BS_RADIOBUTTON | WS_TABSTOP | WS_VISIBLE - **RTEXT**: WC_STATIC, SS_TEXT | DT_RIGHT | WS_GROUP | WS_VISIBLE - **SLIDER**: WC_SLIDER, WS_SLIDER | WS_TABSTOP | WS_VISIBLE - **SPINBUTTON**: WC_SPINBUTTON, WS_TABSTOP | WS_VISIBLE | SPBS_MASTER - **VALUESET**: WC_VALUESET, WS_TABSTOP | WS_VISIBLE
- Examples**:
``` DLGTEMPLATE "errmess" BEGIN
DIALOG "Disk Error", 100, 10, 10, 300, 110 BEGIN CTEXT "Select One:", 1, 10, 80, 280, 12 RADIOBUTTON "Retry", 2, 75, 50, 60, 12 RADIOBUTTON "Abort", 3, 75, 30, 60, 12 RADIOBUTTON "Ignore", 4, 75, 10, 60, 12 END
END
WINDOWTEMPLATE "wind1" BEGIN
FRAME "My Window", 1, 10, 10, 320, 130, WS_VISIBLE, FCF_STANDARD | FCF_VERTSCROLL BEGIN WINDOW "", FID_CLIENT, 0, 0, 0, 0, "MyClientClass", style END
END
DLGTEMPLATE parallel1 BEGIN
DIALOG "Parallel Dialog", 1, 50, 50, 180, 110 CTLDATA FCF_TITLEBAR | FCF_SYSMENU | FCF_DLGBORDER BEGIN AUTORADIOBUTTON "Retry", 2, 75, 80, 60, 12 AUTORADIOBUTTON "Abort", 3, 75, 50, 60, 12 AUTORADIOBUTTON "Ignore", 4, 75, 30, 60, 12 END
END
Resource (.RES) File Specification
The `.RES` file format is:
(/TYPE NAME FLAGS SIZE BYTES/)+
- **TYPE**: Null-terminated string or ordinal (0xFF followed by an INT).
- **NAME**: Same format as TYPE. No predefined names.
- **FLAGS**: Unsigned value with memory manager flags:
#define NSTYPE 0x0007 /* Segment type mask */ #define NSCODE 0x0000 /* Code segment */ #define NSDATA 0x0001 /* Data segment */ #define NSITER 0x0008 /* Iterated segment flag */ #define NSMOVE 0x0010 /* Moveable segment flag */ #define NSPURE 0x0020 /* Pure segment flag */ #define NSPRELOAD 0x0040 /* Preload segment flag */ #define NSEXRD 0x0080 /* Execute-only (code), read-only (data) */ #define NSRELOC 0x0100 /* Segment has relocations */ #define NSCONFORM 0x0200 /* Segment has debug info */ #define NSDPL 0x0C00 /* 286 DPL bits */ #define NSDISCARD 0x1000 /* Discard bit for segment */ #define NS32BIT 0x2000 /* 32-BIT code segment */ #define NSHUGE 0x4000 /* Huge memory segment */
- **SIZE**: LONG value defining the number of bytes in the resource.
- **BYTES**: The resource data stream.
Multiple resources can appear sequentially. For multimedia resource types (MIDI, RIFF, WAVE, AVI), see the *OS/2 Warp Multimedia Programming Reference*.
- Predefined Resource Types**:
#define RT_POINTER 1 #define RT_BITMAP 2 #define RT_MENU 3 #define RT_DIALOG 4 #define RT_STRING 5 #define RT_FONTDIR 6 #define RT_FONT 7 #define RT_ACCELTABLE 8 #define RT_RCDATA 9 #define RT_DLGINCLUDE 11 #define RT_FKALONG 17 #define RT_HELPTABLE 18 #define RT_RMID 100 #define RT_RIFF 101 #define RT_WAVE 102 #define RT_AVI 103 #define RT_RESNAMES 255
Begin Resource Group (BRG): required
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 BRG 0xD3A8C6
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Resource group name C'0000 0002'
Begin Color Attribute (BCA) Table: required
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 BCA 0xD3A877
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Color table name C'0000 0004'
Color Attribute Table (CAT): required
Structured Field Introducer
- 0-1 Length 0xn+8
- 2-4 CAT 0xD3B077
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
Base Part (required)
- 0 Flags
* 0 Reserved B'0' * 1 Reset * B'0' Do not reset to default * B'1' Do reset to default * 2-7 Reserved B'000000'
- 1 Reserved 0x00
- 2 LCTID 0x00
Element list(s) (triple generating) are mutually-exclusive. One or other is required.
Element List (repeating)
- 0 Length of this parameter
- 1 Type 0x01: element list
- 2 Flags 0x00: reserved
- 3 Format
* 0x01 RGB
- 4-6 Starting Index (Top Byte Truncated)
- 7 Size of RGB component1 0x08
- 8 Size of RGB component2 0x08
- 9 Size of RGB component3 0x08
- 10 Number of bytes in each following color triple 0x04
- 11-m Color triples
Triple Generating
- 0 Length of this parameter 0x0A
- 1 Type 0x02: bit generator
- 2 Flags
* 0 ABFlag * B'0' Normal * 1-7 Reserved B'0000000'
- 3 Format
* 0x01 RGB
- 4-6 Starting index (top byte truncated)
- 7 Size of RGB component1 0x08
- 8 Size of RGB component2 0x08
- 9 Size of RGB component3 0x08
End Color Attribute (ECA) Table: required
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 ECA 0xD3A977
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Color table name C Hepburn.0000 0004'
Begin Image Object (BIM): optional, repeating
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 BIM 0xD3A8FB
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Image name C'xxxx xxxx'
Begin Resource Group (BRG): optional
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 BRG 0xD3A8C6
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Resource group name C'xxxx xxxx'
Color Attribute Table (BCA): optional
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 BCA 0xD3A877
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Color table name C'xxxx xxxx'
Color Attribute Table (CAT): required
Structured Field Introducer
- 0-1 Length
- 2-4 CAT 0xD3B077
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
Base Part
- 0 Flags 0x00
- 1 Reserved 0x00
- 2 LUTID
Element List (repeating)
- 0 Length of this parameter
- 1 Type 0x01: element list
- 2 Flags 0x00: reserved
- 3 Format 0x01: RGB
- 4-6 Starting index (top byte truncated)
- 7 Size of RGB component1 0x08
- 8 Size of RGB component2 0x08
- 9 Size of RGB component3 0x08
- 10 Number of bytes in each following color triple 0x03
- 11-n Color triples
End Color Attribute Table (ECA): required if BCA present
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 ECA 0xD3A977
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Color Table name C'xxxx xxxx'
End Resource Group (ERG): required if BRG present
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 ERG 0xD3A9C6
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Resource Group name C'xxxx xxxx'
Begin Object Environment Group (BOG): optional
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 BOG 0xD3A8C7
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Object environment group name C'xxxx xxxx'
Map Color Attribute (MCA) Table: required
Structured Field Introducer
- 0-1 Length 0x001A
- 2-4 MCA 0xD3AB77
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-1 Length
Triplet (required)
- 0 Length 0x0C
- 1 Triplet type: fully qualified name 0x02
- 2 Type: ref to Begin Resource Object 0x84
- 3 ID 0x00
- 4-11 Color table name C'xxxx xxxx'
lcid (required)
- 0 Length 0x04
- 1 Triplet type: resource local ID 0x24
- 2 Type color table resource 0x07
- 3 Local identifier (LUT-ID) 0x01
End Object Environment Group (EOG): required if BOG present
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 EOG 0xD3A9C7
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Object Environment Group name C'xxxx xxxx'
Image Data Descriptor (IDD): required
Structured Field Introducer
- 0-1 Length 0x0011
- 2-4 IDD 0xD3A6FB
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0 Unit of measure:
* 0x00 tens of inches * 0x01 tens of centimeters
- 1-2 X resolution image points / UOM
- 3-4 Y resolution image points / UOM
- 5-6 X extent of image PS
- 7-8 Y extent of image PS
Image Picture Data (IPD): required
Structured Field Introducer
- 0-1 Length
- 2-4 IPD 0xD3EEFB
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters (all required and in this order, except that only one of Image LUT-ID and IDE structure is present)
Begin Segment
- 0 Type 0x70: begin segment
- 1 Length of following 0x00
Begin Image Content
- 0 Type 0x91: Begin Image Content
- 1 Length of following 0x01
- 2 Format 0xFF
Image Size
- 0 Type 0x94: image size
- 1 Length of following 0x09
- 2 Units of measure 0x02: logical
- 3-4 Horizontal resolution
- 5-6 Vertical resolution
- 7-8 Height in pels
- 9-10 Width in pels
Image Encoding
- 0 Type 0x95: image encoding
- 1 Length of following 0x02
- 2 Compression algorithm 0x03: none
- 3 Recording algorithm 0x03: bottom-to-top
Image IDE-Size
- 0 Type 0x96: image IDE-Size
- 1 Length of following 0x01
- 2 Number of bits per element
Image LUT-ID (For bit maps with other than 24 bits per pel)
- 0 Type 0x97 Image LUT-ID
- 1 Length of following 0x01
- 2 LUT-ID
IDE Structure (For bit maps with 24 bits per pel)
- 0 Type 0x9B: IDE structure
- 1 Length of following 0x08
- 2 Flags:
* 0 ABFlag * B'0' Normal (Additive) * 1-7 Reserved B'0000000'
- 3 Format
* 0x01 RGB
- 4-6 Reserved 0x000000
- 7 Size of element 1
- 8 Size of element 2
- 9 Size of element 3
Image Picture Data (IPD): required, repeating
Structured Field Introducer
- 0-1 Length
- 2-4 IPD 0xD3EEFB
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
Image Data
- 0-1 Type 0xFE92: image data
- 2-3 Length of following
- 4-n Image data (scan lines of bit maps)
End Image Content (required, only present in last Image Picture Data)
- 0 Type 0x93: End Image Content
- 1 Length of following 0x00
End Segment (required, only present in last Image Picture Data)
- 0 Type 0x71: end segment
- 1 Length of following 0x00
End Image Object (EIM): required if BIM present
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 EIM 0xD3A9FB
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Image name C'xxxx xxxx'
Begin Graphics Object (BGR): required
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 BGR 0xD3A8BB
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Graphics object name C'0000 0007'
Begin Object Environment Group (BOG): optional
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 BOG 0xD3A8C7
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Object Environment Group name C'0000 0007'
Map Color Attribute Table (MCA): required
Structured Field Introducer
- 0-1 Length 0x0016
- 2-4 MCA 0xD3AB77
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-1 Length
Triplet (required)
- 0 Length 0x0C
- 1 Triplet type: fully qualified name 0x02
- 2 Type: ref to Begin Resource Object 0x84
- 3 ID 0x00
- 4-11 Color table name C'0000 0004'
Map Coded Font (MCF): required, for default font
Structured Field Introducer
- 0-1 Length 0x20
- 2-4 MCF 0xD3AB8A
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-1 Length
Triplets (required)
Font name
- 0 Length 0x0C
- 1 Triplet type: fully qualified name 0x02
- 2 Type: ref to coded font 0x84
- 3 ID 0x00
- 4-11 Coded font name: C'nnxx xxxx' where n is 0xFF
lcid
- 0 Length 0x04
- 1 Triplet type: Resource Local ID 0x24
- 2 Type: Coded Font Resource 0x05
- 3 Local identifier (LCID) 0x00
Font Binary GCID
- 0 Length 0x06
- 1 Triplet type: Font Binary GCID 0x20
- 2-5 GCID
Map Coded Font (MCF): optional, repeating, for loaded fonts
Structured Field Introducer
- 0-1 Length 0x58
- 2-4 MCF 0xD3AB8A
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-1 Length
Triplets (required)
Font name
- 0 Length 0x0C
- 1 Triplet type: fully qualified name 0x02
- 2 Type: ref to coded font 0x84
- 3 ID 0x00
- 4-11 Coded font name
lcid
- 0 Length 0x04
- 1 Triplet type: Resource Local ID 0x24
- 2 Type: coded font resource 0x05
- 3 Local identifier (LCID)
Font Attributes
- 0 Length 0x14
- 1 Triplet type: Font Descriptor 0x1F
- 2 Weight Class
- 3 Width Class
- 4-5 Font Height
- 6-7 Char Width
- 8 Descript Flags
- 9 Usage Codes
- 10 Family
- 11 Activity Class
- 12 Font Quality
- 13-14 CAP Height
- 15-16 X Height
- 17-18 Line Density
- 19 Use Flags
Font Binary GCID
- 0 Length 0x06
- 1 Triplet type: Font Binary GCID 0x20
- 2-5 GCID
Font Typeface
- 0 Length 0x24
- 1 Triplet type: fully qualified name 0x02
- 2 Type: ref to font typeface 0x08
- 3 ID 0x00
- 4-35 Font typeface C'xxx...xxx'
Map Data Resource (MDR): optional, repeating
Structured Field Introducer
- 0-1 Length 0x1D
- 2-4 MDR 0xD3ABC3
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-1 Length
Triplets (required)
Bit-map Name
- 0 Length 0x0C
- 1 Triplet type: fully qualified name 0x02
- 2 Type: ref to Image Object 0x84
- 3 ID 0x00
- 4-11 Image name C'xxxx xxxx'
Extended Resource lcid
- 0 Length 0x07
- 1 Triplet type: Extended Resource Local ID 0x22
- 2 Type: Image Resource 0x10
- 3-6 Bit-map handle
End Object Environment Group (EOG): required if BOG present
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 EOG 0xD3A9C7
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Object Environment Group name C'0000 0007'
Graphics Data Descriptor (GDD): required
Structured Field Introducer
- 0-1 Length 0xnnnn
- 2-4 GDD 0xD3A6BB
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters (all required and in this order)
- 0 0xF7 Specify GVM Subset
- 1 Length of following data 0x07
- 2 0xB0 drawing order subset
- 3-4 0x0000
- 5 0x23 Level 3.2
- 6 0x01 Version 1
- 7 Length of following field 0x01
- 8 Coordinate types in data
* 0x04 Intel16 * 0x05 Intel32
- 0 0xF6 Set Picture Descriptor
- 1 Length of following data
- 2 Flags
* 0 B'0' Picture in 2D * 1 Picture Dimensions * B'0' Not absolute (PU_ARBITRARY PS) * B'1' Absolute (example: PU_TWIPS PS) * 2 Picture Elements * B'0' Not pels * B'1' Pels (PU_PELS PS) (Bit 1 must also be set) * 3-7 B'00000'
- 3 0x00 Reserved
- 4 Picture frame size coordinate type
* 0x04 Intel16 * 0x05 Intel32
- 5 UnitsOfMeasure
* 0x00 Ten inches * 0x01 Decimeter
- 6-11 or 6-17 (2 or 4 bytes) Resolution.
* GPS Units / UOM on x axis * GPS Units / UOM on y axis * GPS Units / UOM on z axis
- 12-23 or 18-41 (2 or 4 bytes) Window Size.
* GPS X left, X right * GPS Y bottom, Y top * GPS Z near, Z far
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set Default Parameter Format 0x08
- 3-4 Mask 0xE000
- 5 Names 0x8F
- 6 Coordinates
* 0x00 Picture in 2D
- 7 Transforms
* 0x04 Intel16 * 0x05 Intel32
- 8 Geometrics
* 0x04 Intel16 * 0x05 Intel32
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set default viewing transform 0x07
- 3-4 Mask 0xCC0C
- 5 Names 0x8F
- 6-n M11, M12, M21, M22, M41, M42 Matrix elements
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set default line attributes 0x01
- 3-4 Mask - OR of as many of the following bits as are required:
* 0x8000 Line type * 0x4000 Line width * 0x2000 Line end * 0x1000 Line join * 0x0800 Stroke width * 0x0008 Line color * 0x0002 Line mix
- 5 Flags
* 0x0F Set indicated default attributes to initial values. (Data field is not present in this instance). * 0x8F Set indicated default attributes to specified values.
- 6-n Data - data values as required, in the following order if present.
* No space is reserved for attributes for which the corresponding mask flag was not set. * (1 byte) - Line type * (1 byte) - Line width * (1 byte) - Line end * (1 byte) - Line join * (G bytes) - Stroke width * (4 bytes) - Line color * (1 byte) - Line mix (G=2 or 4 depending on the Geometrics parameter of Set Default Parameter Format)
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set Default Character Attributes 0x02
- 3-4 Mask - OR of as many of the following bits as are required:
* 0x8000 Character angle * 0x4000 Character box * 0x2000 Character direction * 0x1000 Character precision * 0x0800 Character set * 0x0400 Character shear * 0x0040 Character break extra * 0x0020 Character extra * 0x0008 Character color * 0x0004 Character background color * 0x0002 Character mix * 0x0001 Character background mix
- 5 Flags
* 0x0F Set indicated default attributes to initial values. (Data field is not present in this case). * 0x8F Set indicated default attributes to specified values.
- 6-n Data - data values as required, in the following order if present.
* No space is reserved for attributes for which the corresponding Mask flag was not set. * (2*G bytes) - Character angle * (2*G + 4 bytes) - Character box * (1 byte) - Character direction * (1 byte) - Character precision * (1 byte) - Character set * (2*G bytes) - Character shear * (4 bytes) - Character break extra * (4 bytes) - Character extra * (4 bytes) - Character color * (4 bytes) - Character background color * (1 byte) - Character mix * (1 byte) - Character background mix (G=2 or 4 depending on the Geometrics parameter of Set Default Parameter Format)
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set Default Marker Attributes 0x03
- 3-4 Mask - OR of as many of the following bits as are required:
* 0x4000 Marker box * 0x1000 Marker precision * 0x0800 Marker set * 0x0100 Marker symbol * 0x0008 Marker color * 0x0004 Marker background color * 0x0002 Marker mix * 0x0001 Marker background mix
- 5 Flags
* 0x0F Set indicated default attributes to initial values. (Data field is not present in this instance) * 0x8F Set indicated default attributes to specified values.
- 6-n Data - data values as required, in this order if present.
* No space is reserved for attributes for which the corresponding Mask flag was not set. * (2*G bytes) - Marker box * (1 byte) - Marker precision * (1 byte) - Marker set * (1 byte) - Marker symbol * (4 bytes) - Marker color * (4 bytes) - Marker background color * (1 byte) - Marker mix * (1 byte) - Marker background mix (G=2 or 4 depending on the Geometrics parameter of Set Default Parameter Format)
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set Default Pattern Attributes 0x04
- 3-4 Mask - OR of as many of the following bits as are required:
* 0x0800 Pattern set * 0x0100 Pattern symbol * 0x0080 Pattern reference point * 0x0008 Pattern color * 0x0004 Pattern background color * 0x0002 Pattern mix * 0x0001 Pattern background mix
- 5 Flags
* 0x0F Set indicated default attributes to initial values. (Data field is not present in this instance) * 0x8F Set indicated default attributes to specified values.
- 6-n Data - data values as required, in this order if present.
* No space is reserved for attributes for which the corresponding Mask flag was not set. * (1 byte) - Pattern set * (1 byte) - Pattern symbol * (2*G bytes) - Pattern reference point * (4 bytes) - Pattern color * (4 bytes) - Pattern background color * (1 byte) - Pattern mix * (1 byte) - Pattern background mix (G=2 or 4 depending on the Geometrics parameter of Set Default Parameter Format)
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set Default Image Attributes 0x06
- 3-4 Mask - OR of as many of these bits as are required:
* 0x0008 Image color * 0x0004 Image background color * 0x0002 Image mix * 0x0001 Image background mix
- 5 Flags
* 0x0F Set indicated default attributes to initial values. (Data field is not present in this instance) * 0x8F Set indicated default attributes to specified values.
- 6-n Data - data values as required, in this order if present.
* No space is reserved for attributes for which the corresponding Mask flag was not set. * (4 bytes) - Image color * (4 bytes) - Image background color * (1 byte) - Image mix * (1 byte) - Image background mix
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set Default Viewing Window 0x05
- 3-4 Mask - OR of as many of the following bits as are required:
* 0x8000 x left limit * 0x4000 x right limit * 0x2000 y bottom limit * 0x1000 y top limit
- 5 Flags
* 0x0F Set indicated default attributes to initial values. (Data field is not present in this case). * 0x8F Set indicated default attributes to specified values.
- 6-n Data - data values as required, in the following order if present.
* No space is reserved for attributes for which the corresponding Mask flag was not set. * (2*G bytes) - x left limit * (2*G bytes) - x right limit * (2*G bytes) - y bottom limit * (2*G bytes) - y top limit (G=2 or 4 depending on the Geometrics parameter of Set Default Parameter Format)
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set Default Arc Parameters 0x0B
- 3-4 Mask - OR of as many of the following bits as are required:
* 0x8000 P value * 0x4000 Q value * 0x2000 R value * 0x1000 S value
- 5 Flags
* 0x0F Set indicated default attributes to initial values. (Data field is not present in this case). * 0x8F Set indicated default attributes to specified values.
- 6-n Data - data values as required, in the following order if present.
* No space is reserved for attributes for which the corresponding Mask flag was not set. * (G bytes) - P value * (G bytes) - Q value * (G bytes) - R value * (G bytes) - S value (G=2 or 4 depending on the Geometrics parameter of Set Default Parameter Format)
- 0 0x21 Set Current Defaults
- 1 Length of following data
- 2 Set Default Pick Identifier 0x0C
- 3-4 Mask - OR of as many of the following bits as are required:
* 0x8000 Pick identifier
- 5 Flags
* 0x0F Set indicated default attributes to initial values. (Data field is not present in this case). * 0x8F Set indicated default attributes to specified values.
- 6-n Data - data values as required, in the following order if present.
* No space is reserved for attributes for which the corresponding Mask flag was not set. * (4 bytes) - Pick identifier
- 0 0xE7 Set Bit-map Identifier
- 1 Length of following data 0x07
- 2-3 Usage Flags 0x8000
- 4-7 Bit-map handle
- 8 Lcid
Graphics Data (GAD): optional, repeating
Structured Field Introducer
- 0-1 Length 0xn+9
- 2-4 GAD 0xD3EEBB
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters (maximum length in one structured field is 32759)
Graphics Segment (optional, repeating)
Segment data (including the Begin Segment parameter) can be split at any point between successive Graphics Data structured fields.
- 0 0x70 Begin Segment
- 1 Length of following data 0x0E
- 2-5 Segment identifier
- 6 Segment attributes (1)
* 0 B'1' Invisible * 1 B'1' Propagate invisibility * 2 B'1' Detectable * 3 B'1' Propagate detectability * 6 B'1' Dynamic * 7 B'1' Fast chaining
- 7 Segment attributes (2)
* 0 B'1' Non-chained * 3 B'1' Prolog
- 8-9 Segment data length (low-order 2 bytes)
- 10-13 Reserved
- 14-15 Segment data length (high-order 2 bytes)
- 16-n Graphics orders (see the Graphics Programming Interface Programming Reference)
End Graphics Object (EGR)
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 EGR 0xD3A9BB
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Graphics object name C'0000 0007'
End Resource Group (ERG): required
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 ERG 0xD3A9C6
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Resource Group name C'0000 0002'
End Document (EDT): required
Structured Field Introducer
- 0-1 Length 0x0010
- 2-4 EDT 0xD3A9A8
- 5 Flags 0x00
- 6-7 Segment sequence number 0x0000
Parameters
- 0-7 Document name C'0000 0001'
Virtual Key Definitions
The PC virtual key (VKEY) set is detailed in the table below, outlining the mappings for the Personal Computer AT keyboard and the Enhanced Keyboard.
Symbol | Personal Computer AT Keyboard |
Enhanced Keyboard |
---|---|---|
VK_BUTTON1 VK_BUTTON2 VK_BUTTON3
|
These values are only used to access the up/down and toggled states of the pointing device buttons; they never actually appear in a WM_CHAR message.
|
These values are only used to access the up/down and toggled states of the pointing device buttons; they never actually appear in a WM_CHAR message.
|
VK_BREAK
|
Ctrl + Scroll Lock | Ctrl + Pause |
VK_BACKSPACE
|
Backspace | Backspace |
VK_TAB
|
Tab | Tab |
VK_BACKTAB
|
Shift + Tab | Shift + Tab |
VK_NEWLINE
|
Enter | Enter |
VK_SHIFT *
|
Left and Right Shift | Left and Right Shift |
VK_CTRL *
|
Ctrl | Left and Right Ctrl |
VK_ALT *
|
Alt | Left and Right Alt |
VK_ALTGRAF *
|
None | Alt Graf (if available) |
VK_PAUSE
|
Ctrl + Num Lock | Pause |
VK_CAPSLOCK
|
Caps Lock | Caps Lock |
VK_ESC
|
Esc | Esc |
VK_SPACE *
|
Space | Space |
VK_PAGEUP *
|
Numpad 9 | Pg Up and Numpad 9 |
VK_PAGEDOWN *
|
Numpad 3 | Pg Dn and Numpad 3 |
VK_END *
|
Numpad 1 | End and Numpad 1 |
VK_HOME *
|
Numpad 7 | Home and Numpad 7 |
VK_LEFT *
|
Numpad 4 | Left and Numpad 4 |
VK_UP *
|
Numpad 8 | Up and Numpad 8 |
VK_RIGHT *
|
Numpad 6 | Right and Numpad 6 |
VK_DOWN *
|
Numpad 2 | Down and Numpad 2 |
VK_PRINTSCRN
|
Shift + Print Screen | Print Screen |
VK_INSERT *
|
Numpad 0 | Ins and Numpad 0 |
VK_DELETE *
|
Numpad . | Del and Numpad . |
VK_SCRLLOCK
|
Scroll Lock | Scroll Lock |
VK_NUMLOCK
|
Num Lock | Num Lock |
VK_ENTER
|
Shift + Enter | Shift + Enter and Numpad Enter |
VK_SYSRQ
|
SysRq | Alt + Print Screen |
VK_F1 *
|
F1 | F1 |
VK_F2 *
|
F2 | F2 |
VK_F3 *
|
F3 | F3 |
VK_F4 *
|
F4 | F4 |
VK_F5 *
|
F5 | F5 |
VK_F6 *
|
F6 | F6 |
VK_F7 *
|
F7 | F7 |
VK_F8 *
|
F8 | F8 |
VK_F9 *
|
F9 | F9 |
VK_F10 *
|
F10 | F10 |
VK_F11 *
|
None | F11 |
VK_F12 *
|
None | F12 |
VK_F13
|
None | None |
VK_F14
|
None | None |
VK_F15
|
None | None |
VK_F16
|
None | None |
VK_F17
|
None | None |
VK_F18
|
None | None |
VK_F19
|
None | None |
VK_F20
|
None | None |
VK_F21
|
None | None |
VK_F22
|
None | None |
VK_F23
|
None | None |
VK_F24
|
None | None |
VK_MENU *
|
F10 | F10 |
- Notes
- VKEYs marked with an asterisk (*) are generated irrespective of other shift states (Shift, Ctrl, Alt, and Alt Graf).
- VK_CAPSLOCK is not generated for any of the Ctrl shift states, for PC-DOS compatibility.
- Wherever possible, the VK_ name is derived from the legend on the key top of the 101-key Enhanced PC keyboard.