[gtk+] borderimage: Use a GtkCssStyle instead of GtkStyleContext
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] borderimage: Use a GtkCssStyle instead of GtkStyleContext
- Date: Tue, 20 Jan 2015 05:33:14 +0000 (UTC)
commit d0a12d477e965958c3943a565485ad25789136e4
Author: Benjamin Otte <otte redhat com>
Date: Sat Jan 17 05:27:23 2015 +0100
borderimage: Use a GtkCssStyle instead of GtkStyleContext
gtk/gtkborderimage.c | 14 +++++++-------
gtk/gtkborderimageprivate.h | 2 +-
gtk/gtkrender.c | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkborderimage.c b/gtk/gtkborderimage.c
index 21e2c35..58a43f8 100644
--- a/gtk/gtkborderimage.c
+++ b/gtk/gtkborderimage.c
@@ -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;
}
diff --git a/gtk/gtkborderimageprivate.h b/gtk/gtkborderimageprivate.h
index c82fe82..90a8326 100644
--- a/gtk/gtkborderimageprivate.h
+++ b/gtk/gtkborderimageprivate.h
@@ -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],
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c
index b702a07..db81b0e 100644
--- a/gtk/gtkrender.c
+++ b/gtk/gtkrender.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]