mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-21 14:49:16 +02:00
Bug 559706 - interface prequisites
svn path=/trunk/; revision=932
This commit is contained in:
parent
c10269cf2d
commit
7916f49e55
7
gdump.c
7
gdump.c
@ -186,7 +186,12 @@ dump_interface_type (GType type, const char *symbol, GOutputStream *out)
|
|||||||
for (i = 0; i < n_interfaces; i++)
|
for (i = 0; i < n_interfaces; i++)
|
||||||
{
|
{
|
||||||
GType itype = interfaces[i];
|
GType itype = interfaces[i];
|
||||||
escaped_printf (out, " <extends>%s</extends>\n",
|
if (itype == G_TYPE_OBJECT)
|
||||||
|
{
|
||||||
|
/* This is implicit */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
escaped_printf (out, " <prerequisite name=\"%s\"/>\n",
|
||||||
g_type_name (itype));
|
g_type_name (itype));
|
||||||
}
|
}
|
||||||
dump_properties (type, out);
|
dump_properties (type, out);
|
||||||
|
51
girparser.c
51
girparser.c
@ -54,7 +54,7 @@ typedef enum
|
|||||||
STATE_INTERFACE_PROPERTY, /* 15 */
|
STATE_INTERFACE_PROPERTY, /* 15 */
|
||||||
STATE_INTERFACE_FIELD,
|
STATE_INTERFACE_FIELD,
|
||||||
STATE_IMPLEMENTS,
|
STATE_IMPLEMENTS,
|
||||||
STATE_REQUIRES,
|
STATE_PREREQUISITE,
|
||||||
STATE_BOXED,
|
STATE_BOXED,
|
||||||
STATE_BOXED_FIELD, /* 20 */
|
STATE_BOXED_FIELD, /* 20 */
|
||||||
STATE_STRUCT,
|
STATE_STRUCT,
|
||||||
@ -2338,25 +2338,6 @@ start_element_handler (GMarkupParseContext *context,
|
|||||||
attribute_names, attribute_values,
|
attribute_names, attribute_values,
|
||||||
ctx, error))
|
ctx, error))
|
||||||
goto out;
|
goto out;
|
||||||
else if (strcmp (element_name, "class") == 0 &&
|
|
||||||
ctx->state == STATE_REQUIRES)
|
|
||||||
{
|
|
||||||
const gchar *name;
|
|
||||||
|
|
||||||
name = find_attribute ("name", attribute_names, attribute_values);
|
|
||||||
|
|
||||||
if (name == NULL)
|
|
||||||
MISSING_ATTRIBUTE (context, error, element_name, "name");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GIrNodeInterface *iface;
|
|
||||||
|
|
||||||
iface = (GIrNodeInterface *)ctx->current_node;
|
|
||||||
iface ->prerequisites = g_list_append (iface->prerequisites, g_strdup (name));
|
|
||||||
}
|
|
||||||
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
@ -2522,7 +2503,26 @@ start_element_handler (GMarkupParseContext *context,
|
|||||||
attribute_names, attribute_values,
|
attribute_names, attribute_values,
|
||||||
ctx, error))
|
ctx, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
else if (strcmp (element_name, "prerequisite") == 0 &&
|
||||||
|
ctx->state == STATE_INTERFACE)
|
||||||
|
{
|
||||||
|
const gchar *name;
|
||||||
|
|
||||||
|
name = find_attribute ("name", attribute_names, attribute_values);
|
||||||
|
|
||||||
|
state_switch (ctx, STATE_PREREQUISITE);
|
||||||
|
|
||||||
|
if (name == NULL)
|
||||||
|
MISSING_ATTRIBUTE (context, error, element_name, "name");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GIrNodeInterface *iface;
|
||||||
|
|
||||||
|
iface = (GIrNodeInterface *)ctx->current_node;
|
||||||
|
iface ->prerequisites = g_list_append (iface->prerequisites, g_strdup (name));
|
||||||
|
}
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
@ -2549,13 +2549,6 @@ start_element_handler (GMarkupParseContext *context,
|
|||||||
attribute_names, attribute_values,
|
attribute_names, attribute_values,
|
||||||
ctx, error))
|
ctx, error))
|
||||||
goto out;
|
goto out;
|
||||||
else if (strcmp (element_name, "requires") == 0 &&
|
|
||||||
ctx->state == STATE_INTERFACE)
|
|
||||||
{
|
|
||||||
state_switch (ctx, STATE_REQUIRES);
|
|
||||||
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
else if (start_struct (context, element_name,
|
else if (start_struct (context, element_name,
|
||||||
attribute_names, attribute_values,
|
attribute_names, attribute_values,
|
||||||
ctx, error))
|
ctx, error))
|
||||||
@ -2893,8 +2886,8 @@ end_element_handler (GMarkupParseContext *context,
|
|||||||
if (require_end_element (context, ctx, "implements", element_name, error))
|
if (require_end_element (context, ctx, "implements", element_name, error))
|
||||||
state_switch (ctx, STATE_CLASS);
|
state_switch (ctx, STATE_CLASS);
|
||||||
break;
|
break;
|
||||||
case STATE_REQUIRES:
|
case STATE_PREREQUISITE:
|
||||||
if (require_end_element (context, ctx, "requires", element_name, error))
|
if (require_end_element (context, ctx, "prerequisite", element_name, error))
|
||||||
state_switch (ctx, STATE_INTERFACE);
|
state_switch (ctx, STATE_INTERFACE);
|
||||||
break;
|
break;
|
||||||
case STATE_NAMESPACE_CONSTANT:
|
case STATE_NAMESPACE_CONSTANT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user