{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.IBus.Objects.Factory
(
Factory(..) ,
IsFactory ,
toFactory ,
#if defined(ENABLE_OVERLOADING)
ResolveFactoryMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FactoryAddEngineMethodInfo ,
#endif
factoryAddEngine ,
#if defined(ENABLE_OVERLOADING)
FactoryCreateEngineMethodInfo ,
#endif
factoryCreateEngine ,
factoryNew ,
C_FactoryCreateEngineCallback ,
FactoryCreateEngineCallback ,
#if defined(ENABLE_OVERLOADING)
FactoryCreateEngineSignalInfo ,
#endif
afterFactoryCreateEngine ,
genClosure_FactoryCreateEngine ,
mk_FactoryCreateEngineCallback ,
noFactoryCreateEngineCallback ,
onFactoryCreateEngine ,
wrap_FactoryCreateEngineCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection
import {-# SOURCE #-} qualified GI.IBus.Objects.Engine as IBus.Engine
import {-# SOURCE #-} qualified GI.IBus.Objects.Object as IBus.Object
import {-# SOURCE #-} qualified GI.IBus.Objects.Service as IBus.Service
newtype Factory = Factory (SP.ManagedPtr Factory)
deriving (Factory -> Factory -> Bool
(Factory -> Factory -> Bool)
-> (Factory -> Factory -> Bool) -> Eq Factory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Factory -> Factory -> Bool
$c/= :: Factory -> Factory -> Bool
== :: Factory -> Factory -> Bool
$c== :: Factory -> Factory -> Bool
Eq)
instance SP.ManagedPtrNewtype Factory where
toManagedPtr :: Factory -> ManagedPtr Factory
toManagedPtr (Factory ManagedPtr Factory
p) = ManagedPtr Factory
p
foreign import ccall "ibus_factory_get_type"
c_ibus_factory_get_type :: IO B.Types.GType
instance B.Types.TypedObject Factory where
glibType :: IO GType
glibType = IO GType
c_ibus_factory_get_type
instance B.Types.GObject Factory
class (SP.GObject o, O.IsDescendantOf Factory o) => IsFactory o
instance (SP.GObject o, O.IsDescendantOf Factory o) => IsFactory o
instance O.HasParentTypes Factory
type instance O.ParentTypes Factory = '[IBus.Service.Service, IBus.Object.Object, GObject.Object.Object]
toFactory :: (MIO.MonadIO m, IsFactory o) => o -> m Factory
toFactory :: forall (m :: * -> *) o. (MonadIO m, IsFactory o) => o -> m Factory
toFactory = IO Factory -> m Factory
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Factory -> m Factory) -> (o -> IO Factory) -> o -> m Factory
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Factory -> Factory) -> o -> IO Factory
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Factory -> Factory
Factory
instance B.GValue.IsGValue (Maybe Factory) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ibus_factory_get_type
gvalueSet_ :: Ptr GValue -> Maybe Factory -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Factory
P.Nothing = Ptr GValue -> Ptr Factory -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Factory
forall a. Ptr a
FP.nullPtr :: FP.Ptr Factory)
gvalueSet_ Ptr GValue
gv (P.Just Factory
obj) = Factory -> (Ptr Factory -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Factory
obj (Ptr GValue -> Ptr Factory -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Factory)
gvalueGet_ Ptr GValue
gv = do
Ptr Factory
ptr <- Ptr GValue -> IO (Ptr Factory)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Factory)
if Ptr Factory
ptr Ptr Factory -> Ptr Factory -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Factory
forall a. Ptr a
FP.nullPtr
then Factory -> Maybe Factory
forall a. a -> Maybe a
P.Just (Factory -> Maybe Factory) -> IO Factory -> IO (Maybe Factory)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Factory -> Factory) -> Ptr Factory -> IO Factory
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Factory -> Factory
Factory Ptr Factory
ptr
else Maybe Factory -> IO (Maybe Factory)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Factory
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveFactoryMethod (t :: Symbol) (o :: *) :: * where
ResolveFactoryMethod "addEngine" o = FactoryAddEngineMethodInfo
ResolveFactoryMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFactoryMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFactoryMethod "createEngine" o = FactoryCreateEngineMethodInfo
ResolveFactoryMethod "destroy" o = IBus.Object.ObjectDestroyMethodInfo
ResolveFactoryMethod "emitSignal" o = IBus.Service.ServiceEmitSignalMethodInfo
ResolveFactoryMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFactoryMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFactoryMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFactoryMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFactoryMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFactoryMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFactoryMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFactoryMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFactoryMethod "register" o = IBus.Service.ServiceRegisterMethodInfo
ResolveFactoryMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFactoryMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFactoryMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFactoryMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFactoryMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFactoryMethod "unregister" o = IBus.Service.ServiceUnregisterMethodInfo
ResolveFactoryMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFactoryMethod "getConnection" o = IBus.Service.ServiceGetConnectionMethodInfo
ResolveFactoryMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFactoryMethod "getObjectPath" o = IBus.Service.ServiceGetObjectPathMethodInfo
ResolveFactoryMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFactoryMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFactoryMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFactoryMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFactoryMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFactoryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFactoryMethod t Factory, O.OverloadedMethod info Factory p) => OL.IsLabel t (Factory -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveFactoryMethod t Factory, O.OverloadedMethod info Factory p, R.HasField t Factory p) => R.HasField t Factory p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveFactoryMethod t Factory, O.OverloadedMethodInfo info Factory) => OL.IsLabel t (O.MethodProxy info Factory) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type FactoryCreateEngineCallback =
T.Text
-> IO (Maybe IBus.Engine.Engine)
noFactoryCreateEngineCallback :: Maybe FactoryCreateEngineCallback
noFactoryCreateEngineCallback :: Maybe FactoryCreateEngineCallback
noFactoryCreateEngineCallback = Maybe FactoryCreateEngineCallback
forall a. Maybe a
Nothing
type C_FactoryCreateEngineCallback =
Ptr () ->
CString ->
Ptr () ->
IO (Ptr IBus.Engine.Engine)
foreign import ccall "wrapper"
mk_FactoryCreateEngineCallback :: C_FactoryCreateEngineCallback -> IO (FunPtr C_FactoryCreateEngineCallback)
genClosure_FactoryCreateEngine :: MonadIO m => FactoryCreateEngineCallback -> m (GClosure C_FactoryCreateEngineCallback)
genClosure_FactoryCreateEngine :: forall (m :: * -> *).
MonadIO m =>
FactoryCreateEngineCallback
-> m (GClosure C_FactoryCreateEngineCallback)
genClosure_FactoryCreateEngine FactoryCreateEngineCallback
cb = IO (GClosure C_FactoryCreateEngineCallback)
-> m (GClosure C_FactoryCreateEngineCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FactoryCreateEngineCallback)
-> m (GClosure C_FactoryCreateEngineCallback))
-> IO (GClosure C_FactoryCreateEngineCallback)
-> m (GClosure C_FactoryCreateEngineCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_FactoryCreateEngineCallback
cb' = FactoryCreateEngineCallback -> C_FactoryCreateEngineCallback
wrap_FactoryCreateEngineCallback FactoryCreateEngineCallback
cb
C_FactoryCreateEngineCallback
-> IO (FunPtr C_FactoryCreateEngineCallback)
mk_FactoryCreateEngineCallback C_FactoryCreateEngineCallback
cb' IO (FunPtr C_FactoryCreateEngineCallback)
-> (FunPtr C_FactoryCreateEngineCallback
-> IO (GClosure C_FactoryCreateEngineCallback))
-> IO (GClosure C_FactoryCreateEngineCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FactoryCreateEngineCallback
-> IO (GClosure C_FactoryCreateEngineCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_FactoryCreateEngineCallback ::
FactoryCreateEngineCallback ->
C_FactoryCreateEngineCallback
wrap_FactoryCreateEngineCallback :: FactoryCreateEngineCallback -> C_FactoryCreateEngineCallback
wrap_FactoryCreateEngineCallback FactoryCreateEngineCallback
_cb Ptr ()
_ CString
engineName Ptr ()
_ = do
Text
engineName' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
engineName
Maybe Engine
result <- FactoryCreateEngineCallback
_cb Text
engineName'
Ptr Engine
-> Maybe Engine -> (Engine -> IO (Ptr Engine)) -> IO (Ptr Engine)
forall (m :: * -> *) b a.
Monad m =>
b -> Maybe a -> (a -> m b) -> m b
maybeM Ptr Engine
forall a. Ptr a
nullPtr Maybe Engine
result ((Engine -> IO (Ptr Engine)) -> IO (Ptr Engine))
-> (Engine -> IO (Ptr Engine)) -> IO (Ptr Engine)
forall a b. (a -> b) -> a -> b
$ \Engine
result' -> do
Ptr Engine
result'' <- Engine -> IO (Ptr Engine)
forall a b. (HasCallStack, GObject a) => a -> IO (Ptr b)
B.ManagedPtr.disownObject Engine
result'
Ptr Engine -> IO (Ptr Engine)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Engine
result''
onFactoryCreateEngine :: (IsFactory a, MonadIO m) => a -> FactoryCreateEngineCallback -> m SignalHandlerId
onFactoryCreateEngine :: forall a (m :: * -> *).
(IsFactory a, MonadIO m) =>
a -> FactoryCreateEngineCallback -> m SignalHandlerId
onFactoryCreateEngine a
obj FactoryCreateEngineCallback
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_FactoryCreateEngineCallback
cb' = FactoryCreateEngineCallback -> C_FactoryCreateEngineCallback
wrap_FactoryCreateEngineCallback FactoryCreateEngineCallback
cb
FunPtr C_FactoryCreateEngineCallback
cb'' <- C_FactoryCreateEngineCallback
-> IO (FunPtr C_FactoryCreateEngineCallback)
mk_FactoryCreateEngineCallback C_FactoryCreateEngineCallback
cb'
a
-> Text
-> FunPtr C_FactoryCreateEngineCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"create-engine" FunPtr C_FactoryCreateEngineCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterFactoryCreateEngine :: (IsFactory a, MonadIO m) => a -> FactoryCreateEngineCallback -> m SignalHandlerId
afterFactoryCreateEngine :: forall a (m :: * -> *).
(IsFactory a, MonadIO m) =>
a -> FactoryCreateEngineCallback -> m SignalHandlerId
afterFactoryCreateEngine a
obj FactoryCreateEngineCallback
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_FactoryCreateEngineCallback
cb' = FactoryCreateEngineCallback -> C_FactoryCreateEngineCallback
wrap_FactoryCreateEngineCallback FactoryCreateEngineCallback
cb
FunPtr C_FactoryCreateEngineCallback
cb'' <- C_FactoryCreateEngineCallback
-> IO (FunPtr C_FactoryCreateEngineCallback)
mk_FactoryCreateEngineCallback C_FactoryCreateEngineCallback
cb'
a
-> Text
-> FunPtr C_FactoryCreateEngineCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"create-engine" FunPtr C_FactoryCreateEngineCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data FactoryCreateEngineSignalInfo
instance SignalInfo FactoryCreateEngineSignalInfo where
type HaskellCallbackType FactoryCreateEngineSignalInfo = FactoryCreateEngineCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_FactoryCreateEngineCallback cb
cb'' <- mk_FactoryCreateEngineCallback cb'
connectSignalFunPtr obj "create-engine" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Factory
type instance O.AttributeList Factory = FactoryAttributeList
type FactoryAttributeList = ('[ '("connection", IBus.Service.ServiceConnectionPropertyInfo), '("objectPath", IBus.Service.ServiceObjectPathPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Factory = FactorySignalList
type FactorySignalList = ('[ '("createEngine", FactoryCreateEngineSignalInfo), '("destroy", IBus.Object.ObjectDestroySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ibus_factory_new" ibus_factory_new ::
Ptr Gio.DBusConnection.DBusConnection ->
IO (Ptr Factory)
factoryNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) =>
a
-> m Factory
factoryNew :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusConnection a) =>
a -> m Factory
factoryNew a
connection = IO Factory -> m Factory
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Factory -> m Factory) -> IO Factory -> m Factory
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusConnection
connection' <- a -> IO (Ptr DBusConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
connection
Ptr Factory
result <- Ptr DBusConnection -> IO (Ptr Factory)
ibus_factory_new Ptr DBusConnection
connection'
Text -> Ptr Factory -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"factoryNew" Ptr Factory
result
Factory
result' <- ((ManagedPtr Factory -> Factory) -> Ptr Factory -> IO Factory
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Factory -> Factory
Factory) Ptr Factory
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
connection
Factory -> IO Factory
forall (m :: * -> *) a. Monad m => a -> m a
return Factory
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ibus_factory_add_engine" ibus_factory_add_engine ::
Ptr Factory ->
CString ->
CGType ->
IO ()
factoryAddEngine ::
(B.CallStack.HasCallStack, MonadIO m, IsFactory a) =>
a
-> T.Text
-> GType
-> m ()
factoryAddEngine :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFactory a) =>
a -> Text -> GType -> m ()
factoryAddEngine a
factory Text
engineName GType
engineType = 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 Factory
factory' <- a -> IO (Ptr Factory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
CString
engineName' <- Text -> IO CString
textToCString Text
engineName
let engineType' :: CGType
engineType' = GType -> CGType
gtypeToCGType GType
engineType
Ptr Factory -> CString -> CGType -> IO ()
ibus_factory_add_engine Ptr Factory
factory' CString
engineName' CGType
engineType'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
engineName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FactoryAddEngineMethodInfo
instance (signature ~ (T.Text -> GType -> m ()), MonadIO m, IsFactory a) => O.OverloadedMethod FactoryAddEngineMethodInfo a signature where
overloadedMethod = factoryAddEngine
instance O.OverloadedMethodInfo FactoryAddEngineMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.IBus.Objects.Factory.factoryAddEngine",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-Factory.html#v:factoryAddEngine"
}
#endif
foreign import ccall "ibus_factory_create_engine" ibus_factory_create_engine ::
Ptr Factory ->
CString ->
IO (Ptr IBus.Engine.Engine)
factoryCreateEngine ::
(B.CallStack.HasCallStack, MonadIO m, IsFactory a) =>
a
-> T.Text
-> m IBus.Engine.Engine
factoryCreateEngine :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFactory a) =>
a -> Text -> m Engine
factoryCreateEngine a
factory Text
engineName = IO Engine -> m Engine
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Engine -> m Engine) -> IO Engine -> m Engine
forall a b. (a -> b) -> a -> b
$ do
Ptr Factory
factory' <- a -> IO (Ptr Factory)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
CString
engineName' <- Text -> IO CString
textToCString Text
engineName
Ptr Engine
result <- Ptr Factory -> CString -> IO (Ptr Engine)
ibus_factory_create_engine Ptr Factory
factory' CString
engineName'
Text -> Ptr Engine -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"factoryCreateEngine" Ptr Engine
result
Engine
result' <- ((ManagedPtr Engine -> Engine) -> Ptr Engine -> IO Engine
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Engine -> Engine
IBus.Engine.Engine) Ptr Engine
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
engineName'
Engine -> IO Engine
forall (m :: * -> *) a. Monad m => a -> m a
return Engine
result'
#if defined(ENABLE_OVERLOADING)
data FactoryCreateEngineMethodInfo
instance (signature ~ (T.Text -> m IBus.Engine.Engine), MonadIO m, IsFactory a) => O.OverloadedMethod FactoryCreateEngineMethodInfo a signature where
overloadedMethod = factoryCreateEngine
instance O.OverloadedMethodInfo FactoryCreateEngineMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.IBus.Objects.Factory.factoryCreateEngine",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-Factory.html#v:factoryCreateEngine"
}
#endif