Deprecation cleanup

Sun Oct 13 16:20:41 2002  Manish Singh  <yosh@gimp.org>

        * tests/pixbuf-randomly-modified.c tests/prop-editor.c
        tests/testcalendar.c tests/testdnd.c tests/testgtk.c tests/testinput.c
        tests/testmultidisplay.c tests/testmultiscreen.c tests/testrgb.c
        tests/testselection.c tests/testsocket.c tests/testsocket_common.c
        tests/testtext.c tests/testtextbuffer.c tests/testtreecolumns.c
        tests/testtreeedit.c tests/testtreeflow.c tests/testtreefocus.c
        tests/testtreesort.c tests/testtreeview.c tests/testxinerama.c
        tests/treestoretest.c: Deprecation cleanup

        * tests/Makefile.am: Added disable deprecation flags
This commit is contained in:
Manish Singh 2002-10-13 23:22:33 +00:00 committed by Manish Singh
parent aa54cfeede
commit 37278865e1
30 changed files with 1626 additions and 1527 deletions

View File

@ -1,3 +1,16 @@
Sun Oct 13 16:20:41 2002 Manish Singh <yosh@gimp.org>
* tests/pixbuf-randomly-modified.c tests/prop-editor.c
tests/testcalendar.c tests/testdnd.c tests/testgtk.c tests/testinput.c
tests/testmultidisplay.c tests/testmultiscreen.c tests/testrgb.c
tests/testselection.c tests/testsocket.c tests/testsocket_common.c
tests/testtext.c tests/testtextbuffer.c tests/testtreecolumns.c
tests/testtreeedit.c tests/testtreeflow.c tests/testtreefocus.c
tests/testtreesort.c tests/testtreeview.c tests/testxinerama.c
tests/treestoretest.c: Deprecation cleanup
* tests/Makefile.am: Added disable deprecation flags
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]

View File

@ -1,3 +1,16 @@
Sun Oct 13 16:20:41 2002 Manish Singh <yosh@gimp.org>
* tests/pixbuf-randomly-modified.c tests/prop-editor.c
tests/testcalendar.c tests/testdnd.c tests/testgtk.c tests/testinput.c
tests/testmultidisplay.c tests/testmultiscreen.c tests/testrgb.c
tests/testselection.c tests/testsocket.c tests/testsocket_common.c
tests/testtext.c tests/testtextbuffer.c tests/testtreecolumns.c
tests/testtreeedit.c tests/testtreeflow.c tests/testtreefocus.c
tests/testtreesort.c tests/testtreeview.c tests/testxinerama.c
tests/treestoretest.c: Deprecation cleanup
* tests/Makefile.am: Added disable deprecation flags
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]

View File

@ -1,3 +1,16 @@
Sun Oct 13 16:20:41 2002 Manish Singh <yosh@gimp.org>
* tests/pixbuf-randomly-modified.c tests/prop-editor.c
tests/testcalendar.c tests/testdnd.c tests/testgtk.c tests/testinput.c
tests/testmultidisplay.c tests/testmultiscreen.c tests/testrgb.c
tests/testselection.c tests/testsocket.c tests/testsocket_common.c
tests/testtext.c tests/testtextbuffer.c tests/testtreecolumns.c
tests/testtreeedit.c tests/testtreeflow.c tests/testtreefocus.c
tests/testtreesort.c tests/testtreeview.c tests/testxinerama.c
tests/treestoretest.c: Deprecation cleanup
* tests/Makefile.am: Added disable deprecation flags
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]

View File

@ -1,3 +1,16 @@
Sun Oct 13 16:20:41 2002 Manish Singh <yosh@gimp.org>
* tests/pixbuf-randomly-modified.c tests/prop-editor.c
tests/testcalendar.c tests/testdnd.c tests/testgtk.c tests/testinput.c
tests/testmultidisplay.c tests/testmultiscreen.c tests/testrgb.c
tests/testselection.c tests/testsocket.c tests/testsocket_common.c
tests/testtext.c tests/testtextbuffer.c tests/testtreecolumns.c
tests/testtreeedit.c tests/testtreeflow.c tests/testtreefocus.c
tests/testtreesort.c tests/testtreeview.c tests/testxinerama.c
tests/treestoretest.c: Deprecation cleanup
* tests/Makefile.am: Added disable deprecation flags
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]

View File

@ -1,3 +1,16 @@
Sun Oct 13 16:20:41 2002 Manish Singh <yosh@gimp.org>
* tests/pixbuf-randomly-modified.c tests/prop-editor.c
tests/testcalendar.c tests/testdnd.c tests/testgtk.c tests/testinput.c
tests/testmultidisplay.c tests/testmultiscreen.c tests/testrgb.c
tests/testselection.c tests/testsocket.c tests/testsocket_common.c
tests/testtext.c tests/testtextbuffer.c tests/testtreecolumns.c
tests/testtreeedit.c tests/testtreeflow.c tests/testtreefocus.c
tests/testtreesort.c tests/testtreeview.c tests/testxinerama.c
tests/treestoretest.c: Deprecation cleanup
* tests/Makefile.am: Added disable deprecation flags
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]

View File

@ -1,3 +1,16 @@
Sun Oct 13 16:20:41 2002 Manish Singh <yosh@gimp.org>
* tests/pixbuf-randomly-modified.c tests/prop-editor.c
tests/testcalendar.c tests/testdnd.c tests/testgtk.c tests/testinput.c
tests/testmultidisplay.c tests/testmultiscreen.c tests/testrgb.c
tests/testselection.c tests/testsocket.c tests/testsocket_common.c
tests/testtext.c tests/testtextbuffer.c tests/testtreecolumns.c
tests/testtreeedit.c tests/testtreeflow.c tests/testtreefocus.c
tests/testtreesort.c tests/testtreeview.c tests/testxinerama.c
tests/treestoretest.c: Deprecation cleanup
* tests/Makefile.am: Added disable deprecation flags
Sun Oct 13 13:43:16 2002 Manish Singh <yosh@gimp.org>
* gtk/gtkcurve.[ch] gtk/gtkgamma.[ch] gtk/gtklayout.[ch]

View File

@ -7,6 +7,8 @@ makefile.msc
pixbuf-lowmem
pixbuf-random
pixbuf-randomly-modified
pixbuf-random-image
pixbuf-random-seed
pixbuf-read
simple
testcalendar

View File

@ -4,6 +4,9 @@ INCLUDES = @STRIP_BEGIN@ \
-I$(top_srcdir) \
-I$(top_builddir)/gdk \
-I$(top_srcdir)/gdk \
-DG_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
@GTK_DEBUG_FLAGS@ \
@GTK_DEP_CFLAGS@ \
@STRIP_END@

View File

@ -61,7 +61,7 @@ randomly_modify (const guchar *image, guint size)
loader = gdk_pixbuf_loader_new ();
gdk_pixbuf_loader_write (loader, img_copy, size, NULL);
gdk_pixbuf_loader_close (loader, NULL);
g_object_unref (G_OBJECT (loader));
g_object_unref (loader);
}
g_free (img_copy);
}

View File

