{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.IBus.Objects.Attribute
(
Attribute(..) ,
IsAttribute ,
toAttribute ,
#if defined(ENABLE_OVERLOADING)
ResolveAttributeMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AttributeGetAttrTypeMethodInfo ,
#endif
attributeGetAttrType ,
#if defined(ENABLE_OVERLOADING)
AttributeGetEndIndexMethodInfo ,
#endif
attributeGetEndIndex ,
#if defined(ENABLE_OVERLOADING)
AttributeGetStartIndexMethodInfo ,
#endif
attributeGetStartIndex ,
#if defined(ENABLE_OVERLOADING)
AttributeGetValueMethodInfo ,
#endif
attributeGetValue ,
attributeNew ,
) 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 {-# SOURCE #-} qualified GI.IBus.Objects.Object as IBus.Object
import {-# SOURCE #-} qualified GI.IBus.Objects.Serializable as IBus.Serializable
newtype Attribute = Attribute (SP.ManagedPtr Attribute)
deriving (Attribute -> Attribute -> Bool
(Attribute -> Attribute -> Bool)
-> (Attribute -> Attribute -> Bool) -> Eq Attribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Attribute -> Attribute -> Bool
$c/= :: Attribute -> Attribute -> Bool
== :: Attribute -> Attribute -> Bool
$c== :: Attribute -> Attribute -> Bool
Eq)
instance SP.ManagedPtrNewtype Attribute where
toManagedPtr :: Attribute -> ManagedPtr Attribute
toManagedPtr (Attribute ManagedPtr Attribute
p) = ManagedPtr Attribute
p
foreign import ccall "ibus_attribute_get_type"
c_ibus_attribute_get_type :: IO B.Types.GType
instance B.Types.TypedObject Attribute where
glibType :: IO GType
glibType = IO GType
c_ibus_attribute_get_type
instance B.Types.GObject Attribute
instance B.GValue.IsGValue Attribute where
toGValue :: Attribute -> IO GValue
toGValue Attribute
o = do
GType
gtype <- IO GType
c_ibus_attribute_get_type
Attribute -> (Ptr Attribute -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Attribute
o (GType
-> (GValue -> Ptr Attribute -> IO ()) -> Ptr Attribute -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Attribute -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Attribute
fromGValue GValue
gv = do
Ptr Attribute
ptr <- GValue -> IO (Ptr Attribute)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Attribute)
(ManagedPtr Attribute -> Attribute)
-> Ptr Attribute -> IO Attribute
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Attribute -> Attribute
Attribute Ptr Attribute
ptr
class (SP.GObject o, O.IsDescendantOf Attribute o) => IsAttribute o
instance (SP.GObject o, O.IsDescendantOf Attribute o) => IsAttribute o
instance O.HasParentTypes Attribute
type instance O.ParentTypes Attribute = '[IBus.Serializable.Serializable, IBus.Object.Object, GObject.Object.Object]
toAttribute :: (MonadIO m, IsAttribute o) => o -> m Attribute
toAttribute :: o -> m Attribute
toAttribute = IO Attribute -> m Attribute
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Attribute -> m Attribute)
-> (o -> IO Attribute) -> o -> m Attribute
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Attribute -> Attribute) -> o -> IO Attribute
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Attribute -> Attribute
Attribute
#if defined(ENABLE_OVERLOADING)
type family ResolveAttributeMethod (t :: Symbol) (o :: *) :: * where
ResolveAttributeMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAttributeMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAttributeMethod "copy" o = IBus.Serializable.SerializableCopyMethodInfo
ResolveAttributeMethod "destroy" o = IBus.Object.ObjectDestroyMethodInfo
ResolveAttributeMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAttributeMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAttributeMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAttributeMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAttributeMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAttributeMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAttributeMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAttributeMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAttributeMethod "removeQattachment" o = IBus.Serializable.SerializableRemoveQattachmentMethodInfo
ResolveAttributeMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAttributeMethod "serializeObject" o = IBus.Serializable.SerializableSerializeObjectMethodInfo
ResolveAttributeMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAttributeMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAttributeMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAttributeMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAttributeMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAttributeMethod "getAttrType" o = AttributeGetAttrTypeMethodInfo
ResolveAttributeMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAttributeMethod "getEndIndex" o = AttributeGetEndIndexMethodInfo
ResolveAttributeMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAttributeMethod "getQattachment" o = IBus.Serializable.SerializableGetQattachmentMethodInfo
ResolveAttributeMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAttributeMethod "getStartIndex" o = AttributeGetStartIndexMethodInfo
ResolveAttributeMethod "getValue" o = AttributeGetValueMethodInfo
ResolveAttributeMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAttributeMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAttributeMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAttributeMethod "setQattachment" o = IBus.Serializable.SerializableSetQattachmentMethodInfo
ResolveAttributeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAttributeMethod t Attribute, O.MethodInfo info Attribute p) => OL.IsLabel t (Attribute -> 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 Attribute
type instance O.AttributeList Attribute = AttributeAttributeList
type AttributeAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Attribute = AttributeSignalList
type AttributeSignalList = ('[ '("destroy", IBus.Object.ObjectDestroySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ibus_attribute_new" ibus_attribute_new ::
Word32 ->
Word32 ->
Word32 ->
Word32 ->
IO (Ptr Attribute)
attributeNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Word32
-> Word32
-> Word32
-> Word32
-> m Attribute
attributeNew :: Word32 -> Word32 -> Word32 -> Word32 -> m Attribute
attributeNew Word32
type_ Word32
value Word32
startIndex Word32
endIndex = 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 Attribute
result <- Word32 -> Word32 -> Word32 -> Word32 -> IO (Ptr Attribute)
ibus_attribute_new Word32
type_ Word32
value Word32
startIndex Word32
endIndex
Text -> Ptr Attribute -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"attributeNew" 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
Attribute) Ptr Attribute
result
Attribute -> IO Attribute
forall (m :: * -> *) a. Monad m => a -> m a
return Attribute
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ibus_attribute_get_attr_type" ibus_attribute_get_attr_type ::
Ptr Attribute ->
IO Word32
attributeGetAttrType ::
(B.CallStack.HasCallStack, MonadIO m, IsAttribute a) =>
a
-> m Word32
attributeGetAttrType :: a -> m Word32
attributeGetAttrType a
attr = 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 Attribute
attr' <- a -> IO (Ptr Attribute)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attr
Word32
result <- Ptr Attribute -> IO Word32
ibus_attribute_get_attr_type Ptr Attribute
attr'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attr
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data AttributeGetAttrTypeMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAttribute a) => O.MethodInfo AttributeGetAttrTypeMethodInfo a signature where
overloadedMethod = attributeGetAttrType
#endif
foreign import ccall "ibus_attribute_get_end_index" ibus_attribute_get_end_index ::
Ptr Attribute ->
IO Word32
attributeGetEndIndex ::
(B.CallStack.HasCallStack, MonadIO m, IsAttribute a) =>
a
-> m Word32
attributeGetEndIndex :: a -> m Word32
attributeGetEndIndex a
attr = 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 Attribute
attr' <- a -> IO (Ptr Attribute)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attr
Word32
result <- Ptr Attribute -> IO Word32
ibus_attribute_get_end_index Ptr Attribute
attr'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attr
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data AttributeGetEndIndexMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAttribute a) => O.MethodInfo AttributeGetEndIndexMethodInfo a signature where
overloadedMethod = attributeGetEndIndex
#endif
foreign import ccall "ibus_attribute_get_start_index" ibus_attribute_get_start_index ::
Ptr Attribute ->
IO Word32
attributeGetStartIndex ::
(B.CallStack.HasCallStack, MonadIO m, IsAttribute a) =>
a
-> m Word32
attributeGetStartIndex :: a -> m Word32
attributeGetStartIndex a
attr = 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 Attribute
attr' <- a -> IO (Ptr Attribute)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attr
Word32
result <- Ptr Attribute -> IO Word32
ibus_attribute_get_start_index Ptr Attribute
attr'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attr
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data AttributeGetStartIndexMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAttribute a) => O.MethodInfo AttributeGetStartIndexMethodInfo a signature where
overloadedMethod = attributeGetStartIndex
#endif
foreign import ccall "ibus_attribute_get_value" ibus_attribute_get_value ::
Ptr Attribute ->
IO Word32
attributeGetValue ::
(B.CallStack.HasCallStack, MonadIO m, IsAttribute a) =>
a
-> m Word32
attributeGetValue :: a -> m Word32
attributeGetValue a
attr = 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 Attribute
attr' <- a -> IO (Ptr Attribute)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attr
Word32
result <- Ptr Attribute -> IO Word32
ibus_attribute_get_value Ptr Attribute
attr'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attr
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data AttributeGetValueMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAttribute a) => O.MethodInfo AttributeGetValueMethodInfo a signature where
overloadedMethod = attributeGetValue
#endif