diff options
Diffstat (limited to 'montis/src/Montis/Core/Internal')
| -rw-r--r-- | montis/src/Montis/Core/Internal/Foreign/Export.hs | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/montis/src/Montis/Core/Internal/Foreign/Export.hs b/montis/src/Montis/Core/Internal/Foreign/Export.hs index 635955a..d3d5662 100644 --- a/montis/src/Montis/Core/Internal/Foreign/Export.hs +++ b/montis/src/Montis/Core/Internal/Foreign/Export.hs @@ -1,5 +1,5 @@ -- | This module has no public functions, but provides the surface interface --- between the Montis runtime and the soul. +-- between the Montis runtime and the world. module Montis.Core.Internal.Foreign.Export () where import Control.Monad (forM_) @@ -64,11 +64,11 @@ runForeignWithReturn fn outptr stableptr = do -- State marshal/export -- | Marshals the opaque state to a C-style byte array and size pointer. -foreign export ccall "arksoul_export_preserve" - soulMarshalState :: OpqStT -> Ptr Word32 -> IO (Ptr Word8) +foreign export ccall "arkworld_export_preserve" + worldMarshalState :: OpqStT -> Ptr Word32 -> IO (Ptr Word8) -soulMarshalState :: OpqStT -> Ptr Word32 -> IO (Ptr Word8) -soulMarshalState opqStT outlen = do +worldMarshalState :: OpqStT -> Ptr Word32 -> IO (Ptr Word8) +worldMarshalState opqStT outlen = do (_, st) <- deRefStablePtr opqStT let bs = CH.pack (marshalState st) ret <- mallocBytes (BS.length bs) @@ -80,11 +80,11 @@ soulMarshalState opqStT outlen = do -- ---------------------------------------------------------------------- -- Input handlers -foreign export ccall "arksoul_export_handle_button" - soulHandleButton :: Ptr WlrPointerButtonEvent -> Word32 -> OpqStT -> IO OpqStT +foreign export ccall "arkworld_export_handle_button" + worldHandleButton :: Ptr WlrPointerButtonEvent -> Word32 -> OpqStT -> IO OpqStT -soulHandleButton :: Ptr WlrPointerButtonEvent -> Word32 -> OpqStT -> IO OpqStT -soulHandleButton eventPtr modifiers = +worldHandleButton :: Ptr WlrPointerButtonEvent -> Word32 -> OpqStT -> IO OpqStT +worldHandleButton eventPtr modifiers = runForeign $ do s <- gets currentHooks event <- liftIO $ @@ -107,8 +107,8 @@ soulHandleButton eventPtr modifiers = -- ---------------------------------------------------------------------- -- Keybinding handler -foreign export ccall "arksoul_export_handle_keybinding" - soulHandleKeybinding :: +foreign export ccall "arkworld_export_handle_keybinding" + worldHandleKeybinding :: Ptr ForeignWlrInputDevice -> Ptr WlrEventKeyboardKey -> Word32 -> @@ -118,7 +118,7 @@ foreign export ccall "arksoul_export_handle_keybinding" OpqStT -> IO OpqStT -soulHandleKeybinding :: +worldHandleKeybinding :: Ptr ForeignWlrInputDevice -> Ptr WlrEventKeyboardKey -> Word32 -> @@ -127,7 +127,7 @@ soulHandleKeybinding :: Ptr CInt -> OpqStT -> IO OpqStT -soulHandleKeybinding inputDevicePtr eventPtr mods sym cp = +worldHandleKeybinding inputDevicePtr eventPtr mods sym cp = runForeignWithReturn $ do s <- gets currentHooks event <- liftIO $ @@ -153,11 +153,11 @@ soulHandleKeybinding inputDevicePtr eventPtr mods sym cp = -- ---------------------------------------------------------------------- -- Motion handler -foreign export ccall "arksoul_export_handle_motion" - soulHandleMotion :: Ptr Void -> Word32 -> Word32 -> CDouble -> CDouble -> OpqStT -> IO OpqStT +foreign export ccall "arkworld_export_handle_motion" + worldHandleMotion :: Ptr Void -> Word32 -> Word32 -> CDouble -> CDouble -> OpqStT -> IO OpqStT -soulHandleMotion :: Ptr Void -> Word32 -> Word32 -> CDouble -> CDouble -> OpqStT -> IO OpqStT -soulHandleMotion eventPtr modifiers isAbsolute lx ly = +worldHandleMotion :: Ptr Void -> Word32 -> Word32 -> CDouble -> CDouble -> OpqStT -> IO OpqStT +worldHandleMotion eventPtr modifiers isAbsolute lx ly = runForeign $ do s <- gets currentHooks event <- liftIO $ @@ -201,26 +201,26 @@ soulHandleMotion eventPtr modifiers isAbsolute lx ly = -- | Function exported to the harness to handle the mapping/unmapping/deletion -- of an XDG surface. -foreign export ccall "arksoul_export_handle_surface" - soulHandleSurface :: +foreign export ccall "arkworld_export_handle_surface" + worldHandleSurface :: Ptr ForeignWlrXdgSurface -> CInt -> OpqStT -> IO OpqStT -soulHandleSurface :: +worldHandleSurface :: Ptr ForeignWlrXdgSurface -> CInt -> OpqStT -> IO OpqStT -soulHandleSurface p t = +worldHandleSurface p t = runForeign $ do s <- gets currentHooks surfaceHook s (SurfaceEvent (toEnum $ fromIntegral t) (toSurface p)) -- | Function exported to the harness to handle the mapping/unmapping/deletion -- of an XWayland surface. -foreign export ccall "arksoul_export_handle_xwayland_surface" - soulHandleXWaylandSurface :: +foreign export ccall "arkworld_export_handle_xwayland_surface" + worldHandleXWaylandSurface :: Ptr ForeignWlrXWaylandSurface -> CInt -> OpqStT -> IO OpqStT -soulHandleXWaylandSurface :: +worldHandleXWaylandSurface :: Ptr ForeignWlrXWaylandSurface -> CInt -> OpqStT -> IO OpqStT -soulHandleXWaylandSurface p t = +worldHandleXWaylandSurface p t = runForeign $ do s <- gets currentHooks surfaceHook s (SurfaceEvent (toEnum $ fromIntegral t) (toSurface p)) |