{-# LANGUAGE ImplicitParams, RankNTypes, 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 ,
KeymapDirectionChangedCallback ,
#if defined(ENABLE_OVERLOADING)
KeymapDirectionChangedSignalInfo ,
#endif
afterKeymapDirectionChanged ,
onKeymapDirectionChanged ,
KeymapKeysChangedCallback ,
#if defined(ENABLE_OVERLOADING)
KeymapKeysChangedSignalInfo ,
#endif
afterKeymapKeysChanged ,
onKeymapKeysChanged ,
KeymapStateChangedCallback ,
#if defined(ENABLE_OVERLOADING)
KeymapStateChangedSignalInfo ,
#endif
afterKeymapStateChanged ,
onKeymapStateChanged ,
) 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.GArray as B.GArray
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.Coerce as Coerce
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 GHC.Records as R
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
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 :: (MIO.MonadIO m, IsKeymap o) => o -> m Keymap
toKeymap :: forall (m :: * -> *) o. (MonadIO m, IsKeymap o) => o -> m Keymap
toKeymap = IO Keymap -> m Keymap
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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'
B.ManagedPtr.unsafeCastTo ManagedPtr Keymap -> Keymap
Keymap
instance B.GValue.IsGValue (Maybe Keymap) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_keymap_get_type
gvalueSet_ :: Ptr GValue -> Maybe Keymap -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Keymap
P.Nothing = Ptr GValue -> Ptr Keymap -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Keymap
forall a. Ptr a
FP.nullPtr :: FP.Ptr Keymap)
gvalueSet_ Ptr GValue
gv (P.Just Keymap
obj) = Keymap -> (Ptr Keymap -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Keymap
obj (Ptr GValue -> Ptr Keymap -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Keymap)
gvalueGet_ Ptr GValue
gv = do
Ptr Keymap
ptr <- Ptr GValue -> IO (Ptr Keymap)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Keymap)
if Ptr Keymap
ptr Ptr Keymap -> Ptr Keymap -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Keymap
forall a. Ptr a
FP.nullPtr
then Keymap -> Maybe Keymap
forall a. a -> Maybe a
P.Just (Keymap -> Maybe Keymap) -> IO Keymap -> IO (Maybe Keymap)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (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
else Maybe Keymap -> IO (Maybe Keymap)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Keymap
forall a. Maybe a
P.Nothing
#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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveKeymapMethod t Keymap, O.OverloadedMethod info Keymap p, R.HasField t Keymap p) => R.HasField t Keymap p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveKeymapMethod t Keymap, O.OverloadedMethodInfo info Keymap) => OL.IsLabel t (O.MethodProxy info Keymap) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type KeymapDirectionChangedCallback =
IO ()
type C_KeymapDirectionChangedCallback =
Ptr Keymap ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_KeymapDirectionChangedCallback :: C_KeymapDirectionChangedCallback -> IO (FunPtr C_KeymapDirectionChangedCallback)
wrap_KeymapDirectionChangedCallback ::
GObject a => (a -> KeymapDirectionChangedCallback) ->
C_KeymapDirectionChangedCallback
wrap_KeymapDirectionChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_KeymapDirectionChangedCallback
wrap_KeymapDirectionChangedCallback a -> IO ()
gi'cb Ptr Keymap
gi'selfPtr Ptr ()
_ = do
Ptr Keymap -> (Keymap -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Keymap
gi'selfPtr ((Keymap -> IO ()) -> IO ()) -> (Keymap -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Keymap
gi'self -> a -> IO ()
gi'cb (Keymap -> a
Coerce.coerce Keymap
gi'self)
onKeymapDirectionChanged :: (IsKeymap a, MonadIO m) => a -> ((?self :: a) => KeymapDirectionChangedCallback) -> m SignalHandlerId
onKeymapDirectionChanged :: forall a (m :: * -> *).
(IsKeymap a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onKeymapDirectionChanged a
obj (?self::a) => 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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_KeymapDirectionChangedCallback
wrapped' = (a -> IO ()) -> C_KeymapDirectionChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_KeymapDirectionChangedCallback
wrap_KeymapDirectionChangedCallback a -> IO ()
wrapped
FunPtr C_KeymapDirectionChangedCallback
wrapped'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapDirectionChangedCallback C_KeymapDirectionChangedCallback
wrapped'
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
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterKeymapDirectionChanged :: (IsKeymap a, MonadIO m) => a -> ((?self :: a) => KeymapDirectionChangedCallback) -> m SignalHandlerId
afterKeymapDirectionChanged :: forall a (m :: * -> *).
(IsKeymap a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterKeymapDirectionChanged a
obj (?self::a) => 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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_KeymapDirectionChangedCallback
wrapped' = (a -> IO ()) -> C_KeymapDirectionChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_KeymapDirectionChangedCallback
wrap_KeymapDirectionChangedCallback a -> IO ()
wrapped
FunPtr C_KeymapDirectionChangedCallback
wrapped'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapDirectionChangedCallback C_KeymapDirectionChangedCallback
wrapped'
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
wrapped'' 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap::direction-changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#g:signal:directionChanged"})
#endif
type KeymapKeysChangedCallback =
IO ()
type C_KeymapKeysChangedCallback =
Ptr Keymap ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_KeymapKeysChangedCallback :: C_KeymapKeysChangedCallback -> IO (FunPtr C_KeymapKeysChangedCallback)
wrap_KeymapKeysChangedCallback ::
GObject a => (a -> KeymapKeysChangedCallback) ->
C_KeymapKeysChangedCallback
wrap_KeymapKeysChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_KeymapDirectionChangedCallback
wrap_KeymapKeysChangedCallback a -> IO ()
gi'cb Ptr Keymap
gi'selfPtr Ptr ()
_ = do
Ptr Keymap -> (Keymap -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Keymap
gi'selfPtr ((Keymap -> IO ()) -> IO ()) -> (Keymap -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Keymap
gi'self -> a -> IO ()
gi'cb (Keymap -> a
Coerce.coerce Keymap
gi'self)
onKeymapKeysChanged :: (IsKeymap a, MonadIO m) => a -> ((?self :: a) => KeymapKeysChangedCallback) -> m SignalHandlerId
onKeymapKeysChanged :: forall a (m :: * -> *).
(IsKeymap a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onKeymapKeysChanged a
obj (?self::a) => 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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_KeymapDirectionChangedCallback
wrapped' = (a -> IO ()) -> C_KeymapDirectionChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_KeymapDirectionChangedCallback
wrap_KeymapKeysChangedCallback a -> IO ()
wrapped
FunPtr C_KeymapDirectionChangedCallback
wrapped'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapKeysChangedCallback C_KeymapDirectionChangedCallback
wrapped'
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
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterKeymapKeysChanged :: (IsKeymap a, MonadIO m) => a -> ((?self :: a) => KeymapKeysChangedCallback) -> m SignalHandlerId
afterKeymapKeysChanged :: forall a (m :: * -> *).
(IsKeymap a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterKeymapKeysChanged a
obj (?self::a) => 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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_KeymapDirectionChangedCallback
wrapped' = (a -> IO ()) -> C_KeymapDirectionChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_KeymapDirectionChangedCallback
wrap_KeymapKeysChangedCallback a -> IO ()
wrapped
FunPtr C_KeymapDirectionChangedCallback
wrapped'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapKeysChangedCallback C_KeymapDirectionChangedCallback
wrapped'
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
wrapped'' 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap::keys-changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#g:signal:keysChanged"})
#endif
type KeymapStateChangedCallback =
IO ()
type C_KeymapStateChangedCallback =
Ptr Keymap ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_KeymapStateChangedCallback :: C_KeymapStateChangedCallback -> IO (FunPtr C_KeymapStateChangedCallback)
wrap_KeymapStateChangedCallback ::
GObject a => (a -> KeymapStateChangedCallback) ->
C_KeymapStateChangedCallback
wrap_KeymapStateChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_KeymapDirectionChangedCallback
wrap_KeymapStateChangedCallback a -> IO ()
gi'cb Ptr Keymap
gi'selfPtr Ptr ()
_ = do
Ptr Keymap -> (Keymap -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Keymap
gi'selfPtr ((Keymap -> IO ()) -> IO ()) -> (Keymap -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Keymap
gi'self -> a -> IO ()
gi'cb (Keymap -> a
Coerce.coerce Keymap
gi'self)
onKeymapStateChanged :: (IsKeymap a, MonadIO m) => a -> ((?self :: a) => KeymapStateChangedCallback) -> m SignalHandlerId
onKeymapStateChanged :: forall a (m :: * -> *).
(IsKeymap a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onKeymapStateChanged a
obj (?self::a) => 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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_KeymapDirectionChangedCallback
wrapped' = (a -> IO ()) -> C_KeymapDirectionChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_KeymapDirectionChangedCallback
wrap_KeymapStateChangedCallback a -> IO ()
wrapped
FunPtr C_KeymapDirectionChangedCallback
wrapped'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapStateChangedCallback C_KeymapDirectionChangedCallback
wrapped'
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
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterKeymapStateChanged :: (IsKeymap a, MonadIO m) => a -> ((?self :: a) => KeymapStateChangedCallback) -> m SignalHandlerId
afterKeymapStateChanged :: forall a (m :: * -> *).
(IsKeymap a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterKeymapStateChanged a
obj (?self::a) => 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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_KeymapDirectionChangedCallback
wrapped' = (a -> IO ()) -> C_KeymapDirectionChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_KeymapDirectionChangedCallback
wrap_KeymapStateChangedCallback a -> IO ()
wrapped
FunPtr C_KeymapDirectionChangedCallback
wrapped'' <- C_KeymapDirectionChangedCallback
-> IO (FunPtr C_KeymapDirectionChangedCallback)
mk_KeymapStateChangedCallback C_KeymapDirectionChangedCallback
wrapped'
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
wrapped'' 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap::state-changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#g:signal:stateChanged"})
#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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapAddVirtualModifiersMethodInfo a signature where
overloadedMethod = keymapAddVirtualModifiers
instance O.OverloadedMethodInfo KeymapAddVirtualModifiersMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapAddVirtualModifiers",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapGetCapsLockStateMethodInfo a signature where
overloadedMethod = keymapGetCapsLockState
instance O.OverloadedMethodInfo KeymapGetCapsLockStateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapGetCapsLockState",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapGetDirectionMethodInfo a signature where
overloadedMethod = keymapGetDirection
instance O.OverloadedMethodInfo KeymapGetDirectionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapGetDirection",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapGetEntriesForKeycodeMethodInfo a signature where
overloadedMethod = keymapGetEntriesForKeycode
instance O.OverloadedMethodInfo KeymapGetEntriesForKeycodeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapGetEntriesForKeycode",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapGetEntriesForKeyvalMethodInfo a signature where
overloadedMethod = keymapGetEntriesForKeyval
instance O.OverloadedMethodInfo KeymapGetEntriesForKeyvalMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapGetEntriesForKeyval",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapGetModifierMaskMethodInfo a signature where
overloadedMethod = keymapGetModifierMask
instance O.OverloadedMethodInfo KeymapGetModifierMaskMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapGetModifierMask",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapGetModifierStateMethodInfo a signature where
overloadedMethod = keymapGetModifierState
instance O.OverloadedMethodInfo KeymapGetModifierStateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapGetModifierState",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapGetNumLockStateMethodInfo a signature where
overloadedMethod = keymapGetNumLockState
instance O.OverloadedMethodInfo KeymapGetNumLockStateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapGetNumLockState",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapGetScrollLockStateMethodInfo a signature where
overloadedMethod = keymapGetScrollLockState
instance O.OverloadedMethodInfo KeymapGetScrollLockStateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapGetScrollLockState",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapHaveBidiLayoutsMethodInfo a signature where
overloadedMethod = keymapHaveBidiLayouts
instance O.OverloadedMethodInfo KeymapHaveBidiLayoutsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapHaveBidiLayouts",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapLookupKeyMethodInfo a signature where
overloadedMethod = keymapLookupKey
instance O.OverloadedMethodInfo KeymapLookupKeyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapLookupKey",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapMapVirtualModifiersMethodInfo a signature where
overloadedMethod = keymapMapVirtualModifiers
instance O.OverloadedMethodInfo KeymapMapVirtualModifiersMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapMapVirtualModifiers",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsKeymap a) =>
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.OverloadedMethod KeymapTranslateKeyboardStateMethodInfo a signature where
overloadedMethod = keymapTranslateKeyboardState
instance O.OverloadedMethodInfo KeymapTranslateKeyboardStateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Keymap.keymapTranslateKeyboardState",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.25/docs/GI-Gdk-Objects-Keymap.html#v: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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDisplay a) =>
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