Commit 0f6ab278 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

removed g_signal_handlers_disconnect_by_data again. As Owen pointed out,

2001-07-31  Sven Neumann  <sven@gimp.org>

	* app/core/core-types.h: removed g_signal_handlers_disconnect_by_data
	again. As Owen pointed out, it's generally a bad idea to use it since
	you can't be absolutely sure that no one else has a pointer to the
	data you are disconnecting.

	* app/gdisplay.c: added the macro here temporarily.

	* app/module_db.c
	* app/undo_history.c
	* app/gui/brush-editor.c
	* app/gui/brush-select.c
	* app/gui/gradient-select.c
	* app/gui/pattern-select.c: use g_signal_handlers_disconnect_by_func.

	* libgimpwidgets/gimpbutton.c
	* libgimpwidgets/gimpchainbutton.c
	* libgimpwidgets/gimpcolorarea.c
	* libgimpwidgets/gimpcolorbutton.c
	* libgimpwidgets/gimpfileselection.c
	* libgimpwidgets/gimphelpui.c
	* libgimpwidgets/gimpoffsetarea.c
	* libgimpwidgets/gimppatheditor.c
	* libgimpwidgets/gimpsizeentry.c
	* libgimpwidgets/gimpunitmenu.c
	* libgimpwidgets/gimpwidgets.c: GObject porting.
