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 
31 G_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 
39 typedef struct _GskRenderNode           GskRenderNode;
40 typedef struct _GskColorStop            GskColorStop;
41 typedef 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  */
50 struct _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  */
65 struct _GskShadow
66 {
67   GdkRGBA color;
68   float dx;
69   float dy;
70   float radius;
71 };
72 
73 typedef 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  */
85 struct _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  */
104 typedef void           (* GskParseErrorFunc)                    (const GskParseLocation *start,
105                                                                  const GskParseLocation *end,
106                                                                  const GError           *error,
107                                                                  gpointer                user_data);
108 
109 GDK_AVAILABLE_IN_ALL
110 GType                   gsk_render_node_get_type                (void) G_GNUC_CONST;
111 
112 GDK_AVAILABLE_IN_ALL
113 GQuark                  gsk_serialization_error_quark           (void);
114 
115 GDK_AVAILABLE_IN_ALL
116 GskRenderNode *         gsk_render_node_ref                     (GskRenderNode *node);
117 GDK_AVAILABLE_IN_ALL
118 void                    gsk_render_node_unref                   (GskRenderNode *node);
119 
120 GDK_AVAILABLE_IN_ALL
121 GskRenderNodeType       gsk_render_node_get_node_type           (const GskRenderNode *node);
122 
123 GDK_AVAILABLE_IN_ALL
124 void                    gsk_render_node_get_bounds              (GskRenderNode   *node,
125                                                                  graphene_rect_t *bounds);
126 
127 GDK_AVAILABLE_IN_ALL
128 void                    gsk_render_node_draw                    (GskRenderNode *node,
129                                                                  cairo_t       *cr);
130 
131 GDK_AVAILABLE_IN_ALL
132 GBytes *                gsk_render_node_serialize               (GskRenderNode *node);
133 GDK_AVAILABLE_IN_ALL
134 gboolean                gsk_render_node_write_to_file           (GskRenderNode *node,
135                                                                  const char    *filename,
136                                                                  GError       **error);
137 GDK_AVAILABLE_IN_ALL
138 GskRenderNode *         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 
168 typedef struct _GskDebugNode                    GskDebugNode;
169 typedef struct _GskColorNode                    GskColorNode;
170 typedef struct _GskTextureNode                  GskTextureNode;
171 typedef struct _GskLinearGradientNode           GskLinearGradientNode;
172 typedef struct _GskRepeatingLinearGradientNode  GskRepeatingLinearGradientNode;
173 typedef struct _GskRadialGradientNode           GskRadialGradientNode;
174 typedef struct _GskRepeatingRadialGradientNode  GskRepeatingRadialGradientNode;
175 typedef struct _GskConicGradientNode            GskConicGradientNode;
176 typedef struct _GskBorderNode                   GskBorderNode;
177 typedef struct _GskInsetShadowNode              GskInsetShadowNode;
178 typedef struct _GskOutsetShadowNode             GskOutsetShadowNode;
179 typedef struct _GskCairoNode                    GskCairoNode;
180 typedef struct _GskContainerNode                GskContainerNode;
181 typedef struct _GskTransformNode                GskTransformNode;
182 typedef struct _GskOpacityNode                  GskOpacityNode;
183 typedef struct _GskColorMatrixNode              GskColorMatrixNode;
184 typedef struct _GskRepeatNode                   GskRepeatNode;
185 typedef struct _GskClipNode                     GskClipNode;
186 typedef struct _GskRoundedClipNode              GskRoundedClipNode;
187 typedef struct _GskShadowNode                   GskShadowNode;
188 typedef struct _GskBlendNode                    GskBlendNode;
189 typedef struct _GskCrossFadeNode                GskCrossFadeNode;
190 typedef struct _GskTextNode                     GskTextNode;
191 typedef struct _GskBlurNode                     GskBlurNode;
192 typedef struct _GskGLShaderNode                 GskGLShaderNode;
193 
194 GDK_AVAILABLE_IN_ALL
195 GType                   gsk_debug_node_get_type                 (void) G_GNUC_CONST;
196 GDK_AVAILABLE_IN_ALL
197 GskRenderNode *         gsk_debug_node_new                      (GskRenderNode            *child,
198                                                                  char                     *message);
199 GDK_AVAILABLE_IN_ALL
200 GskRenderNode *         gsk_debug_node_get_child                (const GskRenderNode      *node) G_GNUC_PURE;
201 GDK_AVAILABLE_IN_ALL
202 const char *            gsk_debug_node_get_message              (const GskRenderNode      *node) G_GNUC_PURE;
203 
204 GDK_AVAILABLE_IN_ALL
205 GType                   gsk_color_node_get_type                 (void) G_GNUC_CONST;
206 GDK_AVAILABLE_IN_ALL
207 GskRenderNode *         gsk_color_node_new                      (const GdkRGBA            *rgba,
208                                                                  const graphene_rect_t    *bounds);
209 GDK_AVAILABLE_IN_ALL
210 const GdkRGBA *         gsk_color_node_get_color                (const GskRenderNode      *node) G_GNUC_PURE;
211 
212 GDK_AVAILABLE_IN_ALL
213 GType                   gsk_texture_node_get_type               (void) G_GNUC_CONST;
214 GDK_AVAILABLE_IN_ALL
215 GskRenderNode *         gsk_texture_node_new                    (GdkTexture               *texture,
216                                                                  const graphene_rect_t    *bounds);
217 GDK_AVAILABLE_IN_ALL
218 GdkTexture *            gsk_texture_node_get_texture            (const GskRenderNode      *node) G_GNUC_PURE;
219 
220 GDK_AVAILABLE_IN_ALL
221 GType                   gsk_linear_gradient_node_get_type           (void) G_GNUC_CONST;
222 GDK_AVAILABLE_IN_ALL
223 GskRenderNode *         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);
228 GDK_AVAILABLE_IN_ALL
229 const graphene_point_t * gsk_linear_gradient_node_get_start         (const GskRenderNode      *node) G_GNUC_PURE;
230 GDK_AVAILABLE_IN_ALL
231 const graphene_point_t * gsk_linear_gradient_node_get_end           (const GskRenderNode      *node) G_GNUC_PURE;
232 GDK_AVAILABLE_IN_ALL
233 gsize                    gsk_linear_gradient_node_get_n_color_stops (const GskRenderNode      *node) G_GNUC_PURE;
234 GDK_AVAILABLE_IN_ALL
235 const GskColorStop *     gsk_linear_gradient_node_get_color_stops   (const GskRenderNode      *node,
236                                                                      gsize                    *n_stops) G_GNUC_PURE;
237 
238 GDK_AVAILABLE_IN_ALL
239 GType                   gsk_repeating_linear_gradient_node_get_type (void) G_GNUC_CONST;
240 GDK_AVAILABLE_IN_ALL
241 GskRenderNode *         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 
247 GDK_AVAILABLE_IN_ALL
248 GType                   gsk_conic_gradient_node_get_type            (void) G_GNUC_CONST;
249 GDK_AVAILABLE_IN_ALL
250 GskRenderNode *         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);
255 GDK_AVAILABLE_IN_ALL
256 const graphene_point_t * gsk_conic_gradient_node_get_center         (const GskRenderNode      *node) G_GNUC_PURE;
257 GDK_AVAILABLE_IN_ALL
258 float                    gsk_conic_gradient_node_get_rotation       (const GskRenderNode      *node) G_GNUC_PURE;
259 GDK_AVAILABLE_IN_4_2
260 float                    gsk_conic_gradient_node_get_angle          (const GskRenderNode      *node) G_GNUC_PURE;
261 GDK_AVAILABLE_IN_ALL
262 gsize                    gsk_conic_gradient_node_get_n_color_stops  (const GskRenderNode      *node) G_GNUC_PURE;
263 GDK_AVAILABLE_IN_ALL
264 const GskColorStop *     gsk_conic_gradient_node_get_color_stops    (const GskRenderNode      *node,
265                                                                      gsize                    *n_stops) G_GNUC_PURE;
266 
267 GDK_AVAILABLE_IN_ALL
268 GType                   gsk_radial_gradient_node_get_type (void) G_GNUC_CONST;
269 GDK_AVAILABLE_IN_ALL
270 GskRenderNode *         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);
278 GDK_AVAILABLE_IN_ALL
279 gsize                   gsk_radial_gradient_node_get_n_color_stops (const GskRenderNode *node) G_GNUC_PURE;
280 GDK_AVAILABLE_IN_ALL
281 const GskColorStop *    gsk_radial_gradient_node_get_color_stops   (const GskRenderNode *node,
282                                                                     gsize               *n_stops) G_GNUC_PURE;
283 GDK_AVAILABLE_IN_ALL
284 const graphene_point_t *gsk_radial_gradient_node_get_center        (const GskRenderNode *node) G_GNUC_PURE;
285 GDK_AVAILABLE_IN_ALL
286 float                   gsk_radial_gradient_node_get_hradius       (const GskRenderNode *node) G_GNUC_PURE;
287 GDK_AVAILABLE_IN_ALL
288 float                   gsk_radial_gradient_node_get_vradius       (const GskRenderNode *node) G_GNUC_PURE;
289 GDK_AVAILABLE_IN_ALL
290 float                   gsk_radial_gradient_node_get_start         (const GskRenderNode *node) G_GNUC_PURE;
291 GDK_AVAILABLE_IN_ALL
292 float                   gsk_radial_gradient_node_get_end           (const GskRenderNode *node) G_GNUC_PURE;
293 
294 GDK_AVAILABLE_IN_ALL
295 GType                   gsk_repeating_radial_gradient_node_get_type (void) G_GNUC_CONST;
296 GDK_AVAILABLE_IN_ALL
297 GskRenderNode *         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 
306 GDK_AVAILABLE_IN_ALL
307 GType                   gsk_border_node_get_type                (void) G_GNUC_CONST;
308 GDK_AVAILABLE_IN_ALL
309 GskRenderNode *         gsk_border_node_new                     (const GskRoundedRect     *outline,
310                                                                  const float               border_width[4],
311                                                                  const GdkRGBA             border_color[4]);
312 GDK_AVAILABLE_IN_ALL
313 const GskRoundedRect *  gsk_border_node_get_outline             (const GskRenderNode      *node) G_GNUC_PURE;
314 GDK_AVAILABLE_IN_ALL
315 const float *           gsk_border_node_get_widths              (const GskRenderNode      *node) G_GNUC_PURE;
316 GDK_AVAILABLE_IN_ALL
317 const GdkRGBA *         gsk_border_node_get_colors              (const GskRenderNode      *node) G_GNUC_PURE;
318 
319 GDK_AVAILABLE_IN_ALL
320 GType                   gsk_inset_shadow_node_get_type          (void) G_GNUC_CONST;
321 GDK_AVAILABLE_IN_ALL
322 GskRenderNode *         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);
328 GDK_AVAILABLE_IN_ALL
329 const GskRoundedRect *  gsk_inset_shadow_node_get_outline       (const GskRenderNode      *node) G_GNUC_PURE;
330 GDK_AVAILABLE_IN_ALL
331 const GdkRGBA *         gsk_inset_shadow_node_get_color         (const GskRenderNode      *node) G_GNUC_PURE;
332 GDK_AVAILABLE_IN_ALL
333 float                   gsk_inset_shadow_node_get_dx            (const GskRenderNode      *node) G_GNUC_PURE;
334 GDK_AVAILABLE_IN_ALL
335 float                   gsk_inset_shadow_node_get_dy            (const GskRenderNode      *node) G_GNUC_PURE;
336 GDK_AVAILABLE_IN_ALL
337 float                   gsk_inset_shadow_node_get_spread        (const GskRenderNode      *node) G_GNUC_PURE;
338 GDK_AVAILABLE_IN_ALL
339 float                   gsk_inset_shadow_node_get_blur_radius   (const GskRenderNode      *node) G_GNUC_PURE;
340 
341 GDK_AVAILABLE_IN_ALL
342 GType                   gsk_outset_shadow_node_get_type         (void) G_GNUC_CONST;
343 GDK_AVAILABLE_IN_ALL
344 GskRenderNode *         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);
350 GDK_AVAILABLE_IN_ALL
351 const GskRoundedRect *  gsk_outset_shadow_node_get_outline      (const GskRenderNode      *node) G_GNUC_PURE;
352 GDK_AVAILABLE_IN_ALL
353 const GdkRGBA *         gsk_outset_shadow_node_get_color        (const GskRenderNode      *node) G_GNUC_PURE;
354 GDK_AVAILABLE_IN_ALL
355 float                   gsk_outset_shadow_node_get_dx           (const GskRenderNode      *node) G_GNUC_PURE;
356 GDK_AVAILABLE_IN_ALL
357 float                   gsk_outset_shadow_node_get_dy           (const GskRenderNode      *node) G_GNUC_PURE;
358 GDK_AVAILABLE_IN_ALL
359 float                   gsk_outset_shadow_node_get_spread       (const GskRenderNode      *node) G_GNUC_PURE;
360 GDK_AVAILABLE_IN_ALL
361 float                   gsk_outset_shadow_node_get_blur_radius  (const GskRenderNode      *node) G_GNUC_PURE;
362 
363 GDK_AVAILABLE_IN_ALL
364 GType                   gsk_cairo_node_get_type                 (void) G_GNUC_CONST;
365 GDK_AVAILABLE_IN_ALL
366 GskRenderNode *         gsk_cairo_node_new                      (const graphene_rect_t    *bounds);
367 GDK_AVAILABLE_IN_ALL
368 cairo_t *               gsk_cairo_node_get_draw_context         (GskRenderNode            *node);
369 GDK_AVAILABLE_IN_ALL
370 cairo_surface_t *       gsk_cairo_node_get_surface              (GskRenderNode            *node);
371 
372 GDK_AVAILABLE_IN_ALL
373 GType                   gsk_container_node_get_type             (void) G_GNUC_CONST;
374 GDK_AVAILABLE_IN_ALL
375 GskRenderNode *         gsk_container_node_new                  (GskRenderNode           **children,
376                                                                  guint                     n_children);
377 GDK_AVAILABLE_IN_ALL
378 guint                   gsk_container_node_get_n_children       (const GskRenderNode      *node) G_GNUC_PURE;
379 GDK_AVAILABLE_IN_ALL
380 GskRenderNode *         gsk_container_node_get_child            (const GskRenderNode      *node,
381                                                                  guint                     idx) G_GNUC_PURE;
382 
383 GDK_AVAILABLE_IN_ALL
384 GType                   gsk_transform_node_get_type             (void) G_GNUC_CONST;
385 GDK_AVAILABLE_IN_ALL
386 GskRenderNode *         gsk_transform_node_new                  (GskRenderNode            *child,
387                                                                  GskTransform             *transform);
388 GDK_AVAILABLE_IN_ALL
389 GskRenderNode *         gsk_transform_node_get_child            (const GskRenderNode      *node) G_GNUC_PURE;
390 GDK_AVAILABLE_IN_ALL
391 GskTransform *          gsk_transform_node_get_transform        (const GskRenderNode      *node) G_GNUC_PURE;
392 
393 GDK_AVAILABLE_IN_ALL
394 GType                   gsk_opacity_node_get_type               (void) G_GNUC_CONST;
395 GDK_AVAILABLE_IN_ALL
396 GskRenderNode *         gsk_opacity_node_new                    (GskRenderNode            *child,
397                                                                  float                     opacity);
398 GDK_AVAILABLE_IN_ALL
399 GskRenderNode *         gsk_opacity_node_get_child              (const GskRenderNode      *node) G_GNUC_PURE;
400 GDK_AVAILABLE_IN_ALL
401 float                   gsk_opacity_node_get_opacity            (const GskRenderNode      *node) G_GNUC_PURE;
402 
403 GDK_AVAILABLE_IN_ALL
404 GType                   gsk_color_matrix_node_get_type          (void) G_GNUC_CONST;
405 GDK_AVAILABLE_IN_ALL
406 GskRenderNode *         gsk_color_matrix_node_new               (GskRenderNode            *child,
407                                                                  const graphene_matrix_t  *color_matrix,
408                                                                  const graphene_vec4_t    *color_offset);
409 GDK_AVAILABLE_IN_ALL
410 GskRenderNode *         gsk_color_matrix_node_get_child         (const GskRenderNode      *node) G_GNUC_PURE;
411 GDK_AVAILABLE_IN_ALL
412 const graphene_matrix_t *
413                         gsk_color_matrix_node_get_color_matrix  (const GskRenderNode      *node) G_GNUC_PURE;
414 GDK_AVAILABLE_IN_ALL
415 const graphene_vec4_t * gsk_color_matrix_node_get_color_offset  (const GskRenderNode      *node) G_GNUC_PURE;
416 
417 GDK_AVAILABLE_IN_ALL
418 GType                   gsk_repeat_node_get_type                (void) G_GNUC_CONST;
419 GDK_AVAILABLE_IN_ALL
420 GskRenderNode *         gsk_repeat_node_new                     (const graphene_rect_t    *bounds,
421                                                                  GskRenderNode            *child,
422                                                                  const graphene_rect_t    *child_bounds);
423 GDK_AVAILABLE_IN_ALL
424 GskRenderNode *         gsk_repeat_node_get_child               (const GskRenderNode      *node) G_GNUC_PURE;
425 GDK_AVAILABLE_IN_ALL
426 const graphene_rect_t * gsk_repeat_node_get_child_bounds        (const GskRenderNode      *node) G_GNUC_PURE;
427 
428 GDK_AVAILABLE_IN_ALL
429 GType                   gsk_clip_node_get_type                  (void) G_GNUC_CONST;
430 GDK_AVAILABLE_IN_ALL
431 GskRenderNode *         gsk_clip_node_new                       (GskRenderNode            *child,
432                                                                  const graphene_rect_t    *clip);
433 GDK_AVAILABLE_IN_ALL
434 GskRenderNode *         gsk_clip_node_get_child                 (const GskRenderNode      *node) G_GNUC_PURE;
435 GDK_AVAILABLE_IN_ALL
436 const graphene_rect_t * gsk_clip_node_get_clip                  (const GskRenderNode      *node) G_GNUC_PURE;
437 
438 GDK_AVAILABLE_IN_ALL
439 GType                   gsk_rounded_clip_node_get_type          (void) G_GNUC_CONST;
440 GDK_AVAILABLE_IN_ALL
441 GskRenderNode *         gsk_rounded_clip_node_new               (GskRenderNode            *child,
442                                                                  const GskRoundedRect     *clip);
443 GDK_AVAILABLE_IN_ALL
444 GskRenderNode *         gsk_rounded_clip_node_get_child         (const GskRenderNode      *node) G_GNUC_PURE;
445 GDK_AVAILABLE_IN_ALL
446 const GskRoundedRect *  gsk_rounded_clip_node_get_clip          (const GskRenderNode      *node) G_GNUC_PURE;
447 
448 GDK_AVAILABLE_IN_ALL
449 GType                   gsk_shadow_node_get_type                (void) G_GNUC_CONST;
450 GDK_AVAILABLE_IN_ALL
451 GskRenderNode *         gsk_shadow_node_new                     (GskRenderNode            *child,
452                                                                  const GskShadow          *shadows,
453                                                                  gsize                     n_shadows);
454 GDK_AVAILABLE_IN_ALL
455 GskRenderNode *         gsk_shadow_node_get_child               (const GskRenderNode      *node) G_GNUC_PURE;
456 GDK_AVAILABLE_IN_ALL
457 const GskShadow *       gsk_shadow_node_get_shadow              (const GskRenderNode      *node,
458                                                                  gsize                     i) G_GNUC_PURE;
459 GDK_AVAILABLE_IN_ALL
460 gsize                   gsk_shadow_node_get_n_shadows           (const GskRenderNode      *node) G_GNUC_PURE;
461 
462 GDK_AVAILABLE_IN_ALL
463 GType                   gsk_blend_node_get_type                 (void) G_GNUC_CONST;
464 GDK_AVAILABLE_IN_ALL
465 GskRenderNode *         gsk_blend_node_new                      (GskRenderNode            *bottom,
466                                                                  GskRenderNode            *top,
467                                                                  GskBlendMode              blend_mode);
468 GDK_AVAILABLE_IN_ALL
469 GskRenderNode *         gsk_blend_node_get_bottom_child         (const GskRenderNode      *node) G_GNUC_PURE;
470 GDK_AVAILABLE_IN_ALL
471 GskRenderNode *         gsk_blend_node_get_top_child            (const GskRenderNode      *node) G_GNUC_PURE;
472 GDK_AVAILABLE_IN_ALL
473 GskBlendMode            gsk_blend_node_get_blend_mode           (const GskRenderNode      *node) G_GNUC_PURE;
474 
475 GDK_AVAILABLE_IN_ALL
476 GType                   gsk_cross_fade_node_get_type            (void) G_GNUC_CONST;
477 GDK_AVAILABLE_IN_ALL
478 GskRenderNode *         gsk_cross_fade_node_new                 (GskRenderNode            *start,
479                                                                  GskRenderNode            *end,
480                                                                  float                     progress);
481 GDK_AVAILABLE_IN_ALL
482 GskRenderNode *         gsk_cross_fade_node_get_start_child     (const GskRenderNode      *node) G_GNUC_PURE;
483 GDK_AVAILABLE_IN_ALL
484 GskRenderNode *         gsk_cross_fade_node_get_end_child       (const GskRenderNode      *node) G_GNUC_PURE;
485 GDK_AVAILABLE_IN_ALL
486 float                   gsk_cross_fade_node_get_progress        (const GskRenderNode      *node) G_GNUC_PURE;
487 
488 GDK_AVAILABLE_IN_ALL
489 GType                   gsk_text_node_get_type                  (void) G_GNUC_CONST;
490 GDK_AVAILABLE_IN_ALL
491 GskRenderNode *         gsk_text_node_new                       (PangoFont                *font,
492                                                                  PangoGlyphString         *glyphs,
493                                                                  const GdkRGBA            *color,
494                                                                  const graphene_point_t   *offset);
495 GDK_AVAILABLE_IN_ALL
496 PangoFont *             gsk_text_node_get_font                  (const GskRenderNode      *node) G_GNUC_PURE;
497 GDK_AVAILABLE_IN_ALL
498 gboolean                gsk_text_node_has_color_glyphs          (const GskRenderNode      *node) G_GNUC_PURE;
499 GDK_AVAILABLE_IN_ALL
500 guint                   gsk_text_node_get_num_glyphs            (const GskRenderNode      *node) G_GNUC_PURE;
501 GDK_AVAILABLE_IN_ALL
502 const PangoGlyphInfo   *gsk_text_node_get_glyphs                (const GskRenderNode      *node,
503                                                                  guint                    *n_glyphs) G_GNUC_PURE;
504 GDK_AVAILABLE_IN_ALL
505 const GdkRGBA *         gsk_text_node_get_color                 (const GskRenderNode      *node) G_GNUC_PURE;
506 GDK_AVAILABLE_IN_ALL
507 const graphene_point_t *gsk_text_node_get_offset                (const GskRenderNode      *node) G_GNUC_PURE;
508 
509 GDK_AVAILABLE_IN_ALL
510 GType                   gsk_blur_node_get_type                  (void) G_GNUC_CONST;
511 GDK_AVAILABLE_IN_ALL
512 GskRenderNode *         gsk_blur_node_new                       (GskRenderNode            *child,
513                                                                  float                     radius);
514 GDK_AVAILABLE_IN_ALL
515 GskRenderNode *         gsk_blur_node_get_child                 (const GskRenderNode      *node) G_GNUC_PURE;
516 GDK_AVAILABLE_IN_ALL
517 float                   gsk_blur_node_get_radius                (const GskRenderNode      *node) G_GNUC_PURE;
518 
519 GDK_AVAILABLE_IN_ALL
520 GType                   gsk_gl_shader_node_get_type              (void) G_GNUC_CONST;
521 GDK_AVAILABLE_IN_ALL
522 GskRenderNode *         gsk_gl_shader_node_new                  (GskGLShader              *shader,
523                                                                  const graphene_rect_t    *bounds,
524                                                                  GBytes                   *args,
525                                                                  GskRenderNode           **children,
526                                                                  guint                     n_children);
527 GDK_AVAILABLE_IN_ALL
528 guint                   gsk_gl_shader_node_get_n_children       (const GskRenderNode      *node) G_GNUC_PURE;
529 GDK_AVAILABLE_IN_ALL
530 GskRenderNode *         gsk_gl_shader_node_get_child            (const GskRenderNode      *node,
531                                                                  guint                     idx) G_GNUC_PURE;
532 GDK_AVAILABLE_IN_ALL
533 GBytes *                gsk_gl_shader_node_get_args             (const GskRenderNode      *node) G_GNUC_PURE;
534 GDK_AVAILABLE_IN_ALL
535 GskGLShader *           gsk_gl_shader_node_get_shader           (const GskRenderNode      *node) G_GNUC_PURE;
536 
537 G_END_DECLS
538 
539 #endif /* __GSK_RENDER_NODE_H__ */
540