Copyright | (c) Ashley Towns 2016 |
---|---|
License | BSD3 |
Maintainer | mail@ashleytowns.id.au |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
Provides abstractions over the low level bindings to the core WLC API.
- data Callback
- = OutputCreated (Output -> IO Bool)
- | OutputDestroyed (Output -> IO ())
- | OutputFocus (Output -> Bool -> IO ())
- | OutputResolution (Output -> Size -> Size -> IO ())
- | OutputRenderPre (Output -> IO ())
- | OutputRenderPost (Output -> IO ())
- | ViewCreated (View -> IO Bool)
- | ViewDestroyed (View -> IO ())
- | ViewFocus (View -> Bool -> IO ())
- | ViewMoveToOutput (View -> Output -> Output -> IO ())
- | ViewRequestGeometry (View -> Geometry -> IO ())
- | ViewRequestState (View -> ViewState -> Bool -> IO ())
- | ViewRequestMove (View -> Point -> IO ())
- | ViewRequestResize (View -> ResizeEdge -> Point -> IO ())
- | ViewRenderPre (View -> IO ())
- | ViewRenderPost (View -> IO ())
- | KeyboardKey (Maybe View -> Int -> Modifiers -> Int -> KeyState -> IO Bool)
- | PointerButton (Maybe View -> Int -> Modifiers -> Int -> ButtonState -> Point -> IO Bool)
- | PointerScroll (Maybe View -> Int -> Modifiers -> ScrollAxis -> Double -> IO Bool)
- | PointerMotion (Maybe View -> Int -> Point -> IO Bool)
- | Touch (Maybe View -> Int -> Modifiers -> TouchType -> Int -> Point -> IO Bool)
- | CompositorReady (IO ())
- | CompositorTerminate (IO ())
- dispatchEvent :: Callback -> IO ()
- logHandler :: (LogType -> String -> IO ()) -> IO ()
- initialize :: IO Bool
- terminate :: IO ()
- getBackendType :: IO BackendType
- exec :: String -> [String] -> IO ()
- run :: IO ()
- outputGetMask :: Output -> IO Word32
- outputSetMask :: Output -> Word32 -> IO ()
- outputFocus :: Output -> IO ()
- viewFocus :: View -> IO ()
- viewClose :: View -> IO ()
- viewGetOutput :: View -> IO Output
- viewSetOutput :: View -> Output -> IO ()
- viewSendToBack :: View -> IO ()
- viewSendBelow :: View -> View -> IO ()
- viewBringAbove :: View -> View -> IO ()
- viewBringToFront :: View -> IO ()
- viewGetMask :: View -> IO Word32
- viewSetMask :: View -> Word32 -> IO ()
- viewGetGeometry :: View -> IO Geometry
- viewGetViewType :: View -> IO ViewType
- viewSetViewType :: View -> ViewType -> Bool -> IO ()
- viewGetViewState :: View -> IO ViewState
- viewSetViewState :: View -> ViewState -> Bool -> IO ()
- viewGetParent :: View -> IO (Maybe View)
- viewSetParent :: View -> View -> IO ()
- viewGetTitle :: View -> IO String
- viewGetClass :: View -> IO String
- viewGetAppId :: View -> IO String
- pointerGetPosition :: IO Point
- pointerSetPosition :: Point -> IO ()
Callback API
Available callbacks to be handed to dispatchEvent
OutputCreated (Output -> IO Bool) | Output was created. Return false if you want to destroy the output. |
OutputDestroyed (Output -> IO ()) | Output was destroyed. |
OutputFocus (Output -> Bool -> IO ()) | Output got or lost focus. |
OutputResolution (Output -> Size -> Size -> IO ()) | Output resolution changed. |
OutputRenderPre (Output -> IO ()) | Output pre render hook. |
OutputRenderPost (Output -> IO ()) | Output post render hook. |
ViewCreated (View -> IO Bool) | View was created. Return false if you want to destroy the view. |
ViewDestroyed (View -> IO ()) | View was destroyed. |
ViewFocus (View -> Bool -> IO ()) | View got or lost focus. |
ViewMoveToOutput (View -> Output -> Output -> IO ()) | View was moved to output. |
ViewRequestGeometry (View -> Geometry -> IO ()) | Request to set given geometry for view. Apply using |
ViewRequestState (View -> ViewState -> Bool -> IO ()) | Request to disable or enable the given state for view. Apply using |
ViewRequestMove (View -> Point -> IO ()) | Request to move itself. Start a interactive move to agree. |
ViewRequestResize (View -> ResizeEdge -> Point -> IO ()) | Request to resize itself with the given edges. Start a interactive resize to agree. |
ViewRenderPre (View -> IO ()) | View pre render hook. |
ViewRenderPost (View -> IO ()) | View post render hook. |
KeyboardKey (Maybe View -> Int -> Modifiers -> Int -> KeyState -> IO Bool) | Key event was triggered, view will be |
PointerButton (Maybe View -> Int -> Modifiers -> Int -> ButtonState -> Point -> IO Bool) | Button event was triggered, view will be |
PointerScroll (Maybe View -> Int -> Modifiers -> ScrollAxis -> Double -> IO Bool) | Scroll event was triggered, view will be |
PointerMotion (Maybe View -> Int -> Point -> IO Bool) | Motion event was triggered, view will be |
Touch (Maybe View -> Int -> Modifiers -> TouchType -> Int -> Point -> IO Bool) | Touch event was triggered, view will be |
CompositorReady (IO ()) | Compositor is ready to accept clients. |
CompositorTerminate (IO ()) | Compositor is about to terminate |
dispatchEvent :: Callback -> IO () Source
Marshals the Callback
and applies it to the underlying library
Core API
logHandler :: (LogType -> String -> IO ()) -> IO () Source
Set log handler. Can be set before initialize.
initialize :: IO Bool Source
Initialize wlc. Returns false on failure.
Avoid running unverified code before initialize
as wlc compositor may be run with higher
privileges on non logind systems where compositor binary needs to be suid.
initialize's purpose is to initialize and drop privileges as soon as possible.
Callbacks should be set using dispatchEvent
before calling initialize
,
failing to do so will cause any callback the init may trigger to not be called.
getBackendType :: IO BackendType Source
Query backend wlc is using.
Output
outputGetMask :: Output -> IO Word32 Source
Get current visibility bitmask.
outputSetMask :: Output -> Word32 -> IO () Source
Set visibility bitmask.
outputFocus :: Output -> IO () Source
Focus output. Pass zero for no focus.
View
viewGetOutput :: View -> IO Output Source
Get current output.
viewSetOutput :: View -> Output -> IO () Source
Set output. Alternatively you can outputSetViews
.
viewSendToBack :: View -> IO () Source
Send behind everything.
viewBringToFront :: View -> IO () Source
Bring to front of everything.
viewGetMask :: View -> IO Word32 Source
Get current visibility bitmask.
viewSetMask :: View -> Word32 -> IO () Source
Set visibility bitmask.
viewGetGeometry :: View -> IO Geometry Source
Get current geometry. (what client sees)
viewSetViewType :: View -> ViewType -> Bool -> IO () Source
Set ViewType
bit. Toggle indicates whether it is set or not.
viewSetViewState :: View -> ViewState -> Bool -> IO () Source
Set ViewState
bit. Toggle indicates whether it is set or not.
viewGetClass :: View -> IO String Source
Get class. (shell-surface only)
viewGetAppId :: View -> IO String Source
Get app id. (xdg-surface only)
Input
pointerGetPosition :: IO Point Source
Get current pointer position.
pointerSetPosition :: Point -> IO () Source
Set current pointer position.