forked from AuroraMiddleware/gtk
Formatting fixes
This commit is contained in:
parent
7a55961ce7
commit
d99c3e0332
@ -1388,7 +1388,7 @@ typedef struct {
|
|||||||
|
|
||||||
static PangoAttribute *
|
static PangoAttribute *
|
||||||
attribute_from_text (GtkBuilder *builder,
|
attribute_from_text (GtkBuilder *builder,
|
||||||
const gchar *name,
|
const gchar *name,
|
||||||
const gchar *value,
|
const gchar *value,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
@ -1444,7 +1444,7 @@ attribute_from_text (GtkBuilder *builder,
|
|||||||
attribute = pango_attr_underline_new (g_value_get_boolean (&val));
|
attribute = pango_attr_underline_new (g_value_get_boolean (&val));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PANGO_ATTR_STRIKETHROUGH:
|
case PANGO_ATTR_STRIKETHROUGH:
|
||||||
if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error))
|
if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error))
|
||||||
attribute = pango_attr_strikethrough_new (g_value_get_boolean (&val));
|
attribute = pango_attr_strikethrough_new (g_value_get_boolean (&val));
|
||||||
break;
|
break;
|
||||||
@ -1453,28 +1453,25 @@ attribute_from_text (GtkBuilder *builder,
|
|||||||
attribute = pango_attr_gravity_new (g_value_get_enum (&val));
|
attribute = pango_attr_gravity_new (g_value_get_enum (&val));
|
||||||
break;
|
break;
|
||||||
case PANGO_ATTR_GRAVITY_HINT:
|
case PANGO_ATTR_GRAVITY_HINT:
|
||||||
if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_GRAVITY_HINT,
|
if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_GRAVITY_HINT, value, &val, error))
|
||||||
value, &val, error))
|
|
||||||
attribute = pango_attr_gravity_hint_new (g_value_get_enum (&val));
|
attribute = pango_attr_gravity_hint_new (g_value_get_enum (&val));
|
||||||
break;
|
break;
|
||||||
/* PangoAttrString */
|
/* PangoAttrString */
|
||||||
case PANGO_ATTR_FAMILY:
|
case PANGO_ATTR_FAMILY:
|
||||||
attribute = pango_attr_family_new (value);
|
attribute = pango_attr_family_new (value);
|
||||||
g_value_init (&val, G_TYPE_INT);
|
g_value_init (&val, G_TYPE_INT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* PangoAttrSize */
|
/* PangoAttrSize */
|
||||||
case PANGO_ATTR_SIZE:
|
case PANGO_ATTR_SIZE:
|
||||||
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT,
|
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
|
||||||
value, &val, error))
|
|
||||||
attribute = pango_attr_size_new (g_value_get_int (&val));
|
attribute = pango_attr_size_new (g_value_get_int (&val));
|
||||||
break;
|
break;
|
||||||
case PANGO_ATTR_ABSOLUTE_SIZE:
|
case PANGO_ATTR_ABSOLUTE_SIZE:
|
||||||
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT,
|
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
|
||||||
value, &val, error))
|
|
||||||
attribute = pango_attr_size_new_absolute (g_value_get_int (&val));
|
attribute = pango_attr_size_new_absolute (g_value_get_int (&val));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* PangoAttrFontDesc */
|
/* PangoAttrFontDesc */
|
||||||
case PANGO_ATTR_FONT_DESC:
|
case PANGO_ATTR_FONT_DESC:
|
||||||
if ((font_desc = pango_font_description_from_string (value)))
|
if ((font_desc = pango_font_description_from_string (value)))
|
||||||
@ -1489,32 +1486,28 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|||||||
|
|
||||||
/* PangoAttrColor */
|
/* PangoAttrColor */
|
||||||
case PANGO_ATTR_FOREGROUND:
|
case PANGO_ATTR_FOREGROUND:
|
||||||
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR,
|
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR, value, &val, error))
|
||||||
value, &val, error))
|
|
||||||
{
|
{
|
||||||
color = g_value_get_boxed (&val);
|
color = g_value_get_boxed (&val);
|
||||||
attribute = pango_attr_foreground_new (color->red, color->green, color->blue);
|
attribute = pango_attr_foreground_new (color->red, color->green, color->blue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PANGO_ATTR_BACKGROUND:
|
case PANGO_ATTR_BACKGROUND:
|
||||||
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR,
|
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR, value, &val, error))
|
||||||
value, &val, error))
|
|
||||||
{
|
{
|
||||||
color = g_value_get_boxed (&val);
|
color = g_value_get_boxed (&val);
|
||||||
attribute = pango_attr_background_new (color->red, color->green, color->blue);
|
attribute = pango_attr_background_new (color->red, color->green, color->blue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PANGO_ATTR_UNDERLINE_COLOR:
|
case PANGO_ATTR_UNDERLINE_COLOR:
|
||||||
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR,
|
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR, value, &val, error))
|
||||||
value, &val, error))
|
|
||||||
{
|
{
|
||||||
color = g_value_get_boxed (&val);
|
color = g_value_get_boxed (&val);
|
||||||
attribute = pango_attr_underline_color_new (color->red, color->green, color->blue);
|
attribute = pango_attr_underline_color_new (color->red, color->green, color->blue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PANGO_ATTR_STRIKETHROUGH_COLOR:
|
case PANGO_ATTR_STRIKETHROUGH_COLOR:
|
||||||
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR,
|
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_COLOR, value, &val, error))
|
||||||
value, &val, error))
|
|
||||||
{
|
{
|
||||||
color = g_value_get_boxed (&val);
|
color = g_value_get_boxed (&val);
|
||||||
attribute = pango_attr_strikethrough_color_new (color->red, color->green, color->blue);
|
attribute = pango_attr_strikethrough_color_new (color->red, color->green, color->blue);
|
||||||
@ -1522,15 +1515,14 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
/* PangoAttrShape */
|
/* PangoAttrShape */
|
||||||
case PANGO_ATTR_SHAPE:
|
case PANGO_ATTR_SHAPE:
|
||||||
/* Unsupported for now */
|
/* Unsupported for now */
|
||||||
break;
|
break;
|
||||||
/* PangoAttrFloat */
|
/* PangoAttrFloat */
|
||||||
case PANGO_ATTR_SCALE:
|
case PANGO_ATTR_SCALE:
|
||||||
if (gtk_builder_value_from_string_type (builder, G_TYPE_DOUBLE,
|
if (gtk_builder_value_from_string_type (builder, G_TYPE_DOUBLE, value, &val, error))
|
||||||
value, &val, error))
|
|
||||||
attribute = pango_attr_scale_new (g_value_get_double (&val));
|
attribute = pango_attr_scale_new (g_value_get_double (&val));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1585,8 +1577,7 @@ pango_start_element (GMarkupParseContext *context,
|
|||||||
|
|
||||||
if (start)
|
if (start)
|
||||||
{
|
{
|
||||||
if (!gtk_builder_value_from_string_type (data->builder, G_TYPE_UINT,
|
if (!gtk_builder_value_from_string_type (data->builder, G_TYPE_UINT, start, &val, error))
|
||||||
start, &val, error))
|
|
||||||
{
|
{
|
||||||
_gtk_builder_prefix_error (data->builder, context, error);
|
_gtk_builder_prefix_error (data->builder, context, error);
|
||||||
return;
|
return;
|
||||||
@ -1597,8 +1588,7 @@ pango_start_element (GMarkupParseContext *context,
|
|||||||
|
|
||||||
if (end)
|
if (end)
|
||||||
{
|
{
|
||||||
if (!gtk_builder_value_from_string_type (data->builder, G_TYPE_UINT,
|
if (!gtk_builder_value_from_string_type (data->builder, G_TYPE_UINT, end, &val, error))
|
||||||
end, &val, error))
|
|
||||||
{
|
{
|
||||||
_gtk_builder_prefix_error (data->builder, context, error);
|
_gtk_builder_prefix_error (data->builder, context, error);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user