summaryrefslogtreecommitdiff
path: root/gsk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2017-01-18 00:05:25 +0100
committerBenjamin Otte <otte@redhat.com>2017-01-18 04:13:56 +0100
commit84c1204853b532494c4568d81d10b45142472565 (patch)
tree4e488432ea51041cbf4260c4cbbdf64eb017497f /gsk
parent2ae6f59e7a0fb3b4af79f39d8d29e49e009133c2 (diff)
downloadgtk+-84c1204853b532494c4568d81d10b45142472565.tar.gz
rendernode: Add getters for box-shadow nodes
Diffstat (limited to 'gsk')
-rw-r--r--gsk/gskrendernodeimpl.c120
-rw-r--r--gsk/gskrendernodeprivate.h14
2 files changed, 134 insertions, 0 deletions
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index aaa6a922bd..7827ece4b4 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -1303,6 +1303,66 @@ gsk_inset_shadow_node_new (const GskRoundedRect *outline,
return &self->render_node;
}
+const GskRoundedRect *
+gsk_inset_shadow_node_peek_outline (GskRenderNode *node)
+{
+ GskInsetShadowNode *self = (GskInsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_INSET_SHADOW_NODE), NULL);
+
+ return &self->outline;
+}
+
+const GdkRGBA *
+gsk_inset_shadow_node_peek_color (GskRenderNode *node)
+{
+ GskInsetShadowNode *self = (GskInsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_INSET_SHADOW_NODE), NULL);
+
+ return &self->color;
+}
+
+float
+gsk_inset_shadow_node_get_dx (GskRenderNode *node)
+{
+ GskInsetShadowNode *self = (GskInsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_INSET_SHADOW_NODE), 0.0f);
+
+ return self->dx;
+}
+
+float
+gsk_inset_shadow_node_get_dy (GskRenderNode *node)
+{
+ GskInsetShadowNode *self = (GskInsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_INSET_SHADOW_NODE), 0.0f);
+
+ return self->dy;
+}
+
+float
+gsk_inset_shadow_node_get_spread (GskRenderNode *node)
+{
+ GskInsetShadowNode *self = (GskInsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_INSET_SHADOW_NODE), 0.0f);
+
+ return self->spread;
+}
+
+float
+gsk_inset_shadow_node_get_blur_radius (GskRenderNode *node)
+{
+ GskInsetShadowNode *self = (GskInsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_INSET_SHADOW_NODE), 0.0f);
+
+ return self->blur_radius;
+}
+
/*** GSK_OUTSET_SHADOW_NODE ***/
typedef struct _GskOutsetShadowNode GskOutsetShadowNode;
@@ -1554,6 +1614,66 @@ gsk_outset_shadow_node_new (const GskRoundedRect *outline,
return &self->render_node;
}
+const GskRoundedRect *
+gsk_outset_shadow_node_peek_outline (GskRenderNode *node)
+{
+ GskOutsetShadowNode *self = (GskOutsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_OUTSET_SHADOW_NODE), NULL);
+
+ return &self->outline;
+}
+
+const GdkRGBA *
+gsk_outset_shadow_node_peek_color (GskRenderNode *node)
+{
+ GskOutsetShadowNode *self = (GskOutsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_OUTSET_SHADOW_NODE), NULL);
+
+ return &self->color;
+}
+
+float
+gsk_outset_shadow_node_get_dx (GskRenderNode *node)
+{
+ GskOutsetShadowNode *self = (GskOutsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_OUTSET_SHADOW_NODE), 0.0f);
+
+ return self->dx;
+}
+
+float
+gsk_outset_shadow_node_get_dy (GskRenderNode *node)
+{
+ GskOutsetShadowNode *self = (GskOutsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_OUTSET_SHADOW_NODE), 0.0f);
+
+ return self->dy;
+}
+
+float
+gsk_outset_shadow_node_get_spread (GskRenderNode *node)
+{
+ GskOutsetShadowNode *self = (GskOutsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_OUTSET_SHADOW_NODE), 0.0f);
+
+ return self->spread;
+}
+
+float
+gsk_outset_shadow_node_get_blur_radius (GskRenderNode *node)
+{
+ GskOutsetShadowNode *self = (GskOutsetShadowNode *) node;
+
+ g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_OUTSET_SHADOW_NODE), 0.0f);
+
+ return self->blur_radius;
+}
+
/*** GSK_CAIRO_NODE ***/
typedef struct _GskCairoNode GskCairoNode;
diff --git a/gsk/gskrendernodeprivate.h b/gsk/gskrendernodeprivate.h
index 52f7bc8b46..1a19b5d23b 100644
--- a/gsk/gskrendernodeprivate.h
+++ b/gsk/gskrendernodeprivate.h
@@ -62,6 +62,20 @@ const GskRoundedRect * gsk_border_node_peek_outline (GskRenderNode *node);
const float * gsk_border_node_peek_widths (GskRenderNode *node);
const GdkRGBA * gsk_border_node_peek_colors (GskRenderNode *node);
+const GskRoundedRect * gsk_inset_shadow_node_peek_outline (GskRenderNode *node);
+const GdkRGBA * gsk_inset_shadow_node_peek_color (GskRenderNode *node);
+float gsk_inset_shadow_node_get_dx (GskRenderNode *node);
+float gsk_inset_shadow_node_get_dy (GskRenderNode *node);
+float gsk_inset_shadow_node_get_spread (GskRenderNode *node);
+float gsk_inset_shadow_node_get_blur_radius (GskRenderNode *node);
+
+const GskRoundedRect * gsk_outset_shadow_node_peek_outline (GskRenderNode *node);
+const GdkRGBA * gsk_outset_shadow_node_peek_color (GskRenderNode *node);
+float gsk_outset_shadow_node_get_dx (GskRenderNode *node);
+float gsk_outset_shadow_node_get_dy (GskRenderNode *node);
+float gsk_outset_shadow_node_get_spread (GskRenderNode *node);
+float gsk_outset_shadow_node_get_blur_radius (GskRenderNode *node);
+
GskRenderNode *gsk_cairo_node_new_for_surface (const graphene_rect_t *bounds, cairo_surface_t *surface);
cairo_surface_t *gsk_cairo_node_get_surface (GskRenderNode *node);