metabrush/src/app/MetaBrush/Action.hs-boot
2023-01-09 04:27:08 +01:00

137 lines
2.8 KiB
Haskell
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module MetaBrush.Action where
-- base
import Data.Word
( Word32 )
-- gi-gtk
import qualified GI.Gtk as GTK
-- hashable
import Data.Hashable
( Hashable )
-- text
import Data.Text
( Text )
-- MetaBrush
import Math.Linear
( (..), T(..) )
import {-# SOURCE #-} MetaBrush.Context
( UIElements, Variables )
import {-# SOURCE #-} MetaBrush.UI.FileBar
( TabLocation(..) )
import MetaBrush.UI.Viewport
( Ruler(..) )
import MetaBrush.Unique
( Unique )
--------------------------------------------------------------------------------
data ActionName
= AppAction { actionSimpleName :: !Text }
| WinAction { actionSimpleName :: !Text }
instance Eq ActionName
instance Ord ActionName
instance Show ActionName
instance Hashable ActionName
class HandleAction action where
handleAction :: UIElements -> Variables -> action -> IO ()
instance HandleAction ()
data NewFile = NewFile !TabLocation
instance HandleAction NewFile
data OpenFile = OpenFile !TabLocation
instance HandleAction OpenFile
data OpenFolder = OpenFolder !TabLocation
instance HandleAction OpenFolder
data Save = Save
instance HandleAction Save
data SaveAs = SaveAs
instance HandleAction SaveAs
data Close
= CloseActive
| CloseThis
{ docToClose :: !Unique }
instance HandleAction Close
data SwitchFromTo =
SwitchFromTo
{ mbPrevActiveDocUnique :: !( Maybe Unique )
, newActiveDocUnique :: !Unique
}
instance HandleAction SwitchFromTo
data Quit = Quit
instance HandleAction Quit
quitEverything :: GTK.IsWindow window => GTK.Application -> window -> IO ()
data Undo = Undo
instance HandleAction Undo
data Redo = Redo
instance HandleAction Redo
data Cut = Cut
instance HandleAction Cut
data Copy = Copy
instance HandleAction Copy
data Paste = Paste
instance HandleAction Paste
data Duplicate = Duplicate
instance HandleAction Duplicate
data Delete = Delete
instance HandleAction Delete
data ToggleGuides = ToggleGuides
instance HandleAction ToggleGuides
data Confirm = Confirm
instance HandleAction Confirm
data About = About
instance HandleAction About
data MouseMove = MouseMove !( 2 )
instance HandleAction MouseMove
data ActionOrigin
= ViewportOrigin
| RulerOrigin !Ruler
data MouseClickType
= SingleClick
| DoubleClick
data MouseClick =
MouseClick
{ clickOrigin :: !ActionOrigin
, clickType :: !MouseClickType
, clickButton :: !Word32
, clickCoords :: !( 2 )
}
instance HandleAction MouseClick
data MouseRelease = MouseRelease !Word32 !( 2 )
instance HandleAction MouseRelease
data Scroll = Scroll !( Maybe ( 2 ) ) !( T ( 2 ) )
instance HandleAction Scroll
data KeyboardPress = KeyboardPress !Word32
instance HandleAction KeyboardPress
data KeyboardRelease = KeyboardRelease !Word32
instance HandleAction KeyboardRelease