Commit 79faae01 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

Switched to GObject reference counting:

2001-08-12  Michael Natterer  <mitch@gimp.org>

	Switched to GObject reference counting:

	* app/core/gimpcontainer.c: only ref(), not ref()/sink() children
	of strong containers. Reordered gimp_container_remove() so we
	don't need to ref the object while removing it.

	* app/core/gimpcontext.c: misc fixes. Needs to be badly tortured...

	* app/app_procs.c
	* app/gdisplay.c
	* app/gimprc.c
	* app/core/gimp.c
	* app/core/gimpbrush.c
	* app/core/gimpbrushpipe.c
	* app/core/gimpdatafactory.c
	* app/core/gimpdocuments.c
	* app/core/gimpgradient.c
	* app/core/gimpimage.c
	* app/core/gimplayer.c
	* app/core/gimplist.c
	* app/core/gimpobject.c
	* app/core/gimpparasite.c
	* app/core/gimppattern.c
	* app/core/gimpundostack.c
	* app/gui/dialogs.c
	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpfuzzyselecttool.c: changed accordingly: don't
	ref()/sink() any more, unref all (??) objects after adding them to
	strong containers, misc. minor fixes.

	* app/gui/dialogs-constructors.c
	* app/widgets/gimpwidgets.c: use g_object_add_weak_pointer()
	instead of simply crashing because g_object_weak_ref() was used
	with gtk_widget_destroyed, brrr.

	* app/widgets/gimpdnd.c: removed unneeded g_return_if_fail()'s.
