bindings-wlc-0.1.0.7: Bindings against the wlc library

Copyright(c) Ashley Towns 2016
LicenseBSD3
Maintainermail@ashleytowns.id.au
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

System.WLC.Core

Contents

Description

Provides abstractions over the low level bindings to the core WLC API.

Synopsis

Callback API

data Callback Source

Available callbacks to be handed to dispatchEvent

Constructors

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 viewSetGeometry to agree.

ViewRequestState (View -> ViewState -> Bool -> IO ())

Request to disable or enable the given state for view. Apply using viewSetViewState to agree.

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 Nothing if there was no focus. Return true to prevent sending the event to clients.

PointerButton (Maybe View -> Int -> Modifiers -> Int -> ButtonState -> Point -> IO Bool)

Button event was triggered, view will be Nothing if there was no focus. Return true to prevent sending the event to clients.

PointerScroll (Maybe View -> Int -> Modifiers -> ScrollAxis -> Double -> IO Bool)

Scroll event was triggered, view will be Nothing if there was no focus. Return true to prevent sending the event to clients.

PointerMotion (Maybe View -> Int -> Point -> IO Bool)

Motion event was triggered, view will be Nothing if there was no focus. Apply with pointerSetPosition to agree. Return true to prevent sending the event to clients.

Touch (Maybe View -> Int -> Modifiers -> TouchType -> Int -> Point -> IO Bool)

Touch event was triggered, view will be Nothing if there was no focus. Return true to prevent sending the event to clients.

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.

terminate :: IO () Source

Terminate wlc.

getBackendType :: IO BackendType Source

Query backend wlc is using.

exec :: String -> [String] -> IO () Source

Exec program.

run :: IO () Source

Run event loop.

Output

getOutputs :: IO [Output] Source

Get outputs.

getFocusedOutput :: IO Output Source

Get focused output.

outputGetName :: Output -> IO String Source

Get output name.

outputGetSleep :: Output -> IO Bool Source

Get sleep state.

outputSetSleep :: Output -> Bool -> IO () Source

Wake up / sleep.

outputGetResolution :: Output -> IO Size Source

Get resolution.

outputSetResolution :: Output -> Size -> IO () Source

Set resolution.

outputGetMask :: Output -> IO Word32 Source

Get current visibility bitmask.

outputSetMask :: Output -> Word32 -> IO () Source

Set visibility bitmask.

outputGetViews :: Output -> IO [View] Source

Get views in stack order.

outputSetViews :: Output -> [View] -> IO Bool Source

Set views in stack order. This will also change mutable views. Returns false on failure.

outputFocus :: Output -> IO () Source

Focus output. Pass zero for no focus.

View

viewFocus :: View -> IO () Source

Focus view. Pass zero for no focus.

viewClose :: View -> IO () Source

Close 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.

viewSendBelow :: View -> View -> IO () Source

Send below another View.

viewBringAbove :: View -> View -> IO () Source

Send above another View.

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)

viewSetGeometry :: View -> ResizeEdge -> Geometry -> IO () Source

Set geometry. Set edges if the geometry change is caused by interactive resize.

viewSetViewType :: View -> ViewType -> Bool -> IO () Source

Set ViewType bit. Toggle indicates whether it is set or not.

viewGetViewState :: View -> IO ViewState Source

Get current ViewState bitfield.

viewSetViewState :: View -> ViewState -> Bool -> IO () Source

Set ViewState bit. Toggle indicates whether it is set or not.

viewSetParent :: View -> View -> IO () Source

Set parent View.

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.