From a3562b0d2aa84f06b11f48bea4b8a55862e330a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 15 May 2020 10:38:30 +0300 Subject: [PATCH] docs: Add list of interfaces implemented by elements to the docs Part-of: --- docs/gst-hotdoc-plugins-scanner.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/gst-hotdoc-plugins-scanner.c b/docs/gst-hotdoc-plugins-scanner.c index 9a3db0ae54..37ffb0cb07 100644 --- a/docs/gst-hotdoc-plugins-scanner.c +++ b/docs/gst-hotdoc-plugins-scanner.c @@ -708,6 +708,9 @@ static void _add_object_details (GString * json, GObject * object) { GType type; + GType *interfaces; + guint n_interfaces; + g_string_append (json, "\"hierarchy\": ["); for (type = G_OBJECT_TYPE (object);; type = g_type_parent (type)) { @@ -718,6 +721,21 @@ _add_object_details (GString * json, GObject * object) break; } g_string_append (json, "]"); + + interfaces = g_type_interfaces (G_OBJECT_TYPE (object), &n_interfaces); + if (n_interfaces) { + GType *iface; + + g_string_append (json, ",\"interfaces\": ["); + for (iface = interfaces; *iface; iface++, n_interfaces--) { + g_string_append_printf (json, "\"%s\"%c", g_type_name (*iface), + n_interfaces > 1 ? ',' : ' '); + } + + g_string_append (json, "]"); + g_free (interfaces); + } + _add_properties (json, object, G_OBJECT_GET_CLASS (object)); _add_signals (json, object);