{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GES.Interfaces.Extractable
(
Extractable(..) ,
IsExtractable ,
toExtractable ,
#if defined(ENABLE_OVERLOADING)
ResolveExtractableMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ExtractableGetAssetMethodInfo ,
#endif
extractableGetAsset ,
#if defined(ENABLE_OVERLOADING)
ExtractableGetIdMethodInfo ,
#endif
extractableGetId ,
#if defined(ENABLE_OVERLOADING)
ExtractableSetAssetMethodInfo ,
#endif
extractableSetAsset ,
) 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.GES.Objects.Asset as GES.Asset
import qualified GI.GObject.Objects.InitiallyUnowned as GObject.InitiallyUnowned
import qualified GI.GObject.Objects.Object as GObject.Object
newtype = (SP.ManagedPtr Extractable)
deriving (Extractable -> Extractable -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Extractable -> Extractable -> Bool
$c/= :: Extractable -> Extractable -> Bool
== :: Extractable -> Extractable -> Bool
$c== :: Extractable -> Extractable -> Bool
Eq)
instance SP.ManagedPtrNewtype Extractable where
toManagedPtr :: Extractable -> ManagedPtr Extractable
toManagedPtr (Extractable ManagedPtr Extractable
p) = ManagedPtr Extractable
p
foreign import ccall "ges_extractable_get_type"
:: IO B.Types.GType
instance B.Types.TypedObject Extractable where
glibType :: IO GType
glibType = IO GType
c_ges_extractable_get_type
instance B.Types.GObject Extractable
class (SP.GObject o, O.IsDescendantOf Extractable o) => o
instance (SP.GObject o, O.IsDescendantOf Extractable o) => IsExtractable o
instance O.HasParentTypes Extractable
type instance O.ParentTypes Extractable = '[GObject.InitiallyUnowned.InitiallyUnowned, GObject.Object.Object]
toExtractable :: (MIO.MonadIO m, IsExtractable o) => o -> m Extractable
= 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 Extractable -> Extractable
Extractable
instance B.GValue.IsGValue (Maybe Extractable) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ges_extractable_get_type
gvalueSet_ :: Ptr GValue -> Maybe Extractable -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Extractable
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 Extractable)
gvalueSet_ Ptr GValue
gv (P.Just Extractable
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Extractable
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Extractable)
gvalueGet_ Ptr GValue
gv = do
Ptr Extractable
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Extractable)
if Ptr Extractable
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 Extractable -> Extractable
Extractable Ptr Extractable
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Extractable
type instance O.AttributeList Extractable = ExtractableAttributeList
type ExtractableAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveExtractableMethod (t :: Symbol) (o :: *) :: * where
ResolveExtractableMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveExtractableMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveExtractableMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveExtractableMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveExtractableMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveExtractableMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveExtractableMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveExtractableMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveExtractableMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveExtractableMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveExtractableMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveExtractableMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveExtractableMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveExtractableMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveExtractableMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveExtractableMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveExtractableMethod "getAsset" o = ExtractableGetAssetMethodInfo
ResolveExtractableMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveExtractableMethod "getId" o = ExtractableGetIdMethodInfo
ResolveExtractableMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveExtractableMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveExtractableMethod "setAsset" o = ExtractableSetAssetMethodInfo
ResolveExtractableMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveExtractableMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveExtractableMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveExtractableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveExtractableMethod t Extractable, O.OverloadedMethod info Extractable p) => OL.IsLabel t (Extractable -> 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 ~ ResolveExtractableMethod t Extractable, O.OverloadedMethod info Extractable p, R.HasField t Extractable p) => R.HasField t Extractable p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveExtractableMethod t Extractable, O.OverloadedMethodInfo info Extractable) => OL.IsLabel t (O.MethodProxy info Extractable) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "ges_extractable_get_asset" ::
Ptr Extractable ->
IO (Ptr GES.Asset.Asset)
extractableGetAsset ::
(B.CallStack.HasCallStack, MonadIO m, IsExtractable a) =>
a
-> m (Maybe GES.Asset.Asset)
a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Extractable
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Asset
result <- Ptr Extractable -> IO (Ptr Asset)
ges_extractable_get_asset Ptr Extractable
self'
Maybe Asset
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Asset
result forall a b. (a -> b) -> a -> b
$ \Ptr Asset
result' -> do
Asset
result'' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Asset -> Asset
GES.Asset.Asset) Ptr Asset
result'
forall (m :: * -> *) a. Monad m => a -> m a
return Asset
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Asset
maybeResult
#if defined(ENABLE_OVERLOADING)
data ExtractableGetAssetMethodInfo
instance (signature ~ (m (Maybe GES.Asset.Asset)), MonadIO m, IsExtractable a) => O.OverloadedMethod ExtractableGetAssetMethodInfo a signature where
overloadedMethod = extractableGetAsset
instance O.OverloadedMethodInfo ExtractableGetAssetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Interfaces.Extractable.extractableGetAsset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Interfaces-Extractable.html#v:extractableGetAsset"
})
#endif
foreign import ccall "ges_extractable_get_id" ::
Ptr Extractable ->
IO CString
extractableGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsExtractable a) =>
a
-> m T.Text
a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Extractable
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
result <- Ptr Extractable -> IO CString
ges_extractable_get_id Ptr Extractable
self'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"extractableGetId" CString
result
Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
forall a. Ptr a -> IO ()
freeMem CString
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data ExtractableGetIdMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsExtractable a) => O.OverloadedMethod ExtractableGetIdMethodInfo a signature where
overloadedMethod = extractableGetId
instance O.OverloadedMethodInfo ExtractableGetIdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Interfaces.Extractable.extractableGetId",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Interfaces-Extractable.html#v:extractableGetId"
})
#endif
foreign import ccall "ges_extractable_set_asset" ::
Ptr Extractable ->
Ptr GES.Asset.Asset ->
IO CInt
extractableSetAsset ::
(B.CallStack.HasCallStack, MonadIO m, IsExtractable a, GES.Asset.IsAsset b) =>
a
-> b
-> m Bool
a
self b
asset = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Extractable
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Asset
asset' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
asset
CInt
result <- Ptr Extractable -> Ptr Asset -> IO CInt
ges_extractable_set_asset Ptr Extractable
self' Ptr Asset
asset'
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
asset
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ExtractableSetAssetMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsExtractable a, GES.Asset.IsAsset b) => O.OverloadedMethod ExtractableSetAssetMethodInfo a signature where
overloadedMethod = extractableSetAsset
instance O.OverloadedMethodInfo ExtractableSetAssetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Interfaces.Extractable.extractableSetAsset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Interfaces-Extractable.html#v:extractableSetAsset"
})
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Extractable = ExtractableSignalList
type ExtractableSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif