Commit 37278865 authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

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
parent aa54cfee
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]
......
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]
......
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]
......
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]
......
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]
......
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]
......
......@@ -7,6 +7,8 @@ makefile.msc
pixbuf-lowmem
pixbuf-random
pixbuf-randomly-modified
pixbuf-random-image
pixbuf-random-seed
pixbuf-read
simple
testcalendar
......
......@@ -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@
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE);
vbox = gtk_vbox_new(FALSE, DEF_PAD);
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);
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);
......
......@@ -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);
......
This diff is collapsed.
......@@ -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);