Merge branch 'drop-buildable-get-id' into 'main'

builder: Stop using GtkBuildable.get_id

See merge request GNOME/gtk!5239
This commit is contained in:
Matthias Clasen 2022-11-21 10:35:16 +00:00
commit 83839cb219
2 changed files with 2 additions and 38 deletions

View File

@ -626,10 +626,7 @@ gtk_builder_get_parameters (GtkBuilder *builder,
static const char *
object_get_id (GObject *object)
{
if (GTK_IS_BUILDABLE (object))
return gtk_buildable_get_buildable_id (GTK_BUILDABLE (object));
else
return g_object_get_data (object, "gtk-builder-id");
return g_object_get_data (object, "gtk-builder-id");
}
static GObject *
@ -672,10 +669,7 @@ static inline void
object_set_id (GObject *object,
const char *id)
{
if (GTK_IS_BUILDABLE (object))
gtk_buildable_set_buildable_id (GTK_BUILDABLE (object), id);
else
g_object_set_data_full (object, "gtk-builder-id", g_strdup (id), g_free);
g_object_set_data_full (object, "gtk-builder-id", g_strdup (id), g_free);
}
void

View File

@ -608,9 +608,6 @@ 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);
@ -630,8 +627,6 @@ static void gtk_widget_buildable_custom_finished (GtkBuildable
GObject *child,
const char *tagname,
gpointer data);
static void gtk_widget_buildable_parser_finished (GtkBuildable *buildable,
GtkBuilder *builder);
static void gtk_widget_set_usize_internal (GtkWidget *widget,
int width,
int height);
@ -654,7 +649,6 @@ 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)
@ -8498,32 +8492,13 @@ 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->parser_finished = gtk_widget_buildable_parser_finished;
iface->custom_tag_start = gtk_widget_buildable_custom_tag_start;
iface->custom_tag_end = gtk_widget_buildable_custom_tag_end;
iface->custom_finished = gtk_widget_buildable_custom_finished;
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,
@ -8564,11 +8539,6 @@ gtk_widget_buildable_get_internal_child (GtkBuildable *buildable,
return NULL;
}
static void
gtk_widget_buildable_parser_finished (GtkBuildable *buildable,
GtkBuilder *builder)
{
}
typedef struct
{