mirror of https://github.com/GNOME/gimp.git
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.
This commit is contained in:
parent
8a63c99f72
commit
79faae01b4
39
ChangeLog
39
ChangeLog
|
@ -1,3 +1,42 @@
|
|||
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,9 +52,11 @@ enum
|
|||
|
||||
/* local function prototypes */
|
||||
|
||||
static void gimp_container_init (GimpContainer *container);
|
||||
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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
context->parent = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* define / undefinine context properties */
|
||||
|
@ -1097,9 +1096,10 @@ 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),
|
||||
g_object_get (GTK_OBJECT (context),
|
||||
gimp_context_prop_names[prop], &object,
|
||||
NULL);
|
||||
|
||||
|
@ -1116,7 +1116,7 @@ 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),
|
||||
g_object_set (GTK_OBJECT (context),
|
||||
gimp_context_prop_names[prop], object,
|
||||
NULL);
|
||||
}
|
||||
|
@ -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_context_real_set_tool (dest, src->tool_info);
|
||||
|
||||
if ((!src->tool_info || src->tool_info == standard_tool_info) &&
|
||||
if ((! src->tool_info || src->tool_info == standard_tool_info) &&
|
||||
src->tool_name)
|
||||
{
|
||||
g_free (dest->tool_name);
|
||||
|
@ -1436,7 +1432,6 @@ gimp_context_get_foreground (GimpContext *context,
|
|||
GimpRGB *color)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
*color = context->foreground;
|
||||
|
@ -1447,9 +1442,8 @@ gimp_context_set_foreground (GimpContext *context,
|
|||
const GimpRGB *color)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||
context_find_defined (context, GIMP_CONTEXT_FOREGROUND_MASK);
|
||||
|
||||
g_return_if_fail (color != NULL);
|
||||
context_find_defined (context, GIMP_CONTEXT_FOREGROUND_MASK);
|
||||
|
||||
gimp_context_real_set_foreground (context, color);
|
||||
}
|
||||
|
@ -1502,9 +1496,8 @@ gimp_context_set_background (GimpContext *context,
|
|||
const GimpRGB *color)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||
context_find_defined (context, GIMP_CONTEXT_BACKGROUND_MASK);
|
||||
|
||||
g_return_if_fail (color != NULL);
|
||||
context_find_defined (context, GIMP_CONTEXT_BACKGROUND_MASK);
|
||||
|
||||
gimp_context_real_set_background (context, color);
|
||||
}
|
||||
|
@ -1696,10 +1689,8 @@ void
|
|||
gimp_context_set_brush (GimpContext *context,
|
||||
GimpBrush *brush)
|
||||
{
|
||||
g_return_if_fail (! context || GIMP_IS_CONTEXT (context));
|
||||
g_return_if_fail (! brush || GIMP_IS_BRUSH (brush));
|
||||
|
||||
g_return_if_fail (GIMP_IS_CONTEXT (context));
|
||||
g_return_if_fail (! brush || GIMP_IS_BRUSH (brush));
|
||||
context_find_defined (context, GIMP_CONTEXT_BRUSH_MASK);
|
||||
|
||||
gimp_context_real_set_brush (context, brush);
|
||||
|
@ -1708,8 +1699,6 @@ gimp_context_set_brush (GimpContext *context,
|
|||
void
|
||||
gimp_context_brush_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),
|
||||
|
@ -1790,20 +1779,21 @@ gimp_context_real_set_brush (GimpContext *context,
|
|||
context->brush_name = NULL;
|
||||
}
|
||||
|
||||
/* make sure the active brush is swapped before we get a new one... */
|
||||
if (base_config->stingy_memory_use &&
|
||||
context->brush && context->brush->mask &&
|
||||
G_OBJECT (context->brush)->ref_count == 2)
|
||||
{
|
||||
temp_buf_swap (brush->mask);
|
||||
}
|
||||
|
||||
/* disconnect from the old brush's signals */
|
||||
if (context->brush)
|
||||
{
|
||||
/* make sure the active brush is swapped before we get a new one... */
|
||||
if (base_config->stingy_memory_use &&
|
||||
context->brush->mask &&
|
||||
G_OBJECT (context->brush)->ref_count == 2)
|
||||
{
|
||||
temp_buf_swap (context->brush->mask);
|
||||
}
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (context->brush),
|
||||
gimp_context_brush_dirty,
|
||||
context);
|
||||
|
||||
g_object_unref (G_OBJECT (context->brush));
|
||||
}
|
||||
|
||||
|
@ -1843,7 +1833,7 @@ gimp_context_copy_brush (GimpContext *src,
|
|||
{
|
||||
gimp_context_real_set_brush (dest, src->brush);
|
||||
|
||||
if ((!src->brush || src->brush == standard_brush) && src->brush_name)
|
||||
if ((! src->brush || src->brush == standard_brush) && src->brush_name)
|
||||
{
|
||||
g_free (dest->brush_name);
|
||||
dest->brush_name = g_strdup (src->brush_name);
|
||||
|
|
|
@ -133,9 +133,6 @@ gimp_data_factory_new (GType data_type,
|
|||
|
||||
factory->container = gimp_data_list_new (data_type);
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (factory->container));
|
||||
gtk_object_sink (GTK_OBJECT (factory->container));
|
||||
|
||||
factory->data_path = data_path;
|
||||
|
||||
factory->loader_entries = loader_entries;
|
||||
|
@ -241,6 +238,7 @@ gimp_data_factory_data_new (GimpDataFactory *factory,
|
|||
data = factory->data_new_func (name);
|
||||
|
||||
gimp_container_add (factory->container, GIMP_OBJECT (data));
|
||||
g_object_unref (G_OBJECT (data));
|
||||
|
||||
return data;
|
||||
}
|
||||
|
@ -296,8 +294,13 @@ gimp_data_factory_data_load_callback (const gchar *filename,
|
|||
data = (GimpData *) (* factory->loader_entries[i].load_func) (filename);
|
||||
|
||||
if (! data)
|
||||
{
|
||||
g_message (_("Warning: Failed to load data from\n\"%s\""), filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_container_add (factory->container, GIMP_OBJECT (data));
|
||||
g_object_unref (G_OBJECT (data));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -282,8 +282,7 @@ gimp_gradient_get_standard (void)
|
|||
{
|
||||
standard_gradient = GIMP_GRADIENT (gimp_gradient_new ("Standard"));
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (standard_gradient));
|
||||
gtk_object_sink (GTK_OBJECT (standard_gradient));
|
||||
g_object_ref (G_OBJECT (standard_gradient));
|
||||
}
|
||||
|
||||
return GIMP_DATA (standard_gradient);
|
||||
|
|
|
@ -3605,6 +3605,7 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
}
|
||||
|
||||
gimp_container_insert (gimage->layers, GIMP_OBJECT (layer), position);
|
||||
g_object_unref (G_OBJECT (layer));
|
||||
|
||||
/* notify the layers dialog of the currently active layer */
|
||||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
@ -3801,6 +3802,7 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* add the channel to the list */
|
||||
gimp_container_add (gimage->channels, GIMP_OBJECT (channel));
|
||||
g_object_unref (G_OBJECT (channel));
|
||||
|
||||
/* notify this gimage of the currently active channel */
|
||||
gimp_image_set_active_channel (gimage, channel);
|
||||
|
|
|
@ -3605,6 +3605,7 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
}
|
||||
|
||||
gimp_container_insert (gimage->layers, GIMP_OBJECT (layer), position);
|
||||
g_object_unref (G_OBJECT (layer));
|
||||
|
||||
/* notify the layers dialog of the currently active layer */
|
||||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
@ -3801,6 +3802,7 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* add the channel to the list */
|
||||
gimp_container_add (gimage->channels, GIMP_OBJECT (channel));
|
||||
g_object_unref (G_OBJECT (channel));
|
||||
|
||||
/* notify this gimage of the currently active channel */
|
||||
gimp_image_set_active_channel (gimage, channel);
|
||||
|
|
|
@ -3605,6 +3605,7 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
}
|
||||
|
||||
gimp_container_insert (gimage->layers, GIMP_OBJECT (layer), position);
|
||||
g_object_unref (G_OBJECT (layer));
|
||||
|
||||
/* notify the layers dialog of the currently active layer */
|
||||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
@ -3801,6 +3802,7 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* add the channel to the list */
|
||||
gimp_container_add (gimage->channels, GIMP_OBJECT (channel));
|
||||
g_object_unref (G_OBJECT (channel));
|
||||
|
||||
/* notify this gimage of the currently active channel */
|
||||
gimp_image_set_active_channel (gimage, channel);
|
||||
|
|
|
@ -3605,6 +3605,7 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
}
|
||||
|
||||
gimp_container_insert (gimage->layers, GIMP_OBJECT (layer), position);
|
||||
g_object_unref (G_OBJECT (layer));
|
||||
|
||||
/* notify the layers dialog of the currently active layer */
|
||||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
@ -3801,6 +3802,7 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* add the channel to the list */
|
||||
gimp_container_add (gimage->channels, GIMP_OBJECT (channel));
|
||||
g_object_unref (G_OBJECT (channel));
|
||||
|
||||
/* notify this gimage of the currently active channel */
|
||||
gimp_image_set_active_channel (gimage, channel);
|
||||
|
|
|
@ -3605,6 +3605,7 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
}
|
||||
|
||||
gimp_container_insert (gimage->layers, GIMP_OBJECT (layer), position);
|
||||
g_object_unref (G_OBJECT (layer));
|
||||
|
||||
/* notify the layers dialog of the currently active layer */
|
||||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
@ -3801,6 +3802,7 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* add the channel to the list */
|
||||
gimp_container_add (gimage->channels, GIMP_OBJECT (channel));
|
||||
g_object_unref (G_OBJECT (channel));
|
||||
|
||||
/* notify this gimage of the currently active channel */
|
||||
gimp_image_set_active_channel (gimage, channel);
|
||||
|
|
|
@ -3605,6 +3605,7 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
}
|
||||
|
||||
gimp_container_insert (gimage->layers, GIMP_OBJECT (layer), position);
|
||||
g_object_unref (G_OBJECT (layer));
|
||||
|
||||
/* notify the layers dialog of the currently active layer */
|
||||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
@ -3801,6 +3802,7 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* add the channel to the list */
|
||||
gimp_container_add (gimage->channels, GIMP_OBJECT (channel));
|
||||
g_object_unref (G_OBJECT (channel));
|
||||
|
||||
/* notify this gimage of the currently active channel */
|
||||
gimp_image_set_active_channel (gimage, channel);
|
||||
|
|
|
@ -415,9 +415,6 @@ gimp_layer_copy (GimpLayer *layer,
|
|||
{
|
||||
new_layer->mask = gimp_layer_mask_copy (layer->mask);
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (new_layer->mask));
|
||||
gtk_object_sink (GTK_OBJECT (new_layer->mask));
|
||||
|
||||
gimp_layer_mask_set_layer (new_layer->mask, new_layer);
|
||||
}
|
||||
|
||||
|
@ -552,9 +549,6 @@ gimp_layer_add_mask (GimpLayer *layer,
|
|||
|
||||
layer->mask = mask;
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (layer->mask));
|
||||
gtk_object_sink (GTK_OBJECT (layer->mask));
|
||||
|
||||
gimp_layer_mask_set_layer (mask, layer);
|
||||
|
||||
gimp_drawable_update (GIMP_DRAWABLE (layer),
|
||||
|
|
|
@ -32,7 +32,9 @@
|
|||
|
||||
static void gimp_list_class_init (GimpListClass *klass);
|
||||
static void gimp_list_init (GimpList *list);
|
||||
|
||||
static void gimp_list_dispose (GObject *object);
|
||||
|
||||
static void gimp_list_add (GimpContainer *container,
|
||||
GimpObject *object);
|
||||
static void gimp_list_remove (GimpContainer *container,
|
||||
|
|
|
@ -122,6 +122,7 @@ gimp_object_class_init (GimpObjectClass *klass)
|
|||
object_class->set_property = gimp_object_set_property;
|
||||
object_class->get_property = gimp_object_get_property;
|
||||
|
||||
klass->disconnect = NULL;
|
||||
klass->name_changed = NULL;
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
|
@ -141,8 +142,19 @@ gimp_object_init (GimpObject *object)
|
|||
static void
|
||||
gimp_object_dispose (GObject *object)
|
||||
{
|
||||
gboolean disconnected;
|
||||
|
||||
disconnected = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (object),
|
||||
"disconnected"));
|
||||
|
||||
if (! disconnected)
|
||||
{
|
||||
g_signal_emit (G_OBJECT (object), object_signals[DISCONNECT], 0);
|
||||
|
||||
g_object_set_data (G_OBJECT (object), "disconnected",
|
||||
GINT_TO_POINTER (TRUE));
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -250,9 +250,7 @@ gimp_pattern_get_standard (void)
|
|||
}
|
||||
|
||||
/* set ref_count to 2 --> never swap the standard pattern */
|
||||
gtk_object_ref (GTK_OBJECT (standard_pattern));
|
||||
gtk_object_ref (GTK_OBJECT (standard_pattern));
|
||||
gtk_object_sink (GTK_OBJECT (standard_pattern));
|
||||
g_object_ref (G_OBJECT (standard_pattern));
|
||||
}
|
||||
|
||||
return GIMP_DATA (standard_pattern);
|
||||
|
|
|
@ -250,9 +250,7 @@ gimp_pattern_get_standard (void)
|
|||
}
|
||||
|
||||
/* set ref_count to 2 --> never swap the standard pattern */
|
||||
gtk_object_ref (GTK_OBJECT (standard_pattern));
|
||||
gtk_object_ref (GTK_OBJECT (standard_pattern));
|
||||
gtk_object_sink (GTK_OBJECT (standard_pattern));
|
||||
g_object_ref (G_OBJECT (standard_pattern));
|
||||
}
|
||||
|
||||
return GIMP_DATA (standard_pattern);
|
||||
|
|
|
@ -3605,6 +3605,7 @@ gimp_image_add_layer (GimpImage *gimage,
|
|||
}
|
||||
|
||||
gimp_container_insert (gimage->layers, GIMP_OBJECT (layer), position);
|
||||
g_object_unref (G_OBJECT (layer));
|
||||
|
||||
/* notify the layers dialog of the currently active layer */
|
||||
gimp_image_set_active_layer (gimage, layer);
|
||||
|
@ -3801,6 +3802,7 @@ gimp_image_add_channel (GimpImage *gimage,
|
|||
|
||||
/* add the channel to the list */
|
||||
gimp_container_add (gimage->channels, GIMP_OBJECT (channel));
|
||||
g_object_unref (G_OBJECT (channel));
|
||||
|
||||
/* notify this gimage of the currently active channel */
|
||||
gimp_image_set_active_channel (gimage, channel);
|
||||
|
|
|
@ -266,8 +266,7 @@ gdisplay_new (GimpImage *gimage,
|
|||
gimage->instance_count++; /* this is obsolete */
|
||||
gimage->disp_count++;
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (gimage));
|
||||
gtk_object_sink (GTK_OBJECT (gimage));
|
||||
g_object_ref (G_OBJECT (gimage));
|
||||
|
||||
/* We're interested in clean and dirty signals so we can update the
|
||||
* title if need be.
|
||||
|
@ -490,7 +489,7 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
gdk_drawable_unref (gdisp->icon);
|
||||
gdk_drawable_unref (gdisp->iconmask);
|
||||
|
||||
gtk_widget_unref (gdisp->shell);
|
||||
gtk_widget_destroy (gdisp->shell);
|
||||
|
||||
g_free (gdisp);
|
||||
}
|
||||
|
|
|
@ -93,8 +93,6 @@ gimp_undo_stack_init (GimpUndoStack *stack)
|
|||
GIMP_CONTAINER_POLICY_STRONG);
|
||||
|
||||
stack->undos = undos;
|
||||
gtk_object_ref (GTK_OBJECT (undos));
|
||||
gtk_object_sink (GTK_OBJECT (undos));
|
||||
|
||||
g_signal_connect (G_OBJECT (undos), "add",
|
||||
G_CALLBACK (gimp_undo_stack_add_callback),
|
||||
|
@ -146,6 +144,7 @@ gimp_undo_stack_push (GimpUndoStack *stack,
|
|||
|
||||
gimp_undo_push (undo, stack->gimage);
|
||||
gimp_container_add (GIMP_CONTAINER (stack->undos), GIMP_OBJECT (undo));
|
||||
g_object_unref (G_OBJECT (undo));
|
||||
}
|
||||
|
||||
GimpUndo *
|
||||
|
|
|
@ -704,9 +704,7 @@ dialogs_path_list_view_new (GimpDialogFactory *factory,
|
|||
|
||||
view = paths_dialog_create ();
|
||||
|
||||
g_object_weak_ref (G_OBJECT (view),
|
||||
(GDestroyNotify) gtk_widget_destroyed,
|
||||
&view);
|
||||
g_object_add_weak_pointer (G_OBJECT (view), (gpointer *) &view);
|
||||
|
||||
dockable = dialogs_dockable_new (view,
|
||||
"Path List", "Paths",
|
||||
|
@ -777,9 +775,7 @@ dialogs_error_console_get (GimpDialogFactory *factory,
|
|||
|
||||
view = error_console_create ();
|
||||
|
||||
g_object_weak_ref (G_OBJECT (view),
|
||||
(GDestroyNotify) gtk_widget_destroyed,
|
||||
&view);
|
||||
g_object_add_weak_pointer (G_OBJECT (view), (gpointer *) &view);
|
||||
|
||||
dockable = dialogs_dockable_new (view,
|
||||
"Error Console", "Errors",
|
||||
|
|
|
@ -103,15 +103,11 @@ dialogs_init (Gimp *gimp)
|
|||
gimp_get_user_context (gimp),
|
||||
NULL,
|
||||
NULL);
|
||||
gtk_object_ref (GTK_OBJECT (global_dialog_factory));
|
||||
gtk_object_sink (GTK_OBJECT (global_dialog_factory));
|
||||
|
||||
global_dock_factory = gimp_dialog_factory_new ("dock",
|
||||
gimp_get_user_context (gimp),
|
||||
menus_get_dialogs_factory (),
|
||||
dialogs_dock_new);
|
||||
gtk_object_ref (GTK_OBJECT (global_dock_factory));
|
||||
gtk_object_sink (GTK_OBJECT (global_dock_factory));
|
||||
|
||||
for (i = 0; i < n_toplevel_entries; i++)
|
||||
gimp_dialog_factory_register_entry (global_dialog_factory,
|
||||
|
|
|
@ -266,8 +266,7 @@ gdisplay_new (GimpImage *gimage,
|
|||
gimage->instance_count++; /* this is obsolete */
|
||||
gimage->disp_count++;
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (gimage));
|
||||
gtk_object_sink (GTK_OBJECT (gimage));
|
||||
g_object_ref (G_OBJECT (gimage));
|
||||
|
||||
/* We're interested in clean and dirty signals so we can update the
|
||||
* title if need be.
|
||||
|
@ -490,7 +489,7 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
gdk_drawable_unref (gdisp->icon);
|
||||
gdk_drawable_unref (gdisp->iconmask);
|
||||
|
||||
gtk_widget_unref (gdisp->shell);
|
||||
gtk_widget_destroy (gdisp->shell);
|
||||
|
||||
g_free (gdisp);
|
||||
}
|
||||
|
|
|
@ -266,8 +266,7 @@ gdisplay_new (GimpImage *gimage,
|
|||
gimage->instance_count++; /* this is obsolete */
|
||||
gimage->disp_count++;
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (gimage));
|
||||
gtk_object_sink (GTK_OBJECT (gimage));
|
||||
g_object_ref (G_OBJECT (gimage));
|
||||
|
||||
/* We're interested in clean and dirty signals so we can update the
|
||||
* title if need be.
|
||||
|
@ -490,7 +489,7 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
gdk_drawable_unref (gdisp->icon);
|
||||
gdk_drawable_unref (gdisp->iconmask);
|
||||
|
||||
gtk_widget_unref (gdisp->shell);
|
||||
gtk_widget_destroy (gdisp->shell);
|
||||
|
||||
g_free (gdisp);
|
||||
}
|
||||
|
|
|
@ -2844,9 +2844,6 @@ parse_document (gpointer val1p,
|
|||
GIMP_LIST (the_gimp->documents)->list =
|
||||
g_list_append (GIMP_LIST (the_gimp->documents)->list, imagefile);
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (imagefile));
|
||||
gtk_object_sink (GTK_OBJECT (imagefile));
|
||||
|
||||
the_gimp->documents->num_children++;
|
||||
|
||||
return OK;
|
||||
|
|
|
@ -704,9 +704,7 @@ dialogs_path_list_view_new (GimpDialogFactory *factory,
|
|||
|
||||
view = paths_dialog_create ();
|
||||
|
||||
g_object_weak_ref (G_OBJECT (view),
|
||||
(GDestroyNotify) gtk_widget_destroyed,
|
||||
&view);
|
||||
g_object_add_weak_pointer (G_OBJECT (view), (gpointer *) &view);
|
||||
|
||||
dockable = dialogs_dockable_new (view,
|
||||
"Path List", "Paths",
|
||||
|
@ -777,9 +775,7 @@ dialogs_error_console_get (GimpDialogFactory *factory,
|
|||
|
||||
view = error_console_create ();
|
||||
|
||||
g_object_weak_ref (G_OBJECT (view),
|
||||
(GDestroyNotify) gtk_widget_destroyed,
|
||||
&view);
|
||||
g_object_add_weak_pointer (G_OBJECT (view), (gpointer *) &view);
|
||||
|
||||
dockable = dialogs_dockable_new (view,
|
||||
"Error Console", "Errors",
|
||||
|
|
|
@ -103,15 +103,11 @@ dialogs_init (Gimp *gimp)
|
|||
gimp_get_user_context (gimp),
|
||||
NULL,
|
||||
NULL);
|
||||
gtk_object_ref (GTK_OBJECT (global_dialog_factory));
|
||||
gtk_object_sink (GTK_OBJECT (global_dialog_factory));
|
||||
|
||||
global_dock_factory = gimp_dialog_factory_new ("dock",
|
||||
gimp_get_user_context (gimp),
|
||||
menus_get_dialogs_factory (),
|
||||
dialogs_dock_new);
|
||||
gtk_object_ref (GTK_OBJECT (global_dock_factory));
|
||||
gtk_object_sink (GTK_OBJECT (global_dock_factory));
|
||||
|
||||
for (i = 0; i < n_toplevel_entries; i++)
|
||||
gimp_dialog_factory_register_entry (global_dialog_factory,
|
||||
|
|
|
@ -1075,7 +1075,10 @@ bezier_select_reset (GimpBezierSelectTool *bezier_sel)
|
|||
}
|
||||
|
||||
if (bezier_sel->mask)
|
||||
{
|
||||
g_object_unref (G_OBJECT (bezier_sel->mask));
|
||||
bezier_sel->mask = NULL;
|
||||
}
|
||||
|
||||
bezier_sel->state = BEZIER_START; /* we are starting the curve */
|
||||
bezier_sel->draw_mode = BEZIER_DRAW_ALL; /* draw everything by default */
|
||||
|
@ -2898,9 +2901,6 @@ bezier_convert (GimpBezierSelectTool *bezier_sel,
|
|||
gdisp->gimage->width,
|
||||
gdisp->gimage->height);
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (bezier_sel->mask));
|
||||
gtk_object_sink (GTK_OBJECT (bezier_sel->mask));
|
||||
|
||||
/* allocate room for the scanlines */
|
||||
bezier_sel->scanlines = g_malloc (sizeof (GSList *) * height);
|
||||
|
||||
|
|
|
@ -647,9 +647,6 @@ fuzzy_select_calculate (GimpFuzzySelectTool *fuzzy_sel,
|
|||
|
||||
fuzzy_mask = new;
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (fuzzy_mask));
|
||||
gtk_object_sink (GTK_OBJECT (fuzzy_mask));
|
||||
|
||||
/* calculate and allocate a new XSegment array which represents the boundary
|
||||
* of the color-contiguous region
|
||||
*/
|
||||
|
|
|
@ -647,9 +647,6 @@ fuzzy_select_calculate (GimpFuzzySelectTool *fuzzy_sel,
|
|||
|
||||
fuzzy_mask = new;
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (fuzzy_mask));
|
||||
gtk_object_sink (GTK_OBJECT (fuzzy_mask));
|
||||
|
||||
/* calculate and allocate a new XSegment array which represents the boundary
|
||||
* of the color-contiguous region
|
||||
*/
|
||||
|
|
|
@ -959,7 +959,6 @@ gimp_gtk_drag_source_set_by_type (GtkWidget *widget,
|
|||
{
|
||||
GimpDndDataType dnd_type;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
dnd_type = gimp_dnd_data_type_get_by_gtk_type (type);
|
||||
|
@ -981,7 +980,6 @@ gimp_gtk_drag_dest_set_by_type (GtkWidget *widget,
|
|||
{
|
||||
GimpDndDataType dnd_type;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
dnd_type = gimp_dnd_data_type_get_by_gtk_type (type);
|
||||
|
@ -1003,7 +1001,6 @@ gimp_dnd_viewable_source_set (GtkWidget *widget,
|
|||
{
|
||||
GimpDndDataType dnd_type;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
g_return_if_fail (get_viewable_func != NULL);
|
||||
|
||||
|
@ -1023,7 +1020,6 @@ gimp_dnd_viewable_source_unset (GtkWidget *widget,
|
|||
{
|
||||
GimpDndDataType dnd_type;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
dnd_type = gimp_dnd_data_type_get_by_gtk_type (type);
|
||||
|
@ -1042,7 +1038,6 @@ gimp_dnd_viewable_dest_set (GtkWidget *widget,
|
|||
{
|
||||
GimpDndDataType dnd_type;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
g_return_if_fail (set_viewable_func != NULL);
|
||||
|
||||
|
@ -1062,7 +1057,6 @@ gimp_dnd_viewable_dest_unset (GtkWidget *widget,
|
|||
{
|
||||
GimpDndDataType dnd_type;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
dnd_type = gimp_dnd_data_type_get_by_gtk_type (type);
|
||||
|
@ -1080,7 +1074,6 @@ gimp_dnd_get_drag_data (GtkWidget *widget)
|
|||
GimpDndDragViewableFunc get_data_func;
|
||||
gpointer get_data_data;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
|
||||
|
||||
data_type =
|
||||
|
|
|
@ -377,9 +377,8 @@ gimp_preview_set_viewable (GimpPreview *preview,
|
|||
G_TYPE_FROM_INSTANCE (preview->viewable));
|
||||
}
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (preview->viewable),
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&preview->viewable);
|
||||
g_object_remove_weak_pointer (G_OBJECT (preview->viewable),
|
||||
(gpointer *) &preview->viewable);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (preview->viewable),
|
||||
G_CALLBACK (gimp_preview_paint),
|
||||
|
@ -407,9 +406,8 @@ gimp_preview_set_viewable (GimpPreview *preview,
|
|||
NULL);
|
||||
}
|
||||
|
||||
g_object_weak_ref (G_OBJECT (preview->viewable),
|
||||
(GWeakNotify) gtk_widget_destroyed,
|
||||
&preview->viewable);
|
||||
g_object_add_weak_pointer (G_OBJECT (preview->viewable),
|
||||
(gpointer *) &preview->viewable);
|
||||
|
||||
g_signal_connect_swapped (G_OBJECT (preview->viewable),
|
||||
"invalidate_preview",
|
||||
|
|
|
@ -377,9 +377,8 @@ gimp_preview_set_viewable (GimpPreview *preview,
|
|||
G_TYPE_FROM_INSTANCE (preview->viewable));
|
||||
}
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (preview->viewable),
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&preview->viewable);
|
||||
g_object_remove_weak_pointer (G_OBJECT (preview->viewable),
|
||||
(gpointer *) &preview->viewable);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (preview->viewable),
|
||||
G_CALLBACK (gimp_preview_paint),
|
||||
|
@ -407,9 +406,8 @@ gimp_preview_set_viewable (GimpPreview *preview,
|
|||
NULL);
|
||||
}
|
||||
|
||||
g_object_weak_ref (G_OBJECT (preview->viewable),
|
||||
(GWeakNotify) gtk_widget_destroyed,
|
||||
&preview->viewable);
|
||||
g_object_add_weak_pointer (G_OBJECT (preview->viewable),
|
||||
(gpointer *) &preview->viewable);
|
||||
|
||||
g_signal_connect_swapped (G_OBJECT (preview->viewable),
|
||||
"invalidate_preview",
|
||||
|
|
|
@ -377,9 +377,8 @@ gimp_preview_set_viewable (GimpPreview *preview,
|
|||
G_TYPE_FROM_INSTANCE (preview->viewable));
|
||||
}
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (preview->viewable),
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&preview->viewable);
|
||||
g_object_remove_weak_pointer (G_OBJECT (preview->viewable),
|
||||
(gpointer *) &preview->viewable);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (preview->viewable),
|
||||
G_CALLBACK (gimp_preview_paint),
|
||||
|
@ -407,9 +406,8 @@ gimp_preview_set_viewable (GimpPreview *preview,
|
|||
NULL);
|
||||
}
|
||||
|
||||
g_object_weak_ref (G_OBJECT (preview->viewable),
|
||||
(GWeakNotify) gtk_widget_destroyed,
|
||||
&preview->viewable);
|
||||
g_object_add_weak_pointer (G_OBJECT (preview->viewable),
|
||||
(gpointer *) &preview->viewable);
|
||||
|
||||
g_signal_connect_swapped (G_OBJECT (preview->viewable),
|
||||
"invalidate_preview",
|
||||
|
|
|
@ -377,9 +377,8 @@ gimp_preview_set_viewable (GimpPreview *preview,
|
|||
G_TYPE_FROM_INSTANCE (preview->viewable));
|
||||
}
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (preview->viewable),
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&preview->viewable);
|
||||
g_object_remove_weak_pointer (G_OBJECT (preview->viewable),
|
||||
(gpointer *) &preview->viewable);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (preview->viewable),
|
||||
G_CALLBACK (gimp_preview_paint),
|
||||
|
@ -407,9 +406,8 @@ gimp_preview_set_viewable (GimpPreview *preview,
|
|||
NULL);
|
||||
}
|
||||
|
||||
g_object_weak_ref (G_OBJECT (preview->viewable),
|
||||
(GWeakNotify) gtk_widget_destroyed,
|
||||
&preview->viewable);
|
||||
g_object_add_weak_pointer (G_OBJECT (preview->viewable),
|
||||
(gpointer *) &preview->viewable);
|
||||
|
||||
g_signal_connect_swapped (G_OBJECT (preview->viewable),
|
||||
"invalidate_preview",
|
||||
|
|
Loading…
Reference in New Issue