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
|
|
|
|
2016-12-21 10:21:38 +00:00
|
|
|
graphene_rect_t bounds;
|
2016-03-17 13:48:19 +00:00
|
|
|
};
|
|
|
|
|
2016-12-11 02:57:42 +00:00
|
|
|
struct _GskRenderNodeClass
|
|
|
|
{
|
|
|
|
GskRenderNodeType node_type;
|
2016-12-11 03:28:21 +00:00
|
|
|
gsize struct_size;
|
2016-12-11 02:57:42 +00:00
|
|
|
const char *type_name;
|
2017-01-17 23:05:25 +00:00
|
|
|
|
2017-10-20 06:06:20 +00:00
|
|
|
void (* finalize) (GskRenderNode *node);
|
|
|
|
void (* draw) (GskRenderNode *node,
|
|
|
|
cairo_t *cr);
|
2018-03-20 00:37:05 +00:00
|
|
|
gboolean (* can_diff) (GskRenderNode *node1,
|
|
|
|
GskRenderNode *node2);
|
|
|
|
void (* diff) (GskRenderNode *node1,
|
|
|
|
GskRenderNode *node2,
|
|
|
|
cairo_region_t *region);
|
2017-10-20 06:06:20 +00:00
|
|
|
GVariant * (* serialize) (GskRenderNode *node);
|
|
|
|
GskRenderNode * (* deserialize) (GVariant *variant,
|
|
|
|
GError **error);
|
|
|
|
};
|
2016-08-24 13:07:26 +00:00
|
|
|
|
2017-10-20 06:06:20 +00:00
|
|
|
GskRenderNode * gsk_render_node_new (const GskRenderNodeClass *node_class,
|
|
|
|
gsize extra_size);
|
2016-12-17 06:44:10 +00:00
|
|
|
|
2018-03-20 00:37:05 +00:00
|
|
|
gboolean gsk_render_node_can_diff (GskRenderNode *node1,
|
|
|
|
GskRenderNode *node2);
|
|
|
|
void gsk_render_node_diff (GskRenderNode *node1,
|
|
|
|
GskRenderNode *node2,
|
|
|
|
cairo_region_t *region);
|
|
|
|
void gsk_render_node_diff_impossible (GskRenderNode *node1,
|
|
|
|
GskRenderNode *node2,
|
|
|
|
cairo_region_t *region);
|
|
|
|
|
2017-10-20 06:06:20 +00:00
|
|
|
GVariant * gsk_render_node_serialize_node (GskRenderNode *node);
|
|
|
|
GskRenderNode * gsk_render_node_deserialize_node (GskRenderNodeType type,
|
|
|
|
GVariant *variant,
|
|
|
|
GError **error);
|
2017-09-03 03:49:34 +00:00
|
|
|
|
2017-10-20 06:52:02 +00:00
|
|
|
GskRenderNode * gsk_cairo_node_new_for_surface (const graphene_rect_t *bounds,
|
|
|
|
cairo_surface_t *surface);
|
|
|
|
|
2018-04-21 09:20:15 +00:00
|
|
|
GskRenderNode * gsk_text_node_new_with_bounds (PangoFont *font,
|
|
|
|
PangoGlyphString *glyphs,
|
|
|
|
const GdkRGBA *color,
|
|
|
|
double x,
|
|
|
|
double y,
|
|
|
|
const graphene_rect_t *bounds);
|
|
|
|
|
|
|
|
|
2016-03-17 13:48:19 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GSK_RENDER_NODE_PRIVATE_H__ */
|