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
|
|
|
|
|
|
|
/* Use for debugging */
|
|
|
|
char *name;
|
|
|
|
|
2016-08-13 07:34:22 +00:00
|
|
|
/* Scaling filters */
|
|
|
|
GskScalingFilter min_filter;
|
|
|
|
GskScalingFilter mag_filter;
|
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);
|
|
|
|
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
|
|
|
|
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);
|
|
|
|
|
2016-03-17 13:48:19 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GSK_RENDER_NODE_PRIVATE_H__ */
|