| Safe Haskell | Safe-Inferred |
|---|
Ui.UiMsg
Description
Receive events from the C++ UI layer, package them up nicely, and forward them on to the event handling mechanism (the responder).
Synopsis
- data UiMsg = UiMsg Context Msg
- data Context = Context {}
- data Track
- data Msg
- data UiUpdate
- data MsgEvent
- data MouseEvent = MouseEvent {
- mouse_state :: !MouseState
- mouse_modifiers :: ![Key.Modifier]
- mouse_coords :: !(Int, Int)
- mouse_clicks :: !Int
- mouse_is_click :: !Bool
- data AuxMsg
- data MouseState
- data KbdState
- show_short :: UiMsg -> Text
Documentation
Technically not all UiMsgs have a Context, but it's easier to give everyone a Context since it can be all Nothing anyway.
Instances
| Show UiMsg Source # | |
| CStorable UiMsg Source # | |
| Pretty UiMsg Source # | |
Constructors
| Context | |
Fields
| |
Whether the context is on the track itself or the skeleton display above the track.
There are a few cases where there is a track but no position and it *doesn't* mean SkeletonDisplay, namely UpdateTrackWidth and UpdateInput. However, those cases are handled in a specific place while Track goes on to become a mouse Modifier, so I don't mind if the former is a little awkward for the benefit of the latter.
Constructors
| Track !TrackTime | |
| SkeletonDisplay | |
| Divider |
Corresponds to UiMsg::MsgType enum.
Each UiUpdate has a ViewId which is separate from the focus. This is because they can happen to an unfocused view, e.g. on OS X UpdateViewResize and UpdateClose.
Constructors
| MsgEvent MsgEvent | |
| UiUpdate Id.ViewId UiUpdate | |
| UpdateScreenSize Int Int Rect.Rect | Give screen dimensions: screen number, total screens, rect. This is a UiUpdate but it doesn't have a ViewId. |
These are generated when the UI is manipulated directly and makes changes to its own state. They are like Ui.Update except in the opposide direction: fltk telling haskell what changes occurred.
Constructors
| UpdateInput !(Maybe Text) | Nothing means the text didn't change, but a msg is being sent anyway since that's the only way I know the floating edit input has closed. |
| UpdateTrackScroll !Types.Width | |
| UpdateTimeScroll !ScoreTime | |
| UpdateViewResize !Rect.Rect !Block.Padding | Size of entire block window, and padding. |
| UpdateTrackWidth !Types.Width !Types.Width | TrackWidth.width, TrackWidth.suggested_width |
| UpdateClose | The given view was closed. |
MsgType.msg_event, which is a fltk event.
Constructors
| Mouse !MouseEvent | |
| Kbd KbdState [Key.Modifier] Key.Key (Maybe Char) | The Char is the text that this key wants to enter, if any. The Key is just the keycap, without taking shift or other modifiers into account. |
| AuxMsg AuxMsg | |
| Unhandled Int |
data MouseEvent Source #
Constructors
| MouseEvent | |
Fields
| |
Instances
| Show MouseEvent Source # | |
Defined in Ui.UiMsg Methods showsPrec :: Int -> MouseEvent -> ShowS # show :: MouseEvent -> String # showList :: [MouseEvent] -> ShowS # | |
| Eq MouseEvent Source # | |
Defined in Ui.UiMsg | |
| Ord MouseEvent Source # | |
Defined in Ui.UiMsg Methods compare :: MouseEvent -> MouseEvent -> Ordering # (<) :: MouseEvent -> MouseEvent -> Bool # (<=) :: MouseEvent -> MouseEvent -> Bool # (>) :: MouseEvent -> MouseEvent -> Bool # (>=) :: MouseEvent -> MouseEvent -> Bool # max :: MouseEvent -> MouseEvent -> MouseEvent # min :: MouseEvent -> MouseEvent -> MouseEvent # | |
| Pretty MouseEvent Source # | |
Defined in Ui.UiMsg Methods pretty :: MouseEvent -> Text Source # format :: MouseEvent -> Doc Source # formatList :: [MouseEvent] -> Doc Source # | |
Most of these are unused, but are included here for completeness.
data MouseState Source #
Constructors
| MouseMove | |
| MouseDrag Types.MouseButton | |
| MouseDown Types.MouseButton | |
| MouseUp Types.MouseButton |
Instances
| Show MouseState Source # | |
Defined in Ui.UiMsg Methods showsPrec :: Int -> MouseState -> ShowS # show :: MouseState -> String # showList :: [MouseState] -> ShowS # | |
| Eq MouseState Source # | |
Defined in Ui.UiMsg | |
| Ord MouseState Source # | |
Defined in Ui.UiMsg Methods compare :: MouseState -> MouseState -> Ordering # (<) :: MouseState -> MouseState -> Bool # (<=) :: MouseState -> MouseState -> Bool # (>) :: MouseState -> MouseState -> Bool # (>=) :: MouseState -> MouseState -> Bool # max :: MouseState -> MouseState -> MouseState # min :: MouseState -> MouseState -> MouseState # | |
| Pretty MouseState Source # | |
Defined in Ui.UiMsg Methods pretty :: MouseState -> Text Source # format :: MouseState -> Doc Source # formatList :: [MouseState] -> Doc Source # | |