{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Dazzle.Structs.ShortcutChord
(
ShortcutChord(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveShortcutChordMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ShortcutChordAppendEventMethodInfo ,
#endif
shortcutChordAppendEvent ,
#if defined(ENABLE_OVERLOADING)
ShortcutChordCopyMethodInfo ,
#endif
shortcutChordCopy ,
shortcutChordEqual ,
#if defined(ENABLE_OVERLOADING)
ShortcutChordFreeMethodInfo ,
#endif
shortcutChordFree ,
#if defined(ENABLE_OVERLOADING)
ShortcutChordGetLabelMethodInfo ,
#endif
shortcutChordGetLabel ,
#if defined(ENABLE_OVERLOADING)
ShortcutChordGetLengthMethodInfo ,
#endif
shortcutChordGetLength ,
#if defined(ENABLE_OVERLOADING)
ShortcutChordGetNthKeyMethodInfo ,
#endif
shortcutChordGetNthKey ,
#if defined(ENABLE_OVERLOADING)
ShortcutChordHasModifierMethodInfo ,
#endif
shortcutChordHasModifier ,
shortcutChordHash ,
#if defined(ENABLE_OVERLOADING)
ShortcutChordMatchMethodInfo ,
#endif
shortcutChordMatch ,
shortcutChordNewFromEvent ,
shortcutChordNewFromString ,
#if defined(ENABLE_OVERLOADING)
ShortcutChordToStringMethodInfo ,
#endif
shortcutChordToString ,
) 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.GHashTable as B.GHT
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.Kind as DK
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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import {-# SOURCE #-} qualified GI.Dazzle.Enums as Dazzle.Enums
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Structs.EventKey as Gdk.EventKey
#else
import {-# SOURCE #-} qualified GI.Dazzle.Enums as Dazzle.Enums
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Structs.EventKey as Gdk.EventKey
#endif
newtype ShortcutChord = ShortcutChord (SP.ManagedPtr ShortcutChord)
deriving (ShortcutChord -> ShortcutChord -> Bool
(ShortcutChord -> ShortcutChord -> Bool)
-> (ShortcutChord -> ShortcutChord -> Bool) -> Eq ShortcutChord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ShortcutChord -> ShortcutChord -> Bool
== :: ShortcutChord -> ShortcutChord -> Bool
$c/= :: ShortcutChord -> ShortcutChord -> Bool
/= :: ShortcutChord -> ShortcutChord -> Bool
Eq)
instance SP.ManagedPtrNewtype ShortcutChord where
toManagedPtr :: ShortcutChord -> ManagedPtr ShortcutChord
toManagedPtr (ShortcutChord ManagedPtr ShortcutChord
p) = ManagedPtr ShortcutChord
p
foreign import ccall "dzl_shortcut_chord_get_type" c_dzl_shortcut_chord_get_type ::
IO GType
type instance O.ParentTypes ShortcutChord = '[]
instance O.HasParentTypes ShortcutChord
instance B.Types.TypedObject ShortcutChord where
glibType :: IO GType
glibType = IO GType
c_dzl_shortcut_chord_get_type
instance B.Types.GBoxed ShortcutChord
instance B.GValue.IsGValue (Maybe ShortcutChord) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_dzl_shortcut_chord_get_type
gvalueSet_ :: Ptr GValue -> Maybe ShortcutChord -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ShortcutChord
P.Nothing = Ptr GValue -> Ptr ShortcutChord -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr ShortcutChord
forall a. Ptr a
FP.nullPtr :: FP.Ptr ShortcutChord)
gvalueSet_ Ptr GValue
gv (P.Just ShortcutChord
obj) = ShortcutChord -> (Ptr ShortcutChord -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ShortcutChord
obj (Ptr GValue -> Ptr ShortcutChord -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe ShortcutChord)
gvalueGet_ Ptr GValue
gv = do
Ptr ShortcutChord
ptr <- Ptr GValue -> IO (Ptr ShortcutChord)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr ShortcutChord)
if Ptr ShortcutChord
ptr Ptr ShortcutChord -> Ptr ShortcutChord -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr ShortcutChord
forall a. Ptr a
FP.nullPtr
then ShortcutChord -> Maybe ShortcutChord
forall a. a -> Maybe a
P.Just (ShortcutChord -> Maybe ShortcutChord)
-> IO ShortcutChord -> IO (Maybe ShortcutChord)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr ShortcutChord -> ShortcutChord)
-> Ptr ShortcutChord -> IO ShortcutChord
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr ShortcutChord -> ShortcutChord
ShortcutChord Ptr ShortcutChord
ptr
else Maybe ShortcutChord -> IO (Maybe ShortcutChord)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ShortcutChord
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ShortcutChord
type instance O.AttributeList ShortcutChord = ShortcutChordAttributeList
type ShortcutChordAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "dzl_shortcut_chord_new_from_event" dzl_shortcut_chord_new_from_event ::
Ptr Gdk.EventKey.EventKey ->
IO (Ptr ShortcutChord)
shortcutChordNewFromEvent ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gdk.EventKey.EventKey
-> m ShortcutChord
shortcutChordNewFromEvent :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
EventKey -> m ShortcutChord
shortcutChordNewFromEvent EventKey
event = IO ShortcutChord -> m ShortcutChord
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ShortcutChord -> m ShortcutChord)
-> IO ShortcutChord -> m ShortcutChord
forall a b. (a -> b) -> a -> b
$ do
Ptr EventKey
event' <- EventKey -> IO (Ptr EventKey)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr EventKey
event
Ptr ShortcutChord
result <- Ptr EventKey -> IO (Ptr ShortcutChord)
dzl_shortcut_chord_new_from_event Ptr EventKey
event'
Text -> Ptr ShortcutChord -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shortcutChordNewFromEvent" Ptr ShortcutChord
result
ShortcutChord
result' <- ((ManagedPtr ShortcutChord -> ShortcutChord)
-> Ptr ShortcutChord -> IO ShortcutChord
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ShortcutChord -> ShortcutChord
ShortcutChord) Ptr ShortcutChord
result
EventKey -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr EventKey
event
ShortcutChord -> IO ShortcutChord
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ShortcutChord
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "dzl_shortcut_chord_new_from_string" dzl_shortcut_chord_new_from_string ::
CString ->
IO (Ptr ShortcutChord)
shortcutChordNewFromString ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ShortcutChord
shortcutChordNewFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m ShortcutChord
shortcutChordNewFromString Text
accelerator = IO ShortcutChord -> m ShortcutChord
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ShortcutChord -> m ShortcutChord)
-> IO ShortcutChord -> m ShortcutChord
forall a b. (a -> b) -> a -> b
$ do
CString
accelerator' <- Text -> IO CString
textToCString Text
accelerator
Ptr ShortcutChord
result <- CString -> IO (Ptr ShortcutChord)
dzl_shortcut_chord_new_from_string CString
accelerator'
Text -> Ptr ShortcutChord -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shortcutChordNewFromString" Ptr ShortcutChord
result
ShortcutChord
result' <- ((ManagedPtr ShortcutChord -> ShortcutChord)
-> Ptr ShortcutChord -> IO ShortcutChord
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ShortcutChord -> ShortcutChord
ShortcutChord) Ptr ShortcutChord
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
accelerator'
ShortcutChord -> IO ShortcutChord
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ShortcutChord
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "dzl_shortcut_chord_append_event" dzl_shortcut_chord_append_event ::
Ptr ShortcutChord ->
Ptr Gdk.EventKey.EventKey ->
IO CInt
shortcutChordAppendEvent ::
(B.CallStack.HasCallStack, MonadIO m) =>
ShortcutChord
-> Gdk.EventKey.EventKey
-> m Bool
shortcutChordAppendEvent :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShortcutChord -> EventKey -> m Bool
shortcutChordAppendEvent ShortcutChord
self EventKey
event = IO Bool -> m Bool
forall a. IO a -> m a
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 ShortcutChord
self' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
self
Ptr EventKey
event' <- EventKey -> IO (Ptr EventKey)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr EventKey
event
CInt
result <- Ptr ShortcutChord -> Ptr EventKey -> IO CInt
dzl_shortcut_chord_append_event Ptr ShortcutChord
self' Ptr EventKey
event'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
self
EventKey -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr EventKey
event
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ShortcutChordAppendEventMethodInfo
instance (signature ~ (Gdk.EventKey.EventKey -> m Bool), MonadIO m) => O.OverloadedMethod ShortcutChordAppendEventMethodInfo ShortcutChord signature where
overloadedMethod = shortcutChordAppendEvent
instance O.OverloadedMethodInfo ShortcutChordAppendEventMethodInfo ShortcutChord where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Dazzle.Structs.ShortcutChord.shortcutChordAppendEvent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-ShortcutChord.html#v:shortcutChordAppendEvent"
})
#endif
foreign import ccall "dzl_shortcut_chord_copy" dzl_shortcut_chord_copy ::
Ptr ShortcutChord ->
IO (Ptr ShortcutChord)
shortcutChordCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
ShortcutChord
-> m ShortcutChord
shortcutChordCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShortcutChord -> m ShortcutChord
shortcutChordCopy ShortcutChord
self = IO ShortcutChord -> m ShortcutChord
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ShortcutChord -> m ShortcutChord)
-> IO ShortcutChord -> m ShortcutChord
forall a b. (a -> b) -> a -> b
$ do
Ptr ShortcutChord
self' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
self
Ptr ShortcutChord
result <- Ptr ShortcutChord -> IO (Ptr ShortcutChord)
dzl_shortcut_chord_copy Ptr ShortcutChord
self'
Text -> Ptr ShortcutChord -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shortcutChordCopy" Ptr ShortcutChord
result
ShortcutChord
result' <- ((ManagedPtr ShortcutChord -> ShortcutChord)
-> Ptr ShortcutChord -> IO ShortcutChord
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ShortcutChord -> ShortcutChord
ShortcutChord) Ptr ShortcutChord
result
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
self
ShortcutChord -> IO ShortcutChord
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ShortcutChord
result'
#if defined(ENABLE_OVERLOADING)
data ShortcutChordCopyMethodInfo
instance (signature ~ (m ShortcutChord), MonadIO m) => O.OverloadedMethod ShortcutChordCopyMethodInfo ShortcutChord signature where
overloadedMethod = shortcutChordCopy
instance O.OverloadedMethodInfo ShortcutChordCopyMethodInfo ShortcutChord where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Dazzle.Structs.ShortcutChord.shortcutChordCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-ShortcutChord.html#v:shortcutChordCopy"
})
#endif
foreign import ccall "dzl_shortcut_chord_free" dzl_shortcut_chord_free ::
Ptr ShortcutChord ->
IO ()
shortcutChordFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
ShortcutChord
-> m ()
shortcutChordFree :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShortcutChord -> m ()
shortcutChordFree ShortcutChord
self = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ShortcutChord
self' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
self
Ptr ShortcutChord -> IO ()
dzl_shortcut_chord_free Ptr ShortcutChord
self'
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
self
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ShortcutChordFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod ShortcutChordFreeMethodInfo ShortcutChord signature where
overloadedMethod = shortcutChordFree
instance O.OverloadedMethodInfo ShortcutChordFreeMethodInfo ShortcutChord where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Dazzle.Structs.ShortcutChord.shortcutChordFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-ShortcutChord.html#v:shortcutChordFree"
})
#endif
foreign import ccall "dzl_shortcut_chord_get_label" dzl_shortcut_chord_get_label ::
Ptr ShortcutChord ->
IO CString
shortcutChordGetLabel ::
(B.CallStack.HasCallStack, MonadIO m) =>
ShortcutChord
-> m T.Text
shortcutChordGetLabel :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShortcutChord -> m Text
shortcutChordGetLabel ShortcutChord
self = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr ShortcutChord
self' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
self
CString
result <- Ptr ShortcutChord -> IO CString
dzl_shortcut_chord_get_label Ptr ShortcutChord
self'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shortcutChordGetLabel" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
self
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data ShortcutChordGetLabelMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod ShortcutChordGetLabelMethodInfo ShortcutChord signature where
overloadedMethod = shortcutChordGetLabel
instance O.OverloadedMethodInfo ShortcutChordGetLabelMethodInfo ShortcutChord where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Dazzle.Structs.ShortcutChord.shortcutChordGetLabel",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-ShortcutChord.html#v:shortcutChordGetLabel"
})
#endif
foreign import ccall "dzl_shortcut_chord_get_length" dzl_shortcut_chord_get_length ::
Ptr ShortcutChord ->
IO Word32
shortcutChordGetLength ::
(B.CallStack.HasCallStack, MonadIO m) =>
ShortcutChord
-> m Word32
shortcutChordGetLength :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShortcutChord -> m Word32
shortcutChordGetLength ShortcutChord
self = IO Word32 -> m Word32
forall a. IO a -> m a
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 ShortcutChord
self' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
self
Word32
result <- Ptr ShortcutChord -> IO Word32
dzl_shortcut_chord_get_length Ptr ShortcutChord
self'
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
self
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data ShortcutChordGetLengthMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.OverloadedMethod ShortcutChordGetLengthMethodInfo ShortcutChord signature where
overloadedMethod = shortcutChordGetLength
instance O.OverloadedMethodInfo ShortcutChordGetLengthMethodInfo ShortcutChord where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Dazzle.Structs.ShortcutChord.shortcutChordGetLength",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-ShortcutChord.html#v:shortcutChordGetLength"
})
#endif
foreign import ccall "dzl_shortcut_chord_get_nth_key" dzl_shortcut_chord_get_nth_key ::
Ptr ShortcutChord ->
Word32 ->
Word32 ->
CUInt ->
IO ()
shortcutChordGetNthKey ::
(B.CallStack.HasCallStack, MonadIO m) =>
ShortcutChord
-> Word32
-> Word32
-> [Gdk.Flags.ModifierType]
-> m ()
shortcutChordGetNthKey :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShortcutChord -> Word32 -> Word32 -> [ModifierType] -> m ()
shortcutChordGetNthKey ShortcutChord
self Word32
nth Word32
keyval [ModifierType]
modifier = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ShortcutChord
self' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
self
let modifier' :: CUInt
modifier' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
modifier
Ptr ShortcutChord -> Word32 -> Word32 -> CUInt -> IO ()
dzl_shortcut_chord_get_nth_key Ptr ShortcutChord
self' Word32
nth Word32
keyval CUInt
modifier'
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
self
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ShortcutChordGetNthKeyMethodInfo
instance (signature ~ (Word32 -> Word32 -> [Gdk.Flags.ModifierType] -> m ()), MonadIO m) => O.OverloadedMethod ShortcutChordGetNthKeyMethodInfo ShortcutChord signature where
overloadedMethod = shortcutChordGetNthKey
instance O.OverloadedMethodInfo ShortcutChordGetNthKeyMethodInfo ShortcutChord where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Dazzle.Structs.ShortcutChord.shortcutChordGetNthKey",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-ShortcutChord.html#v:shortcutChordGetNthKey"
})
#endif
foreign import ccall "dzl_shortcut_chord_has_modifier" dzl_shortcut_chord_has_modifier ::
Ptr ShortcutChord ->
IO CInt
shortcutChordHasModifier ::
(B.CallStack.HasCallStack, MonadIO m) =>
ShortcutChord
-> m Bool
shortcutChordHasModifier :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShortcutChord -> m Bool
shortcutChordHasModifier ShortcutChord
self = IO Bool -> m Bool
forall a. IO a -> m a
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 ShortcutChord
self' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
self
CInt
result <- Ptr ShortcutChord -> IO CInt
dzl_shortcut_chord_has_modifier Ptr ShortcutChord
self'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
self
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ShortcutChordHasModifierMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod ShortcutChordHasModifierMethodInfo ShortcutChord signature where
overloadedMethod = shortcutChordHasModifier
instance O.OverloadedMethodInfo ShortcutChordHasModifierMethodInfo ShortcutChord where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Dazzle.Structs.ShortcutChord.shortcutChordHasModifier",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-ShortcutChord.html#v:shortcutChordHasModifier"
})
#endif
foreign import ccall "dzl_shortcut_chord_match" dzl_shortcut_chord_match ::
Ptr ShortcutChord ->
Ptr ShortcutChord ->
IO CUInt
shortcutChordMatch ::
(B.CallStack.HasCallStack, MonadIO m) =>
ShortcutChord
-> ShortcutChord
-> m Dazzle.Enums.ShortcutMatch
shortcutChordMatch :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShortcutChord -> ShortcutChord -> m ShortcutMatch
shortcutChordMatch ShortcutChord
self ShortcutChord
other = IO ShortcutMatch -> m ShortcutMatch
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ShortcutMatch -> m ShortcutMatch)
-> IO ShortcutMatch -> m ShortcutMatch
forall a b. (a -> b) -> a -> b
$ do
Ptr ShortcutChord
self' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
self
Ptr ShortcutChord
other' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
other
CUInt
result <- Ptr ShortcutChord -> Ptr ShortcutChord -> IO CUInt
dzl_shortcut_chord_match Ptr ShortcutChord
self' Ptr ShortcutChord
other'
let result' :: ShortcutMatch
result' = (Int -> ShortcutMatch
forall a. Enum a => Int -> a
toEnum (Int -> ShortcutMatch) -> (CUInt -> Int) -> CUInt -> ShortcutMatch
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
self
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
other
ShortcutMatch -> IO ShortcutMatch
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ShortcutMatch
result'
#if defined(ENABLE_OVERLOADING)
data ShortcutChordMatchMethodInfo
instance (signature ~ (ShortcutChord -> m Dazzle.Enums.ShortcutMatch), MonadIO m) => O.OverloadedMethod ShortcutChordMatchMethodInfo ShortcutChord signature where
overloadedMethod = shortcutChordMatch
instance O.OverloadedMethodInfo ShortcutChordMatchMethodInfo ShortcutChord where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Dazzle.Structs.ShortcutChord.shortcutChordMatch",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-ShortcutChord.html#v:shortcutChordMatch"
})
#endif
foreign import ccall "dzl_shortcut_chord_to_string" dzl_shortcut_chord_to_string ::
Ptr ShortcutChord ->
IO CString
shortcutChordToString ::
(B.CallStack.HasCallStack, MonadIO m) =>
ShortcutChord
-> m T.Text
shortcutChordToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShortcutChord -> m Text
shortcutChordToString ShortcutChord
self = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr ShortcutChord
self' <- ShortcutChord -> IO (Ptr ShortcutChord)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShortcutChord
self
CString
result <- Ptr ShortcutChord -> IO CString
dzl_shortcut_chord_to_string Ptr ShortcutChord
self'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shortcutChordToString" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
ShortcutChord -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShortcutChord
self
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data ShortcutChordToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod ShortcutChordToStringMethodInfo ShortcutChord signature where
overloadedMethod = shortcutChordToString
instance O.OverloadedMethodInfo ShortcutChordToStringMethodInfo ShortcutChord where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Dazzle.Structs.ShortcutChord.shortcutChordToString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-ShortcutChord.html#v:shortcutChordToString"
})
#endif
foreign import ccall "dzl_shortcut_chord_equal" dzl_shortcut_chord_equal ::
Ptr () ->
Ptr () ->
IO CInt
shortcutChordEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> Ptr ()
-> m Bool
shortcutChordEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> Ptr () -> m Bool
shortcutChordEqual Ptr ()
data1 Ptr ()
data2 = IO Bool -> m Bool
forall a. IO a -> m a
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
CInt
result <- Ptr () -> Ptr () -> IO CInt
dzl_shortcut_chord_equal Ptr ()
data1 Ptr ()
data2
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "dzl_shortcut_chord_hash" dzl_shortcut_chord_hash ::
Ptr () ->
IO Word32
shortcutChordHash ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> m Word32
shortcutChordHash :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Ptr () -> m Word32
shortcutChordHash Ptr ()
data_ = IO Word32 -> m Word32
forall a. IO a -> m a
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
Word32
result <- Ptr () -> IO Word32
dzl_shortcut_chord_hash Ptr ()
data_
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveShortcutChordMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveShortcutChordMethod "appendEvent" o = ShortcutChordAppendEventMethodInfo
ResolveShortcutChordMethod "copy" o = ShortcutChordCopyMethodInfo
ResolveShortcutChordMethod "free" o = ShortcutChordFreeMethodInfo
ResolveShortcutChordMethod "hasModifier" o = ShortcutChordHasModifierMethodInfo
ResolveShortcutChordMethod "match" o = ShortcutChordMatchMethodInfo
ResolveShortcutChordMethod "toString" o = ShortcutChordToStringMethodInfo
ResolveShortcutChordMethod "getLabel" o = ShortcutChordGetLabelMethodInfo
ResolveShortcutChordMethod "getLength" o = ShortcutChordGetLengthMethodInfo
ResolveShortcutChordMethod "getNthKey" o = ShortcutChordGetNthKeyMethodInfo
ResolveShortcutChordMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveShortcutChordMethod t ShortcutChord, O.OverloadedMethod info ShortcutChord p) => OL.IsLabel t (ShortcutChord -> 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 ~ ResolveShortcutChordMethod t ShortcutChord, O.OverloadedMethod info ShortcutChord p, R.HasField t ShortcutChord p) => R.HasField t ShortcutChord p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveShortcutChordMethod t ShortcutChord, O.OverloadedMethodInfo info ShortcutChord) => OL.IsLabel t (O.MethodProxy info ShortcutChord) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif