Important: The information in this document is obsolete and should not be used for new development.
Summary of the Script Manager
Pascal Summary
Constants
{Script system constants} {Implicit script codes} smSystemScript = -1; {designates system script.} smCurrentScript = -2; {designates font script.} smAllScripts = -3; {designates any script} {Explicit script codes} smRoman = 0; {Roman} smJapanese = 1; {Japanese} smTradChinese = 2; {Traditional Chinese} smKorean = 3; {Korean} smArabic = 4; {Arabic} smHebrew = 5; {Hebrew} smGreek = 6; {Greek} smCyrillic = 7; {Cyrillic} smRSymbol = 8; {Right-left symbol} smDevanagari = 9; {Devanagari} smGurmukhi = 10; {Gurmukhi} smGujarati = 11; {Gujarati} smOriya = 12; {Oriya} smBengali = 13; {Bengali} smTamil = 14; {Tamil} smTelugu = 15; {Telugu} smKannada = 16; {Kannada/Kanarese} smMalayalam = 17; {Malayalam} smSinhalese = 18; {Sinhalese} smBurmese = 19; {Burmese} smKhmer = 20; {Khmer/Cambodian} smThai = 21; {Thai} smLaotian = 22; {Laotian} smGeorgian = 23; {Georgian} smArmenian = 24; {Armenian} smSimpChinese = 25; {Simplified Chinese} smTibetan = 26; {Tibetan} smMongolian = 27; {Mongolian} smGeez = 28; {Geez/Ethiopic} smEthiopic = 28; {Synonym for smGeez} smEastEurRoman = 29; {Synonym for smSlavic} smVietnamese = 30; {Vietnamese} smExtArabic = 31; {extended Arabic} smUninterp = 32; {uninterpreted symbols, e.g. palette symbols} {Language Codes} langEnglish = 0; { smRoman script } langFrench = 1; { smRoman script } langGerman = 2; { smRoman script } langItalian = 3; { smRoman script } langDutch = 4; { smRoman script } langSwedish = 5; { smRoman script } langSpanish = 6; { smRoman script } langDanish = 7; { smRoman script } langPortuguese = 8; { smRoman script } langNorwegian = 9; { smRoman script } langHebrew = 10; { smHebrew script } langJapanese = 11; { smJapanese script } langArabic = 12; { smArabic script } langFinnish = 13; { smRoman script } langGreek = 14; { smGreek script } langIcelandic = 15; { extended Roman script } langMaltese = 16; { extended Roman script } langTurkish = 17; { extended Roman script } langCroatian = 18; { Serbo-Croatian in extended Roman script } langTradChinese = 19; { Chinese in traditional characters } langUrdu = 20; { smArabic script } langHindi = 21; { smDevanagari script } langThai = 22; { smThai script } langKorean = 23; { smKorean script } langLithuanian = 24; { smEastEurRoman script } langPolish = 25; { smEastEurRoman script } langHungarian = 26; { smEastEurRoman script } langEstonian = 27; { smEastEurRoman script } langLettish = 28; { smEastEurRoman script } langLatvian = 28; { Synonym for langLettish } langSaamisk = 29; { extended Roman script } langLappish = 29; { Synonym for langSaamisk } langFaeroese = 30; { smRoman script } langFarsi = 31; { smArabic script } langPersian = 31; { Synonym for langFarsi } langRussian = 32; { smCyrillic script } langSimpChinese = 33; { Chinese in simplified characters } langFlemish = 34; { smRoman script } langIrish = 35; { smRoman script } langAlbanian = 36; { smRoman script } langRomanian = 37; { smEastEurRoman script } langCzech = 38; { smEastEurRoman script } langSlovak = 39; { smEastEurRoman script } langSlovenian = 40; { smEastEurRoman script } langYiddish = 41; { smHebrew script } langSerbian = 42; { Serbo-Croatian in smCyrillic script } langMacedonian = 43; { smCyrillic script } langBulgarian = 44; { smCyrillic script } langUkrainian = 45; { smCyrillic script } langByelorussian = 46; { smCyrillic script } langUzbek = 47; { smCyrillic script } langKazakh = 48; { smCyrillic script } langAzerbaijani = 49; { Azerbaijani in smCyrillic script } langAzerbaijanAr = 50; { Azerbaijani in smArabic script (Iran) } langArmenian = 51; { smArmenian script } langGeorgian = 52; { smGeorgian script } langMoldovan = 53; { smCyrillic script } langMoldavian = 53; { Synonym for langMoldovan } langKirghiz = 54; { smCyrillic script } langTajiki = 55; { smCyrillic script } langTurkmen = 56; { smCyrillic script } langMongolian = 57; { Mongolian in smMongolian script } langMongolianCyr = 58; { Mongolian in smCyrillic script } langPashto = 59; { smArabic script } langKurdish = 60; { smArabic script } langKashmiri = 61; { smArabic script } langSindhi = 62; { smExtArabic script } langTibetan = 63; { smTibetan script } langNepali = 64; { smDevanagari script } langSanskrit = 65; { smDevanagari script } langMarathi = 66; { smDevanagari script } langBengali = 67; { smBengali script } langAssamese = 68; { smBengali script } langGujarati = 69; { smGujarati script } langPunjabi = 70; { smGurmukhi script } langOriya = 71; { smOriya script } langMalayalam = 72; { smMalayalam script } langKannada = 73; { smKannada script } langTamil = 74; { smTamil script } langTelugu = 75; { smTelugu script } langSinhalese = 76; { smSinhalese script } langBurmese = 77; { smBurmese script } langKhmer = 78; { smKhmer script } langLao = 79; { smLaotian script } langVietnamese = 80; { smVietnamese script } langIndonesian = 81; { smRoman script } langTagalog = 82; { smRoman script } langMalayRoman = 83; { Malay in smRoman script } langMalayArabic = 84; { Malay in smArabic script } langAmharic = 85; { smEthiopic script } langTigrinya = 86; { smEthiopic script } langGalla = 87; { smEthiopic script } langOromo = 87; { synonym for langGalla } langSomali = 88; { smRoman script } langSwahili = 89; { smRoman script } langRuanda = 90; { smRoman script } langRundi = 91; { smRoman script } langChewa = 92; { smRoman script } langMalagasy = 93; { smRoman script } langEsperanto = 94; { extended Roman script } langWelsh = 128; { smRoman script } langBasque = 129; { smRoman script } langCatalan = 130; { smRoman script } langLatin = 131; { smRoman script } langQuechua = 132; { smRoman script } langGuarani = 133; { smRoman script } langAymara = 134; { smRoman script } langTatar = 135; { smCyrillic script } langUighur = 136; { smArabic script } langDzongkha = 137; { (lang of Bhutan) smTibetan script } langJavaneseRom = 138; { Javanese in smRoman script } langSundaneseRom = 139; { Sundanese in smRoman script } { Region codes } verUS = 0; verFrance = 1; verBritain = 2; verGermany = 3; verItaly = 4; verNetherlands = 5; verFrBelgiumLux = 6; {French for Belgium & Luxembourg} verSweden = 7; verSpain = 8; verDenmark = 9; verPortugal = 10; verFrCanada = 11; verNorway = 12; verIsrael = 13; verJapan = 14; verAustralia = 15; verArabia = 16; verArabic = 16; {synonym for verArabia} verFinland = 17; verFrSwiss = 18; {Swiss French} verGrSwiss = 19; {Swiss German} verGreece = 20; verIceland = 21; verMalta = 22; verCyprus = 23; verTurkey = 24; verYugoCroatian = 25; {Croatian system} verIndiaHindi = 33; {Hindi system for India} verPakistan = 34; verLithuania = 41; verPoland = 42; verHungary = 43; verEstonia = 44; verLatvia = 45; verLapland = 46; verFaeroeIsl = 47; verIran = 48; verRussia = 49; verIreland = 50; {English-language version for Ireland} verKorea = 51; verChina = 52; verTaiwan = 53; verThailand = 54; minCountry = verUS; maxCountry = verThailand; {Calendar codes} calGregorian = 0; calArabicCivil = 1; calArabicLunar = 2; calJapanese = 3; calJewish = 4; calCoptic = 5; calPersian = 6; {Numeral codes} intWestern = 0; intArabic = 1; intRoman = 2; intJapanese = 3; intEuropean = 4; intOutputMask = $8000; { CharacterByteType byte types } smSingleByte = 0; smFirstByte = -1; smLastByte = 1; smMiddleByte = 2; {CharacterType field masks} smcTypeMask = $000F; smcReserved = $00F0; smcClassMask = $0F00; smcOrientationMask = $1000; {2-byte script glyph orientation} smcRightMask = $2000; smcUpperMask = $4000; smcDoubleMask = $8000; {Basic CharacterType character types} smCharPunct = $0000; smCharAscii = $0001; smCharEuro = $0007; smCharExtAscii = $0007; {more correct synonym for smCharEuro} {Additional CharacterType character types for script systems} smCharKatakana = $0002; {Japanese Katakana} smCharHiragana = $0003; {Japanese Hiragana} smCharIdeographic = $0004; {Hanzi, Kanji, Hanja} smCharTwoByteGreek = $0005; {2-byte Greek in Far East systems} smCharTwoByteRussian = $0006; {2-byte Cyrillic in Far East systems} smCharBidirect = $0008; {Arabic/Hebrew} smCharContextualLR = $0009; {contextual left-right: Thai, Indic scripts} smCharNonContextualLR = $000A; {noncontextual left-right: Cyrillic, Greek} smCharHangul = $000C; {Korean Hangul} smCharJamo = $000D; {Korean Jamo} smCharBopomofo = $000E; {Chinese Bopomofo (Zhuyinfuhao)} {CharacterType classes for punctuation (smCharPunct)} smPunctNormal = $0000; smPunctNumber = $0100; smPunctSymbol = $0200; smPunctBlank = $0300; {Additional CharacterType classes for punctuation in two-byte systems} smPunctRepeat = $0400; {repeat marker} smPunctGraphic = $0500; {line graphics} {CharacterType Katakana and Hiragana classes for 2-byte systems} smKanaSmall = $0100; {small Kana character} smKanaHardOK = $0200; {can have dakuten} smKanaSoftOK = $0300; {can have dakuten or han-dakuten} {CharacterType ideographic classes for 2-byte systems} smIdeographicLevel1 = $0000; {level 1 char} smIdeographicLevel2 = $0100; {level 2 char} smIdeographicUser = $0200; {user char} {CharacterType Jamo classes for Korean systems} smJamoJaeum = $0000; {simple consonant char} smJamoBogJaeum = $0100; {complex consonant char} smJamoMoeum = $0200; {simple vowel char} smJamoBogMoeum = $0300; {complex vowel char} {CharacterType glyph orientation for 2-byte systems} smCharHorizontal = $0000; {horizontal character form, or for both} smCharVertical = $1000; {vertical character form} {CharacterType directions} smCharLeft = $0000; smCharRight = $2000; {CharacterType case modifers} smCharLower = $0000; smCharUpper = $4000; {CharacterType character size modifiers (1 or multiple bytes)} smChar1byte = $0000; smChar2byte = $8000; {TransliterateText target types for Roman} smTransAscii = 0; {convert to ASCII} smTransNative = 1; {convert to font script} smTransCase = $FE; {convert case for all text} smTransSystem = $FF; {convert to system script} {TransliterateText target types for 2-byte scripts} smTransAscii1 = 2; {1-byte Roman} smTransAscii2 = 3; {2-byte Roman} smTransKana1 = 4; {1-byte Japanese Katakana} smTransKana2 = 5; {2-byte Japanese Katakana} smTransGana2 = 7; {2-byte Japanese Hiragana (no 1-byte Hiragana)} smTransHangul2 = 8; {2-byte Korean Hangul} smTransJamo2 = 9; {2-byte Korean Jamo} smTransBopomofo2 = 10; {2-byte Chinese Bopomofo (Zhuyinfuhao)} {TransliterateText target modifiers} smTransLower = $4000; {target becomes lowercase} smTransUpper = $8000; {target becomes uppercase} {TransliterateText resource format numbers} smTransRuleBaseFormat = 1; {rule-based trsl resource format } smTransHangulFormat = 2; {table-based Hangul trsl resource format} {TransliterateText property flags} smTransPreDoubleByting = 1; {convert all text to 2-byte } { before transliteration} smTransPreLowerCasing = 2; {convert all text to lowercase } { before transliteration} {TransliterateText source mask - general} smMaskAll = $FFFFFFFF; {convert all text} {TransliterateText source masks} smMaskAscii = $00000001; {2^smTransAscii} smMaskNative = $00000002; {2^smTransNative} {TransliterateText source masks for 2-byte scripts} smMaskAscii1 = $00000004; {2^smTransAscii1} smMaskAscii2 = $00000008; {2^smTransAscii2} smMaskKana1 = $00000010; {2^smTransKana1} smMaskKana2 = $00000020; {2^smTransKana2} smMaskGana2 = $00000080; {2^smTransGana2} smMaskHangul2 = $00000100; {2^smTransHangul2} smMaskJamo2 = $00000200; {2^smTransJamo2} smMaskBopomofo2 = $00000400; {2^smTransBopomofo2} {Result values from GetScriptManagerVariable, SetScriptManagerVariable, } { GetScriptVariable, and SetScriptVariable} smNotInstalled = 0; {routine not available in specified script} smBadVerb = -1; {bad selector passed to a routine} smBadScript = -2; {bad script code passed to a routine} {Values for script redraw flag} smRedrawChar = 0; {redraw character only} smRedrawWord = 1; {redraw entire word (2-byte systems)} smRedrawLine = -1; {redraw entire line (bidirectional systems)} {GetScriptManagerVariable and SetScriptManagerVariable selectors} smVersion = 0; {Script Manager version number} smMunged = 2; {Globals change count} smEnabled = 4; {Count of enabled scripts, incl Roman} smBidirect = 6; {At least one bidirectional script} smFontForce = 8; {Force font flag} smIntlForce = 10; {Intl resources selection flag} smForced = 12; {Script was forced to system script} smDefault = 14; {Script was defaulted to Roman script} smPrint = 16; {Printer action routine} smSysScript = 18; {System script} smLastScript = 20; {Last keyboard script} smKeyScript = 22; {Keyboard script} smSysRef = 24; {System folder refNum} smKeyCache = 26; {obsolete} smKeySwap = 28; {Swapping table handle} smGenFlags = 30; {General flags long} smOverride = 32; {Script override flags} smCharPortion = 34; {Ch vs SpExtra proportion} smDoubleByte = 36; {Flag for double-byte script installed} smKCHRCache = 38; {Returns pointer to KCHR cache} smRegionCode = 40; {Returns current region code (verXxx)} smKeyDisableState = 42; {Returns current keyboard disable state} { GetScriptVariable and SetScriptVariable selectors.} smScriptVersion = 0; {Script software version} smScriptMunged = 2; {Script entry changed count} smScriptEnabled = 4; {Script enabled flag} smScriptRight = 6; {Right to left flag} smScriptJust = 8; {Justification flag} smScriptRedraw = 10; {Word redraw flag} smScriptSysFond = 12; {Preferred system font} smScriptAppFond = 14; {Preferred Application font} smScriptBundle = 16; {Beginning of itlb verbs} smScriptNumber = 16; {Script itl0 id} smScriptDate = 18; {Script itl1 id} smScriptSort = 20; {Script itl2 id} smScriptFlags = 22; {flags word} smScriptToken = 24; {Script itl4 id} smScriptEncoding = 26; {id of optional itl5, if present} smScriptLang = 28; {Current language for script} smScriptNumDate = 30; {Script Number/Date formats.} smScriptKeys = 32; {Script KCHR id} smScriptIcon = 34; {ID # of SICN or kcs#/kcs4/kcs8 family} smScriptPrint = 36; {Script printer action routine} smScriptTrap = 38; {Trap entry pointer} smScriptCreator = 40; {Script file creator} smScriptFile = 42; {Script file name} smScriptName = 44; {Script name} smScriptMonoFondSize = 78; {default monospace FOND (hi) & size (lo)} smScriptPrefFondSize = 80; {preferred FOND (hi) & size (lo)} smScriptSmallFondSize = 82; {default small FOND (hi) & size (lo)} smScriptSysFondSize = 84; {default system FOND (hi) & size (lo)} smScriptAppFondSize = 86; {default app FOND (hi) & size (lo)} smScriptHelpFondSize = 88; {default Help Mgr FOND (hi) & size (lo)} smScriptValidStyles = 90; {mask of valid styles for script} smScriptAliasStyle = 92; {style (set) to use for aliases} { Negative selectors for KeyScript } smKeyNextScript = -1; { Switch to next available script } smKeySysScript = -2; { Switch to the system script } smKeySwapScript = -3; { Switch to previously-used script } smKeyNextKybd = -4; { Switch to next keyboard in current keyscript } smKeySwapKybd = -5; { Switch to previous keyboard in current keyscript } smKeyDisableKybds = -6; { Disable keyboards not in system or Roman script } smKeyEnableKybds = -7; { Re-enable keyboards for all enabled scripts } smKeyToggleInline = -8; { Toggle inline input for current keyscript } smKeyToggleDirection = -9; {Toggle default line direction (TESysJust)} smKeyNextInputMethod = -10; {Switch to next input method in current script} smKeySwapInputMethod = -11; {Switch to prev. input method in curr. script} smKeyDisableKybdSwitch = -12; {Disable switching from current keyboard} smKeySetDirLeftRight = -15; {Set default line dir. left-right,align left} smKeySetDirRightLeft = -16; {Set default line dir. right-left,align right} smKeyRoman = -17; { Set keyscript to Roman. Does nothing if Roman-only} { Bits in the smScriptFlags word (bits above 8 are non-static) } smsfIntellCP = 0; {Script has intelligent cut & paste} smsfSingByte = 1; {Script has only single bytes} smsfNatCase = 2; {Native chars have upper & lower case} smsfContext = 3; {Script is contextual} smsfNoForceFont = 4; {Script will not force characters} smsfB0Digits = 5; {Script has alternate digits at B0-B9} smsfAutoInit = 6; {Auto initialize the script} smsfUnivExt = 7; {Script is handled by WorldScript I} smsfSynchUnstyledTE = 8; {Synchronize keyboard and chartype in unstyled TE} smsfForms = 13; {Uses contextual forms for letters} smsfLigatures = 14; {Uses contextual ligatures} smsfReverse = 15; {Reverses native text, right-left} { Bits in the smGenFlags long.} {First (high-order) byte is set from itlc flags byte. } smfShowIcon = 31; {Show icon even if only one script} smfDualCaret = 30; {Use dual caret for mixed direction text} smfNameTagEnab = 29; {Reserved for internal use} { Script Manager font equates. } smFondStart = $4000; {start from 16K} smFondEnd = $C000; {past end of range at 48K} { Miscellaneous font equates. } smUprHalfCharSet = $80; {first char code in top half of std char set} { Character Set Extensions } diaeresisUprY = $D9; fraction = $DA; intlCurrency = $DB; leftSingGuillemet = $DC; rightSingGuillemet = $DD; fiLigature = $DE; flLigature = $DF; dblDagger = $E0; centeredDot = $E1; baseSingQuote = $E2; baseDblQuote = $E3; perThousand = $E4; circumflexUprA = $E5; circumflexUprE = $E6; acuteUprA = $E7; diaeresisUprE = $E8; graveUprE = $E9; acuteUprI = $EA; circumflexUprI = $EB; diaeresisUprI = $EC; graveUprI = $ED; acuteUprO = $EE; circumflexUprO = $EF; appleLogo = $F0; graveUprO = $F1; acuteUprU = $F2; circumflexUprU = $F3; graveUprU = $F4; dotlessLwrI = $F5; circumflex = $F6; tilde = $F7; macron = $F8; breveMark = $F9; overDot = $FA; ringMark = $FB; cedilla = $FC; doubleAcute = $FD; ogonek = $FE; hachek = $FF; { TokenType values } tokenIntl = 4; {the itl resource number of the tokenizer} tokenEmpty = -1; {used internally as an empty flag} tokenUnknown = 0; {chars that do not match a defined token type} tokenWhite = 1; {whitespace} tokenLeftLit = 2; {literal begin} tokenRightLit = 3; {literal end} tokenAlpha = 4; {alphabetic} tokenNumeric = 5; {numeric} tokenNewLine = 6; {new line} tokenLeftComment = 7; {open comment} tokenRightComment = 8; {close comment} tokenLiteral = 9; {literal} tokenEscape = 10; {character escape (e.g. '\' in "\n", "\t")} tokenAltNum = 11; {alternate number (e.g. $B0-B9 in Arabic,Hebrew)} tokenRealNum = 12; {real number} tokenAltReal = 13; {alternate real number} tokenReserve1 = 14; {reserved} tokenReserve2 = 15; {reserved} tokenLeftParen = 16; {open parenthesis} tokenRightParen = 17; {close parenthesis} tokenLeftBracket = 18; {open square bracket} tokenRightBracket = 19; {close square bracket} tokenLeftCurly = 20; {open curly bracket} tokenRightCurly = 21; {close curly bracket} tokenLeftEnclose = 22; {open guillemet} tokenRightEnclose = 23; {close guillemet} tokenPlus = 24; tokenMinus = 25; tokenAsterisk = 26; {times/multiply} tokenDivide = 27; tokenPlusMinus = 28; {plus or minus symbol} tokenSlash = 29; tokenBackSlash = 30; tokenLess = 31; {less than symbol} tokenGreat = 32; {greater than symbol} tokenEqual = 33; tokenLessEqual2 = 34; {less than or equal, 2 characters (e.g. <=)} tokenLessEqual1 = 35; {less than or equal, 1 character} tokenGreatEqual2 = 36; {greater than or equal, 2 characters (e.g. >=)} tokenGreatEqual1 = 37; {greater than or equal, 1 character} token2Equal = 38; {double equal (e.g. ==)} tokenColonEqual = 39; {colon equal} tokenNotEqual = 40; {not equal, 1 character} tokenLessGreat = 41; {less/greater, Pascal not equal (e.g. <>)} tokenExclamEqual = 42; {exclamation equal, C not equal (e.g. !=)} tokenExclam = 43; {exclamation point} tokenTilde = 44; {centered tilde} tokenComma = 45; tokenPeriod = 46; tokenLeft2Quote = 47; {open double quote} tokenRight2Quote = 48; {close double quote} tokenLeft1Quote = 49; {open single quote} tokenRight1Quote = 50; {close single quote} token2Quote = 51; {double quote} token1Quote = 52; {single quote} tokenSemicolon = 53; tokenPercent = 54; tokenCaret = 55; tokenUnderline = 56; tokenAmpersand = 57; tokenAtSign = 58; tokenBar = 59; {vertical bar} tokenQuestion = 60; tokenPi = 61; {lower-case pi} tokenRoot = 62; {square root symbol} tokenSigma = 63; {capital sigma} tokenIntegral = 64; {integral sign} tokenMicro = 65; tokenCapPi = 66; {capital pi} tokenInfinity = 67; tokenColon = 68; tokenHash = 69; {e.g. #} tokenDollar = 70; tokenNoBreakSpace = 71; {non-breaking space} tokenFraction = 72; tokenIntlCurrency = 73; tokenLeftSingGuillemet = 74; tokenRightSingGuillemet = 75; tokenPerThousand = 76; tokenEllipsis = 77; tokenCenterDot = 78; tokenNil = 127; delimPad = -2; { Table selectors for GetIntlResourceTable } smWordSelectTable = 0; { get word break table from 'itl2' } smWordWrapTable = 1; { get line break table from 'itl2' } smNumberPartsTable = 2; { get number parts table from 'itl4' } smUnTokenTable = 3; { get unToken table from 'itl4' } smWhiteSpaceList = 4; { get whitespace table from 'itl4' }Data Types
TYPE TokenResults = (tokenOK,tokenOverflow,stringOverflow,badDelim, badEnding,crash); CharByteTable = PACKED ARRAY[0..255] OF SignedByte; TokenType = Integer; DelimType = ARRAY[0..1] OF TokenType; CommentType = ARRAY[0..3] OF TokenType; TokenRec = RECORD theToken: TokenType; position: Ptr; {pointer into original source} length: LongInt; {length of text in original source} stringPosition: StringPtr; {Pascal/C string copy of identifier} END; TokenRecPtr = ^TokenRec; TokenBlock = RECORD source: Ptr; {pointer to stream of characters} sourceLength: LongInt; {length of source stream} tokenList: Ptr; {pointer to array of tokens} tokenLength: LongInt; {maximum length of TokenList} tokenCount: LongInt; {number tokens generated by tokenizer} stringList: Ptr; {pointer to stream of identifiers} stringLength: LongInt; {length of string list} stringCount: LongInt; {number of bytes currently used} doString: Boolean; {make strings & put into StringList} doAppend: Boolean; {append to TokenList rather than replace} doAlphanumeric: Boolean; {identifiers may include numeric} doNest: Boolean; {do comments nest?} leftDelims: DelimType; rightDelims: DelimType; leftComment: CommentType; rightComment: CommentType; escapeCode: TokenType;{escape symbol code} decimalCode: TokenType; itlResource: Handle; {handle to current script itl4 resource} reserved: ARRAY [0..7] OF LongInt; {must be zero!} END; TokenBlockPtr = ^TokenBlock;Routines
Checking and Setting the System Direction
FUNCTION GetSysDirection : Integer; PROCEDURE SetSysDirection (newDirection: Integer);Checking and Setting Script Manager Variables
FUNCTION GetScriptManagerVariable (selector: Integer): LongInt; FUNCTION SetScriptManagerVariable (selector: Integer; param: LongInt): OSErr;Checking and Setting Script Variables
FUNCTION GetScriptVariable (script: ScriptCode; selector: Integer): LongInt; FUNCTION SetScriptVariable (script: ScriptCode; selector: Integer; param: LongInt): OSErr;Making Keyboard Settings
PROCEDURE KeyScript (code: Integer);Determining Script Codes From Font Information
FUNCTION FontScript: Integer; FUNCTION FontToScript (fontNumber: Integer): Integer; FUNCTION IntlScript: Integer;Analyzing Characters
FUNCTION CharacterByteType (textBuf: Ptr;textOffset: Integer; script: ScriptCode): Integer; FUNCTION CharacterType (textBuf: Ptr; textOffset: Integer; script: ScriptCode): Integer; FUNCTION FillParseTable (VAR table: CharByteTable; script: ScriptCode): Boolean;Directly Accessing International Resources
PROCEDURE ClearIntlResourceCache; FUNCTION GetIntlResource (theID: Integer): Handle; PROCEDURE GetIntlResourceTable (script: ScriptCode;tableCode: Integer;VAR itlHandle: Handle; VAR offset: LongInt;VAR length: LongInt);Tokenization
FUNCTION IntlTokenize (tokenParam: TokenBlockPtr): TokenResults;Transliteration
FUNCTION TransliterateText (srcHandle: Handle; dstHandle: Handle; target: Integer; srcMask: LongInt; script: ScriptCode): OSErr;Replacing a Script System's Default Routines
FUNCTION GetScriptUtilityAddress (selector: Integer; before: Boolean; script: ScriptCode): Ptr; PROCEDURE SetScriptUtilityAddress (selector: Integer; before: Boolean; routineAddr: Ptr; script: ScriptCode); FUNCTION GetScriptQDPatchAddress (trapNum: Integer; before: Boolean; forPrinting: Boolean; script: ScriptCode): Ptr; PROCEDURE SetScriptQDPatchAddress (trapNum: Integer;before: Boolean; forPrinting: Boolean; routineAddr: Ptr; script: ScriptCode);C Summary
Constants
Please see page 6-107 for a listing of constants defined in Pascal by the Script Manager. The constants as defined in C are identical to them.Data Types
typedef unsigned char TokenResults; typedef char CharByteTable[256]; typedef short TokenType; typedef TokenType DelimType[2]; typedef TokenType CommentType[4]; struct TokenRec { TokenType theToken; Ptr position; /*pointer into original source*/ long length; /*length of text in original source*/ StringPtr stringPosition; /*Pascal/C string copy of identifier*/ }; typedef struct TokenRec TokenRec; typedef TokenRec *TokenRecPtr; struct TokenBlock { Ptr source; /*pointer to stream of characters*/ long sourceLength; /*length of source stream*/ Ptr tokenList; /*pointer to array of tokens*/ long tokenLength; /*maximum length of TokenList*/ long tokenCount; /*number tokens generated by tokenizer*/ Ptr stringList; /*pointer to stream of identifiers*/ long stringLength; /*length of string list*/ long stringCount; /*number of bytes currently used*/ Boolean doString; /*make strings & put into StringList*/ Boolean doAppend; /*append to TokenList rather than replace*/ Boolean doAlphanumeric; /*identifiers may include numeric*/ Boolean doNest; /*do comments nest?*/ TokenType leftDelims[2]; TokenType rightDelims[2]; TokenType leftComment[4]; TokenType rightComment[4]; TokenType escapeCode; /*escape symbol code*/ TokenType decimalCode; Handle itlResource; /*handle to itl4 resource of current script*/ long reserved[8]; /*must be zero!*/ }; typedef struct TokenBlock TokenBlock; typedef TokenBlock *TokenBlockPtr;Routines
Checking and Setting the System Direction
#define GetSysDirection() (* (short*) 0x0BAC); pascal void SetSysDirection (short newDirection);Checking and Setting Script Manager Variables
pascal long GetScriptManagerVariable (short selector); pascal OSErr SetScriptManagerVariable (short selector, long param);Checking and Setting Script Variables
pascal long GetScriptVariable (ScriptCode script, short selector); pascal OSErr SetScriptVariable (ScriptCode script, short selector, long param);Making Keyboard Settings
pascal void KeyScript (short code);Determining Script Codes From Font Information
pascal short FontScript (void); pascal short FontToScript (short fontNumber); pascal short IntlScript (void);Analyzing Characters
pascal short CharacterByteType (Ptr textBuf, short textOffset, ScriptCode script); pascal short CharacterType (Ptr textBuf, short textOffset, ScriptCode script); pascal Boolean FillParseTable (CharByteTable table, ScriptCode script);Directly Accessing International Resources
pascal void ClearIntlResourceCache (void); pascal Handle GetIntlResource (short theID); pascal void GetIntlResourceTable (ScriptCode script, short tableCode, Handle *itlHandle, long *offset, long *length);Tokenization
pascal TokenResults IntlTokenize (TokenBlockPtr tokenParam);Transliteration
pascal OSErr TransliterateText (Handle srcHandle, Handle dstHandle, short target, long srcMask, ScriptCode script);Replacing a Script System's Default Routines
pascal Ptr GetScriptUtilityAddress (short selector, Boolean before, ScriptCode script); pascal void SetScriptUtilityAddress (short selector, Boolean before, Ptr routineAddr, ScriptCode script); pascal Ptr GetScriptQDPatchAddress (short trapNum, Boolean before, Boolean forPrinting, ScriptCode script); pascal void SetScriptQDPatchAddress (short trapNum, Boolean before, Boolean forPrinting, Ptr routineAddr, ScriptCode script);Assembly-Language Summary
Trap Macros
Trap Macro Names
Pascal name Trap macro name FontScript _FontScript IntlScript _IntlScript KeyScript _KeyScript FontToScript _FontToScript GetScriptManagerVariable _GetScriptManagerVariable SetScriptManagerVariable _SetScriptManagerVariable GetScriptVariable _GetScriptVariable SetScriptVariable _SetScriptVariable CharacterByteType _CharacterByteType CharacterType _CharacterType TransliterateText _TransliterateText FillParseTable _FillParseTable GetScriptUtilityAddress _GetScriptUtilityAddress SetScriptUtilityAddress _SetScriptUtilityAddress GetScriptQDPatchAddress _GetScriptQDPatchAddress SetScriptQDPatchAddress _SetScriptQDPatchAddress IntlTokenize _IntlTokenize GetIntlResource _GetIntlResource ClearIntlResourceCache _ClearIntlResourceCache GetIntlResourceTable _GetIntlResourceTable Global Variables
SysDirection System direction; the primary line direction and alignment for text BootDrive The drive number of the startup volume