Mac OS 9
IntlResources.h
Go to the documentation of this file.
1 
19 #ifndef __INTLRESOURCES__
20 #define __INTLRESOURCES__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #if PRAGMA_ONCE
27 #pragma once
28 #endif
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #if PRAGMA_IMPORT
35 #pragma import on
36 #endif
37 
38 #if PRAGMA_STRUCT_ALIGN
39 #pragma options align = mac68k
40 #elif PRAGMA_STRUCT_PACKPUSH
41 #pragma pack(push, 2)
42 #elif PRAGMA_STRUCT_PACK
43 #pragma pack(2)
44 #endif
45 
46 enum {
47  /* Bits in the itlcFlags byte */
48  itlcShowIcon = 7, /*Show icon even if only one script*/
49  itlcDualCaret = 6, /*Use dual caret for mixed direction text*/
50  /* Bits in the itlcSysFlags word */
51  itlcSysDirection = 15 /*System direction - left to right/right to left*/
52 };
53 
54 enum {
55  /* One more flag in the itlcFlags byte */
56  itlcDisableKeyScriptSync =
57  3 /*Disable font and keyboard script synchrinozation*/
58 };
59 
60 enum {
61  /* We should define masks, too. */
62  itlcDisableKeyScriptSyncMask =
63  1 << itlcDisableKeyScriptSync /*Disable font and keyboard script
64  synchrinozation mask*/
65 };
66 
67 enum {
68  tokLeftQuote = 1, /* NumberParts.data[] enumerators */
69  tokRightQuote = 2, /* In general, these are NOT to be considered indices into
70  the data[] array */
71  tokLeadPlacer = 3,
72  tokLeader = 4,
73  tokNonLeader = 5,
74  tokZeroLead = 6,
75  tokPercent = 7,
76  tokPlusSign = 8,
77  tokMinusSign = 9,
78  tokThousands = 10,
79  tokReserved = 11, /* 11 is reserved field */
80  tokSeparator = 12,
81  tokEscape = 13,
82  tokDecPoint = 14,
83  tokEPlus = 15,
84  tokEMinus = 16,
85  tokMaxSymbols = 31,
86  curNumberPartsVersion = 1 /*current version of NumberParts record*/
87 };
88 
89 enum {
90  currSymLead = 16,
91  currNegSym = 32,
92  currTrailingZ = 64,
93  currLeadingZ = 128
94 };
95 
96 enum { mdy = 0, dmy = 1, ymd = 2, myd = 3, dym = 4, ydm = 5 };
97 
98 typedef SInt8 DateOrders;
99 enum {
100  timeCycle24 = 0, /*time sequence 0:00 - 23:59*/
101  timeCycleZero = 1, /*time sequence 0:00-11:59, 0:00 - 11:59*/
102  timeCycle12 = 255, /*time sequence 12:00 - 11:59, 12:00 - 11:59*/
103  zeroCycle = 1, /*old name for timeCycleZero*/
104  longDay = 0, /*day of the month*/
105  longWeek = 1, /*day of the week*/
106  longMonth = 2, /*month of the year*/
107  longYear = 3, /*year*/
108  supDay = 1, /*suppress day of month*/
109  supWeek = 2, /*suppress day of week*/
110  supMonth = 4, /*suppress month*/
111  supYear = 8, /*suppress year*/
112  dayLdingZ = 32,
113  mntLdingZ = 64,
114  century = 128,
115  secLeadingZ = 32,
116  minLeadingZ = 64,
117  hrLeadingZ = 128
118 };
119 
120 /* moved OffsetTable back here from QuickdrawText */
121 struct OffPair {
122  short offFirst;
123  short offSecond;
124 };
125 typedef struct OffPair OffPair;
126 typedef OffPair OffsetTable[3];
127 struct Intl0Rec {
128  char decimalPt; /*decimal point character*/
129  char thousSep; /*thousands separator character*/
130  char listSep; /*list separator character*/
131  char currSym1; /*currency symbol*/
132  char currSym2;
133  char currSym3;
134  UInt8 currFmt; /*currency format flags*/
135  UInt8 dateOrder; /*order of short date elements: mdy, dmy, etc.*/
136  UInt8 shrtDateFmt; /*format flags for each short date element*/
137  char dateSep; /*date separator character*/
138  UInt8 timeCycle; /*specifies time cycle: 0..23, 1..12, or 0..11*/
139  UInt8 timeFmt; /*format flags for each time element*/
140  char mornStr[4]; /*trailing string for AM if 12-hour cycle*/
141  char eveStr[4]; /*trailing string for PM if 12-hour cycle*/
142  char timeSep; /*time separator character*/
143  char time1Suff; /*trailing string for AM if 24-hour cycle*/
144  char time2Suff;
145  char time3Suff;
146  char time4Suff;
147  char time5Suff; /*trailing string for PM if 24-hour cycle*/
148  char time6Suff;
149  char time7Suff;
150  char time8Suff;
151  UInt8 metricSys; /*255 if metric, 0 if inches etc.*/
152  short intl0Vers; /*region code (hi byte) and version (lo byte)*/
153 };
154 typedef struct Intl0Rec Intl0Rec;
155 typedef Intl0Rec *Intl0Ptr;
156 typedef Intl0Ptr *Intl0Hndl;
157 struct Intl1Rec {
158  Str15 days[7]; /*day names*/
159  Str15 months[12]; /*month names*/
160  UInt8 suppressDay; /*255 for no day, or flags to suppress any element*/
161  UInt8 lngDateFmt; /*order of long date elements*/
162  UInt8 dayLeading0; /*255 for leading 0 in day number*/
163  UInt8 abbrLen; /*length for abbreviating names*/
164  char st0[4]; /*separator strings for long date format*/
165  char st1[4];
166  char st2[4];
167  char st3[4];
168  char st4[4];
169  short intl1Vers; /*region code (hi byte) and version (lo byte)*/
170  short localRtn[1]; /*now a flag for opt extension*/
171 };
172 typedef struct Intl1Rec Intl1Rec;
173 typedef Intl1Rec *Intl1Ptr;
174 typedef Intl1Ptr *Intl1Hndl;
175 /*fields for optional itl1 extension*/
176 struct Itl1ExtRec {
177  Intl1Rec base; /*un-extended Intl1Rec*/
178  short version;
179  short format;
180  short calendarCode; /*calendar code for this itl1 resource*/
181  long extraDaysTableOffset; /*offset in itl1 to extra days table*/
182  long extraDaysTableLength; /*length of extra days table*/
183  long extraMonthsTableOffset; /*offset in itl1 to extra months table*/
184  long extraMonthsTableLength; /*length of extra months table*/
185  long abbrevDaysTableOffset; /*offset in itl1 to abbrev days table*/
186  long abbrevDaysTableLength; /*length of abbrev days table*/
187  long abbrevMonthsTableOffset; /*offset in itl1 to abbrev months table*/
188  long abbrevMonthsTableLength; /*length of abbrev months table*/
189  long extraSepsTableOffset; /*offset in itl1 to extra seps table*/
190  long extraSepsTableLength; /*length of extra seps table*/
191  short tables[1]; /*now a flag for opt extension*/
192 };
193 typedef struct Itl1ExtRec Itl1ExtRec;
194 struct UntokenTable {
195  short len;
196  short lastToken;
197  short index[256]; /*index table; last = lastToken*/
198 };
199 typedef struct UntokenTable UntokenTable;
202 union WideChar {
203  char a[2]; /*0 is the high order character*/
204  short b;
205 };
206 typedef union WideChar WideChar;
207 struct WideCharArr {
208  short size;
209  WideChar data[10];
210 };
211 typedef struct WideCharArr WideCharArr;
212 struct NumberParts {
213  short version;
214  WideChar data[31]; /*index by [tokLeftQuote..tokMaxSymbols]*/
215  WideCharArr pePlus;
216  WideCharArr peMinus;
217  WideCharArr peMinusPlus;
218  WideCharArr altNumTable;
219  char reserved[20];
220 };
221 typedef struct NumberParts NumberParts;
222 typedef NumberParts *NumberPartsPtr;
223 
224 struct Itl4Rec {
225  short flags; /*reserved*/
226  long resourceType; /*contains 'itl4'*/
227  short resourceNum; /*resource ID*/
228  short version; /*version number*/
229  long resHeader1; /*reserved*/
230  long resHeader2; /*reserved*/
231  short numTables; /*number of tables, one-based*/
232  long mapOffset; /*offset to table that maps byte to token*/
233  long strOffset; /*offset to routine that copies canonical string*/
234  long fetchOffset; /*offset to routine that gets next byte of character*/
235  long unTokenOffset; /*offset to table that maps token to canonical string*/
236  long defPartsOffset; /*offset to default number parts table*/
237  long resOffset6; /*reserved*/
238  long resOffset7; /*reserved*/
239  long resOffset8; /*reserved*/
240 };
241 typedef struct Itl4Rec Itl4Rec;
242 typedef Itl4Rec *Itl4Ptr;
243 typedef Itl4Ptr *Itl4Handle;
244 /* New NItl4Rec for System 7.0: */
245 struct NItl4Rec {
246  short flags; /*reserved*/
247  long resourceType; /*contains 'itl4'*/
248  short resourceNum; /*resource ID*/
249  short version; /*version number*/
250  short format; /*format code*/
251  short resHeader; /*reserved*/
252  long resHeader2; /*reserved*/
253  short numTables; /*number of tables, one-based*/
254  long mapOffset; /*offset to table that maps byte to token*/
255  long strOffset; /*offset to routine that copies canonical string*/
256  long fetchOffset; /*offset to routine that gets next byte of character*/
257  long unTokenOffset; /*offset to table that maps token to canonical string*/
258  long defPartsOffset; /*offset to default number parts table*/
259  long whtSpListOffset; /*offset to white space code list*/
260  long resOffset7; /*reserved*/
261  long resOffset8; /*reserved*/
262  short resLength1; /*reserved*/
263  short resLength2; /*reserved*/
264  short resLength3; /*reserved*/
265  short unTokenLength; /*length of untoken table*/
266  short defPartsLength; /*length of default number parts table*/
267  short whtSpListLength; /*length of white space code list*/
268  short resLength7; /*reserved*/
269  short resLength8; /*reserved*/
270 };
271 typedef struct NItl4Rec NItl4Rec;
272 typedef NItl4Rec *NItl4Ptr;
273 typedef NItl4Ptr *NItl4Handle;
274 
276  OSType tableSignature; /*4 byte long table name */
277  unsigned long reserved; /*Reserved for internal use */
278  unsigned long tableStartOffset; /*Table start offset in byte*/
279  unsigned long tableSize; /*Table size in byte*/
280 };
282 struct Itl5Record {
283  Fixed versionNumber; /*itl5 resource version number */
284  unsigned short numberOfTables; /*Number of tables it contains */
285  unsigned short reserved[3]; /*Reserved for internal use */
286  TableDirectoryRecord tableDirectory[1]; /*Table directory records */
287 };
288 typedef struct Itl5Record Itl5Record;
290  short sourceType; /*Transliterate target type for the LHS of the rule */
291  short targetType; /*Transliterate target type for the RHS of the rule */
292  short formatNumber; /*Transliterate resource format number */
293  short propertyFlag; /*Transliterate property flags */
294  short numberOfRules; /*Number of rules following this field */
295 };
297 
298 struct ItlcRecord {
299  short itlcSystem; /*default system script*/
300  short itlcReserved; /*reserved*/
301  SInt8 itlcFontForce; /*default font force flag*/
302  SInt8 itlcIntlForce; /*default intl force flag*/
303  SInt8 itlcOldKybd; /*MacPlus intl keybd flag*/
304  SInt8 itlcFlags; /*general flags*/
305  short itlcIconOffset; /*keyboard icon offset; not used in 7.0*/
306  SInt8 itlcIconSide; /*keyboard icon side; not used in 7.0*/
307  SInt8 itlcIconRsvd; /*rsvd for other icon info*/
308  short itlcRegionCode; /*preferred verXxx code*/
309  short itlcSysFlags; /*flags for setting system globals*/
310  SInt8 itlcReserved4[32]; /*for future use*/
311 };
312 typedef struct ItlcRecord ItlcRecord;
313 struct ItlbRecord {
314  short itlbNumber; /*itl0 id number*/
315  short itlbDate; /*itl1 id number*/
316  short itlbSort; /*itl2 id number*/
317  short itlbFlags; /*Script flags*/
318  short itlbToken; /*itl4 id number*/
319  short itlbEncoding; /*itl5 ID # (optional; char encoding)*/
320  short itlbLang; /*current language for script */
321  SInt8 itlbNumRep; /*number representation code*/
322  SInt8 itlbDateRep; /*date representation code */
323  short itlbKeys; /*KCHR id number*/
324  short itlbIcon; /*ID # of SICN or kcs#/kcs4/kcs8 suite.*/
325 };
326 typedef struct ItlbRecord ItlbRecord;
327 /* New ItlbExtRecord structure for System 7.0 */
329  ItlbRecord base; /*un-extended ItlbRecord*/
330  long itlbLocalSize; /*size of script's local record*/
331  short itlbMonoFond; /*default monospace FOND ID*/
332  short itlbMonoSize; /*default monospace font size*/
333  short itlbPrefFond; /*preferred FOND ID*/
334  short itlbPrefSize; /*preferred font size*/
335  short itlbSmallFond; /*default small FOND ID*/
336  short itlbSmallSize; /*default small font size*/
337  short itlbSysFond; /*default system FOND ID*/
338  short itlbSysSize; /*default system font size*/
339  short itlbAppFond; /*default application FOND ID*/
340  short itlbAppSize; /*default application font size*/
341  short itlbHelpFond; /*default Help Mgr FOND ID*/
342  short itlbHelpSize; /*default Help Mgr font size*/
343  Style itlbValidStyles; /*set of valid styles for script*/
344  Style itlbAliasStyle; /*style (set) to mark aliases*/
345 };
346 typedef struct ItlbExtRecord ItlbExtRecord;
347 
348 #if PRAGMA_STRUCT_ALIGN
349 #pragma options align = reset
350 #elif PRAGMA_STRUCT_PACKPUSH
351 #pragma pack(pop)
352 #elif PRAGMA_STRUCT_PACK
353 #pragma pack()
354 #endif
355 
356 #ifdef PRAGMA_IMPORT_OFF
357 #pragma import off
358 #elif PRAGMA_IMPORT
359 #pragma import reset
360 #endif
361 
362 #ifdef __cplusplus
363 }
364 #endif
365 
366 #endif /* __INTLRESOURCES__ */
Basic Macintosh data types.
long Fixed
Definition: MacTypes.h:153
Definition: IntlResources.h:127
Definition: IntlResources.h:157
Definition: IntlResources.h:176
Definition: IntlResources.h:224
Definition: IntlResources.h:282
Definition: IntlResources.h:328
Definition: IntlResources.h:313
Definition: IntlResources.h:298
Definition: IntlResources.h:245
Definition: IntlResources.h:212
Definition: IntlResources.h:121
Definition: IntlResources.h:289
Definition: IntlResources.h:275
Definition: IntlResources.h:194
Definition: IntlResources.h:207
Definition: IntlResources.h:202