{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.Keymap
(
Keymap(..) ,
IsKeymap ,
toKeymap ,
#if defined(ENABLE_OVERLOADING)
ResolveKeymapMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
KeymapAddVirtualModifiersMethodInfo ,
#endif
keymapAddVirtualModifiers ,
#if defined(ENABLE_OVERLOADING)
KeymapGetCapsLockStateMethodInfo ,
#endif
keymapGetCapsLockState ,
keymapGetDefault ,
#if defined(ENABLE_OVERLOADING)
KeymapGetDirectionMethodInfo ,
#endif
keymapGetDirection ,
#if defined(ENABLE_OVERLOADING)
KeymapGetEntriesForKeycodeMethodInfo ,
#endif
keymapGetEntriesForKeycode ,
#if defined(ENABLE_OVERLOADING)
KeymapGetEntriesForKeyvalMethodInfo ,
#endif
keymapGetEntriesForKeyval ,
keymapGetForDisplay ,
#if defined(ENABLE_OVERLOADING)
KeymapGetModifierMaskMethodInfo ,
#endif
keymapGetModifierMask ,
#if defined(ENABLE_OVERLOADING)
KeymapGetModifierStateMethodInfo ,
#endif
keymapGetModifierState ,
#if defined(ENABLE_OVERLOADING)
KeymapGetNumLockStateMethodInfo ,
#endif
keymapGetNumLockState ,
#if defined(ENABLE_OVERLOADING)
KeymapGetScrollLockStateMethodInfo ,
#endif
keymapGetScrollLockState ,
#if defined(ENABLE_OVERLOADING)
KeymapHaveBidiLayoutsMethodInfo ,
#endif
keymapHaveBidiLayouts ,
#if defined(ENABLE_OVERLOADING)
KeymapLookupKeyMethodInfo ,
#endif
keymapLookupKey ,
#if defined(ENABLE_OVERLOADING)
KeymapMapVirtualModifiersMethodInfo ,
#endif
keymapMapVirtualModifiers ,
#if defined(ENABLE_OVERLOADING)
KeymapTranslateKeyboardStateMethodInfo ,
#endif
keymapTranslateKeyboardState ,
C_KeymapDirectionChangedCallback ,
KeymapDirectionChangedCallback ,
#if defined(ENABLE_OVERLOADING)
KeymapDirectionChangedSignalInfo ,
#endif
afterKeymapDirectionChanged ,
genClosure_KeymapDirectionChanged ,
mk_KeymapDirectionChangedCallback ,
noKeymapDirectionChangedCallback ,
onKeymapDirectionChanged ,
wrap_KeymapDirectionChangedCallback ,
C_KeymapKeysChangedCallback ,
KeymapKeysChangedCallback ,
#if defined(ENABLE_OVERLOADING)
KeymapKeysChangedSignalInfo ,
#endif
afterKeymapKeysChanged ,
genClosure_KeymapKeysChanged ,
mk_KeymapKeysChangedCallback ,
noKeymapKeysChangedCallback ,
onKeymapKeysChanged ,
wrap_KeymapKeysChangedCallback ,
C_KeymapStateChangedCallback ,
KeymapStateChangedCallback ,
#if defined(ENABLE_OVERLOADING)
KeymapStateChangedSignalInfo ,
#endif
afterKeymapStateChanged ,
genClosure_KeymapStateChanged ,
mk_KeymapStateChangedCallback ,
noKeymapStateChangedCallback ,
onKeymapStateChanged ,
wrap_KeymapStateChangedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Structs.KeymapKey as Gdk.KeymapKey
import qualified GI.Pango.Enums as Pango.Enums
newtype Keymap = Keymap (SP.ManagedPtr Keymap)
deriving (Keymap -> Keymap -> Bool
(Keymap -> Keymap -> Bool)
-> (Keymap -> Keymap -> Bool) -> Eq Keymap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Keymap -> Keymap -> Bool
$c/= :: Keymap -> Keymap -> Bool
== :: Keymap -> Keymap -> Bool
$c== :: Keymap -> Keymap -> Bool
Eq)
instance SP.ManagedPtrNewtype Keymap where
toManagedPtr :: Keymap -> ManagedPtr Keymap
toManagedPtr (Keymap ManagedPtr Keymap
p) = ManagedPtr Keymap
p
foreign import ccall "gdk_keymap_get_type"
c_gdk_keymap_get_type :: IO B.Types.GType
instance B.Types.TypedObject Keymap where
glibType :: IO GType
glibType = IO GType
c_gdk_keymap_get_type
instance B.Types.GObject Keymap
instance B.GValue.IsGValue Keymap where
toGValue :: Keymap -> IO GValue
toGValue Keymap
o = do
GType
gtype <- IO GType
c_gdk_keymap_get_type
Keymap -> (Ptr Keymap -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Keymap
o (GType -> (GValue -> Ptr Keymap -> IO ()) -> Ptr Keymap -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Keymap -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Keymap
fromGValue GValue
gv = do
Ptr Keymap
ptr <- GValue -> IO (Ptr Keymap)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Keymap)
(ManagedPtr Keymap -> Keymap) -> Ptr Keymap -> IO Keymap
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Keymap -> Keymap
Keymap Ptr Keymap
ptr
class (SP.GObject o, O.IsDescendantOf Keymap o) => IsKeymap o
instance (SP.GObject o, O.IsDescendantOf Keymap o) => IsKeymap o
instance O.HasParentTypes Keymap
type instance O.ParentTypes Keymap = '[GObject.Object.Object]
toKeymap :: (MonadIO m, IsKeymap o) => o -> m Keymap
toKeymap :: o -> m Keymap
toKeymap = IO Keymap -> m Keymap
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Keymap -> m Keymap) -> (o -> IO Keymap) -> o -> m Keymap
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Keymap -> Keymap) -> o -> IO Keymap
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Keymap -> Keymap
Keymap
#if defined(ENABLE_OVERLOADING)
type family ResolveKeymapMethod (t :: Symbol) (o :: *) :: * where
ResolveKeymapMethod "addVirtualModifiers" o = KeymapAddVirtualModifiersMethodInfo
ResolveKeymapMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveKeymapMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveKeymapMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveKeymapMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveKeymapMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveKeymapMethod "haveBidiLayouts" o = KeymapHaveBidiLayoutsMethodInfo
ResolveKeymapMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveKeymapMethod "lookupKey" o = KeymapLookupKeyMethodInfo
ResolveKeymapMethod "mapVirtualModifiers" o = KeymapMapVirtualModifiersMethodInfo
ResolveKeymapMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveKeymapMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveKeymapMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveKeymapMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveKeymapMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveKeymapMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveKeymapMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveKeymapMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveKeymapMethod "translateKeyboardState" o = KeymapTranslateKeyboardStateMethodInfo
ResolveKeymapMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveKeymapMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveKeymapMethod "getCapsLockState" o = KeymapGetCapsLockStateMethodInfo
ResolveKeymapMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveKeymapMethod "getDirection" o = KeymapGetDirectionMethodInfo
ResolveKeymapMethod "getEntriesForKeycode" o = KeymapGetEntriesForKeycodeMethodInfo
ResolveKeymapMethod "getEntriesForKeyval" o = KeymapGetEntriesForKeyvalMethodInfo
ResolveKeymapMethod "getModifierMask" o = KeymapGetModifierMaskMethodInfo
ResolveKeymapMethod "getModifierState" o = KeymapGetModifierStateMethodInfo
ResolveKeymapMethod "getNumLockState" o = KeymapGetNumLockStateMethodInfo
ResolveKeymapMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveKeymapMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveKeymapMethod "getScrollLockState" o = KeymapGetScrollLockStateMethodInfo
ResolveKeymapMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveKeymapMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveKeymapMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveKeymapMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveKeymapMethod t Keymap, O.MethodInfo info Keymap p) => OL.IsLabel t (Keymap -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type KeymapDirectionChangedCallback =
IO ()
noKeymapDirectionChangedCallback :: Maybe KeymapDirectionChangedCallback
noKeymapDirectionChangedCallback :: Maybe (IO ())
noKeymapDirectionChangedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_KeymapDirectionChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_KeymapDirectionChangedCallback :: C_KeymapDirectionChangedCallback -> IO (FunPtr C_KeymapDirectionChangedCallback)
genClosure_KeymapDirectionChanged :: MonadIO m => KeymapDirectionChangedCallback -> m (GClosure C_KeymapDirectionChangedCallback)
genClosure_KeymapDirectionChanged :: IO () -> m (GClosure C_KeymapDirectionChangedCallback)
genClosure_KeymapDirectionChanged IO ()
cb = IO (GClosure C_KeymapDirectionChangedCallback)
-> m (GClosure C_KeymapDirectionChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_KeymapDirectionChangedCallback)
-> m (GClosure C_KeymapDirectionChangedCallback))
-> IO (GClosure C_KeymapDirectionChangedCallback)
-> m (GClosure C_KeymapDirectionChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_KeymapDirectionChangedCallback
cb' = IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapDirectionChangedCallback IO ()
cb
C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapDirectionChangedCallback C_KeymapDirectionChangedCallback
cb' IO (FunPtr C_KeymapDirectionChangedCallback)
-> (FunPtr C_KeymapDirectionChangedCallback
-> IO (GClosure C_KeymapDirectionChangedCallback))
-> IO (GClosure C_KeymapDirectionChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_KeymapDirectionChangedCallback
-> IO (GClosure C_KeymapDirectionChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_KeymapDirectionChangedCallback ::
KeymapDirectionChangedCallback ->
C_KeymapDirectionChangedCallback
wrap_KeymapDirectionChangedCallback :: IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapDirectionChangedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onKeymapDirectionChanged :: (IsKeymap a, MonadIO m) => a -> KeymapDirectionChangedCallback -> m SignalHandlerId
onKeymapDirectionChanged :: a -> IO () -> m SignalHandlerId
onKeymapDirectionChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_KeymapDirectionChangedCallback
cb' = IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapDirectionChangedCallback IO ()
cb
FunPtr C_KeymapDirectionChangedCallback
cb'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapDirectionChangedCallback C_KeymapDirectionChangedCallback
cb'
a
-> Text
-> FunPtr C_KeymapDirectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"direction-changed" FunPtr C_KeymapDirectionChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterKeymapDirectionChanged :: (IsKeymap a, MonadIO m) => a -> KeymapDirectionChangedCallback -> m SignalHandlerId
afterKeymapDirectionChanged :: a -> IO () -> m SignalHandlerId
afterKeymapDirectionChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_KeymapDirectionChangedCallback
cb' = IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapDirectionChangedCallback IO ()
cb
FunPtr C_KeymapDirectionChangedCallback
cb'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapDirectionChangedCallback C_KeymapDirectionChangedCallback
cb'
a
-> Text
-> FunPtr C_KeymapDirectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"direction-changed" FunPtr C_KeymapDirectionChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data KeymapDirectionChangedSignalInfo
instance SignalInfo KeymapDirectionChangedSignalInfo where
type HaskellCallbackType KeymapDirectionChangedSignalInfo = KeymapDirectionChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_KeymapDirectionChangedCallback cb
cb'' <- mk_KeymapDirectionChangedCallback cb'
connectSignalFunPtr obj "direction-changed" cb'' connectMode detail
#endif
type KeymapKeysChangedCallback =
IO ()
noKeymapKeysChangedCallback :: Maybe KeymapKeysChangedCallback
noKeymapKeysChangedCallback :: Maybe (IO ())
noKeymapKeysChangedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_KeymapKeysChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_KeymapKeysChangedCallback :: C_KeymapKeysChangedCallback -> IO (FunPtr C_KeymapKeysChangedCallback)
genClosure_KeymapKeysChanged :: MonadIO m => KeymapKeysChangedCallback -> m (GClosure C_KeymapKeysChangedCallback)
genClosure_KeymapKeysChanged :: IO () -> m (GClosure C_KeymapDirectionChangedCallback)
genClosure_KeymapKeysChanged IO ()
cb = IO (GClosure C_KeymapDirectionChangedCallback)
-> m (GClosure C_KeymapDirectionChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_KeymapDirectionChangedCallback)
-> m (GClosure C_KeymapDirectionChangedCallback))
-> IO (GClosure C_KeymapDirectionChangedCallback)
-> m (GClosure C_KeymapDirectionChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_KeymapDirectionChangedCallback
cb' = IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapKeysChangedCallback IO ()
cb
C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapKeysChangedCallback C_KeymapDirectionChangedCallback
cb' IO (FunPtr C_KeymapDirectionChangedCallback)
-> (FunPtr C_KeymapDirectionChangedCallback
-> IO (GClosure C_KeymapDirectionChangedCallback))
-> IO (GClosure C_KeymapDirectionChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_KeymapDirectionChangedCallback
-> IO (GClosure C_KeymapDirectionChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_KeymapKeysChangedCallback ::
KeymapKeysChangedCallback ->
C_KeymapKeysChangedCallback
wrap_KeymapKeysChangedCallback :: IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapKeysChangedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onKeymapKeysChanged :: (IsKeymap a, MonadIO m) => a -> KeymapKeysChangedCallback -> m SignalHandlerId
onKeymapKeysChanged :: a -> IO () -> m SignalHandlerId
onKeymapKeysChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_KeymapDirectionChangedCallback
cb' = IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapKeysChangedCallback IO ()
cb
FunPtr C_KeymapDirectionChangedCallback
cb'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapKeysChangedCallback C_KeymapDirectionChangedCallback
cb'
a
-> Text
-> FunPtr C_KeymapDirectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"keys-changed" FunPtr C_KeymapDirectionChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterKeymapKeysChanged :: (IsKeymap a, MonadIO m) => a -> KeymapKeysChangedCallback -> m SignalHandlerId
afterKeymapKeysChanged :: a -> IO () -> m SignalHandlerId
afterKeymapKeysChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_KeymapDirectionChangedCallback
cb' = IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapKeysChangedCallback IO ()
cb
FunPtr C_KeymapDirectionChangedCallback
cb'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapKeysChangedCallback C_KeymapDirectionChangedCallback
cb'
a
-> Text
-> FunPtr C_KeymapDirectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"keys-changed" FunPtr C_KeymapDirectionChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data KeymapKeysChangedSignalInfo
instance SignalInfo KeymapKeysChangedSignalInfo where
type HaskellCallbackType KeymapKeysChangedSignalInfo = KeymapKeysChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_KeymapKeysChangedCallback cb
cb'' <- mk_KeymapKeysChangedCallback cb'
connectSignalFunPtr obj "keys-changed" cb'' connectMode detail
#endif
type KeymapStateChangedCallback =
IO ()
noKeymapStateChangedCallback :: Maybe KeymapStateChangedCallback
noKeymapStateChangedCallback :: Maybe (IO ())
noKeymapStateChangedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_KeymapStateChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_KeymapStateChangedCallback :: C_KeymapStateChangedCallback -> IO (FunPtr C_KeymapStateChangedCallback)
genClosure_KeymapStateChanged :: MonadIO m => KeymapStateChangedCallback -> m (GClosure C_KeymapStateChangedCallback)
genClosure_KeymapStateChanged :: IO () -> m (GClosure C_KeymapDirectionChangedCallback)
genClosure_KeymapStateChanged IO ()
cb = IO (GClosure C_KeymapDirectionChangedCallback)
-> m (GClosure C_KeymapDirectionChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_KeymapDirectionChangedCallback)
-> m (GClosure C_KeymapDirectionChangedCallback))
-> IO (GClosure C_KeymapDirectionChangedCallback)
-> m (GClosure C_KeymapDirectionChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_KeymapDirectionChangedCallback
cb' = IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapStateChangedCallback IO ()
cb
C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapStateChangedCallback C_KeymapDirectionChangedCallback
cb' IO (FunPtr C_KeymapDirectionChangedCallback)
-> (FunPtr C_KeymapDirectionChangedCallback
-> IO (GClosure C_KeymapDirectionChangedCallback))
-> IO (GClosure C_KeymapDirectionChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_KeymapDirectionChangedCallback
-> IO (GClosure C_KeymapDirectionChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_KeymapStateChangedCallback ::
KeymapStateChangedCallback ->
C_KeymapStateChangedCallback
wrap_KeymapStateChangedCallback :: IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapStateChangedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onKeymapStateChanged :: (IsKeymap a, MonadIO m) => a -> KeymapStateChangedCallback -> m SignalHandlerId
onKeymapStateChanged :: a -> IO () -> m SignalHandlerId
onKeymapStateChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_KeymapDirectionChangedCallback
cb' = IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapStateChangedCallback IO ()
cb
FunPtr C_KeymapDirectionChangedCallback
cb'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapStateChangedCallback C_KeymapDirectionChangedCallback
cb'
a
-> Text
-> FunPtr C_KeymapDirectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"state-changed" FunPtr C_KeymapDirectionChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterKeymapStateChanged :: (IsKeymap a, MonadIO m) => a -> KeymapStateChangedCallback -> m SignalHandlerId
afterKeymapStateChanged :: a -> IO () -> m SignalHandlerId
afterKeymapStateChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_KeymapDirectionChangedCallback
cb' = IO () -> C_KeymapDirectionChangedCallback
wrap_KeymapStateChangedCallback IO ()
cb
FunPtr C_KeymapDirectionChangedCallback
cb'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapStateChangedCallback C_KeymapDirectionChangedCallback
cb'
a
-> Text
-> FunPtr C_KeymapDirectionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"state-changed" FunPtr C_KeymapDirectionChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data KeymapStateChangedSignalInfo
instance SignalInfo KeymapStateChangedSignalInfo where
type HaskellCallbackType KeymapStateChangedSignalInfo = KeymapStateChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_KeymapStateChangedCallback cb
cb'' <- mk_KeymapStateChangedCallback cb'
connectSignalFunPtr obj "state-changed" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Keymap
type instance O.AttributeList Keymap = KeymapAttributeList
type KeymapAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Keymap = KeymapSignalList
type KeymapSignalList = ('[ '("directionChanged", KeymapDirectionChangedSignalInfo), '("keysChanged", KeymapKeysChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("stateChanged", KeymapStateChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_keymap_add_virtual_modifiers" gdk_keymap_add_virtual_modifiers ::
Ptr Keymap ->
Ptr CUInt ->
IO ()
keymapAddVirtualModifiers ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> [Gdk.Flags.ModifierType]
-> m ([Gdk.Flags.ModifierType])
keymapAddVirtualModifiers :: a -> [ModifierType] -> m [ModifierType]
keymapAddVirtualModifiers a
keymap [ModifierType]
state = IO [ModifierType] -> m [ModifierType]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ModifierType] -> m [ModifierType])
-> IO [ModifierType] -> m [ModifierType]
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
let state' :: CUInt
state' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
state
Ptr CUInt
state'' <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
Ptr CUInt -> CUInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr CUInt
state'' CUInt
state'
Ptr Keymap -> Ptr CUInt -> IO ()
gdk_keymap_add_virtual_modifiers Ptr Keymap
keymap' Ptr CUInt
state''
CUInt
state''' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
state''
let state'''' :: [ModifierType]
state'''' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
state'''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
state''
[ModifierType] -> IO [ModifierType]
forall (m :: * -> *) a. Monad m => a -> m a
return [ModifierType]
state''''
#if defined(ENABLE_OVERLOADING)
data KeymapAddVirtualModifiersMethodInfo
instance (signature ~ ([Gdk.Flags.ModifierType] -> m ([Gdk.Flags.ModifierType])), MonadIO m, IsKeymap a) => O.MethodInfo KeymapAddVirtualModifiersMethodInfo a signature where
overloadedMethod = keymapAddVirtualModifiers
#endif
foreign import ccall "gdk_keymap_get_caps_lock_state" gdk_keymap_get_caps_lock_state ::
Ptr Keymap ->
IO CInt
keymapGetCapsLockState ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> m Bool
keymapGetCapsLockState :: a -> m Bool
keymapGetCapsLockState a
keymap = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
CInt
result <- Ptr Keymap -> IO CInt
gdk_keymap_get_caps_lock_state Ptr Keymap
keymap'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data KeymapGetCapsLockStateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsKeymap a) => O.MethodInfo KeymapGetCapsLockStateMethodInfo a signature where
overloadedMethod = keymapGetCapsLockState
#endif
foreign import ccall "gdk_keymap_get_direction" gdk_keymap_get_direction ::
Ptr Keymap ->
IO CUInt
keymapGetDirection ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> m Pango.Enums.Direction
keymapGetDirection :: a -> m Direction
keymapGetDirection a
keymap = IO Direction -> m Direction
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Direction -> m Direction) -> IO Direction -> m Direction
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
CUInt
result <- Ptr Keymap -> IO CUInt
gdk_keymap_get_direction Ptr Keymap
keymap'
let result' :: Direction
result' = (Int -> Direction
forall a. Enum a => Int -> a
toEnum (Int -> Direction) -> (CUInt -> Int) -> CUInt -> Direction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Direction -> IO Direction
forall (m :: * -> *) a. Monad m => a -> m a
return Direction
result'
#if defined(ENABLE_OVERLOADING)
data KeymapGetDirectionMethodInfo
instance (signature ~ (m Pango.Enums.Direction), MonadIO m, IsKeymap a) => O.MethodInfo KeymapGetDirectionMethodInfo a signature where
overloadedMethod = keymapGetDirection
#endif
foreign import ccall "gdk_keymap_get_entries_for_keycode" gdk_keymap_get_entries_for_keycode ::
Ptr Keymap ->
Word32 ->
Ptr (Ptr Gdk.KeymapKey.KeymapKey) ->
Ptr (Ptr Word32) ->
Ptr Int32 ->
IO CInt
keymapGetEntriesForKeycode ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> Word32
-> m ((Bool, [Gdk.KeymapKey.KeymapKey], [Word32]))
keymapGetEntriesForKeycode :: a -> Word32 -> m (Bool, [KeymapKey], [Word32])
keymapGetEntriesForKeycode a
keymap Word32
hardwareKeycode = IO (Bool, [KeymapKey], [Word32]) -> m (Bool, [KeymapKey], [Word32])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, [KeymapKey], [Word32])
-> m (Bool, [KeymapKey], [Word32]))
-> IO (Bool, [KeymapKey], [Word32])
-> m (Bool, [KeymapKey], [Word32])
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
Ptr (Ptr KeymapKey)
keys <- IO (Ptr (Ptr KeymapKey))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gdk.KeymapKey.KeymapKey))
Ptr (Ptr Word32)
keyvals <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
Ptr Int32
nEntries <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CInt
result <- Ptr Keymap
-> Word32
-> Ptr (Ptr KeymapKey)
-> Ptr (Ptr Word32)
-> Ptr Int32
-> IO CInt
gdk_keymap_get_entries_for_keycode Ptr Keymap
keymap' Word32
hardwareKeycode Ptr (Ptr KeymapKey)
keys Ptr (Ptr Word32)
keyvals Ptr Int32
nEntries
Int32
nEntries' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
nEntries
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Ptr KeymapKey
keys' <- Ptr (Ptr KeymapKey) -> IO (Ptr KeymapKey)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr KeymapKey)
keys
[Ptr KeymapKey]
keys'' <- (Int -> Int32 -> Ptr KeymapKey -> IO [Ptr KeymapKey]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
12 Int32
nEntries') Ptr KeymapKey
keys'
[KeymapKey]
keys''' <- (Ptr KeymapKey -> IO KeymapKey)
-> [Ptr KeymapKey] -> IO [KeymapKey]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr KeymapKey -> KeymapKey)
-> Ptr KeymapKey -> IO KeymapKey
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr KeymapKey -> KeymapKey
Gdk.KeymapKey.KeymapKey) [Ptr KeymapKey]
keys''
Ptr KeymapKey -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr KeymapKey
keys'
Ptr Word32
keyvals' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
keyvals
[Word32]
keyvals'' <- (Int32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Int32
nEntries') Ptr Word32
keyvals'
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
keyvals'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Ptr (Ptr KeymapKey) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr KeymapKey)
keys
Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
keyvals
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
nEntries
(Bool, [KeymapKey], [Word32]) -> IO (Bool, [KeymapKey], [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', [KeymapKey]
keys''', [Word32]
keyvals'')
#if defined(ENABLE_OVERLOADING)
data KeymapGetEntriesForKeycodeMethodInfo
instance (signature ~ (Word32 -> m ((Bool, [Gdk.KeymapKey.KeymapKey], [Word32]))), MonadIO m, IsKeymap a) => O.MethodInfo KeymapGetEntriesForKeycodeMethodInfo a signature where
overloadedMethod = keymapGetEntriesForKeycode
#endif
foreign import ccall "gdk_keymap_get_entries_for_keyval" gdk_keymap_get_entries_for_keyval ::
Ptr Keymap ->
Word32 ->
Ptr (Ptr Gdk.KeymapKey.KeymapKey) ->
Ptr Int32 ->
IO CInt
keymapGetEntriesForKeyval ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> Word32
-> m ((Bool, [Gdk.KeymapKey.KeymapKey]))
keymapGetEntriesForKeyval :: a -> Word32 -> m (Bool, [KeymapKey])
keymapGetEntriesForKeyval a
keymap Word32
keyval = IO (Bool, [KeymapKey]) -> m (Bool, [KeymapKey])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, [KeymapKey]) -> m (Bool, [KeymapKey]))
-> IO (Bool, [KeymapKey]) -> m (Bool, [KeymapKey])
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
Ptr (Ptr KeymapKey)
keys <- IO (Ptr (Ptr KeymapKey))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gdk.KeymapKey.KeymapKey))
Ptr Int32
nKeys <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CInt
result <- Ptr Keymap -> Word32 -> Ptr (Ptr KeymapKey) -> Ptr Int32 -> IO CInt
gdk_keymap_get_entries_for_keyval Ptr Keymap
keymap' Word32
keyval Ptr (Ptr KeymapKey)
keys Ptr Int32
nKeys
Int32
nKeys' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
nKeys
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Ptr KeymapKey
keys' <- Ptr (Ptr KeymapKey) -> IO (Ptr KeymapKey)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr KeymapKey)
keys
[Ptr KeymapKey]
keys'' <- (Int -> Int32 -> Ptr KeymapKey -> IO [Ptr KeymapKey]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
12 Int32
nKeys') Ptr KeymapKey
keys'
[KeymapKey]
keys''' <- (Ptr KeymapKey -> IO KeymapKey)
-> [Ptr KeymapKey] -> IO [KeymapKey]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr KeymapKey -> KeymapKey)
-> Ptr KeymapKey -> IO KeymapKey
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr KeymapKey -> KeymapKey
Gdk.KeymapKey.KeymapKey) [Ptr KeymapKey]
keys''
Ptr KeymapKey -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr KeymapKey
keys'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Ptr (Ptr KeymapKey) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr KeymapKey)
keys
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
nKeys
(Bool, [KeymapKey]) -> IO (Bool, [KeymapKey])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', [KeymapKey]
keys''')
#if defined(ENABLE_OVERLOADING)
data KeymapGetEntriesForKeyvalMethodInfo
instance (signature ~ (Word32 -> m ((Bool, [Gdk.KeymapKey.KeymapKey]))), MonadIO m, IsKeymap a) => O.MethodInfo KeymapGetEntriesForKeyvalMethodInfo a signature where
overloadedMethod = keymapGetEntriesForKeyval
#endif
foreign import ccall "gdk_keymap_get_modifier_mask" gdk_keymap_get_modifier_mask ::
Ptr Keymap ->
CUInt ->
IO CUInt
keymapGetModifierMask ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> Gdk.Enums.ModifierIntent
-> m [Gdk.Flags.ModifierType]
keymapGetModifierMask :: a -> ModifierIntent -> m [ModifierType]
keymapGetModifierMask a
keymap ModifierIntent
intent = IO [ModifierType] -> m [ModifierType]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ModifierType] -> m [ModifierType])
-> IO [ModifierType] -> m [ModifierType]
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
let intent' :: CUInt
intent' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (ModifierIntent -> Int) -> ModifierIntent -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ModifierIntent -> Int
forall a. Enum a => a -> Int
fromEnum) ModifierIntent
intent
CUInt
result <- Ptr Keymap -> CUInt -> IO CUInt
gdk_keymap_get_modifier_mask Ptr Keymap
keymap' CUInt
intent'
let result' :: [ModifierType]
result' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
[ModifierType] -> IO [ModifierType]
forall (m :: * -> *) a. Monad m => a -> m a
return [ModifierType]
result'
#if defined(ENABLE_OVERLOADING)
data KeymapGetModifierMaskMethodInfo
instance (signature ~ (Gdk.Enums.ModifierIntent -> m [Gdk.Flags.ModifierType]), MonadIO m, IsKeymap a) => O.MethodInfo KeymapGetModifierMaskMethodInfo a signature where
overloadedMethod = keymapGetModifierMask
#endif
foreign import ccall "gdk_keymap_get_modifier_state" gdk_keymap_get_modifier_state ::
Ptr Keymap ->
IO Word32
keymapGetModifierState ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> m Word32
keymapGetModifierState :: a -> m Word32
keymapGetModifierState a
keymap = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
Word32
result <- Ptr Keymap -> IO Word32
gdk_keymap_get_modifier_state Ptr Keymap
keymap'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data KeymapGetModifierStateMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsKeymap a) => O.MethodInfo KeymapGetModifierStateMethodInfo a signature where
overloadedMethod = keymapGetModifierState
#endif
foreign import ccall "gdk_keymap_get_num_lock_state" gdk_keymap_get_num_lock_state ::
Ptr Keymap ->
IO CInt
keymapGetNumLockState ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> m Bool
keymapGetNumLockState :: a -> m Bool
keymapGetNumLockState a
keymap = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
CInt
result <- Ptr Keymap -> IO CInt
gdk_keymap_get_num_lock_state Ptr Keymap
keymap'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data KeymapGetNumLockStateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsKeymap a) => O.MethodInfo KeymapGetNumLockStateMethodInfo a signature where
overloadedMethod = keymapGetNumLockState
#endif
foreign import ccall "gdk_keymap_get_scroll_lock_state" gdk_keymap_get_scroll_lock_state ::
Ptr Keymap ->
IO CInt
keymapGetScrollLockState ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> m Bool
keymapGetScrollLockState :: a -> m Bool
keymapGetScrollLockState a
keymap = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
CInt
result <- Ptr Keymap -> IO CInt
gdk_keymap_get_scroll_lock_state Ptr Keymap
keymap'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data KeymapGetScrollLockStateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsKeymap a) => O.MethodInfo KeymapGetScrollLockStateMethodInfo a signature where
overloadedMethod = keymapGetScrollLockState
#endif
foreign import ccall "gdk_keymap_have_bidi_layouts" gdk_keymap_have_bidi_layouts ::
Ptr Keymap ->
IO CInt
keymapHaveBidiLayouts ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> m Bool
keymapHaveBidiLayouts :: a -> m Bool
keymapHaveBidiLayouts a
keymap = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
CInt
result <- Ptr Keymap -> IO CInt
gdk_keymap_have_bidi_layouts Ptr Keymap
keymap'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data KeymapHaveBidiLayoutsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsKeymap a) => O.MethodInfo KeymapHaveBidiLayoutsMethodInfo a signature where
overloadedMethod = keymapHaveBidiLayouts
#endif
foreign import ccall "gdk_keymap_lookup_key" gdk_keymap_lookup_key ::
Ptr Keymap ->
Ptr Gdk.KeymapKey.KeymapKey ->
IO Word32
keymapLookupKey ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> Gdk.KeymapKey.KeymapKey
-> m Word32
keymapLookupKey :: a -> KeymapKey -> m Word32
keymapLookupKey a
keymap KeymapKey
key = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
Ptr KeymapKey
key' <- KeymapKey -> IO (Ptr KeymapKey)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr KeymapKey
key
Word32
result <- Ptr Keymap -> Ptr KeymapKey -> IO Word32
gdk_keymap_lookup_key Ptr Keymap
keymap' Ptr KeymapKey
key'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
KeymapKey -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr KeymapKey
key
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data KeymapLookupKeyMethodInfo
instance (signature ~ (Gdk.KeymapKey.KeymapKey -> m Word32), MonadIO m, IsKeymap a) => O.MethodInfo KeymapLookupKeyMethodInfo a signature where
overloadedMethod = keymapLookupKey
#endif
foreign import ccall "gdk_keymap_map_virtual_modifiers" gdk_keymap_map_virtual_modifiers ::
Ptr Keymap ->
Ptr CUInt ->
IO CInt
keymapMapVirtualModifiers ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> [Gdk.Flags.ModifierType]
-> m ((Bool, [Gdk.Flags.ModifierType]))
keymapMapVirtualModifiers :: a -> [ModifierType] -> m (Bool, [ModifierType])
keymapMapVirtualModifiers a
keymap [ModifierType]
state = IO (Bool, [ModifierType]) -> m (Bool, [ModifierType])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, [ModifierType]) -> m (Bool, [ModifierType]))
-> IO (Bool, [ModifierType]) -> m (Bool, [ModifierType])
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
let state' :: CUInt
state' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
state
Ptr CUInt
state'' <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
Ptr CUInt -> CUInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr CUInt
state'' CUInt
state'
CInt
result <- Ptr Keymap -> Ptr CUInt -> IO CInt
gdk_keymap_map_virtual_modifiers Ptr Keymap
keymap' Ptr CUInt
state''
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
CUInt
state''' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
state''
let state'''' :: [ModifierType]
state'''' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
state'''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
state''
(Bool, [ModifierType]) -> IO (Bool, [ModifierType])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', [ModifierType]
state'''')
#if defined(ENABLE_OVERLOADING)
data KeymapMapVirtualModifiersMethodInfo
instance (signature ~ ([Gdk.Flags.ModifierType] -> m ((Bool, [Gdk.Flags.ModifierType]))), MonadIO m, IsKeymap a) => O.MethodInfo KeymapMapVirtualModifiersMethodInfo a signature where
overloadedMethod = keymapMapVirtualModifiers
#endif
foreign import ccall "gdk_keymap_translate_keyboard_state" gdk_keymap_translate_keyboard_state ::
Ptr Keymap ->
Word32 ->
CUInt ->
Int32 ->
Ptr Word32 ->
Ptr Int32 ->
Ptr Int32 ->
Ptr CUInt ->
IO CInt
keymapTranslateKeyboardState ::
(B.CallStack.HasCallStack, MonadIO m, IsKeymap a) =>
a
-> Word32
-> [Gdk.Flags.ModifierType]
-> Int32
-> m ((Bool, Word32, Int32, Int32, [Gdk.Flags.ModifierType]))
keymapTranslateKeyboardState :: a
-> Word32
-> [ModifierType]
-> Int32
-> m (Bool, Word32, Int32, Int32, [ModifierType])
keymapTranslateKeyboardState a
keymap Word32
hardwareKeycode [ModifierType]
state Int32
group = IO (Bool, Word32, Int32, Int32, [ModifierType])
-> m (Bool, Word32, Int32, Int32, [ModifierType])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32, Int32, Int32, [ModifierType])
-> m (Bool, Word32, Int32, Int32, [ModifierType]))
-> IO (Bool, Word32, Int32, Int32, [ModifierType])
-> m (Bool, Word32, Int32, Int32, [ModifierType])
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
keymap' <- a -> IO (Ptr Keymap)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
keymap
let state' :: CUInt
state' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
state
Ptr Word32
keyval <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr Int32
effectiveGroup <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
level <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr CUInt
consumedModifiers <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
CInt
result <- Ptr Keymap
-> Word32
-> CUInt
-> Int32
-> Ptr Word32
-> Ptr Int32
-> Ptr Int32
-> Ptr CUInt
-> IO CInt
gdk_keymap_translate_keyboard_state Ptr Keymap
keymap' Word32
hardwareKeycode CUInt
state' Int32
group Ptr Word32
keyval Ptr Int32
effectiveGroup Ptr Int32
level Ptr CUInt
consumedModifiers
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word32
keyval' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
keyval
Int32
effectiveGroup' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
effectiveGroup
Int32
level' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
level
CUInt
consumedModifiers' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
consumedModifiers
let consumedModifiers'' :: [ModifierType]
consumedModifiers'' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
consumedModifiers'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
keymap
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
keyval
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
effectiveGroup
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
level
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
consumedModifiers
(Bool, Word32, Int32, Int32, [ModifierType])
-> IO (Bool, Word32, Int32, Int32, [ModifierType])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
keyval', Int32
effectiveGroup', Int32
level', [ModifierType]
consumedModifiers'')
#if defined(ENABLE_OVERLOADING)
data KeymapTranslateKeyboardStateMethodInfo
instance (signature ~ (Word32 -> [Gdk.Flags.ModifierType] -> Int32 -> m ((Bool, Word32, Int32, Int32, [Gdk.Flags.ModifierType]))), MonadIO m, IsKeymap a) => O.MethodInfo KeymapTranslateKeyboardStateMethodInfo a signature where
overloadedMethod = keymapTranslateKeyboardState
#endif
foreign import ccall "gdk_keymap_get_default" gdk_keymap_get_default ::
IO (Ptr Keymap)
{-# DEPRECATED keymapGetDefault ["(Since version 3.22)","Use 'GI.Gdk.Objects.Keymap.keymapGetForDisplay' instead"] #-}
keymapGetDefault ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Keymap
keymapGetDefault :: m Keymap
keymapGetDefault = IO Keymap -> m Keymap
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Keymap -> m Keymap) -> IO Keymap -> m Keymap
forall a b. (a -> b) -> a -> b
$ do
Ptr Keymap
result <- IO (Ptr Keymap)
gdk_keymap_get_default
Text -> Ptr Keymap -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"keymapGetDefault" Ptr Keymap
result
Keymap
result' <- ((ManagedPtr Keymap -> Keymap) -> Ptr Keymap -> IO Keymap
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Keymap -> Keymap
Keymap) Ptr Keymap
result
Keymap -> IO Keymap
forall (m :: * -> *) a. Monad m => a -> m a
return Keymap
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_keymap_get_for_display" gdk_keymap_get_for_display ::
Ptr Gdk.Display.Display ->
IO (Ptr Keymap)
keymapGetForDisplay ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
a
-> m Keymap
keymapGetForDisplay :: a -> m Keymap
keymapGetForDisplay a
display = IO Keymap -> m Keymap
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Keymap -> m Keymap) -> IO Keymap -> m Keymap
forall a b. (a -> b) -> a -> b
$ do
Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
Ptr Keymap
result <- Ptr Display -> IO (Ptr Keymap)
gdk_keymap_get_for_display Ptr Display
display'
Text -> Ptr Keymap -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"keymapGetForDisplay" Ptr Keymap
result
Keymap
result' <- ((ManagedPtr Keymap -> Keymap) -> Ptr Keymap -> IO Keymap
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Keymap -> Keymap
Keymap) Ptr Keymap
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
Keymap -> IO Keymap
forall (m :: * -> *) a. Monad m => a -> m a
return Keymap
result'
#if defined(ENABLE_OVERLOADING)
#endif