summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-05-22 08:30:34 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-05-22 08:32:48 -0400
commit39ccbe6549971afd09ce5483638ea84840bf2e21 (patch)
treea2d7c785781cdd0cc0683e88f341fa7401fcb75c
parentbd5414addb9f6f78920dfdf9bd9619f2311661d3 (diff)
downloadgtk+-39ccbe6549971afd09ce5483638ea84840bf2e21.tar.gz
tests: Drop manual property editor
No need for this anymore, now that we have the inspector everywhere.
-rw-r--r--tests/Makefile.am27
-rw-r--r--tests/prop-editor.c1486
-rw-r--r--tests/prop-editor.h30
-rw-r--r--tests/testboxcss.c1
-rw-r--r--tests/testentrycompletion.c31
-rw-r--r--tests/testentryicons.c49
-rw-r--r--tests/testfilechooser.c3
-rw-r--r--tests/testfilechooserbutton.c32
-rw-r--r--tests/testfontchooser.c3
-rw-r--r--tests/testfontchooserdialog.c3
-rw-r--r--tests/testgtk.c208
-rw-r--r--tests/testiconview.c5
-rw-r--r--tests/testmenubutton.c2
-rw-r--r--tests/testnumerableicon.c27
-rw-r--r--tests/testrecentchooser.c4
-rwxr-xr-xtests/teststatusicon.c23
-rw-r--r--tests/testtoolbar.c13
-rw-r--r--tests/testtreechanging.c4
-rw-r--r--tests/testtreeview.c45
19 files changed, 9 insertions, 1987 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e2396b828f..1cf7bf2993 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -303,23 +303,18 @@ video_timer_SOURCES = \
variable.h
testboxcss_SOURCES = \
- testboxcss.c \
- prop-editor.c
+ testboxcss.c
testentrycompletion_SOURCES = \
- prop-editor.c \
testentrycompletion.c
testentryicons_SOURCES = \
- prop-editor.c \
testentryicons.c
testfilechooser_SOURCES = \
- prop-editor.c \
testfilechooser.c
testfilechooserbutton_SOURCES = \
- prop-editor.c \
testfilechooserbutton.c
testflowbox_SOURCES = \
@@ -332,22 +327,18 @@ testfontselectiondialog_SOURCES = \
testfontselectiondialog.c
testfontchooser_SOURCES = \
- prop-editor.c \
testfontchooser.c
testfontchooserdialog_SOURCES = \
- prop-editor.c \
testfontchooserdialog.c
testgrid_SOURCES = \
testgrid.c
testgtk_SOURCES = \
- prop-editor.c \
testgtk.c
testtreechanging_SOURCES = \
- prop-editor.c \
testtreechanging.c
testtreeedit_SOURCES = \
@@ -357,16 +348,13 @@ testtreemodel_SOURCES = \
testtreemodel.c
testtreeview_SOURCES = \
- prop-editor.c \
testtreeview.c
testtoolbar_SOURCES = \
- testtoolbar.c \
- prop-editor.c
+ testtoolbar.c
testmenubutton_SOURCES = \
- testmenubutton.c \
- prop-editor.c
+ testmenubutton.c
testprint_SOURCES = \
testprint.c \
@@ -385,7 +373,6 @@ testspinbutton_SOURCES = \
testspinbutton.c
teststatusicon_SOURCES = \
- prop-editor.c \
teststatusicon.c
testmerge_SOURCES = \
@@ -413,18 +400,15 @@ testgiconpixbuf_SOURCES = \
testgiconpixbuf.c
testiconview_SOURCES = \
- testiconview.c \
- prop-editor.c
+ testiconview.c
testiconview_keynav_SOURCES = \
testiconview-keynav.c
testnumerableicon_SOURCES = \
- testnumerableicon.c \
- prop-editor.c
+ testnumerableicon.c
testrecentchooser_SOURCES = \
- prop-editor.c \
testrecentchooser.c
testgrouping_SOURCES = \
@@ -505,7 +489,6 @@ testwindowsize_SOURCES = testwindowsize.c
EXTRA_DIST += \
gradient1.png \
- prop-editor.h \
testgtk.1 \
testgtk.css \
testgtk2.css \
diff --git a/tests/prop-editor.c b/tests/prop-editor.c
deleted file mode 100644
index e9afe6f767..0000000000
--- a/tests/prop-editor.c
+++ /dev/null
@@ -1,1486 +0,0 @@
-/* prop-editor.c
- * Copyright (C) 2000 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <string.h>
-
-#include <gtk/gtk.h>
-
-#include "prop-editor.h"
-
-
-typedef struct
-{
- gpointer instance;
- GObject *alive_object;
- gulong id;
-} DisconnectData;
-
-static void
-disconnect_func (gpointer data)
-{
- DisconnectData *dd = data;
-
- g_signal_handler_disconnect (dd->instance, dd->id);
-}
-
-static void
-signal_removed (gpointer data,
- GClosure *closure)
-{
- DisconnectData *dd = data;
-
- g_object_steal_data (dd->alive_object, "alive-object-data");
- g_free (dd);
-}
-
-static gboolean
-is_child_property (GParamSpec *pspec)
-{
- return g_param_spec_get_qdata (pspec, g_quark_from_string ("is-child-prop")) != NULL;
-}
-
-static void
-mark_child_property (GParamSpec *pspec)
-{
- g_param_spec_set_qdata (pspec, g_quark_from_string ("is-child-prop"),
- GINT_TO_POINTER (TRUE));
-}
-
-static void
-g_object_connect_property (GObject *object,
- GParamSpec *spec,
- GCallback func,
- gpointer data,
- GObject *alive_object)
-{
- GClosure *closure;
- gchar *with_detail;
- DisconnectData *dd;
-
- if (is_child_property (spec))
- with_detail = g_strconcat ("child-notify::", spec->name, NULL);
- else
- with_detail = g_strconcat ("notify::", spec->name, NULL);
-
- dd = g_new (DisconnectData, 1);
-
- closure = g_cclosure_new (func, data, NULL);
-
- g_closure_add_invalidate_notifier (closure, dd, signal_removed);
-
- dd->id = g_signal_connect_closure (object, with_detail,
- closure, FALSE);
-
- dd->instance = object;
- dd->alive_object = alive_object;
-
- g_object_set_data_full (G_OBJECT (alive_object),
- "alive-object-data",
- dd,
- disconnect_func);
-
- g_free (with_detail);
-}
-
-typedef struct
-{
- GObject *obj;
- GParamSpec *spec;
- gulong modified_id;
-} ObjectProperty;
-
-static void
-free_object_property (ObjectProperty *p)
-{
- g_free (p);
-}
-
-static void
-connect_controller (GObject *controller,
- const gchar *signal,
- GObject *model,
- GParamSpec *spec,
- GCallback func)
-{
- ObjectProperty *p;
-
- p = g_new (ObjectProperty, 1);
- p->obj = model;
- p->spec = spec;
-
- p->modified_id = g_signal_connect_data (controller, signal, func, p,
- (GClosureNotify)free_object_property,
- 0);
- g_object_set_data (controller, "object-property", p);
-}
-
-static void
-block_controller (GObject *controller)
-{
- ObjectProperty *p = g_object_get_data (controller, "object-property");
-
- if (p)
- g_signal_handler_block (controller, p->modified_id);
-}
-
-static void
-unblock_controller (GObject *controller)
-{
- ObjectProperty *p = g_object_get_data (controller, "object-property");
-
- if (p)
- g_signal_handler_unblock (controller, p->modified_id);
-}
-
-static void
-int_modified (GtkAdjustment *adj, gpointer data)
-{
- ObjectProperty *p = data;
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, (int) gtk_adjustment_get_value (adj), NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, (int) gtk_adjustment_get_value (adj), NULL);
-}
-
-static void
-get_property_value (GObject *object, GParamSpec *pspec, GValue *value)
-{
- if (is_child_property (pspec))
- {
- GtkWidget *widget = GTK_WIDGET (object);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_get_property (GTK_CONTAINER (parent),
- widget, pspec->name, value);
- }
- else
- g_object_get_property (object, pspec->name, value);
-}
-
-static void
-int_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkAdjustment *adj = GTK_ADJUSTMENT (data);
- GValue val = G_VALUE_INIT;
-
- g_value_init (&val, G_TYPE_INT);
-
- get_property_value (object, pspec, &val);
-
- if (g_value_get_int (&val) != (int)gtk_adjustment_get_value (adj))
- {
- block_controller (G_OBJECT (adj));
- gtk_adjustment_set_value (adj, g_value_get_int (&val));
- unblock_controller (G_OBJECT (adj));
- }
-
- g_value_unset (&val);
-}
-
-static void
-uint_modified (GtkAdjustment *adj, gpointer data)
-{
- ObjectProperty *p = data;
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, (guint) gtk_adjustment_get_value (adj), NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, (guint) gtk_adjustment_get_value (adj), NULL);
-}
-
-static void
-uint_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkAdjustment *adj = GTK_ADJUSTMENT (data);
- GValue val = G_VALUE_INIT;
-
- g_value_init (&val, G_TYPE_UINT);
- get_property_value (object, pspec, &val);
-
- if (g_value_get_uint (&val) != (guint)gtk_adjustment_get_value (adj))
- {
- block_controller (G_OBJECT (adj));
- gtk_adjustment_set_value (adj, g_value_get_uint (&val));
- unblock_controller (G_OBJECT (adj));
- }
-
- g_value_unset (&val);
-}
-
-static void
-float_modified (GtkAdjustment *adj, gpointer data)
-{
- ObjectProperty *p = data;
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, (float) gtk_adjustment_get_value (adj), NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, (float) gtk_adjustment_get_value (adj), NULL);
-}
-
-static void
-float_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkAdjustment *adj = GTK_ADJUSTMENT (data);
- GValue val = G_VALUE_INIT;
-
- g_value_init (&val, G_TYPE_FLOAT);
- get_property_value (object, pspec, &val);
-
- if (g_value_get_float (&val) != (float) gtk_adjustment_get_value (adj))
- {
- block_controller (G_OBJECT (adj));
- gtk_adjustment_set_value (adj, g_value_get_float (&val));
- unblock_controller (G_OBJECT (adj));
- }
-
- g_value_unset (&val);
-}
-
-static void
-double_modified (GtkAdjustment *adj, gpointer data)
-{
- ObjectProperty *p = data;
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, (double) gtk_adjustment_get_value (adj), NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, (double) gtk_adjustment_get_value (adj), NULL);
-}
-
-static void
-double_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkAdjustment *adj = GTK_ADJUSTMENT (data);
- GValue val = G_VALUE_INIT;
-
- g_value_init (&val, G_TYPE_DOUBLE);
- get_property_value (object, pspec, &val);
-
- if (g_value_get_double (&val) != gtk_adjustment_get_value (adj))
- {
- block_controller (G_OBJECT (adj));
- gtk_adjustment_set_value (adj, g_value_get_double (&val));
- unblock_controller (G_OBJECT (adj));
- }
-
- g_value_unset (&val);
-}
-
-static void
-string_modified (GtkEntry *entry, gpointer data)
-{
- ObjectProperty *p = data;
- const gchar *text;
-
- text = gtk_entry_get_text (entry);
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, text, NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, text, NULL);
-}
-
-static void
-string_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkEntry *entry = GTK_ENTRY (data);
- GValue val = G_VALUE_INIT;
- const gchar *str;
- const gchar *text;
-
- g_value_init (&val, G_TYPE_STRING);
- get_property_value (object, pspec, &val);
-
- str = g_value_get_string (&val);
- if (str == NULL)
- str = "";
- text = gtk_entry_get_text (entry);
-
- if (strcmp (str, text) != 0)
- {
- block_controller (G_OBJECT (entry));
- gtk_entry_set_text (entry, str);
- unblock_controller (G_OBJECT (entry));
- }
-
- g_value_unset (&val);
-}
-
-static void
-bool_modified (GtkToggleButton *tb, gpointer data)
-{
- ObjectProperty *p = data;
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent), widget,
- p->spec->name, (int) gtk_toggle_button_get_active (tb),
- NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, (int) gtk_toggle_button_get_active (tb), NULL);
-}
-
-static void
-bool_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkToggleButton *tb = GTK_TOGGLE_BUTTON (data);
- GtkWidget *child;
- GValue val = G_VALUE_INIT;
-
- g_value_init (&val, G_TYPE_BOOLEAN);
- get_property_value (object, pspec, &val);
-
- if (g_value_get_boolean (&val) != gtk_toggle_button_get_active (tb))
- {
- block_controller (G_OBJECT (tb));
- gtk_toggle_button_set_active (tb, g_value_get_boolean (&val));
- unblock_controller (G_OBJECT (tb));
- }
-
- child = gtk_bin_get_child (GTK_BIN (tb));
- gtk_label_set_text (GTK_LABEL (child),
- g_value_get_boolean (&val) ? "TRUE" : "FALSE");
-
- g_value_unset (&val);
-}
-
-
-static void
-enum_modified (GtkComboBox *cb, gpointer data)
-{
- ObjectProperty *p = data;
- gint i;
- GEnumClass *eclass;
-
- eclass = G_ENUM_CLASS (g_type_class_peek (p->spec->value_type));
-
- i = gtk_combo_box_get_active (cb);
-
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, eclass->values[i].value, NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, eclass->values[i].value, NULL);
-}
-
-static void
-enum_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkComboBox *cb = GTK_COMBO_BOX (data);
- GValue val = G_VALUE_INIT;
- GEnumClass *eclass;
- gint i;
-
- eclass = G_ENUM_CLASS (g_type_class_peek (pspec->value_type));
-
- g_value_init (&val, pspec->value_type);
- get_property_value (object, pspec, &val);
-
- i = 0;
- while (i < eclass->n_values)
- {
- if (eclass->values[i].value == g_value_get_enum (&val))
- break;
- ++i;
- }
-
- if (gtk_combo_box_get_active (cb) != i)
- {
- block_controller (G_OBJECT (cb));
- gtk_combo_box_set_active (cb, i);
- unblock_controller (G_OBJECT (cb));
- }
-
- g_value_unset (&val);
-
-}
-
-static void
-flags_modified (GtkCheckButton *button, gpointer data)
-{
- ObjectProperty *p = data;
- gboolean active;
- GFlagsClass *fclass;
- guint flags;
- gint i;
-
- fclass = G_FLAGS_CLASS (g_type_class_peek (p->spec->value_type));
-
- active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
- i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "index"));
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_get (GTK_CONTAINER (parent),
- widget, p->spec->name, &flags, NULL);
- if (active)
- flags |= fclass->values[i].value;
- else
- flags &= ~fclass->values[i].value;
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, flags, NULL);
- }
- else
- {
- g_object_get (p->obj, p->spec->name, &flags, NULL);
-
- if (active)
- flags |= fclass->values[i].value;
- else
- flags &= ~fclass->values[i].value;
-
- g_object_set (p->obj, p->spec->name, flags, NULL);
- }
-}
-
-static void
-flags_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GList *children, *c;
- GValue val = G_VALUE_INIT;
- GFlagsClass *fclass;
- guint flags;
- gint i;
-
- fclass = G_FLAGS_CLASS (g_type_class_peek (pspec->value_type));
-
- g_value_init (&val, pspec->value_type);
- get_property_value (object, pspec, &val);
- flags = g_value_get_flags (&val);
- g_value_unset (&val);
-
- children = gtk_container_get_children (GTK_CONTAINER (data));
-
- for (c = children, i = 0; c; c = c->next, i++)
- {
- block_controller (G_OBJECT (c->data));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (c->data),
- (fclass->values[i].value & flags) != 0);
- unblock_controller (G_OBJECT (c->data));
- }
-
- g_list_free (children);
-}
-
-static gunichar
-unichar_get_value (GtkEntry *entry)
-{
- const gchar *text = gtk_entry_get_text (entry);
-
- if (text[0])
- return g_utf8_get_char (text);
- else
- return 0;
-}
-
-static void
-unichar_modified (GtkEntry *entry, gpointer data)
-{
- ObjectProperty *p = data;
- gunichar val = unichar_get_value (entry);
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, val, NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, val, NULL);
-}
-
-static void
-unichar_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkEntry *entry = GTK_ENTRY (data);
- gunichar new_val;
- gunichar old_val = unichar_get_value (entry);
- GValue val = G_VALUE_INIT;
- gchar buf[7];
- gint len;
-
- g_value_init (&val, pspec->value_type);
- get_property_value (object, pspec, &val);
- new_val = (gunichar)g_value_get_uint (&val);
-
- if (new_val != old_val)
- {
- if (!new_val)
- len = 0;
- else
- len = g_unichar_to_utf8 (new_val, buf);
-
- buf[len] = '\0';
-
- block_controller (G_OBJECT (entry));
- gtk_entry_set_text (entry, buf);
- unblock_controller (G_OBJECT (entry));
- }
-}
-
-static void
-pointer_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkLabel *label = GTK_LABEL (data);
- gchar *str;
- gpointer ptr;
-
- g_object_get (object, pspec->name, &ptr, NULL);
-
- str = g_strdup_printf ("Pointer: %p", ptr);
- gtk_label_set_text (label, str);
- g_free (str);
-}
-
-static gchar *
-object_label (GObject *obj, GParamSpec *pspec)
-{
- const gchar *name;
-
- if (obj)
- name = g_type_name (G_TYPE_FROM_INSTANCE (obj));
- else if (pspec)
- name = g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec));
- else
- name = "unknown";
- return g_strdup_printf ("Object: %p (%s)", obj, name);
-}
-
-static void
-object_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkWidget *label, *button;
- gchar *str;
- GObject *obj;
-
- GList *children = gtk_container_get_children (GTK_CONTAINER (data));
- label = GTK_WIDGET (children->data);
- button = GTK_WIDGET (children->next->data);
- g_object_get (object, pspec->name, &obj, NULL);
- g_list_free (children);
-
- str = object_label (obj, pspec);
-
- gtk_label_set_text (GTK_LABEL (label), str);
- gtk_widget_set_sensitive (button, G_IS_OBJECT (obj));
-
- if (obj)
- g_object_unref (obj);
-
- g_free (str);
-}
-
-static void
-model_destroy (gpointer data)
-{
- g_object_steal_data (data, "model-object");
- gtk_widget_destroy (data);
-}
-
-static void
-window_destroy (gpointer data)
-{
- g_object_steal_data (data, "prop-editor-win");
-}
-
-static void
-object_properties (GtkWidget *button,
- GObject *object)
-{
- gchar *name;
- GObject *obj;
-
- name = (gchar *) g_object_get_data (G_OBJECT (button), "property-name");
- g_object_get (object, name, &obj, NULL);
- if (G_IS_OBJECT (obj))
- create_prop_editor (obj, 0);
-}
-
-static void
-rgba_modified (GtkColorButton *cb, gpointer data)
-{
- ObjectProperty *p = data;
- GdkRGBA color;
-
- gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (cb), &color);
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, &color, NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, &color, NULL);
-}
-
-static void
-rgba_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkColorButton *cb = GTK_COLOR_BUTTON (data);
- GValue val = G_VALUE_INIT;
- GdkRGBA *color;
- GdkRGBA cb_color;
-
- g_value_init (&val, GDK_TYPE_RGBA);
- get_property_value (object, pspec, &val);
-
- color = g_value_get_boxed (&val);
- gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (cb), &cb_color);
-
- if (color != NULL && !gdk_rgba_equal (color, &cb_color))
- {
- block_controller (G_OBJECT (cb));
- gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (cb), color);
- unblock_controller (G_OBJECT (cb));
- }
-
- g_value_unset (&val);
-}
-
-static void
-color_modified (GtkColorButton *cb, gpointer data)
-{
- ObjectProperty *p = data;
- GValue val = G_VALUE_INIT;
-
- g_value_init (&val, GDK_TYPE_COLOR);
- g_object_get_property (G_OBJECT (cb), "color", &val);
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set_property (GTK_CONTAINER (parent),
- widget, p->spec->name, &val);
- }
- else
- g_object_set_property (p->obj, p->spec->name, &val);
-
- g_value_unset (&val);
-}
-
-static void
-color_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkColorButton *cb = GTK_COLOR_BUTTON (data);
- GValue val = G_VALUE_INIT;
-
- g_value_init (&val, GDK_TYPE_COLOR);
- get_property_value (object, pspec, &val);
-
- if (g_value_get_boxed (&val))
- {
- block_controller (G_OBJECT (cb));
- g_object_set_property (G_OBJECT (cb), "color", &val);
- unblock_controller (G_OBJECT (cb));
- }
-
- g_value_unset (&val);
-}
-
-static void
-font_modified (GtkFontChooser *fb, GParamSpec *pspec, gpointer data)
-{
- ObjectProperty *p = data;
- PangoFontDescription *font_desc;
-
- font_desc = gtk_font_chooser_get_font_desc (fb);
-
- if (is_child_property (p->spec))
- {
- GtkWidget *widget = GTK_WIDGET (p->obj);
- GtkWidget *parent = gtk_widget_get_parent (widget);
-
- gtk_container_child_set (GTK_CONTAINER (parent),
- widget, p->spec->name, font_desc, NULL);
- }
- else
- g_object_set (p->obj, p->spec->name, font_desc, NULL);
-
- pango_font_description_free (font_desc);
-}
-
-static void
-font_changed (GObject *object, GParamSpec *pspec, gpointer data)
-{
- GtkFontChooser *fb = GTK_FONT_CHOOSER (data);
- GValue val = G_VALUE_INIT;
- const PangoFontDescription *font_desc;
- PangoFontDescription *fb_font_desc;
-
- g_value_init (&val, PANGO_TYPE_FONT_DESCRIPTION);
- get_property_value (object, pspec, &val);
-
- font_desc = g_value_get_boxed (&val);
- fb_font_desc = gtk_font_chooser_get_font_desc (fb);
-
- if (font_desc == NULL ||
- (fb_font_desc != NULL &&
- !pango_font_description_equal (fb_font_desc, font_desc)))
- {
- block_controller (G_OBJECT (fb));
- gtk_font_chooser_set_font_desc (fb, font_desc);
- unblock_controller (G_OBJECT (fb));
- }
-
- g_value_unset (&val);
- pango_font_description_free (fb_font_desc);
-}
-
-
-static GtkWidget *
-property_widget (GObject *object,
- GParamSpec *spec,
- gboolean can_modify)
-{
- GtkWidget *prop_edit;
- GtkAdjustment *adj;
- gchar *msg;
- GType type = G_PARAM_SPEC_TYPE (spec);
-
- if (type == G_TYPE_PARAM_INT)
- {
- adj = gtk_adjustment_new (G_PARAM_SPEC_INT (spec)->default_value,
- G_PARAM_SPEC_INT (spec)->minimum,
- G_PARAM_SPEC_INT (spec)->maximum,
- 1,
- MAX ((G_PARAM_SPEC_INT (spec)->maximum - G_PARAM_SPEC_INT (spec)->minimum) / 10, 1),
- 0.0);
-
- prop_edit = gtk_spin_button_new (adj, 1.0, 0);
-
- g_object_connect_property (object, spec,
- G_CALLBACK (int_changed),
- adj, G_OBJECT (adj));
-
- if (can_modify)
- connect_controller (G_OBJECT (adj), "value_changed",
- object, spec, G_CALLBACK (int_modified));
- }
- else if (type == G_TYPE_PARAM_UINT)
- {
- adj = gtk_adjustment_new (G_PARAM_SPEC_UINT (spec)->default_value,
- G_PARAM_SPEC_UINT (spec)->minimum,
- G_PARAM_SPEC_UINT (spec)->maximum,
- 1,
- MAX ((G_PARAM_SPEC_UINT (spec)->maximum - G_PARAM_SPEC_UINT (spec)->minimum) / 10, 1),
- 0.0);
-
- prop_edit = gtk_spin_button_new (adj, 1.0, 0);
-
- g_object_connect_property (object, spec,
- G_CALLBACK (uint_changed),
- adj, G_OBJECT (adj));
-
- if (can_modify)
- connect_controller (G_OBJECT (adj), "value_changed",
- object, spec, G_CALLBACK (uint_modified));
- }
- else if (type == G_TYPE_PARAM_FLOAT)
- {
- adj = gtk_adjustment_new (G_PARAM_SPEC_FLOAT (spec)->default_value,
- G_PARAM_SPEC_FLOAT (spec)->minimum,
- G_PARAM_SPEC_FLOAT (spec)->maximum,
- 0.1,
- MAX ((G_PARAM_SPEC_FLOAT (spec)->maximum - G_PARAM_SPEC_FLOAT (spec)->minimum) / 10, 0.1),
- 0.0);
-
- prop_edit = gtk_spin_button_new (adj, 0.1, 2);
-
- g_object_connect_property (object, spec,
- G_CALLBACK (float_changed),
- adj, G_OBJECT (adj));
-
- if (can_modify)
- connect_controller (G_OBJECT (adj), "value_changed",
- object, spec, G_CALLBACK (float_modified));
- }
- else if (type == G_TYPE_PARAM_DOUBLE)
- {
- adj = gtk_adjustment_new (G_PARAM_SPEC_DOUBLE (spec)->default_value,
- G_PARAM_SPEC_DOUBLE (spec)->minimum,
- G_PARAM_SPEC_DOUBLE (spec)->maximum,
- 0.1,
- MAX ((G_PARAM_SPEC_DOUBLE (spec)->maximum - G_PARAM_SPEC_DOUBLE (spec)->minimum) / 10, 0.1),
- 0.0);
-
- prop_edit = gtk_spin_button_new (adj, 0.1, 2);
-
- g_object_connect_property (object, spec,
- G_CALLBACK (double_changed),
- adj, G_OBJECT (adj));
-
- if (can_modify)
- connect_controller (G_OBJECT (adj), "value_changed",
- object, spec, G_CALLBACK (double_modified));
- }
- else if (type == G_TYPE_PARAM_STRING)
- {
- prop_edit = gtk_entry_new ();
-
- g_object_connect_property (object, spec,
- G_CALLBACK (string_changed),
- prop_edit, G_OBJECT (prop_edit));
-
- if (can_modify)
- connect_controller (G_OBJECT (prop_edit), "changed",
- object, spec, G_CALLBACK (string_modified));
- }
- else if (type == G_TYPE_PARAM_BOOLEAN)
- {
- prop_edit = gtk_toggle_button_new_with_label ("");
-
- g_object_connect_property (object, spec,
- G_CALLBACK (bool_changed),
- prop_edit, G_OBJECT (prop_edit));
-
- if (can_modify)
- connect_controller (G_OBJECT (prop_edit), "toggled",
- object, spec, G_CALLBACK (bool_modified));
- }
- else if (type == G_TYPE_PARAM_ENUM)
- {
- {
- GEnumClass *eclass;
- gint j;
-
- prop_edit = gtk_combo_box_text_new ();
-
- eclass = G_ENUM_CLASS (g_type_class_ref (spec->value_type));
-
- j = 0;
- while (j < eclass->n_values)
- {
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (prop_edit),
- eclass->values[j].value_name);
- ++j;
- }
-
- g_type_class_unref (eclass);
-
- g_object_connect_property (object, spec,
- G_CALLBACK (enum_changed),
- prop_edit, G_OBJECT (prop_edit));
-
- if (can_modify)
- connect_controller (G_OBJECT (prop_edit), "changed",
- object, spec, G_CALLBACK (enum_modified));
- }
- }
- else if (type == G_TYPE_PARAM_FLAGS)
- {
- {
- GFlagsClass *fclass;
- gint j;
-
- prop_edit = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-
- fclass = G_FLAGS_CLASS (g_type_class_ref (spec->value_type));
-
- for (j = 0; j < fclass->n_values; j++)
- {
- GtkWidget *b;
-
- b = gtk_check_button_new_with_label (fclass->values[j].value_name);
- g_object_set_data (G_OBJECT (b), "index", GINT_TO_POINTER (j));
- gtk_widget_show (b);
- gtk_box_pack_start (GTK_BOX (prop_edit), b, FALSE, FALSE, 0);
- if (can_modify)
- connect_controller (G_OBJECT (b), "toggled",
- object, spec, G_CALLBACK (flags_modified));
- }
-
- g_type_class_unref (fclass);
-
- g_object_connect_property (object, spec,
- G_CALLBACK (flags_changed),
- prop_edit, G_OBJECT (prop_edit));
- }
- }
- else if (type == G_TYPE_PARAM_UNICHAR)
- {
- prop_edit = gtk_entry_new ();
- gtk_entry_set_max_length (GTK_ENTRY (prop_edit), 1);
-
- g_object_connect_property (object, spec,
- G_CALLBACK (unichar_changed),
- prop_edit, G_OBJECT (prop_edit));
-
- if (can_modify)
- connect_controller (G_OBJECT (prop_edit), "changed",
- object, spec, G_CALLBACK (unichar_modified));
- }
- else if (type == G_TYPE_PARAM_POINTER)
- {
- prop_edit = gtk_label_new ("");
-
- g_object_connect_property (object, spec,
- G_CALLBACK (pointer_changed),
- prop_edit, G_OBJECT (prop_edit));
- }
- else if (type == G_TYPE_PARAM_OBJECT)
- {
- GtkWidget *label, *button;
-
- prop_edit = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
-
- label = gtk_label_new ("");
- button = gtk_button_new_with_label ("Properties");
- g_object_set_data (G_OBJECT (button), "property-name", (gpointer) spec->name);
- g_signal_connect (button, "clicked",
- G_CALLBACK (object_properties),
- object);
-
- gtk_container_add (GTK_CONTAINER (prop_edit), label);
- gtk_container_add (GTK_CONTAINER (prop_edit), button);
-
- g_object_connect_property (object, spec,
- G_CALLBACK (object_changed),
- prop_edit, G_OBJECT (label));
-
- /* The Properties button is not really modifying, anyway */
- can_modify = TRUE;
- }
- else if (type == G_TYPE_PARAM_BOXED &&
- G_PARAM_SPEC_VALUE_TYPE (spec) == GDK_TYPE_RGBA)
- {
- prop_edit = gtk_color_button_new ();
- gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (prop_edit), TRUE);
-
- g_object_connect_property (object, spec,
- G_CALLBACK (rgba_changed),
- prop_edit, G_OBJECT (prop_edit));
-
- if (can_modify)
- connect_controller (G_OBJECT (prop_edit), "color-set",
- object, spec, G_CALLBACK (rgba_modified));
- }
- else if (type == G_TYPE_PARAM_BOXED &&
- G_PARAM_SPEC_VALUE_TYPE (spec) == GDK_TYPE_COLOR)
- {
- prop_edit = gtk_color_button_new ();
-
- g_object_connect_property (object, spec,
- G_CALLBACK (color_changed),
- prop_edit, G_OBJECT (prop_edit));
-
- if (can_modify)
- connect_controller (G_OBJECT (prop_edit), "color-set",
- object, spec, G_CALLBACK (color_modified));
- }
- else if (type == G_TYPE_PARAM_BOXED &&
- G_PARAM_SPEC_VALUE_TYPE (spec) == PANGO_TYPE_FONT_DESCRIPTION)
- {
- prop_edit = gtk_font_button_new ();
-
- g_object_connect_property (object, spec,
- G_CALLBACK (font_changed),
- prop_edit, G_OBJECT (prop_edit));
-
- if (can_modify)
- connect_controller (G_OBJECT (prop_edit), "notify::font-desc",
- object, spec, G_CALLBACK (font_modified));
- }
- else
- {
- msg = g_strdup_printf ("uneditable property type: %s",
- g_type_name (G_PARAM_SPEC_TYPE (spec)));
- prop_edit = gtk_label_new (msg);
- g_free (msg);
- gtk_widget_set_halign (prop_edit, GTK_ALIGN_START);
- gtk_widget_set_valign (prop_edit, GTK_ALIGN_CENTER);
- }
-
- if (!can_modify)
- gtk_widget_set_sensitive (prop_edit, FALSE);
-
- if (g_param_spec_get_blurb (spec))
- gtk_widget_set_tooltip_text (prop_edit, g_param_spec_get_blurb (spec));
-
- return prop_edit;
-}
-
-static GtkWidget *
-properties_from_type (GObject *object,
- GType type)
-{
- GtkWidget *prop_edit;
- GtkWidget *label;
- GtkWidget *sw;
- GtkWidget *vbox;
- GtkWidget *grid;
- GParamSpec **specs;
- guint n_specs;
- int i;
-
- if (G_TYPE_IS_INTERFACE (type))
- {
- gpointer vtable = g_type_default_interface_peek (type);
- specs = g_object_interface_list_properties (vtable, &n_specs);
- }
- else
- {
- GObjectClass *class = G_OBJECT_CLASS (g_type_class_peek (type));
- specs = g_object_class_list_properties (class, &n_specs);
- }
-
- if (n_specs == 0) {
- g_free (specs);
- return NULL;
- }
-
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
- gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
-
- i = 0;
- while (i < n_specs)
- {
- GParamSpec *spec = specs[i];
- gboolean can_modify;
-
- prop_edit = NULL;
-
- can_modify = ((spec->flags & G_PARAM_WRITABLE) != 0 &&
- (spec->flags & G_PARAM_CONSTRUCT_ONLY) == 0);
-
- if ((spec->flags & G_PARAM_READABLE) == 0)
- {
- /* can't display unreadable properties */
- ++i;
- continue;
- }
-
- if (spec->owner_type != type)
- {
- /* we're only interested in params of type */
- ++i;
- continue;
- }
-
- label = gtk_label_new (g_param_spec_get_nick (spec));
- gtk_widget_set_halign (label, GTK_ALIGN_START);
- gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_grid_attach (GTK_GRID (grid), label, 0, i, 1, 1);
-
- prop_edit = property_widget (object, spec, can_modify);
- gtk_grid_attach (GTK_GRID (grid), prop_edit, 1, i, 1, 1);
-
- /* set initial value */
- g_object_notify (object, spec->name);
-
- ++i;
- }
-
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-
- gtk_container_add (GTK_CONTAINER (sw), vbox);
-
- g_free (specs);
-
- return sw;
-}
-
-static GtkWidget *
-child_properties_from_object (GObject *object)
-{
- GtkWidget *prop_edit;
- GtkWidget *label;
- GtkWidget *sw;
- GtkWidget *vbox;
- GtkWidget *grid;
- GtkWidget *parent;
- GParamSpec **specs;
- guint n_specs;
- gint i;
-
- if (!GTK_IS_WIDGET (object))
- return NULL;
-
- parent = gtk_widget_get_parent (GTK_WIDGET (object));
-
- if (!parent)
- return NULL;
-
- specs = gtk_container_class_list_child_properties (G_OBJECT_GET_CLASS (parent), &n_specs);
-
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
- gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
-
- i = 0;
- while (i < n_specs)
- {
- GParamSpec *spec = specs[i];
- gboolean can_modify;
-
- prop_edit = NULL;
-
- can_modify = ((spec->flags & G_PARAM_WRITABLE) != 0 &&
- (spec->flags & G_PARAM_CONSTRUCT_ONLY) == 0);
-
- if ((spec->flags & G_PARAM_READABLE) == 0)
- {
- /* can't display unreadable properties */
- ++i;
- continue;
- }
-
- label = gtk_label_new (g_param_spec_get_nick (spec));
- gtk_widget_set_halign (label, GTK_ALIGN_START);
- gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_grid_attach (GTK_GRID (grid), label, 0, i, 1, 1);
-
- mark_child_property (spec);
- prop_edit = property_widget (object, spec, can_modify);
- gtk_grid_attach (GTK_GRID (grid), prop_edit, 1, i, 1, 1);
-
- /* set initial value */
- gtk_widget_child_notify (GTK_WIDGET (object), spec->name);
-
- ++i;
- }
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-
- gtk_container_add (GTK_CONTAINER (sw), vbox);
-
- g_free (specs);
-
- return sw;
-}
-
-static void
-child_properties (GtkWidget *button,
- GObject *object)
-{
- create_prop_editor (object, 0);
-}
-
-static GtkWidget *
-children_from_object (GObject *object)
-{
- GList *children, *c;
- GtkWidget *grid, *label, *prop_edit, *button, *vbox, *sw;
- gchar *str;
- gint i;
-
- if (!GTK_IS_CONTAINER (object))
- return NULL;
-
- children = gtk_container_get_children (GTK_CONTAINER (object));
-
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
- gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
-
- for (c = children, i = 0; c; c = c->next, i++)
- {
- object = c->data;
-
- label = gtk_label_new ("Child");
- gtk_widget_set_halign (label, GTK_ALIGN_START);
- gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_grid_attach (GTK_GRID (grid), label, 0, i, 1, 1);
-
- prop_edit = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
-
- str = object_label (object, NULL);
- label = gtk_label_new (str);
- g_free (str);
- button = gtk_button_new_with_label ("Properties");
- g_signal_connect (button, "clicked",
- G_CALLBACK (child_properties),
- object);
-
- gtk_container_add (GTK_CONTAINER (prop_edit), label);
- gtk_container_add (GTK_CONTAINER (prop_edit), button);
-
- gtk_grid_attach (GTK_GRID (grid), prop_edit, 1, i, 1, 1);
- }
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-
- gtk_container_add (GTK_CONTAINER (sw), vbox);
-
- g_list_free (children);
-
- return sw;
-}
-
-static GtkWidget *
-cells_from_object (GObject *object)
-{
- GList *cells, *c;
- GtkWidget *grid, *label, *prop_edit, *button, *vbox, *sw;
- gchar *str;
- gint i;
-
- if (!GTK_IS_CELL_LAYOUT (object))
- return NULL;
-
- cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (object));
-
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 10);
- gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
-
- for (c = cells, i = 0; c; c = c->next, i++)
- {
- object = c->data;
-
- label = gtk_label_new ("Cell");
- gtk_widget_set_halign (label, GTK_ALIGN_START);
- gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_grid_attach (GTK_GRID (grid), label, 0, i, 1, 1);
-
- prop_edit = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
-
- str = object_label (object, NULL);
- label = gtk_label_new (str);
- g_free (str);
- button = gtk_button_new_with_label ("Properties");
- g_signal_connect (button, "clicked",
- G_CALLBACK (child_properties),
- object);
-
- gtk_container_add (GTK_CONTAINER (prop_edit), label);
- gtk_container_add (GTK_CONTAINER (prop_edit), button);
-
- gtk_grid_attach (GTK_GRID (grid), prop_edit, 1, i, 1, 1);
- }
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-
- gtk_container_add (GTK_CONTAINER (sw), vbox);
-
- g_list_free (cells);
-
- return sw;
-}
-
-static void
-open_parent_widget (GtkWidget *button,
- GObject *object)
-{
- GtkWidget *parent;
-
- parent = gtk_widget_get_parent (GTK_WIDGET (object));
- if (parent != NULL)
- create_prop_editor (G_OBJECT (parent), 0);
-}
-
-
-/* Pass zero for type if you want all properties */
-GtkWidget*
-create_prop_editor (GObject *object,
- GType type)
-{
- GtkWidget *win, *parent;
- GtkWidget *notebook;
- GtkWidget *properties;
- GtkWidget *label;
- GtkWidget *button;
- GtkWidget *vbox;
- gchar *title;
- GType *ifaces;
- guint n_ifaces;
-
- if ((win = g_object_get_data (G_OBJECT (object), "prop-editor-win")))
- {
- gtk_window_present (GTK_WINDOW (win));
- return win;
- }
-
- win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- if (GTK_IS_WIDGET (object))
- gtk_window_set_screen (GTK_WINDOW (win),
- gtk_widget_get_screen (GTK_WIDGET (object)));
-
- /* hold a weak ref to the object we're editing */
- g_object_set_data_full (G_OBJECT (object), "prop-editor-win", win, model_destroy);
- g_object_set_data_full (G_OBJECT (win), "model-object", object, window_destroy);
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_container_add (GTK_CONTAINER (win), vbox);
-
- if (type == 0)
- {
- notebook = gtk_notebook_new ();
- gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_LEFT);
-
- gtk_box_pack_start (GTK_BOX (vbox), notebook, TRUE, TRUE, 0);
-
- type = G_TYPE_FROM_INSTANCE (object);
-
- title = g_strdup_printf ("Properties of %s widget", g_type_name (type));
- gtk_window_set_title (GTK_WINDOW (win), title);
- g_free (title);
-
- while (type)
- {
- properties = properties_from_type (object, type);
- if (properties)
- {
- label = gtk_label_new (g_type_name (type));
- gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
- properties, label);
- }
-
- type = g_type_parent (type);
- }
-
- ifaces = g_type_interfaces (G_TYPE_FROM_INSTANCE (object), &n_ifaces);
- while (n_ifaces--)
- {
- properties = properties_from_type (object, ifaces[n_ifaces]);
- if (properties)
- {
- label = gtk_label_new (g_type_name (ifaces[n_ifaces]));
- gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
- properties, label);
- }
- }
-
- g_free (ifaces);
-
- properties = child_properties_from_object (object);
- if (properties)
- {
- label = gtk_label_new ("Child properties");
- gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
- properties, label);
- }
-
- properties = children_from_object (object);
- if (properties)
- {
- label = gtk_label_new ("Children");
- gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
- properties, label);
- }
-
- properties = cells_from_object (object);
- if (properties)
- {
- label = gtk_label_new ("Cell renderers");
- gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
- properties, label);
- }
-
- if (GTK_IS_WIDGET (object))
- {
- parent = gtk_widget_get_parent (GTK_WIDGET (object));
- if (parent != NULL)
- {
- button = gtk_button_new_with_label ("Parent widget");
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
- g_signal_connect (button, "clicked",
- G_CALLBACK (open_parent_widget),
- object);
- }
- }
- }
- else
- {
- properties = properties_from_type (object, type);
- gtk_box_pack_start (GTK_BOX (vbox), properties, TRUE, TRUE, 0);
- title = g_strdup_printf ("Properties of %s", g_type_name (type));
- gtk_window_set_title (GTK_WINDOW (win), title);
- g_free (title);
- }
-
- gtk_window_set_default_size (GTK_WINDOW (win), -1, 400);
-
- gtk_widget_show_all (win);
-
- return win;
-}
-
diff --git a/tests/prop-editor.h b/tests/prop-editor.h
deleted file mode 100644
index 43a4bf3e6f..0000000000
--- a/tests/prop-editor.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* prop-editor.h
- * Copyright (C) 2000 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <gtk/gtk.h>
-
-#ifndef __PROP_EDITOR_H__
-#define __PROP_EDITOR_H__
-
-G_BEGIN_DECLS
-
-GtkWidget *create_prop_editor (GObject *object,
- GType type);
-
-G_END_DECLS
-
-#endif /* __PROP_EDITOR_H__ */
diff --git a/tests/testboxcss.c b/tests/testboxcss.c
index 8e4ca2fac4..06290d95c7 100644
--- a/tests/testboxcss.c
+++ b/tests/testboxcss.c
@@ -17,7 +17,6 @@
*/
#include "config.h"
#include <gtk/gtk.h>
-#include "prop-editor.h"
/* This is exactly the style information you've been looking for */
#define GTK_STYLE_PROVIDER_PRIORITY_FORCE G_MAXUINT
diff --git a/tests/testentrycompletion.c b/tests/testentrycompletion.c
index 898b8d3bb1..16f7f10832 100644
--- a/tests/testentrycompletion.c
+++ b/tests/testentrycompletion.c
@@ -21,8 +21,6 @@
#include <string.h>
#include <gtk/gtk.h>
-#include "prop-editor.h"
-
/* Don't copy this bad example; inline RGB data is always a better
* idea than inline XPMs.
*/
@@ -288,27 +286,6 @@ match_selected_cb (GtkEntryCompletion *completion,
return TRUE;
}
-static void
-new_prop_editor (GObject *object)
-{
- gtk_widget_show (create_prop_editor (object, G_OBJECT_TYPE (object)));
-}
-
-static void
-add_with_prop_edit_button (GtkWidget *vbox, GtkWidget *entry, GtkEntryCompletion *completion)
-{
- GtkWidget *hbox, *button;
-
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-
- gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
-
- button = gtk_button_new_with_label ("Properties");
- g_signal_connect_swapped (button, "clicked", G_CALLBACK (new_prop_editor), completion);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-}
-
int
main (int argc, char *argv[])
{
@@ -346,7 +323,7 @@ main (int argc, char *argv[])
gtk_entry_set_completion (GTK_ENTRY (entry), completion);
g_object_unref (completion);
- add_with_prop_edit_button (vbox, entry, completion);
+ gtk_container_add (GTK_CONTAINER (vbox), entry);
/* Create a tree model and use it as the completion model */
completion_model = create_simple_completion_model ();
@@ -366,7 +343,7 @@ main (int argc, char *argv[])
gtk_entry_set_completion (GTK_ENTRY (entry), completion);
g_object_unref (completion);
- add_with_prop_edit_button (vbox, entry, completion);
+ gtk_container_add (GTK_CONTAINER (vbox), entry);
/* Create a tree model and use it as the completion model */
completion_model = create_completion_model ();
@@ -403,7 +380,7 @@ main (int argc, char *argv[])
gtk_entry_set_completion (GTK_ENTRY (entry), completion);
g_object_unref (completion);
- add_with_prop_edit_button (vbox, entry, completion);
+ gtk_container_add (GTK_CONTAINER (vbox), entry);
/* Create a tree model and use it as the completion model */
completion_model = GTK_TREE_MODEL (gtk_list_store_new (1, G_TYPE_STRING));
@@ -429,7 +406,7 @@ main (int argc, char *argv[])
gtk_entry_set_completion (GTK_ENTRY (entry), completion);
g_object_unref (completion);
- add_with_prop_edit_button (vbox, entry, completion);
+ gtk_container_add (GTK_CONTAINER (vbox), entry);
gtk_widget_show_all (window);
diff --git a/tests/testentryicons.c b/tests/testentryicons.c
index 8e6122c34c..211356de32 100644
--- a/tests/testentryicons.c
+++ b/tests/testentryicons.c
@@ -1,6 +1,5 @@
#include <gtk/gtk.h>
#include <stdio.h>
-#include "prop-editor.h"
static gboolean
delete_event_cb (GtkWidget *editor,
@@ -13,27 +12,6 @@ delete_event_cb (GtkWidget *editor,
}
static void
-properties_cb (GtkWidget *button,
- GObject *entry)
-{
- GtkWidget *editor;
-
- editor = g_object_get_data (entry, "properties-dialog");
-
- if (editor == NULL)
- {
- editor = create_prop_editor (G_OBJECT (entry), G_TYPE_INVALID);
- gtk_container_set_border_width (GTK_CONTAINER (editor), 12);
- gtk_window_set_transient_for (GTK_WINDOW (editor),
- GTK_WINDOW (gtk_widget_get_toplevel (button)));
- g_signal_connect (editor, "delete-event", G_CALLBACK (delete_event_cb), NULL);
- g_object_set_data (entry, "properties-dialog", editor);
- }
-
- gtk_window_present (GTK_WINDOW (editor));
-}
-
-static void
clear_pressed (GtkEntry *entry, gint icon, GdkEvent *event, gpointer data)
{
if (icon == GTK_ENTRY_ICON_SECONDARY)
@@ -92,7 +70,6 @@ main (int argc, char **argv)
GtkWidget *grid;
GtkWidget *label;
GtkWidget *entry;
- GtkWidget *button;
GIcon *icon;
GtkTargetList *tlist;
@@ -136,12 +113,6 @@ main (int argc, char **argv)
GTK_ENTRY_ICON_PRIMARY,
"Open a file");
- button = gtk_button_new_with_label ("Properties");
- gtk_grid_attach (GTK_GRID (grid), button, 2, 0, 1, 1);
- g_signal_connect (button, "clicked",
- G_CALLBACK (properties_cb), entry);
-
-
/*
* Save File - sets the icon using an icon name.
*/
@@ -173,11 +144,6 @@ main (int argc, char **argv)
G_CALLBACK (drag_data_get_cb), NULL);
gtk_target_list_unref (tlist);
- button = gtk_button_new_with_label ("Properties");
- gtk_grid_attach (GTK_GRID (grid), button, 2, 1, 1, 1);
- g_signal_connect (button, "clicked",
- G_CALLBACK (properties_cb), entry);
-
/*
* Search - Uses a helper function
*/
@@ -200,11 +166,6 @@ main (int argc, char **argv)
g_signal_connect (entry, "icon-press", G_CALLBACK (clear_pressed), NULL);
- button = gtk_button_new_with_label ("Properties");
- gtk_grid_attach (GTK_GRID (grid), button, 2, 2, 1, 1);
- g_signal_connect (button, "clicked",
- G_CALLBACK (properties_cb), entry);
-
/*
* Password - Sets the icon using an icon name
*/
@@ -226,11 +187,6 @@ main (int argc, char **argv)
GTK_ENTRY_ICON_PRIMARY,
FALSE);
- button = gtk_button_new_with_label ("Properties");
- gtk_grid_attach (GTK_GRID (grid), button, 2, 3, 1, 1);
- g_signal_connect (button, "clicked",
- G_CALLBACK (properties_cb), entry);
-
/* Name - Does not set any icons. */
label = gtk_label_new ("Name:");
gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
@@ -241,11 +197,6 @@ main (int argc, char **argv)
gtk_widget_set_hexpand (entry, TRUE);
gtk_grid_attach (GTK_GRID (grid), entry, 1, 4, 1, 1);
- button = gtk_button_new_with_label ("Properties");
- gtk_grid_attach (GTK_GRID (grid), button, 2, 4, 1, 1);
- g_signal_connect (button, "clicked",
- G_CALLBACK (properties_cb), entry);
-
gtk_widget_show_all (window);
gtk_main();
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c
index 4d86e79e7e..013415a8ad 100644
--- a/tests/testfilechooser.c
+++ b/tests/testfilechooser.c
@@ -35,8 +35,6 @@
# endif
#endif
-#include "prop-editor.h"
-
static GtkWidget *preview_label;
static GtkWidget *preview_image;
static GtkFileChooserAction action;
@@ -691,7 +689,6 @@ main (int argc, char **argv)
/* Extra controls for manipulating the test environment
*/
- create_prop_editor (G_OBJECT (dialog), GTK_TYPE_FILE_CHOOSER);
control_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
diff --git a/tests/testfilechooserbutton.c b/tests/testfilechooserbutton.c
index 31e98e5a1e..0aaf9c478a 100644
--- a/tests/testfilechooserbutton.c
+++ b/tests/testfilechooserbutton.c
@@ -31,8 +31,6 @@
#include <gtk/gtk.h>
-#include "prop-editor.h"
-
static gchar *backend = "gtk+";
static gboolean rtl = FALSE;
static GOptionEntry entries[] = {
@@ -55,28 +53,6 @@ delete_event_cb (GtkWidget *editor,
static void
-properties_button_clicked_cb (GtkWidget *button,
- GObject *entry)
-{
- GtkWidget *editor;
-
- editor = g_object_get_data (entry, "properties-dialog");
-
- if (editor == NULL)
- {
- editor = create_prop_editor (G_OBJECT (entry), G_TYPE_INVALID);
- gtk_container_set_border_width (GTK_CONTAINER (editor), 12);
- gtk_window_set_transient_for (GTK_WINDOW (editor),
- GTK_WINDOW (gtk_widget_get_toplevel (button)));
- g_signal_connect (editor, "delete-event", G_CALLBACK (delete_event_cb), NULL);
- g_object_set_data (entry, "properties-dialog", editor);
- }
-
- gtk_window_present (GTK_WINDOW (editor));
-}
-
-
-static void
print_selected_path_clicked_cb (GtkWidget *button,
gpointer user_data)
{
@@ -312,10 +288,6 @@ main (int argc,
g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL);
gtk_box_pack_start (GTK_BOX (hbox), chooser, TRUE, TRUE, 0);
- button = gtk_button_new_with_label ("Properties");
- g_signal_connect (button, "clicked", G_CALLBACK (properties_button_clicked_cb), chooser);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-
button = gtk_button_new_with_label ("Tests");
g_signal_connect (button, "clicked", G_CALLBACK (tests_button_clicked_cb), chooser);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
@@ -342,10 +314,6 @@ main (int argc,
g_signal_connect (chooser, "update-preview", G_CALLBACK (chooser_update_preview_cb), NULL);
gtk_box_pack_start (GTK_BOX (hbox), chooser, TRUE, TRUE, 0);
- button = gtk_button_new_with_label ("Properties");
- g_signal_connect (button, "clicked", G_CALLBACK (properties_button_clicked_cb), chooser);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-
button = gtk_button_new_with_label ("Tests");
g_signal_connect (button, "clicked", G_CALLBACK (tests_button_clicked_cb), chooser);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
diff --git a/tests/testfontchooser.c b/tests/testfontchooser.c
index a2f54e042e..7ecab02d17 100644
--- a/tests/testfontchooser.c
+++ b/tests/testfontchooser.c
@@ -16,7 +16,6 @@
*/
#include <gtk/gtk.h>
-#include "prop-editor.h"
static void
notify_font_cb (GtkFontChooser *fontchooser, GParamSpec *pspec, gpointer data)
@@ -87,8 +86,6 @@ main (int argc, char *argv[])
gtk_font_chooser_set_preview_text (GTK_FONT_CHOOSER (fontchooser), "[user@host ~]$ &>>");
gtk_font_chooser_set_show_preview_entry (GTK_FONT_CHOOSER (fontchooser), FALSE);
- create_prop_editor (G_OBJECT (fontchooser), GTK_TYPE_FONT_CHOOSER);
-
gtk_main ();
return 0;
diff --git a/tests/testfontchooserdialog.c b/tests/testfontchooserdialog.c
index 0db130bc88..574b138b1c 100644
--- a/tests/testfontchooserdialog.c
+++ b/tests/testfontchooserdialog.c
@@ -17,7 +17,6 @@
#include <string.h>
#include <gtk/gtk.h>
-#include "prop-editor.h"
static gboolean
monospace_filter (const PangoFontFamily *family,
@@ -93,8 +92,6 @@ main (int argc, char *argv[])
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
- create_prop_editor (G_OBJECT (font_button), 0);
-
gtk_main ();
return 0;
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 815ad7c8ab..94648a071b 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -45,8 +45,6 @@
#define sleep(n) _sleep(n)
#endif
-#include "prop-editor.h"
-
#include "test.xpm"
gboolean
@@ -3950,15 +3948,6 @@ entry_toggle_pulse (GtkWidget *checkbutton,
}
static void
-props_clicked (GtkWidget *button,
- GObject *object)
-{
- GtkWidget *window = create_prop_editor (object, 0);
-
- gtk_window_set_title (GTK_WINDOW (window), "Object Properties");
-}
-
-static void
create_entry (GtkWidget *widget)
{
static GtkWidget *window = NULL;
@@ -4004,12 +3993,6 @@ create_entry (GtkWidget *widget)
gtk_editable_select_region (GTK_EDITABLE (entry), 0, 5);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
- button = gtk_button_new_with_mnemonic ("_Props");
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
- g_signal_connect (button, "clicked",
- G_CALLBACK (props_clicked),
- entry);
-
cb = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
gtk_combo_box_text_append_text (cb, "item0");
@@ -5078,7 +5061,6 @@ create_color_selection (GtkWidget *widget)
GtkWidget *picker;
GtkWidget *hbox;
GtkWidget *label;
- GtkWidget *button;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
@@ -5101,12 +5083,6 @@ create_color_selection (GtkWidget *widget)
picker = gtk_color_button_new ();
gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (picker), TRUE);
gtk_container_add (GTK_CONTAINER (hbox), picker);
-
- button = gtk_button_new_with_mnemonic ("_Props");
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
- g_signal_connect (button, "clicked",
- G_CALLBACK (props_clicked),
- picker);
}
if (!gtk_widget_get_visible (window))
@@ -6245,31 +6221,6 @@ create_notebook (GtkWidget *widget)
gtk_widget_destroy (window);
}
-void
-create_settings (GtkWidget *widget)
-{
- static GtkWidget *window = NULL;
-
- if (!window)
- {
- window = create_prop_editor (G_OBJECT (gtk_settings_get_default ()), GTK_TYPE_SETTINGS);
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
-
- gtk_widget_hide (window);
- gtk_window_set_title (GTK_WINDOW (window), "GTK+ Settings");
-
- g_signal_connect (window, "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &window);
- }
-
- if (!gtk_widget_get_visible (window))
- gtk_widget_show (window);
- else
- gtk_widget_destroy (window);
-}
-
/*
* GtkPanes
*/
@@ -6296,15 +6247,6 @@ toggle_shrink (GtkWidget *widget, GtkWidget *child)
gtk_container_child_set_property (container, child, "shrink", &value);
}
-static void
-paned_props_clicked (GtkWidget *button,
- GObject *paned)
-{
- GtkWidget *window = create_prop_editor (paned, GTK_TYPE_PANED);
-
- gtk_window_set_title (GTK_WINDOW (window), "Paned Properties");
-}
-
GtkWidget *
create_pane_options (GtkPaned *paned,
const gchar *frame_label,
@@ -6315,7 +6257,6 @@ create_pane_options (GtkPaned *paned,
GtkWidget *frame;
GtkWidget *grid;
GtkWidget *label;
- GtkWidget *button;
GtkWidget *check_button;
child1 = gtk_paned_get_child1 (paned);
@@ -6363,12 +6304,6 @@ create_pane_options (GtkPaned *paned,
G_CALLBACK (toggle_shrink),
child2);
- button = gtk_button_new_with_mnemonic ("_Properties");
- gtk_grid_attach (GTK_GRID (grid), button, 0, 3, 2, 1);
- g_signal_connect (button, "clicked",
- G_CALLBACK (paned_props_clicked),
- paned);
-
return frame;
}
@@ -8531,147 +8466,6 @@ find_widget_at_pointer (GdkDevice *device)
return NULL;
}
-struct PropertiesData {
- GtkWidget **window;
- GdkCursor *cursor;
- gboolean in_query;
- gulong handler;
-};
-
-static void
-destroy_properties (GtkWidget *widget,
- struct PropertiesData *data)
-{
- if (data->window)
- {
- *data->window = NULL;
- data->window = NULL;
- }
-
- if (data->cursor)
- {
- g_object_unref (data->cursor);
- data->cursor = NULL;
- }
-
- if (data->handler)
- {
- g_signal_handler_disconnect (widget, data->handler);
- data->handler = 0;
- }
-
- g_free (data);
-}
-
-static gint
-property_query_event (GtkWidget *widget,
- GdkEvent *event,
- struct PropertiesData *data)
-{
- GtkWidget *res_widget = NULL;
-
- if (!data->in_query)
- return FALSE;
-
- if (event->type == GDK_BUTTON_RELEASE)
- {
- gtk_grab_remove (widget);
- gdk_device_ungrab (gdk_event_get_device (event), GDK_CURRENT_TIME);
-
- res_widget = find_widget_at_pointer (gdk_event_get_device (event));
- if (res_widget)
- {
- g_object_set_data (G_OBJECT (res_widget), "prop-editor-screen",
- gtk_widget_get_screen (widget));
- create_prop_editor (G_OBJECT (res_widget), 0);
- }
-
- data->in_query = FALSE;
- }
- return FALSE;
-}
-
-
-static void
-query_properties (GtkButton *button,
- struct PropertiesData *data)
-{
- GtkWidget *widget = GTK_WIDGET (button);
- GdkDisplay *display;
- GdkDeviceManager *device_manager;
- GdkDevice *device;
-
- g_signal_connect (button, "event",
- G_CALLBACK (property_query_event), data);
-
- display = gtk_widget_get_display (widget);
-
- if (!data->cursor)
- data->cursor = gdk_cursor_new_for_display (display, GDK_TARGET);
-
- device_manager = gdk_display_get_device_manager (display);
- device = gdk_device_manager_get_client_pointer (device_manager);
- gdk_device_grab (device,
- gtk_widget_get_window (widget),
- GDK_OWNERSHIP_NONE,
- TRUE,
- GDK_BUTTON_RELEASE_MASK,
- data->cursor,
- GDK_CURRENT_TIME);
- gtk_grab_add (widget);
-
- data->in_query = TRUE;
-}
-
-static void
-create_properties (GtkWidget *widget)
-{
- static GtkWidget *window = NULL;
- GtkWidget *button;
- GtkWidget *vbox;
- GtkWidget *label;
- struct PropertiesData *data;
-
- data = g_new (struct PropertiesData, 1);
- data->window = &window;
- data->in_query = FALSE;
- data->cursor = NULL;
- data->handler = 0;
-
- if (!window)
- {
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- gtk_window_set_screen (GTK_WINDOW (window),
- gtk_widget_get_screen (widget));
-
- data->handler = g_signal_connect (window, "destroy",
- G_CALLBACK (destroy_properties),
- data);
-
- gtk_window_set_title (GTK_WINDOW (window), "test properties");
- gtk_container_set_border_width (GTK_CONTAINER (window), 10);
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
- gtk_container_add (GTK_CONTAINER (window), vbox);
-
- label = gtk_label_new ("This is just a dumb test to test properties.\nIf you need a generic module, get gtkparasite.");
- gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
-
- button = gtk_button_new_with_label ("Query properties");
- gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
- g_signal_connect (button, "clicked",
- G_CALLBACK (query_properties),
- data);
- }
-
- if (!gtk_widget_get_visible (window))
- gtk_widget_show_all (window);
- else
- gtk_widget_destroy (window);
-
-}
-
struct SnapshotData {
GtkWidget *toplevel_button;
GtkWidget **window;
@@ -9501,7 +9295,6 @@ struct {
{ "paned keyboard", create_paned_keyboard_navigation },
{ "pixbuf", create_pixbuf },
{ "progress bar", create_progress_bar },
- { "properties", create_properties },
{ "radio buttons", create_radio_buttons },
{ "range controls", create_range_controls },
{ "reparent", create_reparent },
@@ -9510,7 +9303,6 @@ struct {
{ "rotated text", create_rotated_text },
{ "saved position", create_saved_position },
{ "scrolled windows", create_scrolled_windows },
- { "settings", create_settings },
{ "shapes", create_shapes },
{ "size groups", create_size_groups },
{ "snapshot", create_snapshot },
diff --git a/tests/testiconview.c b/tests/testiconview.c
index ea1af1a1d8..010109aac3 100644
--- a/tests/testiconview.c
+++ b/tests/testiconview.c
@@ -18,7 +18,6 @@
#include <gtk/gtk.h>
#include <sys/types.h>
#include <string.h>
-#include "prop-editor.h"
#define NUMBER_OF_ITEMS 10
#define SOME_ITEMS 100
@@ -417,7 +416,6 @@ main (gint argc, gchar **argv)
GtkWidget *window, *icon_list, *scrolled_window;
GtkWidget *vbox, *bbox;
GtkWidget *button;
- GtkWidget *prop_editor;
GtkTreeModel *model;
GtkCellRenderer *cell;
GtkTreeViewColumn *tvc;
@@ -539,9 +537,6 @@ main (gint argc, gchar **argv)
GDK_ACTION_MOVE);
- prop_editor = create_prop_editor (G_OBJECT (icon_list), 0);
- gtk_widget_show_all (prop_editor);
-
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), icon_list);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
diff --git a/tests/testmenubutton.c b/tests/testmenubutton.c
index 6c15176915..670b9ee8d0 100644
--- a/tests/testmenubutton.c
+++ b/tests/testmenubutton.c
@@ -1,5 +1,4 @@
#include <gtk/gtk.h>
-#include "prop-editor.h"
#define INITIAL_HALIGN GTK_ALIGN_START
#define INITIAL_VALIGN GTK_ALIGN_START
@@ -131,7 +130,6 @@ int main (int argc, char **argv)
menubuttons = g_list_prepend (menubuttons, button);
gtk_menu_button_set_popup (GTK_MENU_BUTTON (button), menu_widget);
gtk_grid_attach (GTK_GRID (grid), button, 1, row++, 1, 1);
- gtk_widget_show (create_prop_editor (G_OBJECT (button), 0));
check = gtk_check_button_new_with_label ("Popover");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
diff --git a/tests/testnumerableicon.c b/tests/testnumerableicon.c
index 61bef1bca3..a9f309d67d 100644
--- a/tests/testnumerableicon.c
+++ b/tests/testnumerableicon.c
@@ -18,7 +18,6 @@
#include <stdlib.h>
#include <gtk/gtk.h>
-#include "prop-editor.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@@ -91,27 +90,6 @@ delete_event_cb (GtkWidget *editor,
}
static void
-properties_cb (GtkWidget *button,
- GObject *entry)
-{
- GtkWidget *editor;
-
- editor = g_object_get_data (entry, "properties-dialog");
-
- if (editor == NULL)
- {
- editor = create_prop_editor (G_OBJECT (entry), G_TYPE_INVALID);
- gtk_container_set_border_width (GTK_CONTAINER (editor), 12);
- gtk_window_set_transient_for (GTK_WINDOW (editor),
- GTK_WINDOW (gtk_widget_get_toplevel (button)));
- g_signal_connect (editor, "delete-event", G_CALLBACK (delete_event_cb), NULL);
- g_object_set_data (entry, "properties-dialog", editor);
- }
-
- gtk_window_present (GTK_WINDOW (editor));
-}
-
-static void
refresh_cb (GtkWidget *button,
gpointer user_data)
{
@@ -159,11 +137,6 @@ pack_numerable (GtkWidget *parent,
g_signal_connect (button, "clicked",
G_CALLBACK (button_clicked_cb), d);
- button = gtk_button_new_with_label ("Properties");
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
- g_signal_connect (button, "clicked",
- G_CALLBACK (properties_cb), numerable);
-
button = gtk_button_new_with_label ("Refresh");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
g_signal_connect (button, "clicked",
diff --git a/tests/testrecentchooser.c b/tests/testrecentchooser.c
index 4c48599323..4ac0722c4c 100644
--- a/tests/testrecentchooser.c
+++ b/tests/testrecentchooser.c
@@ -35,8 +35,6 @@
# endif
#endif
-#include "prop-editor.h"
-
static void
print_current_item (GtkRecentChooser *chooser)
{
@@ -169,8 +167,6 @@ main (int argc,
gtk_widget_show_all (dialog);
- create_prop_editor (G_OBJECT (dialog), GTK_TYPE_RECENT_CHOOSER);
-
control_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
vbbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
diff --git a/tests/teststatusicon.c b/tests/teststatusicon.c
index 660e326de9..cacfc20b26 100755
--- a/tests/teststatusicon.c
+++ b/tests/teststatusicon.c
@@ -22,8 +22,6 @@
#include <gtk/gtk.h>
#include <stdlib.h>
-#include "prop-editor.h"
-
typedef enum
{
TEST_STATUS_INFO,
@@ -179,20 +177,6 @@ icon_activated (GtkStatusIcon *icon)
}
static void
-do_properties (GtkMenuItem *item,
- GtkStatusIcon *icon)
-{
- static GtkWidget *editor = NULL;
-
- if (editor == NULL) {
- editor = create_prop_editor (G_OBJECT (icon), GTK_TYPE_STATUS_ICON);
- g_signal_connect (editor, "destroy", G_CALLBACK (gtk_widget_destroyed), &editor);
- }
-
- gtk_window_present (GTK_WINDOW (editor));
-}
-
-static void
do_quit (GtkMenuItem *item)
{
GSList *l;
@@ -229,13 +213,6 @@ popup_menu (GtkStatusIcon *icon,
gtk_menu_set_screen (GTK_MENU (menu),
gtk_status_icon_get_screen (icon));
- menuitem = gtk_menu_item_new_with_mnemonic ("_Properties");
- g_signal_connect (menuitem, "activate", G_CALLBACK (do_properties), icon);
-
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-
- gtk_widget_show (menuitem);
-
menuitem = gtk_menu_item_new_with_label ("Quit");
g_signal_connect (menuitem, "activate", G_CALLBACK (do_quit), NULL);
diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c
index d664669a61..460712bef9 100644
--- a/tests/testtoolbar.c
+++ b/tests/testtoolbar.c
@@ -19,7 +19,6 @@
*/
#include "config.h"
#include <gtk/gtk.h>
-#include "prop-editor.h"
static void
change_orientation (GtkWidget *button, GtkWidget *toolbar)
@@ -348,14 +347,6 @@ static GtkTargetEntry target_table[] = {
{ "application/x-toolbar-item", 0, 0 }
};
-static GtkWidget *
-make_prop_editor (GObject *object)
-{
- GtkWidget *prop_editor = create_prop_editor (object, 0);
- gtk_widget_show (prop_editor);
- return prop_editor;
-}
-
static void
rtl_toggled (GtkCheckButton *check)
{
@@ -670,8 +661,6 @@ main (gint argc, gchar **argv)
item = gtk_radio_tool_button_new (group);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (item), "Center");
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "format-justify-center");
- make_prop_editor (G_OBJECT (item));
-
group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (item));
add_item_to_list (store, item, "Center");
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
@@ -743,8 +732,6 @@ main (gint argc, gchar **argv)
gtk_widget_show_all (window);
- make_prop_editor (G_OBJECT (toolbar));
-
g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (toolbar, "popup_context_menu", G_CALLBACK (popup_context_menu), NULL);
diff --git a/tests/testtreechanging.c b/tests/testtreechanging.c
index 804505cf28..f974486736 100644
--- a/tests/testtreechanging.c
+++ b/tests/testtreechanging.c
@@ -16,7 +16,6 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "prop-editor.h"
#include <gtk/gtk.h>
#define MIN_ROWS 50
@@ -506,9 +505,6 @@ main (int argc,
add (GTK_TREE_VIEW (treeview));
gtk_container_add (GTK_CONTAINER (sw), treeview);
- create_prop_editor (G_OBJECT (treeview), GTK_TYPE_TREE_VIEW);
- create_prop_editor (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview))), GTK_TYPE_TREE_SELECTION);
-
gtk_widget_show_all (window);
g_idle_add (dance, treeview);
diff --git a/tests/testtreeview.c b/tests/testtreeview.c
index 9816540de4..95db9ea521 100644
--- a/tests/testtreeview.c
+++ b/tests/testtreeview.c
@@ -17,7 +17,6 @@
*/
#include <string.h>
-#include "prop-editor.h"
#include <gtk/gtk.h>
#include <stdlib.h>
@@ -164,26 +163,6 @@ get_model_types (void)
}
static void
-col_clicked_cb (GtkTreeViewColumn *col, gpointer data)
-{
- GtkWindow *win;
-
- win = GTK_WINDOW (create_prop_editor (G_OBJECT (col), GTK_TYPE_TREE_VIEW_COLUMN));
-
- gtk_window_set_title (win, gtk_tree_view_column_get_title (col));
-}
-
-static void
-setup_column (GtkTreeViewColumn *col)
-{
- gtk_tree_view_column_set_clickable (col, TRUE);
- g_signal_connect (col,
- "clicked",
- G_CALLBACK (col_clicked_cb),
- NULL);
-}
-
-static void
toggled_callback (GtkCellRendererToggle *celltoggle,
gchar *path_string,
GtkTreeView *tree_view)
@@ -354,7 +333,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
rend,
"text", 1,
NULL);
- setup_column (col);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
@@ -368,8 +346,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_column_pack_start (col, rend, TRUE);
gtk_tree_view_column_add_attribute (col, rend, "text", 0);
- setup_column (col);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
gtk_tree_view_set_expander_column (tree_view, col);
@@ -384,8 +360,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
"active", BOOL_COLUMN,
NULL);
- setup_column (col);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)book_closed_xpm);
@@ -413,8 +387,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
"active", BOOL_COLUMN,
NULL);
- setup_column (col);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
rend = gtk_cell_renderer_spin_new ();
@@ -431,8 +403,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
"text", 4,
NULL);
- setup_column (col);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
#if 0
@@ -443,8 +413,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
"text", 4,
NULL);
- setup_column (col);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
rend = gtk_cell_renderer_text_new ();
@@ -454,8 +422,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
"text", 5,
NULL);
- setup_column (col);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
rend = gtk_cell_renderer_text_new ();
@@ -465,8 +431,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
"text", 6,
NULL);
- setup_column (col);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
rend = gtk_cell_renderer_text_new ();
@@ -476,8 +440,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
"text", 7,
NULL);
- setup_column (col);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
rend = gtk_cell_renderer_text_new ();
@@ -487,8 +449,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
"text", 8,
NULL);
- setup_column (col);
-
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
#endif
@@ -503,8 +463,6 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
"text", 0,
NULL);
- setup_column (col);
-
gtk_tree_view_insert_column (GTK_TREE_VIEW (tree_view), col, 0);
default:
break;
@@ -799,9 +757,6 @@ main (int argc,
gtk_container_add (GTK_CONTAINER (sw), tv);
- create_prop_editor (G_OBJECT (tv), GTK_TYPE_TREE_VIEW);
- create_prop_editor (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (tv))), GTK_TYPE_TREE_SELECTION);
-
gtk_widget_show_all (window);
gtk_main ();