24
24
#include <glib-object.h>
25
25
#include <gio/gio.h>
27
/* This file is both compiled into libgirepository.so, and installed
28
* on the filesystem. But for the dumper, we want to avoid linking
29
* to libgirepository; see
30
* https://bugzilla.gnome.org/show_bug.cgi?id=630342
32
#ifdef G_IREPOSITORY_COMPILATION
27
34
#include "girepository.h"
30
37
#include <string.h>
160
176
gboolean first = TRUE;
178
parent = g_type_parent (type);
163
179
parent_str = g_string_new ("");
180
while (parent != G_TYPE_OBJECT && parent != G_TYPE_INVALID)
166
parent = g_type_parent (parent);
170
185
g_string_append_c (parent_str, ',');
171
186
g_string_append (parent_str, g_type_name (parent));
172
} while (parent != G_TYPE_OBJECT && parent != G_TYPE_INVALID);
187
parent = g_type_parent (parent);
174
190
escaped_printf (out, " parents=\"%s\"", parent_str->str);
290
dump_fundamental_type (GType type, const char *symbol, GOutputStream *out)
297
gboolean first = TRUE;
300
escaped_printf (out, " <fundamental name=\"%s\" get-type=\"%s\"",
301
g_type_name (type), symbol);
303
if (G_TYPE_IS_ABSTRACT (type))
304
escaped_printf (out, " abstract=\"1\"");
306
if (G_TYPE_IS_INSTANTIATABLE (type))
307
escaped_printf (out, " instantiatable=\"1\"");
309
parent = g_type_parent (type);
310
parent_str = g_string_new ("");
311
while (parent != G_TYPE_INVALID)
316
g_string_append_c (parent_str, ',');
317
if (!g_type_name (parent))
319
g_string_append (parent_str, g_type_name (parent));
320
parent = g_type_parent (parent);
323
if (parent_str->len > 0)
324
escaped_printf (out, " parents=\"%s\"", parent_str->str);
325
g_string_free (parent_str, TRUE);
327
goutput_write (out, ">\n");
329
interfaces = g_type_interfaces (type, &n_interfaces);
330
for (i = 0; i < n_interfaces; i++)
332
GType itype = interfaces[i];
333
escaped_printf (out, " <implements name=\"%s\"/>\n",
334
g_type_name (itype));
336
goutput_write (out, " </fundamental>\n");
274
340
dump_type (GType type, const char *symbol, GOutputStream *out)
276
342
switch (g_type_fundamental (type))
294
360
/* GValue, etc. Just skip them. */
297
/* Other fundamental types such as the once GStreamer and Clutter registers
298
* are not yet interesting from an introspection perspective and should be
363
dump_fundamental_type (type, symbol, out);
318
381
* Returns: %TRUE on success, %FALSE on error
383
#ifndef G_IREPOSITORY_COMPILATION
385
dump_irepository (const char *arg, GError **error)
321
388
g_irepository_dump (const char *arg, GError **error)
323
391
GHashTable *output_types;