Carbon


Selectors for Script Manager Variables

Header: Script.h

enum {
    smVersion = 0,
    smMunged = 2,
    smEnabled = 4,
    smBidirect = 6,
    smFontForce = 8,
    smIntlForce = 10,
    smForced = 12,
    smDefault = 14,
    smPrint = 16,
    smSysScript = 18,
    smLastScript = 20,
    smKeyScript = 22,
    smSysRef = 24,
    smKeyCache = 26,
    smKeySwap = 28,
    smGenFlags = 30,
    smOverride = 32,
    smCharPortion = 34,
    smDoubleByte = 36,
    smKCHRCache = 38,
    smRegionCode = 40,
    smKeyDisableState = 42
};

Constant descriptions

smVersion

(2 bytes) The Script Manager version number. This variable has the same format as the version number obtained from calling the Gestalt function with the Gestalt selector gestaltScriptMgrVersion. The high-order byte contains the major version number, and the low-order byte contains the minor version number.

smMunged

(2 bytes) The modification count for Script Manager variables. At startup, smMunged is initialized to 0, and it is incremented when the KeyScript function changes the current keyboard script and updates the variables accessed via smKeyScript and smLastScript. The smMunged selector is also incremented when the SetScriptManagerVariable function is used to change a Script Manager variable. You can check this variable at any time to see whether any of your own data structures that may depend on Script Manager variables need to be updated.

smEnabled

(1 byte) The script count; the number of currently enabled script systems. At startup time, the Script Manager initializes the script count to 0, then increments it for each installed and enabled script system (including Roman). You can use smEnabled to determine whether more than one script system is installed—that is, whether your application needs to handle non-Roman text.

Never call SetScriptManagerVariable with the smEnabled selector. It could result in inconsistency with other script system values.

smBidirect

(1 byte) The bidirectional flag, which indicates when at least one bidirectional script system is enabled. This flag is set to TRUE ($FF) if the Arabic or Hebrew script system is enabled.

smFontForce

(1 byte) The font force flag. At startup, the Script Manager sets its value from the system script’s international configuration ('itlc') resource. The flag returns 0 for FALSE and $FF for TRUE. If the system script is non-Roman, the font force flag controls whether a font with ID in the Roman script range is interpreted as belonging to the Roman script or to the system script.

When you call SetScriptManagerVariable with the smFontForce selector, be sure to pass only the value 0 or $FF, or a later call to GetScriptManagerVariable may return an unrecognized value.

smIntlForce

(1 byte) The international resources selection flag. At startup, the Script Manager sets its value from the system script’s international configuration ('itlc') resource. The flag returns 0 for FALSE and $FF for TRUE. This flag controls whether international resources of the font script or the system script are used for string manipulation.

When you call SetScriptManagerVariable with the smIntlForce selector, be sure to pass only the value 0 or $FF, or a later call to GetScriptManagerVariable may return an unrecognized value.

smForced

(1 byte) The script-forced result flag. If the current script has been forced to the system script, this flag is set to TRUE. Use the smForced selector to obtain reports of the actions of the FontScript, FontToScript, and IntlScript functions. This variable is for information only; never set its value with SetScriptManagerVariable.

smDefault

(1 byte) The script-defaulted result flag. If the script system corresponding to a specified font is not available, this flag is set to TRUE. Use this selector to obtain reports of the actions of the FontScript, FontToScript, and IntlScript functions. This variable is for information only; never set its value with SetScriptManagerVariable.

smPrint

(4 bytes) The print action function vector, set up by the Script Manager at startup.

smSysScript

(2 bytes) The system script code. At startup, the Script Manager initializes this variable from the system script’s international configuration ('itlc') resource. This variable is for information only; never set its value with SetScriptManagerVariable. Constants for all defined script codes are listed in “Script Codes”.

smLastScript

(2 bytes) The previously used keyboard script. When you change keyboard scripts with the KeyScript function, the Script Manager moves the old value of smKeyScript into smLastScript. KeyScript can also swap the current keyboard script with the previous keyboard script, in which case the contents of smLastScript and smKeyScript are swapped. Constants for all defined script codes are listed in “Script Codes”. Never set the value of this variable with SetScriptManagerVariable.

smKeyScript

(2 bytes) The current keyboard script. The KeyScript function tests and updates this variable. When you change keyboard scripts with the KeyScript function, the Script Manager moves the old value of smKeyScript into smLastScript. KeyScript can also swap the current keyboard script with the previous keyboard script, in which case the contents of smLastScript and smKeyScript are swapped. The Script Manager also uses this variable to get the proper keyboard icon and to retrieve the proper keyboard-layout ('KCHR') resource. Constants for all defined script codes are listed in “Script Codes”. Never set the value of this variable directly with SetScriptManagerVariable; call KeyScript to change keyboard scripts.

smSysRef

(2 bytes) The System Folder volume reference number. Its value is initialized from the system global variable BootDrive at startup.

smKeyCache

(4 bytes) An obsolete variable. This variable at one time held a pointer to the keyboard cache. The value it provided was not correct and should not be used.

smKeySwap

(4 bytes) A handle to the keyboard-swap ('KSWP') resource. The Script Manager initializes the handle at startup. The keyboard-swap resource controls the key combinations with which the user can invoke various actions with the KeyScript function, such as switching among script systems.

smGenFlags

(4 bytes) The general flags used by the Script Manager. The Script Manager general flags is a long word value; its high-order byte is set from the flags byte in the system script’s international configuration ('itlc') resource. These constants are available to designate bits in the variable accessed through smGenFlags:

smOverride

(4 bytes) The script override flags. At present, these flags are not set or used by the Script Manager. They are, however, reserved for future use.

smCharPortion

(2 bytes) A value used by script systems to allocate intercharacter and interword spacing when justifying text. It denotes the weight allocated to intercharacter space versus interword space. The value of this variable is initialized to 10 percent by the Script Manager, although it currently has no effect on text of the Roman script system. The variable is in 4.12 fixed-point format, which is a 16-bit signed number with 4 bits of integer and 12 bits of fraction. (In that format, 10 percent has the hexadecimal value $0199.)

smDoubleByte

(1 byte) The 2-byte flag, a Boolean value that is TRUE if at least one 2-byte script system is enabled.

smKCHRCache

(4 bytes) A pointer to the cache that stores a copy of the current keyboard-layout ('KCHR') resource.

smRegionCode

(2 bytes) The region code for this localized version of system software, obtained from the system script’s international configuration ('itlc') resource. This variable identifies the localized version of the system script. Constants for all defined region codes are listed in “Region Codes”.

smKeyDisableState

(1 byte) The current disable state for keyboards. The Script Manager disables some keyboard scripts or keyboard switching when text input must be restricted to certain script systems or when script systems are being moved into or out of the System file. These are the possible values for the variable accessed through smKeyDisableState:

The script management system maintains the keyboard disable state separately for each application. Never set the value of this variable directly with SetScriptManagerVariable; call KeyScript to change the keyboard disable state for your application.

This section lists and describes the selector constants for accessing the Script Manager variables through calls to the GetScriptManagerVariable and SetScriptManagerVariable functions. In every case the variable parameter passed to or from the function is a long integer (4 bytes); the number in parentheses indicates how many of the 4 bytes are necessary to hold the input or return value for that variable. If fewer than 4 bytes are needed, the low byte or low word contains the information.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)