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 |
PaintVolume
is an opaque structure
whose members cannot be directly accessed.
A PaintVolume
represents an
a bounding volume whose internal representation isn't defined but
can be set and queried in terms of an axis aligned bounding box.
A PaintVolume
for a Actor
is defined to be relative from the current actor modelview matrix.
Other internal representation and methods for describing the bounding volume may be added in the future.
Since: 1.4
Synopsis
- newtype PaintVolume = PaintVolume (ManagedPtr PaintVolume)
- paintVolumeCopy :: (HasCallStack, MonadIO m) => PaintVolume -> m PaintVolume
- paintVolumeFree :: (HasCallStack, MonadIO m) => PaintVolume -> m ()
- paintVolumeGetDepth :: (HasCallStack, MonadIO m) => PaintVolume -> m Float
- paintVolumeGetHeight :: (HasCallStack, MonadIO m) => PaintVolume -> m Float
- paintVolumeGetOrigin :: (HasCallStack, MonadIO m) => PaintVolume -> m Vertex
- paintVolumeGetWidth :: (HasCallStack, MonadIO m) => PaintVolume -> m Float
- paintVolumeSetDepth :: (HasCallStack, MonadIO m) => PaintVolume -> Float -> m ()
- paintVolumeSetFromAllocation :: (HasCallStack, MonadIO m, IsActor a) => PaintVolume -> a -> m Bool
- paintVolumeSetHeight :: (HasCallStack, MonadIO m) => PaintVolume -> Float -> m ()
- paintVolumeSetOrigin :: (HasCallStack, MonadIO m) => PaintVolume -> Vertex -> m ()
- paintVolumeSetWidth :: (HasCallStack, MonadIO m) => PaintVolume -> Float -> m ()
- paintVolumeUnion :: (HasCallStack, MonadIO m) => PaintVolume -> PaintVolume -> m ()
- paintVolumeUnionBox :: (HasCallStack, MonadIO m) => PaintVolume -> ActorBox -> m ()
Exported types
newtype PaintVolume Source #
Memory-managed wrapper type.
PaintVolume (ManagedPtr PaintVolume) |
Instances
Eq PaintVolume Source # | |
Defined in GI.Clutter.Structs.PaintVolume (==) :: PaintVolume -> PaintVolume -> Bool # (/=) :: PaintVolume -> PaintVolume -> Bool # | |
GBoxed PaintVolume Source # | |
Defined in GI.Clutter.Structs.PaintVolume | |
ManagedPtrNewtype PaintVolume Source # | |
Defined in GI.Clutter.Structs.PaintVolume toManagedPtr :: PaintVolume -> ManagedPtr PaintVolume | |
TypedObject PaintVolume Source # | |
Defined in GI.Clutter.Structs.PaintVolume | |
HasParentTypes PaintVolume Source # | |
Defined in GI.Clutter.Structs.PaintVolume | |
IsGValue (Maybe PaintVolume) Source # | Convert |
Defined in GI.Clutter.Structs.PaintVolume gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe PaintVolume -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe PaintVolume) | |
type ParentTypes PaintVolume Source # | |
Defined in GI.Clutter.Structs.PaintVolume |
Methods
Click to display all available methods, including inherited ones
copy
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> m PaintVolume | Returns: a newly allocated copy of a |
Copies pv
into a new PaintVolume
Since: 1.6
free
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> m () |
Frees the resources allocated by pv
Since: 1.6
getDepth
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> m Float | Returns: the depth, in units of |
Retrieves the depth of the volume's, axis aligned, bounding box.
In other words; this takes into account what actor's coordinate
space pv
belongs too and conceptually fits an axis aligned box
around the volume. It returns the size of that bounding box as
measured along the z-axis.
If, for example, actorGetTransformedPaintVolume
is used to transform a 2D child actor that is 100px wide, 100px
high and 0px deep into container coordinates then the depth might
not simply be 0px if the child actor has a 3D rotation applied to
it.
Remember: if actorGetTransformedPaintVolume
is
used then the transformed volume will be defined relative to the
container actor and in container coordinates a 2D child actor
can have a 3D bounding volume.
There are no accuracy guarantees for the reported depth, except that it must always be greater than, or equal to, the actor's depth. This is because actors may report simple, loose fitting paint volumes for efficiency.
Since: 1.6
getHeight
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> m Float | Returns: the height, in units of |
Retrieves the height of the volume's, axis aligned, bounding box.
In other words; this takes into account what actor's coordinate
space pv
belongs too and conceptually fits an axis aligned box
around the volume. It returns the size of that bounding box as
measured along the y-axis.
If, for example, actorGetTransformedPaintVolume
is used to transform a 2D child actor that is 100px wide, 100px
high and 0px deep into container coordinates then the height might
not simply be 100px if the child actor has a 3D rotation applied to
it.
Remember: if actorGetTransformedPaintVolume
is
used then a transformed child volume will be defined relative to the
ancestor container actor and so a 2D child actor
can have a 3D bounding volume.
There are no accuracy guarantees for the reported height, except that it must always be greater than, or equal to, the actor's height. This is because actors may report simple, loose fitting paint volumes for efficiency.
Since: 1.6
getOrigin
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> m Vertex |
Retrieves the origin of the PaintVolume
.
Since: 1.6
getWidth
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> m Float | Returns: the width, in units of |
Retrieves the width of the volume's, axis aligned, bounding box.
In other words; this takes into account what actor's coordinate
space pv
belongs too and conceptually fits an axis aligned box
around the volume. It returns the size of that bounding box as
measured along the x-axis.
If, for example, actorGetTransformedPaintVolume
is used to transform a 2D child actor that is 100px wide, 100px
high and 0px deep into container coordinates then the width might
not simply be 100px if the child actor has a 3D rotation applied to
it.
Remember: if actorGetTransformedPaintVolume
is
used then a transformed child volume will be defined relative to the
ancestor container actor and so a 2D child actor can have a 3D
bounding volume.
There are no accuracy guarantees for the reported width, except that it must always be greater than, or equal to, the actor's width. This is because actors may report simple, loose fitting paint volumes for efficiency.
Since: 1.6
setDepth
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> Float |
|
-> m () |
Sets the depth of the paint volume. The depth is measured along
the z axis in the actor coordinates that pv
is associated with.
Since: 1.6
setFromAllocation
paintVolumeSetFromAllocation Source #
:: (HasCallStack, MonadIO m, IsActor a) | |
=> PaintVolume |
|
-> a |
|
-> m Bool | Returns: |
Sets the PaintVolume
from the allocation of actor
.
This function should be used when overriding the
ActorClass
.get_paint_volume
() by Actor
sub-classes
that do not paint outside their allocation.
A typical example is:
static gboolean my_actor_get_paint_volume (ClutterActor *self, ClutterPaintVolume *volume) { return clutter_paint_volume_set_from_allocation (volume, self); }
Since: 1.6
setHeight
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> Float |
|
-> m () |
Sets the height of the paint volume. The height is measured along
the y axis in the actor coordinates that pv
is associated with.
Since: 1.6
setOrigin
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> Vertex |
|
-> m () |
Sets the origin of the paint volume.
The origin is defined as the X, Y and Z coordinates of the top-left corner of an actor's paint volume, in actor coordinates.
The default is origin is assumed at: (0, 0, 0)
Since: 1.6
setWidth
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> Float |
|
-> m () |
Sets the width of the paint volume. The width is measured along
the x axis in the actor coordinates that pv
is associated with.
Since: 1.6
union
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> PaintVolume |
|
-> m () |
Updates the geometry of pv
to encompass pv
and anotherPv
.
There are no guarantees about how precisely the two volumes will be unioned.
Since: 1.6
unionBox
:: (HasCallStack, MonadIO m) | |
=> PaintVolume |
|
-> ActorBox |
|
-> m () |
Unions the 2D region represented by box
to a PaintVolume
.
This function is similar to paintVolumeUnion
, but it is
specific for 2D regions.
Since: 1.10