{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.IBus.Objects.HotkeyProfile
(
HotkeyProfile(..) ,
IsHotkeyProfile ,
toHotkeyProfile ,
#if defined(ENABLE_OVERLOADING)
ResolveHotkeyProfileMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
HotkeyProfileAddHotkeyMethodInfo ,
#endif
hotkeyProfileAddHotkey ,
#if defined(ENABLE_OVERLOADING)
HotkeyProfileAddHotkeyFromStringMethodInfo,
#endif
hotkeyProfileAddHotkeyFromString ,
#if defined(ENABLE_OVERLOADING)
HotkeyProfileFilterKeyEventMethodInfo ,
#endif
hotkeyProfileFilterKeyEvent ,
#if defined(ENABLE_OVERLOADING)
HotkeyProfileLookupHotkeyMethodInfo ,
#endif
hotkeyProfileLookupHotkey ,
hotkeyProfileNew ,
#if defined(ENABLE_OVERLOADING)
HotkeyProfileRemoveHotkeyMethodInfo ,
#endif
hotkeyProfileRemoveHotkey ,
#if defined(ENABLE_OVERLOADING)
HotkeyProfileRemoveHotkeyByEventMethodInfo,
#endif
hotkeyProfileRemoveHotkeyByEvent ,
C_HotkeyProfileTriggerCallback ,
HotkeyProfileTriggerCallback ,
#if defined(ENABLE_OVERLOADING)
HotkeyProfileTriggerSignalInfo ,
#endif
afterHotkeyProfileTrigger ,
genClosure_HotkeyProfileTrigger ,
mk_HotkeyProfileTriggerCallback ,
noHotkeyProfileTriggerCallback ,
onHotkeyProfileTrigger ,
wrap_HotkeyProfileTriggerCallback ,
) 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.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.IBus.Objects.Object as IBus.Object
import {-# SOURCE #-} qualified GI.IBus.Objects.Serializable as IBus.Serializable
newtype HotkeyProfile = HotkeyProfile (SP.ManagedPtr HotkeyProfile)
deriving (HotkeyProfile -> HotkeyProfile -> Bool
(HotkeyProfile -> HotkeyProfile -> Bool)
-> (HotkeyProfile -> HotkeyProfile -> Bool) -> Eq HotkeyProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HotkeyProfile -> HotkeyProfile -> Bool
$c/= :: HotkeyProfile -> HotkeyProfile -> Bool
== :: HotkeyProfile -> HotkeyProfile -> Bool
$c== :: HotkeyProfile -> HotkeyProfile -> Bool
Eq)
instance SP.ManagedPtrNewtype HotkeyProfile where
toManagedPtr :: HotkeyProfile -> ManagedPtr HotkeyProfile
toManagedPtr (HotkeyProfile ManagedPtr HotkeyProfile
p) = ManagedPtr HotkeyProfile
p
foreign import ccall "ibus_hotkey_profile_get_type"
c_ibus_hotkey_profile_get_type :: IO B.Types.GType
instance B.Types.TypedObject HotkeyProfile where
glibType :: IO GType
glibType = IO GType
c_ibus_hotkey_profile_get_type
instance B.Types.GObject HotkeyProfile
class (SP.GObject o, O.IsDescendantOf HotkeyProfile o) => IsHotkeyProfile o
instance (SP.GObject o, O.IsDescendantOf HotkeyProfile o) => IsHotkeyProfile o
instance O.HasParentTypes HotkeyProfile
type instance O.ParentTypes HotkeyProfile = '[IBus.Serializable.Serializable, IBus.Object.Object, GObject.Object.Object]
toHotkeyProfile :: (MIO.MonadIO m, IsHotkeyProfile o) => o -> m HotkeyProfile
toHotkeyProfile :: forall (m :: * -> *) o.
(MonadIO m, IsHotkeyProfile o) =>
o -> m HotkeyProfile
toHotkeyProfile = IO HotkeyProfile -> m HotkeyProfile
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO HotkeyProfile -> m HotkeyProfile)
-> (o -> IO HotkeyProfile) -> o -> m HotkeyProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr HotkeyProfile -> HotkeyProfile)
-> o -> IO HotkeyProfile
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr HotkeyProfile -> HotkeyProfile
HotkeyProfile
instance B.GValue.IsGValue (Maybe HotkeyProfile) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ibus_hotkey_profile_get_type
gvalueSet_ :: Ptr GValue -> Maybe HotkeyProfile -> IO ()
gvalueSet_ Ptr GValue
gv Maybe HotkeyProfile
P.Nothing = Ptr GValue -> Ptr HotkeyProfile -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr HotkeyProfile
forall a. Ptr a
FP.nullPtr :: FP.Ptr HotkeyProfile)
gvalueSet_ Ptr GValue
gv (P.Just HotkeyProfile
obj) = HotkeyProfile -> (Ptr HotkeyProfile -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr HotkeyProfile
obj (Ptr GValue -> Ptr HotkeyProfile -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe HotkeyProfile)
gvalueGet_ Ptr GValue
gv = do
Ptr HotkeyProfile
ptr <- Ptr GValue -> IO (Ptr HotkeyProfile)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr HotkeyProfile)
if Ptr HotkeyProfile
ptr Ptr HotkeyProfile -> Ptr HotkeyProfile -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr HotkeyProfile
forall a. Ptr a
FP.nullPtr
then HotkeyProfile -> Maybe HotkeyProfile
forall a. a -> Maybe a
P.Just (HotkeyProfile -> Maybe HotkeyProfile)
-> IO HotkeyProfile -> IO (Maybe HotkeyProfile)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr HotkeyProfile -> HotkeyProfile)
-> Ptr HotkeyProfile -> IO HotkeyProfile
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr HotkeyProfile -> HotkeyProfile
HotkeyProfile Ptr HotkeyProfile
ptr
else Maybe HotkeyProfile -> IO (Maybe HotkeyProfile)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe HotkeyProfile
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveHotkeyProfileMethod (t :: Symbol) (o :: *) :: * where
ResolveHotkeyProfileMethod "addHotkey" o = HotkeyProfileAddHotkeyMethodInfo
ResolveHotkeyProfileMethod "addHotkeyFromString" o = HotkeyProfileAddHotkeyFromStringMethodInfo
ResolveHotkeyProfileMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveHotkeyProfileMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveHotkeyProfileMethod "copy" o = IBus.Serializable.SerializableCopyMethodInfo
ResolveHotkeyProfileMethod "destroy" o = IBus.Object.ObjectDestroyMethodInfo
ResolveHotkeyProfileMethod "filterKeyEvent" o = HotkeyProfileFilterKeyEventMethodInfo
ResolveHotkeyProfileMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveHotkeyProfileMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveHotkeyProfileMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveHotkeyProfileMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveHotkeyProfileMethod "lookupHotkey" o = HotkeyProfileLookupHotkeyMethodInfo
ResolveHotkeyProfileMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveHotkeyProfileMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveHotkeyProfileMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveHotkeyProfileMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveHotkeyProfileMethod "removeHotkey" o = HotkeyProfileRemoveHotkeyMethodInfo
ResolveHotkeyProfileMethod "removeHotkeyByEvent" o = HotkeyProfileRemoveHotkeyByEventMethodInfo
ResolveHotkeyProfileMethod "removeQattachment" o = IBus.Serializable.SerializableRemoveQattachmentMethodInfo
ResolveHotkeyProfileMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveHotkeyProfileMethod "serializeObject" o = IBus.Serializable.SerializableSerializeObjectMethodInfo
ResolveHotkeyProfileMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveHotkeyProfileMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveHotkeyProfileMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveHotkeyProfileMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveHotkeyProfileMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveHotkeyProfileMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveHotkeyProfileMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveHotkeyProfileMethod "getQattachment" o = IBus.Serializable.SerializableGetQattachmentMethodInfo
ResolveHotkeyProfileMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveHotkeyProfileMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveHotkeyProfileMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveHotkeyProfileMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveHotkeyProfileMethod "setQattachment" o = IBus.Serializable.SerializableSetQattachmentMethodInfo
ResolveHotkeyProfileMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveHotkeyProfileMethod t HotkeyProfile, O.OverloadedMethod info HotkeyProfile p) => OL.IsLabel t (HotkeyProfile -> 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 ~ ResolveHotkeyProfileMethod t HotkeyProfile, O.OverloadedMethod info HotkeyProfile p, R.HasField t HotkeyProfile p) => R.HasField t HotkeyProfile p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveHotkeyProfileMethod t HotkeyProfile, O.OverloadedMethodInfo info HotkeyProfile) => OL.IsLabel t (O.MethodProxy info HotkeyProfile) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type HotkeyProfileTriggerCallback =
Word32
-> Ptr ()
-> IO ()
noHotkeyProfileTriggerCallback :: Maybe HotkeyProfileTriggerCallback
noHotkeyProfileTriggerCallback :: Maybe HotkeyProfileTriggerCallback
noHotkeyProfileTriggerCallback = Maybe HotkeyProfileTriggerCallback
forall a. Maybe a
Nothing
type C_HotkeyProfileTriggerCallback =
Ptr () ->
Word32 ->
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_HotkeyProfileTriggerCallback :: C_HotkeyProfileTriggerCallback -> IO (FunPtr C_HotkeyProfileTriggerCallback)
genClosure_HotkeyProfileTrigger :: MonadIO m => HotkeyProfileTriggerCallback -> m (GClosure C_HotkeyProfileTriggerCallback)
genClosure_HotkeyProfileTrigger :: forall (m :: * -> *).
MonadIO m =>
HotkeyProfileTriggerCallback
-> m (GClosure C_HotkeyProfileTriggerCallback)
genClosure_HotkeyProfileTrigger HotkeyProfileTriggerCallback
cb = IO (GClosure C_HotkeyProfileTriggerCallback)
-> m (GClosure C_HotkeyProfileTriggerCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_HotkeyProfileTriggerCallback)
-> m (GClosure C_HotkeyProfileTriggerCallback))
-> IO (GClosure C_HotkeyProfileTriggerCallback)
-> m (GClosure C_HotkeyProfileTriggerCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_HotkeyProfileTriggerCallback
cb' = HotkeyProfileTriggerCallback -> C_HotkeyProfileTriggerCallback
wrap_HotkeyProfileTriggerCallback HotkeyProfileTriggerCallback
cb
C_HotkeyProfileTriggerCallback
-> IO (FunPtr C_HotkeyProfileTriggerCallback)
mk_HotkeyProfileTriggerCallback C_HotkeyProfileTriggerCallback
cb' IO (FunPtr C_HotkeyProfileTriggerCallback)
-> (FunPtr C_HotkeyProfileTriggerCallback
-> IO (GClosure C_HotkeyProfileTriggerCallback))
-> IO (GClosure C_HotkeyProfileTriggerCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_HotkeyProfileTriggerCallback
-> IO (GClosure C_HotkeyProfileTriggerCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_HotkeyProfileTriggerCallback ::
HotkeyProfileTriggerCallback ->
C_HotkeyProfileTriggerCallback
wrap_HotkeyProfileTriggerCallback :: HotkeyProfileTriggerCallback -> C_HotkeyProfileTriggerCallback
wrap_HotkeyProfileTriggerCallback HotkeyProfileTriggerCallback
_cb Ptr ()
_ Word32
event Ptr ()
userData Ptr ()
_ = do
HotkeyProfileTriggerCallback
_cb Word32
event Ptr ()
userData
onHotkeyProfileTrigger :: (IsHotkeyProfile a, MonadIO m) => a -> P.Maybe T.Text -> HotkeyProfileTriggerCallback -> m SignalHandlerId
onHotkeyProfileTrigger :: forall a (m :: * -> *).
(IsHotkeyProfile a, MonadIO m) =>
a
-> Maybe Text -> HotkeyProfileTriggerCallback -> m SignalHandlerId
onHotkeyProfileTrigger a
obj Maybe Text
detail HotkeyProfileTriggerCallback
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_HotkeyProfileTriggerCallback
cb' = HotkeyProfileTriggerCallback -> C_HotkeyProfileTriggerCallback
wrap_HotkeyProfileTriggerCallback HotkeyProfileTriggerCallback
cb
FunPtr C_HotkeyProfileTriggerCallback
cb'' <- C_HotkeyProfileTriggerCallback
-> IO (FunPtr C_HotkeyProfileTriggerCallback)
mk_HotkeyProfileTriggerCallback C_HotkeyProfileTriggerCallback
cb'
a
-> Text
-> FunPtr C_HotkeyProfileTriggerCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"trigger" FunPtr C_HotkeyProfileTriggerCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
detail
afterHotkeyProfileTrigger :: (IsHotkeyProfile a, MonadIO m) => a -> P.Maybe T.Text -> HotkeyProfileTriggerCallback -> m SignalHandlerId
afterHotkeyProfileTrigger :: forall a (m :: * -> *).
(IsHotkeyProfile a, MonadIO m) =>
a
-> Maybe Text -> HotkeyProfileTriggerCallback -> m SignalHandlerId
afterHotkeyProfileTrigger a
obj Maybe Text
detail HotkeyProfileTriggerCallback
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_HotkeyProfileTriggerCallback
cb' = HotkeyProfileTriggerCallback -> C_HotkeyProfileTriggerCallback
wrap_HotkeyProfileTriggerCallback HotkeyProfileTriggerCallback
cb
FunPtr C_HotkeyProfileTriggerCallback
cb'' <- C_HotkeyProfileTriggerCallback
-> IO (FunPtr C_HotkeyProfileTriggerCallback)
mk_HotkeyProfileTriggerCallback C_HotkeyProfileTriggerCallback
cb'
a
-> Text
-> FunPtr C_HotkeyProfileTriggerCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"trigger" FunPtr C_HotkeyProfileTriggerCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
detail
#if defined(ENABLE_OVERLOADING)
data HotkeyProfileTriggerSignalInfo
instance SignalInfo HotkeyProfileTriggerSignalInfo where
type HaskellCallbackType HotkeyProfileTriggerSignalInfo = HotkeyProfileTriggerCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_HotkeyProfileTriggerCallback cb
cb'' <- mk_HotkeyProfileTriggerCallback cb'
connectSignalFunPtr obj "trigger" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList HotkeyProfile
type instance O.AttributeList HotkeyProfile = HotkeyProfileAttributeList
type HotkeyProfileAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList HotkeyProfile = HotkeyProfileSignalList
type HotkeyProfileSignalList = ('[ '("destroy", IBus.Object.ObjectDestroySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("trigger", HotkeyProfileTriggerSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ibus_hotkey_profile_new" ibus_hotkey_profile_new ::
IO (Ptr HotkeyProfile)
hotkeyProfileNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m HotkeyProfile
hotkeyProfileNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m HotkeyProfile
hotkeyProfileNew = IO HotkeyProfile -> m HotkeyProfile
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO HotkeyProfile -> m HotkeyProfile)
-> IO HotkeyProfile -> m HotkeyProfile
forall a b. (a -> b) -> a -> b
$ do
Ptr HotkeyProfile
result <- IO (Ptr HotkeyProfile)
ibus_hotkey_profile_new
Text -> Ptr HotkeyProfile -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hotkeyProfileNew" Ptr HotkeyProfile
result
HotkeyProfile
result' <- ((ManagedPtr HotkeyProfile -> HotkeyProfile)
-> Ptr HotkeyProfile -> IO HotkeyProfile
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr HotkeyProfile -> HotkeyProfile
HotkeyProfile) Ptr HotkeyProfile
result
HotkeyProfile -> IO HotkeyProfile
forall (m :: * -> *) a. Monad m => a -> m a
return HotkeyProfile
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ibus_hotkey_profile_add_hotkey" ibus_hotkey_profile_add_hotkey ::
Ptr HotkeyProfile ->
Word32 ->
Word32 ->
Word32 ->
IO CInt
hotkeyProfileAddHotkey ::
(B.CallStack.HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a
-> Word32
-> Word32
-> Word32
-> m Bool
hotkeyProfileAddHotkey :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a -> Word32 -> Word32 -> Word32 -> m Bool
hotkeyProfileAddHotkey a
profile Word32
keyval Word32
modifiers Word32
event = 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 HotkeyProfile
profile' <- a -> IO (Ptr HotkeyProfile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
profile
CInt
result <- Ptr HotkeyProfile -> Word32 -> Word32 -> Word32 -> IO CInt
ibus_hotkey_profile_add_hotkey Ptr HotkeyProfile
profile' Word32
keyval Word32
modifiers Word32
event
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
profile
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data HotkeyProfileAddHotkeyMethodInfo
instance (signature ~ (Word32 -> Word32 -> Word32 -> m Bool), MonadIO m, IsHotkeyProfile a) => O.OverloadedMethod HotkeyProfileAddHotkeyMethodInfo a signature where
overloadedMethod = hotkeyProfileAddHotkey
instance O.OverloadedMethodInfo HotkeyProfileAddHotkeyMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.IBus.Objects.HotkeyProfile.hotkeyProfileAddHotkey",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-HotkeyProfile.html#v:hotkeyProfileAddHotkey"
}
#endif
foreign import ccall "ibus_hotkey_profile_add_hotkey_from_string" ibus_hotkey_profile_add_hotkey_from_string ::
Ptr HotkeyProfile ->
CString ->
Word32 ->
IO CInt
hotkeyProfileAddHotkeyFromString ::
(B.CallStack.HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a
-> T.Text
-> Word32
-> m Bool
hotkeyProfileAddHotkeyFromString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a -> Text -> Word32 -> m Bool
hotkeyProfileAddHotkeyFromString a
profile Text
str Word32
event = 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 HotkeyProfile
profile' <- a -> IO (Ptr HotkeyProfile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
profile
CString
str' <- Text -> IO CString
textToCString Text
str
CInt
result <- Ptr HotkeyProfile -> CString -> Word32 -> IO CInt
ibus_hotkey_profile_add_hotkey_from_string Ptr HotkeyProfile
profile' CString
str' Word32
event
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
profile
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
str'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data HotkeyProfileAddHotkeyFromStringMethodInfo
instance (signature ~ (T.Text -> Word32 -> m Bool), MonadIO m, IsHotkeyProfile a) => O.OverloadedMethod HotkeyProfileAddHotkeyFromStringMethodInfo a signature where
overloadedMethod = hotkeyProfileAddHotkeyFromString
instance O.OverloadedMethodInfo HotkeyProfileAddHotkeyFromStringMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.IBus.Objects.HotkeyProfile.hotkeyProfileAddHotkeyFromString",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-HotkeyProfile.html#v:hotkeyProfileAddHotkeyFromString"
}
#endif
foreign import ccall "ibus_hotkey_profile_filter_key_event" ibus_hotkey_profile_filter_key_event ::
Ptr HotkeyProfile ->
Word32 ->
Word32 ->
Word32 ->
Word32 ->
Ptr () ->
IO Word32
hotkeyProfileFilterKeyEvent ::
(B.CallStack.HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a
-> Word32
-> Word32
-> Word32
-> Word32
-> Ptr ()
-> m Word32
hotkeyProfileFilterKeyEvent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a -> Word32 -> Word32 -> Word32 -> Word32 -> Ptr () -> m Word32
hotkeyProfileFilterKeyEvent a
profile Word32
keyval Word32
modifiers Word32
prevKeyval Word32
prevModifiers Ptr ()
userData = 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 HotkeyProfile
profile' <- a -> IO (Ptr HotkeyProfile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
profile
Word32
result <- Ptr HotkeyProfile
-> Word32 -> Word32 -> Word32 -> Word32 -> Ptr () -> IO Word32
ibus_hotkey_profile_filter_key_event Ptr HotkeyProfile
profile' Word32
keyval Word32
modifiers Word32
prevKeyval Word32
prevModifiers Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
profile
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data HotkeyProfileFilterKeyEventMethodInfo
instance (signature ~ (Word32 -> Word32 -> Word32 -> Word32 -> Ptr () -> m Word32), MonadIO m, IsHotkeyProfile a) => O.OverloadedMethod HotkeyProfileFilterKeyEventMethodInfo a signature where
overloadedMethod = hotkeyProfileFilterKeyEvent
instance O.OverloadedMethodInfo HotkeyProfileFilterKeyEventMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.IBus.Objects.HotkeyProfile.hotkeyProfileFilterKeyEvent",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-HotkeyProfile.html#v:hotkeyProfileFilterKeyEvent"
}
#endif
foreign import ccall "ibus_hotkey_profile_lookup_hotkey" ibus_hotkey_profile_lookup_hotkey ::
Ptr HotkeyProfile ->
Word32 ->
Word32 ->
IO Word32
hotkeyProfileLookupHotkey ::
(B.CallStack.HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a
-> Word32
-> Word32
-> m Word32
hotkeyProfileLookupHotkey :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a -> Word32 -> Word32 -> m Word32
hotkeyProfileLookupHotkey a
profile Word32
keyval Word32
modifiers = 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 HotkeyProfile
profile' <- a -> IO (Ptr HotkeyProfile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
profile
Word32
result <- Ptr HotkeyProfile -> Word32 -> Word32 -> IO Word32
ibus_hotkey_profile_lookup_hotkey Ptr HotkeyProfile
profile' Word32
keyval Word32
modifiers
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
profile
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data HotkeyProfileLookupHotkeyMethodInfo
instance (signature ~ (Word32 -> Word32 -> m Word32), MonadIO m, IsHotkeyProfile a) => O.OverloadedMethod HotkeyProfileLookupHotkeyMethodInfo a signature where
overloadedMethod = hotkeyProfileLookupHotkey
instance O.OverloadedMethodInfo HotkeyProfileLookupHotkeyMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.IBus.Objects.HotkeyProfile.hotkeyProfileLookupHotkey",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-HotkeyProfile.html#v:hotkeyProfileLookupHotkey"
}
#endif
foreign import ccall "ibus_hotkey_profile_remove_hotkey" ibus_hotkey_profile_remove_hotkey ::
Ptr HotkeyProfile ->
Word32 ->
Word32 ->
IO CInt
hotkeyProfileRemoveHotkey ::
(B.CallStack.HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a
-> Word32
-> Word32
-> m Bool
hotkeyProfileRemoveHotkey :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a -> Word32 -> Word32 -> m Bool
hotkeyProfileRemoveHotkey a
profile Word32
keyval Word32
modifiers = 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 HotkeyProfile
profile' <- a -> IO (Ptr HotkeyProfile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
profile
CInt
result <- Ptr HotkeyProfile -> Word32 -> Word32 -> IO CInt
ibus_hotkey_profile_remove_hotkey Ptr HotkeyProfile
profile' Word32
keyval Word32
modifiers
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
profile
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data HotkeyProfileRemoveHotkeyMethodInfo
instance (signature ~ (Word32 -> Word32 -> m Bool), MonadIO m, IsHotkeyProfile a) => O.OverloadedMethod HotkeyProfileRemoveHotkeyMethodInfo a signature where
overloadedMethod = hotkeyProfileRemoveHotkey
instance O.OverloadedMethodInfo HotkeyProfileRemoveHotkeyMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.IBus.Objects.HotkeyProfile.hotkeyProfileRemoveHotkey",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-HotkeyProfile.html#v:hotkeyProfileRemoveHotkey"
}
#endif
foreign import ccall "ibus_hotkey_profile_remove_hotkey_by_event" ibus_hotkey_profile_remove_hotkey_by_event ::
Ptr HotkeyProfile ->
Word32 ->
IO CInt
hotkeyProfileRemoveHotkeyByEvent ::
(B.CallStack.HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a
-> Word32
-> m Bool
hotkeyProfileRemoveHotkeyByEvent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHotkeyProfile a) =>
a -> Word32 -> m Bool
hotkeyProfileRemoveHotkeyByEvent a
profile Word32
event = 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 HotkeyProfile
profile' <- a -> IO (Ptr HotkeyProfile)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
profile
CInt
result <- Ptr HotkeyProfile -> Word32 -> IO CInt
ibus_hotkey_profile_remove_hotkey_by_event Ptr HotkeyProfile
profile' Word32
event
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
profile
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data HotkeyProfileRemoveHotkeyByEventMethodInfo
instance (signature ~ (Word32 -> m Bool), MonadIO m, IsHotkeyProfile a) => O.OverloadedMethod HotkeyProfileRemoveHotkeyByEventMethodInfo a signature where
overloadedMethod = hotkeyProfileRemoveHotkeyByEvent
instance O.OverloadedMethodInfo HotkeyProfileRemoveHotkeyByEventMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.IBus.Objects.HotkeyProfile.hotkeyProfileRemoveHotkeyByEvent",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-HotkeyProfile.html#v:hotkeyProfileRemoveHotkeyByEvent"
}
#endif