Commit 1a44f212 authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

cleanup, removed unecessary G_OBJECT() casts. Should do the same for

2003-01-05  Manish Singh  <yosh@gimp.org>

        * many files in app, modules and libgimp*: cleanup, removed unecessary
        G_OBJECT() casts. Should do the same for plug-ins, when more of them
        get undeprecated.
parent 08caef04
2003-01-05 Manish Singh <yosh@gimp.org>
* many files in app, modules and libgimp*: cleanup, removed unecessary
G_OBJECT() casts. Should do the same for plug-ins, when more of them
get undeprecated.
2003-01-05 Manish Singh <yosh@gimp.org>
* plug-ins/script-fu/interp_regex.c: same as below for here.
......
......@@ -369,7 +369,7 @@ channels_new_channel_query (GimpImage *gimage,
TRUE, 0.0, 0.0,
NULL, NULL);
g_signal_connect (G_OBJECT (opacity_scale_data), "value_changed",
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (channels_opacity_update),
options->color_panel);
......@@ -378,7 +378,7 @@ channels_new_channel_query (GimpImage *gimage,
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (G_OBJECT (options->color_panel), "color_changed",
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (channels_color_changed),
opacity_scale_data);
......@@ -518,7 +518,7 @@ channels_edit_channel_query (GimpChannel *channel)
TRUE, 0.0, 0.0,
NULL, NULL);
g_signal_connect (G_OBJECT (opacity_scale_data), "value_changed",
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (channels_opacity_update),
options->color_panel);
......@@ -527,7 +527,7 @@ channels_edit_channel_query (GimpChannel *channel)
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (G_OBJECT (options->color_panel), "color_changed",
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (channels_color_changed),
opacity_scale_data);
......
......@@ -600,7 +600,7 @@ gradient_editor_replicate_cmd_callback (GtkWidget *widget,
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, TRUE, 4);
gtk_widget_show (scale);
g_signal_connect (G_OBJECT (scale_data), "value_changed",
g_signal_connect (scale_data, "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&editor->replicate_times);
......@@ -717,7 +717,7 @@ gradient_editor_split_uniformly_cmd_callback (GtkWidget *widget,
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 4);
gtk_widget_show (scale);
g_signal_connect (G_OBJECT (scale_data), "value_changed",
g_signal_connect (scale_data, "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&editor->split_parts);
......
......@@ -120,23 +120,23 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
gtk_container_set_border_width (GTK_CONTAINER (filesel), 2);
gtk_container_set_border_width (GTK_CONTAINER (filesel->button_area), 2);
g_signal_connect (G_OBJECT (filesel->ok_button), "clicked",
g_signal_connect (filesel->ok_button, "clicked",
G_CALLBACK (gradients_save_as_pov_ok_callback),
gradient);
g_signal_connect_swapped (G_OBJECT (filesel->cancel_button), "clicked",
g_signal_connect_swapped (filesel->cancel_button, "clicked",
G_CALLBACK (gtk_widget_destroy),
filesel);
g_signal_connect_swapped (G_OBJECT (filesel), "delete_event",
g_signal_connect_swapped (filesel, "delete_event",
G_CALLBACK (gtk_widget_destroy),
filesel);
g_object_ref (G_OBJECT (gradient));
g_object_ref (gradient);
g_signal_connect_object (G_OBJECT (filesel), "destroy",
g_signal_connect_object (filesel, "destroy",
G_CALLBACK (g_object_unref),
G_OBJECT (gradient),
gradient,
G_CONNECT_SWAPPED);
/* Connect the "F1" help key */
......
......@@ -150,9 +150,9 @@ image_resize_cmd_callback (GtkWidget *widget,
G_CALLBACK (image_resize_callback),
image_resize);
g_signal_connect_object (G_OBJECT (gdisp), "disconnect",
g_signal_connect_object (gdisp, "disconnect",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (image_resize->resize->resize_shell),
image_resize->resize->resize_shell,
G_CONNECT_SWAPPED);
g_object_weak_ref (G_OBJECT (image_resize->resize->resize_shell),
......@@ -190,9 +190,9 @@ image_scale_cmd_callback (GtkWidget *widget,
G_CALLBACK (image_scale_callback),
image_scale);
g_signal_connect_object (G_OBJECT (gdisp), "disconnect",
g_signal_connect_object (gdisp, "disconnect",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (image_scale->resize->resize_shell),
image_scale->resize->resize_shell,
G_CONNECT_SWAPPED);
g_object_weak_ref (G_OBJECT (image_scale->resize->resize_shell),
......@@ -231,7 +231,7 @@ image_duplicate_cmd_callback (GtkWidget *widget,
gimp_create_display (new_gimage->gimp, new_gimage, 0x0101);
g_object_unref (G_OBJECT (new_gimage));
g_object_unref (new_gimage);
}
void
......
......@@ -830,7 +830,7 @@ layers_edit_layer_query (GimpLayer *layer)
_("Layer _Name"), 1.0, 0.5,
options->name_entry, 1, FALSE);
g_signal_connect (G_OBJECT (options->name_entry), "activate",
g_signal_connect (options->name_entry, "activate",
G_CALLBACK (edit_layer_query_ok_callback),
options);
......@@ -866,7 +866,7 @@ add_mask_query_ok_callback (GtkWidget *widget,
{
mask = gimp_layer_create_mask (layer, options->add_mask_type);
gimp_layer_add_mask (layer, mask, TRUE);
g_object_unref (G_OBJECT (mask));
g_object_unref (mask);
gimp_image_flush (gimage);
}
......
......@@ -223,7 +223,7 @@ qmask_channel_query (GimpDisplayShell *shell)
_("Mask Opacity:"), 1.0, 1.0,
opacity_scale, 1, FALSE);
g_signal_connect (G_OBJECT (opacity_scale_data), "value_changed",
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (qmask_query_scale_update),
options->color_panel);
......@@ -232,7 +232,7 @@ qmask_channel_query (GimpDisplayShell *shell)
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (G_OBJECT (options->color_panel), "color_changed",
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (qmask_query_color_changed),
opacity_scale_data);
......
......@@ -223,7 +223,7 @@ qmask_channel_query (GimpDisplayShell *shell)
_("Mask Opacity:"), 1.0, 1.0,
opacity_scale, 1, FALSE);
g_signal_connect (G_OBJECT (opacity_scale_data), "value_changed",
g_signal_connect (opacity_scale_data, "value_changed",
G_CALLBACK (qmask_query_scale_update),
options->color_panel);
......@@ -232,7 +232,7 @@ qmask_channel_query (GimpDisplayShell *shell)
TRUE, TRUE, 0);
gtk_widget_show (options->color_panel);
g_signal_connect (G_OBJECT (options->color_panel), "color_changed",
g_signal_connect (options->color_panel, "color_changed",
G_CALLBACK (qmask_query_color_changed),
opacity_scale_data);
......
......@@ -343,7 +343,7 @@ vectors_stroke_vectors (GimpVectors *vectors)
tool_manager_control_active (gimage->gimp, RESUME, gdisp);
g_object_unref (G_OBJECT (core));
g_object_unref (core);
gimp_image_flush (gimage);
}
......
......@@ -132,7 +132,7 @@ app_init (gint gimp_argc,
#if 0
/* solely for debugging */
g_signal_connect (G_OBJECT (gimprc), "notify",
g_signal_connect (gimprc, "notify",
G_CALLBACK (gimprc_notify_callback),
NULL);
#endif
......@@ -189,10 +189,10 @@ app_init (gint gimp_argc,
/* connect our "exit" callbacks after gui_restore() so they are
* invoked after the GUI's "exit" callbacks
*/
g_signal_connect (G_OBJECT (the_gimp), "exit",
g_signal_connect (the_gimp, "exit",
G_CALLBACK (app_exit_callback),
NULL);
g_signal_connect_after (G_OBJECT (the_gimp), "exit",
g_signal_connect_after (the_gimp, "exit",
G_CALLBACK (app_exit_finish_callback),
NULL);
......@@ -270,7 +270,7 @@ static gboolean
app_exit_finish_callback (Gimp *gimp,
gboolean kill_it)
{
g_object_unref (G_OBJECT (gimp));
g_object_unref (gimp);
the_gimp = NULL;
base_exit ();
......
......@@ -80,7 +80,7 @@ base_init (GimpBaseConfig *config,
tile_cache_init (config->tile_cache_size);
g_signal_connect (G_OBJECT (config), "notify::tile-cache-size",
g_signal_connect (config, "notify::tile-cache-size",
G_CALLBACK (base_tile_cache_size_notify),
NULL);
......@@ -88,7 +88,7 @@ base_init (GimpBaseConfig *config,
/* Add the swap file */
if (! config->swap_path)
g_object_set (G_OBJECT (config), "swap_path", "${gimp_dir}", NULL);
g_object_set (config, "swap_path", "${gimp_dir}", NULL);
swapdir = gimp_config_path_expand (config->swap_path, TRUE, NULL);
swapfile = g_strdup_printf ("gimpswap.%lu", (unsigned long) getpid ());
......@@ -113,7 +113,7 @@ base_exit (void)
tile_swap_exit ();
tile_cache_exit ();
g_signal_handlers_disconnect_by_func (G_OBJECT (base_config),
g_signal_handlers_disconnect_by_func (base_config,
base_tile_cache_size_notify,
NULL);
......
......@@ -434,11 +434,11 @@ gimp_rc_set_autosave (GimpRc *rc,
return;
if (autosave)
g_signal_connect (G_OBJECT (rc), "notify",
g_signal_connect (rc, "notify",
G_CALLBACK (gimp_rc_notify),
NULL);
else
g_signal_handlers_disconnect_by_func (G_OBJECT (rc),
g_signal_handlers_disconnect_by_func (rc,
gimp_rc_notify, NULL);
rc->autosave = autosave;
......
......@@ -93,7 +93,7 @@ main (int argc,
}
g_print (" done.\n\n");
g_signal_connect (G_OBJECT (gimprc), "notify",
g_signal_connect (gimprc, "notify",
G_CALLBACK (notify_callback),
NULL);
......@@ -109,18 +109,18 @@ main (int argc,
g_print ("\n done.\n");
g_print ("\n Changing a property ...");
g_object_set (G_OBJECT (gimprc), "use-help", FALSE, NULL);
g_object_set (gimprc, "use-help", FALSE, NULL);
g_print ("\n Testing gimp_config_duplicate() ...");
gimprc2 = GIMP_RC (gimp_config_duplicate (G_OBJECT (gimprc)));
g_print (" done.\n");
g_signal_connect (G_OBJECT (gimprc2), "notify",
g_signal_connect (gimprc2, "notify",
G_CALLBACK (notify_callback),
NULL);
g_print ("\n Changing a property in the duplicate ...");
g_object_set (G_OBJECT (gimprc2), "show-tips", FALSE, NULL);
g_object_set (gimprc2, "show-tips", FALSE, NULL);
g_print ("\n Querying for \"default-comment\" ... ");
......@@ -151,7 +151,7 @@ main (int argc,
g_free (result);
g_object_unref (G_OBJECT (gimprc2));
g_object_unref (gimprc2);
g_print ("\n Deserializing from gimpconfig.c (should fail) ...");
if (! gimp_config_deserialize (G_OBJECT (gimprc),
......@@ -166,7 +166,7 @@ main (int argc,
return EXIT_FAILURE;
}
g_object_unref (G_OBJECT (gimprc));
g_object_unref (gimprc);
g_print ("\nFinished test of GimpConfig.\n\n");
......
......@@ -92,7 +92,7 @@ gimp_edit_cut (GimpImage *gimage,
{
/* Free the old global edit buffer */
if (gimage->gimp->global_buffer)
g_object_unref (G_OBJECT (gimage->gimp->global_buffer));
g_object_unref (gimage->gimp->global_buffer);
/* Set the global edit buffer */
gimage->gimp->global_buffer = gimp_buffer_new (cropped_cut,
......@@ -149,7 +149,7 @@ gimp_edit_copy (GimpImage *gimage,
{
/* Free the old global edit buffer */
if (gimage->gimp->global_buffer)
g_object_unref (G_OBJECT (gimage->gimp->global_buffer));
g_object_unref (gimage->gimp->global_buffer);
/* Set the global edit buffer */
gimage->gimp->global_buffer = gimp_buffer_new (cropped_copy,
......@@ -275,7 +275,7 @@ gimp_edit_paste_as_new (Gimp *gimp,
gimp_create_display (gimp, gimage, 0x0101);
g_object_unref (G_OBJECT (gimage));
g_object_unref (gimage);
return gimage;
}
......
......@@ -90,10 +90,10 @@ gimp_gradients_init (Gimp *gimp)
gradient->segments->left_color.b,
0.0);
g_signal_connect (G_OBJECT (gimp->user_context), "foreground_changed",
g_signal_connect (gimp->user_context, "foreground_changed",
G_CALLBACK (gimp_gradients_foreground_changed),
gimp);
g_signal_connect (G_OBJECT (gimp->user_context), "background_changed",
g_signal_connect (gimp->user_context, "background_changed",
G_CALLBACK (gimp_gradients_background_changed),
gimp);
}
......@@ -123,7 +123,7 @@ gimp_gradients_add_gradient (Gimp *gimp,
gimp_container_add (gimp->gradient_factory->container,
GIMP_OBJECT (gradient));
g_object_unref (G_OBJECT (gradient));
g_object_unref (gradient);
g_object_set_data (G_OBJECT (gimp), id, gradient);
......
......@@ -62,7 +62,7 @@ gimp_modules_exit (Gimp *gimp)
if (gimp->module_db)
{
g_object_unref (G_OBJECT (gimp->module_db));
g_object_unref (gimp->module_db);
gimp->module_db = NULL;
}
}
......
......@@ -290,13 +290,13 @@ gimp_finalize (GObject *object)
if (gimp->standard_context)
{
g_object_unref (G_OBJECT (gimp->standard_context));
g_object_unref (gimp->standard_context);
gimp->standard_context = NULL;
}
if (gimp->documents)
{
g_object_unref (G_OBJECT (gimp->documents));
g_object_unref (gimp->documents);
gimp->documents = NULL;
}
......@@ -304,7 +304,7 @@ gimp_finalize (GObject *object)
if (gimp->tool_info_list)
{
g_object_unref (G_OBJECT (gimp->tool_info_list));
g_object_unref (gimp->tool_info_list);
gimp->tool_info_list = NULL;
}
......@@ -326,37 +326,37 @@ gimp_finalize (GObject *object)
if (gimp->brush_factory)
{
g_object_unref (G_OBJECT (gimp->brush_factory));
g_object_unref (gimp->brush_factory);
gimp->brush_factory = NULL;
}
if (gimp->pattern_factory)
{
g_object_unref (G_OBJECT (gimp->pattern_factory));
g_object_unref (gimp->pattern_factory);
gimp->pattern_factory = NULL;
}
if (gimp->gradient_factory)
{
g_object_unref (G_OBJECT (gimp->gradient_factory));
g_object_unref (gimp->gradient_factory);
gimp->gradient_factory = NULL;
}
if (gimp->palette_factory)
{
g_object_unref (G_OBJECT (gimp->palette_factory));
g_object_unref (gimp->palette_factory);
gimp->palette_factory = NULL;
}
if (gimp->named_buffers)
{
g_object_unref (G_OBJECT (gimp->named_buffers));
g_object_unref (gimp->named_buffers);
gimp->named_buffers = NULL;
}
if (gimp->global_buffer)
{
g_object_unref (G_OBJECT (gimp->global_buffer));
g_object_unref (gimp->global_buffer);
gimp->global_buffer = NULL;
}
......@@ -380,7 +380,7 @@ gimp_finalize (GObject *object)
if (gimp->images)
{
g_object_unref (G_OBJECT (gimp->images));
g_object_unref (gimp->images);
gimp->images = NULL;
}
......@@ -696,13 +696,13 @@ gimp_initialize (Gimp *gimp,
*/
context = gimp_context_new (gimp, "Default", NULL);
gimp_set_default_context (gimp, context);
g_object_unref (G_OBJECT (context));
g_object_unref (context);
/* the initial user_context is a straight copy of the default context
*/
context = gimp_context_new (gimp, "User", context);
gimp_set_user_context (gimp, context);
g_object_unref (G_OBJECT (context));
g_object_unref (context);
gimp_set_current_context (gimp, context);
......@@ -765,7 +765,7 @@ gimp_exit (Gimp *gimp,
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_signal_emit (G_OBJECT (gimp), gimp_signals[EXIT], 0,
g_signal_emit (gimp, gimp_signals[EXIT], 0,
kill_it ? TRUE : FALSE,
&handled);
}
......@@ -965,14 +965,14 @@ gimp_set_default_context (Gimp *gimp,
if (gimp->default_context)
{
g_object_unref (G_OBJECT (gimp->default_context));
g_object_unref (gimp->default_context);
}
gimp->default_context = context;
if (gimp->default_context)
{
g_object_ref (G_OBJECT (gimp->default_context));
g_object_ref (gimp->default_context);
}
}
......@@ -993,14 +993,14 @@ gimp_set_user_context (Gimp *gimp,
if (gimp->user_context)
{
g_object_unref (G_OBJECT (gimp->user_context));
g_object_unref (gimp->user_context);
}
gimp->user_context = context;
if (gimp->user_context)
{
g_object_ref (G_OBJECT (gimp->user_context));
g_object_ref (gimp->user_context);
}
}
......@@ -1021,14 +1021,14 @@ gimp_set_current_context (Gimp *gimp,
if (gimp->current_context)
{
g_object_unref (G_OBJECT (gimp->current_context));
g_object_unref (gimp->current_context);
}
gimp->current_context = context;
if (gimp->current_context)
{
g_object_ref (G_OBJECT (gimp->current_context));
g_object_ref (gimp->current_context);
}
}
......
......@@ -351,7 +351,7 @@ gimp_brush_get_standard (void)
gimp_object_set_name (GIMP_OBJECT (standard_brush), "Standard");
/* set ref_count to 2 --> never swap the standard brush */
g_object_ref (G_OBJECT (standard_brush));
g_object_ref (standard_brush);
}
return GIMP_DATA (standard_brush);
......@@ -489,7 +489,7 @@ gimp_brush_spacing_changed (GimpBrush *brush)
{
g_return_if_fail (GIMP_IS_BRUSH (brush));
g_signal_emit (G_OBJECT (brush), brush_signals[SPACING_CHANGED], 0);
g_signal_emit (brush, brush_signals[SPACING_CHANGED], 0);
}
GimpBrush *
......@@ -587,7 +587,7 @@ gimp_brush_load_brush (gint fd,
"Brush file '%s' appears truncated."),
filename);
g_free (name);
g_object_unref (G_OBJECT (brush));
g_object_unref (brush);
return NULL;
}
break;
......@@ -608,7 +608,7 @@ gimp_brush_load_brush (gint fd,
"Brush file '%s' appears truncated."),
filename);
g_free (name);
g_object_unref (G_OBJECT (brush));
g_object_unref (brush);
return NULL;
}
}
......
......@@ -351,7 +351,7 @@ gimp_brush_get_standard (void)
gimp_object_set_name (GIMP_OBJECT (standard_brush), "Standard");
/* set ref_count to 2 --> never swap the standard brush */
g_object_ref (G_OBJECT (standard_brush));
g_object_ref (standard_brush);
}
return GIMP_DATA (standard_brush);
......@@ -489,7 +489,7 @@ gimp_brush_spacing_changed (GimpBrush *brush)
{
g_return_if_fail (GIMP_IS_BRUSH (brush));
g_signal_emit (G_OBJECT (brush), brush_signals[SPACING_CHANGED], 0);
g_signal_emit (brush, brush_signals[SPACING_CHANGED], 0);
}
GimpBrush *
......@@ -587,7 +587,7 @@ gimp_brush_load_brush (gint fd,
"Brush file '%s' appears truncated."),
filename);
g_free (name);
g_object_unref (G_OBJECT (brush));
g_object_unref (brush);
return NULL;
}
break;
......@@ -608,7 +608,7 @@ gimp_brush_load_brush (gint fd,
"Brush file '%s' appears truncated."),
filename);
g_free (name);
g_object_unref (G_OBJECT (brush));
g_object_unref (brush);
return NULL;
}
}
......
......@@ -159,7 +159,7 @@ gimp_brush_pipe_finalize (GObject *object)
for (i = 0; i < pipe->nbrushes; i++)
if (pipe->brushes[i])
g_object_unref (G_OBJECT (pipe->brushes[i]));
g_object_unref (pipe->brushes[i]);
g_free (pipe->brushes);
pipe->brushes = NULL;
......@@ -371,7 +371,7 @@ gimp_brush_pipe_load (const gchar *filename,
"Brush file '%s' is corrupt."),
filename);
close (fd);
g_object_unref (G_OBJECT (pipe));
g_object_unref (pipe);
g_string_free (buffer, TRUE);
return NULL;
}
......@@ -461,7 +461,7 @@ gimp_brush_pipe_load (const gchar *filename,
"Brush file '%s' is corrupt."),
filename);