mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 00:48:53 +02:00
gobject-query: Use proper Unicode tree drawing characters
This makes the output a lot nicer to read: ``` │ ├void │ ├GInterface │ │ │ └GTypePlugin │ ├gchar ⋮ ``` rather than ``` | `void | `GInterface | `GTypePlugin | `gchar ⋮ ``` It includes a change to correctly use vertical tees at the top level by correctly setting the sibling node rather than always setting it to zero. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
@@ -34,9 +34,9 @@ static gboolean recursion = TRUE;
|
|||||||
|
|
||||||
#define O_SPACE " "
|
#define O_SPACE " "
|
||||||
#define O_ESPACE ""
|
#define O_ESPACE ""
|
||||||
#define O_BRANCH "+"
|
#define O_BRANCH "├"
|
||||||
#define O_VLINE "|"
|
#define O_VLINE "│"
|
||||||
#define O_LLEAF "`"
|
#define O_LLEAF "└"
|
||||||
#define O_KEY_FILL "_"
|
#define O_KEY_FILL "_"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -204,9 +204,13 @@ main (gint argc,
|
|||||||
for (i = 0; i <= G_TYPE_FUNDAMENTAL_MAX; i += G_TYPE_MAKE_FUNDAMENTAL (1))
|
for (i = 0; i <= G_TYPE_FUNDAMENTAL_MAX; i += G_TYPE_MAKE_FUNDAMENTAL (1))
|
||||||
{
|
{
|
||||||
const gchar *name = g_type_name (i);
|
const gchar *name = g_type_name (i);
|
||||||
|
GType sibling = i + G_TYPE_MAKE_FUNDAMENTAL (1);
|
||||||
|
|
||||||
|
if (sibling > G_TYPE_FUNDAMENTAL_MAX || g_type_name (sibling) == NULL)
|
||||||
|
sibling = 0;
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
show_nodes (i, 0, iindent);
|
show_nodes (i, sibling, iindent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user