cssvalue: Constify a bunch of APIs

This commit is contained in:
Benjamin Otte 2012-03-23 23:23:30 +01:00
parent 4a12717e4d
commit 5bbf59b519
5 changed files with 36 additions and 36 deletions

View File

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

View File

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

View File

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

View File

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

View File

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