API: container: Remove GtkContainer::child property

This commit is contained in:
Benjamin Otte 2016-10-09 03:22:56 +02:00
parent d4d3374729
commit 1d4f23da8e
3 changed files with 9 additions and 73 deletions

View File

@ -294,14 +294,6 @@ enum {
LAST_SIGNAL
};
enum {
PROP_0,
PROP_CHILD,
LAST_PROP
};
static GParamSpec *container_props[LAST_PROP];
#define PARAM_SPEC_PARAM_ID(pspec) ((pspec)->param_id)
#define PARAM_SPEC_SET_PARAM_ID(pspec, id) ((pspec)->param_id = (id))
@ -312,14 +304,6 @@ static void gtk_container_base_class_finalize (GtkContainerClass *klass);
static void gtk_container_class_init (GtkContainerClass *klass);
static void gtk_container_init (GtkContainer *container);
static void gtk_container_destroy (GtkWidget *widget);
static void gtk_container_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_container_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_container_add_unimplemented (GtkContainer *container,
GtkWidget *widget);
static void gtk_container_remove_unimplemented (GtkContainer *container,
@ -478,9 +462,6 @@ gtk_container_class_init (GtkContainerClass *class)
hadjustment_key_id = g_quark_from_static_string ("gtk-hadjustment");
quark_focus_chain = g_quark_from_static_string ("gtk-container-focus-chain");
gobject_class->set_property = gtk_container_set_property;
gobject_class->get_property = gtk_container_get_property;
widget_class->destroy = gtk_container_destroy;
widget_class->compute_expand = gtk_container_compute_expand;
widget_class->show_all = gtk_container_show_all;
@ -499,15 +480,6 @@ gtk_container_class_init (GtkContainerClass *class)
class->composite_name = gtk_container_child_default_composite_name;
class->get_path_for_child = gtk_container_real_get_path_for_child;
container_props[PROP_CHILD] =
g_param_spec_object ("child",
P_("Child"),
P_("Can be used to add a new child to the container"),
GTK_TYPE_WIDGET,
GTK_PARAM_WRITABLE);
g_object_class_install_properties (gobject_class, LAST_PROP, container_props);
container_signals[ADD] =
g_signal_new (I_("add"),
G_OBJECT_CLASS_TYPE (gobject_class),
@ -1656,42 +1628,6 @@ gtk_container_destroy (GtkWidget *widget)
GTK_WIDGET_CLASS (parent_class)->destroy (widget);
}
static void
gtk_container_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkContainer *container = GTK_CONTAINER (object);
switch (prop_id)
{
case PROP_CHILD:
gtk_container_add (container, GTK_WIDGET (g_value_get_object (value)));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_container_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
//GtkContainer *container = GTK_CONTAINER (object);
//GtkContainerPrivate *priv = container->priv;
switch (prop_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
/**
* gtk_container_add:
* @container: a #GtkContainer

View File

@ -2108,6 +2108,13 @@ create_saved_position (GtkWidget *widget)
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
gtk_container_add (GTK_CONTAINER (window), main_vbox);
button = g_object_new (GTK_TYPE_TOGGLE_BUTTON,
"label", "Stop Events",
"active", FALSE,
"visible", TRUE,
NULL);
g_signal_connect (button, "clicked", G_CALLBACK (uposition_stop_configure), window);
vbox =
g_object_new (GTK_TYPE_BOX,
"orientation", GTK_ORIENTATION_VERTICAL,
@ -2115,14 +2122,8 @@ create_saved_position (GtkWidget *widget)
"GtkBox::spacing", 5,
"GtkWidget::parent", main_vbox,
"GtkWidget::visible", TRUE,
"child", g_object_connect (g_object_new (GTK_TYPE_TOGGLE_BUTTON,
"label", "Stop Events",
"active", FALSE,
"visible", TRUE,
NULL),
"signal::clicked", uposition_stop_configure, window,
NULL),
NULL);
gtk_container_add (GTK_CONTAINER (vbox), button);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE);
@ -2325,8 +2326,8 @@ create_tooltips (GtkWidget *widget)
"label_xalign", (double) 0.5,
"visible", TRUE,
"parent", box2,
"child", box3,
NULL);
gtk_container_add (GTK_CONTAINER (frame), box3);
gtk_box_set_child_packing (GTK_BOX (box2), frame, TRUE, TRUE, GTK_PACK_START);
separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);

View File

@ -53,7 +53,6 @@ list_ignore_properties (gboolean buglist)
{
/* currently untestable properties */
static const IgnoreProperty ignore_properties[] = {
{ "GtkContainer", "child", NULL, }, /* needs working child widget */
{ "GtkRadioMenuItem", "group", NULL, }, /* needs working sibling */
{ "GtkWidget", "parent", NULL, }, /* needs working parent widget */
{ "GtkCList", "selection-mode", (void*) GTK_SELECTION_NONE, },