AdobeCommon:
CEDAR
DEFINITIONS = {
Selection:
TYPE =
RECORD [
num: CARDINAL,
ropes: LIST OF Rope.ROPE
];
Selections: TYPE = REF SelectionsSequence;
SelectionsSequence:
TYPE =
MACHINE
DEPENDENT
RECORD [
seq: PACKED SEQUENCE length: CARDINAL OF Selection
];
ButtonType: TYPE = {string, bounded, number, enumerated};
ARState: TYPE = {Normal, CheckedOut};
DependentsSequence: TYPE = REF DependentsSequenceRec;
DependentsSequenceRec:
TYPE =
MACHINE
DEPENDENT
RECORD [
seq: PACKED SEQUENCE length: CARDINAL OF EnumeratedTypes
];
EnumeratedTypes: TYPE = REF EnumeratedTypesRec ¬ NIL;
EnumeratedTypesRec:
TYPE =
RECORD [
dependentsSequence: DependentsSequence ¬ NIL,
button: REF ANY ¬ NIL,
adjButton: REF ANY ¬ NIL,
currentHeight: CARD ¬ 1,
mainViewer: Handle ¬ NIL,
dependentOn: EnumeratedTypes ¬ NIL,
controllerOf: REF ANY ¬ NIL,
currentMenu: CARDINAL ¬ 0,
currentSelection: CARDINAL ¬ 0,
allSelections: Selections ¬ NIL,
type: AdobeOps.FieldType,
stream: IO.STREAM ¬ NIL,
boolVal: BOOL ¬ FALSE,
maxLength: CARD ¬ 0,
defaults: ARRAY AdobeOps.ToolType OF Rope.ROPE,
fieldNum: CARD ¬ 0];
ButtonsSeq: TYPE ~ REF ButtonSeqObject;
ButtonSeqObject:
TYPE ~
MACHINE
DEPENDENT
RECORD [
seq: PACKED SEQUENCE length: CARDINAL OF EnumeratedTypes
];
SystemType: TYPE = Rope.ROPE;
SystemsList: TYPE = LIST OF SystemType;
ButtonViewer:
TYPE =
RECORD [
outer: REF ANY ¬ NIL
];
FieldViewer:
TYPE =
RECORD [
outer: REF ANY ¬ NIL,
buttons: ButtonsSeq ¬ NIL
];
MessageViewer:
TYPE =
RECORD [
outer: REF ANY ¬ NIL,
reportStream: IO.STREAM ¬ NIL
];
Box: TYPE = REF ANY;
ReportProc: TYPE = PROCEDURE [h: Handle, format: Rope.ROPE, v1, v2, v3: IO.Value ¬ [null[]]];
AnotherToolProc: TYPE = PROCEDURE [parent: Handle ¬ NIL];
GetContentsProc: TYPE = PROCEDURE [box: Box] RETURNS [r: Rope.ROPE];
GetSelectionContentsProc: TYPE = PROCEDURE [box: Box ¬ NIL] RETURNS [r: Rope.ROPE];
SetContentsProc: TYPE = PROCEDURE [box: Box, r: Rope.ROPE];
SetSelectionProc: TYPE = PROCEDURE [box: Box, selection: ViewerTools.SelPos ¬ NIL];
SetDisplayStyleProc: TYPE = PROCEDURE [box: Box, style: ATOM];
SetIconProc: TYPE = PROCEDURE [h: Handle, function: ATOM];
AddButtonsProc: TYPE = PROCEDURE [h: Handle];
PaintBoxProc: TYPE = PROCEDURE [box: Box, which: ATOM];
ReLabelBoxProc: TYPE = PROCEDURE [box: Box, newLabel: Rope.ROPE];
NewMenuEntryProc: TYPE = PROCEDURE [entryName: Rope.ROPE] RETURNS [REF ANY];
FindMenuEntryProc: TYPE = PROCEDURE [h: Handle, entryName: Rope.ROPE] RETURNS [REF ANY];
ReplaceMenuEntryProc: TYPE = PROCEDURE [h: Handle, menu: REF ANY, oldEntry, newEntry: REF ANY];
InhibitEditsProc: TYPE = PROCEDURE [box: Box];
EnableEditsProc: TYPE = PROCEDURE [box: Box];
PopUpRequestProc: TYPE = PROCEDURE [title: Rope.ROPE, selections: LIST OF Rope.ROPE] RETURNS [INT];
DestroyBoxProc: TYPE = PROCEDURE [h: Handle, box: Box, draw: BOOLEAN ¬ TRUE];
GetBoxGeometryProc: TYPE = PROCEDURE [box: Box] RETURNS [x, y, w, h: INT];
SetBoxGeometryProc: TYPE = PROCEDURE [box: Box, x, y, w, h: INT, draw: BOOL ¬ TRUE];
NewFieldBoxProc: TYPE = PROCEDURE [parent: Box, x, y, w, h: INT, scrollable: BOOL ¬ TRUE, border: BOOL ¬ FALSE] RETURNS [b: Box];
NewLabelBoxProc: TYPE = PROCEDURE [parent: Box, x, y: CARD, name: Rope.ROPE, border: BOOL ¬ FALSE] RETURNS [b: Box];
SetContainerNameProc: TYPE = PROCEDURE [box: Box, name: Rope.ROPE];
SetMainNameProc: TYPE = PROCEDURE [box: Box, name: Rope.ROPE];
GetMainNameProc: TYPE = PROCEDURE [box: Box] RETURNS [name: Rope.ROPE];
MakeButtonProc: TYPE = PROCEDURE [parent: Box, x, y: CARD, name: Rope.ROPE, data: REF ANY , scrollable: BOOLEAN ¬ TRUE, proc: ATOM, cData: REF ANY, paint: BOOL ¬ FALSE] RETURNS [b: Box];
AssistLoginProc: TYPE = PROCEDURE;
GetBoxNameProc: TYPE = PROCEDURE [box: Box] RETURNS [name: Rope.ROPE];
XBoundBoxProc: TYPE = PROCEDURE [parent, box: Box];
SetBoxScrollableProc: TYPE = PROCEDURE [box: Box];
Handle: TYPE = REF AdobeViewerDataRec;
AdobeViewerDataRec:
TYPE =
RECORD [
isBusy: BOOL ¬ FALSE,
outer: REF ANY ¬ NIL,
buttonViewer: ButtonViewer,
messageViewer: MessageViewer,
fieldViewer: FieldViewer,
menu:
REF
ANY,
Menus.Menu ← NIL,
tool, oldtool: AdobeOps.ToolType ¬ edit,
knownSystems: SystemsHandle, --SystemsList ¬ NIL,
system, oldsystem: CARDINAL ¬ LAST[CARDINAL],
systemName: Rope.ROPE ¬ NIL,
unboundFieldHeight: CARD ¬ 3,
newSystem: LONG STRING ← NIL,
system, oldsystem: SystemType ← NIL,
systemHandle: AdobeOps.ARSystemHandle ¬ NIL,
systemMenuItem:
REF
ANY,
Menus.MenuEntry ← NIL,
currentAR, oldCurrentAR: CARDINAL ¬ 0,
currentARState: ARState ¬ Normal,
lastButton: ViewerClasses.Viewer ← NIL,
useQLButton, overwriteButton, formatButton: REF ANY ¬ NIL,
controlButtons: ControlSeq ¬ NIL,
editors: ARRAY[1..4] OF REF ANY ¬ ALL[NIL],
context: AdobeToolContext.UserContext ¬ NIL,
ARFile: PFS.OpenFile ¬ NIL,
instanceData: REF ANY ¬ NIL,
report: ReportProc,
getContents: GetContentsProc,
getSelectionContents: GetSelectionContentsProc,
setContents: SetContentsProc,
setSelection: SetSelectionProc,
setDisplayStyle: SetDisplayStyleProc,
setIcon: SetIconProc,
addButtons: AddButtonsProc,
paintBox: PaintBoxProc,
popUpRequest: PopUpRequestProc,
reLabelBox: ReLabelBoxProc,
newMenuEntry: NewMenuEntryProc,
findMenuEntry: FindMenuEntryProc,
replaceMenuEntry: ReplaceMenuEntryProc,
makeAnotherTool: AnotherToolProc,
inhibitEdits: InhibitEditsProc,
enableEdits: EnableEditsProc,
getBoxGeometry: GetBoxGeometryProc,
setBoxGeometry: SetBoxGeometryProc,
getBoxName: GetBoxNameProc,
destroyBox: DestroyBoxProc,
setBoxScrollable: SetBoxScrollableProc,
xBoundBox: XBoundBoxProc,
newFieldBox: NewFieldBoxProc,
newLabelBox: NewLabelBoxProc,
setContainerName: SetContainerNameProc,
setMainName: SetMainNameProc,
getMainName: GetMainNameProc,
makeButton: MakeButtonProc,
assistLogin: AssistLoginProc,
extraData: REF ANY ¬ NIL
];
ControlSeq: TYPE ~ REF ControlSeqRec ¬ NIL;
ControlSeqRec:
TYPE =
RECORD[
SEQUENCE len: CARD OF REF ANY];
SystemsHandle: TYPE = REF Systems ¬ NIL;
Systems:
TYPE =
RECORD[
next: CARDINAL ¬ 0,
system: REF SysList];
SysList: TYPE = RECORD[SEQUENCE maxLength: CARDINAL OF Rope.ROPE];
SysDescPtr: TYPE = REF SysDesc;
SysDesc:
TYPE =
RECORD[
arSH: AdobeOps.ARSystemHandle ¬ NIL,
nextNode: SysDescPtr ¬ NIL];
LockedSysDescPtr: TYPE = REF LockedPtr;
LockedPtr:
TYPE =
MONITORED
RECORD[
nodePtr: SysDescPtr];
StringArray: TYPE = AdobeServer.StringArray;
DataHandle: TYPE = REF Data;
Data:
TYPE =
RECORD [
window: REF ANY ¬ NIL,
msgSW: REF ANY ¬ NIL,
cmdSW: REF ANY ¬ NIL,
deacAgent: Supervisor.SubsystemHandle,
logonAgent: Supervisor.SubsystemHandle,
swapAgent: Supervisor.SubsystemHandle,
processID: PROCESS,
tool: AdobeOps.ToolType ¬ submit,
knownSystems: SystemsHandle ¬ NIL,
system: CARDINAL ¬ LAST[CARDINAL],
newSystem: Rope.ROPE ¬ NIL,
systemMenu: Menu.Handle ← NIL,
changingSystem: BOOLEAN ¬ FALSE,
isBusy: BOOLEAN ¬ FALSE,
dontCleanUp: BOOLEAN ¬ FALSE,
heap: UNCOUNTED ZONE ¬ NIL,
context: AdobeToolContext.UserContext ¬ NIL,
accessSession: ARAccess.Session ← NIL,
non-specific pointer to allow other tools implemented on Adobe's
interfaces to define their own instanceData
instanceData: REF ANY ¬ NIL];
ReportFields: TYPE = REF ReportFieldsSeq;
ReportFieldsSeq:
TYPE =
RECORD [
seq: SEQUENCE length: CARDINAL OF BOOLEAN];
OrderInfo: TYPE = REF OrderInfoObject;
OrderInfoObject:
TYPE =
RECORD [
widths: SEQUENCE length: CARDINAL OF OrderItem];
OrderItem:
TYPE =
RECORD [
flName: Rope.ROPE ¬ NIL,
flIndex: CARDINAL ¬ 0,
colWidth: CARDINAL ¬ 0,
colIndex: CARDINAL ¬ 0];
RowBuffer: TYPE = REF RowBufferRec;
RowBufferRec: TYPE = RECORD [s: Rope.ROPE ¬ NIL, next: RowBuffer ¬ NIL];
TemplateEntry: TYPE = {fixed, variable, string};
Template: TYPE = REF TemplateObject;
TemplateObject:
TYPE =
RECORD [
next: Template ¬ NIL,
body: SELECT type: TemplateEntry FROM
fixed => [width: CARDINAL ¬ 0],
variable => NULL,
string => [
s: Rope.ROPE ¬ NIL,
suppressFieldName: BOOLEAN ¬ FALSE,
nameStart, nameLength: CARDINAL ¬ 0],
ENDCASE];
FormatType: TYPE = {plain, columns, template};
SetStatus: TYPE = RECORD [runOffset, setIndex: CARDINAL];
constants
InitialSetStatus: SetStatus = [LAST[CARDINAL], LAST[CARDINAL]];
ColSpace: CARDINAL = 2;
ValidRelations: TYPE = ARRAY AdobeOps.FieldType OF Operations;
Operations: TYPE = PACKED ARRAY AdobeP75V2.Relation OF BOOLEAN;
validRelations: ValidRelations = [
arId: [equal: TRUE, notEqual: TRUE, lessThan: TRUE,
lessThanOrEqual: TRUE, greaterThan: TRUE,
greaterThanOrEqual: TRUE, in: FALSE, notIn: FALSE],
dateTime: [equal: TRUE, notEqual: TRUE, lessThan: TRUE,
lessThanOrEqual: TRUE, greaterThan: TRUE,
greaterThanOrEqual: TRUE, in: FALSE, notIn: FALSE],
numeric: [equal: TRUE, notEqual: TRUE, lessThan: TRUE,
lessThanOrEqual: TRUE, greaterThan: TRUE,
greaterThanOrEqual: TRUE, in: FALSE, notIn: FALSE],
fixedLengthString: [equal: TRUE, notEqual: TRUE, lessThan: FALSE,
lessThanOrEqual: FALSE, greaterThan: FALSE,
greaterThanOrEqual: FALSE, in: TRUE, notIn: TRUE],
enumerated: [equal: TRUE, notEqual: TRUE, lessThan: FALSE,
lessThanOrEqual: FALSE, greaterThan: FALSE,
greaterThanOrEqual: FALSE, in: FALSE, notIn: FALSE],
string: ALL[FALSE]];
--procedures
NoCredentials: ERROR;
CatchErrors: PROCEDURE[
h: Handle, --item: FormSW.ItemHandle, index: CARDINAL,
--windowData: DataHandle, --proc: PROC[h: Handle]];
EnableAdobeAborts: PROCEDURE[w: REF ANY];
DisableAdobeAborts: PROCEDURE[w: REF ANY];
SetFSWOrderAndDefaultFromUserFile: PROCEDURE[systemName: Rope.ROPE, arSH: AdobeOps.ARSystemHandle, server: Rope.ROPE];
GetFullLoginName: PROCEDURE [h: Handle ¬ NIL] RETURNS [loginName: Rope.ROPE];
GetData: PROCEDURE[w: REF ANY] RETURNS [Handle];
GetDataSW: PROCEDURE[sw: REF ANY] RETURNS [Handle];
CreateOtherSWs: PROCEDURE[w: Handle, makeCmdSW: BOOLEAN ¬ TRUE];
DestroyOtherSWs: PROCEDURE[data: Handle, killCmdSW: BOOLEAN ¬ TRUE];
ChangeFormSW: PROCEDURE[w: REF ANY];
PostMessage: PROCEDURE [handle: Handle, postCR: BOOL, message: Rope.ROPE];
, v1, v2, v3: IO.Value ← [null[]]];
PostNumber: PROCEDURE[sw: Handle, postCR: BOOLEAN, number: CARD];
SearchKnownSysDescList: PROCEDURE[head: LockedSysDescPtr, systemName: Rope.ROPE]
RETURNS[arSH: AdobeOps.ARSystemHandle ¬ NIL];
AddToKnownSysDescList: PROCEDURE[head: LockedSysDescPtr,
arSH: AdobeOps.ARSystemHandle];
DeleteSysDescList: PROCEDURE[head: LockedSysDescPtr]
RETURNS[nilHead: LockedSysDescPtr ¬ NIL];
GetDescList: PROCEDURE RETURNS [LockedSysDescPtr];
FindSystem: PROCEDURE[head: LockedSysDescPtr, toolData: Handle,
systemName: Rope.ROPE, useDescList: BOOLEAN]
RETURNS [arSH: AdobeOps.ARSystemHandle];
AdobeTimeRope: PROCEDURE [time: BasicTime.GMT] RETURNS [timeRope: Rope.ROPE];
Routine to change systems
ChangeSystem: PROCEDURE [toolData: Handle, systemIndex: CARDINAL,
useDescList: BOOLEAN];
Routines to manage known systems
LocateSystemInKnownSystems: PROCEDURE[name: Rope.ROPE,systems: SystemsHandle] RETURNS[system: CARDINAL];
AddSystemToKnownSystems: PROCEDURE[name: Rope.ROPE, systems: SystemsHandle];
RemoveSystemFromKnownSystems: PROCEDURE[name: Rope.ROPE,
systems: SystemsHandle];
AllocateKnownSystems: PROCEDURE[oldSeq: SystemsHandle]
RETURNS[newSeq: SystemsHandle];
--Procedures for QueryLists
QLNameHints: Buttons.ButtonProc; --provides list of available query lists
FreeHintStrings: PROCEDURE; --should work for any hint menu.
CountARs: PROCEDURE [set: AdobeOps.SetOfARs]
RETURNS [n: CARDINAL]; --counts the number of ars in a query list.
GetNextAR: PROCEDURE[set: AdobeOps.SetOfARs, current: SetStatus]
RETURNS[nextAR: AdobeOps.ARNumber, newStatus: SetStatus];--get next ar in query list/SetOfARs
GetPreviousAR: PROCEDURE[set: AdobeOps.SetOfARs, current: SetStatus]
RETURNS[nextAR: AdobeOps.ARNumber, newStatus: SetStatus];--get previous ar in query list/SetOfARs
FindThisQL: PROCEDURE[qlName: Rope.ROPE, arSH: Handle]
RETURNS [qlHandle: AdobeOps.QueryList];--get queryList given name
AndSets: PROCEDURE[set1, set2: AdobeOps.SetOfARs]
RETURNS [resultSet: AdobeOps.SetOfARs];--ANDs set1 and set2 and returns the resulting set
OrSets: PROCEDURE[set1, set2: AdobeOps.SetOfARs]
RETURNS[resultSet: AdobeOps.SetOfARs];--ORs set1 and set2 and returns the resulting set
AddToSet: PROCEDURE[arNum: AdobeOps.ARNumber, set: REF AdobeOps.SetOfARs,
lastRef: CARDINAL] RETURNS[thisRef: CARDINAL];--adds arNum to set
GrowSet: PROCEDURE [oldSet: REF AdobeOps.SetOfARs];
AddToOtherQLList: PROCEDURE [arSH: AdobeOps.ARSystemHandle,
ql: AdobeOps.QueryList];--adds ql to otherQLs of the arSH
--Procedure to reset dependent enumerated item after item it depends on has been changed
SetChoicesForEnumerated: PROCEDURE[--sw: Window.Handle, --windowData: Handle, itemIndex: CARDINAL, fli: AdobeOps.DependsOnIndex, displayIndex: CARDINAL,
reset: BOOLEAN];
FindSystem: PROCEDURE[systemName: Rope.ROPE] RETURNS [arSH: AdobeOps.ARSystemHandle];
}.