[gtk+/wip/cssvalue: 35/137] cssvalue: Constify a bunch of APIs



commit 3cc40d30e71c6589a174dd5a0f6394d07d50706c
Author: Benjamin Otte <otte redhat com>
Date:   Fri Mar 23 23:23:30 2012 +0100

    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 9684dc4..05a027c 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 7dd1cf4..efaf308 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -665,7 +665,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;
 
@@ -842,7 +842,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 18d6f91..a3854f2 100644
--- a/gtk/gtkcssvalue.c
+++ b/gtk/gtkcssvalue.c
@@ -459,7 +459,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);
@@ -538,28 +538,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);
@@ -594,7 +594,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 49f7715..d925b71 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 89d0acc..fee8606 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;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]