rendernode: Add getters for box-shadow nodes

This commit is contained in:
Benjamin Otte 2017-01-18 00:05:25 +01:00
parent 2ae6f59e7a
commit 84c1204853
2 changed files with 134 additions and 0 deletions

View File

@ -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;

View File

@ -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);