1/* GSK - The GTK Scene Kit
2 *
3 * Copyright 2016 Endless
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __GSK_RENDER_NODE_H__
20#define __GSK_RENDER_NODE_H__
21
22#if !defined (__GSK_H_INSIDE__) && !defined (GTK_COMPILATION)
23#error "Only <gsk/gsk.h> can be included directly."
24#endif
25
26#include <gsk/gskroundedrect.h>
27#include <gsk/gsktypes.h>
28#include <gsk/gskglshader.h>
29#include <gtk/css/gtkcss.h>
30
31G_BEGIN_DECLS
32
33#define GSK_TYPE_RENDER_NODE (gsk_render_node_get_type ())
34
35#define GSK_IS_RENDER_NODE(obj) ((obj) != NULL)
36
37#define GSK_SERIALIZATION_ERROR (gsk_serialization_error_quark ())
38
39typedef struct _GskRenderNode GskRenderNode;
40typedef struct _GskColorStop GskColorStop;
41typedef struct _GskShadow GskShadow;
42
43/**
44 * GskColorStop:
45 * @offset: the offset of the color stop
46 * @color: the color at the given offset
47 *
48 * A color stop in a gradient node.
49 */
50struct _GskColorStop
51{
52 float offset;
53 GdkRGBA color;
54};
55
56/**
57 * GskShadow:
58 * @color: the color of the shadow
59 * @dx: the horizontal offset of the shadow
60 * @dy: the vertical offset of the shadow
61 * @radius: the radius of the shadow
62 *
63 * The shadow parameters in a shadow node.
64 */
65struct _GskShadow
66{
67 GdkRGBA color;
68 float dx;
69 float dy;
70 float radius;
71};
72
73typedef struct _GskParseLocation GskParseLocation;
74
75/**
76 * GskParseLocation:
77 * @bytes: the offset of the location in the parse buffer, as bytes
78 * @chars: the offset of the location in the parse buffer, as characters
79 * @lines: the line of the location in the parse buffer
80 * @line_bytes: the position in the line, as bytes
81 * @line_chars: the position in the line, as characters
82 *
83 * A location in a parse buffer.
84 */
85struct _GskParseLocation
86{
87 gsize bytes;
88 gsize chars;
89 gsize lines;
90 gsize line_bytes;
91 gsize line_chars;
92};
93
94/**
95 * GskParseErrorFunc:
96 * @start: start of the error location
97 * @end: end of the error location
98 * @error: the error
99 * @user_data: user data
100 *
101 * Type of callback that is called when an error occurs
102 * during node deserialization.
103 */
104typedef void (* GskParseErrorFunc) (const GskParseLocation *start,
105 const GskParseLocation *end,
106 const GError *error,
107 gpointer user_data);
108
109GDK_AVAILABLE_IN_ALL
110GType gsk_render_node_get_type (void) G_GNUC_CONST;
111
112GDK_AVAILABLE_IN_ALL
113GQuark gsk_serialization_error_quark (void);
114
115GDK_AVAILABLE_IN_ALL
116GskRenderNode * gsk_render_node_ref (GskRenderNode *node);
117GDK_AVAILABLE_IN_ALL
118void gsk_render_node_unref (GskRenderNode *node);
119
120GDK_AVAILABLE_IN_ALL
121GskRenderNodeType gsk_render_node_get_node_type (const GskRenderNode *node);
122
123GDK_AVAILABLE_IN_ALL
124void gsk_render_node_get_bounds (GskRenderNode *node,
125 graphene_rect_t *bounds);
126
127GDK_AVAILABLE_IN_ALL
128void gsk_render_node_draw (GskRenderNode *node,
129 cairo_t *cr);
130
131GDK_AVAILABLE_IN_ALL
132GBytes * gsk_render_node_serialize (GskRenderNode *node);
133GDK_AVAILABLE_IN_ALL
134gboolean gsk_render_node_write_to_file (GskRenderNode *node,
135 const char *filename,
136 GError **error);
137GDK_AVAILABLE_IN_ALL
138GskRenderNode * gsk_render_node_deserialize (GBytes *bytes,
139 GskParseErrorFunc error_func,
140 gpointer user_data);
141
142#define GSK_TYPE_DEBUG_NODE (gsk_debug_node_get_type())
143#define GSK_TYPE_COLOR_NODE (gsk_color_node_get_type())
144#define GSK_TYPE_TEXTURE_NODE (gsk_texture_node_get_type())
145#define GSK_TYPE_LINEAR_GRADIENT_NODE (gsk_linear_gradient_node_get_type())
146#define GSK_TYPE_REPEATING_LINEAR_GRADIENT_NODE (gsk_repeating_linear_gradient_node_get_type())
147#define GSK_TYPE_RADIAL_GRADIENT_NODE (gsk_radial_gradient_node_get_type())
148#define GSK_TYPE_REPEATING_RADIAL_GRADIENT_NODE (gsk_repeating_radial_gradient_node_get_type())
149#define GSK_TYPE_CONIC_GRADIENT_NODE (gsk_conic_gradient_node_get_type())
150#define GSK_TYPE_BORDER_NODE (gsk_border_node_get_type())
151#define GSK_TYPE_INSET_SHADOW_NODE (gsk_inset_shadow_node_get_type())
152#define GSK_TYPE_OUTSET_SHADOW_NODE (gsk_outset_shadow_node_get_type())
153#define GSK_TYPE_CAIRO_NODE (gsk_cairo_node_get_type())
154#define GSK_TYPE_CONTAINER_NODE (gsk_container_node_get_type())
155#define GSK_TYPE_TRANSFORM_NODE (gsk_transform_node_get_type())
156#define GSK_TYPE_OPACITY_NODE (gsk_opacity_node_get_type())
157#define GSK_TYPE_COLOR_MATRIX_NODE (gsk_color_matrix_node_get_type())
158#define GSK_TYPE_REPEAT_NODE (gsk_repeat_node_get_type())
159#define GSK_TYPE_CLIP_NODE (gsk_clip_node_get_type())
160#define GSK_TYPE_ROUNDED_CLIP_NODE (gsk_rounded_clip_node_get_type())
161#define GSK_TYPE_SHADOW_NODE (gsk_shadow_node_get_type())
162#define GSK_TYPE_BLEND_NODE (gsk_blend_node_get_type())
163#define GSK_TYPE_CROSS_FADE_NODE (gsk_cross_fade_node_get_type())
164#define GSK_TYPE_TEXT_NODE (gsk_text_node_get_type())
165#define GSK_TYPE_BLUR_NODE (gsk_blur_node_get_type())
166#define GSK_TYPE_GL_SHADER_NODE (gsk_gl_shader_node_get_type())
167
168typedef struct _GskDebugNode GskDebugNode;
169typedef struct _GskColorNode GskColorNode;
170typedef struct _GskTextureNode GskTextureNode;
171typedef struct _GskLinearGradientNode GskLinearGradientNode;
172typedef struct _GskRepeatingLinearGradientNode GskRepeatingLinearGradientNode;
173typedef struct _GskRadialGradientNode GskRadialGradientNode;
174typedef struct _GskRepeatingRadialGradientNode GskRepeatingRadialGradientNode;
175typedef struct _GskConicGradientNode GskConicGradientNode;
176typedef struct _GskBorderNode GskBorderNode;
177typedef struct _GskInsetShadowNode GskInsetShadowNode;
178typedef struct _GskOutsetShadowNode GskOutsetShadowNode;
179typedef struct _GskCairoNode GskCairoNode;
180typedef struct _GskContainerNode GskContainerNode;
181typedef struct _GskTransformNode GskTransformNode;
182typedef struct _GskOpacityNode GskOpacityNode;
183typedef struct _GskColorMatrixNode GskColorMatrixNode;
184typedef struct _GskRepeatNode GskRepeatNode;
185typedef struct _GskClipNode GskClipNode;
186typedef struct _GskRoundedClipNode GskRoundedClipNode;
187typedef struct _GskShadowNode GskShadowNode;
188typedef struct _GskBlendNode GskBlendNode;
189typedef struct _GskCrossFadeNode GskCrossFadeNode;
190typedef struct _GskTextNode GskTextNode;
191typedef struct _GskBlurNode GskBlurNode;
192typedef struct _GskGLShaderNode GskGLShaderNode;
193
194GDK_AVAILABLE_IN_ALL
195GType gsk_debug_node_get_type (void) G_GNUC_CONST;
196GDK_AVAILABLE_IN_ALL
197GskRenderNode * gsk_debug_node_new (GskRenderNode *child,
198 char *message);
199GDK_AVAILABLE_IN_ALL
200GskRenderNode * gsk_debug_node_get_child (const GskRenderNode *node) G_GNUC_PURE;
201GDK_AVAILABLE_IN_ALL
202const char * gsk_debug_node_get_message (const GskRenderNode *node) G_GNUC_PURE;
203
204GDK_AVAILABLE_IN_ALL
205GType gsk_color_node_get_type (void) G_GNUC_CONST;
206GDK_AVAILABLE_IN_ALL
207GskRenderNode * gsk_color_node_new (const GdkRGBA *rgba,
208 const graphene_rect_t *bounds);
209GDK_AVAILABLE_IN_ALL
210const GdkRGBA * gsk_color_node_get_color (const GskRenderNode *node) G_GNUC_PURE;
211
212GDK_AVAILABLE_IN_ALL
213GType gsk_texture_node_get_type (void) G_GNUC_CONST;
214GDK_AVAILABLE_IN_ALL
215GskRenderNode * gsk_texture_node_new (GdkTexture *texture,
216 const graphene_rect_t *bounds);
217GDK_AVAILABLE_IN_ALL
218GdkTexture * gsk_texture_node_get_texture (const GskRenderNode *node) G_GNUC_PURE;
219
220GDK_AVAILABLE_IN_ALL
221GType gsk_linear_gradient_node_get_type (void) G_GNUC_CONST;
222GDK_AVAILABLE_IN_ALL
223GskRenderNode * gsk_linear_gradient_node_new (const graphene_rect_t *bounds,
224 const graphene_point_t *start,
225 const graphene_point_t *end,
226 const GskColorStop *color_stops,
227 gsize n_color_stops);
228GDK_AVAILABLE_IN_ALL
229const graphene_point_t * gsk_linear_gradient_node_get_start (const GskRenderNode *node) G_GNUC_PURE;
230GDK_AVAILABLE_IN_ALL
231const graphene_point_t * gsk_linear_gradient_node_get_end (const GskRenderNode *node) G_GNUC_PURE;
232GDK_AVAILABLE_IN_ALL
233gsize gsk_linear_gradient_node_get_n_color_stops (const GskRenderNode *node) G_GNUC_PURE;
234GDK_AVAILABLE_IN_ALL
235const GskColorStop * gsk_linear_gradient_node_get_color_stops (const GskRenderNode *node,
236 gsize *n_stops) G_GNUC_PURE;
237
238GDK_AVAILABLE_IN_ALL
239GType gsk_repeating_linear_gradient_node_get_type (void) G_GNUC_CONST;
240GDK_AVAILABLE_IN_ALL
241GskRenderNode * gsk_repeating_linear_gradient_node_new (const graphene_rect_t *bounds,
242 const graphene_point_t *start,
243 const graphene_point_t *end,
244 const GskColorStop *color_stops,
245 gsize n_color_stops);
246
247GDK_AVAILABLE_IN_ALL
248GType gsk_conic_gradient_node_get_type (void) G_GNUC_CONST;
249GDK_AVAILABLE_IN_ALL
250GskRenderNode * gsk_conic_gradient_node_new (const graphene_rect_t *bounds,
251 const graphene_point_t *center,
252 float rotation,
253 const GskColorStop *color_stops,
254 gsize n_color_stops);
255GDK_AVAILABLE_IN_ALL
256const graphene_point_t * gsk_conic_gradient_node_get_center (const GskRenderNode *node) G_GNUC_PURE;
257GDK_AVAILABLE_IN_ALL
258float gsk_conic_gradient_node_get_rotation (const GskRenderNode *node) G_GNUC_PURE;
259GDK_AVAILABLE_IN_4_2
260float gsk_conic_gradient_node_get_angle (const GskRenderNode *node) G_GNUC_PURE;
261GDK_AVAILABLE_IN_ALL
262gsize gsk_conic_gradient_node_get_n_color_stops (const GskRenderNode *node) G_GNUC_PURE;
263GDK_AVAILABLE_IN_ALL
264const GskColorStop * gsk_conic_gradient_node_get_color_stops (const GskRenderNode *node,
265 gsize *n_stops) G_GNUC_PURE;
266
267GDK_AVAILABLE_IN_ALL
268GType gsk_radial_gradient_node_get_type (void) G_GNUC_CONST;
269GDK_AVAILABLE_IN_ALL
270GskRenderNode * gsk_radial_gradient_node_new (const graphene_rect_t *bounds,
271 const graphene_point_t *center,
272 float hradius,
273 float vradius,
274 float start,
275 float end,
276 const GskColorStop *color_stops,
277 gsize n_color_stops);
278GDK_AVAILABLE_IN_ALL
279gsize gsk_radial_gradient_node_get_n_color_stops (const GskRenderNode *node) G_GNUC_PURE;
280GDK_AVAILABLE_IN_ALL
281const GskColorStop * gsk_radial_gradient_node_get_color_stops (const GskRenderNode *node,
282 gsize *n_stops) G_GNUC_PURE;
283GDK_AVAILABLE_IN_ALL
284const graphene_point_t *gsk_radial_gradient_node_get_center (const GskRenderNode *node) G_GNUC_PURE;
285GDK_AVAILABLE_IN_ALL
286float gsk_radial_gradient_node_get_hradius (const GskRenderNode *node) G_GNUC_PURE;
287GDK_AVAILABLE_IN_ALL
288float gsk_radial_gradient_node_get_vradius (const GskRenderNode *node) G_GNUC_PURE;
289GDK_AVAILABLE_IN_ALL
290float gsk_radial_gradient_node_get_start (const GskRenderNode *node) G_GNUC_PURE;
291GDK_AVAILABLE_IN_ALL
292float gsk_radial_gradient_node_get_end (const GskRenderNode *node) G_GNUC_PURE;
293
294GDK_AVAILABLE_IN_ALL
295GType gsk_repeating_radial_gradient_node_get_type (void) G_GNUC_CONST;
296GDK_AVAILABLE_IN_ALL
297GskRenderNode * gsk_repeating_radial_gradient_node_new (const graphene_rect_t *bounds,
298 const graphene_point_t *center,
299 float hradius,
300 float vradius,
301 float start,
302 float end,
303 const GskColorStop *color_stops,
304 gsize n_color_stops);
305
306GDK_AVAILABLE_IN_ALL
307GType gsk_border_node_get_type (void) G_GNUC_CONST;
308GDK_AVAILABLE_IN_ALL
309GskRenderNode * gsk_border_node_new (const GskRoundedRect *outline,
310 const float border_width[4],
311 const GdkRGBA border_color[4]);
312GDK_AVAILABLE_IN_ALL
313const GskRoundedRect * gsk_border_node_get_outline (const GskRenderNode *node) G_GNUC_PURE;
314GDK_AVAILABLE_IN_ALL
315const float * gsk_border_node_get_widths (const GskRenderNode *node) G_GNUC_PURE;
316GDK_AVAILABLE_IN_ALL
317const GdkRGBA * gsk_border_node_get_colors (const GskRenderNode *node) G_GNUC_PURE;
318
319GDK_AVAILABLE_IN_ALL
320GType gsk_inset_shadow_node_get_type (void) G_GNUC_CONST;
321GDK_AVAILABLE_IN_ALL
322GskRenderNode * gsk_inset_shadow_node_new (const GskRoundedRect *outline,
323 const GdkRGBA *color,
324 float dx,
325 float dy,
326 float spread,
327 float blur_radius);
328GDK_AVAILABLE_IN_ALL
329const GskRoundedRect * gsk_inset_shadow_node_get_outline (const GskRenderNode *node) G_GNUC_PURE;
330GDK_AVAILABLE_IN_ALL
331const GdkRGBA * gsk_inset_shadow_node_get_color (const GskRenderNode *node) G_GNUC_PURE;
332GDK_AVAILABLE_IN_ALL
333float gsk_inset_shadow_node_get_dx (const GskRenderNode *node) G_GNUC_PURE;
334GDK_AVAILABLE_IN_ALL
335float gsk_inset_shadow_node_get_dy (const GskRenderNode *node) G_GNUC_PURE;
336GDK_AVAILABLE_IN_ALL
337float gsk_inset_shadow_node_get_spread (const GskRenderNode *node) G_GNUC_PURE;
338GDK_AVAILABLE_IN_ALL
339float gsk_inset_shadow_node_get_blur_radius (const GskRenderNode *node) G_GNUC_PURE;
340
341GDK_AVAILABLE_IN_ALL
342GType gsk_outset_shadow_node_get_type (void) G_GNUC_CONST;
343GDK_AVAILABLE_IN_ALL
344GskRenderNode * gsk_outset_shadow_node_new (const GskRoundedRect *outline,
345 const GdkRGBA *color,
346 float dx,
347 float dy,
348 float spread,
349 float blur_radius);
350GDK_AVAILABLE_IN_ALL
351const GskRoundedRect * gsk_outset_shadow_node_get_outline (const GskRenderNode *node) G_GNUC_PURE;
352GDK_AVAILABLE_IN_ALL
353const GdkRGBA * gsk_outset_shadow_node_get_color (const GskRenderNode *node) G_GNUC_PURE;
354GDK_AVAILABLE_IN_ALL
355float gsk_outset_shadow_node_get_dx (const GskRenderNode *node) G_GNUC_PURE;
356GDK_AVAILABLE_IN_ALL
357float gsk_outset_shadow_node_get_dy (const GskRenderNode *node) G_GNUC_PURE;
358GDK_AVAILABLE_IN_ALL
359float gsk_outset_shadow_node_get_spread (const GskRenderNode *node) G_GNUC_PURE;
360GDK_AVAILABLE_IN_ALL
361float gsk_outset_shadow_node_get_blur_radius (const GskRenderNode *node) G_GNUC_PURE;
362
363GDK_AVAILABLE_IN_ALL
364GType gsk_cairo_node_get_type (void) G_GNUC_CONST;
365GDK_AVAILABLE_IN_ALL
366GskRenderNode * gsk_cairo_node_new (const graphene_rect_t *bounds);
367GDK_AVAILABLE_IN_ALL
368cairo_t * gsk_cairo_node_get_draw_context (GskRenderNode *node);
369GDK_AVAILABLE_IN_ALL
370cairo_surface_t * gsk_cairo_node_get_surface (GskRenderNode *node);
371
372GDK_AVAILABLE_IN_ALL
373GType gsk_container_node_get_type (void) G_GNUC_CONST;
374GDK_AVAILABLE_IN_ALL
375GskRenderNode * gsk_container_node_new (GskRenderNode **children,
376 guint n_children);
377GDK_AVAILABLE_IN_ALL
378guint gsk_container_node_get_n_children (const GskRenderNode *node) G_GNUC_PURE;
379GDK_AVAILABLE_IN_ALL
380GskRenderNode * gsk_container_node_get_child (const GskRenderNode *node,
381 guint idx) G_GNUC_PURE;
382
383GDK_AVAILABLE_IN_ALL
384GType gsk_transform_node_get_type (void) G_GNUC_CONST;
385GDK_AVAILABLE_IN_ALL
386GskRenderNode * gsk_transform_node_new (GskRenderNode *child,
387 GskTransform *transform);
388GDK_AVAILABLE_IN_ALL
389GskRenderNode * gsk_transform_node_get_child (const GskRenderNode *node) G_GNUC_PURE;
390GDK_AVAILABLE_IN_ALL
391GskTransform * gsk_transform_node_get_transform (const GskRenderNode *node) G_GNUC_PURE;
392
393GDK_AVAILABLE_IN_ALL
394GType gsk_opacity_node_get_type (void) G_GNUC_CONST;
395GDK_AVAILABLE_IN_ALL
396GskRenderNode * gsk_opacity_node_new (GskRenderNode *child,
397 float opacity);
398GDK_AVAILABLE_IN_ALL
399GskRenderNode * gsk_opacity_node_get_child (const GskRenderNode *node) G_GNUC_PURE;
400GDK_AVAILABLE_IN_ALL
401float gsk_opacity_node_get_opacity (const GskRenderNode *node) G_GNUC_PURE;
402
403GDK_AVAILABLE_IN_ALL
404GType gsk_color_matrix_node_get_type (void) G_GNUC_CONST;
405GDK_AVAILABLE_IN_ALL
406GskRenderNode * gsk_color_matrix_node_new (GskRenderNode *child,
407 const graphene_matrix_t *color_matrix,
408 const graphene_vec4_t *color_offset);
409GDK_AVAILABLE_IN_ALL
410GskRenderNode * gsk_color_matrix_node_get_child (const GskRenderNode *node) G_GNUC_PURE;
411GDK_AVAILABLE_IN_ALL
412const graphene_matrix_t *
413 gsk_color_matrix_node_get_color_matrix (const GskRenderNode *node) G_GNUC_PURE;
414GDK_AVAILABLE_IN_ALL
415const graphene_vec4_t * gsk_color_matrix_node_get_color_offset (const GskRenderNode *node) G_GNUC_PURE;
416
417GDK_AVAILABLE_IN_ALL
418GType gsk_repeat_node_get_type (void) G_GNUC_CONST;
419GDK_AVAILABLE_IN_ALL
420GskRenderNode * gsk_repeat_node_new (const graphene_rect_t *bounds,
421 GskRenderNode *child,
422 const graphene_rect_t *child_bounds);
423GDK_AVAILABLE_IN_ALL
424GskRenderNode * gsk_repeat_node_get_child (const GskRenderNode *node) G_GNUC_PURE;
425GDK_AVAILABLE_IN_ALL
426const graphene_rect_t * gsk_repeat_node_get_child_bounds (const GskRenderNode *node) G_GNUC_PURE;
427
428GDK_AVAILABLE_IN_ALL
429GType gsk_clip_node_get_type (void) G_GNUC_CONST;
430GDK_AVAILABLE_IN_ALL
431GskRenderNode * gsk_clip_node_new (GskRenderNode *child,
432 const graphene_rect_t *clip);
433GDK_AVAILABLE_IN_ALL
434GskRenderNode * gsk_clip_node_get_child (const GskRenderNode *node) G_GNUC_PURE;
435GDK_AVAILABLE_IN_ALL
436const graphene_rect_t * gsk_clip_node_get_clip (const GskRenderNode *node) G_GNUC_PURE;
437
438GDK_AVAILABLE_IN_ALL
439GType gsk_rounded_clip_node_get_type (void) G_GNUC_CONST;
440GDK_AVAILABLE_IN_ALL
441GskRenderNode * gsk_rounded_clip_node_new (GskRenderNode *child,
442 const GskRoundedRect *clip);
443GDK_AVAILABLE_IN_ALL
444GskRenderNode * gsk_rounded_clip_node_get_child (const GskRenderNode *node) G_GNUC_PURE;
445GDK_AVAILABLE_IN_ALL
446const GskRoundedRect * gsk_rounded_clip_node_get_clip (const GskRenderNode *node) G_GNUC_PURE;
447
448GDK_AVAILABLE_IN_ALL
449GType gsk_shadow_node_get_type (void) G_GNUC_CONST;
450GDK_AVAILABLE_IN_ALL
451GskRenderNode * gsk_shadow_node_new (GskRenderNode *child,
452 const GskShadow *shadows,
453 gsize n_shadows);
454GDK_AVAILABLE_IN_ALL
455GskRenderNode * gsk_shadow_node_get_child (const GskRenderNode *node) G_GNUC_PURE;
456GDK_AVAILABLE_IN_ALL
457const GskShadow * gsk_shadow_node_get_shadow (const GskRenderNode *node,
458 gsize i) G_GNUC_PURE;
459GDK_AVAILABLE_IN_ALL
460gsize gsk_shadow_node_get_n_shadows (const GskRenderNode *node) G_GNUC_PURE;
461
462GDK_AVAILABLE_IN_ALL
463GType gsk_blend_node_get_type (void) G_GNUC_CONST;
464GDK_AVAILABLE_IN_ALL
465GskRenderNode * gsk_blend_node_new (GskRenderNode *bottom,
466 GskRenderNode *top,
467 GskBlendMode blend_mode);
468GDK_AVAILABLE_IN_ALL
469GskRenderNode * gsk_blend_node_get_bottom_child (const GskRenderNode *node) G_GNUC_PURE;
470GDK_AVAILABLE_IN_ALL
471GskRenderNode * gsk_blend_node_get_top_child (const GskRenderNode *node) G_GNUC_PURE;
472GDK_AVAILABLE_IN_ALL
473GskBlendMode gsk_blend_node_get_blend_mode (const GskRenderNode *node) G_GNUC_PURE;
474
475GDK_AVAILABLE_IN_ALL
476GType gsk_cross_fade_node_get_type (void) G_GNUC_CONST;
477GDK_AVAILABLE_IN_ALL
478GskRenderNode * gsk_cross_fade_node_new (GskRenderNode *start,
479 GskRenderNode *end,
480 float progress);
481GDK_AVAILABLE_IN_ALL
482GskRenderNode * gsk_cross_fade_node_get_start_child (const GskRenderNode *node) G_GNUC_PURE;
483GDK_AVAILABLE_IN_ALL
484GskRenderNode * gsk_cross_fade_node_get_end_child (const GskRenderNode *node) G_GNUC_PURE;
485GDK_AVAILABLE_IN_ALL
486float gsk_cross_fade_node_get_progress (const GskRenderNode *node) G_GNUC_PURE;
487
488GDK_AVAILABLE_IN_ALL
489GType gsk_text_node_get_type (void) G_GNUC_CONST;
490GDK_AVAILABLE_IN_ALL
491GskRenderNode * gsk_text_node_new (PangoFont *font,
492 PangoGlyphString *glyphs,
493 const GdkRGBA *color,
494 const graphene_point_t *offset);
495GDK_AVAILABLE_IN_ALL
496PangoFont * gsk_text_node_get_font (const GskRenderNode *node) G_GNUC_PURE;
497GDK_AVAILABLE_IN_4_2
498gboolean gsk_text_node_has_color_glyphs (const GskRenderNode *node) G_GNUC_PURE;
499GDK_AVAILABLE_IN_ALL
500guint gsk_text_node_get_num_glyphs (const GskRenderNode *node) G_GNUC_PURE;
501GDK_AVAILABLE_IN_ALL
502const PangoGlyphInfo *gsk_text_node_get_glyphs (const GskRenderNode *node,
503 guint *n_glyphs) G_GNUC_PURE;
504GDK_AVAILABLE_IN_ALL
505const GdkRGBA * gsk_text_node_get_color (const GskRenderNode *node) G_GNUC_PURE;
506GDK_AVAILABLE_IN_ALL
507const graphene_point_t *gsk_text_node_get_offset (const GskRenderNode *node) G_GNUC_PURE;
508
509GDK_AVAILABLE_IN_ALL
510GType gsk_blur_node_get_type (void) G_GNUC_CONST;
511GDK_AVAILABLE_IN_ALL
512GskRenderNode * gsk_blur_node_new (GskRenderNode *child,
513 float radius);
514GDK_AVAILABLE_IN_ALL
515GskRenderNode * gsk_blur_node_get_child (const GskRenderNode *node) G_GNUC_PURE;
516GDK_AVAILABLE_IN_ALL
517float gsk_blur_node_get_radius (const GskRenderNode *node) G_GNUC_PURE;
518
519GDK_AVAILABLE_IN_ALL
520GType gsk_gl_shader_node_get_type (void) G_GNUC_CONST;
521GDK_AVAILABLE_IN_ALL
522GskRenderNode * gsk_gl_shader_node_new (GskGLShader *shader,
523 const graphene_rect_t *bounds,
524 GBytes *args,
525 GskRenderNode **children,
526 guint n_children);
527GDK_AVAILABLE_IN_ALL
528guint gsk_gl_shader_node_get_n_children (const GskRenderNode *node) G_GNUC_PURE;
529GDK_AVAILABLE_IN_ALL
530GskRenderNode * gsk_gl_shader_node_get_child (const GskRenderNode *node,
531 guint idx) G_GNUC_PURE;
532GDK_AVAILABLE_IN_ALL
533GBytes * gsk_gl_shader_node_get_args (const GskRenderNode *node) G_GNUC_PURE;
534GDK_AVAILABLE_IN_ALL
535GskGLShader * gsk_gl_shader_node_get_shader (const GskRenderNode *node) G_GNUC_PURE;
536
537/**
538 * GSK_VALUE_HOLDS_RENDER_NODE:
539 * @value: a `GValue`
540 *
541 * Evaluates to %TRUE if @value was initialized with %GSK_TYPE_RENDER_NODE.
542 */
543#define GSK_VALUE_HOLDS_RENDER_NODE(value) (G_VALUE_HOLDS ((value), GSK_TYPE_RENDER_NODE))
544
545GDK_AVAILABLE_IN_4_4
546void gsk_value_set_render_node (GValue *value,
547 GskRenderNode *node);
548GDK_AVAILABLE_IN_4_4
549void gsk_value_take_render_node (GValue *value,
550 GskRenderNode *node);
551GDK_AVAILABLE_IN_4_4
552GskRenderNode * gsk_value_get_render_node (const GValue *value);
553GDK_AVAILABLE_IN_4_4
554GskRenderNode * gsk_value_dup_render_node (const GValue *value);
555
556
557G_END_DECLS
558
559#endif /* __GSK_RENDER_NODE_H__ */
560

source code of gtk/gsk/gskrendernode.h