parent 8a63c99f
2001-08-12 Michael Natterer <mitch@gimp.org>
Switched to GObject reference counting:
* app/core/gimpcontainer.c: only ref(), not ref()/sink() children
of strong containers. Reordered gimp_container_remove() so we
don't need to ref the object while removing it.
* app/core/gimpcontext.c: misc fixes. Needs to be badly tortured...
* app/app_procs.c
* app/gdisplay.c
* app/gimprc.c
* app/core/gimp.c
* app/core/gimpbrush.c
* app/core/gimpbrushpipe.c
* app/core/gimpdatafactory.c
* app/core/gimpdocuments.c
* app/core/gimpgradient.c
* app/core/gimpimage.c
* app/core/gimplayer.c
* app/core/gimplist.c
* app/core/gimpobject.c
* app/core/gimpparasite.c
* app/core/gimppattern.c
* app/core/gimpundostack.c
* app/gui/dialogs.c
* app/tools/gimpbezierselecttool.c
* app/tools/gimpfuzzyselecttool.c: changed accordingly: don't
ref()/sink() any more, unref all (??) objects after adding them to
strong containers, misc. minor fixes.
* app/gui/dialogs-constructors.c
* app/widgets/gimpwidgets.c: use g_object_add_weak_pointer()
instead of simply crashing because g_object_weak_ref() was used
with gtk_widget_destroyed, brrr.
* app/widgets/gimpdnd.c: removed unneeded g_return_if_fail()'s.
2001-08-12 Sven Neumann <sven@gimp.org>
* TODO.xml: fixed an error, updated some numbers and added new items.
......
......@@ -101,9 +101,6 @@ app_init (gint gimp_argc,
*/
the_gimp = gimp_new ();
gtk_object_ref (GTK_OBJECT (the_gimp));
gtk_object_sink (GTK_OBJECT (the_gimp));
/* Check if the user's gimp_directory exists
*/
gimp_dir = gimp_directory ();
......
......@@ -45,8 +45,6 @@ gimp_documents_init (Gimp *gimp)
gimp->documents = gimp_list_new (GIMP_TYPE_IMAGEFILE,
GIMP_CONTAINER_POLICY_STRONG);
gtk_object_ref (GTK_OBJECT (gimp->documents));
gtk_object_sink (GTK_OBJECT (gimp->documents));
}
void
......@@ -151,8 +149,6 @@ gimp_documents_add (Gimp *gimp,
imagefile = gimp_imagefile_new (filename);
gimp_container_add (gimp->documents, GIMP_OBJECT (imagefile));
gtk_object_ref (GTK_OBJECT (imagefile));
gtk_object_sink (GTK_OBJECT (imagefile));
g_object_unref (G_OBJECT (imagefile));
}
}
......@@ -43,9 +43,6 @@ gimp_parasites_init (Gimp *gimp)
g_return_if_fail (gimp->parasites == NULL);
gimp->parasites = gimp_parasite_list_new ();
gtk_object_ref (GTK_OBJECT (gimp->parasites));
gtk_object_sink (GTK_OBJECT (gimp->parasites));
}
void
......
......@@ -127,9 +127,6 @@ gimp_init (Gimp *gimp)
gimp->images = gimp_list_new (GIMP_TYPE_IMAGE,
GIMP_CONTAINER_POLICY_WEAK);
gtk_object_ref (GTK_OBJECT (gimp->images));
gtk_object_sink (GTK_OBJECT (gimp->images));
gimp->next_image_ID = 1;
gimp->next_guide_ID = 1;
gimp->image_table = g_hash_table_new (g_direct_hash, NULL);
......@@ -140,9 +137,6 @@ gimp_init (Gimp *gimp)
gimp->global_buffer = NULL;
gimp->named_buffers = gimp_list_new (GIMP_TYPE_BUFFER,
GIMP_CONTAINER_POLICY_STRONG);
gtk_object_ref (GTK_OBJECT (gimp->named_buffers));
gtk_object_sink (GTK_OBJECT (gimp->named_buffers));
gimp->brush_factory = NULL;
gimp->pattern_factory = NULL;
gimp->gradient_factory = NULL;
......@@ -152,8 +146,6 @@ gimp_init (Gimp *gimp)
gimp->tool_info_list = gimp_list_new (GIMP_TYPE_TOOL_INFO,
GIMP_CONTAINER_POLICY_STRONG);
gtk_object_ref (GTK_OBJECT (gimp->tool_info_list));
gtk_object_sink (GTK_OBJECT (gimp->tool_info_list));
gimp_documents_init (gimp);
......@@ -344,7 +336,6 @@ gimp_initialize (Gimp *gimp)
static gint n_palette_loader_entries = (sizeof (palette_loader_entries) /
sizeof (palette_loader_entries[0]));
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
gimp->brush_factory =
......@@ -354,8 +345,6 @@ gimp_initialize (Gimp *gimp)
n_brush_loader_entries,
gimp_brush_new,
gimp_brush_get_standard);
gtk_object_ref (GTK_OBJECT (gimp->brush_factory));
gtk_object_sink (GTK_OBJECT (gimp->brush_factory));
gimp->pattern_factory =
gimp_data_factory_new (GIMP_TYPE_PATTERN,
......@@ -364,8 +353,6 @@ gimp_initialize (Gimp *gimp)
n_pattern_loader_entries,
gimp_pattern_new,
gimp_pattern_get_standard);
gtk_object_ref (GTK_OBJECT (gimp->pattern_factory));
gtk_object_sink (GTK_OBJECT (gimp->pattern_factory));
gimp->gradient_factory =
gimp_data_factory_new (GIMP_TYPE_GRADIENT,
......@@ -374,8 +361,6 @@ gimp_initialize (Gimp *gimp)
n_gradient_loader_entries,
gimp_gradient_new,
gimp_gradient_get_standard);
gtk_object_ref (GTK_OBJECT (gimp->gradient_factory));
gtk_object_sink (GTK_OBJECT (gimp->gradient_factory));
gimp->palette_factory =
gimp_data_factory_new (GIMP_TYPE_PALETTE,
......@@ -384,30 +369,32 @@ gimp_initialize (Gimp *gimp)
n_palette_loader_entries,
gimp_palette_new,
gimp_palette_get_standard);
gtk_object_ref (GTK_OBJECT (gimp->palette_factory));
gtk_object_sink (GTK_OBJECT (gimp->palette_factory));
gimp_image_new_init (gimp);
gimp->standard_context = gimp_create_context (gimp, "Standard", NULL);
gtk_object_ref (GTK_OBJECT (gimp->standard_context));
gtk_object_sink (GTK_OBJECT (gimp->standard_context));
/* TODO: load from disk */
/* the default context contains the user's saved preferences
*
* TODO: load from disk
*/
context = gimp_create_context (gimp, "Default", NULL);
gimp_set_default_context (gimp, context);
g_object_unref (G_OBJECT (context));
/* the initial user_context is a straight copy of the default context
*/
context = gimp_create_context (gimp, "User", context);
gimp_set_user_context (gimp, context);
gimp_set_current_context (gimp, context);
g_object_unref (G_OBJECT (context));
}
void
gimp_restore (Gimp *gimp,
gboolean no_data)
{
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
/* initialize the global parasite table */
......@@ -440,7 +427,6 @@ gimp_restore (Gimp *gimp,
void
gimp_shutdown (Gimp *gimp)
{
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
gimp_data_factory_data_save (gimp->brush_factory);
......@@ -455,7 +441,6 @@ gimp_shutdown (Gimp *gimp)
void
gimp_set_busy (Gimp *gimp)
{
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
/* FIXME: gimp_busy HACK */
......@@ -482,7 +467,6 @@ gimp_idle_unset_busy (gpointer data)
void
gimp_set_busy_until_idle (Gimp *gimp)
{
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
if (! gimp->busy_idle_id)
......@@ -498,7 +482,6 @@ gimp_set_busy_until_idle (Gimp *gimp)
void
gimp_unset_busy (Gimp *gimp)
{
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
if (gimp->gui_unset_busy_func)
......@@ -517,7 +500,6 @@ gimp_create_image (Gimp *gimp,
{
GimpImage *gimage;
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
gimage = gimp_image_new (gimp, width, height, type);
......@@ -543,7 +525,6 @@ void
gimp_create_display (Gimp *gimp,
GimpImage *gimage)
{
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
if (gimp->create_display_func)
......@@ -559,7 +540,6 @@ gimp_open_file (Gimp *gimp,
GimpImage *gimage;
gint status;
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (filename != NULL);
......@@ -601,7 +581,6 @@ gimp_create_context (Gimp *gimp,
{
GimpContext *context;
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (!template || GIMP_IS_CONTEXT (template), NULL);
......@@ -631,7 +610,6 @@ gimp_context_disconnect_callback (GimpContext *context,
GimpContext *
gimp_get_standard_context (Gimp *gimp)
{
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return gimp->standard_context;
......@@ -641,7 +619,6 @@ void
gimp_set_default_context (Gimp *gimp,
GimpContext *context)
{
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (! context || GIMP_IS_CONTEXT (context));
......@@ -654,15 +631,13 @@ gimp_set_default_context (Gimp *gimp,
if (gimp->default_context)
{
gtk_object_ref (GTK_OBJECT (gimp->default_context));
gtk_object_sink (GTK_OBJECT (gimp->default_context));
g_object_ref (G_OBJECT (gimp->default_context));
}
}
GimpContext *
gimp_get_default_context (Gimp *gimp)
{
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return gimp->default_context;
......@@ -672,7 +647,6 @@ void
gimp_set_user_context (Gimp *gimp,
GimpContext *context)
{
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (! context || GIMP_IS_CONTEXT (context));
......@@ -685,15 +659,13 @@ gimp_set_user_context (Gimp *gimp,
if (gimp->user_context)
{
gtk_object_ref (GTK_OBJECT (gimp->user_context));
gtk_object_sink (GTK_OBJECT (gimp->user_context));
g_object_ref (G_OBJECT (gimp->user_context));
}
}
GimpContext *
gimp_get_user_context (Gimp *gimp)
{
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return gimp->user_context;
......@@ -703,7 +675,6 @@ void
gimp_set_current_context (Gimp *gimp,
GimpContext *context)
{
g_return_if_fail (gimp != NULL);
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (! context || GIMP_IS_CONTEXT (context));
......@@ -723,7 +694,6 @@ gimp_set_current_context (Gimp *gimp,
GimpContext *
gimp_get_current_context (Gimp *gimp)
{
g_return_val_if_fail (gimp != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
return gimp->current_context;
......
......@@ -322,8 +322,6 @@ gimp_brush_get_standard (void)
/* set ref_count to 2 --> never swap the standard brush */
g_object_ref (G_OBJECT (standard_brush));
gtk_object_ref (GTK_OBJECT (standard_brush));
gtk_object_sink (GTK_OBJECT (standard_brush));
}
return GIMP_DATA (standard_brush);
......
......@@ -322,8 +322,6 @@ gimp_brush_get_standard (void)
/* set ref_count to 2 --> never swap the standard brush */
g_object_ref (G_OBJECT (standard_brush));
gtk_object_ref (GTK_OBJECT (standard_brush));
gtk_object_sink (GTK_OBJECT (standard_brush));
}
return GIMP_DATA (standard_brush);
......
......@@ -321,7 +321,7 @@ gimp_brush_pipe_load (const gchar *filename)
g_message (_("Brush pipes should have at least one brush:\n\"%s\""),
filename);
close (fd);
gtk_object_sink (GTK_OBJECT (pipe));
g_object_unref (G_OBJECT (pipe));
g_string_free (buffer, TRUE);
return NULL;
}
......@@ -401,9 +401,6 @@ gimp_brush_pipe_load (const gchar *filename)
if (pipe->brushes[pipe->nbrushes])
{
gtk_object_ref (GTK_OBJECT (pipe->brushes[pipe->nbrushes]));
gtk_object_sink (GTK_OBJECT (pipe->brushes[pipe->nbrushes]));
gimp_object_set_name (GIMP_OBJECT (pipe->brushes[pipe->nbrushes]),
NULL);
}
......@@ -412,7 +409,7 @@ gimp_brush_pipe_load (const gchar *filename)
g_message (_("Failed to load one of the brushes in the brush pipe\n\"%s\""),
filename);
close (fd);
gtk_object_sink (GTK_OBJECT (pipe));
g_object_unref (G_OBJECT (pipe));
return NULL;
}
......
......@@ -321,7 +321,7 @@ gimp_brush_pipe_load (const gchar *filename)
g_message (_("Brush pipes should have at least one brush:\n\"%s\""),
filename);
close (fd);
gtk_object_sink (GTK_OBJECT (pipe));
g_object_unref (G_OBJECT (pipe));
g_string_free (buffer, TRUE);
return NULL;
}
......@@ -401,9 +401,6 @@ gimp_brush_pipe_load (const gchar *filename)
if (pipe->brushes[pipe->nbrushes])
{
gtk_object_ref (GTK_OBJECT (pipe->brushes[pipe->nbrushes]));
gtk_object_sink (GTK_OBJECT (pipe->brushes[pipe->nbrushes]));
gimp_object_set_name (GIMP_OBJECT (pipe->brushes[pipe->nbrushes]),
NULL);
}
......@@ -412,7 +409,7 @@ gimp_brush_pipe_load (const gchar *filename)
g_message (_("Failed to load one of the brushes in the brush pipe\n\"%s\""),
filename);
close (fd);
gtk_object_sink (GTK_OBJECT (pipe));
g_object_unref (G_OBJECT (pipe));
return NULL;
}
......
......@@ -52,11 +52,13 @@ enum
/* local function prototypes */
static void gimp_container_init (GimpContainer *container);
static void gimp_container_class_init (GimpContainerClass *klass);
static void gimp_container_dispose (GObject *object);
static void gimp_container_disconnect_callback (GimpObject *object,
gpointer data);
static void gimp_container_class_init (GimpContainerClass *klass);
static void gimp_container_init (GimpContainer *container);
static void gimp_container_dispose (GObject *object);
static void gimp_container_disconnect_callback (GimpObject *object,
gpointer data);
static guint container_signals[LAST_SIGNAL] = { 0 };
......@@ -93,18 +95,7 @@ gimp_container_get_type (void)
}
static void
gimp_container_init (GimpContainer *container)
{
container->children_type = GIMP_TYPE_OBJECT;
container->policy = GIMP_CONTAINER_POLICY_STRONG;
container->num_children = 0;
container->handlers = NULL;
container->freeze_count = 0;
}
static void
gimp_container_class_init (GimpContainerClass* klass)
gimp_container_class_init (GimpContainerClass *klass)
{
GObjectClass *object_class;
......@@ -166,13 +157,25 @@ gimp_container_class_init (GimpContainerClass* klass)
klass->add = NULL;
klass->remove = NULL;
klass->reorder = NULL;
klass->freeze = NULL;
klass->thaw = NULL;
klass->have = NULL;
klass->foreach = NULL;
klass->get_child_by_name = NULL;
klass->get_child_by_index = NULL;
klass->get_child_index = NULL;
klass->freeze = NULL;
klass->thaw = NULL;
}
static void
gimp_container_init (GimpContainer *container)
{
container->children_type = GIMP_TYPE_OBJECT;
container->policy = GIMP_CONTAINER_POLICY_STRONG;
container->num_children = 0;
container->handlers = NULL;
container->freeze_count = 0;
}
static void
......@@ -263,8 +266,7 @@ gimp_container_add (GimpContainer *container,
switch (container->policy)
{
case GIMP_CONTAINER_POLICY_STRONG:
gtk_object_ref (GTK_OBJECT (object));
gtk_object_sink (GTK_OBJECT (object));
g_object_ref (G_OBJECT (object));
break;
case GIMP_CONTAINER_POLICY_WEAK:
......@@ -316,7 +318,10 @@ gimp_container_remove (GimpContainer *container,
}
}
g_object_ref (G_OBJECT (object));
container->num_children--;
g_signal_emit (G_OBJECT (container), container_signals[REMOVE], 0,
object);
switch (container->policy)
{
......@@ -332,13 +337,6 @@ gimp_container_remove (GimpContainer *container,
break;
}
container->num_children--;
g_signal_emit (G_OBJECT (container), container_signals[REMOVE], 0,
object);
g_object_unref (G_OBJECT (object));
return TRUE;
}
......
......@@ -357,7 +357,7 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GIMP_TYPE_IMAGE);
gimp_context_signals[DISPLAY_CHANGED] =
g_signal_new (gimp_context_signal_names[DISPLAY_CHANGED],
......@@ -377,7 +377,7 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GIMP_TYPE_TOOL_INFO);
gimp_context_signals[FOREGROUND_CHANGED] =
g_signal_new (gimp_context_signal_names[FOREGROUND_CHANGED],
......@@ -427,7 +427,7 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GIMP_TYPE_BRUSH);
gimp_context_signals[PATTERN_CHANGED] =
g_signal_new (gimp_context_signal_names[PATTERN_CHANGED],
......@@ -437,7 +437,7 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GIMP_TYPE_PATTERN);
gimp_context_signals[GRADIENT_CHANGED] =
g_signal_new (gimp_context_signal_names[GRADIENT_CHANGED],
......@@ -447,7 +447,7 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GIMP_TYPE_GRADIENT);
gimp_context_signals[PALETTE_CHANGED] =
g_signal_new (gimp_context_signal_names[PALETTE_CHANGED],
......@@ -457,7 +457,7 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GIMP_TYPE_PALETTE);
gimp_context_signals[BUFFER_CHANGED] =
g_signal_new (gimp_context_signal_names[BUFFER_CHANGED],
......@@ -467,7 +467,7 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
GIMP_TYPE_BUFFER);
object_class->set_property = gimp_context_set_property;
object_class->get_property = gimp_context_get_property;
......@@ -927,6 +927,7 @@ gimp_context_set_parent (GimpContext *context,
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (! parent || GIMP_IS_CONTEXT (parent));
g_return_if_fail (context != parent);
if (context == parent || context->parent == parent)
return;
......@@ -949,14 +950,12 @@ void
gimp_context_unset_parent (GimpContext *context)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (GIMP_IS_CONTEXT (context->parent));
if (context->parent)
{
if (context->defined_props != GIMP_CONTEXT_ALL_PROPS_MASK)
gtk_signal_disconnect_by_data (GTK_OBJECT (context->parent), context);
if (context->defined_props != GIMP_CONTEXT_ALL_PROPS_MASK)
gtk_signal_disconnect_by_data (GTK_OBJECT (context->parent), context);
context->parent = NULL;
}
context->parent = NULL;
}
/* define / undefinine context properties */
......@@ -1097,11 +1096,12 @@ gimp_context_get_by_type (GimpContext *context,
GimpObject *object = NULL;
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail ((prop = gimp_context_type_to_property (type)) != -1, NULL);
g_return_val_if_fail ((prop = gimp_context_type_to_property (type)) != -1,
NULL);
gtk_object_get (GTK_OBJECT (context),
gimp_context_prop_names[prop], &object,
NULL);
g_object_get (GTK_OBJECT (context),
gimp_context_prop_names[prop], &object,
NULL);
return object;
}
......@@ -1116,9 +1116,9 @@ gimp_context_set_by_type (GimpContext *context,
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail ((prop = gimp_context_type_to_property (type)) != -1);
gtk_object_set (GTK_OBJECT (context),
gimp_context_prop_names[prop], object,
NULL);
g_object_set (GTK_OBJECT (context),
gimp_context_prop_names[prop], object,
NULL);
}
void
......@@ -1288,10 +1288,8 @@ void
gimp_context_set_tool (GimpContext *context,
GimpToolInfo *tool_info)
{
g_return_if_fail (! context || GIMP_IS_CONTEXT (context));
g_return_if_fail (! tool_info || GIMP_IS_TOOL_INFO (tool_info));
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (! tool_info || GIMP_IS_TOOL_INFO (tool_info));
context_find_defined (context, GIMP_CONTEXT_TOOL_MASK);
gimp_context_real_set_tool (context, tool_info);
......@@ -1300,8 +1298,6 @@ gimp_context_set_tool (GimpContext *context,
void
gimp_context_tool_changed (GimpContext *context)
{
g_return_if_fail (! context || GIMP_IS_CONTEXT (context));
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_signal_emit (G_OBJECT (context),
......@@ -1328,7 +1324,7 @@ gimp_context_tool_list_thaw (GimpContainer *container,
GimpToolInfo *tool_info;
if (! context->tool_name)
context->tool_name = g_strdup ("Color Picker");
context->tool_name = g_strdup ("gimp:rect-select-tool");
if ((tool_info = (GimpToolInfo *)
gimp_container_get_child_by_name (container,
......@@ -1419,7 +1415,7 @@ gimp_context_copy_tool (GimpContext *src,
{
gimp_conte