DIRECTORY Atom, GGDrawProcess, GGError, GGEvent, GGInterfaceTypes, GGModelTypes, GGMouseEvent, GGUserInput, GGWindow, Imager, ImagerTransformation, Menus, Rope, TIPUser, ViewerClasses; GGUserInputImpl: CEDAR PROGRAM IMPORTS Atom, GGError, GGDrawProcess, GGEvent, GGMouseEvent, GGWindow EXPORTS GGUserInput = BEGIN Camera: TYPE = GGModelTypes.Camera; GargoyleData: TYPE = GGInterfaceTypes.GargoyleData; GGButtonData: TYPE = GGInterfaceTypes.GGButtonData; Point: TYPE = GGModelTypes.Point; Viewer: TYPE = ViewerClasses.Viewer; HandleMenuAction: PUBLIC Menus.ClickProc = { buttonData: GGButtonData _ NARROW[clientData]; gargoyleData: GargoyleData _ NARROW[buttonData.gargoyleData]; action: LIST OF REF ANY _ buttonData.action; GeneralDispatch[action, gargoyleData]; -- put the action on the slack queue and return }; PlayAction: PUBLIC PROC [point: Point, action: LIST OF REF ANY, mouseEvent: BOOL, gargoyleData: GargoyleData] = { IF mouseEvent THEN InputCameraCoords[point, action, gargoyleData] ELSE GeneralDispatch[action, gargoyleData]; }; InputNotify: PUBLIC PROCEDURE [self: ViewerClasses.Viewer, input: LIST OF REF ANY] = { gargoyleData: GargoyleData _ NARROW[self.data]; IF ISTYPE[input.first, TIPUser.TIPScreenCoords] THEN { controlPoint: Point; camera: Camera _ gargoyleData.camera; mousePlace: TIPUser.TIPScreenCoords _ NARROW[input.first]; controlPoint[1] _ mousePlace.mouseX; controlPoint[2] _ mousePlace.mouseY; controlPoint _ GGWindow.ScreenToCamera[controlPoint, camera]; InputCameraCoords[controlPoint, input.rest, gargoyleData]; } ELSE GeneralDispatch[input, gargoyleData]; }; InputCameraCoords: PROC [controlPoint: Point, input: LIST OF REF ANY, gargoyleData: GargoyleData] = { atom: ATOM; atom _ NARROW[input.first]; SELECT atom FROM $StartSelectPoint => GGDrawProcess.QueueInputAction[GGMouseEvent.StartSelectPoint, input, controlPoint, gargoyleData]; $EndSelectPoint => GGDrawProcess.QueueInputAction[GGMouseEvent.EndSelectPoint, input, controlPoint, gargoyleData]; $StartCopySelect => NotYetImplementedMessage[atom]; $EndCopySelect => NotYetImplementedMessage[atom]; $StartAdd => GGDrawProcess.QueueInputAction[GGMouseEvent.StartAdd, input, controlPoint, gargoyleData]; $EndAdd => GGDrawProcess.QueueInputAction[GGMouseEvent.EndAdd, input, controlPoint, gargoyleData]; $StartDeselectPoint => NotYetImplementedMessage[atom]; $StartSelectTrajectory => GGDrawProcess.QueueInputAction[GGMouseEvent.StartSelectTrajectory, input, controlPoint, gargoyleData]; $StartCopySelectTrajectory => GGDrawProcess.QueueInputAction[GGMouseEvent.StartCopySelectTrajectory, input, controlPoint, gargoyleData]; $StartDrag => GGDrawProcess.QueueInputAction[GGMouseEvent.StartDrag, input, controlPoint, gargoyleData]; $EndDrag => GGDrawProcess.QueueInputAction[GGMouseEvent.EndDrag, input, controlPoint, gargoyleData]; $StartScale => GGDrawProcess.QueueInputAction[GGMouseEvent.StartScale, input, controlPoint, gargoyleData]; $EndScale => GGDrawProcess.QueueInputAction[GGMouseEvent.EndScale, input, controlPoint, gargoyleData]; $StartExtend => GGDrawProcess.QueueInputAction[GGMouseEvent.StartExtend, input, controlPoint, gargoyleData]; $StartCopyExtend => NotYetImplementedMessage[atom]; $StartRotate => GGDrawProcess.QueueInputAction[GGMouseEvent.StartRotate, input, controlPoint, gargoyleData]; $EndRotate => GGDrawProcess.QueueInputAction[GGMouseEvent.EndRotate, input, controlPoint, gargoyleData]; $DuringCopySelect, $DuringDeselectPoint, $EndDeselectPoint, $DuringSelectTrajectory, $EndSelectTrajectory, $DuringCopySelectTrajectory, $EndCopySelectTrajectory, $DuringExtend, $EndExtend, $DuringCopyExtend, $EndCopyExtend => {}; $DuringSelectPoint => GGDrawProcess.QueueOrBashInputAction[GGMouseEvent.DuringSelectPoint, input, controlPoint, gargoyleData]; $DuringAdd => GGDrawProcess.QueueOrBashInputAction[GGMouseEvent.DuringAdd, input, controlPoint, gargoyleData]; $DuringDrag => GGDrawProcess.QueueOrBashInputAction[GGMouseEvent.DuringDrag, input, controlPoint, gargoyleData]; $DuringRotate => GGDrawProcess.QueueOrBashInputAction[GGMouseEvent.DuringRotate, input, controlPoint, gargoyleData]; $DuringScale => GGDrawProcess.QueueOrBashInputAction[GGMouseEvent.DuringScale, input, controlPoint, gargoyleData]; ENDCASE => NotYetImplementedMessage[atom]; }; -- end of InputCameraCoords NotYetImplementedMessage: PROC [atom: ATOM] = { GGError.Append["User action ", begin]; GGError.Append[Atom.GetPName[atom], middle]; GGError.Append[" is not yet implemented", end]; GGError.Blink[]; }; GeneralDispatch: PUBLIC PROC [action: LIST OF REF ANY, gargoyleData: GargoyleData] = { atom: ATOM _ NARROW[action.first]; SELECT atom FROM $NoOp => {}; $Clear => NotYetImplementedMessage[atom]; $Reset => NotYetImplementedMessage[atom]; $Get => NotYetImplementedMessage[atom]; $Store => NotYetImplementedMessage[atom]; $Split => NotYetImplementedMessage[atom]; $Interpress => SimpleQueue[GGEvent.Interpress, action, gargoyleData]; $Delete => SimpleQueue[GGEvent.Delete, action, gargoyleData]; $SelectAll => SimpleQueue[GGEvent.SelectAll, action, gargoyleData]; $SetStraight => SimpleQueue[GGEvent.SetStraight, action, gargoyleData]; $SetArc => SimpleQueue[GGEvent.SetArc, action, gargoyleData]; $SetConic => SimpleQueue[GGEvent.SetConic, action, gargoyleData]; $SetBezier => SimpleQueue[GGEvent.SetBezier, action, gargoyleData]; $SetSpline => SimpleQueue[GGEvent.SetSpline, action, gargoyleData]; $Close => SimpleQueue[GGEvent.Close, action, gargoyleData]; $ShowPoints => SimpleQueue[GGEvent.ShowPoints, action, gargoyleData]; $HidePoints => SimpleQueue[GGEvent.HidePoints, action, gargoyleData]; $Refresh => SimpleQueue[GGEvent.Refresh, action, gargoyleData]; $DisableRefresh => SimpleQueue[GGEvent.DisableRefresh, action, gargoyleData]; $EnableRefresh => SimpleQueue[GGEvent.EnableRefresh, action, gargoyleData]; $TestGravity => SimpleQueue[GGEvent.TestGravity, action, gargoyleData]; $DrawTouchPoints => SimpleQueue[GGEvent.DrawTouchPoints, action, gargoyleData]; $DescribeTouchPoints => SimpleQueue[GGEvent.DescribeTouchPoints, action, gargoyleData]; $DrawBoundBoxes => SimpleQueue[GGEvent.DrawBoundBoxes, action, gargoyleData]; $DrawSelectionBox => SimpleQueue[GGEvent.DrawSelectionBox, action, gargoyleData]; $Typescript => SimpleQueue[GGEvent.Typescript, action, gargoyleData]; $SlackLog => SimpleQueue[GGEvent.SlackLog, action, gargoyleData]; $DescribeCaretObject => SimpleQueue[GGEvent.DescribeCaretObject, action, gargoyleData]; $LineWidth => SimpleQueue[GGEvent.LineWidth, action, gargoyleData]; $AreaColorBlack => SimpleQueue[GGEvent.AreaColorBlack, action, gargoyleData]; $AreaColorWhite => SimpleQueue[GGEvent.AreaColorWhite, action, gargoyleData]; $AreaColorGray => SimpleQueue[GGEvent.AreaColorGray, action, gargoyleData]; $MakeHot => SimpleQueue[GGEvent.MakeHot, action, gargoyleData]; $MakeCold => SimpleQueue[GGEvent.MakeCold, action, gargoyleData]; $DropAnchor => SimpleQueue[GGEvent.DropAnchor, action, gargoyleData]; $LiftAnchor => SimpleQueue[GGEvent.KillAnchor, action, gargoyleData]; $GravityChoiceChange => SimpleQueue[GGEvent.GravityChoiceChange, action, gargoyleData]; $GravityExtentChange => SimpleQueue[GGEvent.GravityExtentChange, action, gargoyleData]; $ToggleAlwaysOn => SimpleQueue[GGEvent.ToggleAlwaysOn, action, gargoyleData]; $ToggleDoubleBuffer => SimpleQueue[GGEvent.ToggleDoubleBuffer, action, gargoyleData]; $SlopePrompt => SimpleQueue[GGEvent.SlopePrompt, action, gargoyleData]; $AddSlope => SimpleQueue[GGEvent.AddSlope, action, gargoyleData]; $GetSlope => SimpleQueue[GGEvent.GetSlope, action, gargoyleData]; $ToggleSlope => SimpleQueue[GGEvent.ToggleSlope, action, gargoyleData]; $DeleteSlope => SimpleQueue[GGEvent.DeleteSlope, action, gargoyleData]; $RadiusPrompt => SimpleQueue[GGEvent.RadiusPrompt, action, gargoyleData]; $AddRadius => SimpleQueue[GGEvent.AddRadius, action, gargoyleData]; $GetRadius => SimpleQueue[GGEvent.GetRadius, action, gargoyleData]; $ToggleRadius => SimpleQueue[GGEvent.ToggleRadius, action, gargoyleData]; $DeleteRadius => SimpleQueue[GGEvent.DeleteRadius, action, gargoyleData]; $DistancePrompt => SimpleQueue[GGEvent.DistancePrompt, action, gargoyleData]; $AddDistance => SimpleQueue[GGEvent.AddDistance, action, gargoyleData]; $GetDistance => SimpleQueue[GGEvent.GetDistance, action, gargoyleData]; $ToggleDistance => SimpleQueue[GGEvent.ToggleDistance, action, gargoyleData]; $DeleteDistance => SimpleQueue[GGEvent.DeleteDistance, action, gargoyleData]; $ReloadTipTable => GGWindow.ReloadTipTable[gargoyleData]; -- should be moved to GGEventImpl ENDCASE => NotYetImplementedMessage[atom]; }; -- end of InputNotify EventProc: TYPE = GGDrawProcess.EventProc; SimpleQueue: PROC [callBack: EventProc, inputAction: LIST OF REF ANY, gargoyleData: GargoyleData] = GGDrawProcess.QueueInputActionNoPoint; END. ÆGGUserInputImpl.mesa Author: Eric Bier on June 6, 1985 1:01:02 am PDT Last edited by Bier on October 17, 1985 4:50:34 pm PDT Contents: Procedures which handle user actions (menu buttons and mouse actions). IF ISTYPE[input.first, TIPUser.TIPScreenCoords] THEN { mousePlace _ NARROW[input.first]; controlPoint[1] _ mousePlace.mouseX; controlPoint[2] _ mousePlace.mouseY; controlPoint _ GGWindow.ScreenToCamera[controlPoint, gargoyleData.camera]; GGDrawProcess.LogRawMouse[controlPoint]; }; Self is an ActionArea. p: ImagerTransformation.VEC; p _ ImagerTransformation.Transform[ImagerTransformation.Invert[context.state.T], [mousePlace.mouseX, mousePlace.mouseY]]; This puts the control point in screen coordinates (screen dots). Convert to camera coordinates. These actions could come from the TIP table or from bugging a menu. File Line Master Line Hierarchy Menu Curve Menu Edit Curve Menu View Menu Debug Menu Style Line Alignment Line: Miscellaneous ʘIhead1™J™0J™6J™PJ™šÏk ˜ Jšœ®˜®J˜—šœœ˜Jšœ>˜EJšœ˜—Jš˜˜Jšœœ˜#Jšœœ!˜3Jšœœ!˜3Jšœœ˜!Jšœœ˜$—J˜šÏnœœ˜,J˜.J˜=J˜,J˜VJ˜J˜—šœœ'œ™6Jšœ œ™!Iprocšœ$™$Lšœ$™$JšœJ™JJšœ(™(J™J™—šž œœœœœœœœ!˜qJšœ œ/˜AJšœÏbœ˜+J˜J˜—šž œœ œ%œœœœ˜VJšœ™Jšœœ ˜/šœœ'œ˜6Jšœ˜Jšœ%˜%Jšœ&œ˜:Lšœ™Lšœy™yLšœ$˜$šœ$˜$L™@—šœ=˜=Jšœ™—Jšžœ)˜:Jšœ˜—JšœŸœ˜*J˜J˜—š žœœœœœœ˜eJšœœ˜ Jšœœ˜Jšœ˜Jšœ#ŸœŸœ%˜vJšœ"ŸœŸœ%˜sJšœ3˜3Jšœ1˜1JšœŸœŸœ%˜fJšœŸœŸœ%˜bJšœ6˜6J˜Jšœ(ŸœŸœ%˜€Jšœ,ŸœŸœ%˜ˆJ˜JšœŸœŸ œ%˜hJšœŸœŸœ%˜dJ˜JšœŸœŸ œ%˜jJšœŸœŸœ%˜fJ˜JšœŸœŸ œ%˜lJšœ3˜3JšœŸœŸ œ%˜lJšœŸœŸ œ%˜hJ˜Jšœ˜Jšœ(˜(J˜.J˜6J˜˜!JšœŸœ˜J˜—Jšœ$ŸœŸœ%˜~JšœŸœŸ œ%˜nJšœŸœŸ œ%˜pJšœŸœŸ œ%˜tJšœŸœŸ œ%˜rJ˜Jšœ#˜*JšœÏc ž˜J˜—šžœœœ˜/Jšœ&˜&Jšœ,˜,Jšœ/˜/Jšœ˜J˜J˜—šžœœœ œœœœ!˜VJ™CJšœœœ˜"Jšœ˜J˜ J™ Jšœ)˜)Jšœ)˜)Jšœ'˜'Jšœ)˜)Jšœ)˜)Jšœ#Ÿ œ˜EJ™ J™J™JšœŸœ˜=Jšœ#Ÿ œ˜DJ™J™ JšœG˜GJšœ=˜=JšœA˜AJšœ"Ÿ œ˜CJšœC˜CJ˜J™JšœŸœ˜;JšœE˜EJšœE˜EJ˜J™ J™Jšœ?˜?JšœM˜MJšœK˜KJ™J™ Jšœ$Ÿ œ˜GJšœO˜OJšœW˜WJšœM˜MJšœQ˜QJšœE˜EJšœA˜AJšœW˜WJ˜J™ Jšœ"Ÿ œ˜CJšœM˜MJšœM˜MJšœK˜KL™L™Lšœ Ÿœ˜?Lšœ!Ÿœ˜ALšœ#Ÿ œ˜ELšœ#Ÿ œ˜ELšœW˜WLšœW˜WLšœM˜MLšœU˜UL˜LšœG˜GLšœA˜ALšœA˜ALšœG˜GLšœG˜GL˜LšœI˜ILšœC˜CLšœC˜CLšœI˜ILšœI˜IL˜LšœM˜MLšœG˜GLšœG˜GLšœM˜MLšœM˜ML™L™ JšœŸœ Ðbc˜\Jšœ#˜*Jšœ ˜J˜—Jšœ œ˜*Jš ž œœ$œœœœF˜ŠJ˜Jšœ˜J˜—…—"\,¡