156 static GHashTable *gv_prop_hash = NULL;
163 static gulong gv_prop_hash_ref_count = 0;
222 cr_style_init_properties (
void);
234 static const gchar *num_prop_code_to_string (
enum CRNumProp a_code);
236 static const gchar *rgb_prop_code_to_string (
enum CRRgbProp a_code);
242 set_prop_padding_x_from_value (
CRStyle * a_style,
246 set_prop_border_x_width_from_value (
CRStyle * a_style,
250 set_prop_border_width_from_value (
CRStyle *a_style,
254 set_prop_border_x_style_from_value (
CRStyle * a_style,
258 set_prop_border_style_from_value (
CRStyle *a_style,
262 set_prop_margin_x_from_value (
CRStyle * a_style,
CRTerm * a_value,
266 set_prop_display_from_value (
CRStyle * a_style,
CRTerm * a_value);
269 set_prop_position_from_value (
CRStyle * a_style,
CRTerm * a_value);
285 set_prop_background_color (
CRStyle * a_style,
CRTerm * a_value);
288 set_prop_border_x_color_from_value (
CRStyle * a_style,
CRTerm * a_value,
292 set_prop_border_x_from_value (
CRStyle * a_style,
CRTerm * a_value,
296 set_prop_border_from_value (
CRStyle * a_style,
CRTerm * a_value);
299 set_prop_padding_from_value (
CRStyle * a_style,
CRTerm * a_value);
302 set_prop_margin_from_value (
CRStyle * a_style,
CRTerm * a_value);
305 set_prop_font_family_from_value (
CRStyle * a_style,
CRTerm * a_value);
308 init_style_font_size_field (
CRStyle * a_style);
311 set_prop_font_size_from_value (
CRStyle * a_style,
CRTerm * a_value);
314 set_prop_font_style_from_value (
CRStyle * a_style,
CRTerm * a_value);
317 set_prop_font_weight_from_value (
CRStyle * a_style,
CRTerm * a_value);
320 num_prop_code_to_string (
enum CRNumProp a_code)
322 guint len =
sizeof (gv_num_props_dump_infos) /
326 "to 'enum CRNumProp' and no matching"
328 "added to gv_num_prop_dump_infos table.\n"
329 "Please add the missing matching entry");
332 if (gv_num_props_dump_infos[a_code].
code != a_code) {
334 " 'enum CRNumProp' and "
335 "the order of entries in "
336 "the gv_num_prop_dump_infos table");
339 return gv_num_props_dump_infos[a_code].
str;
343 rgb_prop_code_to_string (
enum CRRgbProp a_code)
345 guint len =
sizeof (gv_rgb_props_dump_infos) /
350 "to 'enum CRRgbProp' and no matching"
352 "added to gv_rgb_prop_dump_infos table.\n"
353 "Please add the missing matching entry");
356 if (gv_rgb_props_dump_infos[a_code].
code != a_code) {
358 " 'enum CRRgbProp' and "
359 "the order of entries in "
360 "the gv_rgb_props_dump_infos table");
363 return gv_rgb_props_dump_infos[a_code].
str;
369 guint len =
sizeof (gv_border_style_props_dump_infos) /
374 "to 'enum CRBorderStyleProp' and no matching"
376 "added to gv_border_style_prop_dump_infos table.\n"
377 "Please add the missing matching entry");
380 if (gv_border_style_props_dump_infos[a_code].
code != a_code) {
382 " 'enum CRBorderStyleProp' and "
383 "the order of entries in "
384 "the gv_border_style_props_dump_infos table");
387 return gv_border_style_props_dump_infos[a_code].
str;
391 cr_style_init_properties (
void)
397 gv_prop_hash = g_hash_table_new (g_str_hash, g_str_equal);
404 for (i = 0; gv_prop_table[i].
name; i++) {
407 (gpointer) gv_prop_table[i].name,
408 GINT_TO_POINTER (gv_prop_table[i].prop_id));
416 cr_style_get_prop_id (
const guchar * a_prop)
418 gpointer *raw_id = NULL;
421 cr_style_init_properties ();
424 raw_id = g_hash_table_lookup (gv_prop_hash, a_prop);
428 return GPOINTER_TO_INT (raw_id);
432 set_prop_padding_x_from_value (
CRStyle * a_style,
436 CRNum *num_val = NULL;
468 && !strncmp ((
const char *)
"inherit",
470 sizeof (
"inherit")-1)) {
501 set_prop_border_x_width_from_value (
CRStyle * a_style,
506 CRNum *num_val = NULL;
536 if (!strncmp (
"thin",
538 sizeof (
"thin")-1)) {
544 sizeof (
"medium")-1)) {
547 }
else if (!strncmp (
"thick",
549 sizeof (
"thick")-1)) {
569 set_prop_border_width_from_value (
CRStyle *a_style,
575 g_return_val_if_fail (a_style && a_value,
583 direction <
NB_DIRS ; direction ++) {
584 set_prop_border_x_width_from_value (a_style,
589 cur_term = cur_term->
next ;
592 set_prop_border_x_width_from_value (a_style, cur_term,
594 set_prop_border_x_width_from_value (a_style, cur_term,
597 cur_term = cur_term->
next ;
600 set_prop_border_x_width_from_value (a_style, cur_term,
603 cur_term = cur_term->
next ;
606 set_prop_border_x_width_from_value (a_style, cur_term,
613 set_prop_border_x_style_from_value (
CRStyle * a_style,
623 border_style_ptr = &a_style->
633 border_style_ptr = &a_style->
638 border_style_ptr = &a_style->
650 if (!strncmp (
"none",
652 sizeof (
"none")-1)) {
654 }
else if (!strncmp (
"hidden",
656 sizeof (
"hidden")-1)) {
658 }
else if (!strncmp (
"dotted",
660 sizeof (
"dotted")-1)) {
662 }
else if (!strncmp (
"dashed",
663 a_value->
content.
str->stryng->str, sizeof (
"dashed")-1)) {
665 }
else if (!strncmp (
"solid",
666 a_value->
content.
str->stryng->str, sizeof (
"solid")-1)) {
668 }
else if (!strncmp (
"double",
669 a_value->
content.
str->stryng->str, sizeof (
"double")-1)) {
671 }
else if (!strncmp (
"groove",
672 a_value->
content.
str->stryng->str, sizeof (
"groove")-1)) {
674 }
else if (!strncmp (
"ridge",
676 sizeof (
"ridge")-1)) {
678 }
else if (!strncmp (
"inset",
680 sizeof (
"inset")-1)) {
682 }
else if (!strncmp (
"outset",
684 sizeof (
"outset")-1)) {
686 }
else if (!strncmp (
"inherit",
688 sizeof (
"inherit")-1)) {
698 set_prop_border_style_from_value (
CRStyle *a_style,
704 g_return_val_if_fail (a_style && a_value,
715 set_prop_border_x_style_from_value (a_style,
720 cur_term = cur_term->
next ;
725 set_prop_border_x_style_from_value (a_style, cur_term,
727 set_prop_border_x_style_from_value (a_style, cur_term,
730 cur_term = cur_term->
next ;
734 set_prop_border_x_style_from_value (a_style, cur_term,
737 cur_term = cur_term->
next ;
741 set_prop_border_x_style_from_value (a_style, cur_term,
747 set_prop_margin_x_from_value (
CRStyle * a_style,
CRTerm * a_value,
751 CRNum *num_val = NULL;
776 switch (a_value->
type) {
781 && !strcmp (a_value->
content.
str->stryng->str,
786 && !strcmp (a_value->
content.
str->stryng->str,
812 set_prop_display_from_value (
CRStyle * a_style,
CRTerm * a_value)
837 switch (a_value->
type) {
847 for (i = 0; disp_vals_map[i].
prop_name; i++) {
853 disp_vals_map[i].
type;
873 set_prop_position_from_value (
CRStyle * a_style,
CRTerm * a_value)
888 switch (a_value->
type) {
898 for (i = 0; position_vals_map[i].
name; i++) {
899 if (!strncmp (position_vals_map[i].
name,
901 strlen (position_vals_map[i].
904 position_vals_map[i].
type;
923 CRNum *box_offset = NULL;
960 if (!strncmp (
"inherit",
962 sizeof (
"inherit")-1)) {
964 }
else if (!strncmp (
"auto",
966 sizeof (
"auto")-1)) {
977 g_return_val_if_fail (a_style && a_value,
991 if (!strncmp (
"none",
993 sizeof (
"none")-1)) {
995 }
else if (!strncmp (
"left",
997 sizeof (
"left")-1)) {
999 }
else if (!strncmp (
"right",
1001 sizeof (
"right")-1)) {
1003 }
else if (!strncmp (
"inherit",
1005 sizeof (
"inherit")-1)) {
1014 CRNum *width = NULL;
1015 g_return_val_if_fail (a_style
1026 if (!strncmp (
"auto",
1028 sizeof (
"auto")-1)) {
1030 }
else if (!strncmp (
"inherit",
1032 sizeof (
"inherit")-1)) {
1051 g_return_val_if_fail (a_style
1060 set_prop_background_color (
CRStyle * a_style,
CRTerm * a_value)
1082 set_prop_border_x_color_from_value (
CRStyle * a_style,
CRTerm * a_value,
1085 CRRgb *rgb_color = NULL;
1123 (
const guchar *) a_value->
content.
str->stryng->str);
1126 if (status !=
CR_OK) {
1139 set_prop_border_x_from_value (
CRStyle * a_style,
CRTerm * a_value,
1148 for (cur_term = a_value;
1150 cur_term = cur_term->
next) {
1151 status = set_prop_border_x_width_from_value (a_style,
1154 if (status !=
CR_OK) {
1155 status = set_prop_border_x_style_from_value
1156 (a_style, cur_term, a_dir);
1158 if (status !=
CR_OK) {
1159 status = set_prop_border_x_color_from_value
1160 (a_style, cur_term, a_dir);
1167 set_prop_border_from_value (
CRStyle * a_style,
CRTerm * a_value)
1173 for (direction = 0; direction <
NB_DIRS; direction++) {
1174 set_prop_border_x_from_value (a_style,
1183 set_prop_padding_from_value (
CRStyle * a_style,
CRTerm * a_value)
1195 cur_term = cur_term->
next;
1200 for (direction = 0; direction <
NB_DIRS; direction++) {
1201 set_prop_padding_x_from_value (a_style, cur_term, direction);
1203 cur_term = cur_term->
next;
1207 cur_term = cur_term->
next;
1213 set_prop_padding_x_from_value (a_style, cur_term,
DIR_RIGHT);
1214 set_prop_padding_x_from_value (a_style, cur_term,
DIR_LEFT);
1217 cur_term = cur_term->
next;
1222 set_prop_padding_x_from_value (a_style, cur_term,
DIR_BOTTOM);
1225 cur_term = cur_term->
next;
1229 status = set_prop_padding_x_from_value (a_style, cur_term,
DIR_LEFT);
1234 set_prop_margin_from_value (
CRStyle * a_style,
CRTerm * a_value)
1245 cur_term = cur_term->
next;
1251 for (direction = 0; direction <
NB_DIRS; direction++) {
1252 set_prop_margin_x_from_value (a_style, cur_term, direction);
1254 cur_term = cur_term->
next;
1257 cur_term = cur_term->
next;
1262 set_prop_margin_x_from_value (a_style, cur_term,
DIR_RIGHT);
1263 set_prop_margin_x_from_value (a_style, cur_term,
DIR_LEFT);
1266 cur_term = cur_term->
next;
1271 set_prop_margin_x_from_value (a_style, cur_term,
DIR_BOTTOM);
1274 cur_term = cur_term->
next;
1279 status = set_prop_margin_x_from_value (a_style, cur_term,
DIR_LEFT);
1285 set_prop_font_family_from_value (
CRStyle * a_style,
CRTerm * a_value)
1298 !strcmp (
"inherit", a_value->
content.
str->stryng->str))
1304 for (cur_term = a_value; cur_term; cur_term = cur_term->
next) {
1305 switch (cur_term->
type) {
1327 && !strcmp (cur_term->
content.
str->stryng->str,
1333 && !strcmp (cur_term->
content.
str->stryng->str,
1339 && !strcmp (cur_term->
content.
str->stryng->str,
1361 (guchar *) cur_term->
content.
str->stryng->str);
1372 font_family = cur_ff2;
1378 if (a_style->font_family) {
1380 a_style->font_family = NULL ;
1382 a_style->font_family = font_family;
1383 font_family = NULL ;
1390 init_style_font_size_field (
CRStyle * a_style)
1394 memset (&a_style->font_size, 0,
1410 set_prop_font_size_from_value (
CRStyle * a_style,
CRTerm * a_value)
1416 switch (a_value->
type) {
1421 && !strcmp (a_value->
content.
str->stryng->str,
1423 status = init_style_font_size_field (a_style);
1424 g_return_val_if_fail (status ==
CR_OK, status);
1426 a_style->font_size.sv.type =
1428 a_style->font_size.sv.value.predefined =
1434 && !strcmp (a_value->
content.
str->stryng->str,
1436 status = init_style_font_size_field (a_style);
1437 g_return_val_if_fail (status ==
CR_OK, status);
1439 a_style->font_size.sv.type =
1441 a_style->font_size.sv.value.predefined =
1446 && !strcmp (a_value->
content.
str->stryng->str,
1448 status = init_style_font_size_field (a_style);
1449 g_return_val_if_fail (status ==
CR_OK, status);
1451 a_style->font_size.sv.type =
1453 a_style->font_size.sv.value.predefined =
1458 && !strcmp (a_value->
content.
str->stryng->str,
"medium")) {
1459 status = init_style_font_size_field (a_style);
1460 g_return_val_if_fail (status ==
CR_OK, status);
1462 a_style->font_size.sv.type =
1464 a_style->font_size.sv.value.predefined =
1469 && !strcmp (a_value->
content.
str->stryng->str,
1471 status = init_style_font_size_field (a_style);
1472 g_return_val_if_fail (status ==
CR_OK, status);
1474 a_style->font_size.sv.type =
1476 a_style->font_size.sv.value.predefined =
1481 && !strcmp (a_value->
content.
str->stryng->str,
1483 status = init_style_font_size_field (a_style);
1484 g_return_val_if_fail (status ==
CR_OK, status);
1486 a_style->font_size.sv.type =
1488 a_style->font_size.sv.value.predefined =
1493 && !strcmp (a_value->
content.
str->stryng->str,
1495 status = init_style_font_size_field (a_style);
1496 g_return_val_if_fail (status ==
CR_OK, status);
1498 a_style->font_size.sv.type =
1500 a_style->font_size.sv.value.predefined =
1505 && !strcmp (a_value->
content.
str->stryng->str,
1507 status = init_style_font_size_field (a_style);
1508 g_return_val_if_fail (status ==
CR_OK, status);
1515 && !strcmp (a_value->
content.
str->stryng->str,
1517 status = init_style_font_size_field (a_style);
1518 g_return_val_if_fail (status ==
CR_OK, status);
1521 a_style->font_size.sv.value.relative =
1526 && !strcmp (a_value->
content.
str->stryng->str,
"inherit")) {
1527 status = init_style_font_size_field (a_style);
1528 g_return_val_if_fail (status ==
CR_OK, status);
1533 status = init_style_font_size_field (a_style);
1540 status = init_style_font_size_field (a_style);
1541 g_return_val_if_fail (status ==
CR_OK, status);
1544 cr_num_copy (&a_style->font_size.sv.value.absolute,
1550 status = init_style_font_size_field (a_style);
1557 set_prop_font_style_from_value (
CRStyle * a_style,
CRTerm * a_value)
1563 switch (a_value->
type) {
1568 if (!strcmp (a_value->
content.
str->stryng->str,
"normal")) {
1597 set_prop_font_weight_from_value (
CRStyle * a_style,
CRTerm * a_value)
1603 switch (a_value->
type) {
1608 if (!strcmp (a_value->
content.
str->stryng->str,
1611 }
else if (!strcmp (a_value->
content.
str->stryng->str,
1614 }
else if (!strcmp (a_value->
content.
str->stryng->str,
1617 }
else if (!strcmp (a_value->
content.
str->stryng->str,
1620 }
else if (!strcmp (a_value->
content.
str->stryng->str,
1666 set_prop_white_space_from_value (
CRStyle * a_style,
CRTerm * a_value)
1672 switch (a_value->
type) {
1675 if (!strcmp (a_value->
content.
str->stryng->str,
"normal")) {
1677 }
else if (!strcmp (a_value->
content.
str->stryng->str,
1680 }
else if (!strcmp (a_value->
content.
str->stryng->str,
1683 }
else if (!strcmp (a_value->
content.
str->stryng->str,
1716 result = g_try_malloc (
sizeof (
CRStyle));
1721 memset (result, 0,
sizeof (
CRStyle));
1722 gv_prop_hash_ref_count++;
1724 if (a_set_props_to_initial_values == TRUE) {
1797 255, 255, 255, FALSE);
1807 cr_rgb_set (&a_this->rgb_props[i].sv, 0, 0, 0,
1820 a_this->parent_style = NULL;
1824 a_this->font_family = NULL;
1831 a_this->inherited_props_resolved = FALSE ;
1891 cr_rgb_set (&a_this->rgb_props[i].sv, 0, 0, 0, FALSE);
1897 255, 255, 255, FALSE);
1902 cr_rgb_set (&a_this->rgb_props[i].sv, 0, 0, 0, FALSE);
1921 a_this->inherited_props_resolved = FALSE ;
1945 if (a_this->inherited_props_resolved == TRUE)
1949 if (a_this->num_props[i].sv.type ==
NUM_INHERIT) {
1951 &a_this->parent_style->num_props[i].cv);
1957 &a_this->rgb_props[i].cv,
1958 &a_this->parent_style->rgb_props[i].cv);
1963 a_this->border_style_props[i] =
1964 a_this->parent_style->border_style_props[i];
1969 a_this->display = a_this->parent_style->display;
1972 a_this->position = a_this->parent_style->position;
1975 a_this->float_type = a_this->parent_style->float_type;
1978 a_this->font_style = a_this->parent_style->font_style;
1981 a_this->font_variant = a_this->parent_style->font_variant;
1984 a_this->font_weight = a_this->parent_style->font_weight;
1987 a_this->font_stretch = a_this->parent_style->font_stretch;
1990 if (a_this->font_family == NULL) {
1991 a_this->font_family = a_this->parent_style->font_family;
1995 &a_this->parent_style->font_size.cv) ;
1997 a_this->inherited_props_resolved = TRUE ;
2019 g_return_val_if_fail (a_this && a_decl
2026 prop_id = cr_style_get_prop_id
2027 ((
const guchar *) a_decl->
property->stryng->str);
2029 value = a_decl->
value;
2032 status = set_prop_padding_x_from_value
2037 status = set_prop_padding_x_from_value
2041 status = set_prop_padding_x_from_value
2046 status = set_prop_padding_x_from_value
2051 status = set_prop_padding_from_value (a_this, value) ;
2055 status = set_prop_border_x_width_from_value (a_this, value,
2060 status = set_prop_border_x_width_from_value (a_this, value,
2065 status = set_prop_border_x_width_from_value (a_this, value,
2070 status = set_prop_border_x_width_from_value (a_this, value,
2075 status = set_prop_border_width_from_value (a_this, value) ;
2079 status = set_prop_border_x_style_from_value (a_this, value,
2084 status = set_prop_border_x_style_from_value (a_this, value,
2089 status = set_prop_border_x_style_from_value (a_this, value,
2094 status = set_prop_border_x_style_from_value (a_this, value,
2099 status = set_prop_border_style_from_value (a_this, value) ;
2103 status = set_prop_border_x_color_from_value (a_this, value,
2108 status = set_prop_border_x_color_from_value (a_this, value,
2113 status = set_prop_border_x_color_from_value (a_this, value,
2118 status = set_prop_border_x_color_from_value (a_this, value,
2123 status = set_prop_border_x_from_value (a_this, value,
2128 status = set_prop_border_x_from_value (a_this, value,
2133 status = set_prop_border_x_from_value (a_this, value,
2138 status = set_prop_border_x_from_value (a_this, value,
2143 status = set_prop_margin_x_from_value (a_this, value,
2148 status = set_prop_border_from_value (a_this, value);
2152 status = set_prop_margin_x_from_value (a_this, value,
2157 status = set_prop_margin_x_from_value (a_this, value,
2162 status = set_prop_margin_x_from_value (a_this, value,
2167 status = set_prop_margin_from_value (a_this, value);
2171 status = set_prop_display_from_value (a_this, value);
2175 status = set_prop_position_from_value (a_this, value);
2179 status = set_prop_x_from_value (a_this, value,
DIR_TOP);
2183 status = set_prop_x_from_value (a_this, value,
DIR_RIGHT);
2187 status = set_prop_x_from_value (a_this, value,
DIR_BOTTOM);
2191 status = set_prop_x_from_value (a_this, value,
DIR_LEFT);
2195 status = set_prop_float (a_this, value);
2199 status = set_prop_width (a_this, value);
2203 status = set_prop_color (a_this, value);
2207 status = set_prop_background_color (a_this, value);
2211 status = set_prop_font_family_from_value (a_this, value);
2215 status = set_prop_font_size_from_value (a_this, value);
2219 status = set_prop_font_style_from_value (a_this, value);
2223 status = set_prop_font_weight_from_value (a_this, value);
2227 status = set_prop_white_space_from_value(a_this, value);
2250 a_this->ref_count++;
2266 g_return_val_if_fail (a_this, FALSE);
2268 if (a_this->ref_count)
2269 a_this->ref_count--;
2271 if (!a_this->ref_count) {
2291 g_return_val_if_fail (a_this, NULL);
2316 memcpy (a_dest, a_src,
sizeof (
CRStyle));
2329 GString * a_str, guint a_nb_indent)
2332 guchar *tmp_str = NULL;
2333 GString *str = NULL;
2337 str = g_string_new (NULL);
2339 g_string_append (str,
"NumPropVal {");
2345 g_string_append_printf (str,
"sv: %s ", tmp_str);
2354 g_string_append_printf (str,
"cv: %s ", tmp_str);
2363 g_string_append_printf (str,
"av: %s ", tmp_str);
2366 g_string_append (str,
"}");
2367 g_string_append (a_str, str->str);
2376 g_string_free (str, TRUE);
2383 GString * a_str, guint a_nb_indent)
2386 guchar *tmp_str = NULL;
2387 GString *str = NULL;
2391 str = g_string_new (NULL);
2394 g_string_append (str,
"RGBPropVal {");
2400 g_string_append_printf (str,
"sv: %s ", tmp_str);
2408 g_string_append_printf (str,
"cv: %s ", tmp_str);
2416 g_string_append_printf (str,
"av: %s ", tmp_str);
2420 g_string_append (str,
"}");
2421 g_string_append (a_str, str->str);
2430 g_string_free (str, TRUE);
2437 GString * a_str, guint a_nb_indent)
2445 str = (gchar *)
"border-style-none";
2448 str = (gchar *)
"border-style-hidden";
2451 str = (gchar *)
"border-style-dotted";
2454 str = (gchar *)
"border-style-dashed";
2457 str = (gchar *)
"border-style-solid";
2460 str = (gchar *)
"border-style-double";
2463 str = (gchar *)
"border-style-groove";
2466 str = (gchar *)
"border-style-ridge";
2469 str = (gchar *)
"border-style-inset";
2472 str = (gchar *)
"border-style-outset";
2475 str = (gchar *)
"unknown border style";
2479 g_string_append (a_str, str);
2485 GString * a_str, guint a_nb_indent)
2493 str = (gchar *)
"display-none";
2496 str = (gchar *)
"display-inline";
2499 str = (gchar *)
"display-block";
2502 str = (gchar *)
"display-list-item";
2505 str = (gchar *)
"display-run-in";
2508 str = (gchar *)
"display-compact";
2511 str = (gchar *)
"display-marker";
2514 str = (gchar *)
"display-table";
2517 str = (gchar *)
"display-inline-table";
2520 str = (gchar *)
"display-table-row-group";
2523 str = (gchar *)
"display-table-header-group";
2526 str = (gchar *)
"display-table-footer-group";
2529 str = (gchar *)
"display-table-row";
2532 str = (gchar *)
"display-table-column-group";
2535 str = (gchar *)
"display-table-column";
2538 str = (gchar *)
"display-table-cell";
2541 str = (gchar *)
"display-table-caption";
2544 str = (gchar *)
"display-inherit";
2547 str = (gchar *)
"unknown display property";
2551 g_string_append (a_str, str);
2558 GString * a_str, guint a_nb_indent)
2566 str = (gchar *)
"position-static";
2569 str = (gchar *)
"position-relative";
2572 str = (gchar *)
"position-absolute";
2575 str = (gchar *)
"position-fixed";
2578 str = (gchar *)
"position-inherit";
2581 str = (gchar *)
"unknown static property";
2584 g_string_append (a_str, str);
2590 GString * a_str, guint a_nb_indent)
2598 str = (gchar *)
"float-none";
2601 str = (gchar *)
"float-left";
2604 str = (gchar *)
"float-right";
2607 str = (gchar *)
"float-inherit";
2610 str = (gchar *)
"unknown float property value";
2614 g_string_append (a_str, str);
2620 GString * a_str, guint a_nb_indent)
2628 str = (gchar *)
"normal";
2631 str = (gchar *)
"pre";
2634 str = (gchar *)
"nowrap";
2637 str = (gchar *)
"inherited";
2640 str = (gchar *)
"unknown white space property value";
2644 g_string_append (a_str, str);
2661 const gint INTERNAL_INDENT = 2;
2662 gint indent = a_nb_indent + INTERNAL_INDENT;
2663 gchar *tmp_str = NULL;
2664 GString *str = NULL;
2670 str = g_string_new (NULL);
2675 g_string_append (str,
"style {\n");
2685 tmp_str = (gchar *) num_prop_code_to_string (i);
2687 g_string_append_printf (str,
"%s: ", tmp_str);
2689 g_string_append (str,
"NULL");
2695 g_string_append (str,
"\n");
2699 tmp_str = (gchar *) rgb_prop_code_to_string (i);
2702 g_string_append_printf (str,
"%s: ", tmp_str);
2704 g_string_append (str,
"NULL: ");
2710 g_string_append (str,
"\n");
2714 tmp_str = (gchar *) border_style_prop_code_to_string (i);
2717 g_string_append_printf (str,
"%s: ", tmp_str);
2719 g_string_append (str,
"NULL: ");
2723 border_style_props[i], str,
2725 g_string_append (str,
"\n");
2728 g_string_append (str,
"display: ");
2730 g_string_append (str,
"\n");
2733 g_string_append (str,
"position: ");
2735 g_string_append (str,
"\n");
2738 g_string_append (str,
"float-type: ");
2740 g_string_append (str,
"\n");
2743 g_string_append (str,
"white-space: ");
2745 g_string_append (str,
"\n");
2748 g_string_append (str,
"font-family: ");
2751 g_string_append (str, tmp_str);
2755 g_string_append (str,
"NULL");
2757 g_string_append (str,
"\n");
2762 g_string_append_printf (str,
"font-size {sv:%s, ",
2765 g_string_append (str,
"font-size {sv:NULL, ");
2769 g_string_append_printf (str,
"cv:%s, ", tmp_str);
2771 g_string_append (str,
"cv:NULL, ");
2775 g_string_append_printf (str,
"av:%s}", tmp_str);
2777 g_string_append (str,
"av:NULL}");
2781 g_string_append (str,
"\n");
2786 g_string_append_printf (str,
"font-size-adjust: %s", tmp_str);
2788 g_string_append (str,
"font-size-adjust: NULL");
2791 g_string_append (str,
"\n");
2796 g_string_append_printf (str,
"font-style: %s", tmp_str);
2798 g_string_append (str,
"font-style: NULL");
2801 g_string_append (str,
"\n");
2806 g_string_append_printf (str,
"font-variant: %s", tmp_str);
2808 g_string_append (str,
"font-variant: NULL");
2811 g_string_append (str,
"\n");
2816 g_string_append_printf (str,
"font-weight: %s", tmp_str);
2818 g_string_append (str,
"font-weight: NULL");
2821 g_string_append (str,
"\n");
2826 g_string_append_printf (str,
"font-stretch: %s", tmp_str);
2828 g_string_append (str,
"font-stretch: NULL");
2831 g_string_append (str,
"\n");
2835 g_string_append (str,
"}");
2847 g_return_if_fail (a_this);