@ -52,7 +52,7 @@ signal_removed (gpointer data,
static void
g_object_connect_property (GObject *object,
const gchar *prop_name,
GtkSignalFunc func,
GCallback func,
gpointer data,
GObject *alive_object)
{
@ -471,7 +471,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
prop_edit = gtk_spin_button_new (adj, 1.0, 0);
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (int_changed),
G_CALLBACK (int_changed),
adj, G_OBJECT (adj));
if (can_modify)
@ -492,7 +492,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
prop_edit = gtk_spin_button_new (adj, 1.0, 0);
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (uint_changed),
G_CALLBACK (uint_changed),
adj, G_OBJECT (adj));
if (can_modify)
@ -513,7 +513,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
prop_edit = gtk_spin_button_new (adj, 0.1, 2);
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (float_changed),
G_CALLBACK (float_changed),
adj, G_OBJECT (adj));
if (can_modify)
@ -533,7 +533,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
prop_edit = gtk_spin_button_new (adj, 0.1, 2);
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (double_changed),
G_CALLBACK (double_changed),
adj, G_OBJECT (adj));
if (can_modify)
@ -545,7 +545,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
prop_edit = gtk_entry_new ();
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (string_changed),
G_CALLBACK (string_changed),
prop_edit, G_OBJECT (prop_edit));
if (can_modify)
@ -557,7 +557,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
prop_edit = gtk_toggle_button_new_with_label ("");
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (bool_changed),
G_CALLBACK (bool_changed),
prop_edit, G_OBJECT (prop_edit));
if (can_modify)
@ -596,7 +596,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
gtk_option_menu_set_menu (GTK_OPTION_MENU (prop_edit), menu);
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (enum_changed),
G_CALLBACK (enum_changed),
prop_edit, G_OBJECT (prop_edit));
if (can_modify)
@ -610,7 +610,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
gtk_entry_set_max_length (GTK_ENTRY (prop_edit), 1);
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (unichar_changed),
G_CALLBACK (unichar_changed),
prop_edit, G_OBJECT (prop_edit));
if (can_modify)
@ -622,7 +622,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
prop_edit = gtk_label_new ("");
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (pointer_changed),
G_CALLBACK (pointer_changed),
prop_edit, G_OBJECT (prop_edit));
}
else if (type == G_TYPE_PARAM_OBJECT)
@ -630,7 +630,7 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
prop_edit = gtk_label_new ("");
g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (object_changed),
G_CALLBACK (object_changed),
prop_edit, G_OBJECT (prop_edit));
}
else
@ -757,8 +757,8 @@ create_prop_editor (GObject *object,
gtk_widget_get_screen (GTK_WIDGET (object)));
tips = gtk_tooltips_new ();
gtk_signal_connect_object (GTK_OBJECT (win), "destroy",
GTK_SIGNAL_FUNC (gtk_object_destroy), GTK_OBJECT (tips));
g_signal_connect_swapped (win, "destroy",
G_CALLBACK (gtk_object_destroy), tips);
/* hold a weak ref to the object we're editing */
g_object_set_data_full (G_OBJECT (object), "prop-editor-win", win, model_destroy);

View File

@ -18,10 +18,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtk/gtk.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <gtk/gtk.h>
#define DEF_PAD 10
#define DEF_PAD_SMALL 5
@ -51,36 +51,36 @@ enum {
* GtkCalendar
*/
void calendar_date_to_string( CalendarData *data,
void calendar_date_to_string (CalendarData *data,
char *buffer,
gint buff_len )
gint buff_len)
{
struct tm tm;
time_t time;
memset (&tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window),
gtk_calendar_get_date (GTK_CALENDAR (data->window),
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
time = mktime(&tm);
strftime (buffer, buff_len-1, "%x", gmtime(&time));
time = mktime (&tm);
strftime (buffer, buff_len - 1, "%x", gmtime (&time));
}
void calendar_set_signal_strings (char *sig_str,
CalendarData *data)
{
gchar *prev_sig;
const gchar *prev_sig;
gtk_label_get (GTK_LABEL (data->prev_sig), &prev_sig);
prev_sig = gtk_label_get_text (GTK_LABEL (data->prev_sig));
gtk_label_set_text (GTK_LABEL (data->prev2_sig), prev_sig);
gtk_label_get (GTK_LABEL (data->last_sig), &prev_sig);
prev_sig = gtk_label_get_text (GTK_LABEL (data->last_sig));
gtk_label_set_text (GTK_LABEL (data->prev_sig), prev_sig);
gtk_label_set_text (GTK_LABEL (data->last_sig), sig_str);
}
void calendar_month_changed( GtkWidget *widget,
CalendarData *data )
void calendar_month_changed (GtkWidget *widget,
CalendarData *data)
{
char buffer[256] = "month_changed: ";
@ -88,8 +88,8 @@ void calendar_month_changed( GtkWidget *widget,
calendar_set_signal_strings (buffer, data);
}
void calendar_day_selected( GtkWidget *widget,
CalendarData *data )
void calendar_day_selected (GtkWidget *widget,
CalendarData *data)
{
char buffer[256] = "day_selected: ";
@ -97,8 +97,8 @@ void calendar_day_selected( GtkWidget *widget,
calendar_set_signal_strings (buffer, data);
}
void calendar_day_selected_double_click( GtkWidget *widget,
CalendarData *data )
void calendar_day_selected_double_click (GtkWidget *widget,
CalendarData *data)
{
struct tm tm;
char buffer[256] = "day_selected_double_click: ";
@ -107,19 +107,19 @@ void calendar_day_selected_double_click( GtkWidget *widget,
calendar_set_signal_strings (buffer, data);
memset (&tm, 0, sizeof (tm));
gtk_calendar_get_date (GTK_CALENDAR(data->window),
gtk_calendar_get_date (GTK_CALENDAR (data->window),
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
tm.tm_year -= TM_YEAR_BASE;
if(GTK_CALENDAR(data->window)->marked_date[tm.tm_mday-1] == 0) {
gtk_calendar_mark_day(GTK_CALENDAR(data->window),tm.tm_mday);
if (GTK_CALENDAR (data->window)->marked_date[tm.tm_mday-1] == 0) {
gtk_calendar_mark_day (GTK_CALENDAR (data->window), tm.tm_mday);
} else {
gtk_calendar_unmark_day(GTK_CALENDAR(data->window),tm.tm_mday);
gtk_calendar_unmark_day (GTK_CALENDAR (data->window), tm.tm_mday);
}
}
void calendar_prev_month( GtkWidget *widget,
CalendarData *data )
void calendar_prev_month (GtkWidget *widget,
CalendarData *data)
{
char buffer[256] = "prev_month: ";
@ -217,17 +217,16 @@ void calendar_select_font( GtkWidget *button,
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&calendar->font_dialog);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&calendar->font_dialog);
gtk_signal_connect (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->ok_button),
"clicked", GTK_SIGNAL_FUNC(calendar_font_selection_ok),
calendar);
gtk_signal_connect_object (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (calendar->font_dialog));
g_signal_connect (GTK_FONT_SELECTION_DIALOG (window)->ok_button,
"clicked", G_CALLBACK (calendar_font_selection_ok),
calendar);
g_signal_connect_swapped (GTK_FONT_SELECTION_DIALOG (window)->cancel_button,
"clicked", G_CALLBACK (gtk_widget_destroy),
calendar->font_dialog);
}
window=calendar->font_dialog;
if (!GTK_WIDGET_VISIBLE (window))
@ -273,18 +272,17 @@ void create_calendar()
}
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "GtkCalendar Example");
gtk_window_set_title (GTK_WINDOW (window), "GtkCalendar Example");
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
gtk_signal_connect(GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
gtk_signal_connect(GTK_OBJECT(window), "delete-event",
GTK_SIGNAL_FUNC(gtk_false),
NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_main_quit),
NULL);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_false),
NULL);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE);
vbox = gtk_vbox_new(FALSE, DEF_PAD);
vbox = gtk_vbox_new (FALSE, DEF_PAD);
gtk_container_add (GTK_CONTAINER (window), vbox);
/*
@ -304,29 +302,29 @@ void create_calendar()
calendar=gtk_calendar_new();
calendar_data.window = calendar;
calendar_set_flags(&calendar_data);
gtk_calendar_mark_day ( GTK_CALENDAR(calendar), 19);
gtk_container_add( GTK_CONTAINER( frame), calendar);
gtk_signal_connect (GTK_OBJECT (calendar), "month_changed",
GTK_SIGNAL_FUNC (calendar_month_changed),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected",
GTK_SIGNAL_FUNC (calendar_day_selected),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected_double_click",
GTK_SIGNAL_FUNC (calendar_day_selected_double_click),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_month",
GTK_SIGNAL_FUNC (calendar_prev_month),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_month",
GTK_SIGNAL_FUNC (calendar_next_month),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_year",
GTK_SIGNAL_FUNC (calendar_prev_year),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_year",
GTK_SIGNAL_FUNC (calendar_next_year),
&calendar_data);
gtk_calendar_mark_day (GTK_CALENDAR (calendar), 19);
gtk_container_add (GTK_CONTAINER (frame), calendar);
g_signal_connect (calendar, "month_changed",
G_CALLBACK (calendar_month_changed),
&calendar_data);
g_signal_connect (calendar, "day_selected",
G_CALLBACK (calendar_day_selected),
&calendar_data);
g_signal_connect (calendar, "day_selected_double_click",
G_CALLBACK (calendar_day_selected_double_click),
&calendar_data);
g_signal_connect (calendar, "prev_month",
G_CALLBACK (calendar_prev_month),
&calendar_data);
g_signal_connect (calendar, "next_month",
G_CALLBACK (calendar_next_month),
&calendar_data);
g_signal_connect (calendar, "prev_year",
G_CALLBACK (calendar_prev_year),
&calendar_data);
g_signal_connect (calendar, "next_year",
G_CALLBACK (calendar_next_year),
&calendar_data);
separator = gtk_vseparator_new ();
@ -345,19 +343,19 @@ void create_calendar()
for (i = 0; i < 5; i++)
{
toggle = gtk_check_button_new_with_label(flags[i].label);
gtk_signal_connect (GTK_OBJECT (toggle),
"toggled",
GTK_SIGNAL_FUNC(calendar_toggle_flag),
&calendar_data);
g_signal_connect (toggle,
"toggled",
G_CALLBACK(calendar_toggle_flag),
&calendar_data);
gtk_box_pack_start (GTK_BOX (vbox3), toggle, TRUE, TRUE, 0);
calendar_data.flag_checkboxes[i]=toggle;
}
/* Build the right font-button */
button = gtk_button_new_with_label("Font...");
gtk_signal_connect (GTK_OBJECT (button),
"clicked",
GTK_SIGNAL_FUNC(calendar_select_font),
&calendar_data);
g_signal_connect (button,
"clicked",
G_CALLBACK(calendar_select_font),
&calendar_data);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
/*
@ -396,9 +394,9 @@ void create_calendar()
gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
button = gtk_button_new_with_label ("Close");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_main_quit),
NULL);
g_signal_connect (button, "clicked",
G_CALLBACK (gtk_main_quit),
NULL);
gtk_container_add (GTK_CONTAINER (bbox), button);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);

View File

@ -293,7 +293,8 @@ target_drag_leave (GtkWidget *widget,
{
g_print("leave\n");
have_drag = FALSE;
gtk_pixmap_set (GTK_PIXMAP (widget), trashcan_closed, trashcan_closed_mask);
gtk_image_set_from_pixmap (GTK_IMAGE (widget),
trashcan_closed, trashcan_closed_mask);
}
gboolean
@ -309,7 +310,8 @@ target_drag_motion (GtkWidget *widget,
if (!have_drag)
{
have_drag = TRUE;
gtk_pixmap_set (GTK_PIXMAP (widget), trashcan_open, trashcan_open_mask);
gtk_image_set_from_pixmap (GTK_IMAGE (widget),
trashcan_closed, trashcan_closed_mask);
}
source_widget = gtk_drag_get_source_widget (context);
@ -341,7 +343,8 @@ target_drag_drop (GtkWidget *widget,
g_print("drop\n");
have_drag = FALSE;
gtk_pixmap_set (GTK_PIXMAP (widget), trashcan_closed, trashcan_closed_mask);
gtk_image_set_from_pixmap (GTK_IMAGE (widget),
trashcan_closed, trashcan_closed_mask);
if (context->targets)
{
@ -497,10 +500,10 @@ popup_cb (gpointer data)
GTK_DEST_DEFAULT_ALL,
target_table, n_targets - 1, /* no rootwin */
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gtk_signal_connect (GTK_OBJECT (button), "drag_motion",
GTK_SIGNAL_FUNC (popup_motion), NULL);
gtk_signal_connect (GTK_OBJECT (button), "drag_leave",
GTK_SIGNAL_FUNC (popup_leave), NULL);
g_signal_connect (button, "drag_motion",
G_CALLBACK (popup_motion), NULL);
g_signal_connect (button, "drag_leave",
G_CALLBACK (popup_leave), NULL);
}
gtk_widget_show_all (table);
@ -579,8 +582,8 @@ main (int argc, char **argv)
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
table = gtk_table_new (2, 2, FALSE);
@ -607,8 +610,8 @@ main (int argc, char **argv)
target_table, n_targets - 1, /* no rootwin */
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gtk_signal_connect( GTK_OBJECT(label), "drag_data_received",
GTK_SIGNAL_FUNC( label_drag_data_received), NULL);
g_signal_connect (label, "drag_data_received",
G_CALLBACK( label_drag_data_received), NULL);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
@ -625,28 +628,28 @@ main (int argc, char **argv)
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
0, 0);
gtk_signal_connect (GTK_OBJECT (label), "drag_motion",
GTK_SIGNAL_FUNC (popsite_motion), NULL);
gtk_signal_connect (GTK_OBJECT (label), "drag_leave",
GTK_SIGNAL_FUNC (popsite_leave), NULL);
g_signal_connect (label, "drag_motion",
G_CALLBACK (popsite_motion), NULL);
g_signal_connect (label, "drag_leave",
G_CALLBACK (popsite_leave), NULL);
pixmap = gtk_pixmap_new (trashcan_closed, trashcan_closed_mask);
pixmap = gtk_image_new_from_pixmap (trashcan_closed, trashcan_closed_mask);
gtk_drag_dest_set (pixmap, 0, NULL, 0, 0);
gtk_table_attach (GTK_TABLE (table), pixmap, 1, 2, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
0, 0);
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_leave",
GTK_SIGNAL_FUNC (target_drag_leave), NULL);
g_signal_connect (pixmap, "drag_leave",
G_CALLBACK (target_drag_leave), NULL);
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_motion",
GTK_SIGNAL_FUNC (target_drag_motion), NULL);
g_signal_connect (pixmap, "drag_motion",
G_CALLBACK (target_drag_motion), NULL);
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_drop",
GTK_SIGNAL_FUNC (target_drag_drop), NULL);
g_signal_connect (pixmap, "drag_drop",
G_CALLBACK (target_drag_drop), NULL);
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_data_received",
GTK_SIGNAL_FUNC (target_drag_data_received), NULL);
g_signal_connect (pixmap, "drag_data_received",
G_CALLBACK (target_drag_data_received), NULL);
/* Drag site */
@ -659,17 +662,17 @@ main (int argc, char **argv)
gtk_widget_get_colormap (window),
drag_icon, drag_mask);
gdk_pixmap_unref (drag_icon);
gdk_pixmap_unref (drag_mask);
g_object_unref (drag_icon);
g_object_unref (drag_mask);
gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
0, 0);
gtk_signal_connect (GTK_OBJECT (button), "drag_data_get",
GTK_SIGNAL_FUNC (source_drag_data_get), NULL);
gtk_signal_connect (GTK_OBJECT (button), "drag_data_delete",
GTK_SIGNAL_FUNC (source_drag_data_delete), NULL);
g_signal_connect (button, "drag_data_get",
G_CALLBACK (source_drag_data_get), NULL);
g_signal_connect (button, "drag_data_delete",
G_CALLBACK (source_drag_data_delete), NULL);
gtk_widget_show_all (window);

