From 5bbf59b519e66b6420ec47298f5cce49bc341a52 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 23 Mar 2012 23:23:30 +0100 Subject: [PATCH] cssvalue: Constify a bunch of APIs --- gtk/gtkcssshorthandpropertyimpl.c | 2 +- gtk/gtkcssstylepropertyimpl.c | 4 +-- gtk/gtkcssvalue.c | 12 ++++---- gtk/gtkcssvalueprivate.h | 50 +++++++++++++++---------------- gtk/gtkthemingbackground.c | 4 +-- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c index 9684dc4e1b..05a027c53e 100644 --- a/gtk/gtkcssshorthandpropertyimpl.c +++ b/gtk/gtkcssshorthandpropertyimpl.c @@ -664,7 +664,7 @@ pack_border_radius (GtkCssShorthandProperty *shorthand, GtkStyleQueryFunc query_func, gpointer query_data) { - GtkCssBorderCornerRadius *top_left; + const GtkCssBorderCornerRadius *top_left; GtkCssStyleProperty *prop; GtkCssValue *v; int value = 0; diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c index f69e9174ba..3edcb94669 100644 --- a/gtk/gtkcssstylepropertyimpl.c +++ b/gtk/gtkcssstylepropertyimpl.c @@ -675,7 +675,7 @@ background_size_compute (GtkCssStyleProperty *property, GtkStyleContext *context, GtkCssValue *specified) { - GtkCssBackgroundSize *ssize = _gtk_css_value_get_background_size (specified); + const GtkCssBackgroundSize *ssize = _gtk_css_value_get_background_size (specified); GtkCssBackgroundSize csize; gboolean changed; @@ -852,7 +852,7 @@ background_position_compute (GtkCssStyleProperty *property, GtkStyleContext *context, GtkCssValue *specified) { - GtkCssBackgroundPosition *spos = _gtk_css_value_get_background_position (specified); + const GtkCssBackgroundPosition *spos = _gtk_css_value_get_background_position (specified); GtkCssBackgroundPosition cpos; gboolean changed; diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c index ef1103bdba..ab56bfa986 100644 --- a/gtk/gtkcssvalue.c +++ b/gtk/gtkcssvalue.c @@ -493,7 +493,7 @@ _gtk_css_value_get_special_kind (GtkCssValue *value) return value->u.gint; } -GtkCssNumber * +const GtkCssNumber * _gtk_css_value_get_number (GtkCssValue *value) { g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_NUMBER), NULL); @@ -572,28 +572,28 @@ _gtk_css_value_get_border_style (GtkCssValue *value) return value->u.gint; } -GtkCssBackgroundSize * +const GtkCssBackgroundSize * _gtk_css_value_get_background_size (GtkCssValue *value) { g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_BACKGROUND_SIZE), NULL); return value->u.ptr; } -GtkCssBackgroundPosition * +const GtkCssBackgroundPosition * _gtk_css_value_get_background_position (GtkCssValue *value) { g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_BACKGROUND_POSITION), NULL); return value->u.ptr; } -GtkCssBorderImageRepeat * +const GtkCssBorderImageRepeat * _gtk_css_value_get_border_image_repeat (GtkCssValue *value) { g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_BORDER_IMAGE_REPEAT), NULL); return value->u.ptr; } -GtkCssBorderCornerRadius * +const GtkCssBorderCornerRadius * _gtk_css_value_get_border_corner_radius (GtkCssValue *value) { g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_BORDER_CORNER_RADIUS), NULL); @@ -628,7 +628,7 @@ _gtk_css_value_get_pango_weight (GtkCssValue *value) return value->u.gint; } -GdkRGBA * +const GdkRGBA * _gtk_css_value_get_rgba (GtkCssValue *value) { g_return_val_if_fail (_gtk_css_value_holds (value, GDK_TYPE_RGBA), NULL); diff --git a/gtk/gtkcssvalueprivate.h b/gtk/gtkcssvalueprivate.h index 49f7715757..d925b71e7f 100644 --- a/gtk/gtkcssvalueprivate.h +++ b/gtk/gtkcssvalueprivate.h @@ -64,31 +64,31 @@ GtkCssValue *_gtk_css_value_new_from_background_position (const GtkCssBackground void _gtk_css_value_init_gvalue (GtkCssValue *value, GValue *g_value); -gboolean _gtk_css_value_is_special (GtkCssValue *value); -GtkCssSpecialValue _gtk_css_value_get_special_kind (GtkCssValue *value); -int _gtk_css_value_get_int (GtkCssValue *value); -double _gtk_css_value_get_double (GtkCssValue *value); -const char * _gtk_css_value_get_string (GtkCssValue *value); -gpointer _gtk_css_value_dup_object (GtkCssValue *value); -gpointer _gtk_css_value_get_object (GtkCssValue *value); -gpointer _gtk_css_value_get_boxed (GtkCssValue *value); -const char ** _gtk_css_value_get_strv (GtkCssValue *value); -GtkCssNumber *_gtk_css_value_get_number (GtkCssValue *value); -GtkSymbolicColor *_gtk_css_value_get_symbolic_color (GtkCssValue *value); -GtkCssImage *_gtk_css_value_get_image (GtkCssValue *value); -GtkBorderStyle _gtk_css_value_get_border_style (GtkCssValue *value); -GtkCssBackgroundSize *_gtk_css_value_get_background_size (GtkCssValue *value); -GtkCssBackgroundPosition *_gtk_css_value_get_background_position (GtkCssValue *value); -GtkCssBorderCornerRadius *_gtk_css_value_get_border_corner_radius (GtkCssValue *value); -GtkCssBorderImageRepeat *_gtk_css_value_get_border_image_repeat (GtkCssValue *value); -PangoFontDescription * _gtk_css_value_get_font_description (GtkCssValue *value); -PangoStyle _gtk_css_value_get_pango_style (GtkCssValue *value); -PangoVariant _gtk_css_value_get_pango_variant (GtkCssValue *value); -PangoWeight _gtk_css_value_get_pango_weight (GtkCssValue *value); -GdkRGBA *_gtk_css_value_get_rgba (GtkCssValue *value); -cairo_pattern_t *_gtk_css_value_get_pattern (GtkCssValue *value); -GtkGradient *_gtk_css_value_get_gradient (GtkCssValue *value); -GtkShadow *_gtk_css_value_get_shadow (GtkCssValue *value); +gboolean _gtk_css_value_is_special (GtkCssValue *value); +GtkCssSpecialValue _gtk_css_value_get_special_kind (GtkCssValue *value); +int _gtk_css_value_get_int (GtkCssValue *value); +double _gtk_css_value_get_double (GtkCssValue *value); +const char * _gtk_css_value_get_string (GtkCssValue *value); +gpointer _gtk_css_value_dup_object (GtkCssValue *value); +gpointer _gtk_css_value_get_object (GtkCssValue *value); +gpointer _gtk_css_value_get_boxed (GtkCssValue *value); +const char ** _gtk_css_value_get_strv (GtkCssValue *value); +const GtkCssNumber *_gtk_css_value_get_number (GtkCssValue *value); +GtkSymbolicColor *_gtk_css_value_get_symbolic_color (GtkCssValue *value); +GtkCssImage *_gtk_css_value_get_image (GtkCssValue *value); +GtkBorderStyle _gtk_css_value_get_border_style (GtkCssValue *value); +const GtkCssBackgroundSize *_gtk_css_value_get_background_size (GtkCssValue *value); +const GtkCssBackgroundPosition *_gtk_css_value_get_background_position (GtkCssValue *value); +const GtkCssBorderCornerRadius *_gtk_css_value_get_border_corner_radius (GtkCssValue *value); +const GtkCssBorderImageRepeat *_gtk_css_value_get_border_image_repeat (GtkCssValue *value); +PangoFontDescription * _gtk_css_value_get_font_description (GtkCssValue *value); +PangoStyle _gtk_css_value_get_pango_style (GtkCssValue *value); +PangoVariant _gtk_css_value_get_pango_variant (GtkCssValue *value); +PangoWeight _gtk_css_value_get_pango_weight (GtkCssValue *value); +const GdkRGBA *_gtk_css_value_get_rgba (GtkCssValue *value); +cairo_pattern_t *_gtk_css_value_get_pattern (GtkCssValue *value); +GtkGradient *_gtk_css_value_get_gradient (GtkCssValue *value); +GtkShadow *_gtk_css_value_get_shadow (GtkCssValue *value); G_END_DECLS diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c index 89d0acc652..fee8606525 100644 --- a/gtk/gtkthemingbackground.c +++ b/gtk/gtkthemingbackground.c @@ -161,8 +161,8 @@ _gtk_theming_background_paint (GtkThemingBackground *bg, && bg->image_rect.height > 0) { GtkCssBackgroundRepeat hrepeat, vrepeat; - GtkCssBackgroundSize *size; - GtkCssBackgroundPosition *pos; + const GtkCssBackgroundSize *size; + const GtkCssBackgroundPosition *pos; double image_width, image_height; double width, height;