Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A Object
that implements the Extractable
interface can be
extracted from a Asset
using assetExtract
.
Each extractable type will have its own way of interpreting the
Asset:id of an asset (or, if it is associated with a specific
subclass of Asset
, the asset subclass may handle the
interpretation of the Asset:id). By default, the requested asset
Asset:id will be ignored by a Extractable
and will be set to
the type name of the extractable instead. Also by default, when the
requested asset is extracted, the returned object will simply be a
newly created default object of that extractable type. You should check
the documentation for each extractable type to see if they differ from
the default.
After the object is extracted, it will have a reference to the asset it
came from, which you can retrieve using extractableGetAsset
.
Synopsis
- newtype Extractable = Extractable (ManagedPtr Extractable)
- class (GObject o, IsDescendantOf Extractable o) => IsExtractable o
- toExtractable :: (MonadIO m, IsExtractable o) => o -> m Extractable
- extractableGetAsset :: (HasCallStack, MonadIO m, IsExtractable a) => a -> m (Maybe Asset)
- extractableGetId :: (HasCallStack, MonadIO m, IsExtractable a) => a -> m Text
- extractableSetAsset :: (HasCallStack, MonadIO m, IsExtractable a, IsAsset b) => a -> b -> m Bool
Exported types
newtype Extractable Source #
Memory-managed wrapper type.
Extractable (ManagedPtr Extractable) |
Instances
Eq Extractable Source # | |
Defined in GI.GES.Interfaces.Extractable (==) :: Extractable -> Extractable -> Bool # (/=) :: Extractable -> Extractable -> Bool # | |
GObject Extractable Source # | |
Defined in GI.GES.Interfaces.Extractable | |
ManagedPtrNewtype Extractable Source # | |
Defined in GI.GES.Interfaces.Extractable toManagedPtr :: Extractable -> ManagedPtr Extractable | |
TypedObject Extractable Source # | |
Defined in GI.GES.Interfaces.Extractable | |
HasParentTypes Extractable Source # | |
Defined in GI.GES.Interfaces.Extractable | |
IsGValue (Maybe Extractable) Source # | Convert |
Defined in GI.GES.Interfaces.Extractable gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Extractable -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Extractable) | |
type ParentTypes Extractable Source # | |
Defined in GI.GES.Interfaces.Extractable type ParentTypes Extractable = '[InitiallyUnowned, Object] |
class (GObject o, IsDescendantOf Extractable o) => IsExtractable o Source #
Type class for types which can be safely cast to Extractable
, for instance with toExtractable
.
Instances
(GObject o, IsDescendantOf Extractable o) => IsExtractable o Source # | |
Defined in GI.GES.Interfaces.Extractable |
toExtractable :: (MonadIO m, IsExtractable o) => o -> m Extractable Source #
Cast to Extractable
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAsset, getData, getId, getProperty, getQdata.
Setters
getAsset
:: (HasCallStack, MonadIO m, IsExtractable a) | |
=> a |
|
-> m (Maybe Asset) | Returns: The asset set on |
Get the asset that has been set on the extractable object.
getId
:: (HasCallStack, MonadIO m, IsExtractable a) | |
=> a |
|
-> m Text | Returns: The Asset:id of some associated |
Gets the Asset:id of some associated asset. It may be the case
that the object has no set asset, or even that such an asset does not
yet exist in the GES cache. Instead, this will return the asset
Asset:id that is _compatible_ with the current state of the object,
as determined by the Extractable
implementer. If it was indeed
extracted from an asset, this should return the same as its
corresponding asset Asset:id.
setAsset
:: (HasCallStack, MonadIO m, IsExtractable a, IsAsset b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Sets the asset for this extractable object.
When an object is extracted from an asset using assetExtract
its
asset will be automatically set. Note that many classes that implement
Extractable
will automatically create their objects using assets
when you call their new
methods. However, you can use this method to
associate an object with a compatible asset if it was created by other
means and does not yet have an asset. Or, for some implementations of
Extractable
, you can use this to change the asset of the given
extractable object, which will lead to a change in its state to
match the new asset Asset:id.