| 1 | /* |
| 2 | * Copyright © 2019 Zander Brown |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ |
| 17 | |
| 18 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 19 | #include <glib/gi18n-lib.h> |
| 20 | |
| 21 | #include "type-info.h"cxx . . $ `<file>/gtk/inspector/type-info.h`/ |
| 22 | |
| 23 | #include "gtkpopover.h"cxx . . $ `<file>/gtk/gtkpopover.h`/ |
| 24 | |
| 25 | struct _GtkInspectorTypePopovercxx . . $ _GtkInspectorTypePopover# |
| 26 | { |
| 27 | GtkPopovercxx . . $ GtkPopover# parent_instancecxx . . $ _GtkInspectorTypePopover#parent_instance.; |
| 28 | }; |
| 29 | |
| 30 | typedef struct _GtkInspectorTypePopoverPrivatecxx . . $ _GtkInspectorTypePopoverPrivate# GtkInspectorTypePopoverPrivatecxx . . $ GtkInspectorTypePopoverPrivate#; |
| 31 | |
| 32 | struct _GtkInspectorTypePopoverPrivatecxx . . $ _GtkInspectorTypePopoverPrivate# |
| 33 | { |
| 34 | GTypecxx . . $ GType# typecxx . . $ _GtkInspectorTypePopoverPrivate#type.; |
| 35 | |
| 36 | GtkWidgetcxx . . $ GtkWidget# *parentscxx . . $ _GtkInspectorTypePopoverPrivate#parents.; |
| 37 | GtkWidgetcxx . . $ GtkWidget# *interfacescxx . . $ _GtkInspectorTypePopoverPrivate#interfaces.; |
| 38 | }; |
| 39 | |
| 40 | enumcxx . . $ $anonymous_type_51c86cc18f326a2_0# |
| 41 | { |
| 42 | PROP_0cxx . . $ PROP_0., |
| 43 | PROP_TYPEcxx . . $ PROP_TYPE. |
| 44 | }; |
| 45 | |
| 46 | G_DEFINE_TYPE_WITH_PRIVATEcxx . . $ `<external>/9567554376676449156/gtype.h:1876:9`! (GtkInspectorTypePopover, gtk_inspector_type_popover, |
| 47 | GTK_TYPE_POPOVERcxx . . $ `gtk/gtkpopover.h:31:9`!) |
| 48 | |
| 49 | static void |
| 50 | add_rowcxx . . $ add_row(3e0616a87a6c51e5). (GtkWidgetcxx . . $ GtkWidget# *box, |
| 51 | const char *name) |
| 52 | { |
| 53 | GtkWidgetcxx . . $ GtkWidget# *row; |
| 54 | GtkWidgetcxx . . $ GtkWidget# *label; |
| 55 | |
| 56 | row = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_LIST_BOX_ROWcxx . . $ `gtk/gtklistbox.h:41:9`!, |
| 57 | "selectable", FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, |
| 58 | "activatable", FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, |
| 59 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 60 | |
| 61 | label = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_LABELcxx . . $ `gtk/gtklabel.h:35:9`!, |
| 62 | "margin-start", 6, |
| 63 | "margin-end", 6, |
| 64 | "margin-top", 6, |
| 65 | "margin-bottom", 6, |
| 66 | "label", name, |
| 67 | "selectable", TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, |
| 68 | "xalign", 0.0, |
| 69 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 70 | |
| 71 | gtk_list_box_row_set_childcxx . . $ gtk_list_box_row_set_child(2dc50f1b58a199a8). (GTK_LIST_BOX_ROWcxx . . $ `gtk/gtklistbox.h:42:9`! (row), label); |
| 72 | gtk_list_box_insertcxx . . $ gtk_list_box_insert(bdb302834669dfad). (GTK_LIST_BOXcxx . . $ `gtk/gtklistbox.h:34:9`! (box), row, -1); |
| 73 | } |
| 74 | |
| 75 | void |
| 76 | gtk_inspector_type_popover_set_gtypecxx . . $ gtk_inspector_type_popover_set_gtype(92b1b38a7d471519). (GtkInspectorTypePopovercxx . . $ GtkInspectorTypePopover# *self, |
| 77 | GTypecxx . . $ GType# gtype) |
| 78 | { |
| 79 | GtkInspectorTypePopoverPrivatecxx . . $ GtkInspectorTypePopoverPrivate# *priv; |
| 80 | GHashTablecxx . . $ GHashTable# *implements; |
| 81 | GHashTableItercxx . . $ GHashTableIter# iter; |
| 82 | const char *name; |
| 83 | GTypecxx . . $ GType# *interfaces; |
| 84 | GTypecxx . . $ GType# tmp; |
| 85 | int i; |
| 86 | GtkWidgetcxx . . $ GtkWidget# *child; |
| 87 | |
| 88 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GTK_IS_INSPECTOR_TYPE_POPOVER (self)); |
| 89 | |
| 90 | priv = gtk_inspector_type_popover_get_instance_privatecxx . . $ gtk_inspector_type_popover_get_instance_private(ed11b4425d419280). (self); |
| 91 | |
| 92 | if (priv->typecxx . . $ _GtkInspectorTypePopoverPrivate#type. == gtype) |
| 93 | return; |
| 94 | |
| 95 | priv->typecxx . . $ _GtkInspectorTypePopoverPrivate#type. = gtype; |
| 96 | |
| 97 | while ((child = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (priv->parentscxx . . $ _GtkInspectorTypePopoverPrivate#parents.))) |
| 98 | gtk_list_box_removecxx . . $ gtk_list_box_remove(80bd4d01e1352ed1). (GTK_LIST_BOXcxx . . $ `gtk/gtklistbox.h:34:9`! (priv->parents), child); |
| 99 | while ((child = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (priv->interfacescxx . . $ _GtkInspectorTypePopoverPrivate#interfaces.))) |
| 100 | gtk_list_box_removecxx . . $ gtk_list_box_remove(80bd4d01e1352ed1). (GTK_LIST_BOXcxx . . $ `gtk/gtklistbox.h:34:9`! (priv->interfaces), child); |
| 101 | |
| 102 | implements = g_hash_table_newcxx . . $ g_hash_table_new(444186de27d60923). (g_str_hashcxx . . $ g_str_hash(b11f534102b1ad6)., g_str_equalcxx . . $ g_str_equal(9148c8c3ff42c9d8).); |
| 103 | |
| 104 | tmp = gtype; |
| 105 | |
| 106 | do |
| 107 | { |
| 108 | add_rowcxx . . $ add_row(3e0616a87a6c51e5). (priv->parentscxx . . $ _GtkInspectorTypePopoverPrivate#parents., g_type_namecxx . . $ g_type_name(30dde979ed96a187). (tmp)); |
| 109 | |
| 110 | interfaces = g_type_interfacescxx . . $ g_type_interfaces(e002a602f3f6e14). (tmp, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 111 | |
| 112 | for (i = 0; interfaces[i]; i++) |
| 113 | g_hash_table_addcxx . . $ g_hash_table_add(69c5b3b3568d4848). (implements, (char *) g_type_namecxx . . $ g_type_name(30dde979ed96a187). (interfaces[i])); |
| 114 | |
| 115 | g_freecxx . . $ g_free(5d22bdacc48458e8). (interfaces); |
| 116 | } |
| 117 | while ((tmp = g_type_parentcxx . . $ g_type_parent(ecdaa1632f49f591). (tmp))); |
| 118 | |
| 119 | g_hash_table_iter_initcxx . . $ g_hash_table_iter_init(1fd6bbae530c3b4). (&iter, implements); |
| 120 | |
| 121 | while (g_hash_table_iter_nextcxx . . $ g_hash_table_iter_next(1740d3f8cffea03c). (&iter, (gpointercxx . . $ gpointer# *) &name, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 122 | add_rowcxx . . $ add_row(3e0616a87a6c51e5). (priv->interfacescxx . . $ _GtkInspectorTypePopoverPrivate#interfaces., name); |
| 123 | |
| 124 | g_hash_table_unrefcxx . . $ g_hash_table_unref(ce4eddf544b9218). (implements); |
| 125 | } |
| 126 | |
| 127 | static void |
| 128 | gtk_inspector_type_popover_initcxx . . $ gtk_inspector_type_popover_init(28972174b4fdaf0e). (GtkInspectorTypePopovercxx . . $ GtkInspectorTypePopover# *self) |
| 129 | { |
| 130 | GtkInspectorTypePopoverPrivatecxx . . $ GtkInspectorTypePopoverPrivate# *priv; |
| 131 | GtkWidgetcxx . . $ GtkWidget# *label; |
| 132 | |
| 133 | gtk_widget_init_templatecxx . . $ gtk_widget_init_template(d7cf858254b37903). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (self)); |
| 134 | |
| 135 | priv = gtk_inspector_type_popover_get_instance_privatecxx . . $ gtk_inspector_type_popover_get_instance_private(ed11b4425d419280). (self); |
| 136 | |
| 137 | priv->typecxx . . $ _GtkInspectorTypePopoverPrivate#type. = G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!; |
| 138 | |
| 139 | label = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_LABELcxx . . $ `gtk/gtklabel.h:35:9`!, |
| 140 | "margin-start", 12, |
| 141 | "margin-end", 12, |
| 142 | "margin-top", 12, |
| 143 | "margin-bottom", 12, |
| 144 | "label", "None", |
| 145 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 146 | |
| 147 | gtk_list_box_set_placeholdercxx . . $ gtk_list_box_set_placeholder(80bd4d01e1352ed1). (GTK_LIST_BOXcxx . . $ `gtk/gtklistbox.h:34:9`! (priv->parents), label); |
| 148 | |
| 149 | label = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_LABELcxx . . $ `gtk/gtklabel.h:35:9`!, |
| 150 | "margin-start", 12, |
| 151 | "margin-end", 12, |
| 152 | "margin-top", 12, |
| 153 | "margin-bottom", 12, |
| 154 | "label", "None", |
| 155 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 156 | |
| 157 | gtk_list_box_set_placeholdercxx . . $ gtk_list_box_set_placeholder(80bd4d01e1352ed1). (GTK_LIST_BOXcxx . . $ `gtk/gtklistbox.h:34:9`! (priv->interfaces), label); |
| 158 | } |
| 159 | |
| 160 | static void |
| 161 | gtk_inspector_type_popover_get_propertycxx . . $ gtk_inspector_type_popover_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object, |
| 162 | guintcxx . . $ guint# param_id, |
| 163 | GValuecxx . . $ GValue# *value, |
| 164 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 165 | { |
| 166 | GtkInspectorTypePopovercxx . . $ GtkInspectorTypePopover# *self = GTK_INSPECTOR_TYPE_POPOVERcxx . . $ GTK_INSPECTOR_TYPE_POPOVER(76018bcb719f17eb). (object); |
| 167 | GtkInspectorTypePopoverPrivatecxx . . $ GtkInspectorTypePopoverPrivate# *priv = gtk_inspector_type_popover_get_instance_privatecxx . . $ gtk_inspector_type_popover_get_instance_private(ed11b4425d419280). (self); |
| 168 | |
| 169 | switch (param_id) |
| 170 | { |
| 171 | case PROP_TYPEcxx . . $ PROP_TYPE.: |
| 172 | g_value_set_gtypecxx . . $ g_value_set_gtype(235192cae6c1f0e4). (value, priv->typecxx . . $ _GtkInspectorTypePopoverPrivate#type.); |
| 173 | break; |
| 174 | |
| 175 | default: |
| 176 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, param_id, pspec); |
| 177 | break; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | static void |
| 182 | gtk_inspector_type_popover_set_propertycxx . . $ gtk_inspector_type_popover_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object, |
| 183 | guintcxx . . $ guint# param_id, |
| 184 | const GValuecxx . . $ GValue# *value, |
| 185 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 186 | { |
| 187 | GtkInspectorTypePopovercxx . . $ GtkInspectorTypePopover# *self = GTK_INSPECTOR_TYPE_POPOVERcxx . . $ GTK_INSPECTOR_TYPE_POPOVER(76018bcb719f17eb). (object); |
| 188 | |
| 189 | switch (param_id) |
| 190 | { |
| 191 | case PROP_TYPEcxx . . $ PROP_TYPE.: |
| 192 | gtk_inspector_type_popover_set_gtypecxx . . $ gtk_inspector_type_popover_set_gtype(92b1b38a7d471519). (self, g_value_get_gtypecxx . . $ g_value_get_gtype(29e6c0e3c95e6aef). (value)); |
| 193 | break; |
| 194 | |
| 195 | default: |
| 196 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, param_id, pspec); |
| 197 | break; |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | static void |
| 202 | gtk_inspector_type_popover_class_initcxx . . $ gtk_inspector_type_popover_class_init(748e56b82c2bece4). (GtkInspectorTypePopoverClasscxx . . $ GtkInspectorTypePopoverClass# *klass) |
| 203 | { |
| 204 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 205 | GtkWidgetClasscxx . . $ GtkWidgetClass# *widget_class = GTK_WIDGET_CLASScxx . . $ `gtk/gtkwidget.h:45:9`! (klass); |
| 206 | |
| 207 | object_class->get_propertycxx . . $ _GObjectClass#get_property. = gtk_inspector_type_popover_get_propertycxx . . $ gtk_inspector_type_popover_get_property(cee2c52f22407c66).; |
| 208 | object_class->set_propertycxx . . $ _GObjectClass#set_property. = gtk_inspector_type_popover_set_propertycxx . . $ gtk_inspector_type_popover_set_property(d7c4bb29f36c0dc4).; |
| 209 | |
| 210 | g_object_class_install_propertycxx . . $ g_object_class_install_property(9c80cb614dbe5a26). (object_class, PROP_TYPEcxx . . $ PROP_TYPE., |
| 211 | g_param_spec_gtypecxx . . $ g_param_spec_gtype(faf99966f027a127). ("type", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 212 | G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE.)); |
| 213 | |
| 214 | gtk_widget_class_set_template_from_resourcecxx . . $ gtk_widget_class_set_template_from_resource(6333614c746ab65a). (widget_class, "/org/gtk/libgtk/inspector/type-info.ui"); |
| 215 | gtk_widget_class_bind_template_child_privatecxx . . $ `gtk/gtkwidget.h:806:9`! (widget_class, GtkInspectorTypePopover, parents); |
| 216 | gtk_widget_class_bind_template_child_privatecxx . . $ `gtk/gtkwidget.h:806:9`! (widget_class, GtkInspectorTypePopover, interfaces); |
| 217 | } |