File diff suppressed because it is too large Load Diff

View File

@ -52,12 +52,12 @@ update_cursor (GtkWidget *widget, gdouble x, gdouble y)
if (cursor_present && (cursor_present != state ||
x != cursor_x || y != cursor_y))
{
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
pixmap,
cursor_x - 5, cursor_y - 5,
cursor_x - 5, cursor_y - 5,
10, 10);
gdk_draw_drawable (widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
pixmap,
cursor_x - 5, cursor_y - 5,
cursor_x - 5, cursor_y - 5,
10, 10);
}
cursor_present = state;
@ -80,7 +80,7 @@ static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
gdk_pixmap_unref (pixmap);
g_object_unref (pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
widget->allocation.height,
@ -99,12 +99,12 @@ configure_event (GtkWidget *widget, GdkEventConfigure *event)
static gint
expose_event (GtkWidget *widget, GdkEventExpose *event)
{
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
event->area.width, event->area.height);
gdk_draw_drawable (widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
event->area.width, event->area.height);
return FALSE;
}
@ -140,7 +140,10 @@ draw_brush (GtkWidget *widget, GdkInputSource source,
gdk_draw_rectangle (pixmap, gc, TRUE,
update_rect.x, update_rect.y,
update_rect.width, update_rect.height);
gtk_widget_draw (widget, &update_rect);
gtk_widget_queue_draw_area (widget,
update_rect.x, update_rect.y,
update_rect.width, update_rect.height);
gdk_window_process_updates (widget->window, TRUE);
}
static guint32 motion_time;
@ -275,15 +278,15 @@ create_input_dialog (void)
if (!inputd)
{
inputd = gtk_input_dialog_new();
inputd = gtk_input_dialog_new ();
gtk_signal_connect (GTK_OBJECT(inputd), "destroy",
(GtkSignalFunc)input_dialog_destroy, &inputd);
gtk_signal_connect_object (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->close_button),
"clicked",
(GtkSignalFunc)gtk_widget_hide,
GTK_OBJECT(inputd));
gtk_widget_hide (GTK_INPUT_DIALOG(inputd)->save_button);
g_signal_connect (inputd, "destroy",
G_CALLBACK (input_dialog_destroy), &inputd);
g_signal_connect_swapped (GTK_INPUT_DIALOG (inputd)->close_button,
"clicked",
G_CALLBACK (gtk_widget_hide),
inputd);
gtk_widget_hide (GTK_INPUT_DIALOG (inputd)->save_button);
gtk_widget_show (inputd);
}
@ -299,7 +302,7 @@ create_input_dialog (void)
void
quit (void)
{
gtk_exit (0);
gtk_main_quit ();
}
int
@ -322,37 +325,37 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_widget_show (vbox);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (quit), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (quit), NULL);
/* Create the drawing area */
drawing_area = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200);
gtk_widget_set_size_request (drawing_area, 200, 200);
gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
gtk_widget_show (drawing_area);
/* Signals used to handle backing pixmap */
gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event",
(GtkSignalFunc) expose_event, NULL);
gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event",
(GtkSignalFunc) configure_event, NULL);
g_signal_connect (drawing_area, "expose_event",
G_CALLBACK (expose_event), NULL);
g_signal_connect (drawing_area, "configure_event",
G_CALLBACK (configure_event), NULL);
/* Event signals */
gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event",
(GtkSignalFunc) motion_notify_event, NULL);
gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event",
(GtkSignalFunc) button_press_event, NULL);
gtk_signal_connect (GTK_OBJECT (drawing_area), "key_press_event",
(GtkSignalFunc) key_press_event, NULL);
g_signal_connect (drawing_area, "motion_notify_event",
G_CALLBACK (motion_notify_event), NULL);
g_signal_connect (drawing_area, "button_press_event",
G_CALLBACK (button_press_event), NULL);
g_signal_connect (drawing_area, "key_press_event",
G_CALLBACK (key_press_event), NULL);
gtk_signal_connect (GTK_OBJECT (drawing_area), "leave_notify_event",
(GtkSignalFunc) leave_notify_event, NULL);
gtk_signal_connect (GTK_OBJECT (drawing_area), "proximity_out_event",
(GtkSignalFunc) proximity_out_event, NULL);
g_signal_connect (drawing_area, "leave_notify_event",
G_CALLBACK (leave_notify_event), NULL);
g_signal_connect (drawing_area, "proximity_out_event",
G_CALLBACK (proximity_out_event), NULL);
gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK
| GDK_LEAVE_NOTIFY_MASK
@ -373,16 +376,16 @@ main (int argc, char *argv[])
button = gtk_button_new_with_label ("Input Dialog");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (create_input_dialog), NULL);
g_signal_connect (button, "clicked",
G_CALLBACK (create_input_dialog), NULL);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Quit");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (window));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy),
window);
gtk_widget_show (button);
gtk_widget_show (window);

