Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 6 - Script Manager / Script Manager Reference
Constants


Selectors for Script Manager Variables

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 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
Value
Size of
variable (bytes)
smVersion02
smMunged22
smEnabled41
smBidirect61
smFontForce81
smIntlForce101
smForced121
smDefault141
smPrint164
smSysScript182
smLastScript202
smKeyScript222
smSysRef242
smKeyCache264
smKeySwap284
smGenFlags304
smOverride324
smCharPortion342
smDoubleByte361
smKCHRCache384
smRegionCode402
smKeyDisableState421

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 selector gestaltScriptMgrVersion. 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 the KeyScript procedure 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
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 the smEnabled 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 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. See "Using the Font Force Flag" on page 6-24.
IMPORTANT
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
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. See "Using the International Resources Selection Flag" on page 6-25.
IMPORTANT
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
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
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
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 with SetScriptManagerVariable. 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 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 on page 6-52. Never set the value of this variable with SetScriptManagerVariable.
smKeyScript
The current keyboard script. The KeyScript procedure tests and updates this variable. When you change keyboard scripts with the KeyScript procedure, 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 on page 6-52. Never set the value of this variable directly with SetScriptManagerVariable; call KeyScript 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 the KeyScript 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:
 ConstantValueExplanation
 smfNameTagEnab29(reserved for internal use)
 smfDualCaret30Use dual caret for mixed-directional text.
 smfShowIcon31Show keyboard menu even if only one keyboard layout or one script (Roman) is available. (This bit is checked only at system startup.)
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:
 ValueExplanation
 0All keyboards are enabled, switching is enabled
 1Keyboard switching is disabled
 $FFKeyboards 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; call KeyScript to change the keyboard disable state for your application.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996