Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
The GskRenderNode
structure contains only private data.
Synopsis
- newtype RenderNode = RenderNode (ManagedPtr RenderNode)
- noRenderNode :: Maybe RenderNode
- renderNodeDraw :: (HasCallStack, MonadIO m) => RenderNode -> Context -> m ()
- renderNodeGetBounds :: (HasCallStack, MonadIO m) => RenderNode -> m Rect
- renderNodeGetNodeType :: (HasCallStack, MonadIO m) => RenderNode -> m RenderNodeType
- renderNodeRef :: (HasCallStack, MonadIO m) => RenderNode -> m RenderNode
- renderNodeSerialize :: (HasCallStack, MonadIO m) => RenderNode -> m Bytes
- renderNodeUnref :: (HasCallStack, MonadIO m) => RenderNode -> m ()
- renderNodeWriteToFile :: (HasCallStack, MonadIO m) => RenderNode -> Text -> m ()
Exported types
newtype RenderNode Source #
Memory-managed wrapper type.
Instances
Eq RenderNode Source # | |
Defined in GI.Gsk.Structs.RenderNode (==) :: RenderNode -> RenderNode -> Bool # (/=) :: RenderNode -> RenderNode -> Bool # | |
BoxedObject RenderNode Source # | |
Defined in GI.Gsk.Structs.RenderNode boxedType :: RenderNode -> IO GType # | |
IsGValue RenderNode Source # | Convert |
Defined in GI.Gsk.Structs.RenderNode toGValue :: RenderNode -> IO GValue # fromGValue :: GValue -> IO RenderNode # |
noRenderNode :: Maybe RenderNode Source #
A convenience alias for Nothing
:: Maybe
RenderNode
.
Methods
Overloaded methods
draw
:: (HasCallStack, MonadIO m) | |
=> RenderNode |
|
-> Context |
|
-> m () |
Draw the contents of node
to the given cairo context.
Typically, you'll use this function to implement fallback rendering
of GskRenderNodes
on an intermediate Cairo context, instead of using
the drawing context associated to a Surface
's rendering buffer.
For advanced nodes that cannot be supported using Cairo, in particular for nodes doing 3D operations, this function may fail.
getBounds
:: (HasCallStack, MonadIO m) | |
=> RenderNode |
|
-> m Rect |
Retrieves the boundaries of the node
. The node will not draw outside
of its boundaries.
getNodeType
renderNodeGetNodeType Source #
:: (HasCallStack, MonadIO m) | |
=> RenderNode |
|
-> m RenderNodeType | Returns: the type of the |
Returns the type of the node
.
ref
:: (HasCallStack, MonadIO m) | |
=> RenderNode |
|
-> m RenderNode | Returns: the |
Acquires a reference on the given RenderNode
.
serialize
:: (HasCallStack, MonadIO m) | |
=> RenderNode |
|
-> m Bytes | Returns: a |
Serializes the node
for later deserialization via
gsk_render_node_deserialize()
. No guarantees are made about the format
used other than that the same version of GTK+ will be able to deserialize
the result of a call to renderNodeSerialize
and
gsk_render_node_deserialize()
will correctly reject files it cannot open
that were created with previous versions of GTK+.
The intended use of this functions is testing, benchmarking and debugging. The format is not meant as a permanent storage format.
unref
:: (HasCallStack, MonadIO m) | |
=> RenderNode |
|
-> m () |
Releases a reference on the given RenderNode
.
If the reference was the last, the resources associated to the node
are
freed.
writeToFile
renderNodeWriteToFile Source #
:: (HasCallStack, MonadIO m) | |
=> RenderNode |
|
-> Text |
|
-> m () | (Can throw |
This function is equivalent to calling renderNodeSerialize
followed by fileSetContents
. See those two functions for details
on the arguments.
It is mostly intended for use inside a debugger to quickly dump a render node to a file for later inspection.