View File

@ -54,7 +54,7 @@ make_selection_dialog (GdkScreen * screen,
"type", GTK_WINDOW_TOPLEVEL,
"title", "MultiDisplay Cut & Paste",
"border_width", 10, NULL);
g_signal_connect (G_OBJECT (window), "destroy",
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
@ -72,7 +72,7 @@ make_selection_dialog (GdkScreen * screen,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (window), GTK_RESPONSE_APPLY);
g_signal_connect (G_OBJECT (window), "response",
g_signal_connect (window, "response",
G_CALLBACK (entry_dialog_response), double_entry);
gtk_widget_show_all (window);
@ -109,8 +109,8 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog_label);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
display_entry);
gtk_signal_connect (GTK_OBJECT (dialog), "response",
GTK_SIGNAL_FUNC (get_screen_response), display_entry);
g_signal_connect (dialog, "response",
G_CALLBACK (get_screen_response), display_entry);
gtk_widget_grab_focus (display_entry);
gtk_widget_show_all (GTK_BIN (dialog)->child);
@ -119,7 +119,7 @@ main (int argc, char *argv[])
{
if (screen2_name)
{
if (!g_strcasecmp (screen2_name, ""))
if (!g_ascii_strcasecmp (screen2_name, ""))
g_printerr ("No display name, reverting to default display\n");
dpy2 = gdk_display_open (screen2_name);

View File

@ -139,7 +139,7 @@ main (int argc, char *argv[])
"visible", TRUE,
NULL);
g_signal_connect (G_OBJECT (moving_button), "clicked",
g_signal_connect (moving_button, "clicked",
G_CALLBACK (move), moving_vbox);
gtk_container_add (GTK_CONTAINER (moving_vbox), moving_button);

View File

@ -156,7 +156,7 @@ testrgb_rgb_test (GtkWidget *drawing_area)
0, 0, 0, 0, WIDTH, HEIGHT,
GDK_RGB_DITHER_NORMAL,
0, 0);
gdk_pixbuf_unref (pixbuf);
g_object_unref (pixbuf);
}
gdk_flush ();
total_time = g_timer_elapsed (timer, NULL) - start_time;
@ -286,22 +286,21 @@ new_testrgb_window (void)
"GtkWindow::title", "testrgb",
"GtkWindow::allow_shrink", FALSE,
NULL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
(GtkSignalFunc) quit_func, NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (quit_func), NULL);
vbox = gtk_vbox_new (FALSE, 0);
drawing_area = gtk_drawing_area_new ();
gtk_widget_set_usize (drawing_area, WIDTH, HEIGHT);
gtk_widget_set_size_request (drawing_area, WIDTH, HEIGHT);
gtk_box_pack_start (GTK_BOX (vbox), drawing_area, FALSE, FALSE, 0);
gtk_widget_show (drawing_area);
button = gtk_button_new_with_label ("Quit");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) gtk_widget_destroy,
GTK_OBJECT (window));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), window);
gtk_widget_show (button);
@ -320,9 +319,7 @@ main (int argc, char **argv)
gdk_rgb_set_verbose (TRUE);
gdk_rgb_init ();
gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
new_testrgb_window ();
gtk_main ();

View File

@ -407,8 +407,8 @@ main (int argc, char *argv[])
gtk_widget_set_name (dialog, "Test Input");
gtk_container_set_border_width (GTK_CONTAINER(dialog), 0);
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
GTK_SIGNAL_FUNC (quit), NULL);
g_signal_connect (dialog, "destroy",
G_CALLBACK (quit), NULL);
table = gtk_table_new (4, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER(table), 10);
@ -426,18 +426,18 @@ main (int argc, char *argv[])
GTK_EXPAND | GTK_FILL, 0, 0, 0);
gtk_widget_show (selection_button);
gtk_signal_connect (GTK_OBJECT(selection_button), "toggled",
GTK_SIGNAL_FUNC (selection_toggled), NULL);
gtk_signal_connect (GTK_OBJECT(selection_widget), "selection_clear_event",
GTK_SIGNAL_FUNC (selection_clear), NULL);
gtk_signal_connect (GTK_OBJECT(selection_widget), "selection_received",
GTK_SIGNAL_FUNC (selection_received), NULL);
g_signal_connect (selection_button, "toggled",
G_CALLBACK (selection_toggled), NULL);
g_signal_connect (selection_widget, "selection_clear_event",
G_CALLBACK (selection_clear), NULL);
g_signal_connect (selection_widget, "selection_received",
G_CALLBACK (selection_received), NULL);
gtk_selection_add_targets (selection_widget, GDK_SELECTION_PRIMARY,
targetlist, ntargets);
gtk_signal_connect (GTK_OBJECT(selection_widget), "selection_get",
GTK_SIGNAL_FUNC (selection_get), NULL);
g_signal_connect (selection_widget, "selection_get",
G_CALLBACK (selection_get), NULL);
selection_text = gtk_text_new (NULL, NULL);
gtk_table_attach_defaults (GTK_TABLE (table), selection_text, 0, 1, 1, 2);
@ -470,17 +470,16 @@ main (int argc, char *argv[])
button = gtk_button_new_with_label ("Paste");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->action_area),
button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (paste), entry);
g_signal_connect (button, "clicked",
G_CALLBACK (paste), entry);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Quit");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->action_area),
button, TRUE, TRUE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (dialog));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), dialog);
gtk_widget_show (button);
gtk_widget_show (dialog);

View File

