summaryrefslogtreecommitdiff
path: root/wayland/Wayland/Server/System.hsc
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2024-08-04 21:37:33 +0200
committerHannes Schulze <haschu0103@outlook.de>2024-08-04 21:37:33 +0200
commit3387f92245dae08bc1125829dd542ec2e13c28fd (patch)
tree8e4048e6ff18605cf7c4e2968d4691d7db302db9 /wayland/Wayland/Server/System.hsc
parent049dfc4dc5341f6d0e0015dccbb54352351e9e14 (diff)
create globals
Diffstat (limited to 'wayland/Wayland/Server/System.hsc')
-rw-r--r--wayland/Wayland/Server/System.hsc14
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}