Formatting fixes
This commit is contained in:
@ -575,7 +575,8 @@ gtk_builder_get_internal_child (GtkBuilder *builder,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
object_set_name (GObject *object, const gchar *name)
|
object_set_name (GObject *object,
|
||||||
|
const gchar *name)
|
||||||
{
|
{
|
||||||
if (GTK_IS_BUILDABLE (object))
|
if (GTK_IS_BUILDABLE (object))
|
||||||
gtk_buildable_set_name (GTK_BUILDABLE (object), name);
|
gtk_buildable_set_name (GTK_BUILDABLE (object), name);
|
||||||
@ -915,7 +916,8 @@ gtk_builder_apply_delayed_properties (GtkBuilder *builder)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
free_binding_info (gpointer data, gpointer user)
|
free_binding_info (gpointer data,
|
||||||
|
gpointer user)
|
||||||
{
|
{
|
||||||
BindingInfo *info = data;
|
BindingInfo *info = data;
|
||||||
|
|
||||||
@ -2319,7 +2321,8 @@ _gtk_builder_get_resource_path (GtkBuilder *builder, const gchar *string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
_gtk_builder_get_absolute_filename (GtkBuilder *builder, const gchar *string)
|
_gtk_builder_get_absolute_filename (GtkBuilder *builder,
|
||||||
|
const gchar *string)
|
||||||
{
|
{
|
||||||
gchar *filename;
|
gchar *filename;
|
||||||
gchar *dirname = NULL;
|
gchar *dirname = NULL;
|
||||||
|
|||||||
@ -70,18 +70,15 @@ error_missing_attribute (ParserData *data,
|
|||||||
const gchar *attribute,
|
const gchar *attribute,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gint line_number, char_number;
|
gint line, col;
|
||||||
|
|
||||||
g_markup_parse_context_get_position (data->ctx,
|
g_markup_parse_context_get_position (data->ctx, &line, &col);
|
||||||
&line_number,
|
|
||||||
&char_number);
|
|
||||||
|
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
GTK_BUILDER_ERROR,
|
GTK_BUILDER_ERROR,
|
||||||
GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
|
GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
|
||||||
"%s:%d:%d <%s> requires attribute \"%s\"",
|
"%s:%d:%d <%s> requires attribute \"%s\"",
|
||||||
data->filename,
|
data->filename, line, col, tag, attribute);
|
||||||
line_number, char_number, tag, attribute);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -90,18 +87,15 @@ error_invalid_attribute (ParserData *data,
|
|||||||
const gchar *attribute,
|
const gchar *attribute,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gint line_number, char_number;
|
gint line, col;
|
||||||
|
|
||||||
g_markup_parse_context_get_position (data->ctx,
|
g_markup_parse_context_get_position (data->ctx, &line, &col);
|
||||||
&line_number,
|
|
||||||
&char_number);
|
|
||||||
|
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
GTK_BUILDER_ERROR,
|
GTK_BUILDER_ERROR,
|
||||||
GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
|
GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
|
||||||
"%s:%d:%d '%s' is not a valid attribute of <%s>",
|
"%s:%d:%d '%s' is not a valid attribute of <%s>",
|
||||||
data->filename,
|
data->filename, line, col, attribute, tag);
|
||||||
line_number, char_number, attribute, tag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -110,26 +104,22 @@ error_invalid_tag (ParserData *data,
|
|||||||
const gchar *expected,
|
const gchar *expected,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gint line_number, char_number;
|
gint line, col;
|
||||||
|
|
||||||
g_markup_parse_context_get_position (data->ctx,
|
g_markup_parse_context_get_position (data->ctx, &line, &col);
|
||||||
&line_number,
|
|
||||||
&char_number);
|
|
||||||
|
|
||||||
if (expected)
|
if (expected)
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
GTK_BUILDER_ERROR,
|
GTK_BUILDER_ERROR,
|
||||||
GTK_BUILDER_ERROR_INVALID_TAG,
|
GTK_BUILDER_ERROR_INVALID_TAG,
|
||||||
"%s:%d:%d '%s' is not a valid tag here, expected a '%s' tag",
|
"%s:%d:%d '%s' is not a valid tag here, expected a '%s' tag",
|
||||||
data->filename,
|
data->filename, line, col, tag, expected);
|
||||||
line_number, char_number, tag, expected);
|
|
||||||
else
|
else
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
GTK_BUILDER_ERROR,
|
GTK_BUILDER_ERROR,
|
||||||
GTK_BUILDER_ERROR_INVALID_TAG,
|
GTK_BUILDER_ERROR_INVALID_TAG,
|
||||||
"%s:%d:%d '%s' is not a valid tag here",
|
"%s:%d:%d '%s' is not a valid tag here",
|
||||||
data->filename,
|
data->filename, line, col, tag);
|
||||||
line_number, char_number, tag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -1076,9 +1066,10 @@ start_element (GMarkupParseContext *context,
|
|||||||
data->last_element = element_name;
|
data->last_element = element_name;
|
||||||
|
|
||||||
if (data->subparser)
|
if (data->subparser)
|
||||||
if (!subparser_start (context, element_name, names, values,
|
{
|
||||||
data, error))
|
if (!subparser_start (context, element_name, names, values, data, error))
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp (element_name, "requires") == 0)
|
if (strcmp (element_name, "requires") == 0)
|
||||||
parse_requires (data, element_name, names, values, error);
|
parse_requires (data, element_name, names, values, error);
|
||||||
@ -1089,7 +1080,6 @@ start_element (GMarkupParseContext *context,
|
|||||||
else if (data->requested_objects && !data->inside_requested_object)
|
else if (data->requested_objects && !data->inside_requested_object)
|
||||||
{
|
{
|
||||||
/* If outside a requested object, simply ignore this tag */
|
/* If outside a requested object, simply ignore this tag */
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (strcmp (element_name, "child") == 0)
|
else if (strcmp (element_name, "child") == 0)
|
||||||
parse_child (data, element_name, names, values, error);
|
parse_child (data, element_name, names, values, error);
|
||||||
@ -1107,13 +1097,11 @@ start_element (GMarkupParseContext *context,
|
|||||||
* if clause to avoid an error below.
|
* if clause to avoid an error below.
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else
|
else if (!parse_custom (context, element_name, names, values, data, error))
|
||||||
if (!parse_custom (context, element_name, names, values,
|
g_set_error (error,
|
||||||
data, error))
|
GTK_BUILDER_ERROR,
|
||||||
g_set_error (error, GTK_BUILDER_ERROR,
|
|
||||||
GTK_BUILDER_ERROR_UNHANDLED_TAG,
|
GTK_BUILDER_ERROR_UNHANDLED_TAG,
|
||||||
_("Unhandled tag: <%s>"),
|
_("Unhandled tag: <%s>"), element_name);
|
||||||
element_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const gchar *
|
const gchar *
|
||||||
@ -1131,7 +1119,6 @@ _gtk_builder_parser_translate (const gchar *domain,
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called for close tags </foo> */
|
|
||||||
static void
|
static void
|
||||||
end_element (GMarkupParseContext *context,
|
end_element (GMarkupParseContext *context,
|
||||||
const gchar *element_name,
|
const gchar *element_name,
|
||||||
@ -1175,7 +1162,6 @@ end_element (GMarkupParseContext *context,
|
|||||||
else if (data->requested_objects && !data->inside_requested_object)
|
else if (data->requested_objects && !data->inside_requested_object)
|
||||||
{
|
{
|
||||||
/* If outside a requested object, simply ignore this tag */
|
/* If outside a requested object, simply ignore this tag */
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (strcmp (element_name, "menu") == 0)
|
else if (strcmp (element_name, "menu") == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user