@ -100,11 +100,11 @@ create_socket (void)
sockets = g_slist_prepend (sockets, socket);
g_signal_connect (G_OBJECT (socket->socket), "destroy",
g_signal_connect (socket->socket, "destroy",
G_CALLBACK (socket_destroyed), socket);
g_signal_connect (G_OBJECT (socket->socket), "plug_added",
g_signal_connect (socket->socket, "plug_added",
G_CALLBACK (plug_added), socket);
g_signal_connect (G_OBJECT (socket->socket), "plug_removed",
g_signal_connect (socket->socket, "plug_removed",
G_CALLBACK (plug_removed), socket);
return socket;
@ -176,7 +176,7 @@ child_read_watch (GIOChannel *channel, GIOCondition cond, gpointer data)
return TRUE;
case G_IO_STATUS_EOF:
n_children--;
g_io_channel_close (channel);
g_io_channel_unref (channel);
return FALSE;
case G_IO_STATUS_ERROR:
fprintf (stderr, "Error reading fd from child: %s\n", error->message);
@ -217,6 +217,7 @@ add_child (GtkWidget *window,
n_children++;
channel = g_io_channel_unix_new (out_fd);
g_io_channel_set_close_on_unref (channel, TRUE);
g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, &error);
if (error)
{
@ -278,8 +279,8 @@ main (int argc, char *argv[])
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
(GtkSignalFunc) gtk_main_quit, NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
gtk_window_set_title (GTK_WINDOW (window), "Socket Test");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
@ -303,37 +304,32 @@ main (int argc, char *argv[])
button = gtk_button_new_with_label ("Add Active Child");
gtk_box_pack_start (GTK_BOX(vbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(add_active_child),
GTK_OBJECT(vbox));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (add_active_child), vbox);
button = gtk_button_new_with_label ("Add Passive Child");
gtk_box_pack_start (GTK_BOX(vbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(add_passive_child),
GTK_OBJECT(vbox));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (add_passive_child), vbox);
button = gtk_button_new_with_label ("Add Local Active Child");
gtk_box_pack_start (GTK_BOX(vbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(add_local_active_child),
GTK_OBJECT(vbox));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (add_local_active_child), vbox);
button = gtk_button_new_with_label ("Add Local Passive Child");
gtk_box_pack_start (GTK_BOX(vbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(add_local_passive_child),
GTK_OBJECT(vbox));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (add_local_passive_child), vbox);
button = gtk_button_new_with_label ("Remove Last Child");
gtk_box_pack_start (GTK_BOX(vbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(remove_child),
GTK_OBJECT(vbox));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (remove_child), vbox);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
@ -344,9 +340,9 @@ main (int argc, char *argv[])
button = gtk_button_new_with_label ("Steal");
gtk_box_pack_start (GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(steal),
entry);
g_signal_connect (button, "clicked",
G_CALLBACK (steal),
entry);
gtk_widget_show_all (window);
@ -357,7 +353,7 @@ main (int argc, char *argv[])
g_print ("Waiting for children to exit\n");
while (n_children)
g_main_iteration (TRUE);
g_main_context_iteration (NULL, TRUE);
}
return 0;

View File

@ -59,17 +59,17 @@ add_buttons (GtkWidget *widget, GtkWidget *box)
gtk_box_pack_start (GTK_BOX (box), add_button, TRUE, TRUE, 0);
gtk_widget_show (add_button);
gtk_signal_connect (GTK_OBJECT (add_button), "clicked",
GTK_SIGNAL_FUNC (add_buttons),
box);
g_signal_connect (add_button, "clicked",
G_CALLBACK (add_buttons),
box);
remove_button = gtk_button_new_with_mnemonic ("_Remove");
gtk_box_pack_start (GTK_BOX (box), remove_button, TRUE, TRUE, 0);
gtk_widget_show (remove_button);
gtk_signal_connect (GTK_OBJECT (remove_button), "clicked",
GTK_SIGNAL_FUNC (remove_buttons),
add_button);
g_signal_connect (remove_button, "clicked",
G_CALLBACK (remove_buttons),
add_button);
}
guint32
@ -84,9 +84,10 @@ create_child_plug (guint32 xid,
window = gtk_plug_new (xid);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
local ? GTK_SIGNAL_FUNC (local_destroy) : GTK_SIGNAL_FUNC (remote_destroy),
NULL);
g_signal_connect (window, "destroy",
local ? G_CALLBACK (local_destroy)
: G_CALLBACK (remote_destroy),
NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
hbox = gtk_hbox_new (FALSE, 0);
@ -101,16 +102,15 @@ create_child_plug (guint32 xid,
button = gtk_button_new_with_mnemonic ("_Close");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (window));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), window);
button = gtk_button_new_with_mnemonic ("_Blink");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (blink),
GTK_OBJECT (window));
g_signal_connect (button, "clicked",
G_CALLBACK (blink),
window);
add_buttons (NULL, hbox);

View File

