{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GES.Objects.Asset
(
Asset(..) ,
IsAsset ,
toAsset ,
#if defined(ENABLE_OVERLOADING)
ResolveAssetMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AssetExtractMethodInfo ,
#endif
assetExtract ,
#if defined(ENABLE_OVERLOADING)
AssetGetErrorMethodInfo ,
#endif
assetGetError ,
#if defined(ENABLE_OVERLOADING)
AssetGetExtractableTypeMethodInfo ,
#endif
assetGetExtractableType ,
#if defined(ENABLE_OVERLOADING)
AssetGetIdMethodInfo ,
#endif
assetGetId ,
#if defined(ENABLE_OVERLOADING)
AssetGetProxyMethodInfo ,
#endif
assetGetProxy ,
#if defined(ENABLE_OVERLOADING)
AssetGetProxyTargetMethodInfo ,
#endif
assetGetProxyTarget ,
#if defined(ENABLE_OVERLOADING)
AssetListProxiesMethodInfo ,
#endif
assetListProxies ,
assetNeedsReload ,
assetRequest ,
assetRequestAsync ,
assetRequestFinish ,
#if defined(ENABLE_OVERLOADING)
AssetSetProxyMethodInfo ,
#endif
assetSetProxy ,
#if defined(ENABLE_OVERLOADING)
AssetUnproxyMethodInfo ,
#endif
assetUnproxy ,
#if defined(ENABLE_OVERLOADING)
AssetExtractableTypePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
assetExtractableType ,
#endif
constructAssetExtractableType ,
getAssetExtractableType ,
#if defined(ENABLE_OVERLOADING)
AssetIdPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
assetId ,
#endif
constructAssetId ,
getAssetId ,
#if defined(ENABLE_OVERLOADING)
AssetProxyPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
assetProxy ,
#endif
clearAssetProxy ,
constructAssetProxy ,
getAssetProxy ,
setAssetProxy ,
#if defined(ENABLE_OVERLOADING)
AssetProxyTargetPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
assetProxyTarget ,
#endif
getAssetProxyTarget ,
) 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.Interfaces.Extractable as GES.Extractable
import {-# SOURCE #-} qualified GI.GES.Interfaces.MetaContainer as GES.MetaContainer
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncInitable as Gio.AsyncInitable
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
newtype Asset = Asset (SP.ManagedPtr Asset)
deriving (Asset -> Asset -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Asset -> Asset -> Bool
$c/= :: Asset -> Asset -> Bool
== :: Asset -> Asset -> Bool
$c== :: Asset -> Asset -> Bool
Eq)
instance SP.ManagedPtrNewtype Asset where
toManagedPtr :: Asset -> ManagedPtr Asset
toManagedPtr (Asset ManagedPtr Asset
p) = ManagedPtr Asset
p
foreign import ccall "ges_asset_get_type"
c_ges_asset_get_type :: IO B.Types.GType
instance B.Types.TypedObject Asset where
glibType :: IO GType
glibType = IO GType
c_ges_asset_get_type
instance B.Types.GObject Asset
class (SP.GObject o, O.IsDescendantOf Asset o) => IsAsset o
instance (SP.GObject o, O.IsDescendantOf Asset o) => IsAsset o
instance O.HasParentTypes Asset
type instance O.ParentTypes Asset = '[GObject.Object.Object, GES.MetaContainer.MetaContainer, Gio.AsyncInitable.AsyncInitable, Gio.Initable.Initable]
toAsset :: (MIO.MonadIO m, IsAsset o) => o -> m Asset
toAsset :: forall (m :: * -> *) o. (MonadIO m, IsAsset o) => o -> m Asset
toAsset = 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 Asset -> Asset
Asset
instance B.GValue.IsGValue (Maybe Asset) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ges_asset_get_type
gvalueSet_ :: Ptr GValue -> Maybe Asset -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Asset
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 Asset)
gvalueSet_ Ptr GValue
gv (P.Just Asset
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Asset
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Asset)
gvalueGet_ Ptr GValue
gv = do
Ptr Asset
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Asset)
if Ptr Asset
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 Asset -> Asset
Asset Ptr Asset
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveAssetMethod (t :: Symbol) (o :: *) :: * where
ResolveAssetMethod "addMetasFromString" o = GES.MetaContainer.MetaContainerAddMetasFromStringMethodInfo
ResolveAssetMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAssetMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAssetMethod "checkMetaRegistered" o = GES.MetaContainer.MetaContainerCheckMetaRegisteredMethodInfo
ResolveAssetMethod "extract" o = AssetExtractMethodInfo
ResolveAssetMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAssetMethod "foreach" o = GES.MetaContainer.MetaContainerForeachMethodInfo
ResolveAssetMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAssetMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAssetMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveAssetMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
ResolveAssetMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
ResolveAssetMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAssetMethod "listProxies" o = AssetListProxiesMethodInfo
ResolveAssetMethod "metasToString" o = GES.MetaContainer.MetaContainerMetasToStringMethodInfo
ResolveAssetMethod "newFinish" o = Gio.AsyncInitable.AsyncInitableNewFinishMethodInfo
ResolveAssetMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAssetMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAssetMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAssetMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAssetMethod "registerMeta" o = GES.MetaContainer.MetaContainerRegisterMetaMethodInfo
ResolveAssetMethod "registerMetaBoolean" o = GES.MetaContainer.MetaContainerRegisterMetaBooleanMethodInfo
ResolveAssetMethod "registerMetaDate" o = GES.MetaContainer.MetaContainerRegisterMetaDateMethodInfo
ResolveAssetMethod "registerMetaDateTime" o = GES.MetaContainer.MetaContainerRegisterMetaDateTimeMethodInfo
ResolveAssetMethod "registerMetaDouble" o = GES.MetaContainer.MetaContainerRegisterMetaDoubleMethodInfo
ResolveAssetMethod "registerMetaFloat" o = GES.MetaContainer.MetaContainerRegisterMetaFloatMethodInfo
ResolveAssetMethod "registerMetaInt" o = GES.MetaContainer.MetaContainerRegisterMetaIntMethodInfo
ResolveAssetMethod "registerMetaInt64" o = GES.MetaContainer.MetaContainerRegisterMetaInt64MethodInfo
ResolveAssetMethod "registerMetaString" o = GES.MetaContainer.MetaContainerRegisterMetaStringMethodInfo
ResolveAssetMethod "registerMetaUint" o = GES.MetaContainer.MetaContainerRegisterMetaUintMethodInfo
ResolveAssetMethod "registerMetaUint64" o = GES.MetaContainer.MetaContainerRegisterMetaUint64MethodInfo
ResolveAssetMethod "registerStaticMeta" o = GES.MetaContainer.MetaContainerRegisterStaticMetaMethodInfo
ResolveAssetMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAssetMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAssetMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAssetMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAssetMethod "unproxy" o = AssetUnproxyMethodInfo
ResolveAssetMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAssetMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAssetMethod "getBoolean" o = GES.MetaContainer.MetaContainerGetBooleanMethodInfo
ResolveAssetMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAssetMethod "getDate" o = GES.MetaContainer.MetaContainerGetDateMethodInfo
ResolveAssetMethod "getDateTime" o = GES.MetaContainer.MetaContainerGetDateTimeMethodInfo
ResolveAssetMethod "getDouble" o = GES.MetaContainer.MetaContainerGetDoubleMethodInfo
ResolveAssetMethod "getError" o = AssetGetErrorMethodInfo
ResolveAssetMethod "getExtractableType" o = AssetGetExtractableTypeMethodInfo
ResolveAssetMethod "getFloat" o = GES.MetaContainer.MetaContainerGetFloatMethodInfo
ResolveAssetMethod "getId" o = AssetGetIdMethodInfo
ResolveAssetMethod "getInt" o = GES.MetaContainer.MetaContainerGetIntMethodInfo
ResolveAssetMethod "getInt64" o = GES.MetaContainer.MetaContainerGetInt64MethodInfo
ResolveAssetMethod "getMarkerList" o = GES.MetaContainer.MetaContainerGetMarkerListMethodInfo
ResolveAssetMethod "getMeta" o = GES.MetaContainer.MetaContainerGetMetaMethodInfo
ResolveAssetMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAssetMethod "getProxy" o = AssetGetProxyMethodInfo
ResolveAssetMethod "getProxyTarget" o = AssetGetProxyTargetMethodInfo
ResolveAssetMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAssetMethod "getString" o = GES.MetaContainer.MetaContainerGetStringMethodInfo
ResolveAssetMethod "getUint" o = GES.MetaContainer.MetaContainerGetUintMethodInfo
ResolveAssetMethod "getUint64" o = GES.MetaContainer.MetaContainerGetUint64MethodInfo
ResolveAssetMethod "setBoolean" o = GES.MetaContainer.MetaContainerSetBooleanMethodInfo
ResolveAssetMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAssetMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAssetMethod "setDate" o = GES.MetaContainer.MetaContainerSetDateMethodInfo
ResolveAssetMethod "setDateTime" o = GES.MetaContainer.MetaContainerSetDateTimeMethodInfo
ResolveAssetMethod "setDouble" o = GES.MetaContainer.MetaContainerSetDoubleMethodInfo
ResolveAssetMethod "setFloat" o = GES.MetaContainer.MetaContainerSetFloatMethodInfo
ResolveAssetMethod "setInt" o = GES.MetaContainer.MetaContainerSetIntMethodInfo
ResolveAssetMethod "setInt64" o = GES.MetaContainer.MetaContainerSetInt64MethodInfo
ResolveAssetMethod "setMarkerList" o = GES.MetaContainer.MetaContainerSetMarkerListMethodInfo
ResolveAssetMethod "setMeta" o = GES.MetaContainer.MetaContainerSetMetaMethodInfo
ResolveAssetMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAssetMethod "setProxy" o = AssetSetProxyMethodInfo
ResolveAssetMethod "setString" o = GES.MetaContainer.MetaContainerSetStringMethodInfo
ResolveAssetMethod "setUint" o = GES.MetaContainer.MetaContainerSetUintMethodInfo
ResolveAssetMethod "setUint64" o = GES.MetaContainer.MetaContainerSetUint64MethodInfo
ResolveAssetMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAssetMethod t Asset, O.OverloadedMethod info Asset p) => OL.IsLabel t (Asset -> 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 ~ ResolveAssetMethod t Asset, O.OverloadedMethod info Asset p, R.HasField t Asset p) => R.HasField t Asset p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveAssetMethod t Asset, O.OverloadedMethodInfo info Asset) => OL.IsLabel t (O.MethodProxy info Asset) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getAssetExtractableType :: (MonadIO m, IsAsset o) => o -> m GType
o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO GType
B.Properties.getObjectPropertyGType o
obj String
"extractable-type"
constructAssetExtractableType :: (IsAsset o, MIO.MonadIO m) => GType -> m (GValueConstruct o)
GType
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall o. String -> GType -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyGType String
"extractable-type" GType
val
#if defined(ENABLE_OVERLOADING)
data AssetExtractableTypePropertyInfo
instance AttrInfo AssetExtractableTypePropertyInfo where
type AttrAllowedOps AssetExtractableTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint AssetExtractableTypePropertyInfo = IsAsset
type AttrSetTypeConstraint AssetExtractableTypePropertyInfo = (~) GType
type AttrTransferTypeConstraint AssetExtractableTypePropertyInfo = (~) GType
type AttrTransferType AssetExtractableTypePropertyInfo = GType
type AttrGetType AssetExtractableTypePropertyInfo = GType
type AttrLabel AssetExtractableTypePropertyInfo = "extractable-type"
type AttrOrigin AssetExtractableTypePropertyInfo = Asset
attrGet = getAssetExtractableType
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructAssetExtractableType
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.extractableType"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#g:attr:extractableType"
})
#endif
getAssetId :: (MonadIO m, IsAsset o) => o -> m T.Text
getAssetId :: forall (m :: * -> *) o. (MonadIO m, IsAsset o) => o -> m Text
getAssetId o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getAssetId" forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"id"
constructAssetId :: (IsAsset o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructAssetId :: forall o (m :: * -> *).
(IsAsset o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructAssetId Text
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"id" (forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data AssetIdPropertyInfo
instance AttrInfo AssetIdPropertyInfo where
type AttrAllowedOps AssetIdPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint AssetIdPropertyInfo = IsAsset
type AttrSetTypeConstraint AssetIdPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint AssetIdPropertyInfo = (~) T.Text
type AttrTransferType AssetIdPropertyInfo = T.Text
type AttrGetType AssetIdPropertyInfo = T.Text
type AttrLabel AssetIdPropertyInfo = "id"
type AttrOrigin AssetIdPropertyInfo = Asset
attrGet = getAssetId
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructAssetId
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.id"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#g:attr:id"
})
#endif
getAssetProxy :: (MonadIO m, IsAsset o) => o -> m (Maybe Asset)
getAssetProxy :: forall (m :: * -> *) o.
(MonadIO m, IsAsset o) =>
o -> m (Maybe Asset)
getAssetProxy o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"proxy" ManagedPtr Asset -> Asset
Asset
setAssetProxy :: (MonadIO m, IsAsset o, IsAsset a) => o -> a -> m ()
setAssetProxy :: forall (m :: * -> *) o a.
(MonadIO m, IsAsset o, IsAsset a) =>
o -> a -> m ()
setAssetProxy o
obj a
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"proxy" (forall a. a -> Maybe a
Just a
val)
constructAssetProxy :: (IsAsset o, MIO.MonadIO m, IsAsset a) => a -> m (GValueConstruct o)
constructAssetProxy :: forall o (m :: * -> *) a.
(IsAsset o, MonadIO m, IsAsset a) =>
a -> m (GValueConstruct o)
constructAssetProxy a
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"proxy" (forall a. a -> Maybe a
P.Just a
val)
clearAssetProxy :: (MonadIO m, IsAsset o) => o -> m ()
clearAssetProxy :: forall (m :: * -> *) o. (MonadIO m, IsAsset o) => o -> m ()
clearAssetProxy o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"proxy" (forall a. Maybe a
Nothing :: Maybe Asset)
#if defined(ENABLE_OVERLOADING)
data AssetProxyPropertyInfo
instance AttrInfo AssetProxyPropertyInfo where
type AttrAllowedOps AssetProxyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint AssetProxyPropertyInfo = IsAsset
type AttrSetTypeConstraint AssetProxyPropertyInfo = IsAsset
type AttrTransferTypeConstraint AssetProxyPropertyInfo = IsAsset
type AttrTransferType AssetProxyPropertyInfo = Asset
type AttrGetType AssetProxyPropertyInfo = (Maybe Asset)
type AttrLabel AssetProxyPropertyInfo = "proxy"
type AttrOrigin AssetProxyPropertyInfo = Asset
attrGet = getAssetProxy
attrSet = setAssetProxy
attrTransfer _ v = do
unsafeCastTo Asset v
attrConstruct = constructAssetProxy
attrClear = clearAssetProxy
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.proxy"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#g:attr:proxy"
})
#endif
getAssetProxyTarget :: (MonadIO m, IsAsset o) => o -> m (Maybe Asset)
getAssetProxyTarget :: forall (m :: * -> *) o.
(MonadIO m, IsAsset o) =>
o -> m (Maybe Asset)
getAssetProxyTarget o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"proxy-target" ManagedPtr Asset -> Asset
Asset
#if defined(ENABLE_OVERLOADING)
data AssetProxyTargetPropertyInfo
instance AttrInfo AssetProxyTargetPropertyInfo where
type AttrAllowedOps AssetProxyTargetPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint AssetProxyTargetPropertyInfo = IsAsset
type AttrSetTypeConstraint AssetProxyTargetPropertyInfo = (~) ()
type AttrTransferTypeConstraint AssetProxyTargetPropertyInfo = (~) ()
type AttrTransferType AssetProxyTargetPropertyInfo = ()
type AttrGetType AssetProxyTargetPropertyInfo = (Maybe Asset)
type AttrLabel AssetProxyTargetPropertyInfo = "proxy-target"
type AttrOrigin AssetProxyTargetPropertyInfo = Asset
attrGet = getAssetProxyTarget
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.proxyTarget"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#g:attr:proxyTarget"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Asset
type instance O.AttributeList Asset = AssetAttributeList
type AssetAttributeList = ('[ '("extractableType", AssetExtractableTypePropertyInfo), '("id", AssetIdPropertyInfo), '("proxy", AssetProxyPropertyInfo), '("proxyTarget", AssetProxyTargetPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
assetExtractableType :: AttrLabelProxy "extractableType"
assetExtractableType = AttrLabelProxy
assetId :: AttrLabelProxy "id"
assetId = AttrLabelProxy
assetProxy :: AttrLabelProxy "proxy"
assetProxy = AttrLabelProxy
assetProxyTarget :: AttrLabelProxy "proxyTarget"
assetProxyTarget = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Asset = AssetSignalList
type AssetSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("notifyMeta", GES.MetaContainer.MetaContainerNotifyMetaSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ges_asset_extract" ::
Ptr Asset ->
Ptr (Ptr GError) ->
IO (Ptr GES.Extractable.Extractable)
assetExtract ::
(B.CallStack.HasCallStack, MonadIO m, IsAsset a) =>
a
-> m GES.Extractable.Extractable
a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Asset
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Extractable
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Asset -> Ptr (Ptr GError) -> IO (Ptr Extractable)
ges_asset_extract Ptr Asset
self'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"assetExtract" Ptr Extractable
result
Extractable
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Extractable -> Extractable
GES.Extractable.Extractable) Ptr Extractable
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (m :: * -> *) a. Monad m => a -> m a
return Extractable
result'
) (do
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data AssetExtractMethodInfo
instance (signature ~ (m GES.Extractable.Extractable), MonadIO m, IsAsset a) => O.OverloadedMethod AssetExtractMethodInfo a signature where
overloadedMethod = assetExtract
instance O.OverloadedMethodInfo AssetExtractMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.assetExtract",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#v:assetExtract"
})
#endif
foreign import ccall "ges_asset_get_error" ges_asset_get_error ::
Ptr Asset ->
IO (Ptr GError)
assetGetError ::
(B.CallStack.HasCallStack, MonadIO m, IsAsset a) =>
a
-> m (Maybe GError)
assetGetError :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsset a) =>
a -> m (Maybe GError)
assetGetError a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Asset
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr GError
result <- Ptr Asset -> IO (Ptr GError)
ges_asset_get_error Ptr Asset
self'
Maybe GError
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr GError
result forall a b. (a -> b) -> a -> b
$ \Ptr GError
result' -> do
GError
result'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GError -> GError
GError) Ptr GError
result'
forall (m :: * -> *) a. Monad m => a -> m a
return GError
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GError
maybeResult
#if defined(ENABLE_OVERLOADING)
data AssetGetErrorMethodInfo
instance (signature ~ (m (Maybe GError)), MonadIO m, IsAsset a) => O.OverloadedMethod AssetGetErrorMethodInfo a signature where
overloadedMethod = assetGetError
instance O.OverloadedMethodInfo AssetGetErrorMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.assetGetError",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#v:assetGetError"
})
#endif
foreign import ccall "ges_asset_get_extractable_type" ::
Ptr Asset ->
IO CGType
assetGetExtractableType ::
(B.CallStack.HasCallStack, MonadIO m, IsAsset a) =>
a
-> m GType
a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Asset
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CGType
result <- Ptr Asset -> IO CGType
ges_asset_get_extractable_type Ptr Asset
self'
let result' :: GType
result' = CGType -> GType
GType CGType
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'
#if defined(ENABLE_OVERLOADING)
data AssetGetExtractableTypeMethodInfo
instance (signature ~ (m GType), MonadIO m, IsAsset a) => O.OverloadedMethod AssetGetExtractableTypeMethodInfo a signature where
overloadedMethod = assetGetExtractableType
instance O.OverloadedMethodInfo AssetGetExtractableTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.assetGetExtractableType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#v:assetGetExtractableType"
})
#endif
foreign import ccall "ges_asset_get_id" ges_asset_get_id ::
Ptr Asset ->
IO CString
assetGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsAsset a) =>
a
-> m T.Text
assetGetId :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsset a) =>
a -> m Text
assetGetId a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Asset
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
result <- Ptr Asset -> IO CString
ges_asset_get_id Ptr Asset
self'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"assetGetId" CString
result
Text
result' <- HasCallStack => CString -> IO Text
cstringToText 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 AssetGetIdMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAsset a) => O.OverloadedMethod AssetGetIdMethodInfo a signature where
overloadedMethod = assetGetId
instance O.OverloadedMethodInfo AssetGetIdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.assetGetId",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#v:assetGetId"
})
#endif
foreign import ccall "ges_asset_get_proxy" ges_asset_get_proxy ::
Ptr Asset ->
IO (Ptr Asset)
assetGetProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsAsset a) =>
a
-> m (Maybe Asset)
assetGetProxy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsset a) =>
a -> m (Maybe Asset)
assetGetProxy a
asset = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Asset
asset' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
asset
Ptr Asset
result <- Ptr Asset -> IO (Ptr Asset)
ges_asset_get_proxy Ptr Asset
asset'
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
Asset) Ptr Asset
result'
forall (m :: * -> *) a. Monad m => a -> m a
return Asset
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
asset
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Asset
maybeResult
#if defined(ENABLE_OVERLOADING)
data AssetGetProxyMethodInfo
instance (signature ~ (m (Maybe Asset)), MonadIO m, IsAsset a) => O.OverloadedMethod AssetGetProxyMethodInfo a signature where
overloadedMethod = assetGetProxy
instance O.OverloadedMethodInfo AssetGetProxyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.assetGetProxy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#v:assetGetProxy"
})
#endif
foreign import ccall "ges_asset_get_proxy_target" ges_asset_get_proxy_target ::
Ptr Asset ->
IO (Ptr Asset)
assetGetProxyTarget ::
(B.CallStack.HasCallStack, MonadIO m, IsAsset a) =>
a
-> m (Maybe Asset)
assetGetProxyTarget :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsset a) =>
a -> m (Maybe Asset)
assetGetProxyTarget a
proxy = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Asset
proxy' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
Ptr Asset
result <- Ptr Asset -> IO (Ptr Asset)
ges_asset_get_proxy_target Ptr Asset
proxy'
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
Asset) Ptr Asset
result'
forall (m :: * -> *) a. Monad m => a -> m a
return Asset
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Asset
maybeResult
#if defined(ENABLE_OVERLOADING)
data AssetGetProxyTargetMethodInfo
instance (signature ~ (m (Maybe Asset)), MonadIO m, IsAsset a) => O.OverloadedMethod AssetGetProxyTargetMethodInfo a signature where
overloadedMethod = assetGetProxyTarget
instance O.OverloadedMethodInfo AssetGetProxyTargetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.assetGetProxyTarget",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#v:assetGetProxyTarget"
})
#endif
foreign import ccall "ges_asset_list_proxies" ges_asset_list_proxies ::
Ptr Asset ->
IO (Ptr (GList (Ptr Asset)))
assetListProxies ::
(B.CallStack.HasCallStack, MonadIO m, IsAsset a) =>
a
-> m [Asset]
assetListProxies :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsset a) =>
a -> m [Asset]
assetListProxies a
asset = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Asset
asset' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
asset
Ptr (GList (Ptr Asset))
result <- Ptr Asset -> IO (Ptr (GList (Ptr Asset)))
ges_asset_list_proxies Ptr Asset
asset'
[Ptr Asset]
result' <- forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Asset))
result
[Asset]
result'' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Asset -> Asset
Asset) [Ptr Asset]
result'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
asset
forall (m :: * -> *) a. Monad m => a -> m a
return [Asset]
result''
#if defined(ENABLE_OVERLOADING)
data AssetListProxiesMethodInfo
instance (signature ~ (m [Asset]), MonadIO m, IsAsset a) => O.OverloadedMethod AssetListProxiesMethodInfo a signature where
overloadedMethod = assetListProxies
instance O.OverloadedMethodInfo AssetListProxiesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.assetListProxies",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#v:assetListProxies"
})
#endif
foreign import ccall "ges_asset_set_proxy" ges_asset_set_proxy ::
Ptr Asset ->
Ptr Asset ->
IO CInt
assetSetProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsAsset a, IsAsset b) =>
a
-> Maybe (b)
-> m Bool
assetSetProxy :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAsset a, IsAsset b) =>
a -> Maybe b -> m Bool
assetSetProxy a
asset Maybe b
proxy = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Asset
asset' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
asset
Ptr Asset
maybeProxy <- case Maybe b
proxy of
Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just b
jProxy -> do
Ptr Asset
jProxy' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProxy
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Asset
jProxy'
CInt
result <- Ptr Asset -> Ptr Asset -> IO CInt
ges_asset_set_proxy Ptr Asset
asset' Ptr Asset
maybeProxy
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
asset
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
proxy forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AssetSetProxyMethodInfo
instance (signature ~ (Maybe (b) -> m Bool), MonadIO m, IsAsset a, IsAsset b) => O.OverloadedMethod AssetSetProxyMethodInfo a signature where
overloadedMethod = assetSetProxy
instance O.OverloadedMethodInfo AssetSetProxyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.assetSetProxy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#v:assetSetProxy"
})
#endif
foreign import ccall "ges_asset_unproxy" ges_asset_unproxy ::
Ptr Asset ->
Ptr Asset ->
IO CInt
assetUnproxy ::
(B.CallStack.HasCallStack, MonadIO m, IsAsset a, IsAsset b) =>
a
-> b
-> m Bool
assetUnproxy :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAsset a, IsAsset b) =>
a -> b -> m Bool
assetUnproxy a
asset b
proxy = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr Asset
asset' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
asset
Ptr Asset
proxy' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
proxy
CInt
result <- Ptr Asset -> Ptr Asset -> IO CInt
ges_asset_unproxy Ptr Asset
asset' Ptr Asset
proxy'
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
asset
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
proxy
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AssetUnproxyMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsAsset a, IsAsset b) => O.OverloadedMethod AssetUnproxyMethodInfo a signature where
overloadedMethod = assetUnproxy
instance O.OverloadedMethodInfo AssetUnproxyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GES.Objects.Asset.assetUnproxy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Asset.html#v:assetUnproxy"
})
#endif
foreign import ccall "ges_asset_needs_reload" ges_asset_needs_reload ::
CGType ->
CString ->
IO CInt
assetNeedsReload ::
(B.CallStack.HasCallStack, MonadIO m) =>
GType
-> Maybe (T.Text)
-> m Bool
assetNeedsReload :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GType -> Maybe Text -> m Bool
assetNeedsReload GType
extractableType Maybe Text
id = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let extractableType' :: CGType
extractableType' = GType -> CGType
gtypeToCGType GType
extractableType
CString
maybeId <- case Maybe Text
id of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jId -> do
CString
jId' <- Text -> IO CString
textToCString Text
jId
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jId'
CInt
result <- CGType -> CString -> IO CInt
ges_asset_needs_reload CGType
extractableType' CString
maybeId
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. Ptr a -> IO ()
freeMem CString
maybeId
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ges_asset_request" ges_asset_request ::
CGType ->
CString ->
Ptr (Ptr GError) ->
IO (Ptr Asset)
assetRequest ::
(B.CallStack.HasCallStack, MonadIO m) =>
GType
-> Maybe (T.Text)
-> m (Maybe Asset)
assetRequest :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GType -> Maybe Text -> m (Maybe Asset)
assetRequest GType
extractableType Maybe Text
id = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let extractableType' :: CGType
extractableType' = GType -> CGType
gtypeToCGType GType
extractableType
CString
maybeId <- case Maybe Text
id of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jId -> do
CString
jId' <- Text -> IO CString
textToCString Text
jId
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jId'
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Asset
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ CGType -> CString -> Ptr (Ptr GError) -> IO (Ptr Asset)
ges_asset_request CGType
extractableType' CString
maybeId
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
wrapObject ManagedPtr Asset -> Asset
Asset) Ptr Asset
result'
forall (m :: * -> *) a. Monad m => a -> m a
return Asset
result''
forall a. Ptr a -> IO ()
freeMem CString
maybeId
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Asset
maybeResult
) (do
forall a. Ptr a -> IO ()
freeMem CString
maybeId
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ges_asset_request_async" ges_asset_request_async ::
CGType ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
assetRequestAsync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
GType
-> Maybe (T.Text)
-> Maybe (a)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
assetRequestAsync :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCancellable a) =>
GType -> Maybe Text -> Maybe a -> Maybe AsyncReadyCallback -> m ()
assetRequestAsync GType
extractableType Maybe Text
id Maybe a
cancellable Maybe AsyncReadyCallback
callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let extractableType' :: CGType
extractableType' = GType -> CGType
gtypeToCGType GType
extractableType
CString
maybeId <- case Maybe Text
id of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jId -> do
CString
jId' <- Text -> IO CString
textToCString Text
jId
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jId'
Ptr Cancellable
maybeCancellable <- case Maybe a
cancellable of
Maybe a
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just a
jCancellable -> do
Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall a b. Ptr a -> FunPtr b
castPtrToFunPtr forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = forall a. Ptr a
nullPtr
CGType
-> CString
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ges_asset_request_async CGType
extractableType' CString
maybeId Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback forall a. Ptr a
userData
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall a. Ptr a -> IO ()
freeMem CString
maybeId
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ges_asset_request_finish" ges_asset_request_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Asset)
assetRequestFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m Asset
assetRequestFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m Asset
assetRequestFinish a
res = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncResult
res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
res
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Asset
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr Asset)
ges_asset_request_finish Ptr AsyncResult
res'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"assetRequestFinish" Ptr Asset
result
Asset
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Asset -> Asset
Asset) Ptr Asset
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
res
forall (m :: * -> *) a. Monad m => a -> m a
return Asset
result'
) (do
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif