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

502 lines
12 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;
; File: Editions.a
;
; Contains: Assembly Interface for Edition Manager
;
; Written by: Nick Kledzik
;
; Copyright: © 1990 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: BigBang
;
; Change History (most recent first):
;
; <5> 8/15/91 MH adjusted formatting of comments to allow a space after "DS
; EditionContainerSpec"
; <4> 8/15/91 MH moved conditional include of FSEqu.a inside the conditional
; assembly directive for Editions.a itself
; <3> 1/30/91 gbm sab, #38: Change the already including this file variable to
; all uppercase (for security reasons)
; <2> 10/3/90 ngk Change file types for edition files. edtP -> edtp, edtT -> edtt
; <1> 8/26/90 ngk first checked in
; <0> 8/26/90 ngk Created
;
; To Do:
;
;--------------------------------------------------------------------
IF &TYPE('__INCLUDINGEDITIONS__') = 'UNDEFINED' THEN
__INCLUDINGEDITIONS__ SET 1
IF &TYPE('__INCLUDINGFSEQU__') = 'UNDEFINED' THEN ; get definition of FSSpec
INCLUDE 'FSEqu.a'
ENDIF
; resource types
rSectionType EQU 'sect'
; section types
stSubscriber EQU $01
stPublisher EQU $0A
; Update Modes
sumAutomatic EQU 0 ; subscriber update mode - Automatically
sumManual EQU 1 ; subscriber update mode - Manually
pumOnSave EQU 0 ; publisher update mode - On Save
pumManual EQU 1 ; publisher update mode - Manually
; EditionContainer subpart usage
kPartsNotUsed EQU 0
kPartNumberUnknown EQU -1
; preview size
kPreviewWidth EQU 120
kPreviewHeight EQU 120
; special formats
kPublisherDocAliasFormat EQU 'alis' ; same as rAliasType
kPreviewFormat EQU 'prvw'
kFormatListFormat EQU 'fmts'
; bits for formatsMask
kPICTformatMask EQU 1
kTEXTformatMask EQU 2
ksndFormatMask EQU 4
; Finder types for edition files
kPICTEditionFileType EQU 'edtp'
kTEXTEditionFileType EQU 'edtt'
ksndEditionFileType EQU 'edts'
kUnknownEditionFileType EQU 'edtu'
; pseudo-item hits for dialogHooks
; the first is for NewPublisher or NewSubscriber Dialogs
emHookRedrawPreview EQU 150
; the following are for SectionOptions Dialog
emHookCancelSection EQU 160
emHookGoToPublisher EQU 161
emHookGetEditionNow EQU 162
emHookSendEditionNow EQU 162
emHookManualUpdateMode EQU 163
emHookAutoUpdateMode EQU 164
; the refcon field of the dialog record in a modalfilter or
; dialoghook during SectionOptionsDialog contains one the following
emOptionsDialogRefCon EQU 'optn'
emCancelSectionDialogRefCon EQU 'cncl'
emGoToPubErrDialogRefCon EQU 'gerr'
; misc
kFormatLengthUnknown EQU -1
; record definitions
;
SectionRecord RECORD 0
version DS.B 1 ; SignedByte { always 1 in 7.0 release }
kind DS.B 1 ; SectionType { publisher or subscriber }
mode DS.W 1 ; UpdateMode { auto or manual }
mdDate DS.L 1 ; TimeStamp { version of data in section }
sectionID DS.L 1 ; LONGINT { application specific, unique per document }
refCon DS.L 1 ; LONGINT { application specific }
alias DS.L 1 ; AliasHandle { handle to Alias Record }
; the following fields are private and set up by RegisterSection
subPart DS.L 1 ; LONGINT { which part of container, always kPartsNotUsed in 7.0 }
nextSection DS.L 1 ; SectionHandle { for linked list of app's Sections }
controlBlock DS.L 1 ; Handle { shared controlblock for this section. }
refNum DS.L 1 ; EditionRefNum { NIL outside of Open/CloseEdition }
size EQU *
ENDR
EditionContainerSpec RECORD 0
theFile DS FSSpec ;
theFileScript DS.W 1 ; ScriptCode
thePart DS.L 1 ; LONGINT
thePartName DS.B 32 ; Str31
thePartScript DS.W 1 ; ScriptCode
size EQU *
ENDR
EditionInfoRecord RECORD 0
crDate DS.L 1 ; Timestamp { date EditionContainer was created }
mdDate DS.L 1 ; Timestamp { date of last change }
fdCreator DS.B 4 ; OSType { file creator }
fdType DS.B 4 ; OSType { file type, 'edtT', etc }
container DS EditionContainerSpec ; { the Edition }
size EQU *
ENDR
NewPublisherReply RECORD 0
canceled DS.B 1 ; BOOLEAN { O }
replacing DS.B 1 ; BOOLEAN { O }
usePart DS.B 1 ; BOOLEAN { I }
pad1 DS.B 1 ;
preview DS.L 1 ; Handle { I }
previewFormat DS.B 4 ; FormatType { I }
container DS EditionContainerSpec ; { I/O }
size EQU *
ENDR
NewSubscriberReply RECORD 0
canceled DS.B 1 ; BOOLEAN { O }
formatsMask DS.B 1 ; SignedByte { I }
container DS EditionContainerSpec ; { I/O }
size EQU *
ENDR
SectionOptionsReply RECORD 0
canceled DS.B 1 ; BOOLEAN { O }
changed DS.B 1 ; BOOLEAN { O }
sectionH DS.L 1 ; SectionHandle { I }
action DS.B 4 ; ResType { 0 }
size EQU *
ENDR
; FormatIOVerb's
ioHasFormat EQU 0
ioReadFormat EQU 1
ioNewFormat EQU 2
ioWriteFormat EQU 3
FormatIOParamBlock RECORD 0
ioRefNum DS.L 1 ; LONGINT
format DS.B 4 ; FormatType
formatIndex DS.L 1 ; LONGINT
offset DS.L 1 ; LONGINT
buffPtr DS.L 1 ; Ptr
buffLen DS.L 1 ; LONGINT
size EQU *
ENDR
; EditionOpenerVerb's
eoOpen EQU 0
eoClose EQU 1
eoOpenNew EQU 2
eoCloseNew EQU 3
eoCanSubscribe EQU 4
EditionOpenerParamBlock RECORD 0
info DS EditionInfoRecord ;
sectionH DS.L 1 ; SectionHandle
document DS.L 1 ; FSSpecPtr
fdCreator DS.B 4 ; OSType
ioRefNum DS.L 1 ; LONGINT
ioProc DS.L 1 ; FormatIOProcPtr
success DS.B 1 ; BOOLEAN
formatsMask DS.B 1 ; SignedByte
size EQU *
ENDR
; Section Events
sectionEventMsgClass EQU 'sect'
sectionReadMsgID EQU 'read'
sectionWriteMsgID EQU 'writ'
sectionScrollMsgID EQU 'scrl'
sectionCancelMsgID EQU 'cncl'
;
; Section events now arrive in the message buffer using the AppleEvent format.
; The direct object parameter is an aeTemporaryIDParamType ('tid '). The temporary
; ID's type is rSectionType ('sect') and the 32-bit value is a SectionHandle.
; The following is a sample buffer
;
; name offset contents
; ---- ------ --------
;
; header 0 'aevt'
; majorVersion 4 $01
; minorVersion 6 $01
; endOfMetaData 8 ';;;;'
; directObjKey 12 '----'
; paramType 16 'tid '
; paramLength 20 $0008
; tempIDType 24 'sect'
; tempID 28 the SectionHandle <-- this is want you want
;
; FUNCTION InitEditionPack: OSErr;
MACRO
_InitEditionPack
MOVE.W #$0011,-(SP)
MOVE.W #$0100,D0
_Pack11
ENDM
; FUNCTION NewSection(container: EditionContainerSpec;
; sectionDocument: FSSpecPtr;
; kind: SectionType;
; sectionID: LONGINT;
; initalMode: UpdateMode;
; VAR sectionH: SectionHandle): OSErr;
MACRO
_NewSection
MOVE.W #$0A02,D0
_Pack11
ENDM
; FUNCTION RegisterSection(sectionDocument: FSSpec; sectionH: SectionHandle;
; VAR aliasWasUpdated: BOOLEAN): OSErr;
MACRO
_RegisterSection
MOVE.W #$0604,D0
_Pack11
ENDM
; FUNCTION UnRegisterSection(sectionH: SectionHandle): OSErr;
MACRO
_UnRegisterSection
MOVE.W #$0206,D0
_Pack11
ENDM
; FUNCTION IsRegisteredSection(sectionH: SectionHandle): OSErr;
MACRO
_IsRegisteredSection
MOVE.W #$0208,D0
_Pack11
ENDM
; FUNCTION AssociateSection(sectionH: SectionHandle; newSectionDocument: FSSpecPtr): OSErr;
MACRO
_AssociateSection
MOVE.W #$040C,D0
_Pack11
ENDM
; FUNCTION CreateEditionContainerFile(editionFile: FSSpec; fdCreator: OSType;
; editionFileNameScript: ScriptCode): OSErr;
MACRO
_CreateEditionContainerFile
MOVE.W #$050E,D0
_Pack11
ENDM
; FUNCTION DeleteEditionContainerFile(editionFile: FSSpec): OSErr;
MACRO
_DeleteEditionContainerFile
MOVE.W #$0210,D0
_Pack11
ENDM
; FUNCTION OpenEdition(subscriberSectionH: SectionHandle;
; VAR refNum: EditionRefNum): OSErr;
MACRO
_OpenEdition
MOVE.W #$0412,D0
_Pack11
ENDM
; FUNCTION OpenNewEdition(publisherSectionH: SectionHandle; fdCreator: OSType;
; publisherSectionDocument: FSSpecPtr;
; VAR refNum: EditionRefNum): OSErr;
MACRO
_OpenNewEdition
MOVE.W #$0814,D0
_Pack11
ENDM
; FUNCTION CloseEdition(whichEdition: EditionRefNum; successful: BOOLEAN): OSErr;
MACRO
_CloseEdition
MOVE.W #$0316,D0
_Pack11
ENDM
; FUNCTION EditionHasFormat(whichEdition: EditionRefNum; whichFormat: FormatType;
; VAR formatSize: Size): OSErr;
MACRO
_EditionHasFormat
MOVE.W #$0618,D0
_Pack11
ENDM
; FUNCTION ReadEdition(whichEdition: EditionRefNum; whichFormat: FormatType;
; buffPtr: Ptr; VAR buffLen: Size): OSErr;
MACRO
_ReadEdition
MOVE.W #$081A,D0
_Pack11
ENDM
; FUNCTION WriteEdition(whichEdition: EditionRefNum; whichFormat: FormatType;
; buffPtr: Ptr; buffLen: Size): OSErr;
MACRO
_WriteEdition
MOVE.W #$081C,D0
_Pack11
ENDM
; FUNCTION GetEditionFormatMark(whichEdition: EditionRefNum; whichFormat: FormatType;
; VAR currentMark: LONGINT): OSErr;
MACRO
_GetEditionFormatMark
MOVE.W #$061E,D0
_Pack11
ENDM
; FUNCTION SetEditionFormatMark(whichEdition: EditionRefNum; whichFormat: FormatType;
; setMarkTo: LONGINT): OSErr;
MACRO
_SetEditionFormatMark
MOVE.W #$0620,D0
_Pack11
ENDM
; FUNCTION GetEditionInfo(sectionH: SectionHandle; VAR editionInfo: EditionInfoRecord): OSErr;
MACRO
_GetEditionInfo
MOVE.W #$0422,D0
_Pack11
ENDM
; FUNCTION GoToPublisherSection(container: EditionContainerSpec): OSErr;
MACRO
_GoToPublisherSection
MOVE.W #$0224,D0
_Pack11
ENDM
; FUNCTION GetLastEditionContainerUsed(VAR container: EditionContainerSpec): OSErr;
MACRO
_GetLastEditionContainerUsed
MOVE.W #$0226,D0
_Pack11
ENDM
; FUNCTION GetStandardFormats(container: EditionContainerSpec; VAR previewFormat: FormatType;
; preview, publisherAlias, formats: Handle): OSErr;
MACRO
_GetStandardFormats
MOVE.W #$0A28,D0
_Pack11
ENDM
; FUNCTION GetEditionOpenerProc(VAR opener: EditionOpenerProcPtr): OSErr;
MACRO
_GetEditionOpenerProc
MOVE.W #$022A,D0
_Pack11
ENDM
; FUNCTION SetEditionOpenerProc(opener: EditionOpenerProcPtr): OSErr;
MACRO
_SetEditionOpenerProc
MOVE.W #$022C,D0
_Pack11
ENDM
; FUNCTION CallEditionOpenerProc(selector: EditionOpenerVerb; VAR PB: EditionOpenerParamBlock;
; routine: EditionOpenerProcPtr): OSErr;
MACRO
_CallEditionOpenerProc
MOVE.W #$052E,D0
_Pack11
ENDM
; FUNCTION CallFormatIOProc(selector: FormatIOVerb; VAR PB: FormatIOParamBlock;
; routine: FormatIOProcPtr): OSErr;
MACRO
_CallFormatIOProc
MOVE.W #$0530,D0
_Pack11
ENDM
; FUNCTION NewSubscriberDialog(VAR reply: NewSubscriberReply): OSErr;
MACRO
_NewSubscriberDialog
MOVE.W #$0232,D0
_Pack11
ENDM
; FUNCTION NewSubscriberExpDialog(VAR reply: NewSubscriberReply; where: Point;
; expansionDITLresID: INTEGER; dlgHook: ExpDlgHookProcPtr;
; filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr;
MACRO
_NewSubscriberExpDialog
MOVE.W #$0B34,D0
_Pack11
ENDM
; FUNCTION NewPublisherDialog(VAR reply: NewPublisherReply): OSErr;
MACRO
_NewPublisherDialog
MOVE.W #$0236,D0
_Pack11
ENDM
; FUNCTION NewPublisherExpDialog(VAR reply: NewPublisherReply; where: Point;
; expansionDITLresID: INTEGER; dlgHook: ExpDlgHookProcPtr;
; filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr;
MACRO
_NewPublisherExpDialog
MOVE.W #$0B38,D0
_Pack11
ENDM
; FUNCTION SectionOptionsDialog(VAR reply: SectionOptionsReply): OSErr;
MACRO
_SectionOptionsDialog
MOVE.W #$023A,D0
_Pack11
ENDM
; FUNCTION SectionOptionsExpDialog(VAR reply: SectionOptionsReply; where: Point;
; expansionDITLresID: INTEGER; dlgHook: ExpDlgHookProcPtr;
; filterProc: ExpModalFilterProcPtr; yourDataPtr: UNIV Ptr): OSErr;
MACRO
_SectionOptionsExpDialog
MOVE.W #$0B3C,D0
_Pack11
ENDM
ENDIF ; ...already included