@ -75,14 +75,14 @@ GSList *views = NULL;
static void
push_active_window (GtkWindow *window)
{
g_object_ref (G_OBJECT (window));
g_object_ref (window);
active_window_stack = g_slist_prepend (active_window_stack, window);
}
static void
pop_active_window (void)
{
gtk_object_unref (active_window_stack->data);
g_object_unref (active_window_stack->data);
active_window_stack = g_slist_delete_link (active_window_stack, active_window_stack);
}
@ -139,19 +139,19 @@ filesel_run (GtkWindow *parent,
gtk_file_selection_set_filename (GTK_FILE_SELECTION (filesel), start_file);
g_object_set_data (G_OBJECT (filesel), "ok-func", (gpointer)func);
g_object_set_data (G_OBJECT (filesel), "ok-func", func);
g_object_set_data (G_OBJECT (filesel), "ok-data", data);
g_object_set_data (G_OBJECT (filesel), "ok-result", &result);
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (filesel)->ok_button),
"clicked",
GTK_SIGNAL_FUNC (filesel_ok_cb), filesel);
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (filesel)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), GTK_OBJECT (filesel));
g_signal_connect (GTK_FILE_SELECTION (filesel)->ok_button,
"clicked",
G_CALLBACK (filesel_ok_cb), filesel);
g_signal_connect_swapped (GTK_FILE_SELECTION (filesel)->cancel_button,
"clicked",
G_CALLBACK (gtk_widget_destroy), filesel);
gtk_signal_connect (GTK_OBJECT (filesel), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
g_signal_connect (filesel, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
gtk_window_set_modal (GTK_WINDOW (filesel), TRUE);
gtk_widget_show (filesel);
@ -183,7 +183,7 @@ msgbox_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer data)
{
if (event->keyval == GDK_Escape)
{
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event");
g_signal_stop_emission_by_name (widget, "key_press_event");
gtk_object_destroy (GTK_OBJECT (widget));
return TRUE;
}
@ -226,13 +226,13 @@ msgbox_run (GtkWindow *parent,
/* Quit our recursive main loop when the dialog is destroyed.
*/
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
/* Catch Escape key presses and have them destroy the dialog
*/
gtk_signal_connect (GTK_OBJECT (dialog), "key_press_event",
GTK_SIGNAL_FUNC (msgbox_key_press_cb), NULL);
g_signal_connect (dialog, "key_press_event",
G_CALLBACK (msgbox_key_press_cb), NULL);
/* Fill in the contents of the widget
*/
@ -264,8 +264,8 @@ msgbox_run (GtkWindow *parent,
if (default_index == 0)
gtk_widget_grab_default (button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (msgbox_yes_cb), &result);
g_signal_connect (button, "clicked",
G_CALLBACK (msgbox_yes_cb), &result);
}
/* When No is clicked, call the msgbox_no_cb
@ -280,8 +280,8 @@ msgbox_run (GtkWindow *parent,
if (default_index == 0)
gtk_widget_grab_default (button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (msgbox_no_cb), &result);
g_signal_connect (button, "clicked",
G_CALLBACK (msgbox_no_cb), &result);
}
/* When Cancel is clicked, destroy the dialog
@ -295,8 +295,8 @@ msgbox_run (GtkWindow *parent,
if (default_index == 1)
gtk_widget_grab_default (button);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_object_destroy), GTK_OBJECT (dialog));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_object_destroy), dialog);
}
gtk_widget_show_all (dialog);
@ -393,7 +393,7 @@ tag_event_handler (GtkTextTag *tag, GtkWidget *widget, GdkEvent *event,
static void
setup_tag (GtkTextTag *tag)
{
g_signal_connect (G_OBJECT (tag),
g_signal_connect (tag,
"event",
G_CALLBACK (tag_event_handler),
NULL);
@ -529,7 +529,7 @@ fill_example_buffer (GtkTextBuffer *buffer)
anchor = gtk_text_buffer_create_child_anchor (buffer, &iter);
g_object_ref (G_OBJECT (anchor));
g_object_ref (anchor);
g_object_set_data_full (G_OBJECT (buffer), "anchor", anchor,
(GDestroyNotify) g_object_unref);
@ -617,7 +617,7 @@ fill_example_buffer (GtkTextBuffer *buffer)
++i;
}
g_object_unref (G_OBJECT (pixbuf));
g_object_unref (pixbuf);
printf ("%d lines %d chars\n",
gtk_text_buffer_get_line_count (buffer),
@ -1198,7 +1198,7 @@ do_search (gpointer callback_data,
search_text = gtk_text_view_new_with_buffer (buffer);
g_object_unref (G_OBJECT (buffer));
g_object_unref (buffer);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
search_text,
@ -1206,10 +1206,10 @@ do_search (gpointer callback_data,
g_object_set_data (G_OBJECT (dialog), "buffer", buffer);
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (dialog_response_callback),
view);
g_signal_connect (dialog,
"response",
G_CALLBACK (dialog_response_callback),
view);
gtk_widget_show (search_text);
@ -1352,7 +1352,7 @@ add_movable_child (GtkTextView *text_view,
gtk_widget_show_all (event_box);
g_signal_connect (G_OBJECT (event_box), "event",
g_signal_connect (event_box, "event",
G_CALLBACK (movable_child_callback),
text_view);
@ -1852,10 +1852,9 @@ buffer_search (Buffer *buffer,
"%d strings found and marked in red",
i);
gtk_signal_connect_object (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (dialog));
g_signal_connect_swapped (dialog,
"response",
G_CALLBACK (gtk_widget_destroy), dialog);
gtk_widget_show (dialog);
}
@ -1888,7 +1887,7 @@ buffer_unref (Buffer *buffer)
{
buffer_set_colors (buffer, FALSE);
buffers = g_slist_remove (buffers, buffer);
g_object_unref (G_OBJECT (buffer->buffer));
g_object_unref (buffer->buffer);
g_free (buffer->filename);
g_free (buffer);
}
@ -2070,7 +2069,7 @@ close_view (View *view)
views = g_slist_remove (views, view);
buffer_unref (view->buffer);
gtk_widget_destroy (view->window);
g_object_unref (G_OBJECT (view->item_factory));
g_object_unref (view->item_factory);
g_free (view);
@ -2397,7 +2396,7 @@ line_numbers_expose (GtkWidget *widget,
g_array_free (pixels, TRUE);
g_array_free (numbers, TRUE);
g_object_unref (G_OBJECT (layout));
g_object_unref (layout);
/* don't stop emission, need to draw children */
return FALSE;
@ -2420,8 +2419,8 @@ create_view (Buffer *buffer)
view->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_object_set_data (G_OBJECT (view->window), "view", view);
gtk_signal_connect (GTK_OBJECT (view->window), "delete_event",
GTK_SIGNAL_FUNC (delete_event_cb), NULL);
g_signal_connect (view->window, "delete_event",
G_CALLBACK (delete_event_cb), NULL);
view->accel_group = gtk_accel_group_new ();
view->item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", view->accel_group);
@ -2461,14 +2460,14 @@ create_view (Buffer *buffer)
GTK_TEXT_WINDOW_BOTTOM,
15);
gtk_signal_connect (GTK_OBJECT (view->text_view),
"expose_event",
GTK_SIGNAL_FUNC (tab_stops_expose),
NULL);
g_signal_connect (view->text_view,
"expose_event",
G_CALLBACK (tab_stops_expose),
NULL);
g_signal_connect (G_OBJECT (view->buffer->buffer),
g_signal_connect (view->buffer->buffer,
"mark_set",
GTK_SIGNAL_FUNC (cursor_set_callback),
G_CALLBACK (cursor_set_callback),
view->text_view);
/* Draw line numbers in the side windows; we should really be
@ -2482,10 +2481,10 @@ create_view (Buffer *buffer)
GTK_TEXT_WINDOW_LEFT,
30);
gtk_signal_connect (GTK_OBJECT (view->text_view),
"expose_event",
GTK_SIGNAL_FUNC (line_numbers_expose),
NULL);
g_signal_connect (view->text_view,
"expose_event",
G_CALLBACK (line_numbers_expose),
NULL);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (sw), view->text_view);

View File

@ -119,7 +119,7 @@ main (int argc, char** argv)
run_tests (buffer);
g_object_unref (G_OBJECT (buffer));
g_object_unref (buffer);
g_print ("All tests passed.\n");
@ -874,7 +874,7 @@ fill_buffer (GtkTextBuffer *buffer)
gtk_text_buffer_apply_tag (buffer, tag, &iter, &iter2);
gdk_pixbuf_unref (pixbuf);
g_object_unref (pixbuf);
}
@ -939,7 +939,7 @@ test_line_separation (const char* str,
/* FIXME tests for backward line */
g_object_unref (G_OBJECT (buffer));
g_object_unref (buffer);
}
@ -1160,5 +1160,5 @@ logical_motion_tests (void)
g_print ("Logical motion tests passed\n");
g_object_unref (G_OBJECT (buffer));
g_object_unref (buffer);
}

View File

@ -515,7 +515,7 @@ view_column_model_new (GtkTreeView *view)
((ViewColumnModel *)retval)->view = view;
((ViewColumnModel *)retval)->columns = gtk_tree_view_get_columns (view);
gtk_signal_connect (GTK_OBJECT (view), "columns_changed", GTK_SIGNAL_FUNC (update_columns), retval);
g_signal_connect (view, "columns_changed", G_CALLBACK (update_columns), retval);
return retval;
}
@ -750,7 +750,7 @@ main (int argc, char *argv[])
gtk_init (&argc, &argv);
/* First initialize all the models for signal purposes */
left_tree_model = (GtkTreeModel *) gtk_list_store_new (2, G_TYPE_STRING, GTK_TYPE_POINTER);
left_tree_model = (GtkTreeModel *) gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
sample_model = (GtkTreeModel *) gtk_list_store_new (1, G_TYPE_STRING);
sample_tree_view_top = gtk_tree_view_new_with_model (sample_model);
sample_tree_view_bottom = gtk_tree_view_new_with_model (sample_model);
@ -808,7 +808,7 @@ main (int argc, char *argv[])
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (left_tree_view), -1,
"Unattached Columns", cell, "text", 0, NULL);
cell = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (cell), "toggled", (GCallback) set_visible, left_tree_view);
g_signal_connect (cell, "toggled", G_CALLBACK (set_visible), left_tree_view);
column = gtk_tree_view_column_new_with_attributes ("Visible", cell, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (left_tree_view), column);
@ -821,40 +821,38 @@ main (int argc, char *argv[])
bbox = gtk_vbutton_box_new ();
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), 0, 0);
gtk_box_pack_start (GTK_BOX (vbox2), bbox, TRUE, TRUE, 0);
button = gtk_button_new_with_mnemonic ("<< (_Q)");
gtk_widget_set_sensitive (button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (add_left_clicked), top_right_tree_view);
g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (top_right_tree_view))),
"changed", GTK_SIGNAL_FUNC (selection_changed), button);
g_signal_connect (button, "clicked", G_CALLBACK (add_left_clicked), top_right_tree_view);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (top_right_tree_view)),
"changed", G_CALLBACK (selection_changed), button);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic (">> (_W)");
gtk_widget_set_sensitive (button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (add_right_clicked), top_right_tree_view);
g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view))),
"changed", GTK_SIGNAL_FUNC (selection_changed), button);
g_signal_connect (button, "clicked", G_CALLBACK (add_right_clicked), top_right_tree_view);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view)),
"changed", G_CALLBACK (selection_changed), button);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
bbox = gtk_vbutton_box_new ();
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), 0, 0);
gtk_box_pack_start (GTK_BOX (vbox2), bbox, TRUE, TRUE, 0);
button = gtk_button_new_with_mnemonic ("<< (_E)");
gtk_widget_set_sensitive (button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (add_left_clicked), bottom_right_tree_view);
g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (bottom_right_tree_view))),
"changed", GTK_SIGNAL_FUNC (selection_changed), button);
g_signal_connect (button, "clicked", G_CALLBACK (add_left_clicked), bottom_right_tree_view);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (bottom_right_tree_view)),
"changed", G_CALLBACK (selection_changed), button);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic (">> (_R)");
gtk_widget_set_sensitive (button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (add_right_clicked), bottom_right_tree_view);
g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view))),
"changed", GTK_SIGNAL_FUNC (selection_changed), button);
g_signal_connect (button, "clicked", G_CALLBACK (add_right_clicked), bottom_right_tree_view);
g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view)),
"changed", G_CALLBACK (selection_changed), button);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
@ -869,7 +867,7 @@ main (int argc, char *argv[])
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (top_right_tree_view), -1,
NULL, cell, "text", 0, NULL);
cell = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (cell), "toggled", (GCallback) set_visible, top_right_tree_view);
g_signal_connect (cell, "toggled", G_CALLBACK (set_visible), top_right_tree_view);
column = gtk_tree_view_column_new_with_attributes (NULL, cell, NULL);
gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (top_right_tree_view), column);
@ -884,7 +882,7 @@ main (int argc, char *argv[])
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (bottom_right_tree_view), -1,
NULL, cell, "text", 0, NULL);
cell = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (cell), "toggled", (GCallback) set_visible, bottom_right_tree_view);
g_signal_connect (cell, "toggled", G_CALLBACK (set_visible), bottom_right_tree_view);
column = gtk_tree_view_column_new_with_attributes (NULL, cell, NULL);
gtk_tree_view_column_set_cell_data_func (column, cell, get_visible, NULL, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (bottom_right_tree_view), column);
@ -929,7 +927,7 @@ main (int argc, char *argv[])
hbox = gtk_hbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("_Add new Column");
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (add_clicked), left_tree_model);
g_signal_connect (button, "clicked", G_CALLBACK (add_clicked), left_tree_model);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show_all (window);

