Rename GTK_CSS_REPEAT_STYLE_NONE to GTK_CSS_REPEAT_STYLE_STRETCH

This is a private type, and the CSS default value is "stretch", which
is how we were parsing and printing NONE anyway.

With this fix we can use the enum stuff for printing/parsing
This commit is contained in:
Alexander Larsson 2011-11-25 15:30:10 +01:00
parent 2a42fad145
commit d85aabe1e3
3 changed files with 9 additions and 9 deletions

View File

@ -274,7 +274,7 @@ gtk_border_image_render_slice (cairo_t *cr,
cairo_pattern_t *pattern; cairo_pattern_t *pattern;
/* We can't draw center tiles yet */ /* We can't draw center tiles yet */
g_assert (hrepeat == GTK_CSS_REPEAT_STYLE_NONE || vrepeat == GTK_CSS_REPEAT_STYLE_NONE); g_assert (hrepeat == GTK_CSS_REPEAT_STYLE_STRETCH || vrepeat == GTK_CSS_REPEAT_STYLE_STRETCH);
hscale = width / slice_width; hscale = width / slice_width;
vscale = height / slice_height; vscale = height / slice_height;
@ -302,7 +302,7 @@ gtk_border_image_render_slice (cairo_t *cr,
width -= 2 * space; width -= 2 * space;
} }
break; break;
case GTK_CSS_REPEAT_STYLE_NONE: case GTK_CSS_REPEAT_STYLE_STRETCH:
break; break;
case GTK_CSS_REPEAT_STYLE_ROUND: case GTK_CSS_REPEAT_STYLE_ROUND:
extend = CAIRO_EXTEND_REPEAT; extend = CAIRO_EXTEND_REPEAT;
@ -334,7 +334,7 @@ gtk_border_image_render_slice (cairo_t *cr,
height -= 2 * space; height -= 2 * space;
} }
break; break;
case GTK_CSS_REPEAT_STYLE_NONE: case GTK_CSS_REPEAT_STYLE_STRETCH:
break; break;
case GTK_CSS_REPEAT_STYLE_ROUND: case GTK_CSS_REPEAT_STYLE_ROUND:
extend = CAIRO_EXTEND_REPEAT; extend = CAIRO_EXTEND_REPEAT;
@ -488,8 +488,8 @@ _gtk_border_image_render (GtkBorderImage *image,
vertical_border[v].offset, vertical_border[v].offset,
horizontal_border[h].size, horizontal_border[h].size,
vertical_border[v].size, vertical_border[v].size,
h == 1 ? image->repeat.hrepeat : GTK_CSS_REPEAT_STYLE_NONE, h == 1 ? image->repeat.hrepeat : GTK_CSS_REPEAT_STYLE_STRETCH,
v == 1 ? image->repeat.vrepeat : GTK_CSS_REPEAT_STYLE_NONE); v == 1 ? image->repeat.vrepeat : GTK_CSS_REPEAT_STYLE_STRETCH);
cairo_surface_destroy (slice); cairo_surface_destroy (slice);
} }

View File

@ -31,7 +31,7 @@ typedef enum {
} GtkCssBackgroundRepeatStyle; } GtkCssBackgroundRepeatStyle;
typedef enum { typedef enum {
GTK_CSS_REPEAT_STYLE_NONE, GTK_CSS_REPEAT_STYLE_STRETCH,
GTK_CSS_REPEAT_STYLE_REPEAT, GTK_CSS_REPEAT_STYLE_REPEAT,
GTK_CSS_REPEAT_STYLE_ROUND, GTK_CSS_REPEAT_STYLE_ROUND,
GTK_CSS_REPEAT_STYLE_SPACE GTK_CSS_REPEAT_STYLE_SPACE

View File

@ -1241,7 +1241,7 @@ border_image_repeat_value_parse (GtkCssParser *parser,
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
if (_gtk_css_parser_try (parser, "stretch", TRUE)) if (_gtk_css_parser_try (parser, "stretch", TRUE))
styles[i] = GTK_CSS_REPEAT_STYLE_NONE; styles[i] = GTK_CSS_REPEAT_STYLE_STRETCH;
else if (_gtk_css_parser_try (parser, "repeat", TRUE)) else if (_gtk_css_parser_try (parser, "repeat", TRUE))
styles[i] = GTK_CSS_REPEAT_STYLE_REPEAT; styles[i] = GTK_CSS_REPEAT_STYLE_REPEAT;
else if (_gtk_css_parser_try (parser, "round", TRUE)) else if (_gtk_css_parser_try (parser, "round", TRUE))
@ -1250,7 +1250,7 @@ border_image_repeat_value_parse (GtkCssParser *parser,
styles[i] = GTK_CSS_REPEAT_STYLE_SPACE; styles[i] = GTK_CSS_REPEAT_STYLE_SPACE;
else if (i == 0) else if (i == 0)
{ {
styles[1] = styles[0] = GTK_CSS_REPEAT_STYLE_NONE; styles[1] = styles[0] = GTK_CSS_REPEAT_STYLE_STRETCH;
break; break;
} }
else else
@ -1270,7 +1270,7 @@ border_image_repeat_style_to_string (GtkCssBorderRepeatStyle repeat)
{ {
switch (repeat) switch (repeat)
{ {
case GTK_CSS_REPEAT_STYLE_NONE: case GTK_CSS_REPEAT_STYLE_STRETCH:
return "stretch"; return "stretch";
case GTK_CSS_REPEAT_STYLE_REPEAT: case GTK_CSS_REPEAT_STYLE_REPEAT:
return "repeat"; return "repeat";