{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.IBus.Objects.AttrList
(
AttrList(..) ,
IsAttrList ,
toAttrList ,
#if defined(ENABLE_OVERLOADING)
ResolveAttrListMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AttrListAppendMethodInfo ,
#endif
attrListAppend ,
#if defined(ENABLE_OVERLOADING)
AttrListGetMethodInfo ,
#endif
attrListGet ,
attrListNew ,
) 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.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 {-# SOURCE #-} qualified GI.IBus.Objects.Attribute as IBus.Attribute
import {-# SOURCE #-} qualified GI.IBus.Objects.Object as IBus.Object
import {-# SOURCE #-} qualified GI.IBus.Objects.Serializable as IBus.Serializable
newtype AttrList = AttrList (ManagedPtr AttrList)
deriving (AttrList -> AttrList -> Bool
(AttrList -> AttrList -> Bool)
-> (AttrList -> AttrList -> Bool) -> Eq AttrList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttrList -> AttrList -> Bool
$c/= :: AttrList -> AttrList -> Bool
== :: AttrList -> AttrList -> Bool
$c== :: AttrList -> AttrList -> Bool
Eq)
foreign import ccall "ibus_attr_list_get_type"
c_ibus_attr_list_get_type :: IO GType
instance GObject AttrList where
gobjectType :: IO GType
gobjectType = IO GType
c_ibus_attr_list_get_type
instance B.GValue.IsGValue AttrList where
toGValue :: AttrList -> IO GValue
toGValue AttrList
o = do
GType
gtype <- IO GType
c_ibus_attr_list_get_type
AttrList -> (Ptr AttrList -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AttrList
o (GType
-> (GValue -> Ptr AttrList -> IO ()) -> Ptr AttrList -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr AttrList -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO AttrList
fromGValue GValue
gv = do
Ptr AttrList
ptr <- GValue -> IO (Ptr AttrList)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr AttrList)
(ManagedPtr AttrList -> AttrList) -> Ptr AttrList -> IO AttrList
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr AttrList -> AttrList
AttrList Ptr AttrList
ptr
class (GObject o, O.IsDescendantOf AttrList o) => IsAttrList o
instance (GObject o, O.IsDescendantOf AttrList o) => IsAttrList o
instance O.HasParentTypes AttrList
type instance O.ParentTypes AttrList = '[IBus.Serializable.Serializable, IBus.Object.Object, GObject.Object.Object]
toAttrList :: (MonadIO m, IsAttrList o) => o -> m AttrList
toAttrList :: o -> m AttrList
toAttrList = IO AttrList -> m AttrList
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AttrList -> m AttrList)
-> (o -> IO AttrList) -> o -> m AttrList
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AttrList -> AttrList) -> o -> IO AttrList
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr AttrList -> AttrList
AttrList
#if defined(ENABLE_OVERLOADING)
type family ResolveAttrListMethod (t :: Symbol) (o :: *) :: * where
ResolveAttrListMethod "append" o = AttrListAppendMethodInfo
ResolveAttrListMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAttrListMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAttrListMethod "copy" o = IBus.Serializable.SerializableCopyMethodInfo
ResolveAttrListMethod "destroy" o = IBus.Object.ObjectDestroyMethodInfo
ResolveAttrListMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAttrListMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAttrListMethod "get" o = AttrListGetMethodInfo
ResolveAttrListMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAttrListMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAttrListMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAttrListMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAttrListMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAttrListMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAttrListMethod "removeQattachment" o = IBus.Serializable.SerializableRemoveQattachmentMethodInfo
ResolveAttrListMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAttrListMethod "serializeObject" o = IBus.Serializable.SerializableSerializeObjectMethodInfo
ResolveAttrListMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAttrListMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAttrListMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAttrListMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAttrListMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAttrListMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAttrListMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAttrListMethod "getQattachment" o = IBus.Serializable.SerializableGetQattachmentMethodInfo
ResolveAttrListMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAttrListMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAttrListMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAttrListMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAttrListMethod "setQattachment" o = IBus.Serializable.SerializableSetQattachmentMethodInfo
ResolveAttrListMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAttrListMethod t AttrList, O.MethodInfo info AttrList p) => OL.IsLabel t (AttrList -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AttrList
type instance O.AttributeList AttrList = AttrListAttributeList
type AttrListAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AttrList = AttrListSignalList
type AttrListSignalList = ('[ '("destroy", IBus.Object.ObjectDestroySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ibus_attr_list_new" ibus_attr_list_new ::
IO (Ptr AttrList)
attrListNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m AttrList
attrListNew :: m AttrList
attrListNew = IO AttrList -> m AttrList
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AttrList -> m AttrList) -> IO AttrList -> m AttrList
forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
result <- IO (Ptr AttrList)
ibus_attr_list_new
Text -> Ptr AttrList -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"attrListNew" Ptr AttrList
result
AttrList
result' <- ((ManagedPtr AttrList -> AttrList) -> Ptr AttrList -> IO AttrList
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr AttrList -> AttrList
AttrList) Ptr AttrList
result
AttrList -> IO AttrList
forall (m :: * -> *) a. Monad m => a -> m a
return AttrList
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ibus_attr_list_append" ibus_attr_list_append ::
Ptr AttrList ->
Ptr IBus.Attribute.Attribute ->
IO ()
attrListAppend ::
(B.CallStack.HasCallStack, MonadIO m, IsAttrList a, IBus.Attribute.IsAttribute b) =>
a
-> b
-> m ()
attrListAppend :: a -> b -> m ()
attrListAppend a
attrList b
attr = 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 AttrList
attrList' <- a -> IO (Ptr AttrList)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attrList
Ptr Attribute
attr' <- b -> IO (Ptr Attribute)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
attr
Ptr AttrList -> Ptr Attribute -> IO ()
ibus_attr_list_append Ptr AttrList
attrList' Ptr Attribute
attr'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attrList
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
attr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AttrListAppendMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsAttrList a, IBus.Attribute.IsAttribute b) => O.MethodInfo AttrListAppendMethodInfo a signature where
overloadedMethod = attrListAppend
#endif
foreign import ccall "ibus_attr_list_get" ibus_attr_list_get ::
Ptr AttrList ->
Word32 ->
IO (Ptr IBus.Attribute.Attribute)
attrListGet ::
(B.CallStack.HasCallStack, MonadIO m, IsAttrList a) =>
a
-> Word32
-> m IBus.Attribute.Attribute
attrListGet :: a -> Word32 -> m Attribute
attrListGet a
attrList Word32
index = IO Attribute -> m Attribute
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Attribute -> m Attribute) -> IO Attribute -> m Attribute
forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
attrList' <- a -> IO (Ptr AttrList)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attrList
Ptr Attribute
result <- Ptr AttrList -> Word32 -> IO (Ptr Attribute)
ibus_attr_list_get Ptr AttrList
attrList' Word32
index
Text -> Ptr Attribute -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"attrListGet" Ptr Attribute
result
Attribute
result' <- ((ManagedPtr Attribute -> Attribute)
-> Ptr Attribute -> IO Attribute
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Attribute -> Attribute
IBus.Attribute.Attribute) Ptr Attribute
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attrList
Attribute -> IO Attribute
forall (m :: * -> *) a. Monad m => a -> m a
return Attribute
result'
#if defined(ENABLE_OVERLOADING)
data AttrListGetMethodInfo
instance (signature ~ (Word32 -> m IBus.Attribute.Attribute), MonadIO m, IsAttrList a) => O.MethodInfo AttrListGetMethodInfo a signature where
overloadedMethod = attrListGet
#endif