Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1422 lines
65 KiB

  1. /*
  2. File: Script.h
  3. Contains: Script Manager interfaces
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1986-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __SCRIPT__
  11. #define __SCRIPT__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __INTLRESOURCES__
  16. #include <IntlResources.h>
  17. #endif
  18. #if PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #if PRAGMA_IMPORT
  25. #pragma import on
  26. #endif
  27. #if PRAGMA_STRUCT_ALIGN
  28. #pragma options align=mac68k
  29. #elif PRAGMA_STRUCT_PACKPUSH
  30. #pragma pack(push, 2)
  31. #elif PRAGMA_STRUCT_PACK
  32. #pragma pack(2)
  33. #endif
  34. /* Meta script codes:*/
  35. enum {
  36. smSystemScript = -1, /* designates system script.*/
  37. smCurrentScript = -2, /* designates current font script.*/
  38. smAllScripts = -3 /* designates any script*/
  39. };
  40. /*
  41. Script codes:
  42. These specify a Mac OS encoding that is related to a FOND ID range.
  43. Some of the encodings have several variants (e.g. for different localized systems)
  44. which all share the same script code.
  45. Not all of these script codes are currently supported by Apple software.
  46. Notes:
  47. - Script code 0 (smRoman) is also used (instead of smGreek) for the Greek encoding
  48. in the Greek localized system.
  49. - Script code 28 (smEthiopic) is also used for the Inuit encoding in the Inuktitut
  50. system.
  51. */
  52. enum {
  53. smRoman = 0,
  54. smJapanese = 1,
  55. smTradChinese = 2, /* Traditional Chinese*/
  56. smKorean = 3,
  57. smArabic = 4,
  58. smHebrew = 5,
  59. smGreek = 6,
  60. smCyrillic = 7,
  61. smRSymbol = 8, /* Right-left symbol*/
  62. smDevanagari = 9,
  63. smGurmukhi = 10,
  64. smGujarati = 11,
  65. smOriya = 12,
  66. smBengali = 13,
  67. smTamil = 14,
  68. smTelugu = 15,
  69. smKannada = 16, /* Kannada/Kanarese*/
  70. smMalayalam = 17,
  71. smSinhalese = 18,
  72. smBurmese = 19,
  73. smKhmer = 20, /* Khmer/Cambodian*/
  74. smThai = 21,
  75. smLao = 22,
  76. smGeorgian = 23,
  77. smArmenian = 24,
  78. smSimpChinese = 25, /* Simplified Chinese*/
  79. smTibetan = 26,
  80. smMongolian = 27,
  81. smEthiopic = 28,
  82. smGeez = 28, /* Synonym for smEthiopic*/
  83. smCentralEuroRoman = 29, /* For Czech, Slovak, Polish, Hungarian, Baltic langs*/
  84. smVietnamese = 30,
  85. smExtArabic = 31, /* extended Arabic*/
  86. smUninterp = 32 /* uninterpreted symbols, e.g. palette symbols*/
  87. };
  88. /* Extended script code for full Unicode input*/
  89. enum {
  90. smUnicodeScript = 0x7E
  91. };
  92. /* Obsolete script code names (kept for backward compatibility):*/
  93. enum {
  94. smChinese = 2, /* (Use smTradChinese or smSimpChinese)*/
  95. smRussian = 7, /* Use smCyrillic*/
  96. /* smMaldivian = 25: deleted, no code for Maldivian*/
  97. smLaotian = 22, /* Use smLao */
  98. smAmharic = 28, /* Use smEthiopic or smGeez*/
  99. smSlavic = 29, /* Use smCentralEuroRoman*/
  100. smEastEurRoman = 29, /* Use smCentralEuroRoman*/
  101. smSindhi = 31, /* Use smExtArabic*/
  102. smKlingon = 32
  103. };
  104. /*
  105. Language codes:
  106. These specify a language implemented using a particular Mac OS encoding.
  107. Not all of these language codes are currently supported by Apple software.
  108. */
  109. enum {
  110. langEnglish = 0, /* smRoman script*/
  111. langFrench = 1, /* smRoman script*/
  112. langGerman = 2, /* smRoman script*/
  113. langItalian = 3, /* smRoman script*/
  114. langDutch = 4, /* smRoman script*/
  115. langSwedish = 5, /* smRoman script*/
  116. langSpanish = 6, /* smRoman script*/
  117. langDanish = 7, /* smRoman script*/
  118. langPortuguese = 8, /* smRoman script*/
  119. langNorwegian = 9, /* smRoman script*/
  120. langHebrew = 10, /* smHebrew script*/
  121. langJapanese = 11, /* smJapanese script*/
  122. langArabic = 12, /* smArabic script*/
  123. langFinnish = 13, /* smRoman script*/
  124. langGreek = 14, /* Greek script using smRoman script code*/
  125. langIcelandic = 15, /* modified smRoman/Icelandic script*/
  126. langMaltese = 16, /* Roman script*/
  127. langTurkish = 17, /* modified smRoman/Turkish script*/
  128. langCroatian = 18, /* modified smRoman/Croatian script*/
  129. langTradChinese = 19, /* Chinese (Mandarin) in traditional characters*/
  130. langUrdu = 20, /* smArabic script*/
  131. langHindi = 21, /* smDevanagari script*/
  132. langThai = 22, /* smThai script*/
  133. langKorean = 23 /* smKorean script*/
  134. };
  135. enum {
  136. langLithuanian = 24, /* smCentralEuroRoman script*/
  137. langPolish = 25, /* smCentralEuroRoman script*/
  138. langHungarian = 26, /* smCentralEuroRoman script*/
  139. langEstonian = 27, /* smCentralEuroRoman script*/
  140. langLatvian = 28, /* smCentralEuroRoman script*/
  141. langSami = 29, /* language of the Sami people of N. Scandinavia */
  142. langFaroese = 30, /* modified smRoman/Icelandic script */
  143. langFarsi = 31, /* modified smArabic/Farsi script*/
  144. langPersian = 31, /* Synonym for langFarsi*/
  145. langRussian = 32, /* smCyrillic script*/
  146. langSimpChinese = 33, /* Chinese (Mandarin) in simplified characters*/
  147. langFlemish = 34, /* smRoman script*/
  148. langIrishGaelic = 35, /* smRoman or modified smRoman/Celtic script (without dot above) */
  149. langAlbanian = 36, /* smRoman script*/
  150. langRomanian = 37, /* modified smRoman/Romanian script*/
  151. langCzech = 38, /* smCentralEuroRoman script*/
  152. langSlovak = 39, /* smCentralEuroRoman script*/
  153. langSlovenian = 40, /* modified smRoman/Croatian script*/
  154. langYiddish = 41, /* smHebrew script*/
  155. langSerbian = 42, /* smCyrillic script*/
  156. langMacedonian = 43, /* smCyrillic script*/
  157. langBulgarian = 44, /* smCyrillic script*/
  158. langUkrainian = 45, /* modified smCyrillic/Ukrainian script*/
  159. langByelorussian = 46, /* smCyrillic script*/
  160. langBelorussian = 46 /* Synonym for langByelorussian */
  161. };
  162. enum {
  163. langUzbek = 47, /* Cyrillic script*/
  164. langKazakh = 48, /* Cyrillic script*/
  165. langAzerbaijani = 49, /* Azerbaijani in Cyrillic script*/
  166. langAzerbaijanAr = 50, /* Azerbaijani in Arabic script*/
  167. langArmenian = 51, /* smArmenian script*/
  168. langGeorgian = 52, /* smGeorgian script*/
  169. langMoldavian = 53, /* smCyrillic script*/
  170. langKirghiz = 54, /* Cyrillic script*/
  171. langTajiki = 55, /* Cyrillic script*/
  172. langTurkmen = 56, /* Cyrillic script*/
  173. langMongolian = 57, /* Mongolian in smMongolian script*/
  174. langMongolianCyr = 58, /* Mongolian in Cyrillic script*/
  175. langPashto = 59, /* Arabic script*/
  176. langKurdish = 60, /* smArabic script*/
  177. langKashmiri = 61, /* Arabic script*/
  178. langSindhi = 62, /* Arabic script*/
  179. langTibetan = 63, /* smTibetan script*/
  180. langNepali = 64, /* smDevanagari script*/
  181. langSanskrit = 65, /* smDevanagari script*/
  182. langMarathi = 66, /* smDevanagari script*/
  183. langBengali = 67, /* smBengali script*/
  184. langAssamese = 68, /* smBengali script*/
  185. langGujarati = 69, /* smGujarati script*/
  186. langPunjabi = 70 /* smGurmukhi script*/
  187. };
  188. enum {
  189. langOriya = 71, /* smOriya script*/
  190. langMalayalam = 72, /* smMalayalam script*/
  191. langKannada = 73, /* smKannada script*/
  192. langTamil = 74, /* smTamil script*/
  193. langTelugu = 75, /* smTelugu script*/
  194. langSinhalese = 76, /* smSinhalese script*/
  195. langBurmese = 77, /* smBurmese script*/
  196. langKhmer = 78, /* smKhmer script*/
  197. langLao = 79, /* smLao script*/
  198. langVietnamese = 80, /* smVietnamese script*/
  199. langIndonesian = 81, /* smRoman script*/
  200. langTagalog = 82, /* Roman script*/
  201. langMalayRoman = 83, /* Malay in smRoman script*/
  202. langMalayArabic = 84, /* Malay in Arabic script*/
  203. langAmharic = 85, /* smEthiopic script*/
  204. langTigrinya = 86, /* smEthiopic script*/
  205. langOromo = 87, /* smEthiopic script*/
  206. langSomali = 88, /* smRoman script*/
  207. langSwahili = 89, /* smRoman script*/
  208. langKinyarwanda = 90, /* smRoman script*/
  209. langRuanda = 90, /* synonym for langKinyarwanda*/
  210. langRundi = 91, /* smRoman script*/
  211. langNyanja = 92, /* smRoman script*/
  212. langChewa = 92, /* synonym for langNyanja*/
  213. langMalagasy = 93, /* smRoman script*/
  214. langEsperanto = 94 /* Roman script*/
  215. };
  216. enum {
  217. langWelsh = 128, /* modified smRoman/Celtic script*/
  218. langBasque = 129, /* smRoman script*/
  219. langCatalan = 130, /* smRoman script*/
  220. langLatin = 131, /* smRoman script*/
  221. langQuechua = 132, /* smRoman script*/
  222. langGuarani = 133, /* smRoman script*/
  223. langAymara = 134, /* smRoman script*/
  224. langTatar = 135, /* Cyrillic script*/
  225. langUighur = 136, /* Arabic script*/
  226. langDzongkha = 137, /* (lang of Bhutan) smTibetan script*/
  227. langJavaneseRom = 138, /* Javanese in smRoman script*/
  228. langSundaneseRom = 139, /* Sundanese in smRoman script*/
  229. langGalician = 140, /* smRoman script*/
  230. langAfrikaans = 141 /* smRoman script */
  231. };
  232. enum {
  233. langBreton = 142, /* smRoman or modified smRoman/Celtic script */
  234. langInuktitut = 143, /* Inuit script using smEthiopic script code */
  235. langScottishGaelic = 144, /* smRoman or modified smRoman/Celtic script */
  236. langManxGaelic = 145, /* smRoman or modified smRoman/Celtic script */
  237. langIrishGaelicScript = 146, /* modified smRoman/Gaelic script (using dot above) */
  238. langTongan = 147, /* smRoman script */
  239. langGreekPoly = 148, /* smGreek script */
  240. langGreenlandic = 149, /* smRoman script */
  241. langAzerbaijanRoman = 150 /* Azerbaijani in Roman script */
  242. };
  243. enum {
  244. langUnspecified = 32767 /* Special code for use in resources (such as 'itlm') */
  245. };
  246. /*
  247. Obsolete language code names (kept for backward compatibility):
  248. Misspelled, ambiguous, misleading, considered pejorative, archaic, etc.
  249. */
  250. enum {
  251. langPortugese = 8, /* Use langPortuguese*/
  252. langMalta = 16, /* Use langMaltese*/
  253. langYugoslavian = 18, /* (use langCroatian, langSerbian, etc.)*/
  254. langChinese = 19, /* (use langTradChinese or langSimpChinese)*/
  255. langLettish = 28, /* Use langLatvian */
  256. langLapponian = 29, /* Use langSami*/
  257. langLappish = 29, /* Use langSami*/
  258. langSaamisk = 29, /* Use langSami */
  259. langFaeroese = 30, /* Use langFaroese */
  260. langIrish = 35, /* Use langIrishGaelic */
  261. langGalla = 87, /* Use langOromo */
  262. langAfricaans = 141 /* Use langAfrikaans */
  263. };
  264. /*
  265. Region codes:
  266. These typically specify a combination of a language code and a particular region.
  267. Some of these numeric values are reserved just for extra resource IDs associated
  268. with certain regions; these are not actual region codes, and are noted in the comments.
  269. Not all of the region codes are currently supported by Apple software.
  270. When relevant, the following list also provides:
  271. - The Apple part number (P/N) code for software localized for the specified region.
  272. - The two-letter ISO language and country codes (from ISO 639 and ISO 3166). The
  273. language code (lowercase) is first, then '_', then the country code (uppercase).
  274. */
  275. enum {
  276. /* P/N ISO codes comments*/
  277. verUS = 0, /* en_US*/
  278. verFrance = 1, /* F fr_FR*/
  279. verBritain = 2, /* B en_GB*/
  280. verGermany = 3, /* D de_DE*/
  281. verItaly = 4, /* T it_IT*/
  282. verNetherlands = 5, /* N nl_NL*/
  283. verFlemish = 6, /* FN nl_BE Flemish (Dutch) for Belgium */
  284. verSweden = 7, /* S sv_SE*/
  285. verSpain = 8, /* E es_ES Spanish for Spain*/
  286. verDenmark = 9, /* DK da_DK*/
  287. verPortugal = 10, /* PO pt_PT Portuguese for Portugal*/
  288. verFrCanada = 11, /* C fr_CA French for Canada*/
  289. verNorway = 12, /* H no_NO,nb_NO Bokm.l*/
  290. verIsrael = 13, /* HB he_IL,iw_IL Hebrew*/
  291. verJapan = 14, /* J ja_JP*/
  292. verAustralia = 15, /* X en_AU English for Australia*/
  293. verArabic = 16, /* AB ar Arabic for N Africa, Arabian peninsula, Levant*/
  294. verFinland = 17, /* K fi_FI*/
  295. verFrSwiss = 18, /* SF fr_CH French Swiss*/
  296. verGrSwiss = 19, /* SD de_CH German Swiss*/
  297. verGreece = 20, /* GR el_GR Monotonic Greek (modern)*/
  298. verIceland = 21, /* IS is_IS*/
  299. verMalta = 22, /* MA mt_MT*/
  300. verCyprus = 23, /* CY _CY Greek or Turkish language? Checking...*/
  301. verTurkey = 24, /* TU tr_TR*/
  302. verYugoCroatian = 25 /* YU Croatian for Yugoslavia; now use verCroatia (68)*/
  303. };
  304. enum {
  305. verNetherlandsComma = 26, /* ID for KCHR resource - Dutch*/
  306. verBelgiumLuxPoint = 27, /* ID for KCHR resource - Belgium*/
  307. verCanadaComma = 28, /* ID for KCHR resource - Canadian ISO*/
  308. verCanadaPoint = 29, /* ID for KCHR resource - Canadian; now unused*/
  309. vervariantPortugal = 30, /* ID for resource; now unused*/
  310. vervariantNorway = 31, /* ID for resource; now unused*/
  311. vervariantDenmark = 32 /* ID for KCHR resource - Danish Mac Plus*/
  312. };
  313. enum {
  314. verIndiaHindi = 33, /* hi_IN Hindi for India*/
  315. verPakistanUrdu = 34, /* UR ur_PK Urdu for Pakistan */
  316. verTurkishModified = 35,
  317. verItalianSwiss = 36, /* ST it_CH Italian Swiss*/
  318. verInternational = 37, /* Z en English for international use */
  319. /* 38 is unassigned*/
  320. verRomania = 39, /* RO ro_RO*/
  321. verGreecePoly = 40, /* grc Polytonic Greek (classical) */
  322. verLithuania = 41, /* LT lt_LT*/
  323. verPoland = 42, /* PL pl_PL*/
  324. verHungary = 43, /* MG hu_HU*/
  325. verEstonia = 44, /* EE et_EE*/
  326. verLatvia = 45, /* LV lv_LV*/
  327. verSami = 46, /* se */
  328. verFaroeIsl = 47, /* FA fo_FO */
  329. verIran = 48, /* PS fa_IR Persian/Farsi*/
  330. verRussia = 49, /* RS ru_RU Russian*/
  331. verIreland = 50, /* GA ga_IE Irish Gaelic for Ireland (without dot above) */
  332. verKorea = 51, /* KH ko_KR*/
  333. verChina = 52, /* CH zh_CN Simplified Chinese*/
  334. verTaiwan = 53, /* TA zh_TW Traditional Chinese*/
  335. verThailand = 54, /* TH th_TH*/
  336. verScriptGeneric = 55, /* SS Generic script system (no language or script) */
  337. verCzech = 56, /* CZ cs_CZ*/
  338. verSlovak = 57, /* SL sk_SK*/
  339. verFarEastGeneric = 58, /* FE Generic Far East system (no language or script) */
  340. verMagyar = 59, /* Unused; see verHungary*/
  341. verBengali = 60, /* bn Bangladesh or India*/
  342. verByeloRussian = 61 /* BY be_BY*/
  343. };
  344. enum {
  345. verUkraine = 62, /* UA uk_UA*/
  346. /* 63 is unassigned*/
  347. verGreeceAlt = 64, /* unused */
  348. verSerbian = 65, /* SR sr_YU,sh_YU */
  349. verSlovenian = 66, /* SV sl_SI */
  350. verMacedonian = 67, /* MD mk_MK */
  351. verCroatia = 68, /* CR hr_HR,sh_HR*/
  352. /* 69 is unassigned*/
  353. verGermanReformed = 70, /* de_DE Reformed orthography (used formerly unassigned 70) */
  354. verBrazil = 71, /* BR pt_BR Portuguese for Brazil*/
  355. verBulgaria = 72, /* BG bg_BG*/
  356. verCatalonia = 73, /* CA ca_ES Catalan for Spain*/
  357. verMultilingual = 74, /* ZM mul (no language or script)*/
  358. verScottishGaelic = 75, /* GD gd*/
  359. verManxGaelic = 76, /* GV gv Isle of Man*/
  360. verBreton = 77, /* BZ br*/
  361. verNunavut = 78, /* IU iu_CA Inuktitut for Canada*/
  362. verWelsh = 79, /* CU cy*/
  363. /* 80 is ID for KCHR resource - Canadian CSA*/
  364. verIrishGaelicScript = 81, /* GS ga_IE Irish Gaelic for Ireland (using dot above)*/
  365. verEngCanada = 82, /* V en_CA English for Canada*/
  366. verBhutan = 83, /* BH dz_BT Dzongkha for Bhutan*/
  367. verArmenian = 84, /* HY hy_AM*/
  368. verGeorgian = 85, /* KR ka_GE*/
  369. verSpLatinAmerica = 86, /* LA es Spanish for Latin America*/
  370. /* 87 is ID for KCHR resource - Spanish ISO*/
  371. verTonga = 88, /* TS to_TO*/
  372. /* 89 is ID for KCHR resource - Polish Modified*/
  373. /* 90 is ID for KCHR resource - Catalan ISO*/
  374. verFrenchUniversal = 91, /* fr French generic*/
  375. verAustria = 92, /* AU de_AT German for Austria*/
  376. /* Y 93 is unused alternate for verSpLatinAmerica*/
  377. verGujarati = 94, /* gu_IN*/
  378. verPunjabi = 95, /* pa Pakistan or India*/
  379. verIndiaUrdu = 96, /* ur_IN Urdu for India*/
  380. verVietnam = 97 /* vi_VN*/
  381. };
  382. enum {
  383. verFrBelgium = 98, /* BF fr_BE French for Belgium */
  384. verUzbek = 99, /* BD uz_UZ */
  385. verSingapore = 100, /* SG */
  386. verNynorsk = 101, /* NY nn_NO Norwegian Nynorsk */
  387. verAfrikaans = 102, /* AK af_ZA */
  388. verEsperanto = 103, /* eo */
  389. verMarathi = 104, /* mr_IN */
  390. verTibetan = 105, /* bo */
  391. verNepal = 106, /* ne_NP */
  392. verGreenland = 107, /* kl */
  393. verIrelandEnglish = 108 /* en_IE English for Ireland, with Euro for currency*/
  394. };
  395. /*
  396. Other extra resource IDs assigned in the same number space:
  397. 179 is ID for KCHR & itl_ resources - Cornish
  398. 581 is ID for KCHR resource - Irish Gaelic script alternate
  399. 582 is ID for KCHR resource - Ogham
  400. 779 is ID for KCHR resource - Welsh alternate
  401. 1111 is ID for KCHR resource - French numeric
  402. */
  403. /*
  404. Obsolete region code names (kept for backward compatibility):
  405. Misspelled or alternate form, ambiguous, misleading, considered pejorative, archaic, etc.
  406. */
  407. enum {
  408. verFrBelgiumLux = 6, /* Incorrect; 6 is Flemish, not French, for Belgium; use verFlemish */
  409. verBelgiumLux = 6, /* Use verFlemish*/
  410. verArabia = 16, /* Use verArabic*/
  411. verYugoslavia = 25, /* Use verYugoCroatian (same number, now unused), or newer verCroatia*/
  412. verIndia = 33, /* Use verIndiaHindi*/
  413. verPakistan = 34, /* Use verPakistanUrdu */
  414. verRumania = 39, /* Alternate for verRomania */
  415. verGreekAncient = 40, /* Use verGreecePoly */
  416. verLapland = 46, /* Use verSami */
  417. verFaeroeIsl = 47, /* Use verFaroeIsl */
  418. verGenericFE = 58, /* Use verFarEastGeneric */
  419. verBelarus = 61, /* Alternate for verByelorussian */
  420. verUkrania = 62, /* Use verUkraine*/
  421. verAlternateGr = 64, /* Use verGreeceAlt */
  422. verSerbia = 65, /* Alternate for verSerbian */
  423. verSlovenia = 66, /* Alternate for verSlovenian */
  424. verMacedonia = 67, /* Alternate for verMacedonian */
  425. verBrittany = 77, /* Alternate for verBreton */
  426. verWales = 79, /* Alternate for verWelsh */
  427. verArmenia = 84, /* Alternate for verArmenian */
  428. verGeorgia = 85, /* Alternate for verGeorgian */
  429. verAustriaGerman = 92, /* Use verAustria */
  430. verTibet = 105 /* Use verTibetan */
  431. };
  432. enum {
  433. minCountry = verUS,
  434. maxCountry = verGreenland
  435. };
  436. enum {
  437. /* Calendar Codes */
  438. calGregorian = 0,
  439. calArabicCivil = 1,
  440. calArabicLunar = 2,
  441. calJapanese = 3,
  442. calJewish = 4,
  443. calCoptic = 5,
  444. calPersian = 6
  445. };
  446. enum {
  447. /* Integer Format Codes */
  448. intWestern = 0,
  449. intArabic = 1,
  450. intRoman = 2,
  451. intJapanese = 3,
  452. intEuropean = 4,
  453. intOutputMask = 0x8000
  454. };
  455. enum {
  456. /* CharByte byte types */
  457. smSingleByte = 0,
  458. smFirstByte = -1,
  459. smLastByte = 1,
  460. smMiddleByte = 2
  461. };
  462. enum {
  463. /* CharType field masks */
  464. smcTypeMask = 0x000F,
  465. smcReserved = 0x00F0,
  466. smcClassMask = 0x0F00,
  467. smcOrientationMask = 0x1000, /*two-byte script glyph orientation*/
  468. smcRightMask = 0x2000,
  469. smcUpperMask = 0x4000,
  470. smcDoubleMask = 0x8000
  471. };
  472. enum {
  473. /* Basic CharType character types */
  474. smCharPunct = 0x0000,
  475. smCharAscii = 0x0001,
  476. smCharEuro = 0x0007,
  477. smCharExtAscii = 0x0007, /* More correct synonym for smCharEuro */
  478. /* Additional CharType character types for script systems */
  479. smCharKatakana = 0x0002, /*Japanese Katakana*/
  480. smCharHiragana = 0x0003, /*Japanese Hiragana*/
  481. smCharIdeographic = 0x0004, /*Hanzi, Kanji, Hanja*/
  482. smCharTwoByteGreek = 0x0005, /*2-byte Greek in Far East systems*/
  483. smCharTwoByteRussian = 0x0006, /*2-byte Cyrillic in Far East systems*/
  484. smCharBidirect = 0x0008, /*Arabic/Hebrew*/
  485. smCharContextualLR = 0x0009, /*Contextual left-right: Thai, Indic scripts*/
  486. smCharNonContextualLR = 0x000A, /*Non-contextual left-right: Cyrillic, Greek*/
  487. smCharHangul = 0x000C, /*Korean Hangul*/
  488. smCharJamo = 0x000D, /*Korean Jamo*/
  489. smCharBopomofo = 0x000E, /*Chinese Bopomofo*/
  490. smCharGanaKana = 0x000F, /*Shared for Japanese Hiragana & Katakana*/
  491. /* old names for some of above, for backward compatibility */
  492. smCharFISKana = 0x0002, /*Katakana*/
  493. smCharFISGana = 0x0003, /*Hiragana*/
  494. smCharFISIdeo = 0x0004 /*Hanzi, Kanji, Hanja*/
  495. };
  496. enum {
  497. smCharFISGreek = 0x0005, /*2-byte Greek in Far East systems*/
  498. smCharFISRussian = 0x0006, /*2-byte Cyrillic in Far East systems*/
  499. /* CharType classes for punctuation (smCharPunct) */
  500. smPunctNormal = 0x0000,
  501. smPunctNumber = 0x0100,
  502. smPunctSymbol = 0x0200,
  503. smPunctBlank = 0x0300, /* Additional CharType classes for punctuation in two-byte systems */
  504. smPunctRepeat = 0x0400, /* repeat marker */
  505. smPunctGraphic = 0x0500, /* line graphics */
  506. /* CharType Katakana and Hiragana classes for two-byte systems */
  507. smKanaSmall = 0x0100, /*small kana character*/
  508. smKanaHardOK = 0x0200, /*can have dakuten*/
  509. smKanaSoftOK = 0x0300, /*can have dakuten or han-dakuten*/
  510. /* CharType Ideographic classes for two-byte systems */
  511. smIdeographicLevel1 = 0x0000, /*level 1 char*/
  512. smIdeographicLevel2 = 0x0100, /*level 2 char*/
  513. smIdeographicUser = 0x0200, /*user char*/
  514. /* old names for above, for backward compatibility */
  515. smFISClassLvl1 = 0x0000, /*level 1 char*/
  516. smFISClassLvl2 = 0x0100, /*level 2 char*/
  517. smFISClassUser = 0x0200, /*user char*/
  518. /* CharType Jamo classes for Korean systems */
  519. smJamoJaeum = 0x0000, /*simple consonant char*/
  520. smJamoBogJaeum = 0x0100, /*complex consonant char*/
  521. smJamoMoeum = 0x0200, /*simple vowel char*/
  522. smJamoBogMoeum = 0x0300 /*complex vowel char*/
  523. };
  524. enum {
  525. /* CharType glyph orientation for two-byte systems */
  526. smCharHorizontal = 0x0000, /* horizontal character form, or for both */
  527. smCharVertical = 0x1000, /* vertical character form */
  528. /* CharType directions */
  529. smCharLeft = 0x0000,
  530. smCharRight = 0x2000, /* CharType case modifers */
  531. smCharLower = 0x0000,
  532. smCharUpper = 0x4000, /* CharType character size modifiers (1 or multiple bytes). */
  533. smChar1byte = 0x0000,
  534. smChar2byte = 0x8000
  535. };
  536. enum {
  537. /* TransliterateText target types for Roman */
  538. smTransAscii = 0, /*convert to ASCII*/
  539. smTransNative = 1, /*convert to font script*/
  540. smTransCase = 0xFE, /*convert case for all text*/
  541. smTransSystem = 0xFF, /*convert to system script*/
  542. /* TransliterateText target types for two-byte scripts */
  543. smTransAscii1 = 2, /*1-byte Roman*/
  544. smTransAscii2 = 3, /*2-byte Roman*/
  545. smTransKana1 = 4, /*1-byte Japanese Katakana*/
  546. smTransKana2 = 5 /*2-byte Japanese Katakana*/
  547. };
  548. enum {
  549. smTransGana2 = 7, /*2-byte Japanese Hiragana (no 1-byte Hiragana)*/
  550. smTransHangul2 = 8, /*2-byte Korean Hangul*/
  551. smTransJamo2 = 9, /*2-byte Korean Jamo*/
  552. smTransBopomofo2 = 10, /*2-byte Chinese Bopomofo*/
  553. /* TransliterateText target modifiers */
  554. smTransLower = 0x4000, /*target becomes lowercase*/
  555. smTransUpper = 0x8000, /*target becomes uppercase*/
  556. /* TransliterateText resource format numbers */
  557. smTransRuleBaseFormat = 1, /*Rule based trsl resource format */
  558. smTransHangulFormat = 2, /*Table based Hangul trsl resource format*/
  559. /* TransliterateText property flags */
  560. smTransPreDoubleByting = 1, /*Convert all text to double byte before transliteration*/
  561. smTransPreLowerCasing = 2 /*Convert all text to lower case before transliteration*/
  562. };
  563. enum {
  564. /* TransliterateText source mask - general */
  565. smMaskAll = (long)0xFFFFFFFF, /*Convert all text*/
  566. /* TransliterateText source masks */
  567. smMaskAscii = 0x00000001, /*2^smTransAscii*/
  568. smMaskNative = 0x00000002, /*2^smTransNative*/
  569. /* TransliterateText source masks for two-byte scripts */
  570. smMaskAscii1 = 0x00000004, /*2^smTransAscii1*/
  571. smMaskAscii2 = 0x00000008, /*2^smTransAscii2*/
  572. smMaskKana1 = 0x00000010, /*2^smTransKana1*/
  573. smMaskKana2 = 0x00000020, /*2^smTransKana2*/
  574. smMaskGana2 = 0x00000080, /*2^smTransGana2*/
  575. smMaskHangul2 = 0x00000100, /*2^smTransHangul2*/
  576. smMaskJamo2 = 0x00000200, /*2^smTransJamo2*/
  577. smMaskBopomofo2 = 0x00000400 /*2^smTransBopomofo2*/
  578. };
  579. enum {
  580. /* Result values from GetScriptManagerVariable and SetScriptManagerVariable calls. */
  581. smNotInstalled = 0, /*routine not available in script*/
  582. smBadVerb = -1, /*Bad verb passed to a routine*/
  583. smBadScript = -2 /*Bad script code passed to a routine*/
  584. };
  585. enum {
  586. /* Values for script redraw flag. */
  587. smRedrawChar = 0, /*Redraw character only*/
  588. smRedrawWord = 1, /*Redraw entire word (2-byte systems)*/
  589. smRedrawLine = -1 /*Redraw entire line (bidirectional systems)*/
  590. };
  591. enum {
  592. /* GetScriptManagerVariable and SetScriptManagerVariable verbs */
  593. smVersion = 0, /*Script Manager version number*/
  594. smMunged = 2, /*Globals change count*/
  595. smEnabled = 4, /*Count of enabled scripts, incl Roman*/
  596. smBidirect = 6, /*At least one bidirectional script*/
  597. smFontForce = 8, /*Force font flag*/
  598. smIntlForce = 10, /*Force intl flag*/
  599. smForced = 12, /*Script was forced to system script*/
  600. smDefault = 14, /*Script was defaulted to Roman script*/
  601. smPrint = 16, /*Printer action routine*/
  602. smSysScript = 18, /*System script*/
  603. smLastScript = 20, /*Last keyboard script*/
  604. smKeyScript = 22, /*Keyboard script*/
  605. smSysRef = 24, /*System folder refNum*/
  606. smKeyCache = 26, /*obsolete*/
  607. smKeySwap = 28, /*Swapping table handle*/
  608. smGenFlags = 30, /*General flags long*/
  609. smOverride = 32, /*Script override flags*/
  610. smCharPortion = 34, /*Ch vs SpExtra proportion*/
  611. /* New for System 7.0: */
  612. smDoubleByte = 36, /*Flag for double-byte script installed*/
  613. smKCHRCache = 38, /*Returns pointer to KCHR cache*/
  614. smRegionCode = 40, /*Returns current region code (verXxx)*/
  615. smKeyDisableState = 42 /*Returns current keyboard disable state*/
  616. };
  617. enum {
  618. /* GetScriptVariable and SetScriptVariable verbs. */
  619. /* Note: Verbs private to script systems are negative, while */
  620. /* those general across script systems are non-negative. */
  621. smScriptVersion = 0, /*Script software version*/
  622. smScriptMunged = 2, /*Script entry changed count*/
  623. smScriptEnabled = 4, /*Script enabled flag*/
  624. smScriptRight = 6, /*Right to left flag*/
  625. smScriptJust = 8, /*Justification flag*/
  626. smScriptRedraw = 10, /*Word redraw flag*/
  627. smScriptSysFond = 12, /*Preferred system font*/
  628. smScriptAppFond = 14, /*Preferred Application font*/
  629. smScriptBundle = 16, /*Beginning of itlb verbs*/
  630. smScriptNumber = 16, /*Script itl0 id*/
  631. smScriptDate = 18, /*Script itl1 id*/
  632. smScriptSort = 20, /*Script itl2 id*/
  633. smScriptFlags = 22, /*flags word*/
  634. smScriptToken = 24, /*Script itl4 id*/
  635. smScriptEncoding = 26, /*id of optional itl5, if present*/
  636. smScriptLang = 28 /*Current language for script*/
  637. };
  638. enum {
  639. smScriptNumDate = 30, /*Script Number/Date formats.*/
  640. smScriptKeys = 32, /*Script KCHR id*/
  641. smScriptIcon = 34, /*ID # of SICN or kcs#/kcs4/kcs8 suite*/
  642. smScriptPrint = 36, /*Script printer action routine*/
  643. smScriptTrap = 38, /*Trap entry pointer*/
  644. smScriptCreator = 40, /*Script file creator*/
  645. smScriptFile = 42, /*Script file name*/
  646. smScriptName = 44, /*Script name*/
  647. /* There is a hole here for old Kanji private verbs 46-76 */
  648. /* New for System 7.0: */
  649. smScriptMonoFondSize = 78, /*default monospace FOND (hi) & size (lo)*/
  650. smScriptPrefFondSize = 80, /*preferred FOND (hi) & size (lo)*/
  651. smScriptSmallFondSize = 82, /*default small FOND (hi) & size (lo)*/
  652. smScriptSysFondSize = 84, /*default system FOND (hi) & size (lo)*/
  653. smScriptAppFondSize = 86, /*default app FOND (hi) & size (lo)*/
  654. smScriptHelpFondSize = 88, /*default Help Mgr FOND (hi) & size (lo)*/
  655. smScriptValidStyles = 90, /*mask of valid styles for script*/
  656. smScriptAliasStyle = 92 /*style (set) to use for aliases*/
  657. };
  658. /* special negative verbs for Get/SetScriptVariable that were associated with WorldScriptI */
  659. /* move them here to be public */
  660. enum {
  661. /* WorldScript private verbs */
  662. smLayoutCache = -309, /* HiWrd(param) is # entries, LoWrd is max input length*/
  663. smOldVerbSupport = -311, /* param is added to old verbs to map to WSI verb*/
  664. smSetKashidas = -291, /* param is ON or OFF, old verb = -36*/
  665. smSetKashProp = -287, /* param is kashida proportion, old verb = -32*/
  666. smScriptSysBase = -281, /* param is associated font to use w/ system font (old verb = -26)*/
  667. smScriptAppBase = -283, /* param is associated font to use w/ app font (old verb = -28)*/
  668. smScriptFntBase = -285, /* param is associated font to use w/ all other fonts (old verb = -30)*/
  669. smScriptLigatures = -263, /* old verb = -8*/
  670. smScriptNumbers = -267 /* old verb = -12*/
  671. };
  672. enum {
  673. /* Special script code values for International Utilities */
  674. iuSystemScript = -1, /* <obsolete> system script */
  675. iuCurrentScript = -2 /* <obsolete> current script (for font of grafPort) */
  676. };
  677. enum {
  678. /* Negative verbs for KeyScript */
  679. smKeyNextScript = -1, /* Switch to next available script */
  680. smKeySysScript = -2, /* Switch to the system script */
  681. smKeySwapScript = -3, /* Switch to previously-used script */
  682. /* New for System 7.0: */
  683. smKeyNextKybd = -4, /* Switch to next keyboard in current keyscript */
  684. smKeySwapKybd = -5, /* Switch to previously-used keyboard in current keyscript */
  685. smKeyDisableKybds = -6, /* Disable keyboards not in system or Roman script */
  686. smKeyEnableKybds = -7, /* Re-enable keyboards for all enabled scripts */
  687. smKeyToggleInline = -8, /* Toggle inline input for current keyscript */
  688. smKeyToggleDirection = -9, /* Toggle default line direction (TESysJust) */
  689. smKeyNextInputMethod = -10, /* Switch to next input method in current keyscript */
  690. smKeySwapInputMethod = -11, /* Switch to last-used input method in current keyscript */
  691. smKeyDisableKybdSwitch = -12, /* Disable switching from the current keyboard */
  692. smKeySetDirLeftRight = -15, /* Set default line dir to left-right, align left */
  693. smKeySetDirRightLeft = -16, /* Set default line dir to right-left, align right */
  694. smKeyRoman = -17 /* Set keyscript to Roman. Does nothing if Roman-only system, unlike KeyScript(smRoman) which forces an update to current default Roman keyboard */
  695. };
  696. /* Optional font and keyboard script synchronization */
  697. enum {
  698. /* One more flag in the smGenFlags long. */
  699. smfDisableKeyScriptSync = 27 /*Disable font and keyboard script synchronization*/
  700. };
  701. enum {
  702. /* We should define masks, too. */
  703. smfDisableKeyScriptSyncMask = 1L << smfDisableKeyScriptSync /*Disable font and keyboard script synchronization mask*/
  704. };
  705. enum {
  706. /* Force keyboard script switching flag and mask for zero and positive KeyScript verbs */
  707. smKeyForceKeyScriptBit = 7, /* Force keyboard script switching flag */
  708. smKeyForceKeyScriptMask = 1 << smKeyForceKeyScriptBit /* its mask */
  709. };
  710. enum {
  711. /* Bits in the smScriptFlags word */
  712. /* (bits above 8 are non-static) */
  713. smsfIntellCP = 0, /*Script has intelligent cut & paste*/
  714. smsfSingByte = 1, /*Script has only single bytes*/
  715. smsfNatCase = 2, /*Native chars have upper & lower case*/
  716. smsfContext = 3, /*Script is contextual*/
  717. smsfNoForceFont = 4, /*Script will not force characters*/
  718. smsfB0Digits = 5, /*Script has alternate digits at B0-B9*/
  719. smsfAutoInit = 6, /*Auto initialize the script*/
  720. smsfUnivExt = 7, /*Script is handled by universal extension*/
  721. smsfSynchUnstyledTE = 8, /*Script synchronizes for unstyled TE*/
  722. smsfForms = 13, /*Uses contextual forms for letters*/
  723. smsfLigatures = 14, /*Uses contextual ligatures*/
  724. smsfReverse = 15, /*Reverses native text, right-left*/
  725. /* Bits in the smGenFlags long. */
  726. /* First (high-order) byte is set from itlc flags byte. */
  727. smfShowIcon = 31, /*Show icon even if only one script*/
  728. smfDualCaret = 30, /*Use dual caret for mixed direction text*/
  729. smfNameTagEnab = 29, /*Reserved for internal use*/
  730. smfUseAssocFontInfo = 28 /*Use the associated font info for FontMetrics calls <48>*/
  731. };
  732. enum {
  733. /* Roman script constants */
  734. /* The following are here for backward compatibility, but should not be used. */
  735. /* This information should be obtained using GetScript. */
  736. romanSysFond = 0x3FFF, /*system font id number*/
  737. romanAppFond = 3, /*application font id number*/
  738. romanFlags = 0x0007, /*roman settings*/
  739. /* Script Manager font equates. */
  740. smFondStart = 0x4000, /*start from 16K*/
  741. smFondEnd = 0xC000, /*past end of range at 48K*/
  742. /* Miscellaneous font equates. */
  743. smUprHalfCharSet = 0x80 /*first char code in top half of std char set*/
  744. };
  745. enum {
  746. /* Character Set Extensions */
  747. diaeresisUprY = 0xD9,
  748. fraction = 0xDA,
  749. intlCurrency = 0xDB,
  750. leftSingGuillemet = 0xDC,
  751. rightSingGuillemet = 0xDD,
  752. fiLigature = 0xDE,
  753. flLigature = 0xDF,
  754. dblDagger = 0xE0,
  755. centeredDot = 0xE1,
  756. baseSingQuote = 0xE2,
  757. baseDblQuote = 0xE3,
  758. perThousand = 0xE4,
  759. circumflexUprA = 0xE5,
  760. circumflexUprE = 0xE6,
  761. acuteUprA = 0xE7,
  762. diaeresisUprE = 0xE8,
  763. graveUprE = 0xE9,
  764. acuteUprI = 0xEA,
  765. circumflexUprI = 0xEB,
  766. diaeresisUprI = 0xEC,
  767. graveUprI = 0xED,
  768. acuteUprO = 0xEE,
  769. circumflexUprO = 0xEF,
  770. appleLogo = 0xF0,
  771. graveUprO = 0xF1,
  772. acuteUprU = 0xF2,
  773. circumflexUprU = 0xF3,
  774. graveUprU = 0xF4,
  775. dotlessLwrI = 0xF5,
  776. circumflex = 0xF6,
  777. tilde = 0xF7,
  778. macron = 0xF8,
  779. breveMark = 0xF9,
  780. overDot = 0xFA,
  781. ringMark = 0xFB,
  782. cedilla = 0xFC,
  783. doubleAcute = 0xFD,
  784. ogonek = 0xFE,
  785. hachek = 0xFF
  786. };
  787. enum {
  788. /* ScriptTokenType values */
  789. tokenIntl = 4, /*the itl resource number of the tokenizer*/
  790. tokenEmpty = -1 /*used internally as an empty flag*/
  791. };
  792. enum {
  793. tokenUnknown = 0, /*chars that do not match a defined token type*/
  794. tokenWhite = 1, /*white space*/
  795. tokenLeftLit = 2, /*literal begin*/
  796. tokenRightLit = 3, /*literal end*/
  797. tokenAlpha = 4, /*alphabetic*/
  798. tokenNumeric = 5, /*numeric*/
  799. tokenNewLine = 6, /*new line*/
  800. tokenLeftComment = 7, /*open comment*/
  801. tokenRightComment = 8, /*close comment*/
  802. tokenLiteral = 9, /*literal*/
  803. tokenEscape = 10, /*character escape (e.g. '\' in "\n", "\t")*/
  804. tokenAltNum = 11, /*alternate number (e.g. $B0-B9 in Arabic,Hebrew)*/
  805. tokenRealNum = 12, /*real number*/
  806. tokenAltReal = 13, /*alternate real number*/
  807. tokenReserve1 = 14, /*reserved*/
  808. tokenReserve2 = 15, /*reserved*/
  809. tokenLeftParen = 16, /*open parenthesis*/
  810. tokenRightParen = 17, /*close parenthesis*/
  811. tokenLeftBracket = 18, /*open square bracket*/
  812. tokenRightBracket = 19 /*close square bracket*/
  813. };
  814. enum {
  815. tokenLeftCurly = 20, /*open curly bracket*/
  816. tokenRightCurly = 21, /*close curly bracket*/
  817. tokenLeftEnclose = 22, /*open guillemet*/
  818. tokenRightEnclose = 23, /*close guillemet*/
  819. tokenPlus = 24,
  820. tokenMinus = 25,
  821. tokenAsterisk = 26, /*times/multiply*/
  822. tokenDivide = 27,
  823. tokenPlusMinus = 28, /*plus or minus symbol*/
  824. tokenSlash = 29,
  825. tokenBackSlash = 30,
  826. tokenLess = 31, /*less than symbol*/
  827. tokenGreat = 32, /*greater than symbol*/
  828. tokenEqual = 33,
  829. tokenLessEqual2 = 34, /*less than or equal, 2 characters (e.g. <=)*/
  830. tokenLessEqual1 = 35, /*less than or equal, 1 character*/
  831. tokenGreatEqual2 = 36, /*greater than or equal, 2 characters (e.g. >=)*/
  832. tokenGreatEqual1 = 37, /*greater than or equal, 1 character*/
  833. token2Equal = 38, /*double equal (e.g. ==)*/
  834. tokenColonEqual = 39 /*colon equal*/
  835. };
  836. enum {
  837. tokenNotEqual = 40, /*not equal, 1 character*/
  838. tokenLessGreat = 41, /*less/greater, Pascal not equal (e.g. <>)*/
  839. tokenExclamEqual = 42, /*exclamation equal, C not equal (e.g. !=)*/
  840. tokenExclam = 43, /*exclamation point*/
  841. tokenTilde = 44, /*centered tilde*/
  842. tokenComma = 45,
  843. tokenPeriod = 46,
  844. tokenLeft2Quote = 47, /*open double quote*/
  845. tokenRight2Quote = 48, /*close double quote*/
  846. tokenLeft1Quote = 49, /*open single quote*/
  847. tokenRight1Quote = 50, /*close single quote*/
  848. token2Quote = 51, /*double quote*/
  849. token1Quote = 52, /*single quote*/
  850. tokenSemicolon = 53,
  851. tokenPercent = 54,
  852. tokenCaret = 55,
  853. tokenUnderline = 56,
  854. tokenAmpersand = 57,
  855. tokenAtSign = 58,
  856. tokenBar = 59 /*vertical bar*/
  857. };
  858. enum {
  859. tokenQuestion = 60,
  860. tokenPi = 61, /*lower-case pi*/
  861. tokenRoot = 62, /*square root symbol*/
  862. tokenSigma = 63, /*capital sigma*/
  863. tokenIntegral = 64, /*integral sign*/
  864. tokenMicro = 65,
  865. tokenCapPi = 66, /*capital pi*/
  866. tokenInfinity = 67,
  867. tokenColon = 68,
  868. tokenHash = 69, /*e.g. #*/
  869. tokenDollar = 70,
  870. tokenNoBreakSpace = 71, /*non-breaking space*/
  871. tokenFraction = 72,
  872. tokenIntlCurrency = 73,
  873. tokenLeftSingGuillemet = 74,
  874. tokenRightSingGuillemet = 75,
  875. tokenPerThousand = 76,
  876. tokenEllipsis = 77,
  877. tokenCenterDot = 78,
  878. tokenNil = 127
  879. };
  880. enum {
  881. delimPad = -2, /* obsolete, misspelled token names kept for backward compatibility */
  882. tokenTilda = 44,
  883. tokenCarat = 55
  884. };
  885. enum {
  886. /* Table selectors for GetItlTable */
  887. smWordSelectTable = 0, /* get word select break table from 'itl2' */
  888. smWordWrapTable = 1, /* get word wrap break table from 'itl2' */
  889. smNumberPartsTable = 2, /* get default number parts table from 'itl4' */
  890. smUnTokenTable = 3, /* get unToken table from 'itl4' */
  891. smWhiteSpaceList = 4, /* get white space list from 'itl4' */
  892. iuWordSelectTable = 0, /* <obsolete> get word select break table from 'itl2' */
  893. iuWordWrapTable = 1, /* <obsolete> get word wrap break table from 'itl2' */
  894. iuNumberPartsTable = 2, /* <obsolete> get default number parts table from 'itl4' */
  895. iuUnTokenTable = 3, /* <obsolete> get unToken table from 'itl4' */
  896. iuWhiteSpaceList = 4 /* <obsolete> get white space list from 'itl4' */
  897. };
  898. /* end of stuff moved from Packages.h */
  899. enum {
  900. tokenOK = 0, /* TokenResults */
  901. tokenOverflow = 1, /* TokenResults */
  902. stringOverflow = 2, /* TokenResults */
  903. badDelim = 3, /* TokenResults */
  904. badEnding = 4, /* TokenResults */
  905. crash = 5 /* TokenResults */
  906. };
  907. typedef SInt8 TokenResults;
  908. typedef char CharByteTable[256];
  909. /* "TokenType" was renamed to "ScriptTokenType" because of a name collisions*/
  910. typedef short ScriptTokenType;
  911. #if TARGET_OS_MAC
  912. typedef ScriptTokenType TokenType;
  913. #endif /* TARGET_OS_MAC */
  914. typedef ScriptTokenType DelimType[2];
  915. typedef ScriptTokenType CommentType[4];
  916. struct TokenRec {
  917. ScriptTokenType theToken;
  918. Ptr position; /*pointer into original source*/
  919. long length; /*length of text in original source*/
  920. StringPtr stringPosition; /*Pascal/C string copy of identifier*/
  921. };
  922. typedef struct TokenRec TokenRec;
  923. typedef TokenRec * TokenRecPtr;
  924. struct TokenBlock {
  925. Ptr source; /*pointer to stream of characters*/
  926. long sourceLength; /*length of source stream*/
  927. Ptr tokenList; /*pointer to array of tokens*/
  928. long tokenLength; /*maximum length of TokenList*/
  929. long tokenCount; /*number tokens generated by tokenizer*/
  930. Ptr stringList; /*pointer to stream of identifiers*/
  931. long stringLength; /*length of string list*/
  932. long stringCount; /*number of bytes currently used*/
  933. Boolean doString; /*make strings & put into StringList*/
  934. Boolean doAppend; /*append to TokenList rather than replace*/
  935. Boolean doAlphanumeric; /*identifiers may include numeric*/
  936. Boolean doNest; /*do comments nest?*/
  937. ScriptTokenType leftDelims[2];
  938. ScriptTokenType rightDelims[2];
  939. ScriptTokenType leftComment[4];
  940. ScriptTokenType rightComment[4];
  941. ScriptTokenType escapeCode; /*escape symbol code*/
  942. ScriptTokenType decimalCode;
  943. Handle itlResource; /*handle to itl4 resource of current script*/
  944. long reserved[8]; /*must be zero!*/
  945. };
  946. typedef struct TokenBlock TokenBlock;
  947. typedef TokenBlock * TokenBlockPtr;
  948. /*
  949. * GetSysDirection()
  950. *
  951. * Availability:
  952. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  953. * CarbonLib: in CarbonLib 1.0 and later
  954. * Mac OS X: in version 10.0 and later
  955. */
  956. EXTERN_API( short )
  957. GetSysDirection(void) TWOWORDINLINE(0x3EB8, 0x0BAC);
  958. /*
  959. * SetSysDirection()
  960. *
  961. * Availability:
  962. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  963. * CarbonLib: in CarbonLib 1.0 and later
  964. * Mac OS X: in version 10.0 and later
  965. */
  966. EXTERN_API( void )
  967. SetSysDirection(short value) TWOWORDINLINE(0x31DF, 0x0BAC);
  968. /*
  969. * FontScript()
  970. *
  971. * Availability:
  972. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  973. * CarbonLib: in CarbonLib 1.0 and later
  974. * Mac OS X: in version 10.0 and later
  975. */
  976. EXTERN_API( short )
  977. FontScript(void) FOURWORDINLINE(0x2F3C, 0x8200, 0x0000, 0xA8B5);
  978. /*
  979. * IntlScript()
  980. *
  981. * Availability:
  982. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  983. * CarbonLib: in CarbonLib 1.0 and later
  984. * Mac OS X: in version 10.0 and later
  985. */
  986. EXTERN_API( short )
  987. IntlScript(void) FOURWORDINLINE(0x2F3C, 0x8200, 0x0002, 0xA8B5);
  988. /*
  989. * FontToScript()
  990. *
  991. * Availability:
  992. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  993. * CarbonLib: in CarbonLib 1.0 and later
  994. * Mac OS X: in version 10.0 and later
  995. */
  996. EXTERN_API( short )
  997. FontToScript(short fontNumber) FOURWORDINLINE(0x2F3C, 0x8202, 0x0006, 0xA8B5);
  998. /*
  999. * GetScriptManagerVariable()
  1000. *
  1001. * Availability:
  1002. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1003. * CarbonLib: in CarbonLib 1.0 and later
  1004. * Mac OS X: in version 10.0 and later
  1005. */
  1006. EXTERN_API( long )
  1007. GetScriptManagerVariable(short selector) FOURWORDINLINE(0x2F3C, 0x8402, 0x0008, 0xA8B5);
  1008. /*
  1009. * SetScriptManagerVariable()
  1010. *
  1011. * Availability:
  1012. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1013. * CarbonLib: in CarbonLib 1.0 and later
  1014. * Mac OS X: in version 10.0 and later
  1015. */
  1016. EXTERN_API( OSErr )
  1017. SetScriptManagerVariable(
  1018. short selector,
  1019. long param) FOURWORDINLINE(0x2F3C, 0x8206, 0x000A, 0xA8B5);
  1020. /*
  1021. * GetScriptVariable()
  1022. *
  1023. * Availability:
  1024. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1025. * CarbonLib: in CarbonLib 1.0 and later
  1026. * Mac OS X: in version 10.0 and later
  1027. */
  1028. EXTERN_API( long )
  1029. GetScriptVariable(
  1030. short script,
  1031. short selector) FOURWORDINLINE(0x2F3C, 0x8404, 0x000C, 0xA8B5);
  1032. /*
  1033. * SetScriptVariable()
  1034. *
  1035. * Availability:
  1036. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1037. * CarbonLib: in CarbonLib 1.0 and later
  1038. * Mac OS X: in version 10.0 and later
  1039. */
  1040. EXTERN_API( OSErr )
  1041. SetScriptVariable(
  1042. short script,
  1043. short selector,
  1044. long param) FOURWORDINLINE(0x2F3C, 0x8208, 0x000E, 0xA8B5);
  1045. /*
  1046. * CharacterByteType()
  1047. *
  1048. * Availability:
  1049. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1050. * CarbonLib: in CarbonLib 1.0 and later
  1051. * Mac OS X: in version 10.0 and later
  1052. */
  1053. EXTERN_API( short )
  1054. CharacterByteType(
  1055. Ptr textBuf,
  1056. short textOffset,
  1057. ScriptCode script) FOURWORDINLINE(0x2F3C, 0xC206, 0x0010, 0xA8B5);
  1058. /*
  1059. * CharacterType()
  1060. *
  1061. * Availability:
  1062. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1063. * CarbonLib: in CarbonLib 1.0 and later
  1064. * Mac OS X: in version 10.0 and later
  1065. */
  1066. EXTERN_API( short )
  1067. CharacterType(
  1068. Ptr textBuf,
  1069. short textOffset,
  1070. ScriptCode script) FOURWORDINLINE(0x2F3C, 0xC206, 0x0012, 0xA8B5);
  1071. /*
  1072. * TransliterateText()
  1073. *
  1074. * Availability:
  1075. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1076. * CarbonLib: in CarbonLib 1.0 and later
  1077. * Mac OS X: in version 10.0 and later
  1078. */
  1079. EXTERN_API( OSErr )
  1080. TransliterateText(
  1081. Handle srcHandle,
  1082. Handle dstHandle,
  1083. short target,
  1084. long srcMask,
  1085. ScriptCode script) FOURWORDINLINE(0x2F3C, 0xC20E, 0x0018, 0xA8B5);
  1086. /*
  1087. * FillParseTable()
  1088. *
  1089. * Availability:
  1090. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1091. * CarbonLib: in CarbonLib 1.0 and later
  1092. * Mac OS X: in version 10.0 and later
  1093. */
  1094. EXTERN_API( Boolean )
  1095. FillParseTable(
  1096. CharByteTable table,
  1097. ScriptCode script) FOURWORDINLINE(0x2F3C, 0xC204, 0x0022, 0xA8B5);
  1098. /*
  1099. * GetIntlResource()
  1100. *
  1101. * Availability:
  1102. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1103. * CarbonLib: in CarbonLib 1.0 and later
  1104. * Mac OS X: in version 10.0 and later
  1105. */
  1106. EXTERN_API( Handle )
  1107. GetIntlResource(short theID) THREEWORDINLINE(0x3F3C, 0x0006, 0xA9ED);
  1108. /*
  1109. * ClearIntlResourceCache()
  1110. *
  1111. * Availability:
  1112. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1113. * CarbonLib: in CarbonLib 1.0 and later
  1114. * Mac OS X: in version 10.0 and later
  1115. */
  1116. EXTERN_API( void )
  1117. ClearIntlResourceCache(void) THREEWORDINLINE(0x3F3C, 0x0018, 0xA9ED);
  1118. /*
  1119. * GetIntlResourceTable()
  1120. *
  1121. * Availability:
  1122. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1123. * CarbonLib: in CarbonLib 1.0 and later
  1124. * Mac OS X: in version 10.0 and later
  1125. */
  1126. EXTERN_API( void )
  1127. GetIntlResourceTable(
  1128. ScriptCode script,
  1129. short tableCode,
  1130. Handle * itlHandle,
  1131. long * offset,
  1132. long * length) THREEWORDINLINE(0x3F3C, 0x0024, 0xA9ED);
  1133. #if CALL_NOT_IN_CARBON
  1134. /*
  1135. * GetScriptUtilityAddress()
  1136. *
  1137. * Availability:
  1138. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1139. * CarbonLib: not available
  1140. * Mac OS X: not available
  1141. */
  1142. EXTERN_API( UniversalProcPtr )
  1143. GetScriptUtilityAddress(
  1144. short selector,
  1145. Boolean Before,
  1146. ScriptCode script) FOURWORDINLINE(0x2F3C, 0xC404, 0x0038, 0xA8B5);
  1147. /*
  1148. * SetScriptUtilityAddress()
  1149. *
  1150. * Availability:
  1151. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1152. * CarbonLib: not available
  1153. * Mac OS X: not available
  1154. */
  1155. EXTERN_API( void )
  1156. SetScriptUtilityAddress(
  1157. short selector,
  1158. Boolean Before,
  1159. UniversalProcPtr routineAddr,
  1160. ScriptCode script) FOURWORDINLINE(0x2F3C, 0xC008, 0x003A, 0xA8B5);
  1161. /*
  1162. * GetScriptQDPatchAddress()
  1163. *
  1164. * Availability:
  1165. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1166. * CarbonLib: not available
  1167. * Mac OS X: not available
  1168. */
  1169. EXTERN_API( UniversalProcPtr )
  1170. GetScriptQDPatchAddress(
  1171. short trapNum,
  1172. Boolean Before,
  1173. Boolean forPrinting,
  1174. ScriptCode script) FOURWORDINLINE(0x2F3C, 0xC406, 0x003C, 0xA8B5);
  1175. /*
  1176. * SetScriptQDPatchAddress()
  1177. *
  1178. * Availability:
  1179. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1180. * CarbonLib: not available
  1181. * Mac OS X: not available
  1182. */
  1183. EXTERN_API( void )
  1184. SetScriptQDPatchAddress(
  1185. short trapNum,
  1186. Boolean Before,
  1187. Boolean forPrinting,
  1188. UniversalProcPtr routineAddr,
  1189. ScriptCode script) FOURWORDINLINE(0x2F3C, 0xC00A, 0x003E, 0xA8B5);
  1190. /*
  1191. * SetIntlResource()
  1192. *
  1193. * Availability:
  1194. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1195. * CarbonLib: not available
  1196. * Mac OS X: not available
  1197. */
  1198. EXTERN_API( void )
  1199. SetIntlResource(
  1200. short refNum,
  1201. short theID,
  1202. Handle intlHandle) THREEWORDINLINE(0x3F3C, 0x0008, 0xA9ED);
  1203. /*
  1204. * CharByte()
  1205. *
  1206. * Availability:
  1207. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1208. * CarbonLib: not available
  1209. * Mac OS X: not available
  1210. */
  1211. EXTERN_API( short )
  1212. CharByte(
  1213. Ptr textBuf,
  1214. short textOffset) FOURWORDINLINE(0x2F3C, 0x8206, 0x0010, 0xA8B5);
  1215. /*
  1216. * CharType()
  1217. *
  1218. * Availability:
  1219. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1220. * CarbonLib: not available
  1221. * Mac OS X: not available
  1222. */
  1223. EXTERN_API( short )
  1224. CharType(
  1225. Ptr textBuf,
  1226. short textOffset) FOURWORDINLINE(0x2F3C, 0x8206, 0x0012, 0xA8B5);
  1227. /*
  1228. * Transliterate()
  1229. *
  1230. * Availability:
  1231. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1232. * CarbonLib: not available
  1233. * Mac OS X: not available
  1234. */
  1235. EXTERN_API( OSErr )
  1236. Transliterate(
  1237. Handle srcHandle,
  1238. Handle dstHandle,
  1239. short target,
  1240. long srcMask) FOURWORDINLINE(0x2F3C, 0x820E, 0x0018, 0xA8B5);
  1241. /*
  1242. * ParseTable()
  1243. *
  1244. * Availability:
  1245. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1246. * CarbonLib: not available
  1247. * Mac OS X: not available
  1248. */
  1249. EXTERN_API( Boolean )
  1250. ParseTable(CharByteTable table) FOURWORDINLINE(0x2F3C, 0x8204, 0x0022, 0xA8B5);
  1251. #endif /* CALL_NOT_IN_CARBON */
  1252. /*
  1253. * IntlTokenize()
  1254. *
  1255. * Availability:
  1256. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1257. * CarbonLib: in CarbonLib 1.0 and later
  1258. * Mac OS X: in version 10.0 and later
  1259. */
  1260. EXTERN_API( TokenResults )
  1261. IntlTokenize(TokenBlockPtr tokenParam) FOURWORDINLINE(0x2F3C, 0x8204, 0xFFFA, 0xA8B5);
  1262. #if OLDROUTINENAMES
  1263. #define SetSysJust(newJust) SetSysDirection(newJust)
  1264. #define GetSysJust() GetSysDirection()
  1265. #define Font2Script(fontNumber) FontToScript(fontNumber)
  1266. #define GetEnvirons(verb) GetScriptManagerVariable(verb)
  1267. #define SetEnvirons(verb, param) SetScriptManagerVariable(verb, param)
  1268. #define GetScript(script, verb) GetScriptVariable(script, verb)
  1269. #define SetScript(script, verb, param) SetScriptVariable(script, verb, param)
  1270. #define IUGetIntl(theID) GetIntlResource(theID)
  1271. #define IUSetIntl(refNum, theID, intlHandle) SetIntlResource(refNum, theID, intlHandle)
  1272. #define IUClearCache() ClearIntlResourceCache()
  1273. #define IUGetItlTable(script, tableCode, itlHandle, offset, length) \
  1274. GetIntlResourceTable(script, tableCode, itlHandle, offset, length)
  1275. #endif /* OLDROUTINENAMES */
  1276. #if PRAGMA_STRUCT_ALIGN
  1277. #pragma options align=reset
  1278. #elif PRAGMA_STRUCT_PACKPUSH
  1279. #pragma pack(pop)
  1280. #elif PRAGMA_STRUCT_PACK
  1281. #pragma pack()
  1282. #endif
  1283. #ifdef PRAGMA_IMPORT_OFF
  1284. #pragma import off
  1285. #elif PRAGMA_IMPORT
  1286. #pragma import reset
  1287. #endif
  1288. #ifdef __cplusplus
  1289. }
  1290. #endif
  1291. #endif /* __SCRIPT__ */