parent 8fae094e
2001-07-31 Sven Neumann <sven@gimp.org>
* app/core/core-types.h: removed g_signal_handlers_disconnect_by_data
again. As Owen pointed out, it's generally a bad idea to use it since
you can't be absolutely sure that no one else has a pointer to the
data you are disconnecting.
* app/gdisplay.c: added the macro here temporarily.
* app/module_db.c
* app/undo_history.c
* app/gui/brush-editor.c
* app/gui/brush-select.c
* app/gui/gradient-select.c
* app/gui/pattern-select.c: use g_signal_handlers_disconnect_by_func.
* libgimpwidgets/gimpbutton.c
* libgimpwidgets/gimpchainbutton.c
* libgimpwidgets/gimpcolorarea.c
* libgimpwidgets/gimpcolorbutton.c
* libgimpwidgets/gimpfileselection.c
* libgimpwidgets/gimphelpui.c
* libgimpwidgets/gimpoffsetarea.c
* libgimpwidgets/gimppatheditor.c
* libgimpwidgets/gimpsizeentry.c
* libgimpwidgets/gimpunitmenu.c
* libgimpwidgets/gimpwidgets.c: GObject porting.
2001-07-30 Michael Natterer <mitch@gimp.org>
* gtkrc: set the width of the scrollbar slider to the same value
......
......@@ -23,13 +23,6 @@
#include "apptypes.h"
/* EEEK, we will submit this a patch for glib */
#define g_signal_handlers_disconnect_by_data(instance,data) \
g_signal_handlers_disconnect_matched (instance,\
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data);
/* enums */
/* Base image types */
......
......@@ -73,6 +73,14 @@
#include "pixmaps/wilber.xpm"
/* EEEK, we shouldn't use this, but it will go away when
GDisplay is made a proper GObject */
#define g_signal_handlers_disconnect_by_data(instance,data) \
g_signal_handlers_disconnect_matched (instance,\
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data)
#define OVERHEAD 25 /* in units of pixel area */
#define EPSILON 5
......
......@@ -357,16 +357,16 @@ module_db_browser_new (void)
button = gtk_button_new_with_label (_("Refresh"));
gtk_widget_show (button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (browser_refresh_callback), st);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (browser_refresh_callback), st);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
st->button = gtk_button_new_with_label ("");
st->button_label = GTK_BIN (st->button)->child;
gtk_box_pack_start (GTK_BOX (hbox), st->button, TRUE, TRUE, 0);
gtk_widget_show (st->button);
gtk_signal_connect (GTK_OBJECT (st->button), "clicked",
GTK_SIGNAL_FUNC (browser_load_unload_callback), st);
g_signal_connect (G_OBJECT (st->button), "clicked",
G_CALLBACK (browser_load_unload_callback), st);
browser_info_init (st, st->table);
browser_info_update (st->last_update, st);
......@@ -384,12 +384,15 @@ module_db_browser_new (void)
G_CALLBACK (browser_info_update), st);
g_signal_connect (G_OBJECT (modules), "add",
G_CALLBACK (browser_info_add), st);
G_CALLBACK (browser_info_add),
st);
g_signal_connect (G_OBJECT (modules), "remove",
G_CALLBACK (browser_info_remove), st);
G_CALLBACK (browser_info_remove),
st);
gtk_signal_connect (GTK_OBJECT (shell), "destroy",
GTK_SIGNAL_FUNC (browser_destroy_callback), st);
g_signal_connect (G_OBJECT (shell), "destroy",
G_CALLBACK (browser_destroy_callback),
st);
return shell;
}
......@@ -448,7 +451,7 @@ module_info_class_init (ModuleInfoClass *klass)
g_signal_new ("modified",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
GTK_SIGNAL_OFFSET (ModuleInfoClass, modified),
G_STRUCT_OFFSET (ModuleInfoClass, modified),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
......@@ -800,7 +803,12 @@ static void
browser_destroy_callback (GtkWidget *widget,
gpointer data)
{
g_signal_handlers_disconnect_by_data (G_OBJECT (modules), data);
g_signal_handlers_disconnect_by_func (G_OBJECT (modules),
browser_info_add,
data);
g_signal_handlers_disconnect_by_func (G_OBJECT (modules),
browser_info_remove,
data);
gimp_container_remove_handler (modules, modules_handler_id);
g_free (data);
}
......
......@@ -73,6 +73,14 @@
#include "pixmaps/wilber.xpm"
/* EEEK, we shouldn't use this, but it will go away when
GDisplay is made a proper GObject */
#define g_signal_handlers_disconnect_by_data(instance,data) \
g_signal_handlers_disconnect_matched (instance,\
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data)
#define OVERHEAD 25 /* in units of pixel area */
#define EPSILON 5
......
......@@ -73,6 +73,14 @@
#include "pixmaps/wilber.xpm"
/* EEEK, we shouldn't use this, but it will go away when
GDisplay is made a proper GObject */
#define g_signal_handlers_disconnect_by_data(instance,data) \
g_signal_handlers_disconnect_matched (instance,\
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data)
#define OVERHEAD 25 /* in units of pixel area */
#define EPSILON 5
......
......@@ -229,8 +229,13 @@ brush_editor_set_brush (BrushEditor *brush_editor,
if (brush_editor->brush)
{
g_signal_handlers_disconnect_by_data (G_OBJECT (brush_editor->brush),
g_signal_handlers_disconnect_by_func (G_OBJECT (brush_editor->brush),
brush_editor_brush_dirty,
brush_editor);
g_signal_handlers_disconnect_by_func (G_OBJECT (brush_editor->brush),
brush_editor_brush_name_changed,
brush_editor);
g_object_unref (G_OBJECT (brush_editor->brush));
brush_editor->brush = NULL;
}
......
......@@ -223,9 +223,9 @@ brush_select_new (gchar *title,
slider = gtk_hscale_new (bsp->opacity_data);
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (bsp->opacity_data), "value_changed",
GTK_SIGNAL_FUNC (opacity_scale_update),
bsp);
g_signal_connect (G_OBJECT (bsp->opacity_data), "value_changed",
G_CALLBACK (opacity_scale_update),
bsp);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Opacity:"), 1.0, 1.0,
slider, 1, FALSE);
......@@ -258,10 +258,10 @@ brush_select_new (gchar *title,
gtk_adjustment_set_value (adj, init_spacing);
}
gtk_signal_connect
(GTK_OBJECT (GIMP_BRUSH_FACTORY_VIEW (bsp->view)->spacing_adjustment),
g_signal_connect
(G_OBJECT (GIMP_BRUSH_FACTORY_VIEW (bsp->view)->spacing_adjustment),
"value_changed",
GTK_SIGNAL_FUNC (spacing_scale_update),
G_CALLBACK (spacing_scale_update),
bsp);
gtk_widget_show (table);
......@@ -277,15 +277,15 @@ brush_select_new (gchar *title,
gtk_widget_show (bsp->shell);
gtk_signal_connect (GTK_OBJECT (bsp->context), "brush_changed",
GTK_SIGNAL_FUNC (brush_select_brush_changed),
bsp);
gtk_signal_connect (GTK_OBJECT (bsp->context), "opacity_changed",
GTK_SIGNAL_FUNC (brush_select_opacity_changed),
bsp);
gtk_signal_connect (GTK_OBJECT (bsp->context), "paint_mode_changed",
GTK_SIGNAL_FUNC (brush_select_paint_mode_changed),
bsp);
g_signal_connect (G_OBJECT (bsp->context), "brush_changed",
G_CALLBACK (brush_select_brush_changed),
bsp);
g_signal_connect (G_OBJECT (bsp->context), "opacity_changed",
G_CALLBACK (brush_select_opacity_changed),
bsp);
g_signal_connect (G_OBJECT (bsp->context), "paint_mode_changed",
G_CALLBACK (brush_select_paint_mode_changed),
bsp);
/* Add to active brush dialogs list */
brush_active_dialogs = g_slist_append (brush_active_dialogs, bsp);
......@@ -302,8 +302,16 @@ brush_select_free (BrushSelect *bsp)
/* remove from active list */
brush_active_dialogs = g_slist_remove (brush_active_dialogs, bsp);
g_signal_handlers_disconnect_by_data (G_OBJECT (bsp->context), bsp);
g_signal_handlers_disconnect_by_func (G_OBJECT (bsp->context),
brush_select_brush_changed,
bsp);
g_signal_handlers_disconnect_by_func (G_OBJECT (bsp->context),
brush_select_opacity_changed,
bsp);
g_signal_handlers_disconnect_by_func (G_OBJECT (bsp->context),
brush_select_paint_mode_changed,
bsp);
if (bsp->callback_name)
{
g_free (bsp->callback_name);
......
......@@ -166,9 +166,9 @@ gradient_select_new (gchar *title,
gtk_widget_show (gsp->shell);
gtk_signal_connect (GTK_OBJECT (gsp->context), "gradient_changed",
GTK_SIGNAL_FUNC (gradient_select_gradient_changed),
(gpointer) gsp);
g_signal_connect (G_OBJECT (gsp->context), "gradient_changed",
G_CALLBACK (gradient_select_gradient_changed),
(gpointer) gsp);
/* Add to active gradient dialogs list */
gradient_active_dialogs = g_slist_append (gradient_active_dialogs, gsp);
......@@ -185,7 +185,9 @@ gradient_select_free (GradientSelect *gsp)
/* remove from active list */
gradient_active_dialogs = g_slist_remove (gradient_active_dialogs, gsp);
g_signal_handlers_disconnect_by_data (G_OBJECT (gsp->context), gsp);
g_signal_handlers_disconnect_by_func (G_OBJECT (gsp->context),
gradient_select_gradient_changed,
gsp);
if (gsp->callback_name)
{
......
......@@ -357,16 +357,16 @@ module_db_browser_new (void)
button = gtk_button_new_with_label (_("Refresh"));
gtk_widget_show (button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (browser_refresh_callback), st);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (browser_refresh_callback), st);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
st->button = gtk_button_new_with_label ("");
st->button_label = GTK_BIN (st->button)->child;
gtk_box_pack_start (GTK_BOX (hbox), st->button, TRUE, TRUE, 0);
gtk_widget_show (st->button);
gtk_signal_connect (GTK_OBJECT (st->button), "clicked",
GTK_SIGNAL_FUNC (browser_load_unload_callback), st);
g_signal_connect (G_OBJECT (st->button), "clicked",
G_CALLBACK (browser_load_unload_callback), st);
browser_info_init (st, st->table);
browser_info_update (st->last_update, st);
......@@ -384,12 +384,15 @@ module_db_browser_new (void)
G_CALLBACK (browser_info_update), st);
g_signal_connect (G_OBJECT (modules), "add",
G_CALLBACK (browser_info_add), st);
G_CALLBACK (browser_info_add),
st);
g_signal_connect (G_OBJECT (modules), "remove",
G_CALLBACK (browser_info_remove), st);
G_CALLBACK (browser_info_remove),
st);
gtk_signal_connect (GTK_OBJECT (shell), "destroy",
GTK_SIGNAL_FUNC (browser_destroy_callback), st);
g_signal_connect (G_OBJECT (shell), "destroy",
G_CALLBACK (browser_destroy_callback),
st);
return shell;
}
......@@ -448,7 +451,7 @@ module_info_class_init (ModuleInfoClass *klass)
g_signal_new ("modified",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
GTK_SIGNAL_OFFSET (ModuleInfoClass, modified),
G_STRUCT_OFFSET (ModuleInfoClass, modified),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
......@@ -800,7 +803,12 @@ static void
browser_destroy_callback (GtkWidget *widget,
gpointer data)
{
g_signal_handlers_disconnect_by_data (G_OBJECT (modules), data);
g_signal_handlers_disconnect_by_func (G_OBJECT (modules),
browser_info_add,
data);
g_signal_handlers_disconnect_by_func (G_OBJECT (modules),
browser_info_remove,
data);
gimp_container_remove_handler (modules, modules_handler_id);
g_free (data);
}
......
......@@ -53,15 +53,15 @@
/* local function prototypes */
static void pattern_select_change_callbacks (PatternSelect *psp,
gboolean closing);
static void pattern_select_change_callbacks (PatternSelect *psp,
gboolean closing);
static void pattern_select_pattern_changed (GimpContext *context,
GimpPattern *pattern,
PatternSelect *psp);
static void pattern_select_pattern_changed (GimpContext *context,
GimpPattern *pattern,
PatternSelect *psp);
static void pattern_select_close_callback (GtkWidget *widget,
gpointer data);
static void pattern_select_close_callback (GtkWidget *widget,
gpointer data);
/* The main pattern selection dialog */
......@@ -178,9 +178,9 @@ pattern_select_new (gchar *title,
gtk_widget_show (psp->shell);
gtk_signal_connect (GTK_OBJECT (psp->context), "pattern_changed",
GTK_SIGNAL_FUNC (pattern_select_pattern_changed),
psp);
g_signal_connect (G_OBJECT (psp->context), "pattern_changed",
G_CALLBACK (pattern_select_pattern_changed),
psp);
/* Add to active pattern dialogs list */
pattern_active_dialogs = g_slist_append (pattern_active_dialogs, psp);
......@@ -197,7 +197,9 @@ pattern_select_free (PatternSelect *psp)
/* remove from active list */
pattern_active_dialogs = g_slist_remove (pattern_active_dialogs, psp);
gtk_signal_disconnect_by_data (GTK_OBJECT (psp->context), psp);
g_signal_handlers_disconnect_by_func (G_OBJECT (psp->context),
pattern_select_pattern_changed,
psp);
if (psp->callback_name)
{
......
......@@ -357,16 +357,16 @@ module_db_browser_new (void)
button = gtk_button_new_with_label (_("Refresh"));
gtk_widget_show (button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (browser_refresh_callback), st);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (browser_refresh_callback), st);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
st->button = gtk_button_new_with_label ("");
st->button_label = GTK_BIN (st->button)->child;
gtk_box_pack_start (GTK_BOX (hbox), st->button, TRUE, TRUE, 0);
gtk_widget_show (st->button);
gtk_signal_connect (GTK_OBJECT (st->button), "clicked",
GTK_SIGNAL_FUNC (browser_load_unload_callback), st);
g_signal_connect (G_OBJECT (st->button), "clicked",
G_CALLBACK (browser_load_unload_callback), st);
browser_info_init (st, st->table);
browser_info_update (st->last_update, st);
......@@ -384,12 +384,15 @@ module_db_browser_new (void)
G_CALLBACK (browser_info_update), st);
g_signal_connect (G_OBJECT (modules), "add",
G_CALLBACK (browser_info_add), st);
G_CALLBACK (browser_info_add),
st);
g_signal_connect (G_OBJECT (modules), "remove",
G_CALLBACK (browser_info_remove), st);
G_CALLBACK (browser_info_remove),
st);
gtk_signal_connect (GTK_OBJECT (shell), "destroy",
GTK_SIGNAL_FUNC (browser_destroy_callback), st);
g_signal_connect (G_OBJECT (shell), "destroy",
G_CALLBACK (browser_destroy_callback),
st);
return shell;
}
......@@ -448,7 +451,7 @@ module_info_class_init (ModuleInfoClass *klass)
g_signal_new ("modified",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
GTK_SIGNAL_OFFSET (ModuleInfoClass, modified),
G_STRUCT_OFFSET (ModuleInfoClass, modified),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
......@@ -800,7 +803,12 @@ static void
browser_destroy_callback (GtkWidget *widget,
gpointer data)
{
g_signal_handlers_disconnect_by_data (G_OBJECT (modules), data);
g_signal_handlers_disconnect_by_func (G_OBJECT (modules),
browser_info_add,
data);
g_signal_handlers_disconnect_by_func (G_OBJECT (modules),
browser_info_remove,
data);
gimp_container_remove_handler (modules, modules_handler_id);
g_free (data);
}
......
......@@ -148,6 +148,14 @@ static GdkBitmap *clean_mask = NULL;
static GdkPixmap *clear_pixmap = NULL;
static GdkBitmap *clear_mask = NULL;
static void undo_history_undo_event (GtkWidget *widget,
gint ev,
gpointer data);
static void undo_history_clean_callback (GtkWidget *widget,
gpointer data);
/**************************************************************/
/* Local functions */
......@@ -466,7 +474,21 @@ undo_history_shell_destroy_callback (GtkWidget *widget,
undo_history_st *st = data;
if (st->gimage)
g_signal_handlers_disconnect_by_data (G_OBJECT (st->gimage), st);
{
g_signal_handlers_disconnect_by_func (G_OBJECT (st->gimage),
undo_history_undo_event,
st);
g_signal_handlers_disconnect_by_func (G_OBJECT (st->gimage),
undo_history_gimage_rename_callback,
st);
g_signal_handlers_disconnect_by_func (G_OBJECT (st->gimage),
undo_history_gimage_destroy_callback,
st);
g_signal_handlers_disconnect_by_func (G_OBJECT (st->gimage),
undo_history_clean_callback,
st);
}
g_free (st);
}
......
......@@ -229,8 +229,13 @@ brush_editor_set_brush (BrushEditor *brush_editor,
if (brush_editor->brush)
{
g_signal_handlers_disconnect_by_data (G_OBJECT (brush_editor->brush),
g_signal_handlers_disconnect_by_func (G_OBJECT (brush_editor->brush),
brush_editor_brush_dirty,
brush_editor);
g_signal_handlers_disconnect_by_func (G_OBJECT (brush_editor->brush),
brush_editor_brush_name_changed,
brush_editor);
g_object_unref (G_OBJECT (brush_editor->brush));
brush_editor->brush = NULL;
}
......
......@@ -166,9 +166,9 @@ gimp_button_button_release (GtkWidget *widget,
(GIMP_BUTTON (button)->press_state &
(GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK)))
{
gtk_signal_emit (GTK_OBJECT (widget),
button_signals[EXTENDED_CLICKED],
GIMP_BUTTON (button)->press_state);
g_signal_emit (G_OBJECT (widget),
button_signals[EXTENDED_CLICKED], 0,
GIMP_BUTTON (button)->press_state);
extended_clicked = TRUE;
......
......@@ -147,14 +147,15 @@ gimp_chain_button_init (GimpChainButton *gcb)
gcb->pixmap = gtk_type_new (gtk_pixmap_get_type ());
gtk_pixmap_set_build_insensitive (GTK_PIXMAP (gcb->pixmap), TRUE);
gtk_signal_connect (GTK_OBJECT(gcb->button), "clicked",
GTK_SIGNAL_FUNC (gimp_chain_button_clicked_callback), gcb);
gtk_signal_connect (GTK_OBJECT (gcb->line1), "expose_event",
GTK_SIGNAL_FUNC (gimp_chain_button_draw_lines),
gcb);
gtk_signal_connect (GTK_OBJECT (gcb->line2), "expose_event",
GTK_SIGNAL_FUNC (gimp_chain_button_draw_lines),
gcb);
g_signal_connect (G_OBJECT(gcb->button), "clicked",
G_CALLBACK (gimp_chain_button_clicked_callback),
gcb);
g_signal_connect (G_OBJECT (gcb->line1), "expose_event",
G_CALLBACK (gimp_chain_button_draw_lines),
gcb);
g_signal_connect (G_OBJECT (gcb->line2), "expose_event",
G_CALLBACK (gimp_chain_button_draw_lines),
gcb);
}
static void
......@@ -168,25 +169,25 @@ gimp_chain_button_destroy (GtkObject *object)
if (gcb->broken)
{
gdk_pixmap_unref (gcb->broken);
gdk_drawable_unref (gcb->broken);
gcb->broken = NULL;
}
if (gcb->broken_mask)
{
gdk_bitmap_unref (gcb->broken_mask);
gdk_drawable_unref (gcb->broken_mask);
gcb->broken_mask = NULL;
}
if (gcb->chain)
{
gdk_pixmap_unref (gcb->chain);
gdk_drawable_unref (gcb->chain);
gcb->chain = NULL;
}
if (gcb->chain_mask)
{
gdk_bitmap_unref (gcb->chain_mask);
gdk_drawable_unref (gcb->chain_mask);
gcb->chain_mask = NULL;
}
......@@ -345,11 +346,11 @@ gimp_chain_button_clicked_callback (GtkWidget *widget,
return;
if (gcb->active)
gtk_pixmap_set (GTK_PIXMAP(gcb->pixmap), gcb->chain, gcb->chain_mask);
gtk_pixmap_set (GTK_PIXMAP (gcb->pixmap), gcb->chain, gcb->chain_mask);
else
gtk_pixmap_set (GTK_PIXMAP(gcb->pixmap), gcb->broken, gcb->broken_mask);
gtk_pixmap_set (GTK_PIXMAP (gcb->pixmap), gcb->broken, gcb->broken_mask);
gtk_signal_emit (GTK_OBJECT (gcb), gimp_chain_button_signals[TOGGLED]);
g_signal_emit (G_OBJECT (gcb), gimp_chain_button_signals[TOGGLED], 0);
}
static gint
......
......@@ -255,8 +255,8 @@ gimp_color_area_set_color (GimpColorArea *gca,
gimp_color_area_update (gca);
gtk_signal_emit (GTK_OBJECT (gca),
gimp_color_area_signals[COLOR_CHANGED]);
g_signal_emit (G_OBJECT (gca),
gimp_color_area_signals[COLOR_CHANGED], 0);
}
}
......@@ -481,10 +481,10 @@ gimp_color_area_drag_begin (GtkWidget *widget,
gtk_widget_show (color_area);
gtk_widget_show (frame);
gtk_object_set_data_full (GTK_OBJECT (widget),
"gimp-color-area-drag-window",
window,
(GtkDestroyNotify) gtk_widget_destroy);
g_object_set_data_full (G_OBJECT (widget),
"gimp-color-area-drag-window",
window,
(GDestroyNotify) gtk_widget_destroy);
gtk_drag_set_icon_widget (context, window, DRAG_ICON_OFFSET, DRAG_ICON_OFFSET);
}
......@@ -493,8 +493,8 @@ static void
gimp_color_area_drag_end (GtkWidget *widget,
GdkDragContext *context)
{
gtk_object_set_data (GTK_OBJECT (widget),
"gimp-color-area-drag-window", NULL);
g_object_set_data (G_OBJECT (widget),
"gimp-color-area-drag-window", NULL);
}
static void
......
......@@ -170,9 +170,9 @@ gimp_color_button_init (GimpColorButton *gcb)
NULL, NULL);
gtk_item_factory_create_items (gcb->item_factory,
nmenu_items, menu_items, gcb);
gtk_signal_connect (GTK_OBJECT (gcb), "button_press_event",
GTK_SIGNAL_FUNC (gimp_color_button_menu_popup),
gcb);
g_signal_connect (G_OBJECT (gcb), "button_press_event",
G_CALLBACK (gimp_color_button_menu_popup),
gcb);
}
GtkType
......@@ -375,16 +375,16 @@ gimp_color_button_clicked (GtkButton *button)
gtk_widget_destroy (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->help_button);
gtk_container_set_border_width (GTK_CONTAINER (gcb->dialog), 2);
gtk_signal_connect (GTK_OBJECT (gcb->dialog), "destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
g_signal_connect (G_OBJECT (gcb->dialog), "destroy",
G_CALLBACK (gtk_widget_destroyed),
&gcb->dialog);
gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->ok_button),
g_signal_connect (G_OBJECT (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->ok_button),
"clicked",
GTK_SIGNAL_FUNC (gimp_color_button_dialog_ok),
G_CALLBACK (gimp_color_button_dialog_ok),
gcb);
gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->cancel_button),
g_signal_connect (G_OBJECT (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC (gimp_color_button_dialog_cancel),
G_CALLBACK (gimp_color_button_dialog_cancel),
gcb);
gtk_window_set_position (GTK_WINDOW (gcb->dialog), GTK_WIN_POS_MOUSE);
}
......@@ -477,8 +477,8 @@ gimp_color_button_color_changed (GtkObject *object,
gtk_color_selection_set_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->colorsel), dcolor);
}
gtk_signal_emit (GTK_OBJECT (gcb),
gimp_color_button_signals[COLOR_CHANGED]);
g_signal_emit (G_OBJECT (gcb),
gimp_color_button_signals[COLOR_CHANGED], 0);
}
static gchar *
......
......@@ -170,19 +170,19 @@ gimp_file_selection_init (GimpFileSelection *gfs)
gfs->browse_button = gtk_button_new_with_label (" ... ");
gtk_box_pack_end (GTK_BOX (gfs), gfs->browse_button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT(gfs->browse_button), "clicked",
GTK_SIGNAL_FUNC (gimp_file_selection_browse_callback),
gfs);
g_signal_connect (G_OBJECT(gfs->browse_button), "clicked",
G_CALLBACK (gimp_file_selection_browse_callback),
gfs);
gtk_widget_show (gfs->browse_button);
gfs->entry = gtk_entry_new ();
gtk_box_pack_end (GTK_BOX (gfs), gfs->entry, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (gfs->entry), "activate",
GTK_SIGNAL_FUNC (gimp_file_selection_entry_callback),
gfs);
gtk_signal_connect (GTK_OBJECT (gfs->entry), "focus_out_event",
GTK_SIGNAL_FUNC (gimp_file_selection_entry_focus_out_callback),
gfs);
g_signal_connect (G_OBJECT (gfs->entry), "activate",
G_CALLBACK (gimp_file_selection_entry_callback),
gfs);
g_signal_connect (G_OBJECT (gfs->entry), "focus_out_event",
G_CALLBACK (gimp_file_selection_entry_focus_out_callback),
gfs);
gtk_widget_show (gfs->entry);
}
......@@ -332,9 +332,13 @@ gimp_file_selection_entry_callback (GtkWidget *widget,
(filename[len - 1] == G_DIR_SEPARATOR))
filename[len - 1] = '\0';
gtk_signal_handler_block_by_data (GTK_OBJECT (gfs->entry), gfs);
g_signal_handlers_block_by_func (G_OBJECT (gfs->entry),
gimp_file_selection_entry_callback,
gfs);
gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename);
gtk_signal_handler_unblock_by_data (GTK_OBJECT (gfs->entry), gfs);
g_signal_handlers_unblock_by_func (G_OBJECT (gfs->entry),
gimp_file_selection_entry_callback,
gfs);
if (gfs->file_selection)
gtk_file_selection_set_filename (GTK_FILE_SELECTION (gfs->file_selection),
......@@ -345,8 +349,8 @@ gimp_file_selection_entry_callback (GtkWidget *widget,
gtk_entry_set_position (GTK_ENTRY (gfs->entry), -1);
gtk_signal_emit (GTK_OBJECT (gfs),
gimp_file_selection_signals[FILENAME_CHANGED]);
g_signal_emit (G_OBJECT (gfs),
gimp_file_selection_signals[FILENAME_CHANGED], 0);
}
static gboolean
......@@ -417,28 +421,28 @@ gimp_file_selection_browse_callback (GtkWidget *widget,
gtk_container_set_border_width (GTK_CONTAINER (gfs->file_selection), 2);
gtk_container_set_border_width (GTK_CONTAINER (GTK_FILE_SELECTION (gfs->file_selection)->button_area), 2);
gtk_signal_connect
(GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->ok_button),
g_signal_connect
(G_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->ok_button),
"clicked",