{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Atk.Objects.ObjectFactory
(
ObjectFactory(..) ,
IsObjectFactory ,
toObjectFactory ,
#if defined(ENABLE_OVERLOADING)
ResolveObjectFactoryMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ObjectFactoryCreateAccessibleMethodInfo ,
#endif
objectFactoryCreateAccessible ,
#if defined(ENABLE_OVERLOADING)
ObjectFactoryGetAccessibleTypeMethodInfo,
#endif
objectFactoryGetAccessibleType ,
#if defined(ENABLE_OVERLOADING)
ObjectFactoryInvalidateMethodInfo ,
#endif
objectFactoryInvalidate ,
) 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.GHashTable as B.GHT
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.Coerce as Coerce
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 {-# SOURCE #-} qualified GI.Atk.Objects.Object as Atk.Object
import qualified GI.GObject.Objects.Object as GObject.Object
newtype ObjectFactory = ObjectFactory (SP.ManagedPtr ObjectFactory)
deriving (ObjectFactory -> ObjectFactory -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ObjectFactory -> ObjectFactory -> Bool
$c/= :: ObjectFactory -> ObjectFactory -> Bool
== :: ObjectFactory -> ObjectFactory -> Bool
$c== :: ObjectFactory -> ObjectFactory -> Bool
Eq)
instance SP.ManagedPtrNewtype ObjectFactory where
toManagedPtr :: ObjectFactory -> ManagedPtr ObjectFactory
toManagedPtr (ObjectFactory ManagedPtr ObjectFactory
p) = ManagedPtr ObjectFactory
p
foreign import ccall "atk_object_factory_get_type"
c_atk_object_factory_get_type :: IO B.Types.GType
instance B.Types.TypedObject ObjectFactory where
glibType :: IO GType
glibType = IO GType
c_atk_object_factory_get_type
instance B.Types.GObject ObjectFactory
class (SP.GObject o, O.IsDescendantOf ObjectFactory o) => IsObjectFactory o
instance (SP.GObject o, O.IsDescendantOf ObjectFactory o) => IsObjectFactory o
instance O.HasParentTypes ObjectFactory
type instance O.ParentTypes ObjectFactory = '[GObject.Object.Object]
toObjectFactory :: (MIO.MonadIO m, IsObjectFactory o) => o -> m ObjectFactory
toObjectFactory :: forall (m :: * -> *) o.
(MonadIO m, IsObjectFactory o) =>
o -> m ObjectFactory
toObjectFactory = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr ObjectFactory -> ObjectFactory
ObjectFactory
instance B.GValue.IsGValue (Maybe ObjectFactory) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_atk_object_factory_get_type
gvalueSet_ :: Ptr GValue -> Maybe ObjectFactory -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ObjectFactory
P.Nothing = forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr ObjectFactory)
gvalueSet_ Ptr GValue
gv (P.Just ObjectFactory
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ObjectFactory
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe ObjectFactory)
gvalueGet_ Ptr GValue
gv = do
Ptr ObjectFactory
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr ObjectFactory)
if Ptr ObjectFactory
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr ObjectFactory -> ObjectFactory
ObjectFactory Ptr ObjectFactory
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveObjectFactoryMethod (t :: Symbol) (o :: *) :: * where
ResolveObjectFactoryMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveObjectFactoryMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveObjectFactoryMethod "createAccessible" o = ObjectFactoryCreateAccessibleMethodInfo
ResolveObjectFactoryMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveObjectFactoryMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveObjectFactoryMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveObjectFactoryMethod "invalidate" o = ObjectFactoryInvalidateMethodInfo
ResolveObjectFactoryMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveObjectFactoryMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveObjectFactoryMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveObjectFactoryMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveObjectFactoryMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveObjectFactoryMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveObjectFactoryMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveObjectFactoryMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveObjectFactoryMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveObjectFactoryMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveObjectFactoryMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveObjectFactoryMethod "getAccessibleType" o = ObjectFactoryGetAccessibleTypeMethodInfo
ResolveObjectFactoryMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveObjectFactoryMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveObjectFactoryMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveObjectFactoryMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveObjectFactoryMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveObjectFactoryMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveObjectFactoryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveObjectFactoryMethod t ObjectFactory, O.OverloadedMethod info ObjectFactory p) => OL.IsLabel t (ObjectFactory -> 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 ~ ResolveObjectFactoryMethod t ObjectFactory, O.OverloadedMethod info ObjectFactory p, R.HasField t ObjectFactory p) => R.HasField t ObjectFactory p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveObjectFactoryMethod t ObjectFactory, O.OverloadedMethodInfo info ObjectFactory) => OL.IsLabel t (O.MethodProxy info ObjectFactory) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ObjectFactory
type instance O.AttributeList ObjectFactory = ObjectFactoryAttributeList
type ObjectFactoryAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ObjectFactory = ObjectFactorySignalList
type ObjectFactorySignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "atk_object_factory_create_accessible" atk_object_factory_create_accessible ::
Ptr ObjectFactory ->
Ptr GObject.Object.Object ->
IO (Ptr Atk.Object.Object)
objectFactoryCreateAccessible ::
(B.CallStack.HasCallStack, MonadIO m, IsObjectFactory a, GObject.Object.IsObject b) =>
a
-> b
-> m Atk.Object.Object
objectFactoryCreateAccessible :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsObjectFactory a, IsObject b) =>
a -> b -> m Object
objectFactoryCreateAccessible a
factory b
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr ObjectFactory
factory' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr Object
obj' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
obj
Ptr Object
result <- Ptr ObjectFactory -> Ptr Object -> IO (Ptr Object)
atk_object_factory_create_accessible Ptr ObjectFactory
factory' Ptr Object
obj'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"objectFactoryCreateAccessible" Ptr Object
result
Object
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Object -> Object
Atk.Object.Object) Ptr Object
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
obj
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result'
#if defined(ENABLE_OVERLOADING)
data ObjectFactoryCreateAccessibleMethodInfo
instance (signature ~ (b -> m Atk.Object.Object), MonadIO m, IsObjectFactory a, GObject.Object.IsObject b) => O.OverloadedMethod ObjectFactoryCreateAccessibleMethodInfo a signature where
overloadedMethod = objectFactoryCreateAccessible
instance O.OverloadedMethodInfo ObjectFactoryCreateAccessibleMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Atk.Objects.ObjectFactory.objectFactoryCreateAccessible",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.25/docs/GI-Atk-Objects-ObjectFactory.html#v:objectFactoryCreateAccessible"
})
#endif
foreign import ccall "atk_object_factory_get_accessible_type" atk_object_factory_get_accessible_type ::
Ptr ObjectFactory ->
IO CGType
objectFactoryGetAccessibleType ::
(B.CallStack.HasCallStack, MonadIO m, IsObjectFactory a) =>
a
-> m GType
objectFactoryGetAccessibleType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsObjectFactory a) =>
a -> m GType
objectFactoryGetAccessibleType a
factory = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr ObjectFactory
factory' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
CGType
result <- Ptr ObjectFactory -> IO CGType
atk_object_factory_get_accessible_type Ptr ObjectFactory
factory'
let result' :: GType
result' = CGType -> GType
GType CGType
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'
#if defined(ENABLE_OVERLOADING)
data ObjectFactoryGetAccessibleTypeMethodInfo
instance (signature ~ (m GType), MonadIO m, IsObjectFactory a) => O.OverloadedMethod ObjectFactoryGetAccessibleTypeMethodInfo a signature where
overloadedMethod = objectFactoryGetAccessibleType
instance O.OverloadedMethodInfo ObjectFactoryGetAccessibleTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Atk.Objects.ObjectFactory.objectFactoryGetAccessibleType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.25/docs/GI-Atk-Objects-ObjectFactory.html#v:objectFactoryGetAccessibleType"
})
#endif
foreign import ccall "atk_object_factory_invalidate" atk_object_factory_invalidate ::
Ptr ObjectFactory ->
IO ()
objectFactoryInvalidate ::
(B.CallStack.HasCallStack, MonadIO m, IsObjectFactory a) =>
a
-> m ()
objectFactoryInvalidate :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsObjectFactory a) =>
a -> m ()
objectFactoryInvalidate a
factory = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr ObjectFactory
factory' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
factory
Ptr ObjectFactory -> IO ()
atk_object_factory_invalidate Ptr ObjectFactory
factory'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
factory
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ObjectFactoryInvalidateMethodInfo
instance (signature ~ (m ()), MonadIO m, IsObjectFactory a) => O.OverloadedMethod ObjectFactoryInvalidateMethodInfo a signature where
overloadedMethod = objectFactoryInvalidate
instance O.OverloadedMethodInfo ObjectFactoryInvalidateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Atk.Objects.ObjectFactory.objectFactoryInvalidate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.25/docs/GI-Atk-Objects-ObjectFactory.html#v:objectFactoryInvalidate"
})
#endif