tests: Drop manual property editor

No need for this anymore, now that we have the inspector everywhere.
This commit is contained in:
Matthias Clasen 2014-05-22 08:30:34 -04:00
parent bd5414addb
commit 39ccbe6549
19 changed files with 9 additions and 1987 deletions

View File

@ -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 \

File diff suppressed because it is too large Load Diff

View File

@ -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__ */

View File

@ -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

View File

@ -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);

View File

@ -1,6 +1,5 @@
#include <gtk/gtk.h>
#include <stdio.h>
#include "prop-editor.h"
static gboolean
delete_event_cb (GtkWidget *editor,
@ -12,27 +11,6 @@ delete_event_cb (GtkWidget *editor,
return TRUE;
}
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)
{
@ -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();

View File

@ -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);

View File

@ -31,8 +31,6 @@
#include <gtk/gtk.h>
#include "prop-editor.h"
static gchar *backend = "gtk+";
static gboolean rtl = FALSE;
static GOptionEntry entries[] = {
@ -54,28 +52,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);

View File

@ -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;

View File

@ -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;

View File

@ -45,8 +45,6 @@
#define sleep(n) _sleep(n)
#endif
#include "prop-editor.h"
#include "test.xpm"
gboolean
@ -3949,15 +3947,6 @@ entry_toggle_pulse (GtkWidget *checkbutton,
GUINT_TO_POINTER ((guint) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (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)
{
@ -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 },

View File

@ -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),

View File

@ -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);

View File

@ -18,7 +18,6 @@
#include <stdlib.h>
#include <gtk/gtk.h>
#include "prop-editor.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
@ -90,27 +89,6 @@ delete_event_cb (GtkWidget *editor,
return TRUE;
}
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",

View File

@ -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);

View File

@ -22,8 +22,6 @@
#include <gtk/gtk.h>
#include <stdlib.h>
#include "prop-editor.h"
typedef enum
{
TEST_STATUS_INFO,
@ -178,20 +176,6 @@ icon_activated (GtkStatusIcon *icon)
gtk_window_present (GTK_WINDOW (dialog));
}
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)
{
@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -17,7 +17,6 @@
*/
#include <string.h>
#include "prop-editor.h"
#include <gtk/gtk.h>
#include <stdlib.h>
@ -163,26 +162,6 @@ get_model_types (void)
return column_types;
}
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,
@ -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 ();