Top |
Functions
Types and Values
Description
GskRenderNode is the basic block in a scene graph to be rendered using GskRenderer.
Each node has a parent, except the top-level node; each node may have children nodes.
Each node has an associated drawing surface, which has the size of
the rectangle set using gsk_render_node_set_bounds()
.
Render nodes are meant to be transient; once they have been associated to a GskRenderer it's safe to release any reference you have on them. All GskRenderNodes are immutable, you can only specify their properties during construction.
Functions
gsk_render_node_ref ()
GskRenderNode *
gsk_render_node_ref (GskRenderNode *node
);
Acquires a reference on the given GskRenderNode.
gsk_render_node_unref ()
void
gsk_render_node_unref (GskRenderNode *node
);
Releases a reference on the given GskRenderNode.
If the reference was the last, the resources associated to the node
are
freed.
gsk_render_node_get_node_type ()
GskRenderNodeType
gsk_render_node_get_node_type (GskRenderNode *node
);
Returns the type of the node
.
gsk_render_node_draw ()
void gsk_render_node_draw (GskRenderNode *node
,cairo_t *cr
);
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 GdkSurface's rendering buffer.
For advanced nodes that cannot be supported using Cairo, in particular for nodes doing 3D operations, this function may fail.
GskParseErrorFunc ()
void (*GskParseErrorFunc) (const GskParseLocation *start
,const GskParseLocation *end
,const GError *error
,gpointer user_data
);
The type of callback that is called when a parse error occurs during deserialization of node data.
gsk_render_node_serialize ()
GBytes *
gsk_render_node_serialize (GskRenderNode *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 gsk_render_node_serialize()
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.
gsk_render_node_deserialize ()
GskRenderNode * gsk_render_node_deserialize (GBytes *bytes
,GskParseErrorFunc error_func
,gpointer user_data
);
Loads data previously created via gsk_render_node_serialize()
. For a
discussion of the supported format, see that function.
gsk_render_node_write_to_file ()
gboolean gsk_render_node_write_to_file (GskRenderNode *node
,const char *filename
,GError **error
);
This function is equivalent to calling gsk_render_node_serialize()
followed by g_file_set_contents()
. 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.
gsk_render_node_get_bounds ()
void gsk_render_node_get_bounds (GskRenderNode *node
,graphene_rect_t *bounds
);
Retrieves the boundaries of the node
. The node will not draw outside
of its boundaries.
gsk_color_node_new ()
GskRenderNode * gsk_color_node_new (const GdkRGBA *rgba
,const graphene_rect_t *bounds
);
Creates a GskRenderNode that will render the color specified by rgba
into
the area given by bounds
.
gsk_color_node_get_color ()
const GdkRGBA *
gsk_color_node_get_color (GskRenderNode *node
);
Retrieves the color of the given node
.
gsk_texture_node_new ()
GskRenderNode * gsk_texture_node_new (GdkTexture *texture
,const graphene_rect_t *bounds
);
Creates a GskRenderNode that will render the given
texture
into the area given by bounds
.
gsk_texture_node_get_texture ()
GdkTexture *
gsk_texture_node_get_texture (GskRenderNode *node
);
Retrieves the GdkTexture used when creating this GskRenderNode.
gsk_linear_gradient_node_new ()
GskRenderNode * gsk_linear_gradient_node_new (const graphene_rect_t *bounds
,const graphene_point_t *start
,const graphene_point_t *end
,const GskColorStop *color_stops
,gsize n_color_stops
);
Creates a GskRenderNode that will create a linear gradient from the given
points and color stops, and render that into the area given by bounds
.
Parameters
bounds |
the rectangle to render the linear gradient into |
|
start |
the point at which the linear gradient will begin |
|
end |
the point at which the linear gradient will finish |
|
color_stops |
a pointer to an array of GskColorStop defining the gradient The offsets of all color steps must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1. |
[array length=n_color_stops] |
n_color_stops |
the number of elements in |
gsk_repeating_linear_gradient_node_new ()
GskRenderNode * gsk_repeating_linear_gradient_node_new (const graphene_rect_t *bounds
,const graphene_point_t *start
,const graphene_point_t *end
,const GskColorStop *color_stops
,gsize n_color_stops
);
Creates a GskRenderNode that will create a repeating linear gradient
from the given points and color stops, and render that into the area
given by bounds
.
Parameters
bounds |
the rectangle to render the linear gradient into |
|
start |
the point at which the linear gradient will begin |
|
end |
the point at which the linear gradient will finish |
|
color_stops |
a pointer to an array of GskColorStop defining the gradient The offsets of all color steps must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1. |
[array length=n_color_stops] |
n_color_stops |
the number of elements in |
gsk_linear_gradient_node_get_start ()
const graphene_point_t *
gsk_linear_gradient_node_get_start (GskRenderNode *node
);
Retrieves the initial point of the linear gradient.
gsk_linear_gradient_node_get_end ()
const graphene_point_t *
gsk_linear_gradient_node_get_end (GskRenderNode *node
);
Retrieves the final point of the linear gradient.
gsk_linear_gradient_node_get_n_color_stops ()
gsize
gsk_linear_gradient_node_get_n_color_stops
(GskRenderNode *node
);
Retrieves the number of color stops in the gradient.
gsk_linear_gradient_node_get_color_stops ()
const GskColorStop * gsk_linear_gradient_node_get_color_stops (GskRenderNode *node
,gsize *n_stops
);
Retrieves the color stops in the gradient.
Parameters
node |
a GskRenderNode for a linear gradient. |
[type GskLinearGradientNode] |
n_stops |
the number of color stops in the returned array. |
[out][optional] |
gsk_radial_gradient_node_new ()
GskRenderNode * gsk_radial_gradient_node_new (const graphene_rect_t *bounds
,const graphene_point_t *center
,float hradius
,float vradius
,float start
,float end
,const GskColorStop *color_stops
,gsize n_color_stops
);
Creates a GskRenderNode that draws a radial gradient. The radial gradient
starts around center
. The size of the gradient is dictated by hradius
in horizontal orientation and by vradius
in vertial orientation.
Parameters
bounds |
the bounds of the node |
|
center |
the center of the gradient |
|
hradius |
the horizontal radius |
|
vradius |
the vertical radius |
|
start |
a percentage >= 0 that defines the start of the gradient around |
|
end |
a percentage >= 0 that defines the end of the gradient around |
|
color_stops |
a pointer to an array of GskColorStop defining the gradient The offsets of all color steps must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1. |
[array length=n_color_stops] |
n_color_stops |
the number of elements in |
gsk_repeating_radial_gradient_node_new ()
GskRenderNode * gsk_repeating_radial_gradient_node_new (const graphene_rect_t *bounds
,const graphene_point_t *center
,float hradius
,float vradius
,float start
,float end
,const GskColorStop *color_stops
,gsize n_color_stops
);
Creates a GskRenderNode that draws a repeating radial gradient. The radial gradient
starts around center
. The size of the gradient is dictated by hradius
in horizontal orientation and by vradius
in vertial orientation.
Parameters
bounds |
the bounds of the node |
|
center |
the center of the gradient |
|
hradius |
the horizontal radius |
|
vradius |
the vertical radius |
|
start |
a percentage >= 0 that defines the start of the gradient around |
|
end |
a percentage >= 0 that defines the end of the gradient around |
|
color_stops |
a pointer to an array of GskColorStop defining the gradient The offsets of all color steps must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1. |
[array length=n_color_stops] |
n_color_stops |
the number of elements in |
gsk_radial_gradient_node_get_n_color_stops ()
gsize
gsk_radial_gradient_node_get_n_color_stops
(GskRenderNode *node
);
Retrieves the number of color stops in the gradient.
gsk_radial_gradient_node_get_color_stops ()
const GskColorStop * gsk_radial_gradient_node_get_color_stops (GskRenderNode *node
,gsize *n_stops
);
Retrieves the color stops in the gradient.
Parameters
node |
a GskRenderNode for a radial gradient. |
[type GskRadialGradientNode] |
n_stops |
the number of color stops in the returned array. |
[out][optional] |
gsk_radial_gradient_node_get_start ()
float
gsk_radial_gradient_node_get_start (GskRenderNode *node
);
Retrieves the start value for the gradient.
gsk_radial_gradient_node_get_end ()
float
gsk_radial_gradient_node_get_end (GskRenderNode *node
);
Retrieves the end value for the gradient.
gsk_radial_gradient_node_get_hradius ()
float
gsk_radial_gradient_node_get_hradius (GskRenderNode *node
);
Retrieves the horizonal radius for the gradient.
gsk_radial_gradient_node_get_vradius ()
float
gsk_radial_gradient_node_get_vradius (GskRenderNode *node
);
Retrieves the vertical radius for the gradient.
gsk_radial_gradient_node_get_center ()
const graphene_point_t *
gsk_radial_gradient_node_get_center (GskRenderNode *node
);
Retrieves the center pointer for the gradient.
gsk_conic_gradient_node_new ()
GskRenderNode * gsk_conic_gradient_node_new (const graphene_rect_t *bounds
,const graphene_point_t *center
,float rotation
,const GskColorStop *color_stops
,gsize n_color_stops
);
Creates a GskRenderNode that draws a conic gradient. The conic gradient
starts around center
in the direction of rotation
. A rotation of 0 means
that the gradient points up. Color stops are then added clockwise.
Parameters
bounds |
the bounds of the node |
|
center |
the center of the gradient |
|
rotation |
the rotation of the gradient in degrees |
|
color_stops |
a pointer to an array of GskColorStop defining the gradient The offsets of all color steps must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1. |
[array length=n_color_stops] |
n_color_stops |
the number of elements in |
gsk_conic_gradient_node_get_n_color_stops ()
gsize
gsk_conic_gradient_node_get_n_color_stops
(GskRenderNode *node
);
Retrieves the number of color stops in the gradient.
gsk_conic_gradient_node_get_color_stops ()
const GskColorStop * gsk_conic_gradient_node_get_color_stops (GskRenderNode *node
,gsize *n_stops
);
Retrieves the color stops in the gradient.
Parameters
node |
a GskRenderNode for a conic gradient. |
[type GskConicGradientNode] |
n_stops |
the number of color stops in the returned array. |
[out][optional] |
gsk_conic_gradient_node_get_center ()
const graphene_point_t *
gsk_conic_gradient_node_get_center (GskRenderNode *node
);
Retrieves the center pointer for the gradient.
gsk_conic_gradient_node_get_rotation ()
float
gsk_conic_gradient_node_get_rotation (GskRenderNode *node
);
Retrieves the rotation for the gradient in degrees.
gsk_border_node_new ()
GskRenderNode * gsk_border_node_new (const GskRoundedRect *outline
,const float border_width[4]
,const GdkRGBA border_color[4]
);
Creates a GskRenderNode that will stroke a border rectangle inside the
given outline
. The 4 sides of the border can have different widths and
colors.
Parameters
outline |
a GskRoundedRect describing the outline of the border |
|
border_width |
the stroke width of the border on the top, right, bottom and left side respectively. |
[array fixed-size=4] |
border_color |
the color used on the top, right, bottom and left side. |
[array fixed-size=4] |
gsk_border_node_get_outline ()
const GskRoundedRect *
gsk_border_node_get_outline (GskRenderNode *node
);
Retrieves the outline of the border.
gsk_border_node_get_widths ()
const float *
gsk_border_node_get_widths (GskRenderNode *node
);
Retrieves the stroke widths of the border.
gsk_border_node_get_colors ()
const GdkRGBA *
gsk_border_node_get_colors (GskRenderNode *node
);
Retrieves the colors of the border.
Returns
an array of 4 GdkRGBA structs for the top, right, bottom and left color of the border.
[transfer none]
gsk_inset_shadow_node_new ()
GskRenderNode * gsk_inset_shadow_node_new (const GskRoundedRect *outline
,const GdkRGBA *color
,float dx
,float dy
,float spread
,float blur_radius
);
Creates a GskRenderNode that will render an inset shadow
into the box given by outline
.
gsk_inset_shadow_node_get_outline ()
const GskRoundedRect *
gsk_inset_shadow_node_get_outline (GskRenderNode *node
);
Retrieves the outline rectangle of the inset shadow.
gsk_inset_shadow_node_get_color ()
const GdkRGBA *
gsk_inset_shadow_node_get_color (GskRenderNode *node
);
Retrieves the color of the inset shadow.
gsk_inset_shadow_node_get_dx ()
float
gsk_inset_shadow_node_get_dx (GskRenderNode *node
);
Retrieves the horizontal offset of the inset shadow.
gsk_inset_shadow_node_get_dy ()
float
gsk_inset_shadow_node_get_dy (GskRenderNode *node
);
Retrieves the vertical offset of the inset shadow.
gsk_inset_shadow_node_get_spread ()
float
gsk_inset_shadow_node_get_spread (GskRenderNode *node
);
Retrieves how much the shadow spreads inwards.
gsk_inset_shadow_node_get_blur_radius ()
float
gsk_inset_shadow_node_get_blur_radius (GskRenderNode *node
);
Retrieves the blur radius to apply to the shadow.
gsk_outset_shadow_node_new ()
GskRenderNode * gsk_outset_shadow_node_new (const GskRoundedRect *outline
,const GdkRGBA *color
,float dx
,float dy
,float spread
,float blur_radius
);
Creates a GskRenderNode that will render an outset shadow
around the box given by outline
.
gsk_outset_shadow_node_get_outline ()
const GskRoundedRect *
gsk_outset_shadow_node_get_outline (GskRenderNode *node
);
Retrieves the outline rectangle of the outset shadow.
gsk_outset_shadow_node_get_color ()
const GdkRGBA *
gsk_outset_shadow_node_get_color (GskRenderNode *node
);
Retrieves the color of the outset shadow.
gsk_outset_shadow_node_get_dx ()
float
gsk_outset_shadow_node_get_dx (GskRenderNode *node
);
Retrieves the horizontal offset of the outset shadow.
gsk_outset_shadow_node_get_dy ()
float
gsk_outset_shadow_node_get_dy (GskRenderNode *node
);
Retrieves the vertical offset of the outset shadow.
gsk_outset_shadow_node_get_spread ()
float
gsk_outset_shadow_node_get_spread (GskRenderNode *node
);
Retrieves how much the shadow spreads outwards.
gsk_outset_shadow_node_get_blur_radius ()
float
gsk_outset_shadow_node_get_blur_radius
(GskRenderNode *node
);
Retrieves the blur radius of the shadow.
gsk_cairo_node_new ()
GskRenderNode *
gsk_cairo_node_new (const graphene_rect_t *bounds
);
Creates a GskRenderNode that will render a cairo surface
into the area given by bounds
. You can draw to the cairo
surface using gsk_cairo_node_get_draw_context()
gsk_cairo_node_get_draw_context ()
cairo_t *
gsk_cairo_node_get_draw_context (GskRenderNode *node
);
Creates a Cairo context for drawing using the surface associated to the render node.
If no surface exists yet, a surface will be created optimized for
rendering to renderer
.
gsk_cairo_node_get_surface ()
cairo_surface_t *
gsk_cairo_node_get_surface (GskRenderNode *node
);
Retrieves the Cairo surface used by the render node.
gsk_container_node_new ()
GskRenderNode * gsk_container_node_new (GskRenderNode **children
,guint n_children
);
Creates a new GskRenderNode instance for holding the given children
.
The new node will acquire a reference to each of the children.
gsk_container_node_get_n_children ()
guint
gsk_container_node_get_n_children (GskRenderNode *node
);
Retrieves the number of direct children of node
.
gsk_container_node_get_child ()
GskRenderNode * gsk_container_node_get_child (GskRenderNode *node
,guint idx
);
Gets one of the children of container
.
Parameters
node |
a container GskRenderNode. |
[type GskContainerNode] |
idx |
the position of the child to get |
gsk_transform_node_new ()
GskRenderNode * gsk_transform_node_new (GskRenderNode *child
,GskTransform *transform
);
Creates a GskRenderNode that will transform the given child
with the given transform
.
gsk_transform_node_get_child ()
GskRenderNode *
gsk_transform_node_get_child (GskRenderNode *node
);
Gets the child node that is getting transformed by the given node
.
gsk_transform_node_get_transform ()
GskTransform *
gsk_transform_node_get_transform (GskRenderNode *node
);
Retrieves the GskTransform used by the node
.
gsk_opacity_node_new ()
GskRenderNode * gsk_opacity_node_new (GskRenderNode *child
,float opacity
);
Creates a GskRenderNode that will drawn the child
with reduced
opacity
.
gsk_opacity_node_get_child ()
GskRenderNode *
gsk_opacity_node_get_child (GskRenderNode *node
);
Gets the child node that is getting opacityed by the given node
.
gsk_opacity_node_get_opacity ()
float
gsk_opacity_node_get_opacity (GskRenderNode *node
);
Gets the transparency factor for an opacity node.
gsk_color_matrix_node_new ()
GskRenderNode * gsk_color_matrix_node_new (GskRenderNode *child
,const graphene_matrix_t *color_matrix
,const graphene_vec4_t *color_offset
);
Creates a GskRenderNode that will drawn the child
with reduced
color_matrix
.
In particular, the node will transform the operation
1 |
pixel = color_matrix * pixel + color_offset |
for every pixel.
gsk_color_matrix_node_get_child ()
GskRenderNode *
gsk_color_matrix_node_get_child (GskRenderNode *node
);
Gets the child node that is getting its colors modified by the given node
.
gsk_color_matrix_node_get_color_matrix ()
const graphene_matrix_t *
gsk_color_matrix_node_get_color_matrix
(GskRenderNode *node
);
Retrieves the color matrix used by the node
.
gsk_color_matrix_node_get_color_offset ()
const graphene_vec4_t *
gsk_color_matrix_node_get_color_offset
(GskRenderNode *node
);
Retrieves the color offset used by the node
.
gsk_repeat_node_new ()
GskRenderNode * gsk_repeat_node_new (const graphene_rect_t *bounds
,GskRenderNode *child
,const graphene_rect_t *child_bounds
);
Creates a GskRenderNode that will repeat the drawing of child
across
the given bounds
.
gsk_repeat_node_get_child ()
GskRenderNode *
gsk_repeat_node_get_child (GskRenderNode *node
);
Retrieves the child of node
.
gsk_repeat_node_get_child_bounds ()
const graphene_rect_t *
gsk_repeat_node_get_child_bounds (GskRenderNode *node
);
Retrieves the bounding rectangle of the child of node
.
gsk_clip_node_new ()
GskRenderNode * gsk_clip_node_new (GskRenderNode *child
,const graphene_rect_t *clip
);
Creates a GskRenderNode that will clip the child
to the area
given by clip
.
gsk_clip_node_get_child ()
GskRenderNode *
gsk_clip_node_get_child (GskRenderNode *node
);
Gets the child node that is getting clipped by the given node
.
gsk_clip_node_get_clip ()
const graphene_rect_t *
gsk_clip_node_get_clip (GskRenderNode *node
);
Retrieves the clip rectangle for node
.
gsk_rounded_clip_node_new ()
GskRenderNode * gsk_rounded_clip_node_new (GskRenderNode *child
,const GskRoundedRect *clip
);
Creates a GskRenderNode that will clip the child
to the area
given by clip
.
gsk_rounded_clip_node_get_child ()
GskRenderNode *
gsk_rounded_clip_node_get_child (GskRenderNode *node
);
Gets the child node that is getting clipped by the given node
.
gsk_rounded_clip_node_get_clip ()
const GskRoundedRect *
gsk_rounded_clip_node_get_clip (GskRenderNode *node
);
Retrievs the rounded rectangle used to clip the contents of the node
.
gsk_shadow_node_new ()
GskRenderNode * gsk_shadow_node_new (GskRenderNode *child
,const GskShadow *shadows
,gsize n_shadows
);
Creates a GskRenderNode that will draw a child
with the given
shadows
below it.
gsk_shadow_node_get_shadow ()
const GskShadow * gsk_shadow_node_get_shadow (GskRenderNode *node
,gsize i
);
Retrieves the shadow data at the given index i
.
gsk_shadow_node_get_n_shadows ()
gsize
gsk_shadow_node_get_n_shadows (GskRenderNode *node
);
Retrieves the number of shadows in the node
.
gsk_shadow_node_get_child ()
GskRenderNode *
gsk_shadow_node_get_child (GskRenderNode *node
);
Retrieves the child GskRenderNode of the shadow node
.
gsk_blend_node_new ()
GskRenderNode * gsk_blend_node_new (GskRenderNode *bottom
,GskRenderNode *top
,GskBlendMode blend_mode
);
Creates a GskRenderNode that will use blend_mode
to blend the top
node onto the bottom
node.
gsk_blend_node_get_bottom_child ()
GskRenderNode *
gsk_blend_node_get_bottom_child (GskRenderNode *node
);
Retrieves the bottom GskRenderNode child of the node
.
gsk_blend_node_get_top_child ()
GskRenderNode *
gsk_blend_node_get_top_child (GskRenderNode *node
);
Retrieves the top GskRenderNode child of the node
.
gsk_blend_node_get_blend_mode ()
GskBlendMode
gsk_blend_node_get_blend_mode (GskRenderNode *node
);
Retrieves the blend mode used by node
.
gsk_cross_fade_node_new ()
GskRenderNode * gsk_cross_fade_node_new (GskRenderNode *start
,GskRenderNode *end
,float progress
);
Creates a GskRenderNode that will do a cross-fade between start
and end
.
gsk_cross_fade_node_get_start_child ()
GskRenderNode *
gsk_cross_fade_node_get_start_child (GskRenderNode *node
);
Retrieves the child GskRenderNode at the beginning of the cross-fade.
gsk_cross_fade_node_get_end_child ()
GskRenderNode *
gsk_cross_fade_node_get_end_child (GskRenderNode *node
);
Retrieves the child GskRenderNode at the end of the cross-fade.
gsk_cross_fade_node_get_progress ()
float
gsk_cross_fade_node_get_progress (GskRenderNode *node
);
Retrieves the progress value of the cross fade.
gsk_text_node_new ()
GskRenderNode * gsk_text_node_new (PangoFont *font
,PangoGlyphString *glyphs
,const GdkRGBA *color
,const graphene_point_t *offset
);
Creates a render node that renders the given glyphs,
Note that color
may not be used if the font contains
color glyphs.
Parameters
font |
the PangoFont containing the glyphs |
|
glyphs |
the PangoGlyphString to render |
|
color |
the foreground color to render with |
|
offset |
offset of the baseline |
gsk_text_node_get_font ()
PangoFont *
gsk_text_node_get_font (GskRenderNode *node
);
Returns the font used by the text node
.
gsk_text_node_get_glyphs ()
const PangoGlyphInfo * gsk_text_node_get_glyphs (GskRenderNode *node
,guint *n_glyphs
);
Retrieves the glyph information in the node
.
Parameters
node |
a text GskRenderNode. |
[type GskTextNode] |
n_glyphs |
the number of glyphs returned. |
[out][optional] |
gsk_text_node_get_color ()
const GdkRGBA *
gsk_text_node_get_color (GskRenderNode *node
);
Retrieves the color used by the text node
.
gsk_text_node_has_color_glyphs ()
gboolean
gsk_text_node_has_color_glyphs (GskRenderNode *node
);
Checks whether the text node
has color glyphs.
gsk_text_node_get_num_glyphs ()
guint
gsk_text_node_get_num_glyphs (GskRenderNode *node
);
Retrieves the number of glyphs in the text node.
gsk_text_node_get_offset ()
const graphene_point_t *
gsk_text_node_get_offset (GskRenderNode *node
);
Retrieves the offset applied to the text.
gsk_blur_node_new ()
GskRenderNode * gsk_blur_node_new (GskRenderNode *child
,float radius
);
Creates a render node that blurs the child.
gsk_blur_node_get_child ()
GskRenderNode *
gsk_blur_node_get_child (GskRenderNode *node
);
Retrieves the child GskRenderNode of the blur node
.
gsk_blur_node_get_radius ()
float
gsk_blur_node_get_radius (GskRenderNode *node
);
Retrieves the blur radius of the node
.
gsk_debug_node_new ()
GskRenderNode * gsk_debug_node_new (GskRenderNode *child
,char *message
);
Creates a GskRenderNode that will add debug information about
the given child
.
Adding this node has no visual effect.
gsk_debug_node_get_child ()
GskRenderNode *
gsk_debug_node_get_child (GskRenderNode *node
);
Gets the child node that is getting drawn by the given node
.
gsk_debug_node_get_message ()
const char *
gsk_debug_node_get_message (GskRenderNode *node
);
Gets the debug message that was set on this node
gsk_gl_shader_node_new ()
GskRenderNode * gsk_gl_shader_node_new (GskGLShader *shader
,const graphene_rect_t *bounds
,GBytes *args
,GskRenderNode **children
,guint n_children
);
Creates a GskRenderNode that will render the given shader
into the
area given by bounds
. The args
is a block of data to use for uniform
input, as per types and offsets defined by the shader
. Normally this
is generated by gsk_gl_shader_format_args()
or GskGLShaderArgBuilder.
See GskGLShader for details about how the shader should be written.
All the children will be rendered into textures (if they aren't already GskTextureNodes, which will be used directly). These textures will be sent as input to the shader.
If the renderer doesn't support GL shaders, or if there is any problem
when compiling the shader, then the node will draw pink. You should use
gsk_gl_shader_compile()
to ensure the shader
will work for the
renderer before using it.
Parameters
shader |
the GskGLShader |
|
bounds |
the rectangle to render the shader into |
|
args |
Arguments for the uniforms |
|
children |
array of child nodes, these will be rendered to textures and used as input. |
[array length=n_children] |
n_children |
Length of |
gsk_gl_shader_node_get_n_children ()
guint
gsk_gl_shader_node_get_n_children (GskRenderNode *node
);
Returns the number of children
gsk_gl_shader_node_get_child ()
GskRenderNode * gsk_gl_shader_node_get_child (GskRenderNode *node
,guint idx
);
Gets one of the children.
Parameters
node |
a GskRenderNode for a gl shader. |
[type GskGLShaderNode] |
idx |
the position of the child to get |
gsk_gl_shader_node_get_args ()
GBytes *
gsk_gl_shader_node_get_args (GskRenderNode *node
);
Gets args for the node.
gsk_gl_shader_node_get_shader ()
GskGLShader *
gsk_gl_shader_node_get_shader (GskRenderNode *node
);
Gets shader code for the node.
Types and Values
GskBlendNode
typedef struct _GskBlendNode GskBlendNode;
A render node applying a blending function between its two child nodes.
GskBlurNode
typedef struct _GskBlurNode GskBlurNode;
A render node applying a blur effect to its single child.
GskClipNode
typedef struct _GskClipNode GskClipNode;
A render node applying a rectangular clip to its single child node.
GskColorMatrixNode
typedef struct _GskColorMatrixNode GskColorMatrixNode;
A render node controlling the color matrix of its single child node.
GskConicGradientNode
typedef struct _GskConicGradientNode GskConicGradientNode;
A render node for a conic gradient.
GskContainerNode
typedef struct _GskContainerNode GskContainerNode;
A render node that can contain other render nodes.
GskCrossFadeNode
typedef struct _GskCrossFadeNode GskCrossFadeNode;
A render node cross fading between two child nodes.
GskDebugNode
typedef struct _GskDebugNode GskDebugNode;
A render node that emits a debugging message when drawing its child node.
GskInsetShadowNode
typedef struct _GskInsetShadowNode GskInsetShadowNode;
A render node for an inset shadow.
GskLinearGradientNode
typedef struct _GskLinearGradientNode GskLinearGradientNode;
A render node for a linear gradient.
GskRadialGradientNode
typedef struct _GskRadialGradientNode GskRadialGradientNode;
A render node for a radial gradient.
GskOpacityNode
typedef struct _GskOpacityNode GskOpacityNode;
A render node controlling the opacity of its single child node.
GskOutsetShadowNode
typedef struct _GskOutsetShadowNode GskOutsetShadowNode;
A render node for an outset shadow.
GskRepeatingLinearGradientNode
typedef struct _GskRepeatingLinearGradientNode GskRepeatingLinearGradientNode;
A render node for a repeating linear gradient.
GskRepeatingRadialGradientNode
typedef struct _GskRepeatingRadialGradientNode GskRepeatingRadialGradientNode;
A render node for a repeating radial gradient.
GskRepeatNode
typedef struct _GskRepeatNode GskRepeatNode;
A render node repeating its single child node.
GskRoundedClipNode
typedef struct _GskRoundedClipNode GskRoundedClipNode;
A render node applying a rounded rectangle clip to its single child.
GskShadowNode
typedef struct _GskShadowNode GskShadowNode;
A render node drawing one or more shadows behind its single child node.
GskTransformNode
typedef struct _GskTransformNode GskTransformNode;
A render node applying a GskTransform to its single child node.
GskGLShaderNode
typedef struct _GskGLShaderNode GskGLShaderNode;
A render node using a GL shader when drawing its children nodes.
enum GskRenderNodeType
The type of a node determines what the node is rendering.
Members
Error type. No node will ever have this type. |
||
A node containing a stack of children |
||
A node drawing a cairo_surface_t |
||
A node drawing a single color rectangle |
||
A node drawing a linear gradient |
||
A node drawing a repeating linear gradient |
||
A node drawing a radial gradient |
||
A node drawing a repeating radial gradient |
||
A node drawing a conic gradient |
||
A node stroking a border around an area |
||
A node drawing a GdkTexture |
||
A node drawing an inset shadow |
||
A node drawing an outset shadow |
||
A node that renders its child after applying a matrix transform |
||
A node that changes the opacity of its child |
||
A node that applies a color matrix to every pixel |
||
A node that repeats the child's contents |
||
A node that clips its child to a rectangular area |
||
A node that clips its child to a rounded rectangle |
||
A node that draws a shadow below its child |
||
A node that blends two children together |
||
A node that cross-fades between two children |
||
A node containing a glyph string |
||
A node that applies a blur |
||
Debug information that does not affect the rendering |
||
A node that uses OpenGL fragment shaders to render |
struct GskParseLocation
struct GskParseLocation { gsize bytes; gsize chars; gsize lines; gsize line_bytes; gsize line_chars; };
A location in a parse buffer.
enum GskScalingFilter
The filters used when scaling texture data.
The actual implementation of each filter is deferred to the rendering pipeline.
struct GskColorStop
struct GskColorStop { float offset; GdkRGBA color; };
A color stop in a gradient node.
struct GskShadow
struct GskShadow { GdkRGBA color; float dx; float dy; float radius; };
The shadow parameters in a shadow node.
Members
GdkRGBA |
the color of the shadow |
|
the horizontal offset of the shadow |
||
the vertical offset of the shadow |
||
the radius of the shadow |
enum GskBlendMode
The blend modes available for render nodes.
The implementation of each blend mode is deferred to the rendering pipeline.
See https://www.w3.org/TR/compositing-1/blending for more information on blending and blend modes.
Members
The default blend mode, which specifies no blending |
||
The source color is multiplied by the destination and replaces the destination |
||
Multiplies the complements of the destination and source color values, then complements the result. |
||
Multiplies or screens the colors, depending on the destination color value. This is the inverse of hard-list |
||
Selects the darker of the destination and source colors |
||
Selects the lighter of the destination and source colors |
||
Brightens the destination color to reflect the source color |
||
Darkens the destination color to reflect the source color |
||
Multiplies or screens the colors, depending on the source color value |
||
Darkens or lightens the colors, depending on the source color value |
||
Subtracts the darker of the two constituent colors from the lighter color |
||
Produces an effect similar to that of the difference mode but lower in contrast |
||
Creates a color with the hue and saturation of the source color and the luminosity of the destination color |
||
Creates a color with the hue of the source color and the saturation and luminosity of the destination color |
||
Creates a color with the saturation of the source color and the hue and luminosity of the destination color |
||
Creates a color with the luminosity of the source color and the hue and saturation of the destination color |