View File

@ -117,7 +117,7 @@ main (gint argc, gchar **argv)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "GtkTreeView editing sample");
gtk_signal_connect (GTK_OBJECT (window), "destroy", gtk_main_quit, NULL);
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_ETCHED_IN);
@ -144,7 +144,7 @@ main (gint argc, gchar **argv)
"text", STRING_COLUMN,
"editable", IS_EDITABLE_COLUMN,
NULL);
g_signal_connect (G_OBJECT (renderer), "edited",
g_signal_connect (renderer, "edited",
G_CALLBACK (edited), tree_model);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, renderer, TRUE);
@ -152,7 +152,7 @@ main (gint argc, gchar **argv)
"text", STRING_COLUMN,
"editable", IS_EDITABLE_COLUMN,
NULL);
g_signal_connect (G_OBJECT (renderer), "edited",
g_signal_connect (renderer, "edited",
G_CALLBACK (edited), tree_model);
renderer = gtk_cell_renderer_pixbuf_new ();
@ -162,7 +162,7 @@ main (gint argc, gchar **argv)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (renderer), "toggled",
g_signal_connect (renderer, "toggled",
G_CALLBACK (toggled), tree_model);
g_object_set (G_OBJECT (renderer),

View File

@ -113,7 +113,7 @@ main (int argc, char *argv[])
path = gtk_tree_path_new_from_string ("80");
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Reflow test");
gtk_signal_connect (GTK_OBJECT (window), "destroy", gtk_main_quit, NULL);
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Incremental Reflow Test"), FALSE, FALSE, 0);
@ -143,8 +143,8 @@ main (int argc, char *argv[])
button = gtk_button_new_with_mnemonic ("<b>_Futz!!</b>");
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (button)->child), TRUE);
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (futz), NULL);
g_signal_connect (G_OBJECT (button), "realize", G_CALLBACK (gtk_widget_grab_focus), NULL);
g_signal_connect (button, "clicked", G_CALLBACK (futz), NULL);
g_signal_connect (button, "realize", G_CALLBACK (gtk_widget_grab_focus), NULL);
gtk_window_set_default_size (GTK_WINDOW (window), 300, 400);
gtk_widget_show_all (window);
g_timeout_add (1000, (GSourceFunc) futz, NULL);

View File

