forked from AuroraMiddleware/gtk
cssvalue: Constify a bunch of APIs
This commit is contained in:
parent
4a12717e4d
commit
5bbf59b519
@ -664,7 +664,7 @@ pack_border_radius (GtkCssShorthandProperty *shorthand,
|
|||||||
GtkStyleQueryFunc query_func,
|
GtkStyleQueryFunc query_func,
|
||||||
gpointer query_data)
|
gpointer query_data)
|
||||||
{
|
{
|
||||||
GtkCssBorderCornerRadius *top_left;
|
const GtkCssBorderCornerRadius *top_left;
|
||||||
GtkCssStyleProperty *prop;
|
GtkCssStyleProperty *prop;
|
||||||
GtkCssValue *v;
|
GtkCssValue *v;
|
||||||
int value = 0;
|
int value = 0;
|
||||||
|
@ -675,7 +675,7 @@ background_size_compute (GtkCssStyleProperty *property,
|
|||||||
GtkStyleContext *context,
|
GtkStyleContext *context,
|
||||||
GtkCssValue *specified)
|
GtkCssValue *specified)
|
||||||
{
|
{
|
||||||
GtkCssBackgroundSize *ssize = _gtk_css_value_get_background_size (specified);
|
const GtkCssBackgroundSize *ssize = _gtk_css_value_get_background_size (specified);
|
||||||
GtkCssBackgroundSize csize;
|
GtkCssBackgroundSize csize;
|
||||||
gboolean changed;
|
gboolean changed;
|
||||||
|
|
||||||
@ -852,7 +852,7 @@ background_position_compute (GtkCssStyleProperty *property,
|
|||||||
GtkStyleContext *context,
|
GtkStyleContext *context,
|
||||||
GtkCssValue *specified)
|
GtkCssValue *specified)
|
||||||
{
|
{
|
||||||
GtkCssBackgroundPosition *spos = _gtk_css_value_get_background_position (specified);
|
const GtkCssBackgroundPosition *spos = _gtk_css_value_get_background_position (specified);
|
||||||
GtkCssBackgroundPosition cpos;
|
GtkCssBackgroundPosition cpos;
|
||||||
gboolean changed;
|
gboolean changed;
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ _gtk_css_value_get_special_kind (GtkCssValue *value)
|
|||||||
return value->u.gint;
|
return value->u.gint;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkCssNumber *
|
const GtkCssNumber *
|
||||||
_gtk_css_value_get_number (GtkCssValue *value)
|
_gtk_css_value_get_number (GtkCssValue *value)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_NUMBER), NULL);
|
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;
|
return value->u.gint;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkCssBackgroundSize *
|
const GtkCssBackgroundSize *
|
||||||
_gtk_css_value_get_background_size (GtkCssValue *value)
|
_gtk_css_value_get_background_size (GtkCssValue *value)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_BACKGROUND_SIZE), NULL);
|
g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_BACKGROUND_SIZE), NULL);
|
||||||
return value->u.ptr;
|
return value->u.ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkCssBackgroundPosition *
|
const GtkCssBackgroundPosition *
|
||||||
_gtk_css_value_get_background_position (GtkCssValue *value)
|
_gtk_css_value_get_background_position (GtkCssValue *value)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_BACKGROUND_POSITION), NULL);
|
g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_BACKGROUND_POSITION), NULL);
|
||||||
return value->u.ptr;
|
return value->u.ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkCssBorderImageRepeat *
|
const GtkCssBorderImageRepeat *
|
||||||
_gtk_css_value_get_border_image_repeat (GtkCssValue *value)
|
_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);
|
g_return_val_if_fail (_gtk_css_value_holds (value, GTK_TYPE_CSS_BORDER_IMAGE_REPEAT), NULL);
|
||||||
return value->u.ptr;
|
return value->u.ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkCssBorderCornerRadius *
|
const GtkCssBorderCornerRadius *
|
||||||
_gtk_css_value_get_border_corner_radius (GtkCssValue *value)
|
_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);
|
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;
|
return value->u.gint;
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkRGBA *
|
const GdkRGBA *
|
||||||
_gtk_css_value_get_rgba (GtkCssValue *value)
|
_gtk_css_value_get_rgba (GtkCssValue *value)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (_gtk_css_value_holds (value, GDK_TYPE_RGBA), NULL);
|
g_return_val_if_fail (_gtk_css_value_holds (value, GDK_TYPE_RGBA), NULL);
|
||||||
|
@ -64,31 +64,31 @@ GtkCssValue *_gtk_css_value_new_from_background_position (const GtkCssBackground
|
|||||||
void _gtk_css_value_init_gvalue (GtkCssValue *value,
|
void _gtk_css_value_init_gvalue (GtkCssValue *value,
|
||||||
GValue *g_value);
|
GValue *g_value);
|
||||||
|
|
||||||
gboolean _gtk_css_value_is_special (GtkCssValue *value);
|
gboolean _gtk_css_value_is_special (GtkCssValue *value);
|
||||||
GtkCssSpecialValue _gtk_css_value_get_special_kind (GtkCssValue *value);
|
GtkCssSpecialValue _gtk_css_value_get_special_kind (GtkCssValue *value);
|
||||||
int _gtk_css_value_get_int (GtkCssValue *value);
|
int _gtk_css_value_get_int (GtkCssValue *value);
|
||||||
double _gtk_css_value_get_double (GtkCssValue *value);
|
double _gtk_css_value_get_double (GtkCssValue *value);
|
||||||
const char * _gtk_css_value_get_string (GtkCssValue *value);
|
const char * _gtk_css_value_get_string (GtkCssValue *value);
|
||||||
gpointer _gtk_css_value_dup_object (GtkCssValue *value);
|
gpointer _gtk_css_value_dup_object (GtkCssValue *value);
|
||||||
gpointer _gtk_css_value_get_object (GtkCssValue *value);
|
gpointer _gtk_css_value_get_object (GtkCssValue *value);
|
||||||
gpointer _gtk_css_value_get_boxed (GtkCssValue *value);
|
gpointer _gtk_css_value_get_boxed (GtkCssValue *value);
|
||||||
const char ** _gtk_css_value_get_strv (GtkCssValue *value);
|
const char ** _gtk_css_value_get_strv (GtkCssValue *value);
|
||||||
GtkCssNumber *_gtk_css_value_get_number (GtkCssValue *value);
|
const GtkCssNumber *_gtk_css_value_get_number (GtkCssValue *value);
|
||||||
GtkSymbolicColor *_gtk_css_value_get_symbolic_color (GtkCssValue *value);
|
GtkSymbolicColor *_gtk_css_value_get_symbolic_color (GtkCssValue *value);
|
||||||
GtkCssImage *_gtk_css_value_get_image (GtkCssValue *value);
|
GtkCssImage *_gtk_css_value_get_image (GtkCssValue *value);
|
||||||
GtkBorderStyle _gtk_css_value_get_border_style (GtkCssValue *value);
|
GtkBorderStyle _gtk_css_value_get_border_style (GtkCssValue *value);
|
||||||
GtkCssBackgroundSize *_gtk_css_value_get_background_size (GtkCssValue *value);
|
const GtkCssBackgroundSize *_gtk_css_value_get_background_size (GtkCssValue *value);
|
||||||
GtkCssBackgroundPosition *_gtk_css_value_get_background_position (GtkCssValue *value);
|
const GtkCssBackgroundPosition *_gtk_css_value_get_background_position (GtkCssValue *value);
|
||||||
GtkCssBorderCornerRadius *_gtk_css_value_get_border_corner_radius (GtkCssValue *value);
|
const GtkCssBorderCornerRadius *_gtk_css_value_get_border_corner_radius (GtkCssValue *value);
|
||||||
GtkCssBorderImageRepeat *_gtk_css_value_get_border_image_repeat (GtkCssValue *value);
|
const GtkCssBorderImageRepeat *_gtk_css_value_get_border_image_repeat (GtkCssValue *value);
|
||||||
PangoFontDescription * _gtk_css_value_get_font_description (GtkCssValue *value);
|
PangoFontDescription * _gtk_css_value_get_font_description (GtkCssValue *value);
|
||||||
PangoStyle _gtk_css_value_get_pango_style (GtkCssValue *value);
|
PangoStyle _gtk_css_value_get_pango_style (GtkCssValue *value);
|
||||||
PangoVariant _gtk_css_value_get_pango_variant (GtkCssValue *value);
|
PangoVariant _gtk_css_value_get_pango_variant (GtkCssValue *value);
|
||||||
PangoWeight _gtk_css_value_get_pango_weight (GtkCssValue *value);
|
PangoWeight _gtk_css_value_get_pango_weight (GtkCssValue *value);
|
||||||
GdkRGBA *_gtk_css_value_get_rgba (GtkCssValue *value);
|
const GdkRGBA *_gtk_css_value_get_rgba (GtkCssValue *value);
|
||||||
cairo_pattern_t *_gtk_css_value_get_pattern (GtkCssValue *value);
|
cairo_pattern_t *_gtk_css_value_get_pattern (GtkCssValue *value);
|
||||||
GtkGradient *_gtk_css_value_get_gradient (GtkCssValue *value);
|
GtkGradient *_gtk_css_value_get_gradient (GtkCssValue *value);
|
||||||
GtkShadow *_gtk_css_value_get_shadow (GtkCssValue *value);
|
GtkShadow *_gtk_css_value_get_shadow (GtkCssValue *value);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -161,8 +161,8 @@ _gtk_theming_background_paint (GtkThemingBackground *bg,
|
|||||||
&& bg->image_rect.height > 0)
|
&& bg->image_rect.height > 0)
|
||||||
{
|
{
|
||||||
GtkCssBackgroundRepeat hrepeat, vrepeat;
|
GtkCssBackgroundRepeat hrepeat, vrepeat;
|
||||||
GtkCssBackgroundSize *size;
|
const GtkCssBackgroundSize *size;
|
||||||
GtkCssBackgroundPosition *pos;
|
const GtkCssBackgroundPosition *pos;
|
||||||
double image_width, image_height;
|
double image_width, image_height;
|
||||||
double width, height;
|
double width, height;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user