sys7.1-doc-wip/Interfaces/AIncludes/TextServices.a
2019-07-27 22:37:48 +08:00

409 lines
12 KiB
Plaintext

;
; File: TextServices.a
;
; Contains: Text Services Manager Assembler Definitions.
;
; Written by: Kenny SC. Tung
;
; Copyright: © 1991-1992 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <27> 10/22/92 KST Added Low level routines macros which are dispatched directly to
; the Component Manager.
; <26> 8/4/92 DCL Moved InformTSM out of the public eye and into TSMPrivate.
; <25> 5/18/92 KST #1029814 <JH>: Deleted "tsmDialogStateSavedErr" and added a new
; error code "tsmUnSupportedTypeErr".
; <24> 5/1/92 KST #1028301,<JH>: JH,#1028301: SetTSMDialogState,
; RestoreTSMDialogState, TSMChangeCursor, and TSMRestoreCursor
; calls are no longer needed and should be removed from the source
; code.
; <23> 4/24/92 KST BMcGhie,changed TSM's official error codes to start from -2500.
; <22> 3/3/92 KST Added 2 new calls: "TSMChangeCursor", "TSMRestoreCursor".
; <21> 3/2/92 KST Moved kMaxTSMSelector to TSMPrivate.a for adding a private trap
; selector.
; <20> 2/28/92 KST Added 2 new calls "SetTSMDialogState", and "RestoreTSMDialogState".
; <19> 2/27/92 KST Renamed "SendAEtoClient" to "SendAEFromTSMComponent".
; <18> 2/25/92 KST Changed low level component call selector to include parameter
; size.
; <17> 2/11/92 DCL Changed the name of this file from TSMEqu.a to TextServices.a
; for better read-ability.
; <16> 2/10/92 KST Adding a new error code and moved TSM message selectors to
; TSMPrivate. 'inpm' resource now stores FEP ID for the old input
; method.
; <15> 1/31/92 YK Added FindServiceWindow.
; <14> 1/29/92 KST Removed IsApplicationTSMAware, it is now only used internally.
; <13> 1/16/92 KST It's actually kMsgChangeToOldJIM.
; <12> 1/16/92 KST Add a new message to InformTSM: kMsgChangeOld2NewJIM.
; <11> 1/10/92 KST Undo the previous change. That's not the problem.
; <10> 1/9/92 KST Changed SetDefaultInputMethod selector back to 13 so that we can
; build TSM INIT with d13.
; <9> 1/8/92 KST Removed kKillTSMAwareApp. CleanUpTSMApp is now a message to
; InforTSM.
; <8> 1/4/92 KST Add a new routine "CloseTextService". Also "OpenTextService" now
; returns component instance to the caller.
; <7> 1/3/92 KST Adding some new selectors: "kInformTSM",
; "kInitTSMAwareApplication", "kCloseTSMAwareApplication",
; "kCloseUpTSMAwareApplication".
; <6> 12/20/91 KST Making progress toward Alpha. Changed "inline" to "TSM", and
; added new calls.
; <5> 12/10/91 KST Adding a new selector: "kInlineAwareRegister", and renamed all
; the selectors to begin with "k".
; <4> 12/6/91 SMB Adding macros…
; <3> 11/26/91 KST Low level TSM routines are now dispatched directly to the
; Component Manager.
; <2> 11/23/91 KST Check in the first time for Cube-E.
;
;
;
; •• Note: _TSMDispatch, and selectors will be moved to TRAP.a when everything is settled.
;
IF &TYPE('__TSMAInclude__') = 'UNDEFINED' THEN
__TSMAInclude__ SET 1
Include 'Traps.a'
kTSMVersion equ 1 ; Version of the Text Services Manager
kTextService equ 'tsvc' ; component type for the component description
kInputMethodService equ 'inpm' ; component subtype for the component description
;;-------------------------------------------------------------------------;;
tsmUnsupScriptLanguageErr EQU -2500 ;
tsmInputMethodNotFoundErr EQU -2501 ;
tsmNotAnAppErr EQU -2502 ; not an application error
tsmAlreadyRegisteredErr EQU -2503 ; want to register again error
tsmNeverRegisteredErr EQU -2504 ; app is not TSM aware error
tsmInvalidDocIDErr EQU -2505 ; invalid TSM documentation id
tsmTSMDocBusyErr EQU -2506 ; document is still active
tsmDocNotActiveErr EQU -2507 ; document is NOT active
tsmNoOpenTSErr EQU -2508 ; no open text service
tsmCantOpenComponentErr EQU -2509 ; can't open the component
tsmTextServiceNotFoundErr EQU -2510 ; no text service found
tsmDocumentOpenErr EQU -2511 ; there are open documents
tsmUseInputWindowErr EQU -2512 ; not TSM aware because we are using input window
tsmTSHasNoMenuErr EQU -2513 ; the text service has no menu
tsmTSNotOpenErr EQU -2514 ; no open text service to close
tsmComponentAlreadyOpenErr EQU -2515 ; text service already opened for the document
tsmInputMethodIsOldErr EQU -2516 ; returned by GetDefaultInputMethod ONLY
tsmScriptHasNoIMErr EQU -2517 ; script has no imput method or is using old IM.
tsmUnsupportedTypeErr EQU -2518 ; unSupported interface type error
tsmUnknownErr EQU -2519 ; any other errors
;;-------------------------------------------------------------------------;;
_TSMDispatch OPWORD $AA54 ; should be moved later
TSMTrapNumber EQU $AA54
; Text Services Manager function selectors ...
kNewTSMDocument equ 0 ; create new TSM aware document
kDeleteTSMDocument equ 1 ; delete TSM aware document
kActivateTSMDocument equ 2 ; activate TSM aware document
kDeactivateTSMDocument equ 3 ; deactivate TSM aware document
kTSMEvent equ 4 ; pass all events to TSM
kTSMMenuSelect equ 5 ; pass menu selection to TSM
kSetTSMCursor equ 6 ; set the cursor
kFixTSMDocument equ 7 ; terminate text services
kGetServiceList equ 8 ; get all text service components
kOpenTextService equ 9 ; open the text service
kCloseTextService equ 10 ; close the text service
kSendAEFromTSMComponent equ 11 ; send Apple Event from component to client
;; Utilities ...
kSetDefaultInputMethod equ 12 ;
kGetDefaultInputMethod equ 13 ; (Get = D)
kSetTextServiceLanguage equ 14 ;
kGetTextServiceLanguage equ 15 ;
kUseInputWindow equ 16 ;
kNewServiceWindow equ 17 ;
kCloseServiceWindow equ 18 ;
kGetFrontServiceWindow equ 19 ;
kInitTSMAwareApplication equ 20 ; claim TSM aware application
kCloseTSMAwareApplication equ 21 ; application deregisters itself as TSM aware
kFindServiceWindow equ 23
;;-------------------------------------------------------------------------;;
;; Low level routines which are dispatched directly to the Component Manager ...
kCMGetScriptLangSupport equ $00040001 ;
kCMInitiateTextService equ $00000002 ;
kCMTerminateTextService equ $00000003 ;
kCMActivateTextService equ $00000004 ;
kCMDeactivateTextService equ $00000005 ;
kCMTextServiceEvent equ $00060006 ;
kCMGetTextServiceMenu equ $00040007 ;
kCMTextServiceMenuSelect equ $00060008 ;
kCMFixTextService equ $00000009 ;
kCMSetTextServiceCursor equ $0004000A ;
kCMHidePaletteWindows equ $0000000B
;;-------------------------------------------------------------------------;;
;; trap routine macros ...
macro
_NewTSMDocument
move.w #kNewTSMDocument,d0
_TSMDispatch
endm
macro
_DeleteTSMDocument
move.w #kDeleteTSMDocument,d0
_TSMDispatch
endm
macro
_ActivateTSMDocument
move.w #kActivateTSMDocument,d0
_TSMDispatch
endm
macro
_DeactivateTSMDocument
move.w #kDeactivateTSMDocument,d0
_TSMDispatch
endm
macro
_TSMEvent
move.w #kTSMEvent,d0
_TSMDispatch
endm
macro
_TSMMenuSelect
move.w #kTSMMenuSelect,d0
_TSMDispatch
endm
macro
_SetTSMCursor
move.w #kSetTSMCursor,d0
_TSMDispatch
endm
macro
_FixTSMDocument
move.w #kFixTSMDocument,d0
_TSMDispatch
endm
macro
_GetServiceList
move.w #kGetServiceList,d0
_TSMDispatch
endm
macro
_OpenTextService
move.w #kOpenTextService,d0
_TSMDispatch
endm
macro
_CloseTextService
move.w #kCloseTextService,d0
_TSMDispatch
endm
macro
_SendAEFromTSMComponent
move.w #kSendAEFromTSMComponent,d0 ; kSendAEFromTSMComponent = 11
_TSMDispatch
endm
macro
_InitTSMAwareApplication
move.w #kInitTSMAwareApplication,d0
_TSMDispatch
endm
macro
_CloseTSMAwareApplication
move.w #kCloseTSMAwareApplication,d0
_TSMDispatch
endm
macro
_SetDefaultInputMethod
move.w #kSetDefaultInputMethod,d0
_TSMDispatch
endm
macro
_GetDefaultInputMethod
move.w #kGetDefaultInputMethod,d0
_TSMDispatch
endm
macro
_SetTextServiceLanguage
move.w #kSetTextServiceLanguage,d0
_TSMDispatch
endm
macro
_GetTextServiceLanguage
move.w #kGetTextServiceLanguage,d0
_TSMDispatch
endm
macro
_UseInputWindow
move.w #kUseInputWindow,d0
_TSMDispatch
endm
macro
_NewServiceWindow
move.w #kNewServiceWindow,d0
_TSMDispatch
endm
macro
_CloseServiceWindow
move.w #kCloseServiceWindow,d0
_TSMDispatch
endm
macro
_GetFrontServiceWindow
move.w #kGetFrontServiceWindow,d0
_TSMDispatch
endm
macro
_FindServiceWindow
move.w #kFindServiceWindow,d0
_TSMDispatch
endm
kUnknownScript EQU $FFFF ; undefined script
kUnknownLanguage EQU $FFFF ; undefined language
ScriptLanguageRec RECORD 0
fScript ds.w 1 ; (word) script code
fLanguage ds.w 1 ; (word) language code
ENDR
;; Change #27 ...
macro
_GetScriptLanguageSupport
move.l #kCMGetScriptLangSupport,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_InitiateTextService
move.l #kCMInitiateTextService,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_TerminateTextService
move.l #kCMTerminateTextService,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_ActivateTextService
move.l #kCMActivateTextService,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_DeactivateTextService
move.l #kCMDeactivateTextService,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_TextServiceEvent
move.l #kCMTextServiceEvent,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_GetTextServiceMenu
move.l #kCMGetTextServiceMenu,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_TextServiceMenuSelect
move.l #kCMTextServiceMenuSelect,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_FixTextService
move.l #kCMFixTextService,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_SetTextServiceCursor
move.l #kCMSetTextServiceCursor,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
macro
_HidePaletteWindows
move.l #kCMHidePaletteWindows,-(sp) ; push parameter size and dispatch selector
moveq #0,d0 ; Component call #0
_ComponentDispatch
endm
ENDIF ; ...already included