gi-ges-1.0.4: libges bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GES.Interfaces.Extractable

Description

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

Exported types

newtype Extractable Source #

Memory-managed wrapper type.

Constructors

Extractable (ManagedPtr Extractable) 

Instances

Instances details
Eq Extractable Source # 
Instance details

Defined in GI.GES.Interfaces.Extractable

GObject Extractable Source # 
Instance details

Defined in GI.GES.Interfaces.Extractable

ManagedPtrNewtype Extractable Source # 
Instance details

Defined in GI.GES.Interfaces.Extractable

Methods

toManagedPtr :: Extractable -> ManagedPtr Extractable

TypedObject Extractable Source # 
Instance details

Defined in GI.GES.Interfaces.Extractable

Methods

glibType :: IO GType

HasParentTypes Extractable Source # 
Instance details

Defined in GI.GES.Interfaces.Extractable

IsGValue (Maybe Extractable) Source #

Convert Extractable to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GES.Interfaces.Extractable

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Extractable -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Extractable)

type ParentTypes Extractable Source # 
Instance details

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

Instances details
(GObject o, IsDescendantOf Extractable o) => IsExtractable o Source # 
Instance details

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

getAsset

extractableGetAsset Source #

Arguments

:: (HasCallStack, MonadIO m, IsExtractable a) 
=> a

self: A Extractable

-> m (Maybe Asset)

Returns: The asset set on self, or Nothing if no asset has been set.

Get the asset that has been set on the extractable object.

getId

extractableGetId Source #

Arguments

:: (HasCallStack, MonadIO m, IsExtractable a) 
=> a

self: A Extractable

-> m Text

Returns: The Asset:id of some associated Asset that is compatible with self's current state.

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

extractableSetAsset Source #

Arguments

:: (HasCallStack, MonadIO m, IsExtractable a, IsAsset b) 
=> a

self: A Extractable

-> b

asset: The asset to set

-> m Bool

Returns: True if asset could be successfully set on self.

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.