diff options
Diffstat (limited to 'montis/src/Montis')
| -rw-r--r-- | montis/src/Montis/Base/Foreign/Runtime.hs | 16 | ||||
| -rw-r--r-- | montis/src/Montis/Core/Internal/Foreign/Export.hs | 50 | ||||
| -rw-r--r-- | montis/src/Montis/Core/Monad.hs | 6 | ||||
| -rw-r--r-- | montis/src/Montis/Core/State.hs | 4 | ||||
| -rw-r--r-- | montis/src/Montis/Core/World/Interface.hs (renamed from montis/src/Montis/Core/Soul/Interface.hs) | 4 |
5 files changed, 40 insertions, 40 deletions
diff --git a/montis/src/Montis/Base/Foreign/Runtime.hs b/montis/src/Montis/Base/Foreign/Runtime.hs index 46507b5..5690b51 100644 --- a/montis/src/Montis/Base/Foreign/Runtime.hs +++ b/montis/src/Montis/Base/Foreign/Runtime.hs @@ -12,26 +12,26 @@ foreign import ccall "montis_do_request_log" foreign_doRequestLog :: Ptr Void -> foreign import ccall "montis_do_request_exit" foreign_doRequestExit :: Ptr Void -> CInt -> IO () -foreign import ccall "arksoul_get_seat" foreign_getSeat :: Ptr Void -> IO (Ptr Void) +foreign import ccall "arkworld_get_seat" foreign_getSeat :: Ptr Void -> IO (Ptr Void) -foreign import ccall "arksoul_toplevel_at" +foreign import ccall "arkworld_toplevel_at" foreign_toplevelAt :: Ptr Void -> CDouble -> CDouble -> IO (Ptr ForeignMontisToplevel) -foreign import ccall "arksoul_get_toplevel_position" +foreign import ccall "arkworld_get_toplevel_position" foreign_getToplevelPosition :: Ptr ForeignMontisToplevel -> Ptr CDouble -> Ptr CDouble -> IO () -foreign import ccall "arksoul_set_toplevel_position" +foreign import ccall "arkworld_set_toplevel_position" foreign_setToplevelPosition :: Ptr ForeignMontisToplevel -> CDouble -> CDouble -> IO () -foreign import ccall "arksoul_get_toplevel_geometry" +foreign import ccall "arkworld_get_toplevel_geometry" foreign_getToplevelGeometry :: Ptr ForeignMontisToplevel -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () -foreign import ccall "arksoul_set_toplevel_geometry" +foreign import ccall "arkworld_set_toplevel_geometry" foreign_setToplevelGeometry :: Ptr ForeignMontisToplevel -> CDouble -> CDouble -> CDouble -> CDouble -> IO () -foreign import ccall "arksoul_focus_toplevel" +foreign import ccall "arkworld_focus_toplevel" foreign_focusToplevel :: Ptr ForeignMontisToplevel -> IO () -foreign import ccall "arksoul_warp_cursor" +foreign import ccall "arkworld_warp_cursor" foreign_warpCursor :: Ptr Void -> CDouble -> CDouble -> IO () 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)) diff --git a/montis/src/Montis/Core/Monad.hs b/montis/src/Montis/Core/Monad.hs index 0eee819..72b2321 100644 --- a/montis/src/Montis/Core/Monad.hs +++ b/montis/src/Montis/Core/Monad.hs @@ -23,7 +23,7 @@ type MontisContext = Context Montis -- | A State type for the Montis monad. type MontisState = State Montis --- | The Opaque State Type passed between the soul and the runtime. The +-- | The Opaque State Type passed between the world and the runtime. The -- OpqStT *is* the opq_st_t from the runtime code. type OpqStT = StablePtr (MontisContext, MontisState) @@ -34,7 +34,7 @@ newtype Montis a where deriving (Functor, Applicative, Monad, MonadState MontisState, MonadIO) -- | Reader access is scoped to the config portion of the full context; this --- keeps soul code from mutating the context while still allowing read-only +-- keeps world code from mutating the context while still allowing read-only -- access to configuration. instance MonadReader MontisConfig Montis where ask :: Montis MontisConfig @@ -47,7 +47,7 @@ instance MonadReader MontisConfig Montis where local cfn (Montis fn) = Montis $ local (\ctx -> ctx {ctxConfig = cfn (ctxConfig ctx)}) fn --- | Access the soul self pointer stored in the context. +-- | Access the world self pointer stored in the context. getSelfPtr :: Montis SelfPtr getSelfPtr = Montis $ asks ctxSelfPtr diff --git a/montis/src/Montis/Core/State.hs b/montis/src/Montis/Core/State.hs index 6a2d5d0..3df06b2 100644 --- a/montis/src/Montis/Core/State.hs +++ b/montis/src/Montis/Core/State.hs @@ -10,11 +10,11 @@ import Montis.Core.Events import Montis.Core.Extensions import Text.Read (readMaybe) --- | An opaque type used for the soul's self-reference. +-- | An opaque type used for the world's self-reference. newtype SelfPtr where SelfPtr :: Ptr Void -> SelfPtr --- | This is the context the soul operates under. The context contains data +-- | This is the context the world operates under. The context contains data -- which must be provided by the runtime or the configuration. This data may not -- be cold-created. -- diff --git a/montis/src/Montis/Core/Soul/Interface.hs b/montis/src/Montis/Core/World/Interface.hs index 3271ab7..39d4e4c 100644 --- a/montis/src/Montis/Core/Soul/Interface.hs +++ b/montis/src/Montis/Core/World/Interface.hs @@ -1,5 +1,5 @@ --- | Provides the soul interface through foreign exports. -module Montis.Core.Soul.Interface where +-- | Provides the world interface through foreign exports. +module Montis.Core.World.Interface where import Data.ByteString (ByteString) import Data.Data (Typeable) |