DIRECTORY Atom, BiScrollers, Convert, GGBasicTypes, GGError, GGEvent, GGInterfaceTypes, GGModelTypes, GGMouseEvent, GGObjects, GGSessionLog, GGUserInput, Imager, ImagerTransformation, IO, Menus, Rope, SlackProcess, TIPUser, ViewerClasses, ViewerTools; GGUserInputImpl: CEDAR PROGRAM IMPORTS Atom, BiScrollers, Convert, GGError, GGObjects, GGSessionLog, SlackProcess, GGEvent, GGMouseEvent, IO, Rope, ViewerTools EXPORTS GGUserInput = BEGIN GargoyleData: TYPE = GGInterfaceTypes.GargoyleData; Outline: TYPE = GGModelTypes.Outline; Point: TYPE = GGBasicTypes.Point; Viewer: TYPE = ViewerClasses.Viewer; SlackHandle: TYPE = SlackProcess.SlackHandle; EventProc: TYPE = SlackProcess.EventProc; MenuNotify: PUBLIC PROC [clientData: REF ANY, action: LIST OF REF ANY] = { gargoyleData: GargoyleData _ NARROW[clientData]; HandleMouseless[action, gargoyleData]; }; PlayAction: PUBLIC PROC [point: Point, action: LIST OF REF ANY, mouseEvent: BOOL, gargoyleData: GargoyleData] = { IF mouseEvent THEN HandleMouse[point, action, gargoyleData] ELSE HandleMouseless[action, gargoyleData]; }; InputNotify: PUBLIC PROC [self: ViewerClasses.Viewer, input: LIST OF REF ANY] = { gargoyleData: GargoyleData _ NARROW[BiScrollers.ClientDataOfViewer[self]]; IF printAllInput THEN PrintAllInput[input, gargoyleData]; WITH input.first SELECT FROM mousePlace: BiScrollers.ClientCoords => { controlPoint: Point _ [mousePlace.x, mousePlace.y]; HandleMouse[controlPoint, input.rest, gargoyleData]; }; refChar: REF CHAR => { myRefChar: REF CHAR _ NEW[CHAR _ refChar^]; HandleMouseless[LIST[$AddChar, myRefChar], gargoyleData]; }; ENDCASE => HandleMouseless[input, gargoyleData]; }; HandleMouse: PROC [controlPoint: Point, input: LIST OF REF ANY, gargoyleData: GargoyleData] = { atom: ATOM _ NARROW[input.first]; atomName: Rope.ROPE _ Atom.GetPName[atom]; IF Rope.Equal[Rope.Substr[atomName, 0, 5], "Start", TRUE] THEN { SlackProcess.QueueInputActionWithPoint[gargoyleData.slackHandle, GGMouseEvent.HandleMouse, input, controlPoint, gargoyleData, NIL]; SlackProcess.QueueInputAction[gargoyleData.slackHandle, GGEvent.SawTextFinish, LIST[$SawTextFinish], gargoyleData, NIL]; } ELSE SELECT atom FROM $GuardUp, $MouseUp, $AllUp => SlackProcess.QueueInputActionWithPoint[gargoyleData.slackHandle, GGMouseEvent.HandleMouse, input, controlPoint, gargoyleData, NIL]; $During => SlackProcess.QueueInputActionWithPoint[gargoyleData.slackHandle, GGMouseEvent.HandleMouse, input, controlPoint, gargoyleData, LIST[$During]]; ENDCASE => NotYetImplementedMessage[atom, gargoyleData]; }; HandleMouseless: PROC [action: LIST OF REF ANY, gargoyleData: GargoyleData] = { atom: ATOM _ NARROW[action.first]; SELECT atom FROM $PaintActionArea => SimpleQueue[gargoyleData.slackHandle, GGEvent.PaintActionArea, action, gargoyleData]; $Abort => SimpleQueue[gargoyleData.slackHandle, GGMouseEvent.HandleMouseless, action, gargoyleData]; $NoOp => {}; $AddChar => SimpleQueue[gargoyleData.slackHandle, GGEvent.AddChar, action, gargoyleData]; $Clear => SimpleQueue[gargoyleData.slackHandle, GGEvent.Clear, action, gargoyleData]; $Reset => SimpleQueue[gargoyleData.slackHandle, GGEvent.Reset, action, gargoyleData]; $Get => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.Get, action, gargoyleData]; }; $Merge => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.Merge, action, gargoyleData]; }; $Store => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.Store, action, gargoyleData]; }; $Save => SimpleQueue[gargoyleData.slackHandle, GGEvent.Save, action, gargoyleData]; $Split => NotYetImplementedMessage[atom, gargoyleData]; $Stuff => SimpleQueue[gargoyleData.slackHandle, GGEvent.StuffIt, action, gargoyleData]; $StuffScreen => SimpleQueue[gargoyleData.slackHandle, GGEvent.StuffItScreen, action, gargoyleData]; $MergeIPEditable => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.MergeIPEditable, action, gargoyleData]; }; $MergeIPSlice => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.MergeIPSlice, action, gargoyleData]; }; $ToIP => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.ToIP, action, gargoyleData]; }; $ToIPScreen => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.ToIPScreen, action, gargoyleData]; }; $IncludeIPByReference => SimpleQueue[gargoyleData.slackHandle, GGEvent.IncludeIPByReference, action, gargoyleData]; $IncludeIPByValue => SimpleQueue[gargoyleData.slackHandle, GGEvent.IncludeIPByValue, action, gargoyleData]; $ShowIPIncludeMode => SimpleQueue[gargoyleData.slackHandle, GGEvent.ShowIPIncludeMode, action, gargoyleData]; $ToIPLit => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToIPLit, action, gargoyleData]; $ToIPTestGravity => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.ToIPTestGravity, action, gargoyleData]; }; $Delete => SimpleQueue[gargoyleData.slackHandle, GGEvent.Delete, action, gargoyleData]; $Undelete => SimpleQueue[gargoyleData.slackHandle, GGEvent.Undelete, action, gargoyleData]; $UnionCombine => SimpleQueue[gargoyleData.slackHandle, GGEvent.UnionCombine, action, gargoyleData]; $SelectAll => SimpleQueue[gargoyleData.slackHandle, GGEvent.SelectAll, action, gargoyleData]; $AddHoles => SimpleQueue[gargoyleData.slackHandle, GGEvent.AddHoles, action, gargoyleData]; $Weld => SimpleQueue[gargoyleData.slackHandle, GGEvent.Weld, action, gargoyleData]; $SplitSegment => SimpleQueue[gargoyleData.slackHandle, GGEvent.SplitSegment, action, gargoyleData]; $Rotate, $Scale, $ScaleX, $ScaleY, $TranslateX, $TranslateY => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.TransRotScale, action, gargoyleData]; }; $SixPointTransform => SimpleQueue[gargoyleData.slackHandle, GGEvent.SixPointTransform, action, gargoyleData]; $FourPointTransform => SimpleQueue[gargoyleData.slackHandle, GGEvent.FourPointTransform, action, gargoyleData]; $Top => SimpleQueue[gargoyleData.slackHandle, GGEvent.Top, action, gargoyleData]; $Bottom => SimpleQueue[gargoyleData.slackHandle, GGEvent.Bottom, action, gargoyleData]; $UpOne => SimpleQueue[gargoyleData.slackHandle, GGEvent.UpOne, action, gargoyleData]; $DownOne => SimpleQueue[gargoyleData.slackHandle, GGEvent.DownOne, action, gargoyleData]; $Close => SimpleQueue[gargoyleData.slackHandle, GGEvent.Close, action, gargoyleData]; $Refresh => SimpleQueue[gargoyleData.slackHandle, GGEvent.Refresh, action, gargoyleData]; $DisableRefresh => SimpleQueue[gargoyleData.slackHandle, GGEvent.DisableRefresh, action, gargoyleData]; $EnableRefresh => SimpleQueue[gargoyleData.slackHandle, GGEvent.EnableRefresh, action, gargoyleData]; $PolygonInCircle => { action _ CheckForSelectedInt[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.PolygonInCircle, action, gargoyleData]; }; $KnotchedLine => SimpleQueue[gargoyleData.slackHandle, GGEvent.NewKnotchedLine, action, gargoyleData]; $NewCircle => SimpleQueue[gargoyleData.slackHandle, GGEvent.NewCircle, action, gargoyleData]; $NewBox => SimpleQueue[gargoyleData.slackHandle, GGEvent.NewBox, action, gargoyleData]; $NewArrow => SimpleQueue[gargoyleData.slackHandle, GGEvent.NewArrow, action, gargoyleData]; $Frame => SimpleQueue[gargoyleData.slackHandle, GGEvent.Frame, action, gargoyleData]; $TestGravity => SimpleQueue[gargoyleData.slackHandle, GGEvent.TestGravity, action, gargoyleData]; $ToIPTestGravity => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToIPTestGravity, action, gargoyleData]; $TestMultiGravity => SimpleQueue[gargoyleData.slackHandle, GGEvent.TestMultiGravity, action, gargoyleData]; $Statistics => SimpleQueue[gargoyleData.slackHandle, GGEvent.Statistics, action, gargoyleData]; $ResetStatistics => SimpleQueue[gargoyleData.slackHandle, GGEvent.ResetStatistics, action, gargoyleData]; $DrawTightBoxes => SimpleQueue[gargoyleData.slackHandle, GGEvent.DrawTightBoxes, action, gargoyleData]; $DrawBoundBoxes => SimpleQueue[gargoyleData.slackHandle, GGEvent.DrawBoundBoxes, action, gargoyleData]; $DrawOutlineBoxes => SimpleQueue[gargoyleData.slackHandle, GGEvent.DrawOutlineBoxes, action, gargoyleData]; $DrawSelectionBox => SimpleQueue[gargoyleData.slackHandle, GGEvent.DrawSelectionBox, action, gargoyleData]; $DrawMovingBox => SimpleQueue[gargoyleData.slackHandle, GGEvent.DrawMovingBox, action, gargoyleData]; $Typescript => SimpleQueue[gargoyleData.slackHandle, GGEvent.Typescript, action, gargoyleData]; $SlackLog => SimpleQueue[gargoyleData.slackHandle, GGEvent.SlackLog, action, gargoyleData]; $DescribeCaretObject => SimpleQueue[gargoyleData.slackHandle, GGEvent.DescribeCaretObject, action, gargoyleData]; $DescribeCaretObject => SimpleQueue[gargoyleData.slackHandle, GGEvent.DescribeCaretObject, action, gargoyleData]; $FSMInfo => SimpleQueue[gargoyleData.slackHandle, FSMInfo, action, gargoyleData]; $Splice => SimpleQueue[gargoyleData.slackHandle, GGEvent.Splice, action, gargoyleData]; $PrintAllInput => printAllInput _ TRUE; $ResetAllInput => printAllInput _ FALSE; $CauseAnError => SimpleQueue[gargoyleData.slackHandle, CauseAnError, action, gargoyleData]; $LineWidth => { action _ CheckForSelectedReal[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.LineWidth, action, gargoyleData]; }; $PrintLineWidth => SimpleQueue[gargoyleData.slackHandle, GGEvent.PrintLineWidth, action, gargoyleData]; $SelectMatchingWidth => { action _ CheckForSelectedReal[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SelectMatchingWidth, action, gargoyleData]; }; $DashesFromSelection => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.DashesFromSelection, action, gargoyleData]; }; $DashesOff => { SimpleQueue[gargoyleData.slackHandle, GGEvent.DashesOff, action, gargoyleData]; }; $Arrows => SimpleQueue[gargoyleData.slackHandle, GGEvent.Arrows, action, gargoyleData]; $AreaColorFromColorTool => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaColorFromColorTool, action, gargoyleData]; $AreaColorFollowColorTool => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaColorFollowColorTool, action, gargoyleData]; $AreaColorToColorTool => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaColorToColorTool, action, gargoyleData]; $AreaColorFromSelectedName => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaColorFromSelectedName, action, gargoyleData]; }; $AreaColorFromSelectedRGB => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaColorFromSelectedRGB, action, gargoyleData]; }; $PrintAreaColor => SimpleQueue[gargoyleData.slackHandle, GGEvent.PrintAreaColor, action, gargoyleData]; $SelectMatchingAreaRGB => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SelectMatchingAreaColor, action, gargoyleData]; }; $SelectMatchingAreaCNS => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SelectMatchingAreaColor, action, gargoyleData]; }; $AreaColorBlack => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaColorBlack, action, gargoyleData]; $AreaColorWhite => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaColorWhite, action, gargoyleData]; $AreaColorGray => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaColorGray, action, gargoyleData]; $AreaColorNone => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaColorNone, action, gargoyleData]; $LineColorFromColorTool => SimpleQueue[gargoyleData.slackHandle, GGEvent.LineColorFromColorTool, action, gargoyleData]; $LineColorFollowColorTool => SimpleQueue[gargoyleData.slackHandle, GGEvent.LineColorFollowColorTool, action, gargoyleData]; $LineColorToColorTool => SimpleQueue[gargoyleData.slackHandle, GGEvent.LineColorToColorTool, action, gargoyleData]; $LineColorFromSelectedName => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.LineColorFromSelectedName, action, gargoyleData]; }; $LineColorFromSelectedRGB => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.LineColorFromSelectedRGB, action, gargoyleData]; }; $SelectMatchingLineRGB => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SelectMatchingLineColor, action, gargoyleData]; }; $SelectMatchingLineCNS => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SelectMatchingLineColor, action, gargoyleData]; }; $PrintLineColor => SimpleQueue[gargoyleData.slackHandle, GGEvent.PrintLineColor, action, gargoyleData]; $LineColorBlack => SimpleQueue[gargoyleData.slackHandle, GGEvent.LineColorBlack, action, gargoyleData]; $LineColorWhite => SimpleQueue[gargoyleData.slackHandle, GGEvent.LineColorWhite, action, gargoyleData]; $LineColorGray => SimpleQueue[gargoyleData.slackHandle, GGEvent.LineColorGray, action, gargoyleData]; $LineColorNone => SimpleQueue[gargoyleData.slackHandle, GGEvent.LineColorNone, action, gargoyleData]; $AddText => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.AddText, action, gargoyleData]; }; $AmplifySpaceFromSelection => { action _ CheckForSelectedReal[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.AmplifySpaceFromSelection, action, gargoyleData]; }; $PrintAmplifySpace => { SimpleQueue[gargoyleData.slackHandle, GGEvent.PrintAmplifySpace, action, gargoyleData]; }; $DropShadowOn => { SimpleQueue[gargoyleData.slackHandle, GGEvent.DropShadowOn, action, gargoyleData]; }; $DropShadowOff => { SimpleQueue[gargoyleData.slackHandle, GGEvent.DropShadowOff, action, gargoyleData]; }; $SetLookAlikes => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SetLookAlikes, action, gargoyleData]; }; $SetPressFont => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SetPressFont, action, gargoyleData]; }; $SetPrintFont => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SetPrintFont, action, gargoyleData]; }; $SetScreenFont => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SetScreenFont, action, gargoyleData]; }; $SetFontDetailed => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SetFontDetailed, action, gargoyleData]; }; $SetFontLiteral => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SetFontLiteral, action, gargoyleData]; }; $ChangeFont => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.ChangeFont, action, gargoyleData]; }; $SetDefaultFontValues => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.SetDefaultFontValues, action, gargoyleData]; }; $ShowFontValues => SimpleQueue[gargoyleData.slackHandle, GGEvent.ShowFontValues, action, gargoyleData]; $ShowFontValuesLiteral => SimpleQueue[gargoyleData.slackHandle, GGEvent.ShowFontValuesLiteral, action, gargoyleData]; $ShowDefaultFontValues => SimpleQueue[gargoyleData.slackHandle, GGEvent.ShowDefaultFontValues, action, gargoyleData]; $FindTextMatchingSelected => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.FindTextMatchingSelected, action, gargoyleData]; }; $FindTextMatchingValues => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.FindTextMatchingValues, action, gargoyleData]; }; $FindTextMatchingFamily => { action _ CheckForSelectedRope[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.FindTextMatchingFamily, action, gargoyleData]; }; $AddToGroup => SimpleQueue[gargoyleData.slackHandle, GGEvent.AddToGroup, action, gargoyleData]; $SelectGroup => SimpleQueue[gargoyleData.slackHandle, GGEvent.SelectGroup, action, gargoyleData]; $RemoveFromGroup => SimpleQueue[gargoyleData.slackHandle, GGEvent.RemoveFromGroup, action, gargoyleData]; $PrintGroupsOfSelected => SimpleQueue[gargoyleData.slackHandle, GGEvent.PrintGroupsOfSelected, action, gargoyleData]; $PrintAllGroups => SimpleQueue[gargoyleData.slackHandle, GGEvent.PrintAllGroups, action, gargoyleData]; $AreaSelectNew => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaSelectNew, action, gargoyleData]; $AreaSelectExtend => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaSelectExtend, action, gargoyleData]; $AreaSelectNewAndDelete => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaSelectNewAndDelete, action, gargoyleData]; $AreaSelectDegenerate => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaSelectDegenerate, action, gargoyleData]; $AreaSelectAll => SimpleQueue[gargoyleData.slackHandle, GGEvent.AreaSelectAll, action, gargoyleData]; $SetStraight => SimpleQueue[gargoyleData.slackHandle, GGEvent.SetStraight, action, gargoyleData]; $SetArc => SimpleQueue[gargoyleData.slackHandle, GGEvent.SetArc, action, gargoyleData]; $SetSnowflake => SimpleQueue[gargoyleData.slackHandle, GGEvent.SetSnowflake, action, gargoyleData]; $SetConic => SimpleQueue[gargoyleData.slackHandle, GGEvent.SetConic, action, gargoyleData]; $SetBezier => SimpleQueue[gargoyleData.slackHandle, GGEvent.SetBezier, action, gargoyleData]; $SetNaturalSpline => SimpleQueue[gargoyleData.slackHandle, GGEvent.SetNaturalSpline, action, gargoyleData]; $SetBSpline => SimpleQueue[gargoyleData.slackHandle, GGEvent.SetBSpline, action, gargoyleData]; $SelectMatchingCurve => SimpleQueue[gargoyleData.slackHandle, GGEvent.SelectMatchingCurve, action, gargoyleData]; $DescribeCurve => SimpleQueue[gargoyleData.slackHandle, GGEvent.DescribeCurve, action, gargoyleData]; $AddControlPoint => SimpleQueue[gargoyleData.slackHandle, GGEvent.AddControlPoint, action, gargoyleData]; $DeleteControlPoint => SimpleQueue[gargoyleData.slackHandle, GGEvent.DeleteControlPoint, action, gargoyleData]; $AddJoint => SimpleQueue[gargoyleData.slackHandle, GGEvent.AddJoint, action, gargoyleData]; $GravityChoiceChange => SimpleQueue[gargoyleData.slackHandle, GGEvent.GravityChoiceChange, action, gargoyleData]; $GravityExtentChange => SimpleQueue[gargoyleData.slackHandle, GGEvent.GravityExtentChange, action, gargoyleData]; $SetGravityExtent => SimpleQueue[gargoyleData.slackHandle, GGEvent.SetGravityExtent, action, gargoyleData]; $ToggleGravity => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToggleGravity, action, gargoyleData]; $ToggleAlignments => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToggleAlignments, action, gargoyleData]; $MakeHot => SimpleQueue[gargoyleData.slackHandle, GGEvent.MakeHot, action, gargoyleData]; $MakeAllHot => SimpleQueue[gargoyleData.slackHandle, GGEvent.MakeAllHot, action, gargoyleData]; $MakeCold => SimpleQueue[gargoyleData.slackHandle, GGEvent.MakeCold, action, gargoyleData]; $MakeAllCold => SimpleQueue[gargoyleData.slackHandle, GGEvent.MakeAllCold, action, gargoyleData]; $ShowHot => SimpleQueue[gargoyleData.slackHandle, GGEvent.ShowHot, action, gargoyleData]; $HideHot => SimpleQueue[gargoyleData.slackHandle, GGEvent.HideHot, action, gargoyleData]; $DropAnchor => SimpleQueue[gargoyleData.slackHandle, GGEvent.DropAnchor, action, gargoyleData]; $LiftAnchor => SimpleQueue[gargoyleData.slackHandle, GGEvent.KillAnchor, action, gargoyleData]; $StandardAlignments => SimpleQueue[gargoyleData.slackHandle, GGEvent.StandardAlignments, action, gargoyleData]; $ToggleShowColors => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToggleShowColors, action, gargoyleData]; $ScreenChoiceChange => SimpleQueue[gargoyleData.slackHandle, GGEvent.ScreenChoiceChange, action, gargoyleData]; $ToggleMidpoints => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToggleMidpoints, action, gargoyleData]; $ToggleHeuristics => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToggleHeuristics, action, gargoyleData]; $RadiusUnitFromSegment => SimpleQueue[gargoyleData.slackHandle, GGEvent.ScaleUnitFromSegment, action, gargoyleData]; $RadiusUnitFromValue => SimpleQueue[gargoyleData.slackHandle, GGEvent.ScaleUnitFromValue, action, gargoyleData]; $RadiusUnitFromSelection => { action _ CheckForSelectedReal[atom, action]; SimpleQueue[gargoyleData.slackHandle, GGEvent.ScaleUnitFromSelection, action, gargoyleData]; }; $InchScaleUnit => SimpleQueue[gargoyleData.slackHandle, GGEvent.InchScaleUnit, action, gargoyleData]; $CentimeterScaleUnit => SimpleQueue[gargoyleData.slackHandle, GGEvent.CentimeterScaleUnit, action, gargoyleData]; $PrintScaleUnit => SimpleQueue[gargoyleData.slackHandle, GGEvent.PrintScaleUnit, action, gargoyleData]; $SlopePrompt => SimpleQueue[gargoyleData.slackHandle, GGEvent.SlopePrompt, action, gargoyleData]; $AddSlope => SimpleQueue[gargoyleData.slackHandle, GGEvent.AddSlope, action, gargoyleData]; $GetSlope => SimpleQueue[gargoyleData.slackHandle, GGEvent.GetSlope, action, gargoyleData]; $ToggleSlope => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToggleSlope, action, gargoyleData]; $DeleteSlope => SimpleQueue[gargoyleData.slackHandle, GGEvent.DeleteSlope, action, gargoyleData]; $AnglePrompt => SimpleQueue[gargoyleData.slackHandle, GGEvent.AnglePrompt, action, gargoyleData]; $AddAngle => SimpleQueue[gargoyleData.slackHandle, GGEvent.AddAngle, action, gargoyleData]; $GetAngle => SimpleQueue[gargoyleData.slackHandle, GGEvent.GetAngle, action, gargoyleData]; $ToggleAngle => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToggleAngle, action, gargoyleData]; $DeleteAngle => SimpleQueue[gargoyleData.slackHandle, GGEvent.DeleteAngle, action, gargoyleData]; $RadiusPrompt => SimpleQueue[gargoyleData.slackHandle, GGEvent.RadiusPrompt, action, gargoyleData]; $AddRadius => SimpleQueue[gargoyleData.slackHandle, GGEvent.AddRadius, action, gargoyleData]; $GetRadius => SimpleQueue[gargoyleData.slackHandle, GGEvent.GetRadius, action, gargoyleData]; $ToggleRadius => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToggleRadius, action, gargoyleData]; $DeleteRadius => SimpleQueue[gargoyleData.slackHandle, GGEvent.DeleteRadius, action, gargoyleData]; $DistancePrompt => SimpleQueue[gargoyleData.slackHandle, GGEvent.DistancePrompt, action, gargoyleData]; $AddDistance => SimpleQueue[gargoyleData.slackHandle, GGEvent.AddDistance, action, gargoyleData]; $GetDistance => SimpleQueue[gargoyleData.slackHandle, GGEvent.GetDistance, action, gargoyleData]; $ToggleDistance => SimpleQueue[gargoyleData.slackHandle, GGEvent.ToggleDistance, action, gargoyleData]; $DeleteDistance => SimpleQueue[gargoyleData.slackHandle, GGEvent.DeleteDistance, action, gargoyleData]; $MeasureSlopeHit => SimpleQueue[gargoyleData.slackHandle, GGEvent.MeasureSlopeHit, action, gargoyleData]; $MeasureAngleHit => SimpleQueue[gargoyleData.slackHandle, GGEvent.MeasureAngleHit, action, gargoyleData]; $MeasureRadiusHit => SimpleQueue[gargoyleData.slackHandle, GGEvent.MeasureRadiusHit, action, gargoyleData]; $MeasureLineDistHit => SimpleQueue[gargoyleData.slackHandle, GGEvent.MeasureLineDistHit, action, gargoyleData]; $ReloadTipTable => SimpleQueue[gargoyleData.slackHandle, GGEvent.ReloadTipTable, action, gargoyleData]; $AllAlignmentsOff => SimpleQueue[gargoyleData.slackHandle, GGEvent.AllAlignmentsOff, action, gargoyleData]; $InitializeAlignments => SimpleQueue[gargoyleData.slackHandle, GGEvent.InitializeAlignments, action, gargoyleData]; $DeleteCaretSegment => SimpleQueue[gargoyleData.slackHandle, GGEvent.DeleteCaretSegment, action, gargoyleData]; $IPSnapShot => SimpleQueue[gargoyleData.slackHandle, GGEvent.IPSnapShot, action, gargoyleData]; $EndOfSessionLogMessage => SimpleQueue[gargoyleData.slackHandle, GGSessionLog.EndOfSessionLogMessage, action, gargoyleData]; ENDCASE => NotYetImplementedMessage[atom, gargoyleData]; }; SimpleQueue: PROC [handle: SlackHandle, callBack: EventProc, inputAction: LIST OF REF ANY, clientData: REF ANY] = { SlackProcess.QueueInputAction[handle, callBack, inputAction, clientData, NIL]; }; printAllInput: BOOL _ FALSE; -- controlled by Debug menu PrintAllInput: PROC [input: LIST OF REF ANY, gargoyleData: GargoyleData] = { FOR list: LIST OF REF ANY _ input, list.rest UNTIL list = NIL DO WITH list.first SELECT FROM atom: ATOM => GGError.AppendTypescript[gargoyleData.feedback, Atom.GetPName[atom], oneLiner]; int: REF INT => GGError.AppendTypescript[gargoyleData.feedback, IO.PutFR["%g ", [integer[int^]]], oneLiner]; refChar: REF CHAR => GGError.AppendTypescript[gargoyleData.feedback, IO.PutFR["%g ", [character[refChar^]]], oneLiner]; coords: BiScrollers.ClientCoords => GGError.AppendTypescript[gargoyleData.feedback, IO.PutFR["(%1.2f, %1.2f) ", [real[coords.x]], [real[coords.y]]], oneLiner]; ENDCASE => ERROR; ENDLOOP; }; NotYetImplementedMessage: PROC [atom: ATOM, gargoyleData: GargoyleData] = { GGError.Append[gargoyleData.feedback, "User action ", begin]; GGError.Append[gargoyleData.feedback, Atom.GetPName[atom], middle]; GGError.Append[gargoyleData.feedback, " is not yet implemented", end]; GGError.Blink[gargoyleData.feedback]; }; CheckForSelectedRope: PROC [atom: ATOM, action: LIST OF REF ANY] RETURNS [newAction: LIST OF REF ANY] = { IF action.rest = NIL THEN { -- interactive call newAction _ LIST[atom, ViewerTools.GetSelectionContents[]]; } ELSE IF ISTYPE[action.rest.first, REF TEXT] THEN { -- TIP table call newAction _ LIST[atom, Rope.FromRefText[NARROW[action.rest.first]]]; } ELSE newAction _ action; -- SessionLog call }; CheckForSelectedReal: PROC [atom: ATOM, action: LIST OF REF ANY] RETURNS [newAction: LIST OF REF ANY] = { rope: Rope.ROPE; real: REAL; IF action.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[action.rest.first, REF TEXT] THEN { -- TIP table call rope _ Rope.FromRefText[NARROW[action.rest.first]]; real _ Convert.RealFromRope[rope ! Convert.Error => {real _ -1.0; CONTINUE}]; newAction _ LIST[atom, NEW[REAL _ real]]; } ELSE newAction _ action; -- SessionLog call }; CheckForSelectedInt: PROC [atom: ATOM, action: LIST OF REF ANY] RETURNS [newAction: LIST OF REF ANY] = { rope: Rope.ROPE; int: INT; IF action.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[action.rest.first, REF INT] THEN { -- TIP table call or SessionLog call newAction _ action; } ELSE ERROR; }; FSMInfo: PROC [event: LIST OF REF ANY, clientData: REF ANY] = { gargoyleData: GargoyleData _ NARROW[clientData]; mouseMode, state: Rope.ROPE; mouseMode _ Atom.GetPName[gargoyleData.mouseMode]; state _ Atom.GetPName[gargoyleData.state]; GGError.PutF[gargoyleData.feedback, oneLiner, "mouseMode = %g. state = %g.", [rope[mouseMode]], [rope[state]]]; }; CauseAnError: PROC [event: LIST OF REF ANY, clientData: REF ANY] = { gargoyleData: GargoyleData _ NARROW[clientData]; scene: GGModelTypes.Scene _ gargoyleData.scene; firstSlice, secondSlice: GGModelTypes.Slice; sliceGen: GGModelTypes.SliceGenerator; sliceGen _ GGObjects.SlicesInScene[scene]; firstSlice _ GGObjects.NextSlice[sliceGen]; secondSlice _ GGObjects.NextSlice[sliceGen]; SIGNAL GGError.Problem[msg: "Client requested SIGNAL"]; }; END. ¢GGUserInputImpl.mesa Author: Eric Bier on June 6, 1985 1:01:02 am PDT Last edited by Bier on January 29, 1987 10:59:31 am PST Contents: Procedures which handle user actions (menu buttons and mouse actions). Pier, February 3, 1987 12:50:17 pm PST Kurlander August 24, 1986 1:00:26 pm PDT Input from the Outside World 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. This puts the control point in Gargoyle coordinates. Need our own copy of the ref and char, because the system will reuse the storage without telling us!! Handling Actions From the Mouse From Buttons, Menus, or Keyboard Non-mouse actions. These actions could come from the TIP table or from bugging a menu. File Line Interpress Menu Master Line Hierarchy Menu Transform Menu Overlap Menu Edit Curve Menu $ShowPoints => SimpleQueue[gargoyleData.slackHandle, GGEvent.ShowPoints, action, gargoyleData]; $HidePoints => SimpleQueue[gargoyleData.slackHandle, GGEvent.HidePoints, action, gargoyleData]; View Menu Shapes Menu Debug Menu $DrawTouchPoints => SimpleQueue[gargoyleData.slackHandle, GGEvent.DrawTouchPoints, action, gargoyleData]; $DescribeTouchPoints => SimpleQueue[gargoyleData.slackHandle, GGEvent.DescribeTouchPoints, action, gargoyleData]; Style Menus Text Menu Fonts Menu Group Menu AreaSelect Menu Curve Menu Other Curve-related stuff Gravity Line: Unit Line Slope Line Angle Line Radius Line Distance Line Coordinate Line Miscellaneous Tip Table only Utility Routines ÊŒ˜Icodešœ™K™0Kšœ7™7™PKšœ&™&K™(—K™šÏk ˜ Kšœ®œA˜ñK˜—šÏnœœ˜Kšœdœ˜€Kšœ˜—˜Kšœœ!˜3Kšœ œ˜%Kšœœ˜!Kšœœ˜$Kšœ œ˜-Kšœ œ˜)—K˜KšÏb™K˜K™šž œœœœœ œœœœ˜JK™OKšœœ ˜0KšŸœ˜&K˜K˜—K™šž œœœœœœœœ!˜qKšœ œ)˜;Kšœ'˜+K˜K˜—K™šž œœœ%œœœœ˜QKšœ™Kšœl™lKšœœ'˜JKšœœ$˜9Kšœ œ˜šœ)˜)šœ3˜3K™4—Kšœ4˜4Kšœ˜—šœ œœ˜Kšœe™eKš œ œœœœ ˜+Kšœœ%˜9K˜—Kšœ)˜0K˜K˜—K˜KšŸ™K˜K™š ž œœœœœœ!˜_Kšœœœ˜!Kšœœ˜*šœ2œœ˜@Kšœ ŸœXœ˜ƒKšœOœ œ˜xK˜—š œ˜Kšœ,ŸœXœ˜¢K˜KšœŸœXÐbkŸ œ˜˜K˜Kšœ1˜8—Kšœ˜K˜—K™ š žœœ œœœœ!˜OK™WKšœœœ˜"šœ˜Kšœi˜iKšœ=Ÿœ˜dK˜ K˜KšœY˜YK™K™ KšœU˜UKšœU˜Ušœ ˜ Kšœ,˜,KšœI˜IK˜—šœ ˜ Kšœ,˜,KšœK˜KKšœ˜—šœ ˜ Kšœ,˜,KšœK˜KK˜—KšœS˜SKšœ7˜7KšœW˜WKšœc˜cK˜K™šœ˜Kšœ,˜,KšœU˜UK˜—šœ˜Kšœ,˜,KšœR˜RK˜—šœ ˜ Kšœ,˜,KšœJ˜JK˜—šœ˜Kšœ,˜,KšœP˜PK˜—Kšœs˜sKšœk˜kKšœm˜mKšœY˜Yšœ˜Kšœ,˜,KšœU˜UK˜—K™K™ K™K™KšœW˜WKšœ[˜[Kšœd˜dKšœ^˜^Kšœ[˜[KšœS˜SKšœc˜cK™K™šœ@˜@Kšœ,˜,KšœS˜SK˜—Kšœm˜mKšœo˜oK™K™ KšœQ˜QKšœW˜WKšœU˜UKšœY˜YK˜K™KšœU˜UKšœ_™_Kšœ_™_K˜K™ KšœY˜YKšœg˜gKšœe˜eK™K™ šœ˜Kšœ+˜+KšœU˜UK˜—Kšœf˜fKšœ]˜]KšœW˜WKšœ[˜[KšœU˜UK˜K™ Kšœa˜aKšœi˜iKšœk˜kKšœ_˜_Kšœi˜iKšœi™iKšœq™qKšœg˜gKšœg˜gKšœk˜kKšœk˜kKšœe˜eKšœ_˜_Kšœ[˜[Kšœq˜qKšœq˜qKšœQ˜QKšœW˜WKšœ"œ˜'Kšœ"œ˜(Kšœ[˜[K˜K™ šœ˜Kšœ,˜,KšœO˜OK˜—Kšœg˜gšœ˜Kšœ,˜,KšœY˜YK˜—šœ˜Kšœ,˜,KšœY˜YKšœ˜—šœ˜KšœO˜OKšœ˜—KšœW˜WK˜Kšœw˜wKšœ{˜{Kšœs˜sšœ˜Kšœ,˜,Kšœ_˜_K˜—šœ˜Kšœ,˜,Kšœ^˜^K˜—Kšœg˜gšœ˜Kšœ,˜,Kšœ]˜]K˜—šœ˜Kšœ,˜,Kšœ]˜]K˜—Kšœg˜gKšœg˜gKšœe˜eKšœe˜eK˜Kšœw˜wKšœ{˜{Kšœs˜sšœ˜Kšœ,˜,Kšœ_˜_K˜—šœ˜Kšœ,˜,Kšœ^˜^K˜—šœ˜Kšœ,˜,Kšœ]˜]K˜—šœ˜Kšœ,˜,Kšœ]˜]K˜—Kšœg˜gKšœg˜gKšœg˜gKšœe˜eKšœe˜eK˜K™ šœ ˜ Kšœ,˜,KšœM˜MK˜—šœ˜Kšœ,˜,Kšœ_˜_K˜—šœ˜KšœW˜WK˜—šœ˜KšœR˜RKšœ˜—šœ˜KšœS˜SKšœ˜—K™Kšœ ™ šœ˜Kšœ,˜,KšœS˜SKšœ˜—šœ˜Kšœ,˜,KšœR˜RKšœ˜—šœ˜Kšœ,˜,KšœR˜RKšœ˜—šœ˜Kšœ,˜,KšœS˜SKšœ˜—šœ˜Kšœ,˜,KšœU˜UKšœ˜—šœ˜Kšœ,˜,KšœT˜TKšœ˜—šœ˜Kšœ,˜,KšœP˜PKšœ˜—šœ˜Kšœ,˜,KšœZ˜ZKšœ˜—Kšœg˜gKšœu˜uKšœu˜ušœ˜Kšœ,˜,Kšœ^˜^Kšœ˜—šœ˜Kšœ,˜,Kšœ\˜\Kšœ˜—šœ˜Kšœ,˜,Kšœ\˜\Kšœ˜—K˜K™ Kšœ_˜_Kšœa˜aKšœi˜iKšœu˜uKšœg˜gK˜K™Kšœe˜eKšœk˜kKšœw˜wKšœs˜sKšœe˜eK™K™ Kšœa˜aKšœW˜WKšœc˜cKšœ[˜[Kšœ]˜]Kšœk˜kKšœ_˜_Kšœq˜qK™K™Kšœe˜eKšœi˜iKšœo˜oKšœ[˜[K˜K™ Kšœq˜qKšœq˜qKšœk˜kKšœe˜eKšœk˜kKšœY˜YKšœ_˜_Kšœ[˜[Kšœa˜aKšœY˜YKšœY˜YKšœ_˜_Kšœ_˜_Kšœo˜oKšœk˜kKšœo˜oKšœi˜iKšœk˜kK˜K™ Kšœt˜tKšœp˜pšœ˜Kšœ,˜,Kšœ\˜\K˜—Kšœe˜eKšœq˜qKšœg˜gK™K™ Kšœa˜aKšœ[˜[Kšœ[˜[Kšœa˜aKšœa˜aK˜K™ Kšœa˜aKšœ[˜[Kšœ[˜[Kšœa˜aKšœa˜aK˜K™ Kšœc˜cKšœ]˜]Kšœ]˜]Kšœc˜cKšœc˜cK˜K™ Kšœg˜gKšœa˜aKšœa˜aKšœg˜gKšœg˜gK™K™Kšœi˜iKšœi˜iKšœk˜kKšœo˜oK˜K™Kšœh˜hKšœl˜lKšœt˜tKšœp˜pKšœ`˜`Kšœ|˜|K˜Kšœ1˜8—Kšœ˜K˜—K˜K™šž œœ9œœœœœœ˜sKšœIœ˜NK˜—K˜KšœœœÏc˜8K˜š ž œœ œœœœ!˜Lšœœœœœœœ˜@Kšœ œ˜KšœœS˜]Kšœœœ4œ*˜lKšœ œœ4œ0˜wKšœTœI˜ŸKšœœ˜—Kšœ˜K˜K˜—šžœœœ!˜KKšœ=˜=KšœC˜CKšœF˜FKšœ%˜%K˜K˜—šžœœœ œœœœœ œœœœ˜išœœœ¡˜/Kšœ œ+˜;Kšœ˜—š œœœœœœ¡˜DKšœ œœ˜DKšœ˜—Kšœ¡˜+K˜K˜—šžœœœ œœœœœ œœœœ˜iKšœ œ˜Kšœœ˜ šœœœ¡˜/Kšœ*˜*KšœBœ˜MKšœ œœœ ˜)Kšœ˜—š œœœœœœ¡˜DKšœœ˜3KšœBœ˜MKšœ œœœ ˜)Kšœ˜—Kšœ¡˜+K˜K˜—šžœœœ œœœœœ œœœœ˜hKšœ œ˜Kšœœ˜ šœœœ¡˜/Kšœ*˜*Kš œœœœ œœœ˜QKšœ œœœ ˜'Kšœ˜—š œœœœœœ¡$˜VKšœ˜Kšœ˜—Kšœœ˜ K˜K˜—šžœœ œœœœœœ˜?Kšœœ ˜0Kšœœ˜Kšœ2˜2Kšœ*˜*K˜pK˜K˜—šž œœ œœœœœœ˜DKšœœ ˜0Kšœ/˜/Kšœ,˜,Jšœ&˜&Jšœ*˜*Jšœ+˜+Jšœ,˜,Jšœ(œ˜7K˜—K˜Kšœ˜—…—k.‚\