GGUserInputImpl.mesa
Author: Eric Bier on June 6, 1985 1:01:02 am PDT
Last edited by Bier on April 20, 1987 5:57:40 pm PDT
Contents: Procedures which handle user actions (menu buttons and mouse events).
Pier, May 5, 1987 6:57:43 pm PDT
Kurlander August 24, 1986 1:00:26 pm PDT
DIRECTORY
Atom, BiScrollers, CodeTimer, Convert, GGBasicTypes, Feedback, GGEvent, GGInterfaceTypes, GGModelTypes, GGMouseEvent, GGScene, GGSessionLog, GGUserInput, Imager, ImagerTransformation, IO, Menus, RefTab, Rope, SlackProcess, TIPUser, ViewerClasses, ViewerTools;
GGUserInputImpl: CEDAR PROGRAM
IMPORTS Atom, BiScrollers, CodeTimer, Convert, Feedback, GGScene, GGSessionLog, SlackProcess, GGEvent, GGMouseEvent, IO, RefTab, Rope, ViewerTools
EXPORTS GGUserInput = BEGIN
CameraData: TYPE = GGModelTypes.CameraData;
GGData: TYPE = GGInterfaceTypes.GGData;
Outline: TYPE = GGModelTypes.Outline;
Point: TYPE = GGBasicTypes.Point;
Viewer: TYPE = ViewerClasses.Viewer;
SlackHandle: TYPE = SlackProcess.SlackHandle;
EventProc: TYPE = SlackProcess.EventProc;
Problem: PUBLIC SIGNAL [msg: Rope.ROPE] = Feedback.Problem;
Before the Queue (done by InputNotifier, Menu Process or Playback Process)
From Buttons and Menus
EventNotify: PUBLIC PROC [clientData: REF ANY, event: LIST OF REF ANY] = {
Used by several menu classes as the procedure to call when a menu click occurs.
ggData: GGData ← NARROW[clientData];
ProcessAndQueueEvent[event, ggData];
};
From Playback Scripts
PlayAction: PUBLIC PROC [clientData: REF ANY, event: LIST OF REF ANY] = {
ggData: GGData ← NARROW[clientData];
ProcessAndQueueEvent[event, ggData];
};
From Mouse and Keyboard
InputNotify: PUBLIC PROC [self: ViewerClasses.Viewer, input: LIST OF REF ANY] = {
ViewerClasses.NotifyProc
Called by the TIP table machinery when an action is received from mouse or keyboard. Self is an ActionArea.
ggData: GGData ← NARROW[BiScrollers.ClientDataOfViewer[self]];
ProcessAndQueueEvent[input, ggData];
};
ProcessAndQueueEvent: PROC [event: LIST OF REF ANY, ggData: GGData] = {
The event will be in one of two forms:
1) LIST[REF CHAR].
2) LIST[ATOM, ... ].
handle: SlackHandle ← ggData.slackHandle;
optimizeHint: REF ANY;
WITH event.first SELECT FROM
refChar: REF CHAR => {
Need our own copy of the ref and char, because the system reuses the storage.
myRefChar: REF CHARNEW[CHAR ← refChar^];
optimizeHint ← NIL;
event ← LIST[$AddChar, myRefChar];
};
atom: ATOM => {
atomName: Rope.ROPE;
found: BOOL;
regEvent: RegisteredEvent;
refAny: REF ANY;
atomName ← Atom.GetPName[atom];
IF atom = $During THEN optimizeHint ← LIST[$During];
IF Rope.Equal[Rope.Substr[atomName, 0, 5], "Start", TRUE] THEN {
SlackProcess.QueueInputAction[handle, Dispatch, LIST[$SawTextFinish], ggData, NIL];
need this before selection changes
};
[found, refAny] ← RefTab.Fetch[eventTable, atom];
regEvent ← NARROW[refAny];
IF NOT found THEN {
NotYetImplementedMessage[atom, ggData];
}
ELSE {
IF regEvent.causeMouseEventsToComplete THEN SlackProcess.QueueInputAction[handle, Dispatch, LIST[$SawMouseFinish], ggData, NIL];
event ← GetAnyArguments[event, regEvent, ggData];
};
};
ENDCASE => ERROR;
IF printAllInput THEN PrintAllInput[ggData, event];
SlackProcess.QueueInputAction[handle, Dispatch, event, ggData, optimizeHint];
};
GetAnyArguments: PROC [event: LIST OF REF ANY, regEvent: RegisteredEvent, ggData: GGData] RETURNS [newEvent: LIST OF REF ANY] = {
atom: ATOMNARROW[event.first];
SELECT regEvent.argType FROM
none => {
IF event.rest # NIL AND ISTYPE[event.rest.first, BiScrollers.ClientCoords] THEN {
mousePlace: BiScrollers.ClientCoords ← NARROW[event.rest.first];
refPoint: REF Point ← NEW[Point ← [mousePlace.x, mousePlace.y]];
newEvent ← LIST[event.first, refPoint];
}
ELSE newEvent ← event;
};
refReal => newEvent ← CheckForSelectedReal[atom, event];
refInt => newEvent ← CheckForSelectedInt[atom, event];
rope => newEvent ← CheckForSelectedRope[atom, event];
ENDCASE => ERROR;
};
After the Queue (Done by SlackProcess).
Dispatch: PROC [clientData: REF ANY, event: LIST OF REF ANY] = {
ggData: GGData ← NARROW[clientData];
atom: ATOMNARROW[event.first];
found: BOOL;
regEvent: RegisteredEvent;
refAny: REF ANY;
[found, refAny] ← RefTab.Fetch[eventTable, atom];
regEvent ← NARROW[refAny];
IF NOT found THEN NotYetImplementedMessage[atom, ggData]
ELSE regEvent.eventProc[ggData, event];
};
Utility Routines
printAllInput: BOOLFALSE; -- controlled by Debug menu
PrintAllInput: PROC [clientData: REF ANY, event: LIST OF REF ANY] = {
ggData: GGData ← NARROW[clientData];
FOR list: LIST OF REF ANY ← event, list.rest UNTIL list = NIL DO
WITH list.first SELECT FROM
atom: ATOM => Feedback.AppendTypescript[ggData.feedback, Atom.GetPName[atom], oneLiner];
int: REF INT => Feedback.AppendTypescript[ggData.feedback, IO.PutFR["%g ", [integer[int^]]], oneLiner];
refChar: REF CHAR => Feedback.AppendTypescript[ggData.feedback, IO.PutFR["%g ", [character[refChar^]]], oneLiner];
coords: BiScrollers.ClientCoords => Feedback.AppendTypescript[ggData.feedback, IO.PutFR["(%g, %g) ", [real[coords.x]], [real[coords.y]]], oneLiner];
ENDCASE => ERROR;
ENDLOOP;
};
NotYetImplementedMessage: PROC [atom: ATOM, ggData: GGData] = {
Feedback.Append[ggData.feedback, "User event ", begin];
Feedback.Append[ggData.feedback, Atom.GetPName[atom], middle];
Feedback.Append[ggData.feedback, " is not yet implemented", end];
Feedback.Blink[ggData.feedback];
};
CheckForSelectedRope: PROC [atom: ATOM, event: LIST OF REF ANY] RETURNS [newAction: LIST OF REF ANY] = {
IF event.rest = NIL THEN { -- interactive call
newAction ← LIST[atom, ViewerTools.GetSelectionContents[]];
}
ELSE IF ISTYPE[event.rest.first, REF TEXT] THEN { -- TIP table call
newAction ← CONS[atom, CONS[Rope.FromRefText[NARROW[event.rest.first]], event.rest.rest]];
}
ELSE newAction ← event; -- SessionLog call
};
CheckForSelectedReal: PROC [atom: ATOM, event: LIST OF REF ANY] RETURNS [newAction: LIST OF REF ANY] = {
rope: Rope.ROPE;
real: REAL;
IF event.rest = NIL THEN { -- interactive call
rope ← ViewerTools.GetSelectionContents[];
real ← Convert.RealFromRope[rope ! Convert.Error => {real ← -1.0; CONTINUE}];
newAction ← LIST[atom, NEW[REAL ← real]];
}
ELSE IF ISTYPE[event.rest.first, REF TEXT] THEN { -- TIP table call
rope ← Rope.FromRefText[NARROW[event.rest.first]];
real ← Convert.RealFromRope[rope ! Convert.Error => {real ← -1.0; CONTINUE}];
newAction ← LIST[atom, NEW[REAL ← real]];
}
ELSE newAction ← event; -- SessionLog call
};
CheckForSelectedInt: PROC [atom: ATOM, event: LIST OF REF ANY] RETURNS [newAction: LIST OF REF ANY] = {
rope: Rope.ROPE;
int: INT;
IF event.rest = NIL THEN { -- interactive call
rope ← ViewerTools.GetSelectionContents[];
int ← IO.GetInt[IO.RIS[rope] ! IO.EndOfStream, IO.Error => {int ← -1; CONTINUE}];
newAction ← LIST[atom, NEW[INT ← int]];
}
ELSE IF ISTYPE[event.rest.first, REF INT] THEN { -- TIP table call or SessionLog call
newAction ← event;
}
ELSE ERROR;
};
FSMInfo: PROC [clientData: REF ANY, event: LIST OF REF ANY] = {
ggData: GGData ← NARROW[clientData];
mouseMode, state: Rope.ROPE;
mouseMode ← Atom.GetPName[ggData.mouseMode];
state ← Atom.GetPName[ggData.state];
Feedback.PutF[ggData.feedback, oneLiner, "mouseMode = %g. state = %g.", [rope[mouseMode]], [rope[state]]];
};
CauseAnError: PROC [clientData: REF ANY, event: LIST OF REF ANY] = {
ggData: GGData ← NARROW[clientData];
scene: GGModelTypes.Scene ← ggData.scene;
firstSlice, secondSlice: GGModelTypes.Slice;
sliceGen: GGModelTypes.SliceGenerator;
sliceGen ← GGScene.SlicesInScene[scene];
firstSlice ← GGScene.NextSlice[sliceGen];
secondSlice ← GGScene.NextSlice[sliceGen];
SIGNAL Feedback.Problem[msg: "Client requested SIGNAL"];
};
RegisteredEvent: TYPE = REF RegisteredEventObj;
RegisteredEventObj: TYPE = RECORD [
eventProc: EventProc,
argType: GGUserInput.ArgumentType,
causeMouseEventsToComplete: BOOL
];
RegisterAction: PUBLIC PROC [atom: ATOM, eventProc: EventProc, argType: GGUserInput.ArgumentType, causeMouseEventsToComplete: BOOLTRUE] = {
regEvent: RegisteredEvent ← NEW[RegisteredEventObj ← [eventProc, argType, causeMouseEventsToComplete]];
notAlreadyRegistered: BOOLTRUE;
notAlreadyRegistered ← RefTab.Insert[eventTable, atom, regEvent];
IF NOT notAlreadyRegistered THEN SIGNAL Problem[msg: IO.PutFR["Event %g was already registered in Gargoyle's event table.", [rope[Atom.GetPName[atom]]] ]];
};
NoOp: EventProc = {};
PrintAllInputOn: PROC [clientData: REF ANY, event: LIST OF REF ANY] = {
printAllInput ← TRUE;
};
PrintAllInputOff: PROC [clientData: REF ANY, event: LIST OF REF ANY] = {
printAllInput ← FALSE;
};
eventTable: RefTab.Ref;
RegisterGargoyleActions: PROC = {
There were 198 events on April 1, 1987
eventTable ← RefTab.Create[240];
RegisterAction[$PaintActionArea, GGEvent.PaintActionArea, none];
RegisterAction[$Abort, GGMouseEvent.HandleMouseless, none, FALSE];
RegisterAction[$NoOp, NoOp, none];
RegisterAction[$AddChar, GGEvent.AddChar, none];
File Line
RegisterAction[$Clear, GGEvent.Clear, none];
RegisterAction[$Reset, GGEvent.Reset, none];
RegisterAction[$Get, GGEvent.Get, rope];
RegisterAction[$Merge, GGEvent.Merge, rope];
RegisterAction[$Store, GGEvent.Store, rope];
RegisterAction[$Save, GGEvent.Save, none];
RegisterAction[$Stuff, GGEvent.StuffIt, none];
RegisterAction[$StuffScreen, GGEvent.StuffItScreen, none];
Interpress Menu
RegisterAction[$MergeIPEditable, GGEvent.MergeIPEditable, rope];
RegisterAction[$MergeIPSlice, GGEvent.MergeIPSlice, rope];
RegisterAction[$ToIP, GGEvent.ToIP, rope];
RegisterAction[$ToIPScreen, GGEvent.ToIPScreen, rope];
RegisterAction[$IncludeIPByReference, GGEvent.IncludeIPByReference, none];
RegisterAction[$IncludeIPByValue, GGEvent.IncludeIPByValue, none];
RegisterAction[$ShowIPIncludeMode, GGEvent.ShowIPIncludeMode, none];
RegisterAction[$ToIPLit, GGEvent.ToIPLit, none];
Help Menu
RegisterAction[$Help, GGEvent.Help, none];
Master Line
Hierarchy Menu
RegisterAction[$Delete, GGEvent.Delete, none];
RegisterAction[$Undelete, GGEvent.Undelete, none];
RegisterAction[$UndeleteAutoConfirm, GGEvent.UndeleteAutoConfirm, none];
RegisterAction[$UnionCombine , GGEvent.UnionCombine, none];
RegisterAction[$AddHoles, GGEvent.AddHoles, none];
RegisterAction[$DescribeCurve, GGEvent.DescribeCurve, none];
Edit Menu
RegisterAction[$ApplyAllDefaults, GGEvent.ApplyAllDefaults, none];
RegisterAction[$SetAllDefaults, GGEvent.SetAllDefaults, none];
RegisterAction[$ShowAllDefaults, GGEvent.ShowAllDefaults, none];
RegisterAction[$StandardDefaults, GGEvent.StandardDefaults, none];
RegisterAction[$Close, GGEvent.Close, none];
RegisterAction[$AddControlPoint, GGEvent.AddControlPoint, none];
RegisterAction[$DeleteControlPoint, GGEvent.DeleteControlPoint, none];
RegisterAction[$AddJoint, GGEvent.AddJoint, none];
RegisterAction[$Weld, GGEvent.Weld, none];
RegisterAction[$SplitSegment, GGEvent.SplitSegment, none];
RegisterAction[$Splice, GGEvent.Splice, none];
RegisterAction[$ShowPoints, GGEvent.ShowPoints, none];
RegisterAction[$HidePoints, GGEvent.HidePoints, none];
Transform Menu
RegisterAction[$Rotate, GGEvent.TransRotScale, rope];
RegisterAction[$Scale, GGEvent.TransRotScale, rope];
RegisterAction[$ScaleX, GGEvent.TransRotScale, rope];
RegisterAction[$ScaleY, GGEvent.TransRotScale, rope];
RegisterAction[$TranslateX, GGEvent.TransRotScale, rope];
RegisterAction[$TranslateY, GGEvent.TransRotScale, rope];
RegisterAction[$SixPointTransform, GGEvent.SixPointTransform, none];
RegisterAction[$FourPointTransform, GGEvent.FourPointTransform, none];
Overlap Menu
RegisterAction[$Top, GGEvent.Top, none];
RegisterAction[$Bottom, GGEvent.Bottom, none];
RegisterAction[$UpOne, GGEvent.UpOne, none];
RegisterAction[$DownOne, GGEvent.DownOne, none];
Refresh related operations
RegisterAction[$Refresh, GGEvent.Refresh, none];
RegisterAction[$DisableRefresh, GGEvent.DisableRefresh, none];
RegisterAction[$EnableRefresh, GGEvent.EnableRefresh, none];
Shapes Menu
RegisterAction[$PolygonInCircle, GGEvent.PolygonInCircle, refInt];
RegisterAction[$KnotchedLine, GGEvent.NewKnotchedLine, none];
RegisterAction[$NewCircle, GGEvent.NewCircle, none];
RegisterAction[$NewBox, GGEvent.NewBox, none];
RegisterAction[$NewArrow, GGEvent.NewArrow, none];
RegisterAction[$Frame, GGEvent.Frame, none];
Debug Menu
RegisterAction[$TestGravity, GGEvent.TestGravity, refInt];
RegisterAction[$ToIPTestGravity, GGEvent.ToIPTestGravity, none];
RegisterAction[$TestMultiGravity, GGEvent.TestMultiGravity, none];
RegisterAction[$Statistics, GGEvent.Statistics, none];
RegisterAction[$PrintSelectedStatistic, GGEvent.PrintSelectedStatistic, rope];
RegisterAction[$ResetStatistics, GGEvent.ResetStatistics, none];
RegisterAction[$DrawTightBoxes, GGEvent.DrawTightBoxes, none];
RegisterAction[$DrawBoundBoxes, GGEvent.DrawBoundBoxes, none];
RegisterAction[$DrawOutlineBoxes, GGEvent.DrawOutlineBoxes, none];
RegisterAction[$DrawSelectionBox, GGEvent.DrawSelectionBox, none];
RegisterAction[$DrawBackgroundBox, GGEvent.DrawMovingBox, none];
RegisterAction[$DrawOverlayBox, GGEvent.DrawMovingBox, none];
RegisterAction[$DrawRubberBox, GGEvent.DrawMovingBox, none];
RegisterAction[$DrawDragBox, GGEvent.DrawMovingBox, none];
RegisterAction[$Typescript, GGEvent.Typescript, none];
RegisterAction[$SlackLog, GGEvent.SlackLog, none];
RegisterAction[$DescribeCaretObject, GGEvent.DescribeCaretObject, none];
RegisterAction[$FSMInfo, FSMInfo, none];
RegisterAction[$PrintAllInput, PrintAllInputOn, none];
RegisterAction[$ResetAllInput, PrintAllInputOff, none];
RegisterAction[$CauseAnError, CauseAnError, none];
Stroke Menu
RegisterAction[$LineWidth, GGEvent.LineWidth, refReal];
RegisterAction[$LineEnd, GGEvent.LineEnds, rope];
RegisterAction[$TrajJoints, GGEvent.TrajJoints, rope];
RegisterAction[$DashesFromSelection, GGEvent.DashesFromSelection, rope];
RegisterAction[$DashesOff, GGEvent.DashesOff, none];
RegisterAction[$PrintStrokeValues, GGEvent.PrintStrokeValues, none];
RegisterAction[$SelectMatchingWidth, GGEvent.SelectMatchingWidth, refReal];
RegisterAction[$SelectMatchingDashes, GGEvent.SelectMatchingDashes, rope];
RegisterAction[$SetDefaultStrokeValues, GGEvent.SetDefaultStrokeValues, none];
RegisterAction[$ShowDefaultStrokeValues, GGEvent.ShowDefaultStrokeValues, none];
ArrowsMenu
RegisterAction[$Arrows, GGEvent.Arrows, none];
Fill Color
RegisterAction[$AreaColorFromColorTool, GGEvent.AreaColorFromColorTool, none];
RegisterAction[$AreaColorFollowColorTool, GGEvent.AreaColorFollowColorTool, none];
RegisterAction[$AreaColorToColorTool, GGEvent.AreaColorToColorTool, none];
RegisterAction[$AreaColorFromSelectedName, GGEvent.AreaColorFromSelectedName, rope];
RegisterAction[$AreaColorFromSelectedRGB, GGEvent.AreaColorFromSelectedRGB, rope];
RegisterAction[$PrintAreaColor, GGEvent.PrintAreaColor, none];
RegisterAction[$SelectMatchingAreaRGB, GGEvent.SelectMatchingAreaColor, rope];
RegisterAction[$SelectMatchingAreaCNS, GGEvent.SelectMatchingAreaColor, rope];
RegisterAction[$AreaColorBlack, GGEvent.AreaColorBlack, none];
RegisterAction[$AreaColorWhite, GGEvent.AreaColorWhite, none];
RegisterAction[$AreaColorGray, GGEvent.AreaColorGray, none];
RegisterAction[$AreaColorNone, GGEvent.AreaColorNone, none];
RegisterAction[$SetDefaultFillColor, GGEvent.SetDefaultFillColor, none];
RegisterAction[$ShowDefaultFillColor, GGEvent.ShowDefaultFillColor, none];
Stroke Color
RegisterAction[$LineColorFromColorTool, GGEvent.LineColorFromColorTool, none];
RegisterAction[$LineColorFollowColorTool, GGEvent.LineColorFollowColorTool, none];
RegisterAction[$LineColorToColorTool, GGEvent.LineColorToColorTool, none];
RegisterAction[$LineColorFromSelectedName, GGEvent.LineColorFromSelectedName, rope];
RegisterAction[$LineColorFromSelectedRGB, GGEvent.LineColorFromSelectedRGB, rope];
RegisterAction[$SelectMatchingLineRGB, GGEvent.SelectMatchingLineColor, rope];
RegisterAction[$SelectMatchingLineCNS, GGEvent.SelectMatchingLineColor, rope];
RegisterAction[$PrintLineColor, GGEvent.PrintLineColor, none];
RegisterAction[$LineColorBlack, GGEvent.LineColorBlack, none];
RegisterAction[$LineColorWhite, GGEvent.LineColorWhite, none];
RegisterAction[$LineColorGray, GGEvent.LineColorGray, none];
RegisterAction[$LineColorNone, GGEvent.LineColorNone, none];
RegisterAction[$SetDefaultLineColor, GGEvent.SetDefaultLineColor, none];
RegisterAction[$ShowDefaultLineColor, GGEvent.ShowDefaultLineColor, none];
Text Menu
RegisterAction[$AddText, GGEvent.AddText, rope];
RegisterAction[$AmplifySpaceFromSelection, GGEvent.AmplifySpaceFromSelection, refReal];
RegisterAction[$PrintAmplifySpace, GGEvent.PrintAmplifySpace, none];
RegisterAction[$DropShadowOn, GGEvent.DropShadowOn, none];
RegisterAction[$DropShadowOff, GGEvent.DropShadowOff, none];
Fonts Menu
RegisterAction[$SetPressFont, GGEvent.SetPressFont, rope];
RegisterAction[$SetPrintFont, GGEvent.SetPrintFont, rope];
RegisterAction[$SetScreenFont, GGEvent.SetScreenFont, rope];
RegisterAction[$SetFontDetailed, GGEvent.SetFontDetailed, rope];
RegisterAction[$SetFontLiteral, GGEvent.SetFontLiteral, rope];
RegisterAction[$ShowFontValues, GGEvent.ShowFontValues, none];
RegisterAction[$ShowFontValuesLiteral, GGEvent.ShowFontValuesLiteral, none];
RegisterAction[$CopyFont, GGEvent.CopyFont, none];
RegisterAction[$CopyAll, GGEvent.CopyAll, none];
RegisterAction[$MatchAll, GGEvent.MatchAll, none];
RegisterAction[$MatchSelectedName, GGEvent.MatchSelectedName, rope];
RegisterAction[$MatchSelectedNameLiteral, GGEvent.MatchSelectedNameLiteral, rope];
RegisterAction[$SetDefaultFontValues, GGEvent.SetDefaultFontValues, none];
RegisterAction[$ShowDefaultFontValues, GGEvent.ShowDefaultFontValues, none];
Group Menu
RegisterAction[$AddToGroup, GGEvent.AddToGroup, none];
RegisterAction[$SelectGroup, GGEvent.SelectGroup, none];
RegisterAction[$RemoveFromGroup, GGEvent.RemoveFromGroup, none];
RegisterAction[$PrintGroupsOfSelected, GGEvent.PrintGroupsOfSelected, none];
RegisterAction[$PrintAllGroups, GGEvent.PrintAllGroups, none];
AreaSelect Menu
RegisterAction[$AreaSelectNew, GGEvent.AreaSelectNew, none];
RegisterAction[$AreaSelectExtend, GGEvent.AreaSelectExtend, none];
RegisterAction[$AreaSelectNewAndDelete, GGEvent.AreaSelectNewAndDelete, none];
RegisterAction[$AreaSelectDegenerate, GGEvent.AreaSelectDegenerate, none];
RegisterAction[$SelectAll, GGEvent.SelectAll, none];
Curve Menu
RegisterAction[$SetStraight, GGEvent.SetStraight, none];
RegisterAction[$SetArc, GGEvent.SetArc, none];
RegisterAction[$SetSnowflake, GGEvent.SetSnowflake, none];
RegisterAction[$SetConic, GGEvent.SetConic, none];
RegisterAction[$SetBezier, GGEvent.SetBezier, none];
RegisterAction[$SetNaturalSpline, GGEvent.SetNaturalSpline, none];
RegisterAction[$SetBSpline, GGEvent.SetBSpline, none];
RegisterAction[$SelectMatchingCurve, GGEvent.SelectMatchingCurve, rope];
Gravity Line:
RegisterAction[$GravityChoiceChange, GGEvent.GravityChoiceChange, none, FALSE];
RegisterAction[$GravityExtentChange, GGEvent.GravityExtentChange, none, FALSE];
RegisterAction[$ToggleGravity, GGEvent.ToggleGravity, none, FALSE];
RegisterAction[$ToggleAlignments, GGEvent.ToggleAlignments, none];
RegisterAction[$MakeHot, GGEvent.MakeHot, none];
RegisterAction[$MakeAllHot, GGEvent.MakeAllHot, none];
RegisterAction[$MakeCold, GGEvent.MakeCold, none];
RegisterAction[$MakeAllCold, GGEvent.MakeAllCold, none];
RegisterAction[$ShowHot, GGEvent.ShowHot, none];
RegisterAction[$HideHot, GGEvent.HideHot, none];
RegisterAction[$DropAnchor, GGEvent.DropAnchor, none];
RegisterAction[$LiftAnchor, GGEvent.KillAnchor, none];
RegisterAction[$StandardAlignments, GGEvent.StandardAlignments, none];
Unit Line
RegisterAction[$RadiusUnitFromSegment, GGEvent.ScaleUnitFromSegment, none];
RegisterAction[$RadiusUnitFromValue, GGEvent.ScaleUnitFromValue, none];
RegisterAction[$RadiusUnitFromSelection, GGEvent.ScaleUnitFromSelection, refReal];
RegisterAction[$InchScaleUnit, GGEvent.InchScaleUnit, none];
RegisterAction[$CentimeterScaleUnit, GGEvent.CentimeterScaleUnit, none];
RegisterAction[$PointsScaleUnit, GGEvent.PointsScaleUnit, none];
RegisterAction[$PrintScaleUnit, GGEvent.PrintScaleUnit, none];
Slope Line
RegisterAction[$SlopePrompt, GGEvent.SlopePrompt, none];
RegisterAction[$AddSlope, GGEvent.AddSlope, none];
RegisterAction[$GetSlope, GGEvent.GetSlope, none];
RegisterAction[$ToggleSlope, GGEvent.ToggleSlope, none];
RegisterAction[$DeleteSlope, GGEvent.DeleteSlope, none];
Angle Line
RegisterAction[$AnglePrompt, GGEvent.AnglePrompt, none];
RegisterAction[$AddAngle, GGEvent.AddAngle, none];
RegisterAction[$GetAngle, GGEvent.GetAngle, none];
RegisterAction[$ToggleAngle, GGEvent.ToggleAngle, none];
RegisterAction[$DeleteAngle, GGEvent.DeleteAngle, none];
Radius Line
RegisterAction[$RadiusPrompt, GGEvent.RadiusPrompt, none];
RegisterAction[$AddRadius, GGEvent.AddRadius, none];
RegisterAction[$GetRadius, GGEvent.GetRadius, none];
RegisterAction[$ToggleRadius, GGEvent.ToggleRadius, none];
RegisterAction[$DeleteRadius, GGEvent.DeleteRadius, none];
Distance Line
RegisterAction[$DistancePrompt, GGEvent.DistancePrompt, none];
RegisterAction[$AddDistance, GGEvent.AddDistance, none];
RegisterAction[$GetDistance, GGEvent.GetDistance, none];
RegisterAction[$ToggleDistance, GGEvent.ToggleDistance, none];
RegisterAction[$DeleteDistance, GGEvent.DeleteDistance, none];
Coordinate Line
RegisterAction[$MeasureSlopeHit, GGEvent.MeasureSlopeHit, none];
RegisterAction[$MeasureAngleHit, GGEvent.MeasureAngleHit, none];
RegisterAction[$MeasureRadiusHit, GGEvent.MeasureRadiusHit, none];
RegisterAction[$MeasureLineDistHit, GGEvent.MeasureLineDistHit, none];
Miscellaneous Keyboard only
RegisterAction[$ReloadTipTable, GGEvent.ReloadTipTable, none];
RegisterAction[$AllAlignmentsOff, GGEvent.AllAlignmentsOff, none];
RegisterAction[$InitializeAlignments, GGEvent.InitializeAlignments, none];
RegisterAction[$DeleteCaretSegment, GGEvent.DeleteCaretSegment, none];
RegisterAction[$IPSnapShot, GGEvent.IPSnapShot, none, FALSE];
RegisterAction[$EndOfSessionLogMessage, GGSessionLog.EndOfScriptMessage, none];
RegisterAction[$PrintRope, GGEvent.PrintRope, none, FALSE];
Setting Parts of the Gargoyle State
RegisterAction[$SetGravityExtent, GGEvent.SetGravityExtent, none, FALSE];
RegisterAction[$SetShowColors, GGEvent.SetShowColors, none, FALSE];
RegisterAction[$SetGravity, GGEvent.SetGravity, none, FALSE];
RegisterAction[$SetMidpoints, GGEvent.SetMidpoints, none, FALSE];
RegisterAction[$SetHeuristics, GGEvent.SetHeuristics, none, FALSE];
RegisterAction[$SetDefaultFont, GGEvent.SetDefaultFont, none, FALSE];
RegisterAction[$ToggleShowColors, GGEvent.ToggleShowColors, none, FALSE];
RegisterAction[$ScreenChoiceChange, GGEvent.ScreenChoiceChange, none];
RegisterAction[$ToggleMidpoints, GGEvent.ToggleMidpoints, none];
RegisterAction[$ToggleHeuristics, GGEvent.ToggleHeuristics, none];
Internal Atoms
RegisterAction[$SawTextFinish, GGEvent.SawTextFinish, none, FALSE];
RegisterAction[$SawMouseFinish, GGMouseEvent.HandleMouseless, none, FALSE];
Mouse Events
RegisterAction[$StartCaretPos, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartAdd, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartBox, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartSelectWithBox, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartDrag, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartCopyAndDrag, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartRotate, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartScale, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartSixPoint, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartSelectJoint, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartExtSelectJoint, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartSelectSegment, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartExtSelectSegment, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartSelectTrajectory, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartExtSelectTrajectory, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartSelectTopLevel, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartExtSelectTopLevel, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartExtendSelection, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartDeselectJoint, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartDeselectSegment, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartDeselectTrajectory, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$StartDeselectTopLevel, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$During, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$AllUp, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$GuardUp, GGMouseEvent.HandleMouse, none, FALSE];
RegisterAction[$MouseUp, GGMouseEvent.HandleMouse, none, FALSE];
Miscellaneous Mouse Only
RegisterAction[$MeasureSlopeHit, GGEvent.MeasureSlopeHit, none];
RegisterAction[$MeasureSlopeHit, GGEvent.MeasureSlopeHit, none];
RegisterAction[$MeasureSlopeHit, GGEvent.MeasureSlopeHit, none];
RegisterAction[$MeasureSlopeHit, GGEvent.MeasureSlopeHit, none];
RegisterAction[$MeasureSlopeHit, GGEvent.MeasureSlopeHit, none];
RegisterAction[$MeasureSlopeHit, GGEvent.MeasureSlopeHit, none];
}; -- end of RegisterGargoyleActions
InitStats: PROC [] = {
interval: CodeTimer.Interval;
interval ← CodeTimer.CreateInterval[$UserInput];
CodeTimer.AddInt[interval, $Gargoyle];
};
RegisterGargoyleActions[];
InitStats[];
END.