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; EventNotify: PUBLIC PROC [clientData: REF ANY, event: LIST OF REF ANY] = { ggData: GGData _ NARROW[clientData]; ProcessAndQueueEvent[event, ggData]; }; PlayAction: PUBLIC PROC [clientData: REF ANY, event: LIST OF REF ANY] = { ggData: GGData _ NARROW[clientData]; ProcessAndQueueEvent[event, ggData]; }; InputNotify: PUBLIC PROC [self: ViewerClasses.Viewer, input: LIST OF REF ANY] = { ggData: GGData _ NARROW[BiScrollers.ClientDataOfViewer[self]]; ProcessAndQueueEvent[input, ggData]; }; ProcessAndQueueEvent: PROC [event: LIST OF REF ANY, ggData: GGData] = { handle: SlackHandle _ ggData.slackHandle; optimizeHint: REF ANY; WITH event.first SELECT FROM refChar: REF CHAR => { myRefChar: REF CHAR _ NEW[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]; }; [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: ATOM _ NARROW[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; }; Dispatch: PROC [clientData: REF ANY, event: LIST OF REF ANY] = { ggData: GGData _ NARROW[clientData]; atom: ATOM _ NARROW[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]; }; printAllInput: BOOL _ FALSE; -- 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: BOOL _ TRUE] = { regEvent: RegisteredEvent _ NEW[RegisteredEventObj _ [eventProc, argType, causeMouseEventsToComplete]]; notAlreadyRegistered: BOOL _ TRUE; 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 = { eventTable _ RefTab.Create[240]; RegisterAction[$PaintActionArea, GGEvent.PaintActionArea, none]; RegisterAction[$Abort, GGMouseEvent.HandleMouseless, none, FALSE]; RegisterAction[$NoOp, NoOp, none]; RegisterAction[$AddChar, GGEvent.AddChar, none]; 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]; 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]; RegisterAction[$Help, GGEvent.Help, none]; 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]; 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[$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]; RegisterAction[$Top, GGEvent.Top, none]; RegisterAction[$Bottom, GGEvent.Bottom, none]; RegisterAction[$UpOne, GGEvent.UpOne, none]; RegisterAction[$DownOne, GGEvent.DownOne, none]; RegisterAction[$Refresh, GGEvent.Refresh, none]; RegisterAction[$DisableRefresh, GGEvent.DisableRefresh, none]; RegisterAction[$EnableRefresh, GGEvent.EnableRefresh, none]; 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]; 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]; 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]; RegisterAction[$Arrows, GGEvent.Arrows, none]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; 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]; RegisterAction[$MeasureSlopeHit, GGEvent.MeasureSlopeHit, none]; RegisterAction[$MeasureAngleHit, GGEvent.MeasureAngleHit, none]; RegisterAction[$MeasureRadiusHit, GGEvent.MeasureRadiusHit, none]; RegisterAction[$MeasureLineDistHit, GGEvent.MeasureLineDistHit, none]; 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]; 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]; RegisterAction[$SawTextFinish, GGEvent.SawTextFinish, none, FALSE]; RegisterAction[$SawMouseFinish, GGMouseEvent.HandleMouseless, none, FALSE]; 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]; }; -- end of RegisterGargoyleActions InitStats: PROC [] = { interval: CodeTimer.Interval; interval _ CodeTimer.CreateInterval[$UserInput]; CodeTimer.AddInt[interval, $Gargoyle]; }; RegisterGargoyleActions[]; InitStats[]; END. rGGUserInputImpl.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 Before the Queue (done by InputNotifier, Menu Process or Playback Process) From Buttons and Menus Used by several menu classes as the procedure to call when a menu click occurs. From Playback Scripts From Mouse and Keyboard ViewerClasses.NotifyProc Called by the TIP table machinery when an action is received from mouse or keyboard. Self is an ActionArea. The event will be in one of two forms: 1) LIST[REF CHAR]. 2) LIST[ATOM, ... ]. Need our own copy of the ref and char, because the system reuses the storage. need this before selection changes After the Queue (Done by SlackProcess). Utility Routines There were 198 events on April 1, 1987 File Line Interpress Menu Help Menu Master Line Hierarchy Menu Edit Menu RegisterAction[$ShowPoints, GGEvent.ShowPoints, none]; RegisterAction[$HidePoints, GGEvent.HidePoints, none]; Transform Menu Overlap Menu Refresh related operations Shapes Menu Debug Menu Stroke Menu ArrowsMenu Fill Color Stroke Color Text Menu Fonts Menu Group Menu AreaSelect Menu Curve Menu Gravity Line: Unit Line Slope Line Angle Line Radius Line Distance Line Coordinate Line Miscellaneous Keyboard only Setting Parts of the Gargoyle State Internal Atoms Mouse Events 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]; Êÿ˜Icodešœ™KšÏnœ'Ïk™0Kšœ1ž™4šœG™OKšœ ™ Kšœ%ž™(—K™šž ˜ Kšœ¸žœI˜ƒK˜—šœžœž˜Kšžœnžœ˜’Kšžœž˜—˜Kšœ žœ˜+Kšœžœ˜'Kšœ žœ˜%Kšœžœ˜!Kšœžœ˜$Kšœ žœ˜-Kšœ žœ˜)Kšœžœžœ žœ˜;—K˜KšÏbJ™JK˜K™š œžœžœžœžœ žœžœžœžœ˜JK™OKšœžœ ˜$Kšœ$˜$K˜K˜—K™š œžœžœžœžœ žœžœžœžœ˜IKšœžœ ˜$Kšœ$˜$K˜K˜—K™š œžœžœ%žœžœžœžœ˜QKšœ™Kšœžœ[™lKšœžœ'˜>Kšœ$˜$K˜K˜—š œžœ žœžœžœžœ˜G™&Jšœžœžœžœ™Jšœžœžœ™—Jšœ)˜)Jšœžœžœ˜J˜šžœ žœž˜šœ žœžœ˜KšœM™MKš œ žœžœžœžœ ˜+Jšœžœ˜Kšœžœ˜"K˜—šœžœ˜Kšœžœ˜Kšœžœ˜ Kšœ˜Kšœžœžœ˜Kšœ˜Kšžœžœžœ ˜4šžœ2žœžœ˜@Kšœ0žœžœ˜SKšœ"™"K˜—Kšœ1˜1Kšœ žœ ˜šžœžœžœ˜Kšœ'˜'K˜—šžœ˜Kšžœ%žœ1žœžœ˜€Jšœ1˜1J˜—J˜—Jšžœžœ˜—Kšžœžœ˜3JšœM˜MK˜K˜—šœžœ žœžœžœžœ-žœ žœžœžœžœ˜Kšœžœžœ˜!šžœž˜˜ š žœžœžœžœ-žœ˜QKšœ'žœ˜@Kšœ žœ žœ'˜@Kšœ žœ˜'K˜—Kšžœ˜K˜—Kšœ8˜8Kšœ6˜6Kšœ5˜5Kšžœžœ˜—K˜K˜—Ihead™'šœžœžœžœ žœžœžœžœ˜@Jšœžœ ˜$Kšœžœžœ˜!Kšœžœ˜ Kšœ˜Kšœžœžœ˜Kšœ1˜1Kšœ žœ ˜Kšžœžœžœ'˜8Kšžœ#˜'J˜—K˜K™K˜KšœžœžœÏc˜8K˜š œžœžœžœ žœžœžœžœ˜EKšœžœ ˜$šžœžœžœžœžœžœžœž˜@Kšžœ žœž˜KšœžœN˜XKšœžœžœ/žœ*˜gKšœ žœžœ/žœ0˜rKšœOžœC˜”Kšžœžœ˜—Kšžœ˜K˜K˜—šœžœžœ˜?Kšœ7˜7Kšœ>˜>KšœA˜AKšœ ˜ K˜K˜—šœžœžœ žœžœžœžœžœ žœžœžœžœ˜hšžœžœžœ ˜.Kšœ žœ+˜;Kšœ˜—š žœžœžœžœžœžœ ˜CKšœ žœžœžœ'˜ZKšœ˜—Kšžœ ˜*K˜K˜—šœžœžœ žœžœžœžœžœ žœžœžœžœ˜hKšœ žœ˜Kšœžœ˜ šžœžœžœ ˜.Kšœ*˜*KšœBžœ˜MKšœ žœžœžœ ˜)Kšœ˜—š žœžœžœžœžœžœ ˜CKšœžœ˜2KšœBžœ˜MKšœ žœžœžœ ˜)Kšœ˜—Kšžœ ˜*K˜K˜—šœžœžœ žœžœžœžœžœ žœžœžœžœ˜gKšœ žœ˜Kšœžœ˜ šžœžœžœ ˜.Kšœ*˜*Kš œžœžœžœ žœžœžœ˜QKšœ žœžœžœ ˜'Kšœ˜—š žœžœžœžœžœžœ $˜UKšœ˜Kšœ˜—Kšžœžœ˜ K˜K˜—šœžœžœžœ žœžœžœžœ˜?Kšœžœ ˜$Kšœžœ˜Kšœ,˜,Kšœ$˜$K˜kK˜K˜—š œžœžœžœ žœžœžœžœ˜DKšœžœ ˜$Kšœ)˜)Kšœ,˜,Jšœ&˜&Jšœ(˜(Jšœ)˜)Jšœ*˜*Jšžœ2˜8K˜—K˜Kšœžœžœ˜/šœžœžœ˜#Kšœ˜Kšœ"˜"Kšœž˜ K˜K˜—š œžœžœžœWžœžœ˜ŽKšœžœH˜gKšœžœžœ˜"KšœA˜AKš žœžœžœžœžœd˜›K˜K˜—Kšœ˜šœžœžœžœ žœžœžœžœ˜GKšœžœ˜K˜K˜—šœžœžœžœ žœžœžœžœ˜HKšœžœ˜K˜—K˜K˜šœžœ˜!K™&Kšœ ˜ Kšœ@˜@Kšœ;žœ˜BKšœ"˜"K˜Kšœ0˜0K™K™ Kšœ,˜,Kšœ,˜,Kšœ(˜(Kšœ,˜,Kšœ,˜,Kšœ*˜*Kšœ.˜.Kšœ:˜:K˜K™Kšœ@˜@Kšœ:˜:Kšœ*˜*Kšœ6˜6KšœJ˜JKšœB˜BKšœD˜DKšœ0˜0K™K™ Kšœ*˜*K˜K™ K™K™Kšœ.˜.Kšœ2˜2KšœH˜HKšœ;˜;Kšœ2˜2Kšœ<˜˜>Kšœ@˜@KšœB˜BKšœ,˜,Kšœ@˜@KšœF˜FKšœ2˜2Kšœ*˜*Kšœ:˜:Kšœ.˜.Kšœ6™6Kšœ6™6K™K™Kšœ5˜5Kšœ4˜4Kšœ5˜5Kšœ5˜5Kšœ9˜9Kšœ9˜9KšœD˜DKšœF˜FK™K™ Kšœ(˜(Kšœ.˜.Kšœ,˜,Kšœ0˜0K˜K™Kšœ0˜0Kšœ>˜>Kšœ<˜˜>Kšœ>˜>KšœB˜BKšœB˜BKšœ@˜@Kšœ=˜=Kšœ<˜˜>KšœN˜NKšœN˜NKšœ>˜>Kšœ>˜>Kšœ<˜˜>Kšœ>˜>Kšœ>˜>Kšœ<˜˜>Kšœ>˜>KšœL˜LKšœ2˜2Kšœ0˜0Kšœ2˜2KšœD˜DKšœR˜RKšœJ˜JKšœL˜LK˜K™ Kšœ6˜6Kšœ8˜8Kšœ@˜@KšœL˜LKšœ>˜>K˜K™Kšœ<˜˜>K™K™ Kšœ8˜8Kšœ2˜2Kšœ2˜2Kšœ8˜8Kšœ8˜8K˜K™ Kšœ8˜8Kšœ2˜2Kšœ2˜2Kšœ8˜8Kšœ8˜8K˜K™ Kšœ:˜:Kšœ4˜4Kšœ4˜4Kšœ:˜:Kšœ:˜:K˜K™ Kšœ>˜>Kšœ8˜8Kšœ8˜8Kšœ>˜>Kšœ>˜>K™K™Kšœ@˜@Kšœ@˜@KšœB˜BKšœF˜FK˜K™Kšœ>˜>KšœB˜BKšœJ˜JKšœF˜FKšœ6žœ˜=KšœO˜OKšœ4žœ˜;K˜K™#KšœBžœ˜IKšœ<žœ˜CKšœ6žœ˜=Kšœ:žœ˜AKšœ<žœ˜CKšœ>žœ˜EKšœBžœ˜IKšœF˜FKšœ@˜@KšœB˜BK™K™Kšœ<žœ˜CKšœDžœ˜KK˜K™ Kšœ?žœ˜FKšœ:žœ˜AKšœ:žœ˜AKšœDžœ˜KKšœ;žœ˜BKšœBžœ˜IKšœ=žœ˜DKšœ<žœ˜CKšœ?žœ˜FKšœBžœ˜IKšœEžœ˜LKšœDžœ˜KKšœGžœ˜NKšœGžœ˜NKšœJžœ˜QKšœEžœ˜LKšœHžœ˜OKšœFžœ˜MKšœDžœ˜KKšœFžœ˜MKšœIžœ˜PKšœGžœ˜NKšœ8žœ˜?Kšœ7žœ˜>Kšœ9žœ˜@Kšœ9žœ˜@K™K™Kšœ@™@Kšœ@™@Kšœ@™@Kšœ@™@Kšœ@™@Kšœ@™@Kšœ !˜$K˜—š œžœ˜K˜K˜0K˜&K˜K˜—Kšœ˜K˜ Kšžœ˜—…—[àvQ