GGState.mesa
Contents: Routines for getting and setting values in the Gargoyle user interface state.
Copyright Ó 1986, 1987, 1992 by Xerox Corporation. All rights reserved.
Pier, June 23, 1993 4:56 pm PDT
Bier, March 19, 1993 4:00 pm PST
DIRECTORY
BiScrollersTransformsTypes, Geom2D, GGAlignTypes, GGBasicTypes, GGCircleCache, GGCoreTypes, GGFont, GGHistoryTypes, GGInterfaceTypes, GGModelTypes, Imager, ImagerTransformation, Rope;
GGState: CEDAR DEFINITIONS = BEGIN
Caret: TYPE = GGInterfaceTypes.Caret;
DefaultData: TYPE = GGModelTypes.DefaultData;
DisplayStyle: TYPE = GGModelTypes.DisplayStyle;
ExtendMode: TYPE = GGModelTypes.ExtendMode;
FeatureCycler: TYPE = GGInterfaceTypes.FeatureCycler;
FontData: TYPE = GGFont.FontData;
GGData: TYPE = GGInterfaceTypes.GGData;
GravityType: TYPE = GGInterfaceTypes.GravityType;
HistoryEvent: TYPE = GGHistoryTypes.HistoryEvent;
SelectMode: TYPE = GGModelTypes.SelectMode;
SequenceOfReal: TYPE = GGCoreTypes.SequenceOfReal;
SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor;
StrokeEnd: TYPE = GGModelTypes.StrokeEnd;
StrokeJoint: TYPE = GGModelTypes.StrokeJoint;
Transformation: TYPE = ImagerTransformation.Transformation;
ROPE: TYPE = Rope.ROPE;
Vector: TYPE = GGBasicTypes.Vector;
NotNewVersion:
PROC [ggData: GGData, op:
ATOM];
Tells viewer it is unedited. op is either $clear or $clean. The unedited icon for a cleared or cleaned Viewer is used.
ChangeIcon:
PROC [ggData: GGData, op:
ATOM];
op is either $clear or $clean. The unedited icon for a cleared or cleaned Viewer is used.
ColorToolIsBound: PROC [ggData: GGData] RETURNS [BOOL ¬ FALSE];
GetViewport:
PROC [ggData: GGData]
RETURNS [rect: Imager.Rectangle];
Finds the rectangle representing the bounds of the current action area.
GetGGInputFocus: PROC RETURNS [focusData: GGData ¬ NIL];
GetAnchor: PROC [ggData: GGData] RETURNS [Caret];
GetBiScrollersTransform: PROC [ggData: GGData] RETURNS [clientToViewer: Transformation];
GetBiScrollersScale:
PROC [ggData: GGData]
RETURNS [s:
REAL];
The larger of the two scaling components of clientToViewer.
GetBiScrollersTransforms: PROC [ggData: GGData] RETURNS [clientToViewer, viewerToClient: Transformation];
SetBiScrollersTransform: PROC [ggData: GGData, clientToViewer: Transformation, paint: BOOL ← TRUE, ageOp: AgeOp ← remember];
BiScrollersConcat: PUBLIC PROC [ggData: GGData, t: Transformation, paint: BOOL ← TRUE, ageOp: AgeOp ← remember];
ScaleOp: TYPE = BiScrollersTransformsTypes.ScaleOp;
BiScrollersScale:
PROC [ggData: GGData, op: ScaleOp];
ScaleOp: TYPE = RECORD [variant: SELECT op: * FROM
reset => [],
byArg => [arg: REAL],
diff => [x, y: REAL],
ENDCASE];
RotateOp: TYPE = BiScrollersTransformsTypes.RotateOp;
BiScrollersRotate:
PROC [ggData: GGData, op: RotateOp];
RotateOp: TYPE = RECORD [variant: SELECT op: * FROM
reset => [],
byArg => [arg: REAL--degrees--],
ENDCASE];
BiScrollersShift: PROC [ggData: GGData, dx, dy: REAL];
Location: TYPE = BiScrollersTransformsTypes.Location;
AgeOp: TYPE = BiScrollersTransformsTypes.AgeOp;
BiScrollersAlign: PROC [ggData: GGData, client, viewer: Location, doX, doY: BOOL ← TRUE, ageOp: AgeOp ¬ remember];
Rect: TYPE = Geom2D.Rect;
BiScrollersBoxScale: PROC [ggData: GGData, from, to: Rect --both in viewer coords--, uniformly: BOOL ¬ TRUE];
BiScrollersPreviousTransform: PROC [ggData: GGData];
DoBSUserAction: PROC [ggData: GGData, event: LIST OF REF];
Alignment Menus
FilterLists: TYPE = GGAlignTypes.FilterLists;
GetFilterLists: PROC [ggData: GGData] RETURNS [filterLists: FilterLists];
AlignmentType: TYPE = {slope, angle, radius, lineDistance};
SetAllAlignmentStates: PROC [ggData: GGData, type: AlignmentType, state: BOOL];
DeleteSelectedAlignments: PROC [ggData: GGData, type: AlignmentType];
ToggleAlignment: PROC [ggData: GGData, alignVal: REAL, type: AlignmentType] RETURNS [menuValue: REAL, changedToOn: BOOL ¬ FALSE];
GetSlopeValue: PROC [ggData: GGData] RETURNS [degrees: REAL, success: BOOL ¬ TRUE];
SetSlopeValue: PROC [ggData: GGData, degrees: REAL];
SelectSlope: PROC [ggData: GGData] RETURNS [success: BOOL ¬ TRUE];
GetSlopeAlignments: PROC [ggData: GGData] RETURNS [values: LIST OF REAL, on: LIST OF BOOL];
AddSlope: PROC [ggData: GGData, degrees: REAL, on: BOOL ¬ TRUE] RETURNS [alreadyThere: BOOL];
AddSlopeList:
PROC [ggData: GGData, degrees:
LIST
OF
REAL, on:
LIST
OF
BOOL ¬
NIL];
Add the listed slopes to the slopes that are currently in the slope alignment menu. "on" is the same length as "degrees" (or is of length 0). Each element of on is TRUE iff the corresponding slope button should be turned on. If on=NIL, then all added buttons will be off.
NewSlopeList:
PROC [ggData: GGData, degrees:
LIST
OF
REAL, on:
LIST
OF
BOOL ¬
NIL];
Set the slope alignment menu from the lists given. "on" is the same length as "degrees". Each element of on is TRUE iff the corresponding slope button should be turned on. If on=NIL, then all slope buttons will be off.
GetAngleAlignments: PROC [ggData: GGData] RETURNS [values: LIST OF REAL, on: LIST OF BOOL];
GetAngleValue: PROC [ggData: GGData] RETURNS [degrees: REAL, success: BOOL ¬ TRUE];
SetAngleValue: PROC [ggData: GGData, degrees: REAL];
SelectAngle: PROC [ggData: GGData] RETURNS [success: BOOL ¬ TRUE];
AddAngle: PROC [ggData: GGData, degrees: REAL, on: BOOL ¬ TRUE] RETURNS [alreadyThere: BOOL];
AddAngleList:
PROC [ggData: GGData, degrees:
LIST
OF
REAL, on:
LIST
OF
BOOL ¬
NIL];
Add the listed angles to the angles that are currently in the angle alignment menu. "on" is the same length as "degrees" (or of length 0). Each element of on is TRUE iff the corresponding angle button should be turned on. If on=NIL, then all angle buttons will be off.
NewAngleList:
PROC [ggData: GGData, degrees:
LIST
OF
REAL, on:
LIST
OF
BOOL ¬
NIL];
Set the angle alignment menu from the lists given. "on" is the same length as "degrees" (or of length 0). Each element of on is TRUE iff the corresponding angle button should be turned on. If on=NIL, then all angle buttons will be off.
GetRadiusAlignments: PROC [ggData: GGData] RETURNS [names: LIST OF ROPE, values: LIST OF REAL, on: LIST OF BOOL];
GetRadiusValue: PROC [ggData: GGData] RETURNS [radius: REAL, success: BOOL ¬ TRUE];
SetRadiusValue: PROC [ggData: GGData, radius: REAL];
SelectRadius: PROC [ggData: GGData] RETURNS [success: BOOL ¬ TRUE];
AddRadius: PROC [ggData: GGData, name: ROPE, radius: REAL, on: BOOL ¬ TRUE] RETURNS [alreadyThere: BOOL];
AddRadiusList:
PROC [ggData: GGData, names:
LIST
OF
ROPE, radii:
LIST
OF
REAL, on:
LIST
OF
BOOL ¬
NIL];
Add the listed radii to the radii that are currently in the radius alignment menu. "on" is the same length as "radii" (or of length 0). Each element of on is TRUE iff the corresponding radius button should be turned on. If on=NIL, then added buttons will be off.
NewRadiusList: PROC [ggData: GGData, names: LIST OF ROPE, radii: LIST OF REAL, on: LIST OF BOOL ¬ NIL];
GetRadiusCircleCache: PROC [ggData: GGData] RETURNS [cache: GGCircleCache.Cache];
SetRadiusCircleCache:
PROC [ggData: GGData, cache: GGCircleCache.Cache]
;
Set the radius alignment menu from the lists given. "on" is the same length as "radii". Each element of on is TRUE iff the corresponding radius button should be turned on. If on=NIL, then all radius buttons will be off.
GetLineDistanceAlignments: PROC [ggData: GGData] RETURNS [names: LIST OF ROPE, values: LIST OF REAL, on: LIST OF BOOL];
GetLineDistanceValue: PROC [ggData: GGData] RETURNS [distance: REAL, success: BOOL ¬ TRUE];
SetLineDistanceValue: PROC [ggData: GGData, distance: REAL];
SelectLineDistance: PROC [ggData: GGData] RETURNS [success: BOOL ¬ TRUE];
AddLineDistance: PROC [ggData: GGData, name: ROPE, distance: REAL, on: BOOL ¬ TRUE] RETURNS [alreadyThere: BOOL];
AddLineDistanceList:
PROC [ggData: GGData, names:
LIST
OF
ROPE, distances:
LIST
OF
REAL, on:
LIST
OF
BOOL ¬
NIL];
Add the listed distances to the distances that are currently in the distance alignment menu. "on" is the same length as "distances" (or of length 0). Each element of on is TRUE iff the corresponding distance button should be turned on. If on=NIL, then all distance buttons will be off.
NewLineDistanceList:
PROC [ggData: GGData, names:
LIST
OF
ROPE, distances:
LIST
OF
REAL, on:
LIST
OF
BOOL ¬
NIL];
Set the distance alignment menu from the lists given. "on" is the same length as "distances" (or of length 0). Each element of on is TRUE iff the corresponding distance button should be turned on. If on=NIL, then all distance buttons will be off.
GetMidpoints: PROC [ggData: GGData] RETURNS [BOOL];
SetMidpoints: PROC [ggData: GGData, midpointsOn: BOOL];
GetShowAlignments: PROC [ggData: GGData] RETURNS [BOOL];
SetShowAlignments: PROC [ggData: GGData, showAlignments: BOOL];
GetDoubleBuffer: PROC [ggData: GGData] RETURNS [BOOL];
SetDoubleBuffer: PROC [ggData: GGData, doubleBuffer: BOOL];
GetUseBackingMap: PROC [ggData: GGData] RETURNS [BOOL];
SetUseBackingMap: PROC [ggData: GGData, useBackingMap: BOOL];
Gargoyle Behaviors
GetActive: PROC [ggData: GGData] RETURNS [BOOL];
SetActive: PROC [ggData: GGData, activeOn: BOOL];
GetReadOnly: PROC [ggData: GGData] RETURNS [BOOL];
SetReadOnly: PROC [ggData: GGData, readOnly: BOOL];
GetPalette: PROC [ggData: GGData] RETURNS [BOOL];
SetPalette: PROC [ggData: GGData, paletteOn: BOOL];
Graphical Style
GetDefaults: PROC [ggData: GGData] RETURNS [DefaultData];
SetDefaults:
PROC [ggData: GGData, defaults: DefaultData];
GetDisplayStyle: PROC [ggData: GGData] RETURNS [DisplayStyle];
SetDisplayStyle: PROC [ggData: GGData, displayStyle: DisplayStyle];
CycleDisplayStyle: PROC [ggData: GGData, forward: BOOL];
GetDefaultDashPattern: PROC [ggData: GGData] RETURNS [dashed: BOOL, pattern: SequenceOfReal, offset: REAL, length: REAL];
SetDefaultDashPattern: PROC [ggData: GGData, dashed: BOOL, pattern: SequenceOfReal, offset: REAL, length: REAL];
GetDefaultFillColor: PROC [ggData: GGData] RETURNS [fillColor: Imager.Color];
SetDefaultFillColor: PROC [ggData: GGData, fillColor: Imager.Color];
GetDefaultStrokeColor: PROC [ggData: GGData] RETURNS [strokeColor: Imager.Color];
SetDefaultStrokeColor: PROC [ggData: GGData, strokeColor: Imager.Color];
GetDefaultStrokeJoint: PROC [ggData: GGData] RETURNS [strokeJoint: StrokeJoint];
SetDefaultStrokeJoint: PROC [ggData: GGData, strokeJoint: StrokeJoint];
GetDefaultStrokeEnd: PROC [ggData: GGData] RETURNS [strokeEnd: StrokeEnd];
SetDefaultStrokeEnd: PROC [ggData: GGData, strokeEnd: StrokeEnd];
GetDefaultDropShadows: PROC [ggData: GGData] RETURNS [dropShadowOn: BOOL, dropShadowOffset: Vector, dropShadowColor: Imager.Color];
SetDefaultDropShadows: PROC [ggData: GGData, dropShadowOn: BOOL, dropShadowOffset: Vector, dropShadowColor: Imager.Color];
GetDefaultFont: PROC [ggData: GGData] RETURNS [fontData: FontData];
SetDefaultFont: PROC [ggData: GGData, fontData: FontData];
Gravity
GetGravity: PROC [ggData: GGData] RETURNS [BOOL];
SetGravity:
PROC [ggData: GGData, gravityOn:
BOOL];
GetGravityExtent: PROC [ggData: GGData] RETURNS [inches: REAL];
SetGravityExtent:
PROC [ggData: GGData, inches:
REAL];
GetGravityType: PROC [ggData: GGData] RETURNS [gravityType: GravityType];
SetGravityType: PROC [ggData: GGData, gravityType: GravityType];
CycleGravityType:
PROC [ggData: GGData, forward:
BOOL];
GetHeuristics: PROC [ggData: GGData] RETURNS [BOOL];
SetHeuristics:
PROC [ggData: GGData, heuristicsOn:
BOOL];
GetScaleUnit: PROC [ggData: GGData] RETURNS [REAL]; -- in units of 1/72 of an inch
SetScaleUnit: PROC [ggData: GGData, unit: REAL, history: HistoryEvent]; -- in units of 1/72 of an inch
Other
GetSliceToExtend: PROC [ggData: GGData] RETURNS [sliceD: SliceDescriptor];
SetSliceToExtend: PROC [ggData: GGData, sliceD: SliceDescriptor];
Hidden State (yuk)
GetSelectMode: PROC [ggData: GGData] RETURNS [selectMode: SelectMode];
SetSelectMode: PROC [ggData: GGData, selectMode: SelectMode];
GetExtendMode: PROC [ggData: GGData] RETURNS [extendMode: ExtendMode];
SetExtendMode: PROC [ggData: GGData, extendMode: ExtendMode];
GetQuickClickMode: PROC RETURNS [on: BOOL];
SetQuickClickMode: PROC [on: BOOL];
GetSelectionCycler: PROC [ggData: GGData] RETURNS [featureCycler: GGInterfaceTypes.FeatureCycler];
SetSelectionCycler: PROC [ggData: GGData, featureCycler: GGInterfaceTypes.FeatureCycler];
Names, files, windows
GetFullName:
PROC [ggData: GGData]
RETURNS [fullName:
ROPE];
file name like /net/server/user/gargoyle/Foo.gargoyle
or /GargoylePics/MyPics/Foo.gargoyle!3
GetWidth: PROC [ggData: GGData] RETURNS [width: INT]; -- actionArea, in "window" units
GetHeight: PROC [ggData: GGData] RETURNS [height: INT]; -- actionArea, in "window" units
GrabInputFocus: PROC [ggData: GGData]; -- actionArea ¬ input focus
PaintActionArea: PROC [ggData: GGData];
GetAdvisory: PROC [ggData: GGData, fullName: ROPE, versionSpecified: BOOL]; -- just read scene and options
StoreAdvisory: PROC [ggData: GGData, fullName: ROPE, versionSpecified: BOOL]; -- just stored scene and options
ClearAdvisory: PROC [ggData: GGData]; -- just cleared
AdviseRestore: PROC [ggData: GGData] RETURNS [ok: BOOL ¬ FALSE]; -- is restore safe??
ShowHelp: PROC [ggData: GGData, category: ATOM];
Typescript: PROC [ggData: GGData];
ReloadTipTable: PROC [ggData: GGData] RETURNS [success: BOOL ¬ TRUE];
GGEdited:
PROC [ggData: GGData, clientData:
REF];
ggData.scene has just been edited. Perform appropriate actions (e.g., flush scripts to disk and display the "[Edited]" symbol on the viewer, if any).
END.