diff options
Diffstat (limited to 'gtk/gtkwidget.c')
-rw-r--r-- | gtk/gtkwidget.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index e96a4c6750..7f129a0d89 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -608,6 +608,9 @@ static gboolean gtk_widget_real_mnemonic_activate (GtkWidget gboolean group_cycling); static void gtk_widget_accessible_interface_init (GtkAccessibleInterface *iface); static void gtk_widget_buildable_interface_init (GtkBuildableIface *iface); +static void gtk_widget_buildable_set_id (GtkBuildable *buildable, + const char *id); +static const char * gtk_widget_buildable_get_id (GtkBuildable *buildable); static GObject * gtk_widget_buildable_get_internal_child (GtkBuildable *buildable, GtkBuilder *builder, const char *childname); @@ -649,6 +652,7 @@ static GQuark quark_size_groups = 0; static GQuark quark_auto_children = 0; static GQuark quark_font_options = 0; static GQuark quark_font_map = 0; +static GQuark quark_builder_set_id = 0; GType gtk_widget_get_type (void) @@ -8492,6 +8496,10 @@ gtk_widget_buildable_add_child (GtkBuildable *buildable, static void gtk_widget_buildable_interface_init (GtkBuildableIface *iface) { + quark_builder_set_id = g_quark_from_static_string ("gtk-builder-set-id"); + + iface->set_id = gtk_widget_buildable_set_id; + iface->get_id = gtk_widget_buildable_get_id; iface->get_internal_child = gtk_widget_buildable_get_internal_child; iface->custom_tag_start = gtk_widget_buildable_custom_tag_start; iface->custom_tag_end = gtk_widget_buildable_custom_tag_end; @@ -8499,6 +8507,20 @@ gtk_widget_buildable_interface_init (GtkBuildableIface *iface) iface->add_child = gtk_widget_buildable_add_child; } +static void +gtk_widget_buildable_set_id (GtkBuildable *buildable, + const char *id) +{ + g_object_set_qdata_full (G_OBJECT (buildable), quark_builder_set_id, + g_strdup (id), g_free); +} + +static const char * +gtk_widget_buildable_get_id (GtkBuildable *buildable) +{ + return g_object_get_qdata (G_OBJECT (buildable), quark_builder_set_id); +} + static GObject * gtk_widget_buildable_get_internal_child (GtkBuildable *buildable, GtkBuilder *builder, |