[gtk+/wip/baedert/box: 4/6] container: Remove composite_name
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/box: 4/6] container: Remove composite_name
- Date: Thu, 20 Oct 2016 15:57:38 +0000 (UTC)
commit c47991bd6e3ac9e842a28d184dcca05915c3b50f
Author: Timm Bäder <mail baedert org>
Date: Thu Oct 20 13:58:36 2016 +0200
container: Remove composite_name
gtk/gtkcontainer.c | 82 ----------------------------------------------------
gtk/gtkcontainer.h | 3 --
2 files changed, 0 insertions(+), 85 deletions(-)
---
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 85fc62b..59fb3ad 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -328,9 +328,6 @@ static void gtk_container_map (GtkWidget *widget);
static void gtk_container_unmap (GtkWidget *widget);
static GtkSizeRequestMode gtk_container_get_request_mode (GtkWidget *widget);
-static gchar* gtk_container_child_default_composite_name (GtkContainer *container,
- GtkWidget *child);
-
static GtkWidgetPath * gtk_container_real_get_path_for_child (GtkContainer *container,
GtkWidget *child);
@@ -476,7 +473,6 @@ gtk_container_class_init (GtkContainerClass *class)
class->forall = NULL;
class->set_focus_child = gtk_container_real_set_focus_child;
class->child_type = NULL;
- class->composite_name = gtk_container_child_default_composite_name;
class->get_path_for_child = gtk_container_real_get_path_for_child;
container_signals[ADD] =
@@ -2036,84 +2032,6 @@ gtk_container_get_children (GtkContainer *container)
return g_list_reverse (children);
}
-static void
-gtk_container_child_position_callback (GtkWidget *widget,
- gpointer client_data)
-{
- struct {
- GtkWidget *child;
- guint i;
- guint index;
- } *data = client_data;
-
- data->i++;
- if (data->child == widget)
- data->index = data->i;
-}
-
-static gchar*
-gtk_container_child_default_composite_name (GtkContainer *container,
- GtkWidget *child)
-{
- struct {
- GtkWidget *child;
- guint i;
- guint index;
- } data;
- gchar *name;
-
- /* fallback implementation */
- data.child = child;
- data.i = 0;
- data.index = 0;
- gtk_container_forall (container,
- gtk_container_child_position_callback,
- &data);
-
- name = g_strdup_printf ("%s-%u",
- g_type_name (G_TYPE_FROM_INSTANCE (child)),
- data.index);
-
- return name;
-}
-
-gchar*
-_gtk_container_child_composite_name (GtkContainer *container,
- GtkWidget *child)
-{
- gboolean composite_child;
-
- g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
- g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
- g_return_val_if_fail (_gtk_widget_get_parent (child) == GTK_WIDGET (container), NULL);
-
- g_object_get (child, "composite-child", &composite_child, NULL);
- if (composite_child)
- {
- static GQuark quark_composite_name = 0;
- gchar *name;
-
- if (!quark_composite_name)
- quark_composite_name = g_quark_from_static_string ("gtk-composite-name");
-
- name = g_object_get_qdata (G_OBJECT (child), quark_composite_name);
- if (!name)
- {
- GtkContainerClass *class;
-
- class = GTK_CONTAINER_GET_CLASS (container);
- if (class->composite_name)
- name = class->composite_name (container, child);
- }
- else
- name = g_strdup (name);
-
- return name;
- }
-
- return NULL;
-}
-
typedef struct {
gboolean hexpand;
gboolean vexpand;
diff --git a/gtk/gtkcontainer.h b/gtk/gtkcontainer.h
index 37af1ea..6725a80 100644
--- a/gtk/gtkcontainer.h
+++ b/gtk/gtkcontainer.h
@@ -63,7 +63,6 @@ struct _GtkContainer
* @forall: Invokes callback on each child of container.
* @set_focus_child: Sets the focused child of container.
* @child_type: Returns the type of the children supported by the container.
- * @composite_name: Gets a widget’s composite name. Deprecated: 3.10.
* @set_child_property: Set a property on a child of container.
* @get_child_property: Get a property from a child of container.
* @get_path_for_child: Get path representing entire widget hierarchy
@@ -89,8 +88,6 @@ struct _GtkContainerClass
void (*set_focus_child) (GtkContainer *container,
GtkWidget *child);
GType (*child_type) (GtkContainer *container);
- gchar* (*composite_name) (GtkContainer *container,
- GtkWidget *child);
void (*set_child_property) (GtkContainer *container,
GtkWidget *child,
guint property_id,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]