@ -314,7 +314,7 @@ main (int argc, char *argv[])
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Card planning sheet");
gtk_signal_connect (GTK_OBJECT (window), "destroy", gtk_main_quit, NULL);
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Jonathan's Holiday Card Planning Sheet"), FALSE, FALSE, 0);
@ -340,7 +340,7 @@ main (int argc, char *argv[])
/* Alex Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (renderer), "toggled", G_CALLBACK (alex_toggled), model);
g_signal_connect (renderer, "toggled", G_CALLBACK (alex_toggled), model);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
@ -357,7 +357,7 @@ main (int argc, char *argv[])
/* Havoc Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (renderer), "toggled", G_CALLBACK (havoc_toggled), model);
g_signal_connect (renderer, "toggled", G_CALLBACK (havoc_toggled), model);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
@ -373,7 +373,7 @@ main (int argc, char *argv[])
/* Tim Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (renderer), "toggled", G_CALLBACK (tim_toggled), model);
g_signal_connect (renderer, "toggled", G_CALLBACK (tim_toggled), model);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
@ -390,7 +390,7 @@ main (int argc, char *argv[])
/* Owen Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (renderer), "toggled", G_CALLBACK (owen_toggled), model);
g_signal_connect (renderer, "toggled", G_CALLBACK (owen_toggled), model);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Owen",
@ -405,7 +405,7 @@ main (int argc, char *argv[])
/* Owen Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (renderer), "toggled", G_CALLBACK (dave_toggled), model);
g_signal_connect (renderer, "toggled", G_CALLBACK (dave_toggled), model);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Dave",
@ -420,16 +420,16 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
gtk_signal_connect (GTK_OBJECT (tree_view), "realize",
GTK_SIGNAL_FUNC (gtk_tree_view_expand_all),
NULL);
g_signal_connect (tree_view, "realize",
G_CALLBACK (gtk_tree_view_expand_all),
NULL);
gtk_window_set_default_size (GTK_WINDOW (window),
650, 400);
gtk_widget_show_all (window);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Model");
gtk_signal_connect (GTK_OBJECT (window), "destroy", gtk_main_quit, NULL);
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("The model revealed"), FALSE, FALSE, 0);
@ -442,7 +442,7 @@ main (int argc, char *argv[])
tree_view = gtk_tree_view_new_with_model (model);
g_object_unref (G_OBJECT (model));
g_object_unref (model);
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
@ -485,9 +485,9 @@ main (int argc, char *argv[])
gtk_cell_renderer_text_new (),
"text", 7, NULL);
gtk_signal_connect (GTK_OBJECT (tree_view), "realize",
GTK_SIGNAL_FUNC (gtk_tree_view_expand_all),
NULL);
g_signal_connect (tree_view, "realize",
G_CALLBACK (gtk_tree_view_expand_all),
NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);

View File

@ -89,7 +89,7 @@ main (int argc, char *argv[])
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Words, words, words - Window 1");
gtk_signal_connect (GTK_OBJECT (window), "destroy", gtk_main_quit, NULL);
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Jonathan and Kristian's list of cool words. (And Anders' cool list of numbers) \n\nThis is just a GtkTreeStore"), FALSE, FALSE, 0);
@ -150,8 +150,8 @@ main (int argc, char *argv[])
smodel = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (model));
ssmodel = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (smodel));
g_object_unref (model);
g_object_unref (G_OBJECT (model));
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE);
renderer = gtk_cell_renderer_text_new ();
@ -206,7 +206,7 @@ main (int argc, char *argv[])
window2 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window2),
"Words, words, words - window 2");
gtk_signal_connect (GTK_OBJECT (window2), "destroy", gtk_main_quit, NULL);
g_signal_connect (window2, "destroy", gtk_main_quit, NULL);
vbox2 = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
gtk_box_pack_start (GTK_BOX (vbox2),
@ -278,7 +278,7 @@ main (int argc, char *argv[])
window3 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window3),
"Words, words, words - Window 3");
gtk_signal_connect (GTK_OBJECT (window3), "destroy", gtk_main_quit, NULL);
g_signal_connect (window3, "destroy", gtk_main_quit, NULL);
vbox3 = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);
gtk_box_pack_start (GTK_BOX (vbox3),

View File

@ -36,25 +36,25 @@ static void run_automated_tests (void);
/* This custom model is to test custom model use. */
#define GTK_TYPE_MODEL_TYPES (gtk_tree_model_types_get_type ())
#define GTK_TREE_MODEL_TYPES(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MODEL_TYPES, GtkTreeModelTypes))
#define GTK_TREE_MODEL_TYPES_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MODEL_TYPES, GtkTreeModelTypesClass))
#define GTK_IS_TREE_MODEL_TYPES(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_MODEL_TYPES))
#define GTK_IS_TREE_MODEL_TYPES_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_MODEL_TYPES))
#define GTK_TYPE_MODEL_TYPES (gtk_tree_model_types_get_type ())
#define GTK_TREE_MODEL_TYPES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MODEL_TYPES, GtkTreeModelTypes))
#define GTK_TREE_MODEL_TYPES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MODEL_TYPES, GtkTreeModelTypesClass))
#define GTK_IS_TREE_MODEL_TYPES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MODEL_TYPES))
#define GTK_IS_TREE_MODEL_TYPES_GET_CLASS(klass) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MODEL_TYPES))
typedef struct _GtkTreeModelTypes GtkTreeModelTypes;
typedef struct _GtkTreeModelTypesClass GtkTreeModelTypesClass;
struct _GtkTreeModelTypes
{
GtkObject parent;
GObject parent;
gint stamp;
};
struct _GtkTreeModelTypesClass
{
GtkObjectClass parent_class;
GObjectClass parent_class;
guint (* get_flags) (GtkTreeModel *tree_model);
gint (* get_n_columns) (GtkTreeModel *tree_model);
@ -104,7 +104,7 @@ struct _GtkTreeModelTypesClass
GtkTreePath *path);
};
GtkType gtk_tree_model_types_get_type (void);
GType gtk_tree_model_types_get_type (void) G_GNUC_CONST;
GtkTreeModelTypes *gtk_tree_model_types_new (void);
typedef enum
@ -159,9 +159,9 @@ static void
setup_column (GtkTreeViewColumn *col)
{
gtk_tree_view_column_set_clickable (col, TRUE);
g_signal_connect (G_OBJECT (col),
g_signal_connect (col,
"clicked",
(GCallback) col_clicked_cb,
G_CALLBACK (col_clicked_cb),
NULL);
}
@ -297,8 +297,8 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
rend = gtk_cell_renderer_toggle_new ();
g_signal_connect (G_OBJECT (rend), "toggled",
GTK_SIGNAL_FUNC (toggled_callback), tree_view);
g_signal_connect (rend, "toggled",
G_CALLBACK (toggled_callback), tree_view);
col = gtk_tree_view_column_new_with_attributes ("Column 3",
rend,
@ -313,7 +313,7 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
image = gtk_image_new_from_pixbuf (pixbuf);
g_object_unref (G_OBJECT (pixbuf));
g_object_unref (pixbuf);
gtk_widget_show (image);
@ -326,7 +326,7 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
*/
g_object_set (G_OBJECT (rend), "radio", TRUE, NULL);
g_signal_connect (G_OBJECT (rend), "toggled",
g_signal_connect (rend, "toggled",
G_CALLBACK (toggled_callback), tree_view);
col = gtk_tree_view_column_new_with_attributes ("Column 4",
@ -633,11 +633,11 @@ main (int argc,
model = create_list_model ();
models[MODEL_SORTED_LIST] = gtk_tree_model_sort_new_with_model (model);
g_object_unref (G_OBJECT (model));
g_object_unref (model);
model = create_tree_model ();
models[MODEL_SORTED_TREE] = gtk_tree_model_sort_new_with_model (model);
g_object_unref (G_OBJECT (model));
g_object_unref (model);
models[MODEL_EMPTY_LIST] = GTK_TREE_MODEL (gtk_list_store_new (1, G_TYPE_INT));
models[MODEL_EMPTY_TREE] = GTK_TREE_MODEL (gtk_tree_store_new (1, G_TYPE_INT));
@ -702,10 +702,10 @@ main (int argc,
0, 0,
0, 0);
gtk_signal_connect (GTK_OBJECT (om),
"changed",
GTK_SIGNAL_FUNC (model_selected),
tv);
g_signal_connect (om,
"changed",
G_CALLBACK (model_selected),
tv);
/* Columns menu */
@ -738,10 +738,10 @@ main (int argc,
set_columns_type (GTK_TREE_VIEW (tv), COLUMNS_LOTS);
gtk_option_menu_set_history (GTK_OPTION_MENU (om), COLUMNS_LOTS);
gtk_signal_connect (GTK_OBJECT (om),
"changed",
GTK_SIGNAL_FUNC (columns_selected),
tv);
g_signal_connect (om,
"changed",
G_CALLBACK (columns_selected),
tv);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
@ -796,10 +796,10 @@ static gboolean gtk_real_model_types_iter_parent (GtkTreeModel *t
GtkTreeIter *child);
GtkType
GType
gtk_tree_model_types_get_type (void)
{
static GtkType model_types_type = 0;
static GType model_types_type = 0;
if (!model_types_type)
{
@ -823,7 +823,9 @@ gtk_tree_model_types_get_type (void)
NULL
};
model_types_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkTreeModelTypes", &model_types_info, 0);
model_types_type = g_type_register_static (G_TYPE_OBJECT,
"GtkTreeModelTypes",
&model_types_info, 0);
g_type_add_interface_static (model_types_type,
GTK_TYPE_TREE_MODEL,
&tree_model_info);
@ -1340,7 +1342,7 @@ run_automated_tests (void)
while (gtk_tree_model_get_iter_first (model, &iter))
gtk_list_store_remove (store, &iter);
g_object_unref (G_OBJECT (store));
g_object_unref (store);
}
{
@ -1353,7 +1355,7 @@ run_automated_tests (void)
/* Remove test until it is rewritten to work */
/* treestore_torture_recurse (store, &root, 0);*/
g_object_unref (G_OBJECT (store));
g_object_unref (store);
}
g_print ("Passed.\n");

View File

@ -65,8 +65,8 @@ main (int argc, char *argv[])
gtk_label_set_markup (GTK_LABEL (label), str);
g_free (str);
button = gtk_button_new_with_label ("Close");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (G_OBJECT (window), "configure-event", G_CALLBACK (request), label);
g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (window, "configure-event", G_CALLBACK (request), label);
vbox = gtk_vbox_new (TRUE, 1);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_container_add (GTK_CONTAINER (vbox), label);

View File

@ -61,7 +61,7 @@ iter_insert (GtkWidget *button, GtkTreeView *tree_view)
GtkTreeIter selected;
GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
entry = gtk_object_get_user_data (GTK_OBJECT (button));
entry = g_object_get_data (G_OBJECT (button), "user_data");
if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
NULL,
&selected))
@ -89,7 +89,7 @@ iter_change (GtkWidget *button, GtkTreeView *tree_view)
GtkTreeIter selected;
GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
entry = gtk_object_get_user_data (GTK_OBJECT (button));
entry = g_object_get_data (G_OBJECT (button), "user_data");
if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
NULL, &selected))
{
@ -277,17 +277,17 @@ make_window (gint view_type)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_signal_connect (GTK_OBJECT (window), "destroy", gtk_main_quit, NULL);
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
/* buttons */
button = gtk_button_new_with_label ("gtk_tree_store_remove");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (selection), "changed",
g_signal_connect (selection, "changed",
G_CALLBACK (selection_changed),
button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (iter_remove),
tree_view);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_remove),
tree_view);
gtk_widget_set_sensitive (button, FALSE);
button = gtk_button_new_with_label ("gtk_tree_store_insert");
@ -296,10 +296,10 @@ make_window (gint view_type)
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_object_set_user_data (GTK_OBJECT (button), entry);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (iter_insert),
tree_view);
g_object_set_data (G_OBJECT (button), "user_data", entry);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_insert),
tree_view);
button = gtk_button_new_with_label ("gtk_tree_store_set");
hbox = gtk_hbox_new (FALSE, 8);
@ -307,42 +307,42 @@ make_window (gint view_type)
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
gtk_object_set_user_data (GTK_OBJECT (button), entry);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (iter_change),
tree_view);
g_object_set_data (G_OBJECT (button), "user_data", entry);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_change),
tree_view);
button = gtk_button_new_with_label ("gtk_tree_store_insert_before");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (iter_insert_before),
tree_view);
g_signal_connect (G_OBJECT (selection), "changed",
g_signal_connect (button, "clicked",
G_CALLBACK (iter_insert_before),
tree_view);
g_signal_connect (selection, "changed",
G_CALLBACK (selection_changed),
button);
gtk_widget_set_sensitive (button, FALSE);
button = gtk_button_new_with_label ("gtk_tree_store_insert_after");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (iter_insert_after),
tree_view);
g_signal_connect (G_OBJECT (selection), "changed",
g_signal_connect (button, "clicked",
G_CALLBACK (iter_insert_after),
tree_view);
g_signal_connect (selection, "changed",
G_CALLBACK (selection_changed),
button);
gtk_widget_set_sensitive (button, FALSE);
button = gtk_button_new_with_label ("gtk_tree_store_prepend");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (iter_prepend),
tree_view);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_prepend),
tree_view);
button = gtk_button_new_with_label ("gtk_tree_store_append");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (iter_append),
tree_view);
g_signal_connect (button, "clicked",
G_CALLBACK (iter_append),
tree_view);
/* The selected column */
cell = gtk_cell_renderer_text_new ();