2016-03-17 13:48:19 +00:00
|
|
|
#ifndef __GSK_RENDER_NODE_PRIVATE_H__
|
|
|
|
#define __GSK_RENDER_NODE_PRIVATE_H__
|
|
|
|
|
|
|
|
#include "gskrendernode.h"
|
|
|
|
#include <cairo.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2016-12-11 02:57:42 +00:00
|
|
|
typedef struct _GskRenderNodeClass GskRenderNodeClass;
|
|
|
|
|
|
|
|
#define GSK_IS_RENDER_NODE_TYPE(node,type) (GSK_IS_RENDER_NODE (node) && (node)->node_class->node_type == (type))
|
|
|
|
|
2016-03-17 13:48:19 +00:00
|
|
|
struct _GskRenderNode
|
|
|
|
{
|
2016-12-11 02:57:42 +00:00
|
|
|
const GskRenderNodeClass *node_class;
|
2016-12-10 20:42:01 +00:00
|
|
|
|
2016-06-29 18:05:33 +00:00
|
|
|
volatile int ref_count;
|
2016-03-17 13:48:19 +00:00
|
|
|
|
|
|
|
/* The graph */
|
|
|
|
GskRenderNode *parent;
|
|
|
|
GskRenderNode *first_child;
|
|
|
|
GskRenderNode *last_child;
|
|
|
|
GskRenderNode *prev_sibling;
|
|
|
|
GskRenderNode *next_sibling;
|
|
|
|
|
|
|
|
int n_children;
|
|
|
|
|
|
|
|
/* Use for debugging */
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
/* Tag updated when adding/removing children */
|
|
|
|
gint64 age;
|
|
|
|
|
2016-08-12 15:44:29 +00:00
|
|
|
/* The contents of the node as a Cairo surface */
|
2016-03-17 13:48:19 +00:00
|
|
|
cairo_surface_t *surface;
|
|
|
|
|
2016-11-07 16:59:38 +00:00
|
|
|
/* The contents of the node as a texture */
|
|
|
|
GskTexture *texture;
|
2016-08-12 15:44:29 +00:00
|
|
|
|
2016-03-17 13:48:19 +00:00
|
|
|
/* Paint opacity */
|
|
|
|
double opacity;
|
|
|
|
|
2016-07-01 11:12:30 +00:00
|
|
|
/* Blend mode */
|
|
|
|
GskBlendMode blend_mode;
|
|
|
|
|
2016-08-13 07:34:22 +00:00
|
|
|
/* Scaling filters */
|
|
|
|
GskScalingFilter min_filter;
|
|
|
|
GskScalingFilter mag_filter;
|
|
|
|
|
2016-03-17 13:48:19 +00:00
|
|
|
/* Clip rectangle */
|
|
|
|
graphene_rect_t bounds;
|
|
|
|
|
|
|
|
/* Transformations relative to the root of the scene */
|
|
|
|
graphene_matrix_t world_matrix;
|
|
|
|
|
|
|
|
/* Transformations applied to the node */
|
|
|
|
graphene_matrix_t transform;
|
|
|
|
|
|
|
|
/* Bit fields; leave at the end */
|
2016-06-22 16:30:36 +00:00
|
|
|
gboolean is_mutable : 1;
|
2016-03-17 13:48:19 +00:00
|
|
|
gboolean opaque : 1;
|
|
|
|
gboolean transform_set : 1;
|
|
|
|
gboolean needs_world_matrix_update : 1;
|
|
|
|
};
|
|
|
|
|
2016-12-11 02:57:42 +00:00
|
|
|
struct _GskRenderNodeClass
|
|
|
|
{
|
|
|
|
GskRenderNodeType node_type;
|
|
|
|
const char *type_name;
|
2016-12-11 03:18:25 +00:00
|
|
|
void (* finalize) (GskRenderNode *node);
|
2016-12-11 02:57:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GskRenderNode *gsk_render_node_new (const GskRenderNodeClass *node_class);
|
2016-07-27 15:23:44 +00:00
|
|
|
|
2016-06-22 16:30:36 +00:00
|
|
|
void gsk_render_node_make_immutable (GskRenderNode *node);
|
|
|
|
|
2016-03-17 13:48:19 +00:00
|
|
|
void gsk_render_node_get_bounds (GskRenderNode *node,
|
|
|
|
graphene_rect_t *frame);
|
|
|
|
void gsk_render_node_get_transform (GskRenderNode *node,
|
|
|
|
graphene_matrix_t *mv);
|
|
|
|
double gsk_render_node_get_opacity (GskRenderNode *node);
|
|
|
|
|
2016-12-11 00:23:02 +00:00
|
|
|
cairo_surface_t *gsk_cairo_node_get_surface (GskRenderNode *node);
|
2016-03-17 13:48:19 +00:00
|
|
|
|
2016-12-10 21:52:22 +00:00
|
|
|
GskTexture *gsk_texture_node_get_texture (GskRenderNode *node);
|
2016-08-12 15:44:29 +00:00
|
|
|
|
2016-08-24 13:07:26 +00:00
|
|
|
GskBlendMode gsk_render_node_get_blend_mode (GskRenderNode *node);
|
|
|
|
|
2016-03-17 13:48:19 +00:00
|
|
|
GskRenderNode *gsk_render_node_get_toplevel (GskRenderNode *node);
|
|
|
|
|
|
|
|
void gsk_render_node_update_world_matrix (GskRenderNode *node,
|
|
|
|
gboolean force);
|
|
|
|
|
|
|
|
void gsk_render_node_get_world_matrix (GskRenderNode *node,
|
|
|
|
graphene_matrix_t *mv);
|
|
|
|
|
2016-06-30 16:06:31 +00:00
|
|
|
int gsk_render_node_get_size (GskRenderNode *root);
|
|
|
|
|
2016-03-17 13:48:19 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GSK_RENDER_NODE_PRIVATE_H__ */
|