for (i = 0; i < G_N_ELEMENTS (names); i++)
{ if (gtk_css_parser_try_ident (parser, names[i].name))
{ if (names[i].horizontal)
x = gtk_css_number_value_new (names[i].percentage, GTK_CSS_PERCENT); else
y = gtk_css_number_value_new (names[i].percentage, GTK_CSS_PERCENT);
swap = names[i].swap; break;
}
} if (i == G_N_ELEMENTS (names))
{ if (gtk_css_number_value_can_parse (parser))
{
x = gtk_css_number_value_parse (parser,
GTK_CSS_PARSE_PERCENT
| GTK_CSS_PARSE_LENGTH);
if (x == NULL) return NULL;
} else
{ if (!try)
gtk_css_parser_error_syntax (parser, "Unrecognized position value"); return NULL;
}
}
for (i = 0; i < G_N_ELEMENTS (names); i++)
{ if (!swap && !names[i].swap)
{ if (names[i].horizontal && x != NULL) continue; if (!names[i].horizontal && y != NULL) continue;
}
if (gtk_css_parser_try_ident (parser, names[i].name))
{ if (x)
{ if (names[i].horizontal && !names[i].swap)
{
y = x;
x = gtk_css_number_value_new (names[i].percentage, GTK_CSS_PERCENT);
} else
{
y = gtk_css_number_value_new (names[i].percentage, GTK_CSS_PERCENT);
}
} else
{
g_assert (names[i].horizontal || names[i].swap);
x = gtk_css_number_value_new (names[i].percentage, GTK_CSS_PERCENT);
} break;
}
}
if (i == G_N_ELEMENTS (names))
{ if (gtk_css_number_value_can_parse (parser))
{ if (y != NULL)
{ if (!try)
gtk_css_parser_error_syntax (parser, "Invalid combination of values");
gtk_css_value_unref (y); return NULL;
}
y = gtk_css_number_value_parse (parser,
GTK_CSS_PARSE_PERCENT
| GTK_CSS_PARSE_LENGTH); if (y == NULL)
{
gtk_css_value_unref (x); return NULL;
}
} else
{ if (y)
x = gtk_css_number_value_new (50, GTK_CSS_PERCENT); else
y = gtk_css_number_value_new (50, GTK_CSS_PERCENT);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.