Important: The information in this document is obsolete and should not be used for new development.
Selectors for Script Manager Variables
This section lists and describes the selector constants for accessing the Script Manager variables through calls to theGetScriptManagerVariable
andSetScriptManagerVariable
functions. In every case the variable parameter passed to or from the function is a long integer (4 bytes); the column "Size of variable" 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.Descriptions of all the variables accessed by these constants follow the list.
Selector constant Variable description
smVersion
- The Script Manager version number. This variable has the same format as the version number obtained from calling the
Gestalt
function with the Gestalt selectorgestaltScriptMgrVersion
. The high-order byte contains the major version number, and the low-order byte contains the minor version number.smMunged
- The modification count for Script Manager variables. At startup,
smMunged
is initialized to 0, and it is incremented when theKeyScript
procedure changes the current keyboard script and updates the variables accessed viasmKeyScript
andsmLastScript
. ThesmMunged
selector is also incremented when theSetScriptManagerVariable
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
- 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.- IMPORTANT
- Never call
SetScriptManagerVariable
with thesmEnabled
selector. It could result in inconsistency with other script system values.smBidirect
- 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
- 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 forFALSE
and $FF forTRUE
. 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. See "Using the Font Force Flag" on page 6-24.- IMPORTANT
- When you call
SetScriptManagerVariable
with thesmFontForce
selector, be sure to pass only the value 0 or $FF, or a later call toGetScriptManagerVariable
may return an unrecognized value.smIntlForce
- 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 forFALSE
and$FF
forTRUE
. This flag controls whether international resources of the font script or the system script are used for string manipulation. See "Using the International Resources Selection Flag" on page 6-25.- IMPORTANT
- When you call
SetScriptManagerVariable
with thesmIntlForce
selector, be sure to pass only the value 0 or $FF, or a later call toGetScriptManagerVariable
may return an unrecognized value.smForced
- The script-forced result flag. If the current script has been forced to the system script, this flag is set to
TRUE
. Use thesmForced
selector to obtain reports of the actions of theFontScript
,FontToScript
, andIntlScript
functions. This variable is for information only; never set its value withSetScriptManagerVariable
.smDefault
- 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 theFontScript
,FontToScript
, andIntlScript
functions. This variable is for information only; never set its value withSetScriptManagerVariable
.smPrint
- The print action routine vector, set up by the Script Manager at startup. See Inside Macintosh: Devices for information on the print action routine.
smSysScript
- 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 withSetScriptManagerVariable
. Constants for all defined script codes are listed on page 6-52.smLastScript
- The previously used keyboard script. When you change keyboard scripts with the
KeyScript
procedure, the Script Manager moves the old value ofsmKeyScript
intosmLastScript
.KeyScript
can also swap the current keyboard script with the previous keyboard script, in which case the contents ofsmLastScript
andsmKeyScript
are swapped. Constants for all defined script codes are listed on page 6-52. Never set the value of this variable withSetScriptManagerVariable
.smKeyScript
- The current keyboard script. The
KeyScript
procedure tests and updates this variable. When you change keyboard scripts with theKeyScript
procedure, the Script Manager moves the old value ofsmKeyScript
intosmLastScript
.KeyScript
can also swap the current keyboard script with the previous keyboard script, in which case the contents ofsmLastScript
andsmKeyScript
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 on page 6-52. Never set the value of this variable directly withSetScriptManagerVariable
; callKeyScript
to change keyboard scripts.smSysRef
- The System Folder volume reference number. Its value is initialized from the system global variable
BootDrive
at startup.smKeyCache
- 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
- 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 theKeyScript
procedure, such as switching among script systems. This resource is described in the appendix "Keyboard Resources" in this book.smGenFlags
- 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. The following constants are available to designate bits in the variable accessed through
smGenFlags
:smOverride
- 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
- 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
- The 2-byte flag, a Boolean value that is
TRUE
if at least one 2-byte script system is enabled.smKCHRCache
- A pointer to the cache that stores a copy of the current keyboard-layout (
'KCHR'
) resource. The keyboard-layout resource is described in the appendix "Keyboard Resources" in this book.smRegionCode
- 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 starting on page 6-57.smKeyDisableState
- 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. See "Making Keyboard Settings" beginning on page 6-17. These are the possible values for the variable accessed through
smKeyDisableState
:
Value Explanation 0 All keyboards are enabled, switching is enabled 1 Keyboard switching is disabled $FF Keyboards for all non-Roman secondary scripts are disabled - The script management system maintains the keyboard disable state separately for each application. Never set the value of this variable directly with
SetScriptManagerVariable
; callKeyScript
to change the keyboard disable state for your application.