gi-gsk-4.0.2: Gsk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gsk.Objects.RenderNode

Description

A node in the render tree.

Synopsis

Exported types

newtype RenderNode Source #

Memory-managed wrapper type.

Instances

Instances details
Eq RenderNode Source # 
Instance details

Defined in GI.Gsk.Objects.RenderNode

ManagedPtrNewtype RenderNode Source # 
Instance details

Defined in GI.Gsk.Objects.RenderNode

BoxedPtr RenderNode Source # 
Instance details

Defined in GI.Gsk.Objects.RenderNode

TypedObject RenderNode Source # 
Instance details

Defined in GI.Gsk.Objects.RenderNode

Methods

glibType :: IO GType #

HasParentTypes RenderNode Source # 
Instance details

Defined in GI.Gsk.Objects.RenderNode

type ParentTypes RenderNode Source # 
Instance details

Defined in GI.Gsk.Objects.RenderNode

type ParentTypes RenderNode = '[] :: [Type]

class (BoxedPtr o, TypedObject o, IsDescendantOf RenderNode o) => IsRenderNode o Source #

Type class for types which can be safely cast to RenderNode, for instance with toRenderNode.

Instances

Instances details
(BoxedPtr o, TypedObject o, IsDescendantOf RenderNode o) => IsRenderNode o Source # 
Instance details

Defined in GI.Gsk.Objects.RenderNode

toRenderNode :: (MonadIO m, IsRenderNode o) => o -> m RenderNode Source #

Cast to RenderNode, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

draw

renderNodeDraw Source #

Arguments

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

node: a RenderNode

-> Context

cr: cairo context to draw to

-> 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

renderNodeGetBounds Source #

Arguments

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

node: a RenderNode

-> m Rect 

Retrieves the boundaries of the node. The node will not draw outside of its boundaries.

getNodeType

renderNodeGetNodeType Source #

Arguments

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

node: a RenderNode

-> m RenderNodeType

Returns: the type of the RenderNode

Returns the type of the node.

ref

renderNodeRef Source #

Arguments

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

node: a RenderNode

-> m RenderNode

Returns: the RenderNode with an additional reference

Acquires a reference on the given RenderNode.

serialize

renderNodeSerialize Source #

Arguments

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

node: a RenderNode

-> m Bytes

Returns: a Bytes representing the node.

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

renderNodeUnref Source #

Arguments

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

node: a 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 #

Arguments

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

node: a RenderNode

-> Text

filename: the file to save it to.

-> m ()

(Can throw GError)

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.