2 * Copyright © 2011 Red Hat Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 * Authors: Benjamin Otte <otte@gnome.org>
22 #include "gtkcssshorthandpropertyprivate.h"
24 #include <cairo-gobject.h>
27 #include "gtkcssarrayvalueprivate.h"
28 #include "gtkcssbordervalueprivate.h"
29 #include "gtkcsscornervalueprivate.h"
30 #include "gtkcssenumvalueprivate.h"
31 #include "gtkcssimageprivate.h"
32 #include "gtkcssimagevalueprivate.h"
33 #include "gtkcssnumbervalueprivate.h"
34 #include "gtkcssrepeatvalueprivate.h"
35 #include "gtkcssstringvalueprivate.h"
36 #include "gtkcssstylefuncsprivate.h"
37 #include "gtkcssvalueprivate.h"
38 #include "gtkstylepropertiesprivate.h"
39 #include "gtksymboliccolorprivate.h"
40 #include "gtktypebuiltins.h"
42 /* this is in case round() is not provided by the compiler,
43 * such as in the case of C89 compilers, like MSVC
45 #include "fallback-c89.c"
50 value_is_done_parsing (GtkCssParser *parser)
52 return _gtk_css_parser_is_eof (parser) ||
53 _gtk_css_parser_begins_with (parser, ',') ||
54 _gtk_css_parser_begins_with (parser, ';') ||
55 _gtk_css_parser_begins_with (parser, '}');
59 parse_four_numbers (GtkCssShorthandProperty *shorthand,
62 GtkCssNumberParseFlags flags)
66 for (i = 0; i < 4; i++)
68 if (!_gtk_css_parser_has_number (parser))
71 values[i] = _gtk_css_number_value_parse (parser, flags);
72 if (values[i] == NULL)
78 _gtk_css_parser_error (parser, "Expected a length");
84 values[i] = _gtk_css_value_ref (values[(i - 1) >> 1]);
91 parse_margin (GtkCssShorthandProperty *shorthand,
96 return parse_four_numbers (shorthand,
99 GTK_CSS_NUMBER_AS_PIXELS
100 | GTK_CSS_PARSE_LENGTH);
104 parse_padding (GtkCssShorthandProperty *shorthand,
105 GtkCssValue **values,
106 GtkCssParser *parser,
109 return parse_four_numbers (shorthand,
112 GTK_CSS_POSITIVE_ONLY
113 | GTK_CSS_NUMBER_AS_PIXELS
114 | GTK_CSS_PARSE_LENGTH);
118 parse_border_width (GtkCssShorthandProperty *shorthand,
119 GtkCssValue **values,
120 GtkCssParser *parser,
123 return parse_four_numbers (shorthand,
126 GTK_CSS_POSITIVE_ONLY
127 | GTK_CSS_NUMBER_AS_PIXELS
128 | GTK_CSS_PARSE_LENGTH);
132 parse_border_radius (GtkCssShorthandProperty *shorthand,
133 GtkCssValue **values,
134 GtkCssParser *parser,
137 GtkCssValue *x[4] = { NULL, }, *y[4] = { NULL, };
140 for (i = 0; i < 4; i++)
142 if (!_gtk_css_parser_has_number (parser))
144 x[i] = _gtk_css_number_value_parse (parser,
145 GTK_CSS_POSITIVE_ONLY
146 | GTK_CSS_PARSE_PERCENT
147 | GTK_CSS_NUMBER_AS_PIXELS
148 | GTK_CSS_PARSE_LENGTH);
155 _gtk_css_parser_error (parser, "Expected a number");
159 /* The magic (i - 1) >> 1 below makes it take the correct value
160 * according to spec. Feel free to check the 4 cases */
162 x[i] = _gtk_css_value_ref (x[(i - 1) >> 1]);
164 if (_gtk_css_parser_try (parser, "/", TRUE))
166 for (i = 0; i < 4; i++)
168 if (!_gtk_css_parser_has_number (parser))
170 y[i] = _gtk_css_number_value_parse (parser,
171 GTK_CSS_POSITIVE_ONLY
172 | GTK_CSS_PARSE_PERCENT
173 | GTK_CSS_NUMBER_AS_PIXELS
174 | GTK_CSS_PARSE_LENGTH);
181 _gtk_css_parser_error (parser, "Expected a number");
186 y[i] = _gtk_css_value_ref (y[(i - 1) >> 1]);
190 for (i = 0; i < 4; i++)
191 y[i] = _gtk_css_value_ref (x[i]);
194 for (i = 0; i < 4; i++)
196 values[i] = _gtk_css_corner_value_new (x[i], y[i]);
202 for (i = 0; i < 4; i++)
205 _gtk_css_value_unref (x[i]);
207 _gtk_css_value_unref (y[i]);
213 parse_border_color (GtkCssShorthandProperty *shorthand,
214 GtkCssValue **values,
215 GtkCssParser *parser,
218 GtkSymbolicColor *symbolic;
221 for (i = 0; i < 4; i++)
223 if (_gtk_css_parser_try (parser, "currentcolor", TRUE))
225 symbolic = gtk_symbolic_color_ref (_gtk_symbolic_color_get_current_color ());
229 symbolic = _gtk_css_parser_read_symbolic_color (parser);
230 if (symbolic == NULL)
234 values[i] = _gtk_css_value_new_take_symbolic_color (symbolic);
236 if (value_is_done_parsing (parser))
240 for (i++; i < 4; i++)
242 values[i] = _gtk_css_value_ref (values[(i - 1) >> 1]);
249 parse_border_style (GtkCssShorthandProperty *shorthand,
250 GtkCssValue **values,
251 GtkCssParser *parser,
256 for (i = 0; i < 4; i++)
258 values[i] = _gtk_css_border_style_value_try_parse (parser);
259 if (values[i] == NULL)
265 _gtk_css_parser_error (parser, "Expected a border style");
270 values[i] = _gtk_css_value_ref (values[(i - 1) >> 1]);
276 parse_border_image (GtkCssShorthandProperty *shorthand,
277 GtkCssValue **values,
278 GtkCssParser *parser,
283 if (values[0] == NULL &&
284 (_gtk_css_parser_has_prefix (parser, "none") ||
285 _gtk_css_image_can_parse (parser)))
289 if (_gtk_css_parser_try (parser, "none", TRUE))
293 image = _gtk_css_image_new_parse (parser, base);
298 values[0] = _gtk_css_image_value_new (image);
300 else if (values[3] == NULL &&
301 (values[3] = _gtk_css_border_repeat_value_try_parse (parser)))
303 /* please move along */
305 else if (values[1] == NULL)
307 values[1] = _gtk_css_border_value_parse (parser,
308 GTK_CSS_PARSE_PERCENT
309 | GTK_CSS_PARSE_NUMBER
310 | GTK_CSS_POSITIVE_ONLY,
313 if (values[1] == NULL)
316 if (_gtk_css_parser_try (parser, "/", TRUE))
318 values[2] = _gtk_css_border_value_parse (parser,
319 GTK_CSS_PARSE_PERCENT
320 | GTK_CSS_PARSE_LENGTH
321 | GTK_CSS_PARSE_NUMBER
322 | GTK_CSS_POSITIVE_ONLY,
325 if (values[2] == NULL)
331 /* We parsed everything and there's still stuff left?
332 * Pretend we didn't notice and let the normal code produce
333 * a 'junk at end of value' error */
337 while (!value_is_done_parsing (parser));
343 parse_border_side (GtkCssShorthandProperty *shorthand,
344 GtkCssValue **values,
345 GtkCssParser *parser,
350 if (values[0] == NULL &&
351 _gtk_css_parser_has_number (parser))
353 values[0] = _gtk_css_number_value_parse (parser,
354 GTK_CSS_POSITIVE_ONLY
355 | GTK_CSS_NUMBER_AS_PIXELS
356 | GTK_CSS_PARSE_LENGTH);
357 if (values[0] == NULL)
360 else if (values[1] == NULL &&
361 (values[1] = _gtk_css_border_style_value_try_parse (parser)))
365 else if (values[2] == NULL)
367 GtkSymbolicColor *symbolic;
369 symbolic = _gtk_css_parser_read_symbolic_color (parser);
370 if (symbolic == NULL)
373 values[2] = _gtk_css_value_new_take_symbolic_color (symbolic);
376 while (!value_is_done_parsing (parser));
382 parse_border (GtkCssShorthandProperty *shorthand,
383 GtkCssValue **values,
384 GtkCssParser *parser,
389 if (values[0] == NULL &&
390 _gtk_css_parser_has_number (parser))
392 values[0] = _gtk_css_number_value_parse (parser,
393 GTK_CSS_POSITIVE_ONLY
394 | GTK_CSS_NUMBER_AS_PIXELS
395 | GTK_CSS_PARSE_LENGTH);
396 if (values[0] == NULL)
398 values[1] = _gtk_css_value_ref (values[0]);
399 values[2] = _gtk_css_value_ref (values[0]);
400 values[3] = _gtk_css_value_ref (values[0]);
402 else if (values[4] == NULL &&
403 (values[4] = _gtk_css_border_style_value_try_parse (parser)))
405 values[5] = _gtk_css_value_ref (values[4]);
406 values[6] = _gtk_css_value_ref (values[4]);
407 values[7] = _gtk_css_value_ref (values[4]);
409 else if (!G_IS_VALUE (&values[8]))
411 GtkSymbolicColor *symbolic;
413 symbolic = _gtk_css_parser_read_symbolic_color (parser);
414 if (symbolic == NULL)
417 values[8] = _gtk_css_value_new_take_symbolic_color (symbolic);
418 values[9] = _gtk_css_value_ref (values[8]);
419 values[10] = _gtk_css_value_ref (values[8]);
420 values[11] = _gtk_css_value_ref (values[8]);
424 /* We parsed everything and there's still stuff left?
425 * Pretend we didn't notice and let the normal code produce
426 * a 'junk at end of value' error */
430 while (!value_is_done_parsing (parser));
432 /* Note that border-image values are not set: according to the spec
433 they just need to be reset when using the border shorthand */
439 parse_font (GtkCssShorthandProperty *shorthand,
440 GtkCssValue **values,
441 GtkCssParser *parser,
444 PangoFontDescription *desc;
448 str = _gtk_css_parser_read_value (parser);
452 desc = pango_font_description_from_string (str);
455 mask = pango_font_description_get_set_fields (desc);
457 if (mask & PANGO_FONT_MASK_FAMILY)
459 values[0] = _gtk_css_array_value_new (_gtk_css_string_value_new (pango_font_description_get_family (desc)));
461 if (mask & PANGO_FONT_MASK_STYLE)
463 values[1] = _gtk_css_font_style_value_new (pango_font_description_get_style (desc));
465 if (mask & PANGO_FONT_MASK_VARIANT)
467 values[2] = _gtk_css_font_variant_value_new (pango_font_description_get_variant (desc));
469 if (mask & PANGO_FONT_MASK_WEIGHT)
471 values[3] = _gtk_css_font_weight_value_new (pango_font_description_get_weight (desc));
473 if (mask & PANGO_FONT_MASK_SIZE)
475 values[4] = _gtk_css_number_value_new ((double) pango_font_description_get_size (desc) / PANGO_SCALE, GTK_CSS_PX);
478 pango_font_description_free (desc);
484 parse_background (GtkCssShorthandProperty *shorthand,
485 GtkCssValue **values,
486 GtkCssParser *parser,
492 if (values[0] == NULL &&
493 (_gtk_css_parser_has_prefix (parser, "none") ||
494 _gtk_css_image_can_parse (parser)))
498 if (_gtk_css_parser_try (parser, "none", TRUE))
502 image = _gtk_css_image_new_parse (parser, base);
507 values[0] = _gtk_css_image_value_new (image);
509 else if (values[1] == NULL &&
510 (values[1] = _gtk_css_background_repeat_value_try_parse (parser)))
512 /* nothing to do here */
514 else if ((values[2] == NULL || values[3] == NULL) &&
515 (values[3] = _gtk_css_area_value_try_parse (parser)))
517 if (values[2] == NULL)
519 values[2] = values[3];
523 else if (values[4] == NULL)
525 GtkSymbolicColor *symbolic;
527 symbolic = _gtk_css_parser_read_symbolic_color (parser);
528 if (symbolic == NULL)
531 values[4] = _gtk_css_value_new_take_symbolic_color (symbolic);
535 /* We parsed everything and there's still stuff left?
536 * Pretend we didn't notice and let the normal code produce
537 * a 'junk at end of value' error */
541 while (!value_is_done_parsing (parser));
549 unpack_border (GtkCssShorthandProperty *shorthand,
550 GtkStyleProperties *props,
554 GValue v = G_VALUE_INIT;
555 GtkBorder *border = g_value_get_boxed (value);
557 g_value_init (&v, G_TYPE_INT);
559 g_value_set_int (&v, border->top);
560 _gtk_style_property_assign (GTK_STYLE_PROPERTY (_gtk_css_shorthand_property_get_subproperty (shorthand, 0)), props, state, &v);
561 g_value_set_int (&v, border->right);
562 _gtk_style_property_assign (GTK_STYLE_PROPERTY (_gtk_css_shorthand_property_get_subproperty (shorthand, 1)), props, state, &v);
563 g_value_set_int (&v, border->bottom);
564 _gtk_style_property_assign (GTK_STYLE_PROPERTY (_gtk_css_shorthand_property_get_subproperty (shorthand, 2)), props, state, &v);
565 g_value_set_int (&v, border->left);
566 _gtk_style_property_assign (GTK_STYLE_PROPERTY (_gtk_css_shorthand_property_get_subproperty (shorthand, 3)), props, state, &v);
572 pack_border (GtkCssShorthandProperty *shorthand,
574 GtkStyleQueryFunc query_func,
577 GtkCssStyleProperty *prop;
581 prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 0);
582 v = (* query_func) (_gtk_css_style_property_get_id (prop), query_data);
584 border.top = _gtk_css_value_get_int (v);
585 prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 1);
586 v = (* query_func) (_gtk_css_style_property_get_id (prop), query_data);
588 border.right = _gtk_css_value_get_int (v);
589 prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 2);
590 v = (* query_func) (_gtk_css_style_property_get_id (prop), query_data);
592 border.bottom = _gtk_css_value_get_int (v);
593 prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 3);
594 v = (* query_func) (_gtk_css_style_property_get_id (prop), query_data);
596 border.left = _gtk_css_value_get_int (v);
598 g_value_init (value, GTK_TYPE_BORDER);
599 g_value_set_boxed (value, &border);
603 unpack_border_radius (GtkCssShorthandProperty *shorthand,
604 GtkStyleProperties *props,
608 GtkCssValue *css_value;
611 css_value = _gtk_css_corner_value_new (_gtk_css_number_value_new (g_value_get_int (value), GTK_CSS_PX),
612 _gtk_css_number_value_new (g_value_get_int (value), GTK_CSS_PX));
614 for (i = 0; i < 4; i++)
615 _gtk_style_properties_set_property_by_property (props,
616 _gtk_css_shorthand_property_get_subproperty (shorthand, i),
620 _gtk_css_value_unref (css_value);
624 pack_border_radius (GtkCssShorthandProperty *shorthand,
626 GtkStyleQueryFunc query_func,
629 GtkCssStyleProperty *prop;
633 prop = GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("border-top-left-radius"));
634 v = (* query_func) (_gtk_css_style_property_get_id (prop), query_data);
636 i = _gtk_css_corner_value_get_x (v, 100);
638 g_value_init (value, G_TYPE_INT);
639 g_value_set_int (value, i);
643 unpack_font_description (GtkCssShorthandProperty *shorthand,
644 GtkStyleProperties *props,
648 GtkStyleProperty *prop;
649 PangoFontDescription *description;
651 GValue v = G_VALUE_INIT;
653 /* For backwards compat, we only unpack values that are indeed set.
654 * For strict CSS conformance we need to unpack all of them.
655 * Note that we do set all of them in the parse function, so it
656 * will not have effects when parsing CSS files. It will though
657 * for custom style providers.
660 description = g_value_get_boxed (value);
663 mask = pango_font_description_get_set_fields (description);
667 if (mask & PANGO_FONT_MASK_FAMILY)
669 GPtrArray *strv = g_ptr_array_new ();
671 g_ptr_array_add (strv, g_strdup (pango_font_description_get_family (description)));
672 g_ptr_array_add (strv, NULL);
673 g_value_init (&v, G_TYPE_STRV);
674 g_value_take_boxed (&v, g_ptr_array_free (strv, FALSE));
676 prop = _gtk_style_property_lookup ("font-family");
677 _gtk_style_property_assign (prop, props, state, &v);
681 if (mask & PANGO_FONT_MASK_STYLE)
683 g_value_init (&v, PANGO_TYPE_STYLE);
684 g_value_set_enum (&v, pango_font_description_get_style (description));
686 prop = _gtk_style_property_lookup ("font-style");
687 _gtk_style_property_assign (prop, props, state, &v);
691 if (mask & PANGO_FONT_MASK_VARIANT)
693 g_value_init (&v, PANGO_TYPE_VARIANT);
694 g_value_set_enum (&v, pango_font_description_get_variant (description));
696 prop = _gtk_style_property_lookup ("font-variant");
697 _gtk_style_property_assign (prop, props, state, &v);
701 if (mask & PANGO_FONT_MASK_WEIGHT)
703 g_value_init (&v, PANGO_TYPE_WEIGHT);
704 g_value_set_enum (&v, pango_font_description_get_weight (description));
706 prop = _gtk_style_property_lookup ("font-weight");
707 _gtk_style_property_assign (prop, props, state, &v);
711 if (mask & PANGO_FONT_MASK_SIZE)
713 g_value_init (&v, G_TYPE_DOUBLE);
714 g_value_set_double (&v, (double) pango_font_description_get_size (description) / PANGO_SCALE);
716 prop = _gtk_style_property_lookup ("font-size");
717 _gtk_style_property_assign (prop, props, state, &v);
723 pack_font_description (GtkCssShorthandProperty *shorthand,
725 GtkStyleQueryFunc query_func,
728 PangoFontDescription *description;
731 description = pango_font_description_new ();
733 v = (* query_func) (_gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("font-family"))), query_data);
736 /* xxx: Can we set all the families here somehow? */
737 pango_font_description_set_family (description, _gtk_css_string_value_get (_gtk_css_array_value_get_nth (v, 0)));
740 v = (* query_func) (_gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("font-size"))), query_data);
742 pango_font_description_set_size (description, round (_gtk_css_number_value_get (v, 100) * PANGO_SCALE));
744 v = (* query_func) (_gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("font-style"))), query_data);
746 pango_font_description_set_style (description, _gtk_css_font_style_value_get (v));
748 v = (* query_func) (_gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("font-variant"))), query_data);
750 pango_font_description_set_variant (description, _gtk_css_font_variant_value_get (v));
752 v = (* query_func) (_gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("font-weight"))), query_data);
754 pango_font_description_set_weight (description, _gtk_css_font_weight_value_get (v));
756 g_value_init (value, PANGO_TYPE_FONT_DESCRIPTION);
757 g_value_take_boxed (value, description);
761 unpack_to_everything (GtkCssShorthandProperty *shorthand,
762 GtkStyleProperties *props,
766 GtkCssStyleProperty *prop;
769 n = _gtk_css_shorthand_property_get_n_subproperties (shorthand);
771 for (i = 0; i < n; i++)
773 prop = _gtk_css_shorthand_property_get_subproperty (shorthand, i);
774 _gtk_style_property_assign (GTK_STYLE_PROPERTY (prop), props, state, value);
779 pack_first_element (GtkCssShorthandProperty *shorthand,
781 GtkStyleQueryFunc query_func,
784 GtkCssStyleProperty *prop;
786 /* NB: This is a fallback for properties that originally were
787 * not used as shorthand. We just pick the first subproperty
788 * as a representative.
789 * Lesson learned: Don't query the shorthand, query the
790 * real properties instead. */
791 prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 0);
792 _gtk_style_property_query (GTK_STYLE_PROPERTY (prop),
799 _gtk_css_shorthand_property_register (const char *name,
801 const char **subproperties,
802 GtkCssShorthandPropertyParseFunc parse_func,
803 GtkCssShorthandPropertyAssignFunc assign_func,
804 GtkCssShorthandPropertyQueryFunc query_func)
806 GtkCssShorthandProperty *node;
808 node = g_object_new (GTK_TYPE_CSS_SHORTHAND_PROPERTY,
810 "value-type", value_type,
811 "subproperties", subproperties,
814 node->parse = parse_func;
815 node->assign = assign_func;
816 node->query = query_func;
820 _gtk_css_shorthand_property_init_properties (void)
822 /* The order is important here, be careful when changing it */
823 const char *font_subproperties[] = { "font-family", "font-style", "font-variant", "font-weight", "font-size", NULL };
824 const char *margin_subproperties[] = { "margin-top", "margin-right", "margin-bottom", "margin-left", NULL };
825 const char *padding_subproperties[] = { "padding-top", "padding-right", "padding-bottom", "padding-left", NULL };
826 const char *border_width_subproperties[] = { "border-top-width", "border-right-width", "border-bottom-width", "border-left-width", NULL };
827 const char *border_radius_subproperties[] = { "border-top-left-radius", "border-top-right-radius",
828 "border-bottom-right-radius", "border-bottom-left-radius", NULL };
829 const char *border_color_subproperties[] = { "border-top-color", "border-right-color", "border-bottom-color", "border-left-color", NULL };
830 const char *border_style_subproperties[] = { "border-top-style", "border-right-style", "border-bottom-style", "border-left-style", NULL };
831 const char *border_image_subproperties[] = { "border-image-source", "border-image-slice", "border-image-width", "border-image-repeat", NULL };
832 const char *border_top_subproperties[] = { "border-top-width", "border-top-style", "border-top-color", NULL };
833 const char *border_right_subproperties[] = { "border-right-width", "border-right-style", "border-right-color", NULL };
834 const char *border_bottom_subproperties[] = { "border-bottom-width", "border-bottom-style", "border-bottom-color", NULL };
835 const char *border_left_subproperties[] = { "border-left-width", "border-left-style", "border-left-color", NULL };
836 const char *border_subproperties[] = { "border-top-width", "border-right-width", "border-bottom-width", "border-left-width",
837 "border-top-style", "border-right-style", "border-bottom-style", "border-left-style",
838 "border-top-color", "border-right-color", "border-bottom-color", "border-left-color",
839 "border-image-source", "border-image-slice", "border-image-width", "border-image-repeat", NULL };
840 const char *outline_subproperties[] = { "outline-width", "outline-style", "outline-color", NULL };
841 const char *background_subproperties[] = { "background-image", "background-repeat", "background-clip", "background-origin",
842 "background-color", NULL };
844 _gtk_css_shorthand_property_register ("font",
845 PANGO_TYPE_FONT_DESCRIPTION,
848 unpack_font_description,
849 pack_font_description);
850 _gtk_css_shorthand_property_register ("margin",
852 margin_subproperties,
856 _gtk_css_shorthand_property_register ("padding",
858 padding_subproperties,
862 _gtk_css_shorthand_property_register ("border-width",
864 border_width_subproperties,
868 _gtk_css_shorthand_property_register ("border-radius",
870 border_radius_subproperties,
872 unpack_border_radius,
874 _gtk_css_shorthand_property_register ("border-color",
876 border_color_subproperties,
878 unpack_to_everything,
880 _gtk_css_shorthand_property_register ("border-style",
881 GTK_TYPE_BORDER_STYLE,
882 border_style_subproperties,
884 unpack_to_everything,
886 _gtk_css_shorthand_property_register ("border-image",
888 border_image_subproperties,
892 _gtk_css_shorthand_property_register ("border-top",
894 border_top_subproperties,
898 _gtk_css_shorthand_property_register ("border-right",
900 border_right_subproperties,
904 _gtk_css_shorthand_property_register ("border-bottom",
906 border_bottom_subproperties,
910 _gtk_css_shorthand_property_register ("border-left",
912 border_left_subproperties,
916 _gtk_css_shorthand_property_register ("border",
918 border_subproperties,
922 _gtk_css_shorthand_property_register ("outline",
924 outline_subproperties,
928 _gtk_css_shorthand_property_register ("background",
930 background_subproperties,