{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.IBus.Objects.Bus
(
Bus(..) ,
IsBus ,
toBus ,
#if defined(ENABLE_OVERLOADING)
ResolveBusMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
BusAddMatchMethodInfo ,
#endif
busAddMatch ,
#if defined(ENABLE_OVERLOADING)
BusAddMatchAsyncMethodInfo ,
#endif
busAddMatchAsync ,
#if defined(ENABLE_OVERLOADING)
BusAddMatchAsyncFinishMethodInfo ,
#endif
busAddMatchAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusCreateInputContextMethodInfo ,
#endif
busCreateInputContext ,
#if defined(ENABLE_OVERLOADING)
BusCreateInputContextAsyncMethodInfo ,
#endif
busCreateInputContextAsync ,
#if defined(ENABLE_OVERLOADING)
BusCreateInputContextAsyncFinishMethodInfo,
#endif
busCreateInputContextAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusCurrentInputContextMethodInfo ,
#endif
busCurrentInputContext ,
#if defined(ENABLE_OVERLOADING)
BusCurrentInputContextAsyncMethodInfo ,
#endif
busCurrentInputContextAsync ,
#if defined(ENABLE_OVERLOADING)
BusCurrentInputContextAsyncFinishMethodInfo,
#endif
busCurrentInputContextAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusExitMethodInfo ,
#endif
busExit ,
#if defined(ENABLE_OVERLOADING)
BusExitAsyncMethodInfo ,
#endif
busExitAsync ,
#if defined(ENABLE_OVERLOADING)
BusExitAsyncFinishMethodInfo ,
#endif
busExitAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusGetConfigMethodInfo ,
#endif
busGetConfig ,
#if defined(ENABLE_OVERLOADING)
BusGetConnectionMethodInfo ,
#endif
busGetConnection ,
#if defined(ENABLE_OVERLOADING)
BusGetEnginesByNamesMethodInfo ,
#endif
busGetEnginesByNames ,
#if defined(ENABLE_OVERLOADING)
BusGetGlobalEngineMethodInfo ,
#endif
busGetGlobalEngine ,
#if defined(ENABLE_OVERLOADING)
BusGetGlobalEngineAsyncMethodInfo ,
#endif
busGetGlobalEngineAsync ,
#if defined(ENABLE_OVERLOADING)
BusGetGlobalEngineAsyncFinishMethodInfo ,
#endif
busGetGlobalEngineAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusGetIbusPropertyMethodInfo ,
#endif
busGetIbusProperty ,
#if defined(ENABLE_OVERLOADING)
BusGetIbusPropertyAsyncMethodInfo ,
#endif
busGetIbusPropertyAsync ,
#if defined(ENABLE_OVERLOADING)
BusGetIbusPropertyAsyncFinishMethodInfo ,
#endif
busGetIbusPropertyAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusGetNameOwnerMethodInfo ,
#endif
busGetNameOwner ,
#if defined(ENABLE_OVERLOADING)
BusGetNameOwnerAsyncMethodInfo ,
#endif
busGetNameOwnerAsync ,
#if defined(ENABLE_OVERLOADING)
BusGetNameOwnerAsyncFinishMethodInfo ,
#endif
busGetNameOwnerAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusGetServiceNameMethodInfo ,
#endif
busGetServiceName ,
#if defined(ENABLE_OVERLOADING)
BusGetUseGlobalEngineMethodInfo ,
#endif
busGetUseGlobalEngine ,
#if defined(ENABLE_OVERLOADING)
BusGetUseGlobalEngineAsyncMethodInfo ,
#endif
busGetUseGlobalEngineAsync ,
#if defined(ENABLE_OVERLOADING)
BusGetUseGlobalEngineAsyncFinishMethodInfo,
#endif
busGetUseGlobalEngineAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusGetUseSysLayoutMethodInfo ,
#endif
busGetUseSysLayout ,
#if defined(ENABLE_OVERLOADING)
BusGetUseSysLayoutAsyncMethodInfo ,
#endif
busGetUseSysLayoutAsync ,
#if defined(ENABLE_OVERLOADING)
BusGetUseSysLayoutAsyncFinishMethodInfo ,
#endif
busGetUseSysLayoutAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusHelloMethodInfo ,
#endif
busHello ,
#if defined(ENABLE_OVERLOADING)
BusIsConnectedMethodInfo ,
#endif
busIsConnected ,
#if defined(ENABLE_OVERLOADING)
BusIsGlobalEngineEnabledMethodInfo ,
#endif
busIsGlobalEngineEnabled ,
#if defined(ENABLE_OVERLOADING)
BusIsGlobalEngineEnabledAsyncMethodInfo ,
#endif
busIsGlobalEngineEnabledAsync ,
#if defined(ENABLE_OVERLOADING)
BusIsGlobalEngineEnabledAsyncFinishMethodInfo,
#endif
busIsGlobalEngineEnabledAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusListActiveEnginesMethodInfo ,
#endif
busListActiveEngines ,
#if defined(ENABLE_OVERLOADING)
BusListActiveEnginesAsyncMethodInfo ,
#endif
busListActiveEnginesAsync ,
#if defined(ENABLE_OVERLOADING)
BusListActiveEnginesAsyncFinishMethodInfo,
#endif
busListActiveEnginesAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusListEnginesMethodInfo ,
#endif
busListEngines ,
#if defined(ENABLE_OVERLOADING)
BusListEnginesAsyncMethodInfo ,
#endif
busListEnginesAsync ,
#if defined(ENABLE_OVERLOADING)
BusListEnginesAsyncFinishMethodInfo ,
#endif
busListEnginesAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusListNamesMethodInfo ,
#endif
busListNames ,
#if defined(ENABLE_OVERLOADING)
BusListQueuedOwnersMethodInfo ,
#endif
busListQueuedOwners ,
#if defined(ENABLE_OVERLOADING)
BusNameHasOwnerMethodInfo ,
#endif
busNameHasOwner ,
#if defined(ENABLE_OVERLOADING)
BusNameHasOwnerAsyncMethodInfo ,
#endif
busNameHasOwnerAsync ,
#if defined(ENABLE_OVERLOADING)
BusNameHasOwnerAsyncFinishMethodInfo ,
#endif
busNameHasOwnerAsyncFinish ,
busNew ,
busNewAsync ,
busNewAsyncClient ,
#if defined(ENABLE_OVERLOADING)
BusPreloadEnginesMethodInfo ,
#endif
busPreloadEngines ,
#if defined(ENABLE_OVERLOADING)
BusPreloadEnginesAsyncMethodInfo ,
#endif
busPreloadEnginesAsync ,
#if defined(ENABLE_OVERLOADING)
BusPreloadEnginesAsyncFinishMethodInfo ,
#endif
busPreloadEnginesAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusRegisterComponentMethodInfo ,
#endif
busRegisterComponent ,
#if defined(ENABLE_OVERLOADING)
BusRegisterComponentAsyncMethodInfo ,
#endif
busRegisterComponentAsync ,
#if defined(ENABLE_OVERLOADING)
BusRegisterComponentAsyncFinishMethodInfo,
#endif
busRegisterComponentAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusReleaseNameMethodInfo ,
#endif
busReleaseName ,
#if defined(ENABLE_OVERLOADING)
BusReleaseNameAsyncMethodInfo ,
#endif
busReleaseNameAsync ,
#if defined(ENABLE_OVERLOADING)
BusReleaseNameAsyncFinishMethodInfo ,
#endif
busReleaseNameAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusRemoveMatchMethodInfo ,
#endif
busRemoveMatch ,
#if defined(ENABLE_OVERLOADING)
BusRemoveMatchAsyncMethodInfo ,
#endif
busRemoveMatchAsync ,
#if defined(ENABLE_OVERLOADING)
BusRemoveMatchAsyncFinishMethodInfo ,
#endif
busRemoveMatchAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusRequestNameMethodInfo ,
#endif
busRequestName ,
#if defined(ENABLE_OVERLOADING)
BusRequestNameAsyncMethodInfo ,
#endif
busRequestNameAsync ,
#if defined(ENABLE_OVERLOADING)
BusRequestNameAsyncFinishMethodInfo ,
#endif
busRequestNameAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusSetGlobalEngineMethodInfo ,
#endif
busSetGlobalEngine ,
#if defined(ENABLE_OVERLOADING)
BusSetGlobalEngineAsyncMethodInfo ,
#endif
busSetGlobalEngineAsync ,
#if defined(ENABLE_OVERLOADING)
BusSetGlobalEngineAsyncFinishMethodInfo ,
#endif
busSetGlobalEngineAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusSetIbusPropertyMethodInfo ,
#endif
busSetIbusProperty ,
#if defined(ENABLE_OVERLOADING)
BusSetIbusPropertyAsyncMethodInfo ,
#endif
busSetIbusPropertyAsync ,
#if defined(ENABLE_OVERLOADING)
BusSetIbusPropertyAsyncFinishMethodInfo ,
#endif
busSetIbusPropertyAsyncFinish ,
#if defined(ENABLE_OVERLOADING)
BusSetWatchDbusSignalMethodInfo ,
#endif
busSetWatchDbusSignal ,
#if defined(ENABLE_OVERLOADING)
BusSetWatchIbusSignalMethodInfo ,
#endif
busSetWatchIbusSignal ,
#if defined(ENABLE_OVERLOADING)
BusClientOnlyPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
busClientOnly ,
#endif
constructBusClientOnly ,
getBusClientOnly ,
#if defined(ENABLE_OVERLOADING)
BusConnectAsyncPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
busConnectAsync ,
#endif
constructBusConnectAsync ,
getBusConnectAsync ,
BusConnectedCallback ,
#if defined(ENABLE_OVERLOADING)
BusConnectedSignalInfo ,
#endif
C_BusConnectedCallback ,
afterBusConnected ,
genClosure_BusConnected ,
mk_BusConnectedCallback ,
noBusConnectedCallback ,
onBusConnected ,
wrap_BusConnectedCallback ,
BusDisconnectedCallback ,
#if defined(ENABLE_OVERLOADING)
BusDisconnectedSignalInfo ,
#endif
C_BusDisconnectedCallback ,
afterBusDisconnected ,
genClosure_BusDisconnected ,
mk_BusDisconnectedCallback ,
noBusDisconnectedCallback ,
onBusDisconnected ,
wrap_BusDisconnectedCallback ,
BusGlobalEngineChangedCallback ,
#if defined(ENABLE_OVERLOADING)
BusGlobalEngineChangedSignalInfo ,
#endif
C_BusGlobalEngineChangedCallback ,
afterBusGlobalEngineChanged ,
genClosure_BusGlobalEngineChanged ,
mk_BusGlobalEngineChangedCallback ,
noBusGlobalEngineChangedCallback ,
onBusGlobalEngineChanged ,
wrap_BusGlobalEngineChangedCallback ,
BusNameOwnerChangedCallback ,
#if defined(ENABLE_OVERLOADING)
BusNameOwnerChangedSignalInfo ,
#endif
C_BusNameOwnerChangedCallback ,
afterBusNameOwnerChanged ,
genClosure_BusNameOwnerChanged ,
mk_BusNameOwnerChangedCallback ,
noBusNameOwnerChangedCallback ,
onBusNameOwnerChanged ,
wrap_BusNameOwnerChangedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection
import {-# SOURCE #-} qualified GI.IBus.Objects.Component as IBus.Component
import {-# SOURCE #-} qualified GI.IBus.Objects.Config as IBus.Config
import {-# SOURCE #-} qualified GI.IBus.Objects.EngineDesc as IBus.EngineDesc
import {-# SOURCE #-} qualified GI.IBus.Objects.InputContext as IBus.InputContext
import {-# SOURCE #-} qualified GI.IBus.Objects.Object as IBus.Object
newtype Bus = Bus (SP.ManagedPtr Bus)
deriving (Bus -> Bus -> Bool
(Bus -> Bus -> Bool) -> (Bus -> Bus -> Bool) -> Eq Bus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Bus -> Bus -> Bool
$c/= :: Bus -> Bus -> Bool
== :: Bus -> Bus -> Bool
$c== :: Bus -> Bus -> Bool
Eq)
instance SP.ManagedPtrNewtype Bus where
toManagedPtr :: Bus -> ManagedPtr Bus
toManagedPtr (Bus ManagedPtr Bus
p) = ManagedPtr Bus
p
foreign import ccall "ibus_bus_get_type"
c_ibus_bus_get_type :: IO B.Types.GType
instance B.Types.TypedObject Bus where
glibType :: IO GType
glibType = IO GType
c_ibus_bus_get_type
instance B.Types.GObject Bus
instance B.GValue.IsGValue Bus where
toGValue :: Bus -> IO GValue
toGValue Bus
o = do
GType
gtype <- IO GType
c_ibus_bus_get_type
Bus -> (Ptr Bus -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Bus
o (GType -> (GValue -> Ptr Bus -> IO ()) -> Ptr Bus -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Bus -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Bus
fromGValue GValue
gv = do
Ptr Bus
ptr <- GValue -> IO (Ptr Bus)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Bus)
(ManagedPtr Bus -> Bus) -> Ptr Bus -> IO Bus
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Bus -> Bus
Bus Ptr Bus
ptr
class (SP.GObject o, O.IsDescendantOf Bus o) => IsBus o
instance (SP.GObject o, O.IsDescendantOf Bus o) => IsBus o
instance O.HasParentTypes Bus
type instance O.ParentTypes Bus = '[IBus.Object.Object, GObject.Object.Object]
toBus :: (MonadIO m, IsBus o) => o -> m Bus
toBus :: o -> m Bus
toBus = IO Bus -> m Bus
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bus -> m Bus) -> (o -> IO Bus) -> o -> m Bus
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Bus -> Bus) -> o -> IO Bus
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Bus -> Bus
Bus
#if defined(ENABLE_OVERLOADING)
type family ResolveBusMethod (t :: Symbol) (o :: *) :: * where
ResolveBusMethod "addMatch" o = BusAddMatchMethodInfo
ResolveBusMethod "addMatchAsync" o = BusAddMatchAsyncMethodInfo
ResolveBusMethod "addMatchAsyncFinish" o = BusAddMatchAsyncFinishMethodInfo
ResolveBusMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveBusMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveBusMethod "createInputContext" o = BusCreateInputContextMethodInfo
ResolveBusMethod "createInputContextAsync" o = BusCreateInputContextAsyncMethodInfo
ResolveBusMethod "createInputContextAsyncFinish" o = BusCreateInputContextAsyncFinishMethodInfo
ResolveBusMethod "currentInputContext" o = BusCurrentInputContextMethodInfo
ResolveBusMethod "currentInputContextAsync" o = BusCurrentInputContextAsyncMethodInfo
ResolveBusMethod "currentInputContextAsyncFinish" o = BusCurrentInputContextAsyncFinishMethodInfo
ResolveBusMethod "destroy" o = IBus.Object.ObjectDestroyMethodInfo
ResolveBusMethod "exit" o = BusExitMethodInfo
ResolveBusMethod "exitAsync" o = BusExitAsyncMethodInfo
ResolveBusMethod "exitAsyncFinish" o = BusExitAsyncFinishMethodInfo
ResolveBusMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveBusMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveBusMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveBusMethod "hello" o = BusHelloMethodInfo
ResolveBusMethod "isConnected" o = BusIsConnectedMethodInfo
ResolveBusMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveBusMethod "isGlobalEngineEnabled" o = BusIsGlobalEngineEnabledMethodInfo
ResolveBusMethod "isGlobalEngineEnabledAsync" o = BusIsGlobalEngineEnabledAsyncMethodInfo
ResolveBusMethod "isGlobalEngineEnabledAsyncFinish" o = BusIsGlobalEngineEnabledAsyncFinishMethodInfo
ResolveBusMethod "listActiveEngines" o = BusListActiveEnginesMethodInfo
ResolveBusMethod "listActiveEnginesAsync" o = BusListActiveEnginesAsyncMethodInfo
ResolveBusMethod "listActiveEnginesAsyncFinish" o = BusListActiveEnginesAsyncFinishMethodInfo
ResolveBusMethod "listEngines" o = BusListEnginesMethodInfo
ResolveBusMethod "listEnginesAsync" o = BusListEnginesAsyncMethodInfo
ResolveBusMethod "listEnginesAsyncFinish" o = BusListEnginesAsyncFinishMethodInfo
ResolveBusMethod "listNames" o = BusListNamesMethodInfo
ResolveBusMethod "listQueuedOwners" o = BusListQueuedOwnersMethodInfo
ResolveBusMethod "nameHasOwner" o = BusNameHasOwnerMethodInfo
ResolveBusMethod "nameHasOwnerAsync" o = BusNameHasOwnerAsyncMethodInfo
ResolveBusMethod "nameHasOwnerAsyncFinish" o = BusNameHasOwnerAsyncFinishMethodInfo
ResolveBusMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveBusMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveBusMethod "preloadEngines" o = BusPreloadEnginesMethodInfo
ResolveBusMethod "preloadEnginesAsync" o = BusPreloadEnginesAsyncMethodInfo
ResolveBusMethod "preloadEnginesAsyncFinish" o = BusPreloadEnginesAsyncFinishMethodInfo
ResolveBusMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveBusMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveBusMethod "registerComponent" o = BusRegisterComponentMethodInfo
ResolveBusMethod "registerComponentAsync" o = BusRegisterComponentAsyncMethodInfo
ResolveBusMethod "registerComponentAsyncFinish" o = BusRegisterComponentAsyncFinishMethodInfo
ResolveBusMethod "releaseName" o = BusReleaseNameMethodInfo
ResolveBusMethod "releaseNameAsync" o = BusReleaseNameAsyncMethodInfo
ResolveBusMethod "releaseNameAsyncFinish" o = BusReleaseNameAsyncFinishMethodInfo
ResolveBusMethod "removeMatch" o = BusRemoveMatchMethodInfo
ResolveBusMethod "removeMatchAsync" o = BusRemoveMatchAsyncMethodInfo
ResolveBusMethod "removeMatchAsyncFinish" o = BusRemoveMatchAsyncFinishMethodInfo
ResolveBusMethod "requestName" o = BusRequestNameMethodInfo
ResolveBusMethod "requestNameAsync" o = BusRequestNameAsyncMethodInfo
ResolveBusMethod "requestNameAsyncFinish" o = BusRequestNameAsyncFinishMethodInfo
ResolveBusMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveBusMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveBusMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveBusMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveBusMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveBusMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveBusMethod "getConfig" o = BusGetConfigMethodInfo
ResolveBusMethod "getConnection" o = BusGetConnectionMethodInfo
ResolveBusMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveBusMethod "getEnginesByNames" o = BusGetEnginesByNamesMethodInfo
ResolveBusMethod "getGlobalEngine" o = BusGetGlobalEngineMethodInfo
ResolveBusMethod "getGlobalEngineAsync" o = BusGetGlobalEngineAsyncMethodInfo
ResolveBusMethod "getGlobalEngineAsyncFinish" o = BusGetGlobalEngineAsyncFinishMethodInfo
ResolveBusMethod "getIbusProperty" o = BusGetIbusPropertyMethodInfo
ResolveBusMethod "getIbusPropertyAsync" o = BusGetIbusPropertyAsyncMethodInfo
ResolveBusMethod "getIbusPropertyAsyncFinish" o = BusGetIbusPropertyAsyncFinishMethodInfo
ResolveBusMethod "getNameOwner" o = BusGetNameOwnerMethodInfo
ResolveBusMethod "getNameOwnerAsync" o = BusGetNameOwnerAsyncMethodInfo
ResolveBusMethod "getNameOwnerAsyncFinish" o = BusGetNameOwnerAsyncFinishMethodInfo
ResolveBusMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveBusMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveBusMethod "getServiceName" o = BusGetServiceNameMethodInfo
ResolveBusMethod "getUseGlobalEngine" o = BusGetUseGlobalEngineMethodInfo
ResolveBusMethod "getUseGlobalEngineAsync" o = BusGetUseGlobalEngineAsyncMethodInfo
ResolveBusMethod "getUseGlobalEngineAsyncFinish" o = BusGetUseGlobalEngineAsyncFinishMethodInfo
ResolveBusMethod "getUseSysLayout" o = BusGetUseSysLayoutMethodInfo
ResolveBusMethod "getUseSysLayoutAsync" o = BusGetUseSysLayoutAsyncMethodInfo
ResolveBusMethod "getUseSysLayoutAsyncFinish" o = BusGetUseSysLayoutAsyncFinishMethodInfo
ResolveBusMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveBusMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveBusMethod "setGlobalEngine" o = BusSetGlobalEngineMethodInfo
ResolveBusMethod "setGlobalEngineAsync" o = BusSetGlobalEngineAsyncMethodInfo
ResolveBusMethod "setGlobalEngineAsyncFinish" o = BusSetGlobalEngineAsyncFinishMethodInfo
ResolveBusMethod "setIbusProperty" o = BusSetIbusPropertyMethodInfo
ResolveBusMethod "setIbusPropertyAsync" o = BusSetIbusPropertyAsyncMethodInfo
ResolveBusMethod "setIbusPropertyAsyncFinish" o = BusSetIbusPropertyAsyncFinishMethodInfo
ResolveBusMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBusMethod "setWatchDbusSignal" o = BusSetWatchDbusSignalMethodInfo
ResolveBusMethod "setWatchIbusSignal" o = BusSetWatchIbusSignalMethodInfo
ResolveBusMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBusMethod t Bus, O.MethodInfo info Bus p) => OL.IsLabel t (Bus -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type BusConnectedCallback =
IO ()
noBusConnectedCallback :: Maybe BusConnectedCallback
noBusConnectedCallback :: Maybe (IO ())
noBusConnectedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_BusConnectedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_BusConnectedCallback :: C_BusConnectedCallback -> IO (FunPtr C_BusConnectedCallback)
genClosure_BusConnected :: MonadIO m => BusConnectedCallback -> m (GClosure C_BusConnectedCallback)
genClosure_BusConnected :: IO () -> m (GClosure C_BusConnectedCallback)
genClosure_BusConnected IO ()
cb = IO (GClosure C_BusConnectedCallback)
-> m (GClosure C_BusConnectedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BusConnectedCallback)
-> m (GClosure C_BusConnectedCallback))
-> IO (GClosure C_BusConnectedCallback)
-> m (GClosure C_BusConnectedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_BusConnectedCallback
cb' = IO () -> C_BusConnectedCallback
wrap_BusConnectedCallback IO ()
cb
C_BusConnectedCallback -> IO (FunPtr C_BusConnectedCallback)
mk_BusConnectedCallback C_BusConnectedCallback
cb' IO (FunPtr C_BusConnectedCallback)
-> (FunPtr C_BusConnectedCallback
-> IO (GClosure C_BusConnectedCallback))
-> IO (GClosure C_BusConnectedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BusConnectedCallback
-> IO (GClosure C_BusConnectedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_BusConnectedCallback ::
BusConnectedCallback ->
C_BusConnectedCallback
wrap_BusConnectedCallback :: IO () -> C_BusConnectedCallback
wrap_BusConnectedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onBusConnected :: (IsBus a, MonadIO m) => a -> BusConnectedCallback -> m SignalHandlerId
onBusConnected :: a -> IO () -> m SignalHandlerId
onBusConnected a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_BusConnectedCallback
cb' = IO () -> C_BusConnectedCallback
wrap_BusConnectedCallback IO ()
cb
FunPtr C_BusConnectedCallback
cb'' <- C_BusConnectedCallback -> IO (FunPtr C_BusConnectedCallback)
mk_BusConnectedCallback C_BusConnectedCallback
cb'
a
-> Text
-> FunPtr C_BusConnectedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"connected" FunPtr C_BusConnectedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterBusConnected :: (IsBus a, MonadIO m) => a -> BusConnectedCallback -> m SignalHandlerId
afterBusConnected :: a -> IO () -> m SignalHandlerId
afterBusConnected a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_BusConnectedCallback
cb' = IO () -> C_BusConnectedCallback
wrap_BusConnectedCallback IO ()
cb
FunPtr C_BusConnectedCallback
cb'' <- C_BusConnectedCallback -> IO (FunPtr C_BusConnectedCallback)
mk_BusConnectedCallback C_BusConnectedCallback
cb'
a
-> Text
-> FunPtr C_BusConnectedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"connected" FunPtr C_BusConnectedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data BusConnectedSignalInfo
instance SignalInfo BusConnectedSignalInfo where
type HaskellCallbackType BusConnectedSignalInfo = BusConnectedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_BusConnectedCallback cb
cb'' <- mk_BusConnectedCallback cb'
connectSignalFunPtr obj "connected" cb'' connectMode detail
#endif
type BusDisconnectedCallback =
IO ()
noBusDisconnectedCallback :: Maybe BusDisconnectedCallback
noBusDisconnectedCallback :: Maybe (IO ())
noBusDisconnectedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_BusDisconnectedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_BusDisconnectedCallback :: C_BusDisconnectedCallback -> IO (FunPtr C_BusDisconnectedCallback)
genClosure_BusDisconnected :: MonadIO m => BusDisconnectedCallback -> m (GClosure C_BusDisconnectedCallback)
genClosure_BusDisconnected :: IO () -> m (GClosure C_BusConnectedCallback)
genClosure_BusDisconnected IO ()
cb = IO (GClosure C_BusConnectedCallback)
-> m (GClosure C_BusConnectedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BusConnectedCallback)
-> m (GClosure C_BusConnectedCallback))
-> IO (GClosure C_BusConnectedCallback)
-> m (GClosure C_BusConnectedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_BusConnectedCallback
cb' = IO () -> C_BusConnectedCallback
wrap_BusDisconnectedCallback IO ()
cb
C_BusConnectedCallback -> IO (FunPtr C_BusConnectedCallback)
mk_BusDisconnectedCallback C_BusConnectedCallback
cb' IO (FunPtr C_BusConnectedCallback)
-> (FunPtr C_BusConnectedCallback
-> IO (GClosure C_BusConnectedCallback))
-> IO (GClosure C_BusConnectedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BusConnectedCallback
-> IO (GClosure C_BusConnectedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_BusDisconnectedCallback ::
BusDisconnectedCallback ->
C_BusDisconnectedCallback
wrap_BusDisconnectedCallback :: IO () -> C_BusConnectedCallback
wrap_BusDisconnectedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onBusDisconnected :: (IsBus a, MonadIO m) => a -> BusDisconnectedCallback -> m SignalHandlerId
onBusDisconnected :: a -> IO () -> m SignalHandlerId
onBusDisconnected a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_BusConnectedCallback
cb' = IO () -> C_BusConnectedCallback
wrap_BusDisconnectedCallback IO ()
cb
FunPtr C_BusConnectedCallback
cb'' <- C_BusConnectedCallback -> IO (FunPtr C_BusConnectedCallback)
mk_BusDisconnectedCallback C_BusConnectedCallback
cb'
a
-> Text
-> FunPtr C_BusConnectedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"disconnected" FunPtr C_BusConnectedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterBusDisconnected :: (IsBus a, MonadIO m) => a -> BusDisconnectedCallback -> m SignalHandlerId
afterBusDisconnected :: a -> IO () -> m SignalHandlerId
afterBusDisconnected a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_BusConnectedCallback
cb' = IO () -> C_BusConnectedCallback
wrap_BusDisconnectedCallback IO ()
cb
FunPtr C_BusConnectedCallback
cb'' <- C_BusConnectedCallback -> IO (FunPtr C_BusConnectedCallback)
mk_BusDisconnectedCallback C_BusConnectedCallback
cb'
a
-> Text
-> FunPtr C_BusConnectedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"disconnected" FunPtr C_BusConnectedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data BusDisconnectedSignalInfo
instance SignalInfo BusDisconnectedSignalInfo where
type HaskellCallbackType BusDisconnectedSignalInfo = BusDisconnectedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_BusDisconnectedCallback cb
cb'' <- mk_BusDisconnectedCallback cb'
connectSignalFunPtr obj "disconnected" cb'' connectMode detail
#endif
type BusGlobalEngineChangedCallback =
T.Text
-> IO ()
noBusGlobalEngineChangedCallback :: Maybe BusGlobalEngineChangedCallback
noBusGlobalEngineChangedCallback :: Maybe BusGlobalEngineChangedCallback
noBusGlobalEngineChangedCallback = Maybe BusGlobalEngineChangedCallback
forall a. Maybe a
Nothing
type C_BusGlobalEngineChangedCallback =
Ptr () ->
CString ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_BusGlobalEngineChangedCallback :: C_BusGlobalEngineChangedCallback -> IO (FunPtr C_BusGlobalEngineChangedCallback)
genClosure_BusGlobalEngineChanged :: MonadIO m => BusGlobalEngineChangedCallback -> m (GClosure C_BusGlobalEngineChangedCallback)
genClosure_BusGlobalEngineChanged :: BusGlobalEngineChangedCallback
-> m (GClosure C_BusGlobalEngineChangedCallback)
genClosure_BusGlobalEngineChanged BusGlobalEngineChangedCallback
cb = IO (GClosure C_BusGlobalEngineChangedCallback)
-> m (GClosure C_BusGlobalEngineChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BusGlobalEngineChangedCallback)
-> m (GClosure C_BusGlobalEngineChangedCallback))
-> IO (GClosure C_BusGlobalEngineChangedCallback)
-> m (GClosure C_BusGlobalEngineChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_BusGlobalEngineChangedCallback
cb' = BusGlobalEngineChangedCallback -> C_BusGlobalEngineChangedCallback
wrap_BusGlobalEngineChangedCallback BusGlobalEngineChangedCallback
cb
C_BusGlobalEngineChangedCallback
-> IO (FunPtr C_BusGlobalEngineChangedCallback)
mk_BusGlobalEngineChangedCallback C_BusGlobalEngineChangedCallback
cb' IO (FunPtr C_BusGlobalEngineChangedCallback)
-> (FunPtr C_BusGlobalEngineChangedCallback
-> IO (GClosure C_BusGlobalEngineChangedCallback))
-> IO (GClosure C_BusGlobalEngineChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BusGlobalEngineChangedCallback
-> IO (GClosure C_BusGlobalEngineChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_BusGlobalEngineChangedCallback ::
BusGlobalEngineChangedCallback ->
C_BusGlobalEngineChangedCallback
wrap_BusGlobalEngineChangedCallback :: BusGlobalEngineChangedCallback -> C_BusGlobalEngineChangedCallback
wrap_BusGlobalEngineChangedCallback BusGlobalEngineChangedCallback
_cb Ptr ()
_ CString
name Ptr ()
_ = do
Text
name' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
name
BusGlobalEngineChangedCallback
_cb Text
name'
onBusGlobalEngineChanged :: (IsBus a, MonadIO m) => a -> BusGlobalEngineChangedCallback -> m SignalHandlerId
onBusGlobalEngineChanged :: a -> BusGlobalEngineChangedCallback -> m SignalHandlerId
onBusGlobalEngineChanged a
obj BusGlobalEngineChangedCallback
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_BusGlobalEngineChangedCallback
cb' = BusGlobalEngineChangedCallback -> C_BusGlobalEngineChangedCallback
wrap_BusGlobalEngineChangedCallback BusGlobalEngineChangedCallback
cb
FunPtr C_BusGlobalEngineChangedCallback
cb'' <- C_BusGlobalEngineChangedCallback
-> IO (FunPtr C_BusGlobalEngineChangedCallback)
mk_BusGlobalEngineChangedCallback C_BusGlobalEngineChangedCallback
cb'
a
-> Text
-> FunPtr C_BusGlobalEngineChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"global-engine-changed" FunPtr C_BusGlobalEngineChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterBusGlobalEngineChanged :: (IsBus a, MonadIO m) => a -> BusGlobalEngineChangedCallback -> m SignalHandlerId
afterBusGlobalEngineChanged :: a -> BusGlobalEngineChangedCallback -> m SignalHandlerId
afterBusGlobalEngineChanged a
obj BusGlobalEngineChangedCallback
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_BusGlobalEngineChangedCallback
cb' = BusGlobalEngineChangedCallback -> C_BusGlobalEngineChangedCallback
wrap_BusGlobalEngineChangedCallback BusGlobalEngineChangedCallback
cb
FunPtr C_BusGlobalEngineChangedCallback
cb'' <- C_BusGlobalEngineChangedCallback
-> IO (FunPtr C_BusGlobalEngineChangedCallback)
mk_BusGlobalEngineChangedCallback C_BusGlobalEngineChangedCallback
cb'
a
-> Text
-> FunPtr C_BusGlobalEngineChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"global-engine-changed" FunPtr C_BusGlobalEngineChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data BusGlobalEngineChangedSignalInfo
instance SignalInfo BusGlobalEngineChangedSignalInfo where
type HaskellCallbackType BusGlobalEngineChangedSignalInfo = BusGlobalEngineChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_BusGlobalEngineChangedCallback cb
cb'' <- mk_BusGlobalEngineChangedCallback cb'
connectSignalFunPtr obj "global-engine-changed" cb'' connectMode detail
#endif
type BusNameOwnerChangedCallback =
T.Text
-> T.Text
-> T.Text
-> IO ()
noBusNameOwnerChangedCallback :: Maybe BusNameOwnerChangedCallback
noBusNameOwnerChangedCallback :: Maybe BusNameOwnerChangedCallback
noBusNameOwnerChangedCallback = Maybe BusNameOwnerChangedCallback
forall a. Maybe a
Nothing
type C_BusNameOwnerChangedCallback =
Ptr () ->
CString ->
CString ->
CString ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_BusNameOwnerChangedCallback :: C_BusNameOwnerChangedCallback -> IO (FunPtr C_BusNameOwnerChangedCallback)
genClosure_BusNameOwnerChanged :: MonadIO m => BusNameOwnerChangedCallback -> m (GClosure C_BusNameOwnerChangedCallback)
genClosure_BusNameOwnerChanged :: BusNameOwnerChangedCallback
-> m (GClosure C_BusNameOwnerChangedCallback)
genClosure_BusNameOwnerChanged BusNameOwnerChangedCallback
cb = IO (GClosure C_BusNameOwnerChangedCallback)
-> m (GClosure C_BusNameOwnerChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BusNameOwnerChangedCallback)
-> m (GClosure C_BusNameOwnerChangedCallback))
-> IO (GClosure C_BusNameOwnerChangedCallback)
-> m (GClosure C_BusNameOwnerChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_BusNameOwnerChangedCallback
cb' = BusNameOwnerChangedCallback -> C_BusNameOwnerChangedCallback
wrap_BusNameOwnerChangedCallback BusNameOwnerChangedCallback
cb
C_BusNameOwnerChangedCallback
-> IO (FunPtr C_BusNameOwnerChangedCallback)
mk_BusNameOwnerChangedCallback C_BusNameOwnerChangedCallback
cb' IO (FunPtr C_BusNameOwnerChangedCallback)
-> (FunPtr C_BusNameOwnerChangedCallback
-> IO (GClosure C_BusNameOwnerChangedCallback))
-> IO (GClosure C_BusNameOwnerChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BusNameOwnerChangedCallback
-> IO (GClosure C_BusNameOwnerChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_BusNameOwnerChangedCallback ::
BusNameOwnerChangedCallback ->
C_BusNameOwnerChangedCallback
wrap_BusNameOwnerChangedCallback :: BusNameOwnerChangedCallback -> C_BusNameOwnerChangedCallback
wrap_BusNameOwnerChangedCallback BusNameOwnerChangedCallback
_cb Ptr ()
_ CString
name CString
oldOwner CString
newOwner Ptr ()
_ = do
Text
name' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
name
Text
oldOwner' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
oldOwner
Text
newOwner' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
newOwner
BusNameOwnerChangedCallback
_cb Text
name' Text
oldOwner' Text
newOwner'
onBusNameOwnerChanged :: (IsBus a, MonadIO m) => a -> BusNameOwnerChangedCallback -> m SignalHandlerId
onBusNameOwnerChanged :: a -> BusNameOwnerChangedCallback -> m SignalHandlerId
onBusNameOwnerChanged a
obj BusNameOwnerChangedCallback
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_BusNameOwnerChangedCallback
cb' = BusNameOwnerChangedCallback -> C_BusNameOwnerChangedCallback
wrap_BusNameOwnerChangedCallback BusNameOwnerChangedCallback
cb
FunPtr C_BusNameOwnerChangedCallback
cb'' <- C_BusNameOwnerChangedCallback
-> IO (FunPtr C_BusNameOwnerChangedCallback)
mk_BusNameOwnerChangedCallback C_BusNameOwnerChangedCallback
cb'
a
-> Text
-> FunPtr C_BusNameOwnerChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"name-owner-changed" FunPtr C_BusNameOwnerChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterBusNameOwnerChanged :: (IsBus a, MonadIO m) => a -> BusNameOwnerChangedCallback -> m SignalHandlerId
afterBusNameOwnerChanged :: a -> BusNameOwnerChangedCallback -> m SignalHandlerId
afterBusNameOwnerChanged a
obj BusNameOwnerChangedCallback
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_BusNameOwnerChangedCallback
cb' = BusNameOwnerChangedCallback -> C_BusNameOwnerChangedCallback
wrap_BusNameOwnerChangedCallback BusNameOwnerChangedCallback
cb
FunPtr C_BusNameOwnerChangedCallback
cb'' <- C_BusNameOwnerChangedCallback
-> IO (FunPtr C_BusNameOwnerChangedCallback)
mk_BusNameOwnerChangedCallback C_BusNameOwnerChangedCallback
cb'
a
-> Text
-> FunPtr C_BusNameOwnerChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"name-owner-changed" FunPtr C_BusNameOwnerChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data BusNameOwnerChangedSignalInfo
instance SignalInfo BusNameOwnerChangedSignalInfo where
type HaskellCallbackType BusNameOwnerChangedSignalInfo = BusNameOwnerChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_BusNameOwnerChangedCallback cb
cb'' <- mk_BusNameOwnerChangedCallback cb'
connectSignalFunPtr obj "name-owner-changed" cb'' connectMode detail
#endif
getBusClientOnly :: (MonadIO m, IsBus o) => o -> m Bool
getBusClientOnly :: o -> m Bool
getBusClientOnly o
obj = 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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"client-only"
constructBusClientOnly :: (IsBus o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructBusClientOnly :: Bool -> m (GValueConstruct o)
constructBusClientOnly Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"client-only" Bool
val
#if defined(ENABLE_OVERLOADING)
data BusClientOnlyPropertyInfo
instance AttrInfo BusClientOnlyPropertyInfo where
type AttrAllowedOps BusClientOnlyPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint BusClientOnlyPropertyInfo = IsBus
type AttrSetTypeConstraint BusClientOnlyPropertyInfo = (~) Bool
type AttrTransferTypeConstraint BusClientOnlyPropertyInfo = (~) Bool
type AttrTransferType BusClientOnlyPropertyInfo = Bool
type AttrGetType BusClientOnlyPropertyInfo = Bool
type AttrLabel BusClientOnlyPropertyInfo = "client-only"
type AttrOrigin BusClientOnlyPropertyInfo = Bus
attrGet = getBusClientOnly
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructBusClientOnly
attrClear = undefined
#endif
getBusConnectAsync :: (MonadIO m, IsBus o) => o -> m Bool
getBusConnectAsync :: o -> m Bool
getBusConnectAsync o
obj = 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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"connect-async"
constructBusConnectAsync :: (IsBus o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructBusConnectAsync :: Bool -> m (GValueConstruct o)
constructBusConnectAsync Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"connect-async" Bool
val
#if defined(ENABLE_OVERLOADING)
data BusConnectAsyncPropertyInfo
instance AttrInfo BusConnectAsyncPropertyInfo where
type AttrAllowedOps BusConnectAsyncPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint BusConnectAsyncPropertyInfo = IsBus
type AttrSetTypeConstraint BusConnectAsyncPropertyInfo = (~) Bool
type AttrTransferTypeConstraint BusConnectAsyncPropertyInfo = (~) Bool
type AttrTransferType BusConnectAsyncPropertyInfo = Bool
type AttrGetType BusConnectAsyncPropertyInfo = Bool
type AttrLabel BusConnectAsyncPropertyInfo = "connect-async"
type AttrOrigin BusConnectAsyncPropertyInfo = Bus
attrGet = getBusConnectAsync
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructBusConnectAsync
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Bus
type instance O.AttributeList Bus = BusAttributeList
type BusAttributeList = ('[ '("clientOnly", BusClientOnlyPropertyInfo), '("connectAsync", BusConnectAsyncPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
busClientOnly :: AttrLabelProxy "clientOnly"
busClientOnly = AttrLabelProxy
busConnectAsync :: AttrLabelProxy "connectAsync"
busConnectAsync = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Bus = BusSignalList
type BusSignalList = ('[ '("connected", BusConnectedSignalInfo), '("destroy", IBus.Object.ObjectDestroySignalInfo), '("disconnected", BusDisconnectedSignalInfo), '("globalEngineChanged", BusGlobalEngineChangedSignalInfo), '("nameOwnerChanged", BusNameOwnerChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ibus_bus_new" ibus_bus_new ::
IO (Ptr Bus)
busNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Bus
busNew :: m Bus
busNew = IO Bus -> m Bus
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bus -> m Bus) -> IO Bus -> m Bus
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
result <- IO (Ptr Bus)
ibus_bus_new
Text -> Ptr Bus -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busNew" Ptr Bus
result
Bus
result' <- ((ManagedPtr Bus -> Bus) -> Ptr Bus -> IO Bus
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Bus -> Bus
Bus) Ptr Bus
result
Bus -> IO Bus
forall (m :: * -> *) a. Monad m => a -> m a
return Bus
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ibus_bus_new_async" ibus_bus_new_async ::
IO (Ptr Bus)
busNewAsync ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Bus
busNewAsync :: m Bus
busNewAsync = IO Bus -> m Bus
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bus -> m Bus) -> IO Bus -> m Bus
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
result <- IO (Ptr Bus)
ibus_bus_new_async
Text -> Ptr Bus -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busNewAsync" Ptr Bus
result
Bus
result' <- ((ManagedPtr Bus -> Bus) -> Ptr Bus -> IO Bus
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Bus -> Bus
Bus) Ptr Bus
result
Bus -> IO Bus
forall (m :: * -> *) a. Monad m => a -> m a
return Bus
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ibus_bus_new_async_client" ibus_bus_new_async_client ::
IO (Ptr Bus)
busNewAsyncClient ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Bus
busNewAsyncClient :: m Bus
busNewAsyncClient = IO Bus -> m Bus
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bus -> m Bus) -> IO Bus -> m Bus
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
result <- IO (Ptr Bus)
ibus_bus_new_async_client
Text -> Ptr Bus -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busNewAsyncClient" Ptr Bus
result
Bus
result' <- ((ManagedPtr Bus -> Bus) -> Ptr Bus -> IO Bus
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Bus -> Bus
Bus) Ptr Bus
result
Bus -> IO Bus
forall (m :: * -> *) a. Monad m => a -> m a
return Bus
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ibus_bus_add_match" ibus_bus_add_match ::
Ptr Bus ->
CString ->
IO CInt
busAddMatch ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> m Bool
busAddMatch :: a -> Text -> m Bool
busAddMatch a
bus Text
rule = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
rule' <- Text -> IO CString
textToCString Text
rule
CInt
result <- Ptr Bus -> CString -> IO CInt
ibus_bus_add_match Ptr Bus
bus' CString
rule'
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
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rule'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusAddMatchMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsBus a) => O.MethodInfo BusAddMatchMethodInfo a signature where
overloadedMethod = busAddMatch
#endif
foreign import ccall "ibus_bus_add_match_async" ibus_bus_add_match_async ::
Ptr Bus ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busAddMatchAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busAddMatchAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busAddMatchAsync a
bus Text
rule Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
rule' <- Text -> IO CString
textToCString Text
rule
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_add_match_async Ptr Bus
bus' CString
rule' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rule'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusAddMatchAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusAddMatchAsyncMethodInfo a signature where
overloadedMethod = busAddMatchAsync
#endif
foreign import ccall "ibus_bus_add_match_async_finish" ibus_bus_add_match_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
busAddMatchAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busAddMatchAsyncFinish :: a -> b -> m ()
busAddMatchAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_add_match_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusAddMatchAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusAddMatchAsyncFinishMethodInfo a signature where
overloadedMethod = busAddMatchAsyncFinish
#endif
foreign import ccall "ibus_bus_create_input_context" ibus_bus_create_input_context ::
Ptr Bus ->
CString ->
IO (Ptr IBus.InputContext.InputContext)
busCreateInputContext ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> m IBus.InputContext.InputContext
busCreateInputContext :: a -> Text -> m InputContext
busCreateInputContext a
bus Text
clientName = IO InputContext -> m InputContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InputContext -> m InputContext)
-> IO InputContext -> m InputContext
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
clientName' <- Text -> IO CString
textToCString Text
clientName
Ptr InputContext
result <- Ptr Bus -> CString -> IO (Ptr InputContext)
ibus_bus_create_input_context Ptr Bus
bus' CString
clientName'
Text -> Ptr InputContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busCreateInputContext" Ptr InputContext
result
InputContext
result' <- ((ManagedPtr InputContext -> InputContext)
-> Ptr InputContext -> IO InputContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputContext -> InputContext
IBus.InputContext.InputContext) Ptr InputContext
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
clientName'
InputContext -> IO InputContext
forall (m :: * -> *) a. Monad m => a -> m a
return InputContext
result'
#if defined(ENABLE_OVERLOADING)
data BusCreateInputContextMethodInfo
instance (signature ~ (T.Text -> m IBus.InputContext.InputContext), MonadIO m, IsBus a) => O.MethodInfo BusCreateInputContextMethodInfo a signature where
overloadedMethod = busCreateInputContext
#endif
foreign import ccall "ibus_bus_create_input_context_async" ibus_bus_create_input_context_async ::
Ptr Bus ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busCreateInputContextAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busCreateInputContextAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busCreateInputContextAsync a
bus Text
clientName Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
clientName' <- Text -> IO CString
textToCString Text
clientName
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_create_input_context_async Ptr Bus
bus' CString
clientName' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
clientName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusCreateInputContextAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusCreateInputContextAsyncMethodInfo a signature where
overloadedMethod = busCreateInputContextAsync
#endif
foreign import ccall "ibus_bus_create_input_context_async_finish" ibus_bus_create_input_context_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr IBus.InputContext.InputContext)
busCreateInputContextAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m IBus.InputContext.InputContext
busCreateInputContextAsyncFinish :: a -> b -> m InputContext
busCreateInputContextAsyncFinish a
bus b
res = IO InputContext -> m InputContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InputContext -> m InputContext)
-> IO InputContext -> m InputContext
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO InputContext -> IO () -> IO InputContext
forall a b. IO a -> IO b -> IO a
onException (do
Ptr InputContext
result <- (Ptr (Ptr GError) -> IO (Ptr InputContext))
-> IO (Ptr InputContext)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr InputContext))
-> IO (Ptr InputContext))
-> (Ptr (Ptr GError) -> IO (Ptr InputContext))
-> IO (Ptr InputContext)
forall a b. (a -> b) -> a -> b
$ Ptr Bus
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr InputContext)
ibus_bus_create_input_context_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
Text -> Ptr InputContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busCreateInputContextAsyncFinish" Ptr InputContext
result
InputContext
result' <- ((ManagedPtr InputContext -> InputContext)
-> Ptr InputContext -> IO InputContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputContext -> InputContext
IBus.InputContext.InputContext) Ptr InputContext
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
InputContext -> IO InputContext
forall (m :: * -> *) a. Monad m => a -> m a
return InputContext
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusCreateInputContextAsyncFinishMethodInfo
instance (signature ~ (b -> m IBus.InputContext.InputContext), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusCreateInputContextAsyncFinishMethodInfo a signature where
overloadedMethod = busCreateInputContextAsyncFinish
#endif
foreign import ccall "ibus_bus_current_input_context" ibus_bus_current_input_context ::
Ptr Bus ->
IO CString
busCurrentInputContext ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m T.Text
busCurrentInputContext :: a -> m Text
busCurrentInputContext a
bus = IO Text -> m Text
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
result <- Ptr Bus -> IO CString
ibus_bus_current_input_context Ptr Bus
bus'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busCurrentInputContext" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data BusCurrentInputContextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsBus a) => O.MethodInfo BusCurrentInputContextMethodInfo a signature where
overloadedMethod = busCurrentInputContext
#endif
foreign import ccall "ibus_bus_current_input_context_async" ibus_bus_current_input_context_async ::
Ptr Bus ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busCurrentInputContextAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busCurrentInputContextAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busCurrentInputContextAsync a
bus Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_current_input_context_async Ptr Bus
bus' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusCurrentInputContextAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusCurrentInputContextAsyncMethodInfo a signature where
overloadedMethod = busCurrentInputContextAsync
#endif
foreign import ccall "ibus_bus_current_input_context_async_finish" ibus_bus_current_input_context_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CString
busCurrentInputContextAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m T.Text
busCurrentInputContextAsyncFinish :: a -> b -> m Text
busCurrentInputContextAsyncFinish a
bus b
res = IO Text -> m Text
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CString
ibus_bus_current_input_context_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busCurrentInputContextAsyncFinish" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusCurrentInputContextAsyncFinishMethodInfo
instance (signature ~ (b -> m T.Text), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusCurrentInputContextAsyncFinishMethodInfo a signature where
overloadedMethod = busCurrentInputContextAsyncFinish
#endif
foreign import ccall "ibus_bus_exit" ibus_bus_exit ::
Ptr Bus ->
CInt ->
IO CInt
busExit ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Bool
-> m Bool
busExit :: a -> Bool -> m Bool
busExit a
bus Bool
restart = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
let restart' :: CInt
restart' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
restart
CInt
result <- Ptr Bus -> CInt -> IO CInt
ibus_bus_exit Ptr Bus
bus' CInt
restart'
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
bus
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusExitMethodInfo
instance (signature ~ (Bool -> m Bool), MonadIO m, IsBus a) => O.MethodInfo BusExitMethodInfo a signature where
overloadedMethod = busExit
#endif
foreign import ccall "ibus_bus_exit_async" ibus_bus_exit_async ::
Ptr Bus ->
CInt ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busExitAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> Bool
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busExitAsync :: a -> Bool -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busExitAsync a
bus Bool
restart Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
let restart' :: CInt
restart' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
restart
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CInt
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_exit_async Ptr Bus
bus' CInt
restart' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusExitAsyncMethodInfo
instance (signature ~ (Bool -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusExitAsyncMethodInfo a signature where
overloadedMethod = busExitAsync
#endif
foreign import ccall "ibus_bus_exit_async_finish" ibus_bus_exit_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
busExitAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busExitAsyncFinish :: a -> b -> m ()
busExitAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_exit_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusExitAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusExitAsyncFinishMethodInfo a signature where
overloadedMethod = busExitAsyncFinish
#endif
foreign import ccall "ibus_bus_get_config" ibus_bus_get_config ::
Ptr Bus ->
IO (Ptr IBus.Config.Config)
busGetConfig ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m IBus.Config.Config
busGetConfig :: a -> m Config
busGetConfig a
bus = IO Config -> m Config
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Config -> m Config) -> IO Config -> m Config
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Config
result <- Ptr Bus -> IO (Ptr Config)
ibus_bus_get_config Ptr Bus
bus'
Text -> Ptr Config -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetConfig" Ptr Config
result
Config
result' <- ((ManagedPtr Config -> Config) -> Ptr Config -> IO Config
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Config -> Config
IBus.Config.Config) Ptr Config
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Config -> IO Config
forall (m :: * -> *) a. Monad m => a -> m a
return Config
result'
#if defined(ENABLE_OVERLOADING)
data BusGetConfigMethodInfo
instance (signature ~ (m IBus.Config.Config), MonadIO m, IsBus a) => O.MethodInfo BusGetConfigMethodInfo a signature where
overloadedMethod = busGetConfig
#endif
foreign import ccall "ibus_bus_get_connection" ibus_bus_get_connection ::
Ptr Bus ->
IO (Ptr Gio.DBusConnection.DBusConnection)
busGetConnection ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m Gio.DBusConnection.DBusConnection
busGetConnection :: a -> m DBusConnection
busGetConnection a
bus = IO DBusConnection -> m DBusConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusConnection -> m DBusConnection)
-> IO DBusConnection -> m DBusConnection
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr DBusConnection
result <- Ptr Bus -> IO (Ptr DBusConnection)
ibus_bus_get_connection Ptr Bus
bus'
Text -> Ptr DBusConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetConnection" Ptr DBusConnection
result
DBusConnection
result' <- ((ManagedPtr DBusConnection -> DBusConnection)
-> Ptr DBusConnection -> IO DBusConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DBusConnection -> DBusConnection
Gio.DBusConnection.DBusConnection) Ptr DBusConnection
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
DBusConnection -> IO DBusConnection
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'
#if defined(ENABLE_OVERLOADING)
data BusGetConnectionMethodInfo
instance (signature ~ (m Gio.DBusConnection.DBusConnection), MonadIO m, IsBus a) => O.MethodInfo BusGetConnectionMethodInfo a signature where
overloadedMethod = busGetConnection
#endif
foreign import ccall "ibus_bus_get_engines_by_names" ibus_bus_get_engines_by_names ::
Ptr Bus ->
Ptr CString ->
IO (Ptr (Ptr IBus.EngineDesc.EngineDesc))
busGetEnginesByNames ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> [T.Text]
-> m [IBus.EngineDesc.EngineDesc]
busGetEnginesByNames :: a -> [Text] -> m [EngineDesc]
busGetEnginesByNames a
bus [Text]
names = IO [EngineDesc] -> m [EngineDesc]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [EngineDesc] -> m [EngineDesc])
-> IO [EngineDesc] -> m [EngineDesc]
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr CString
names' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
names
Ptr (Ptr EngineDesc)
result <- Ptr Bus -> Ptr CString -> IO (Ptr (Ptr EngineDesc))
ibus_bus_get_engines_by_names Ptr Bus
bus' Ptr CString
names'
Text -> Ptr (Ptr EngineDesc) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetEnginesByNames" Ptr (Ptr EngineDesc)
result
[Ptr EngineDesc]
result' <- Ptr (Ptr EngineDesc) -> IO [Ptr EngineDesc]
forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr EngineDesc)
result
[EngineDesc]
result'' <- (Ptr EngineDesc -> IO EngineDesc)
-> [Ptr EngineDesc] -> IO [EngineDesc]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr EngineDesc -> EngineDesc)
-> Ptr EngineDesc -> IO EngineDesc
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr EngineDesc -> EngineDesc
IBus.EngineDesc.EngineDesc) [Ptr EngineDesc]
result'
Ptr (Ptr EngineDesc) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr EngineDesc)
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
names'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
names'
[EngineDesc] -> IO [EngineDesc]
forall (m :: * -> *) a. Monad m => a -> m a
return [EngineDesc]
result''
#if defined(ENABLE_OVERLOADING)
data BusGetEnginesByNamesMethodInfo
instance (signature ~ ([T.Text] -> m [IBus.EngineDesc.EngineDesc]), MonadIO m, IsBus a) => O.MethodInfo BusGetEnginesByNamesMethodInfo a signature where
overloadedMethod = busGetEnginesByNames
#endif
foreign import ccall "ibus_bus_get_global_engine" ibus_bus_get_global_engine ::
Ptr Bus ->
IO (Ptr IBus.EngineDesc.EngineDesc)
busGetGlobalEngine ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m IBus.EngineDesc.EngineDesc
busGetGlobalEngine :: a -> m EngineDesc
busGetGlobalEngine a
bus = IO EngineDesc -> m EngineDesc
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EngineDesc -> m EngineDesc) -> IO EngineDesc -> m EngineDesc
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr EngineDesc
result <- Ptr Bus -> IO (Ptr EngineDesc)
ibus_bus_get_global_engine Ptr Bus
bus'
Text -> Ptr EngineDesc -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetGlobalEngine" Ptr EngineDesc
result
EngineDesc
result' <- ((ManagedPtr EngineDesc -> EngineDesc)
-> Ptr EngineDesc -> IO EngineDesc
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr EngineDesc -> EngineDesc
IBus.EngineDesc.EngineDesc) Ptr EngineDesc
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
EngineDesc -> IO EngineDesc
forall (m :: * -> *) a. Monad m => a -> m a
return EngineDesc
result'
#if defined(ENABLE_OVERLOADING)
data BusGetGlobalEngineMethodInfo
instance (signature ~ (m IBus.EngineDesc.EngineDesc), MonadIO m, IsBus a) => O.MethodInfo BusGetGlobalEngineMethodInfo a signature where
overloadedMethod = busGetGlobalEngine
#endif
foreign import ccall "ibus_bus_get_global_engine_async" ibus_bus_get_global_engine_async ::
Ptr Bus ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busGetGlobalEngineAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busGetGlobalEngineAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busGetGlobalEngineAsync a
bus Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_get_global_engine_async Ptr Bus
bus' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusGetGlobalEngineAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusGetGlobalEngineAsyncMethodInfo a signature where
overloadedMethod = busGetGlobalEngineAsync
#endif
foreign import ccall "ibus_bus_get_global_engine_async_finish" ibus_bus_get_global_engine_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr IBus.EngineDesc.EngineDesc)
busGetGlobalEngineAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m IBus.EngineDesc.EngineDesc
busGetGlobalEngineAsyncFinish :: a -> b -> m EngineDesc
busGetGlobalEngineAsyncFinish a
bus b
res = IO EngineDesc -> m EngineDesc
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EngineDesc -> m EngineDesc) -> IO EngineDesc -> m EngineDesc
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO EngineDesc -> IO () -> IO EngineDesc
forall a b. IO a -> IO b -> IO a
onException (do
Ptr EngineDesc
result <- (Ptr (Ptr GError) -> IO (Ptr EngineDesc)) -> IO (Ptr EngineDesc)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr EngineDesc)) -> IO (Ptr EngineDesc))
-> (Ptr (Ptr GError) -> IO (Ptr EngineDesc)) -> IO (Ptr EngineDesc)
forall a b. (a -> b) -> a -> b
$ Ptr Bus
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr EngineDesc)
ibus_bus_get_global_engine_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
Text -> Ptr EngineDesc -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetGlobalEngineAsyncFinish" Ptr EngineDesc
result
EngineDesc
result' <- ((ManagedPtr EngineDesc -> EngineDesc)
-> Ptr EngineDesc -> IO EngineDesc
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr EngineDesc -> EngineDesc
IBus.EngineDesc.EngineDesc) Ptr EngineDesc
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
EngineDesc -> IO EngineDesc
forall (m :: * -> *) a. Monad m => a -> m a
return EngineDesc
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusGetGlobalEngineAsyncFinishMethodInfo
instance (signature ~ (b -> m IBus.EngineDesc.EngineDesc), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusGetGlobalEngineAsyncFinishMethodInfo a signature where
overloadedMethod = busGetGlobalEngineAsyncFinish
#endif
foreign import ccall "ibus_bus_get_ibus_property" ibus_bus_get_ibus_property ::
Ptr Bus ->
CString ->
IO (Ptr GVariant)
busGetIbusProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> m GVariant
busGetIbusProperty :: a -> Text -> m GVariant
busGetIbusProperty a
bus Text
propertyName = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
propertyName' <- Text -> IO CString
textToCString Text
propertyName
Ptr GVariant
result <- Ptr Bus -> CString -> IO (Ptr GVariant)
ibus_bus_get_ibus_property Ptr Bus
bus' CString
propertyName'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetIbusProperty" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
propertyName'
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
#if defined(ENABLE_OVERLOADING)
data BusGetIbusPropertyMethodInfo
instance (signature ~ (T.Text -> m GVariant), MonadIO m, IsBus a) => O.MethodInfo BusGetIbusPropertyMethodInfo a signature where
overloadedMethod = busGetIbusProperty
#endif
foreign import ccall "ibus_bus_get_ibus_property_async" ibus_bus_get_ibus_property_async ::
Ptr Bus ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busGetIbusPropertyAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busGetIbusPropertyAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busGetIbusPropertyAsync a
bus Text
propertyName Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
propertyName' <- Text -> IO CString
textToCString Text
propertyName
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_get_ibus_property_async Ptr Bus
bus' CString
propertyName' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
propertyName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusGetIbusPropertyAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusGetIbusPropertyAsyncMethodInfo a signature where
overloadedMethod = busGetIbusPropertyAsync
#endif
foreign import ccall "ibus_bus_get_ibus_property_async_finish" ibus_bus_get_ibus_property_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
busGetIbusPropertyAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m GVariant
busGetIbusPropertyAsyncFinish :: a -> b -> m GVariant
busGetIbusPropertyAsyncFinish a
bus b
res = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO GVariant -> IO () -> IO GVariant
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GVariant
result <- (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant))
-> (Ptr (Ptr GError) -> IO (Ptr GVariant)) -> IO (Ptr GVariant)
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr GVariant)
ibus_bus_get_ibus_property_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetIbusPropertyAsyncFinish" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusGetIbusPropertyAsyncFinishMethodInfo
instance (signature ~ (b -> m GVariant), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusGetIbusPropertyAsyncFinishMethodInfo a signature where
overloadedMethod = busGetIbusPropertyAsyncFinish
#endif
foreign import ccall "ibus_bus_get_name_owner" ibus_bus_get_name_owner ::
Ptr Bus ->
CString ->
IO CString
busGetNameOwner ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> m T.Text
busGetNameOwner :: a -> Text -> m Text
busGetNameOwner a
bus Text
name = IO Text -> m Text
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
name' <- Text -> IO CString
textToCString Text
name
CString
result <- Ptr Bus -> CString -> IO CString
ibus_bus_get_name_owner Ptr Bus
bus' CString
name'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetNameOwner" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data BusGetNameOwnerMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsBus a) => O.MethodInfo BusGetNameOwnerMethodInfo a signature where
overloadedMethod = busGetNameOwner
#endif
foreign import ccall "ibus_bus_get_name_owner_async" ibus_bus_get_name_owner_async ::
Ptr Bus ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busGetNameOwnerAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busGetNameOwnerAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busGetNameOwnerAsync a
bus Text
name Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_get_name_owner_async Ptr Bus
bus' CString
name' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusGetNameOwnerAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusGetNameOwnerAsyncMethodInfo a signature where
overloadedMethod = busGetNameOwnerAsync
#endif
foreign import ccall "ibus_bus_get_name_owner_async_finish" ibus_bus_get_name_owner_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CString
busGetNameOwnerAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m T.Text
busGetNameOwnerAsyncFinish :: a -> b -> m Text
busGetNameOwnerAsyncFinish a
bus b
res = IO Text -> m Text
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CString
ibus_bus_get_name_owner_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetNameOwnerAsyncFinish" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusGetNameOwnerAsyncFinishMethodInfo
instance (signature ~ (b -> m T.Text), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusGetNameOwnerAsyncFinishMethodInfo a signature where
overloadedMethod = busGetNameOwnerAsyncFinish
#endif
foreign import ccall "ibus_bus_get_service_name" ibus_bus_get_service_name ::
Ptr Bus ->
IO CString
busGetServiceName ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m T.Text
busGetServiceName :: a -> m Text
busGetServiceName a
bus = IO Text -> m Text
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
result <- Ptr Bus -> IO CString
ibus_bus_get_service_name Ptr Bus
bus'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busGetServiceName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data BusGetServiceNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsBus a) => O.MethodInfo BusGetServiceNameMethodInfo a signature where
overloadedMethod = busGetServiceName
#endif
foreign import ccall "ibus_bus_get_use_global_engine" ibus_bus_get_use_global_engine ::
Ptr Bus ->
IO CInt
{-# DEPRECATED busGetUseGlobalEngine ["(Since version 1.5.3)","Currently global engine is always used."] #-}
busGetUseGlobalEngine ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m Bool
busGetUseGlobalEngine :: a -> m Bool
busGetUseGlobalEngine a
bus = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CInt
result <- Ptr Bus -> IO CInt
ibus_bus_get_use_global_engine Ptr Bus
bus'
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
bus
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusGetUseGlobalEngineMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBus a) => O.MethodInfo BusGetUseGlobalEngineMethodInfo a signature where
overloadedMethod = busGetUseGlobalEngine
#endif
foreign import ccall "ibus_bus_get_use_global_engine_async" ibus_bus_get_use_global_engine_async ::
Ptr Bus ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
{-# DEPRECATED busGetUseGlobalEngineAsync ["(Since version 1.5.3)","Currently global engine is always used."] #-}
busGetUseGlobalEngineAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busGetUseGlobalEngineAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busGetUseGlobalEngineAsync a
bus Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_get_use_global_engine_async Ptr Bus
bus' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusGetUseGlobalEngineAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusGetUseGlobalEngineAsyncMethodInfo a signature where
overloadedMethod = busGetUseGlobalEngineAsync
#endif
foreign import ccall "ibus_bus_get_use_global_engine_async_finish" ibus_bus_get_use_global_engine_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
{-# DEPRECATED busGetUseGlobalEngineAsyncFinish ["(Since version 1.5.3)","Currently global engine is always used."] #-}
busGetUseGlobalEngineAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busGetUseGlobalEngineAsyncFinish :: a -> b -> m ()
busGetUseGlobalEngineAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_get_use_global_engine_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusGetUseGlobalEngineAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusGetUseGlobalEngineAsyncFinishMethodInfo a signature where
overloadedMethod = busGetUseGlobalEngineAsyncFinish
#endif
foreign import ccall "ibus_bus_get_use_sys_layout" ibus_bus_get_use_sys_layout ::
Ptr Bus ->
IO CInt
{-# DEPRECATED busGetUseSysLayout ["(Since version 1.5.3)","Read dconf value","\\/desktop\\/ibus\\/general\\/use_system_keyboard_layout instead."] #-}
busGetUseSysLayout ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m Bool
busGetUseSysLayout :: a -> m Bool
busGetUseSysLayout a
bus = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CInt
result <- Ptr Bus -> IO CInt
ibus_bus_get_use_sys_layout Ptr Bus
bus'
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
bus
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusGetUseSysLayoutMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBus a) => O.MethodInfo BusGetUseSysLayoutMethodInfo a signature where
overloadedMethod = busGetUseSysLayout
#endif
foreign import ccall "ibus_bus_get_use_sys_layout_async" ibus_bus_get_use_sys_layout_async ::
Ptr Bus ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
{-# DEPRECATED busGetUseSysLayoutAsync ["(Since version 1.5.3)","Read dconf value","\\/desktop\\/ibus\\/general\\/use_system_keyboard_layout instead."] #-}
busGetUseSysLayoutAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busGetUseSysLayoutAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busGetUseSysLayoutAsync a
bus Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_get_use_sys_layout_async Ptr Bus
bus' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusGetUseSysLayoutAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusGetUseSysLayoutAsyncMethodInfo a signature where
overloadedMethod = busGetUseSysLayoutAsync
#endif
foreign import ccall "ibus_bus_get_use_sys_layout_async_finish" ibus_bus_get_use_sys_layout_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
{-# DEPRECATED busGetUseSysLayoutAsyncFinish ["(Since version 1.5.3)","Read dconf value","\\/desktop\\/ibus\\/general\\/use_system_keyboard_layout instead."] #-}
busGetUseSysLayoutAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busGetUseSysLayoutAsyncFinish :: a -> b -> m ()
busGetUseSysLayoutAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_get_use_sys_layout_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusGetUseSysLayoutAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusGetUseSysLayoutAsyncFinishMethodInfo a signature where
overloadedMethod = busGetUseSysLayoutAsyncFinish
#endif
foreign import ccall "ibus_bus_hello" ibus_bus_hello ::
Ptr Bus ->
IO CString
busHello ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m T.Text
busHello :: a -> m Text
busHello a
bus = IO Text -> m Text
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
result <- Ptr Bus -> IO CString
ibus_bus_hello Ptr Bus
bus'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"busHello" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data BusHelloMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsBus a) => O.MethodInfo BusHelloMethodInfo a signature where
overloadedMethod = busHello
#endif
foreign import ccall "ibus_bus_is_connected" ibus_bus_is_connected ::
Ptr Bus ->
IO CInt
busIsConnected ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m Bool
busIsConnected :: a -> m Bool
busIsConnected a
bus = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CInt
result <- Ptr Bus -> IO CInt
ibus_bus_is_connected Ptr Bus
bus'
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
bus
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusIsConnectedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBus a) => O.MethodInfo BusIsConnectedMethodInfo a signature where
overloadedMethod = busIsConnected
#endif
foreign import ccall "ibus_bus_is_global_engine_enabled" ibus_bus_is_global_engine_enabled ::
Ptr Bus ->
IO CInt
{-# DEPRECATED busIsGlobalEngineEnabled ["(Since version 1.5.3)","Probably this would be used for Chrome OS only.","Currently global engine is always used and 'GI.IBus.Objects.Bus.busGetGlobalEngine'","returns NULL until the first global engine is assigned.","You can use 'GI.IBus.Functions.setLogHandler' to disable a warning when","'GI.IBus.Objects.Bus.busGetGlobalEngine' returns NULL."] #-}
busIsGlobalEngineEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m Bool
busIsGlobalEngineEnabled :: a -> m Bool
busIsGlobalEngineEnabled a
bus = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CInt
result <- Ptr Bus -> IO CInt
ibus_bus_is_global_engine_enabled Ptr Bus
bus'
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
bus
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusIsGlobalEngineEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBus a) => O.MethodInfo BusIsGlobalEngineEnabledMethodInfo a signature where
overloadedMethod = busIsGlobalEngineEnabled
#endif
foreign import ccall "ibus_bus_is_global_engine_enabled_async" ibus_bus_is_global_engine_enabled_async ::
Ptr Bus ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
{-# DEPRECATED busIsGlobalEngineEnabledAsync ["(Since version 1.5.3)","Probably this would be used for Chrome OS only.","Currently global engine is always used and 'GI.IBus.Objects.Bus.busGetGlobalEngine'","returns NULL until the first global engine is assigned.","You can use 'GI.IBus.Functions.setLogHandler' to disable a warning when","'GI.IBus.Objects.Bus.busGetGlobalEngine' returns NULL."] #-}
busIsGlobalEngineEnabledAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busIsGlobalEngineEnabledAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busIsGlobalEngineEnabledAsync a
bus Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_is_global_engine_enabled_async Ptr Bus
bus' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusIsGlobalEngineEnabledAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusIsGlobalEngineEnabledAsyncMethodInfo a signature where
overloadedMethod = busIsGlobalEngineEnabledAsync
#endif
foreign import ccall "ibus_bus_is_global_engine_enabled_async_finish" ibus_bus_is_global_engine_enabled_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
{-# DEPRECATED busIsGlobalEngineEnabledAsyncFinish ["(Since version 1.5.3)","Probably this would be used for Chrome OS only.","Currently global engine is always used and 'GI.IBus.Objects.Bus.busGetGlobalEngine'","returns NULL until the first global engine is assigned.","You can use 'GI.IBus.Functions.setLogHandler' to disable a warning when","'GI.IBus.Objects.Bus.busGetGlobalEngine' returns NULL."] #-}
busIsGlobalEngineEnabledAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busIsGlobalEngineEnabledAsyncFinish :: a -> b -> m ()
busIsGlobalEngineEnabledAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_is_global_engine_enabled_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusIsGlobalEngineEnabledAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusIsGlobalEngineEnabledAsyncFinishMethodInfo a signature where
overloadedMethod = busIsGlobalEngineEnabledAsyncFinish
#endif
foreign import ccall "ibus_bus_list_active_engines" ibus_bus_list_active_engines ::
Ptr Bus ->
IO (Ptr (GList (Ptr IBus.EngineDesc.EngineDesc)))
{-# DEPRECATED busListActiveEngines ["(Since version 1.5.3)","Read dconf value","\\/desktop\\/ibus\\/general\\/preload-engines instead."] #-}
busListActiveEngines ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m [IBus.EngineDesc.EngineDesc]
busListActiveEngines :: a -> m [EngineDesc]
busListActiveEngines a
bus = IO [EngineDesc] -> m [EngineDesc]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [EngineDesc] -> m [EngineDesc])
-> IO [EngineDesc] -> m [EngineDesc]
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr (GList (Ptr EngineDesc))
result <- Ptr Bus -> IO (Ptr (GList (Ptr EngineDesc)))
ibus_bus_list_active_engines Ptr Bus
bus'
[Ptr EngineDesc]
result' <- Ptr (GList (Ptr EngineDesc)) -> IO [Ptr EngineDesc]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr EngineDesc))
result
[EngineDesc]
result'' <- (Ptr EngineDesc -> IO EngineDesc)
-> [Ptr EngineDesc] -> IO [EngineDesc]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr EngineDesc -> EngineDesc)
-> Ptr EngineDesc -> IO EngineDesc
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr EngineDesc -> EngineDesc
IBus.EngineDesc.EngineDesc) [Ptr EngineDesc]
result'
Ptr (GList (Ptr EngineDesc)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr EngineDesc))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
[EngineDesc] -> IO [EngineDesc]
forall (m :: * -> *) a. Monad m => a -> m a
return [EngineDesc]
result''
#if defined(ENABLE_OVERLOADING)
data BusListActiveEnginesMethodInfo
instance (signature ~ (m [IBus.EngineDesc.EngineDesc]), MonadIO m, IsBus a) => O.MethodInfo BusListActiveEnginesMethodInfo a signature where
overloadedMethod = busListActiveEngines
#endif
foreign import ccall "ibus_bus_list_active_engines_async" ibus_bus_list_active_engines_async ::
Ptr Bus ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
{-# DEPRECATED busListActiveEnginesAsync ["(Since version 1.5.3)","Read dconf value","\\/desktop\\/ibus\\/general\\/preload-engines instead."] #-}
busListActiveEnginesAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busListActiveEnginesAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busListActiveEnginesAsync a
bus Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_list_active_engines_async Ptr Bus
bus' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusListActiveEnginesAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusListActiveEnginesAsyncMethodInfo a signature where
overloadedMethod = busListActiveEnginesAsync
#endif
foreign import ccall "ibus_bus_list_active_engines_async_finish" ibus_bus_list_active_engines_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr IBus.EngineDesc.EngineDesc)))
{-# DEPRECATED busListActiveEnginesAsyncFinish ["(Since version 1.5.3)","Read dconf value","\\/desktop\\/ibus\\/general\\/preload-engines instead."] #-}
busListActiveEnginesAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [IBus.EngineDesc.EngineDesc]
busListActiveEnginesAsyncFinish :: a -> b -> m [EngineDesc]
busListActiveEnginesAsyncFinish a
bus b
res = IO [EngineDesc] -> m [EngineDesc]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [EngineDesc] -> m [EngineDesc])
-> IO [EngineDesc] -> m [EngineDesc]
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO [EngineDesc] -> IO () -> IO [EngineDesc]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr EngineDesc))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr EngineDesc))))
-> IO (Ptr (GList (Ptr EngineDesc)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr EngineDesc))))
-> IO (Ptr (GList (Ptr EngineDesc))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr EngineDesc))))
-> IO (Ptr (GList (Ptr EngineDesc)))
forall a b. (a -> b) -> a -> b
$ Ptr Bus
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr EngineDesc)))
ibus_bus_list_active_engines_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
[Ptr EngineDesc]
result' <- Ptr (GList (Ptr EngineDesc)) -> IO [Ptr EngineDesc]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr EngineDesc))
result
[EngineDesc]
result'' <- (Ptr EngineDesc -> IO EngineDesc)
-> [Ptr EngineDesc] -> IO [EngineDesc]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr EngineDesc -> EngineDesc)
-> Ptr EngineDesc -> IO EngineDesc
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr EngineDesc -> EngineDesc
IBus.EngineDesc.EngineDesc) [Ptr EngineDesc]
result'
Ptr (GList (Ptr EngineDesc)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr EngineDesc))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
[EngineDesc] -> IO [EngineDesc]
forall (m :: * -> *) a. Monad m => a -> m a
return [EngineDesc]
result''
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusListActiveEnginesAsyncFinishMethodInfo
instance (signature ~ (b -> m [IBus.EngineDesc.EngineDesc]), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusListActiveEnginesAsyncFinishMethodInfo a signature where
overloadedMethod = busListActiveEnginesAsyncFinish
#endif
foreign import ccall "ibus_bus_list_engines" ibus_bus_list_engines ::
Ptr Bus ->
IO (Ptr (GList (Ptr IBus.EngineDesc.EngineDesc)))
busListEngines ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m [IBus.EngineDesc.EngineDesc]
busListEngines :: a -> m [EngineDesc]
busListEngines a
bus = IO [EngineDesc] -> m [EngineDesc]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [EngineDesc] -> m [EngineDesc])
-> IO [EngineDesc] -> m [EngineDesc]
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr (GList (Ptr EngineDesc))
result <- Ptr Bus -> IO (Ptr (GList (Ptr EngineDesc)))
ibus_bus_list_engines Ptr Bus
bus'
[Ptr EngineDesc]
result' <- Ptr (GList (Ptr EngineDesc)) -> IO [Ptr EngineDesc]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr EngineDesc))
result
[EngineDesc]
result'' <- (Ptr EngineDesc -> IO EngineDesc)
-> [Ptr EngineDesc] -> IO [EngineDesc]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr EngineDesc -> EngineDesc)
-> Ptr EngineDesc -> IO EngineDesc
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr EngineDesc -> EngineDesc
IBus.EngineDesc.EngineDesc) [Ptr EngineDesc]
result'
Ptr (GList (Ptr EngineDesc)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr EngineDesc))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
[EngineDesc] -> IO [EngineDesc]
forall (m :: * -> *) a. Monad m => a -> m a
return [EngineDesc]
result''
#if defined(ENABLE_OVERLOADING)
data BusListEnginesMethodInfo
instance (signature ~ (m [IBus.EngineDesc.EngineDesc]), MonadIO m, IsBus a) => O.MethodInfo BusListEnginesMethodInfo a signature where
overloadedMethod = busListEngines
#endif
foreign import ccall "ibus_bus_list_engines_async" ibus_bus_list_engines_async ::
Ptr Bus ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busListEnginesAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busListEnginesAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busListEnginesAsync a
bus Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_list_engines_async Ptr Bus
bus' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusListEnginesAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusListEnginesAsyncMethodInfo a signature where
overloadedMethod = busListEnginesAsync
#endif
foreign import ccall "ibus_bus_list_engines_async_finish" ibus_bus_list_engines_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr IBus.EngineDesc.EngineDesc)))
busListEnginesAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [IBus.EngineDesc.EngineDesc]
busListEnginesAsyncFinish :: a -> b -> m [EngineDesc]
busListEnginesAsyncFinish a
bus b
res = IO [EngineDesc] -> m [EngineDesc]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [EngineDesc] -> m [EngineDesc])
-> IO [EngineDesc] -> m [EngineDesc]
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO [EngineDesc] -> IO () -> IO [EngineDesc]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr EngineDesc))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr EngineDesc))))
-> IO (Ptr (GList (Ptr EngineDesc)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr EngineDesc))))
-> IO (Ptr (GList (Ptr EngineDesc))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr EngineDesc))))
-> IO (Ptr (GList (Ptr EngineDesc)))
forall a b. (a -> b) -> a -> b
$ Ptr Bus
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr EngineDesc)))
ibus_bus_list_engines_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
[Ptr EngineDesc]
result' <- Ptr (GList (Ptr EngineDesc)) -> IO [Ptr EngineDesc]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr EngineDesc))
result
[EngineDesc]
result'' <- (Ptr EngineDesc -> IO EngineDesc)
-> [Ptr EngineDesc] -> IO [EngineDesc]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr EngineDesc -> EngineDesc)
-> Ptr EngineDesc -> IO EngineDesc
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr EngineDesc -> EngineDesc
IBus.EngineDesc.EngineDesc) [Ptr EngineDesc]
result'
Ptr (GList (Ptr EngineDesc)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr EngineDesc))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
[EngineDesc] -> IO [EngineDesc]
forall (m :: * -> *) a. Monad m => a -> m a
return [EngineDesc]
result''
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusListEnginesAsyncFinishMethodInfo
instance (signature ~ (b -> m [IBus.EngineDesc.EngineDesc]), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusListEnginesAsyncFinishMethodInfo a signature where
overloadedMethod = busListEnginesAsyncFinish
#endif
foreign import ccall "ibus_bus_list_names" ibus_bus_list_names ::
Ptr Bus ->
IO (Ptr (GList CString))
busListNames ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> m [T.Text]
busListNames :: a -> m [Text]
busListNames a
bus = IO [Text] -> m [Text]
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr (GList CString)
result <- Ptr Bus -> IO (Ptr (GList CString))
ibus_bus_list_names Ptr Bus
bus'
[CString]
result' <- Ptr (GList CString) -> IO [CString]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList CString)
result
[Text]
result'' <- (CString -> IO Text) -> [CString] -> IO [Text]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText [CString]
result'
(CString -> IO ()) -> Ptr (GList CString) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (GList (Ptr a)) -> IO ()
mapGList CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (GList CString)
result
Ptr (GList CString) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList CString)
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result''
#if defined(ENABLE_OVERLOADING)
data BusListNamesMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsBus a) => O.MethodInfo BusListNamesMethodInfo a signature where
overloadedMethod = busListNames
#endif
foreign import ccall "ibus_bus_list_queued_owners" ibus_bus_list_queued_owners ::
Ptr Bus ->
CString ->
IO (Ptr (GList CString))
busListQueuedOwners ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> m [T.Text]
busListQueuedOwners :: a -> Text -> m [Text]
busListQueuedOwners a
bus Text
name = IO [Text] -> m [Text]
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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr (GList CString)
result <- Ptr Bus -> CString -> IO (Ptr (GList CString))
ibus_bus_list_queued_owners Ptr Bus
bus' CString
name'
[CString]
result' <- Ptr (GList CString) -> IO [CString]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList CString)
result
[Text]
result'' <- (CString -> IO Text) -> [CString] -> IO [Text]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText [CString]
result'
(CString -> IO ()) -> Ptr (GList CString) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (GList (Ptr a)) -> IO ()
mapGList CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (GList CString)
result
Ptr (GList CString) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList CString)
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result''
#if defined(ENABLE_OVERLOADING)
data BusListQueuedOwnersMethodInfo
instance (signature ~ (T.Text -> m [T.Text]), MonadIO m, IsBus a) => O.MethodInfo BusListQueuedOwnersMethodInfo a signature where
overloadedMethod = busListQueuedOwners
#endif
foreign import ccall "ibus_bus_name_has_owner" ibus_bus_name_has_owner ::
Ptr Bus ->
CString ->
IO CInt
busNameHasOwner ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> m Bool
busNameHasOwner :: a -> Text -> m Bool
busNameHasOwner a
bus Text
name = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
name' <- Text -> IO CString
textToCString Text
name
CInt
result <- Ptr Bus -> CString -> IO CInt
ibus_bus_name_has_owner Ptr Bus
bus' CString
name'
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
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusNameHasOwnerMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsBus a) => O.MethodInfo BusNameHasOwnerMethodInfo a signature where
overloadedMethod = busNameHasOwner
#endif
foreign import ccall "ibus_bus_name_has_owner_async" ibus_bus_name_has_owner_async ::
Ptr Bus ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busNameHasOwnerAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busNameHasOwnerAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busNameHasOwnerAsync a
bus Text
name Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_name_has_owner_async Ptr Bus
bus' CString
name' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusNameHasOwnerAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusNameHasOwnerAsyncMethodInfo a signature where
overloadedMethod = busNameHasOwnerAsync
#endif
foreign import ccall "ibus_bus_name_has_owner_async_finish" ibus_bus_name_has_owner_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
busNameHasOwnerAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busNameHasOwnerAsyncFinish :: a -> b -> m ()
busNameHasOwnerAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_name_has_owner_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusNameHasOwnerAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusNameHasOwnerAsyncFinishMethodInfo a signature where
overloadedMethod = busNameHasOwnerAsyncFinish
#endif
foreign import ccall "ibus_bus_preload_engines" ibus_bus_preload_engines ::
Ptr Bus ->
Ptr CString ->
IO CInt
busPreloadEngines ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> [T.Text]
-> m Bool
busPreloadEngines :: a -> [Text] -> m Bool
busPreloadEngines a
bus [Text]
names = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr CString
names' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
names
CInt
result <- Ptr Bus -> Ptr CString -> IO CInt
ibus_bus_preload_engines Ptr Bus
bus' Ptr CString
names'
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
bus
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
names'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
names'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusPreloadEnginesMethodInfo
instance (signature ~ ([T.Text] -> m Bool), MonadIO m, IsBus a) => O.MethodInfo BusPreloadEnginesMethodInfo a signature where
overloadedMethod = busPreloadEngines
#endif
foreign import ccall "ibus_bus_preload_engines_async" ibus_bus_preload_engines_async ::
Ptr Bus ->
Ptr CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busPreloadEnginesAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> [T.Text]
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busPreloadEnginesAsync :: a -> [Text] -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busPreloadEnginesAsync a
bus [Text]
names Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr CString
names' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
names
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> Ptr CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_preload_engines_async Ptr Bus
bus' Ptr CString
names' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
names'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
names'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusPreloadEnginesAsyncMethodInfo
instance (signature ~ ([T.Text] -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusPreloadEnginesAsyncMethodInfo a signature where
overloadedMethod = busPreloadEnginesAsync
#endif
foreign import ccall "ibus_bus_preload_engines_async_finish" ibus_bus_preload_engines_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
busPreloadEnginesAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busPreloadEnginesAsyncFinish :: a -> b -> m ()
busPreloadEnginesAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_preload_engines_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusPreloadEnginesAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusPreloadEnginesAsyncFinishMethodInfo a signature where
overloadedMethod = busPreloadEnginesAsyncFinish
#endif
foreign import ccall "ibus_bus_register_component" ibus_bus_register_component ::
Ptr Bus ->
Ptr IBus.Component.Component ->
IO CInt
busRegisterComponent ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, IBus.Component.IsComponent b) =>
a
-> b
-> m Bool
busRegisterComponent :: a -> b -> m Bool
busRegisterComponent a
bus b
component = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Component
component' <- b -> IO (Ptr Component)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
component
CInt
result <- Ptr Bus -> Ptr Component -> IO CInt
ibus_bus_register_component Ptr Bus
bus' Ptr Component
component'
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
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
component
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusRegisterComponentMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsBus a, IBus.Component.IsComponent b) => O.MethodInfo BusRegisterComponentMethodInfo a signature where
overloadedMethod = busRegisterComponent
#endif
foreign import ccall "ibus_bus_register_component_async" ibus_bus_register_component_async ::
Ptr Bus ->
Ptr IBus.Component.Component ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busRegisterComponentAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, IBus.Component.IsComponent b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Int32
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busRegisterComponentAsync :: a -> b -> Int32 -> Maybe c -> Maybe AsyncReadyCallback -> m ()
busRegisterComponentAsync a
bus b
component Int32
timeoutMsec Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr Component
component' <- b -> IO (Ptr Component)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
component
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> Ptr Component
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_register_component_async Ptr Bus
bus' Ptr Component
component' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
component
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusRegisterComponentAsyncMethodInfo
instance (signature ~ (b -> Int32 -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, IBus.Component.IsComponent b, Gio.Cancellable.IsCancellable c) => O.MethodInfo BusRegisterComponentAsyncMethodInfo a signature where
overloadedMethod = busRegisterComponentAsync
#endif
foreign import ccall "ibus_bus_register_component_async_finish" ibus_bus_register_component_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
busRegisterComponentAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busRegisterComponentAsyncFinish :: a -> b -> m ()
busRegisterComponentAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_register_component_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusRegisterComponentAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusRegisterComponentAsyncFinishMethodInfo a signature where
overloadedMethod = busRegisterComponentAsyncFinish
#endif
foreign import ccall "ibus_bus_release_name" ibus_bus_release_name ::
Ptr Bus ->
CString ->
IO Word32
busReleaseName ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> m Word32
busReleaseName :: a -> Text -> m Word32
busReleaseName a
bus Text
name = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
name' <- Text -> IO CString
textToCString Text
name
Word32
result <- Ptr Bus -> CString -> IO Word32
ibus_bus_release_name Ptr Bus
bus' CString
name'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data BusReleaseNameMethodInfo
instance (signature ~ (T.Text -> m Word32), MonadIO m, IsBus a) => O.MethodInfo BusReleaseNameMethodInfo a signature where
overloadedMethod = busReleaseName
#endif
foreign import ccall "ibus_bus_release_name_async" ibus_bus_release_name_async ::
Ptr Bus ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busReleaseNameAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busReleaseNameAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busReleaseNameAsync a
bus Text
name Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_release_name_async Ptr Bus
bus' CString
name' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusReleaseNameAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusReleaseNameAsyncMethodInfo a signature where
overloadedMethod = busReleaseNameAsync
#endif
foreign import ccall "ibus_bus_release_name_async_finish" ibus_bus_release_name_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO Word32
busReleaseNameAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Word32
busReleaseNameAsyncFinish :: a -> b -> m Word32
busReleaseNameAsyncFinish a
bus b
res = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO Word32
ibus_bus_release_name_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusReleaseNameAsyncFinishMethodInfo
instance (signature ~ (b -> m Word32), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusReleaseNameAsyncFinishMethodInfo a signature where
overloadedMethod = busReleaseNameAsyncFinish
#endif
foreign import ccall "ibus_bus_remove_match" ibus_bus_remove_match ::
Ptr Bus ->
CString ->
IO CInt
busRemoveMatch ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> m Bool
busRemoveMatch :: a -> Text -> m Bool
busRemoveMatch a
bus Text
rule = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
rule' <- Text -> IO CString
textToCString Text
rule
CInt
result <- Ptr Bus -> CString -> IO CInt
ibus_bus_remove_match Ptr Bus
bus' CString
rule'
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
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rule'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusRemoveMatchMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsBus a) => O.MethodInfo BusRemoveMatchMethodInfo a signature where
overloadedMethod = busRemoveMatch
#endif
foreign import ccall "ibus_bus_remove_match_async" ibus_bus_remove_match_async ::
Ptr Bus ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busRemoveMatchAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busRemoveMatchAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busRemoveMatchAsync a
bus Text
rule Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
rule' <- Text -> IO CString
textToCString Text
rule
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_remove_match_async Ptr Bus
bus' CString
rule' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rule'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusRemoveMatchAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusRemoveMatchAsyncMethodInfo a signature where
overloadedMethod = busRemoveMatchAsync
#endif
foreign import ccall "ibus_bus_remove_match_async_finish" ibus_bus_remove_match_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
busRemoveMatchAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busRemoveMatchAsyncFinish :: a -> b -> m ()
busRemoveMatchAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_remove_match_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusRemoveMatchAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusRemoveMatchAsyncFinishMethodInfo a signature where
overloadedMethod = busRemoveMatchAsyncFinish
#endif
foreign import ccall "ibus_bus_request_name" ibus_bus_request_name ::
Ptr Bus ->
CString ->
Word32 ->
IO Word32
busRequestName ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> Word32
-> m Word32
busRequestName :: a -> Text -> Word32 -> m Word32
busRequestName a
bus Text
name Word32
flags = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
name' <- Text -> IO CString
textToCString Text
name
Word32
result <- Ptr Bus -> CString -> Word32 -> IO Word32
ibus_bus_request_name Ptr Bus
bus' CString
name' Word32
flags
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data BusRequestNameMethodInfo
instance (signature ~ (T.Text -> Word32 -> m Word32), MonadIO m, IsBus a) => O.MethodInfo BusRequestNameMethodInfo a signature where
overloadedMethod = busRequestName
#endif
foreign import ccall "ibus_bus_request_name_async" ibus_bus_request_name_async ::
Ptr Bus ->
CString ->
Word32 ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busRequestNameAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Word32
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busRequestNameAsync :: a
-> Text
-> Word32
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
busRequestNameAsync a
bus Text
name Word32
flags Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Word32
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_request_name_async Ptr Bus
bus' CString
name' Word32
flags Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusRequestNameAsyncMethodInfo
instance (signature ~ (T.Text -> Word32 -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusRequestNameAsyncMethodInfo a signature where
overloadedMethod = busRequestNameAsync
#endif
foreign import ccall "ibus_bus_request_name_async_finish" ibus_bus_request_name_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO Word32
busRequestNameAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Word32
busRequestNameAsyncFinish :: a -> b -> m Word32
busRequestNameAsyncFinish a
bus b
res = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO Word32 -> IO () -> IO Word32
forall a b. IO a -> IO b -> IO a
onException (do
Word32
result <- (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Word32) -> IO Word32)
-> (Ptr (Ptr GError) -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO Word32
ibus_bus_request_name_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusRequestNameAsyncFinishMethodInfo
instance (signature ~ (b -> m Word32), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusRequestNameAsyncFinishMethodInfo a signature where
overloadedMethod = busRequestNameAsyncFinish
#endif
foreign import ccall "ibus_bus_set_global_engine" ibus_bus_set_global_engine ::
Ptr Bus ->
CString ->
IO CInt
busSetGlobalEngine ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> m Bool
busSetGlobalEngine :: a -> Text -> m Bool
busSetGlobalEngine a
bus Text
globalEngine = 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 Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
globalEngine' <- Text -> IO CString
textToCString Text
globalEngine
CInt
result <- Ptr Bus -> CString -> IO CInt
ibus_bus_set_global_engine Ptr Bus
bus' CString
globalEngine'
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
bus
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
globalEngine'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BusSetGlobalEngineMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsBus a) => O.MethodInfo BusSetGlobalEngineMethodInfo a signature where
overloadedMethod = busSetGlobalEngine
#endif
foreign import ccall "ibus_bus_set_global_engine_async" ibus_bus_set_global_engine_async ::
Ptr Bus ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busSetGlobalEngineAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busSetGlobalEngineAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
busSetGlobalEngineAsync a
bus Text
globalEngine Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
globalEngine' <- Text -> IO CString
textToCString Text
globalEngine
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_set_global_engine_async Ptr Bus
bus' CString
globalEngine' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
globalEngine'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusSetGlobalEngineAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusSetGlobalEngineAsyncMethodInfo a signature where
overloadedMethod = busSetGlobalEngineAsync
#endif
foreign import ccall "ibus_bus_set_global_engine_async_finish" ibus_bus_set_global_engine_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
busSetGlobalEngineAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busSetGlobalEngineAsyncFinish :: a -> b -> m ()
busSetGlobalEngineAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_set_global_engine_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusSetGlobalEngineAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusSetGlobalEngineAsyncFinishMethodInfo a signature where
overloadedMethod = busSetGlobalEngineAsyncFinish
#endif
foreign import ccall "ibus_bus_set_ibus_property" ibus_bus_set_ibus_property ::
Ptr Bus ->
CString ->
Ptr GVariant ->
IO ()
busSetIbusProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> T.Text
-> GVariant
-> m ()
busSetIbusProperty :: a -> Text -> GVariant -> m ()
busSetIbusProperty a
bus Text
propertyName GVariant
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
propertyName' <- Text -> IO CString
textToCString Text
propertyName
Ptr GVariant
value' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
value
Ptr Bus -> CString -> Ptr GVariant -> IO ()
ibus_bus_set_ibus_property Ptr Bus
bus' CString
propertyName' Ptr GVariant
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
value
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
propertyName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusSetIbusPropertyMethodInfo
instance (signature ~ (T.Text -> GVariant -> m ()), MonadIO m, IsBus a) => O.MethodInfo BusSetIbusPropertyMethodInfo a signature where
overloadedMethod = busSetIbusProperty
#endif
foreign import ccall "ibus_bus_set_ibus_property_async" ibus_bus_set_ibus_property_async ::
Ptr Bus ->
CString ->
Ptr GVariant ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
busSetIbusPropertyAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> GVariant
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
busSetIbusPropertyAsync :: a
-> Text
-> GVariant
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
busSetIbusPropertyAsync a
bus Text
propertyName GVariant
value Int32
timeoutMsec Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
CString
propertyName' <- Text -> IO CString
textToCString Text
propertyName
Ptr GVariant
value' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
value
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Bus
-> CString
-> Ptr GVariant
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ibus_bus_set_ibus_property_async Ptr Bus
bus' CString
propertyName' Ptr GVariant
value' Int32
timeoutMsec Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
value
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
propertyName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusSetIbusPropertyAsyncMethodInfo
instance (signature ~ (T.Text -> GVariant -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBus a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BusSetIbusPropertyAsyncMethodInfo a signature where
overloadedMethod = busSetIbusPropertyAsync
#endif
foreign import ccall "ibus_bus_set_ibus_property_async_finish" ibus_bus_set_ibus_property_async_finish ::
Ptr Bus ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
busSetIbusPropertyAsyncFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
busSetIbusPropertyAsyncFinish :: a -> b -> m ()
busSetIbusPropertyAsyncFinish a
bus b
res = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Bus -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
ibus_bus_set_ibus_property_async_finish Ptr Bus
bus' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data BusSetIbusPropertyAsyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsBus a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BusSetIbusPropertyAsyncFinishMethodInfo a signature where
overloadedMethod = busSetIbusPropertyAsyncFinish
#endif
foreign import ccall "ibus_bus_set_watch_dbus_signal" ibus_bus_set_watch_dbus_signal ::
Ptr Bus ->
CInt ->
IO ()
busSetWatchDbusSignal ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Bool
-> m ()
busSetWatchDbusSignal :: a -> Bool -> m ()
busSetWatchDbusSignal a
bus Bool
watch = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
let watch' :: CInt
watch' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
watch
Ptr Bus -> CInt -> IO ()
ibus_bus_set_watch_dbus_signal Ptr Bus
bus' CInt
watch'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusSetWatchDbusSignalMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBus a) => O.MethodInfo BusSetWatchDbusSignalMethodInfo a signature where
overloadedMethod = busSetWatchDbusSignal
#endif
foreign import ccall "ibus_bus_set_watch_ibus_signal" ibus_bus_set_watch_ibus_signal ::
Ptr Bus ->
CInt ->
IO ()
busSetWatchIbusSignal ::
(B.CallStack.HasCallStack, MonadIO m, IsBus a) =>
a
-> Bool
-> m ()
busSetWatchIbusSignal :: a -> Bool -> m ()
busSetWatchIbusSignal a
bus Bool
watch = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
let watch' :: CInt
watch' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
watch
Ptr Bus -> CInt -> IO ()
ibus_bus_set_watch_ibus_signal Ptr Bus
bus' CInt
watch'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BusSetWatchIbusSignalMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBus a) => O.MethodInfo BusSetWatchIbusSignalMethodInfo a signature where
overloadedMethod = busSetWatchIbusSignal
#endif