diff options
Diffstat (limited to 'wayland/Wayland/Server/System.hsc')
| -rw-r--r-- | wayland/Wayland/Server/System.hsc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/wayland/Wayland/Server/System.hsc b/wayland/Wayland/Server/System.hsc index f758a65..6fcd52c 100644 --- a/wayland/Wayland/Server/System.hsc +++ b/wayland/Wayland/Server/System.hsc @@ -6,6 +6,7 @@ module Wayland.Server.System where import Foreign (FunPtr, Ptr, Storable(..)) import Foreign.C (CString, CInt(..)) +import Data.Word (Word32) data WLMessage = WLMessage { msgName :: CString @@ -27,12 +28,19 @@ data WLInterface newtype WLDisplay = WLDisplay (Ptr WLDisplay) newtype WLEventLoop = WLEventLoop (Ptr WLEventLoop) newtype WLEventSource = WLEventSource (Ptr WLEventSource) +newtype WLGlobal = WLGlobal (Ptr WLGlobal) +newtype WLClient = WLClient (Ptr WLClient) +newtype WLResource = WLResource (Ptr WLResource) type WLEventLoopSignalFunc = CInt -> Ptr () -> IO CInt +type WLGlobalBindFunc = WLClient -> Ptr () -> Word32 -> Word32 -> IO () foreign import ccall "wrapper" wrapWLEventLoopSignalFunc :: WLEventLoopSignalFunc -> IO (FunPtr WLEventLoopSignalFunc) +foreign import ccall "wrapper" + wrapWLGlobalBindFunc :: WLGlobalBindFunc -> IO (FunPtr WLGlobalBindFunc) + foreign import ccall "wl_display_create" wlDisplayCreate :: IO WLDisplay @@ -54,6 +62,12 @@ foreign import ccall "wl_display_get_event_loop" foreign import ccall "wl_event_loop_add_signal" wlEventLoopAddSignal :: WLEventLoop -> CInt -> FunPtr WLEventLoopSignalFunc -> Ptr () -> IO WLEventSource +foreign import ccall "wl_global_create" + wlGlobalCreate :: WLDisplay -> Ptr WLInterface -> CInt -> Ptr () -> FunPtr WLGlobalBindFunc -> IO WLGlobal + +foreign import ccall "wl_resource_create" + wlResourceCreate :: WLClient -> Ptr WLInterface -> CInt -> Word32 -> IO WLResource + instance Storable WLMessage where sizeOf _ = #{size struct wl_message} alignment _ = #{alignment struct wl_message} |
