borderimage: Use a GtkCssStyle instead of GtkStyleContext

This commit is contained in:
Benjamin Otte 2015-01-17 05:27:23 +01:00
parent dd2202288a
commit d0a12d477e
3 changed files with 9 additions and 9 deletions

View File

@ -29,7 +29,7 @@
#include "gtkcssimagevalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssrepeatvalueprivate.h"
#include "gtkstylepropertyprivate.h"
#include "gtkcssstyleprivate.h"
/* this is in case round() is not provided by the compiler,
* such as in the case of C89 compilers, like MSVC
@ -37,16 +37,16 @@
#include "fallback-c89.c"
gboolean
_gtk_border_image_init (GtkBorderImage *image,
GtkStyleContext *context)
_gtk_border_image_init (GtkBorderImage *image,
GtkCssStyle *style)
{
image->source = _gtk_css_image_value_get_image (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE));
image->source = _gtk_css_image_value_get_image (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE));
if (image->source == NULL)
return FALSE;
image->slice = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE);
image->width = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH);
image->repeat = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT);
image->slice = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE);
image->width = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH);
image->repeat = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT);
return TRUE;
}

View File

@ -39,7 +39,7 @@ struct _GtkBorderImage {
};
gboolean _gtk_border_image_init (GtkBorderImage *image,
GtkStyleContext *context);
GtkCssStyle *style);
void _gtk_border_image_render (GtkBorderImage *image,
const double border_width[4],

View File

@ -909,7 +909,7 @@ render_frame_internal (GtkStyleContext *context,
border_width[2] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
border_width[3] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
if (_gtk_border_image_init (&border_image, context))
if (_gtk_border_image_init (&border_image, gtk_style_context_lookup_style (context)))
{
_gtk_border_image_render (&border_image, border_width, cr, x, y, width, height);
}