Commit 682b1f3c authored by jaycox's avatar jaycox

Modified Files: ChangeLog app/Makefile.am app/app_procs.c app/channel.c


 Modified Files:
 	ChangeLog app/Makefile.am app/app_procs.c app/channel.c
	app/channel.h app/file_new_dialog.c app/gimage_cmds.c
 	app/gimage_cmds.h app/gimpdrawable.c app/gimpdrawable.h
 	app/gimpdrawableP.h app/gimpimage.c app/gimpimage.h
 	app/gimpimageF.h app/gimpimageP.h app/internal_procs.c
 	app/layer.c app/layer.h app/parasite_cmds.c
 	app/parasite_cmds.h app/plug_in.c app/preferences_dialog.c
 	libgimp/Makefile.am libgimp/gimp.h libgimp/gimpdrawable.c
 	libgimp/gimpfeatures.h.in libgimp/gimpimage.c
 	libgimp/gimpmatrix.h libgimp/parasite.c libgimp/parasite.h
 	plug-ins/script-fu/script-fu-console.c
 	plug-ins/script-fu/script-fu.c
 Added Files:
 	app/gimpparasite.c app/gimpparasite.h app/parasitelist.c
 	app/parasitelist.h app/parasitelistF.h app/parasitelistP.h
 	libgimp/gimpparasite.c

lots of parasite related changes.
parent fc491e5f
Fri Oct 30 01:53:56 1998 Jay Cox (jaycox@earthlink.net)
* app/parasitelist.c
* app/parasitelist.h
* app/parasitelistF.h
* app/parasitelistP.h: new files to implement a list class for
storing parasites in hash tables.
* app/gimpparasite.c
* app/gimpparasite.h: new files for attaching parasites to the gimp.
* app/Makefile.am, app/app_procs.c, app/channel.c, app/channel.h,
* app/file_new_dialog.c, app/gimage_cmds.c, app/gimage_cmds.h,
* app/gimpdrawable.c, app/gimpdrawable.h, app/gimpdrawableP.h,
* app/gimpimage.c, app/gimpimage.h, app/gimpimageF.h, app/gimpimageP.h,
* app/internal_procs.c, app/layer.c, app/layer.h, app/parasite_cmds.c,
* app/parasite_cmds.h, app/plug_in.c: various changes to utillize
the above new files
* app/preferences_dialog.c: remove unecessary #include
* libgimp/gimpfeatures.h.in: #define GIMP_HAVE_PARASITES
* plug-ins/script-fu/script-fu-console.c: ugly work around for a bug
I can't track down. Posibly in gtk+, or unique to my system.
* plug-ins/script-fu/script-fu.c: fix a bug in parasite parsing
* libgimp/Makefile.am, libgimp/gimp.h, libgimp/gimpdrawable.c,
* libgimp/gimpimage.c, libgimp/gimpparasite.c, libgimp/parasite.c
: removed parasite_slist functions. added new parasite functions.
* libgimp/gimpmatrix.h, libgimp/parasite.h: added extern "C"
Tue Oct 27 01:21:17 PST 1998 Manish Singh <yosh@gimp.org>
* app/indexed_palette.c: applied gimp-ruth-981025-0, cosmetic fix
......
......@@ -160,6 +160,8 @@ gimp_SOURCES = \
gimplist.h \
gimplistF.h \
gimplistP.h \
gimpparasite.c \
gimpparasite.h \
gimprc.c \
gimprc.h \
global_edit.c \
......@@ -229,6 +231,10 @@ gimp_SOURCES = \
paintbrush.h \
parasite_cmds.c \
parasite_cmds.h \
parasitelist.c \
parasitelist.h \
parasitelistF.h \
parasitelistP.h \
pattern_header.h \
pattern_select.c \
pattern_select.h \
......
......@@ -2991,8 +2991,8 @@ plug_in_args_destroy (Argument *args,
case PDB_PARASITE:
if (full_destroy)
{
/* parasite_free ((Parasite *)(args[i].value.pdb_pointer));
args[i].value.pdb_pointer = NULL;*/
parasite_free ((Parasite *)(args[i].value.pdb_pointer));
args[i].value.pdb_pointer = NULL;
}
break;
case PDB_STATUS:
......
......@@ -38,6 +38,7 @@
#include "errorconsole.h"
#include "fileops.h"
#include "gimprc.h"
#include "gimpparasite.h"
#include "gimpset.h"
#include "global_edit.h"
#include "gradient.h"
......@@ -500,6 +501,7 @@ app_init (void)
file_ops_pre_init (); /* pre-initialize the file types */
RESET_BAR();
xcf_init (); /* initialize the xcf file format routines */
gimp_init_parasites (); /* initialize the parasite table */
app_init_update_status (_("Looking for data files"), _("Brushes"), 0.00);
brushes_init (no_data); /* initialize the list of gimp brushes */
......
......@@ -27,7 +27,7 @@
#include "gimage_mask.h"
#include "layer.h"
#include "paint_funcs.h"
#include "libgimp/parasite.h"
#include "parasitelist.h"
#include "temp_buf.h"
#include "undo.h"
......@@ -209,7 +209,7 @@ channel_copy (Channel *channel)
/* copy the parasites */
GIMP_DRAWABLE(new_channel)->parasites
= parasite_gslist_copy(GIMP_DRAWABLE(channel)->parasites);
= parasite_list_copy(GIMP_DRAWABLE(channel)->parasites);
/* free up the channel_name memory */
g_free (channel_name);
......@@ -477,7 +477,7 @@ channel_invalidate_previews (GimpImage* gimage)
}
}
guint32
Tattoo
channel_get_tattoo(const Channel *channel)
{
return (gimp_drawable_get_tattoo(GIMP_DRAWABLE(channel)));
......
......@@ -95,7 +95,7 @@ int channel_toggle_visibility (Channel *);
TempBuf * channel_preview (Channel *, int, int);
void channel_invalidate_previews (GimpImage*);
guint32 channel_get_tattoo(const Channel *);
Tattoo channel_get_tattoo(const Channel *);
/* selection mask functions */
......
/* gimpparasite.c: Copyright 1998 Jay Cox <jaycox@earthlink.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <glib.h>
#include "parasitelist.h"
#include "gimpparasite.h"
static ParasiteList *parasites = NULL;
void
gimp_init_parasites()
{
g_return_if_fail(parasites == NULL);
parasites = parasite_list_new();
}
void
gimp_attach_parasite (Parasite *p)
{
parasite_list_add(parasites, p);
}
void
gimp_detach_parasite (char *name)
{
parasite_list_remove(parasites, name);
}
Parasite *
gimp_find_parasite (char *name)
{
return parasite_list_find(parasites, name);
}
/* gimpparasite.h: Copyright 1998 Jay Cox <jaycox@earthlink.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_PARASITE_H__
#define __GIMP_PARASITE_H__
#include "libgimp/parasiteF.h"
void gimp_init_parasites (void);
void gimp_attach_parasite (Parasite *p);
void gimp_detach_parasite (char *name);
Parasite * gimp_find_parasite (char *name);
#endif /* __GIMP_PARASITE_H__ */
......@@ -27,7 +27,7 @@
#include "gimage_mask.h"
#include "layer.h"
#include "paint_funcs.h"
#include "libgimp/parasite.h"
#include "parasitelist.h"
#include "temp_buf.h"
#include "undo.h"
......@@ -209,7 +209,7 @@ channel_copy (Channel *channel)
/* copy the parasites */
GIMP_DRAWABLE(new_channel)->parasites
= parasite_gslist_copy(GIMP_DRAWABLE(channel)->parasites);
= parasite_list_copy(GIMP_DRAWABLE(channel)->parasites);
/* free up the channel_name memory */
g_free (channel_name);
......@@ -477,7 +477,7 @@ channel_invalidate_previews (GimpImage* gimage)
}
}
guint32
Tattoo
channel_get_tattoo(const Channel *channel)
{
return (gimp_drawable_get_tattoo(GIMP_DRAWABLE(channel)));
......
......@@ -95,7 +95,7 @@ int channel_toggle_visibility (Channel *);
TempBuf * channel_preview (Channel *, int, int);
void channel_invalidate_previews (GimpImage*);
guint32 channel_get_tattoo(const Channel *);
Tattoo channel_get_tattoo(const Channel *);
/* selection mask functions */
......
......@@ -27,7 +27,7 @@
#include "gimage_mask.h"
#include "layer.h"
#include "paint_funcs.h"
#include "libgimp/parasite.h"
#include "parasitelist.h"
#include "temp_buf.h"
#include "undo.h"
......@@ -209,7 +209,7 @@ channel_copy (Channel *channel)
/* copy the parasites */
GIMP_DRAWABLE(new_channel)->parasites
= parasite_gslist_copy(GIMP_DRAWABLE(channel)->parasites);
= parasite_list_copy(GIMP_DRAWABLE(channel)->parasites);
/* free up the channel_name memory */
g_free (channel_name);
......@@ -477,7 +477,7 @@ channel_invalidate_previews (GimpImage* gimage)
}
}
guint32
Tattoo
channel_get_tattoo(const Channel *channel)
{
return (gimp_drawable_get_tattoo(GIMP_DRAWABLE(channel)));
......
......@@ -95,7 +95,7 @@ int channel_toggle_visibility (Channel *);
TempBuf * channel_preview (Channel *, int, int);
void channel_invalidate_previews (GimpImage*);
guint32 channel_get_tattoo(const Channel *);
Tattoo channel_get_tattoo(const Channel *);
/* selection mask functions */
......
......@@ -24,7 +24,7 @@
#include "gimpsignal.h"
#include "gimage.h"
#include "gimage_mask.h"
#include "libgimp/parasite.h"
#include "parasitelist.h"
enum {
......@@ -375,25 +375,22 @@ gimp_drawable_set_name (GimpDrawable *drawable, char *name)
Parasite *
gimp_drawable_find_parasite (const GimpDrawable *drawable, const char *name)
{
return parasite_find_in_gslist(drawable->parasites, name);
return parasite_list_find(drawable->parasites, name);
}
void
gimp_drawable_attach_parasite (GimpDrawable *drawable, const Parasite *parasite)
gimp_drawable_attach_parasite (GimpDrawable *drawable, Parasite *parasite)
{
drawable->parasites = parasite_add_to_gslist(parasite, drawable->parasites);
parasite_list_add(drawable->parasites, parasite);
}
void
gimp_drawable_detach_parasite (GimpDrawable *drawable, const char *parasite)
{
Parasite *p;
if ((p = parasite_find_in_gslist(drawable->parasites, parasite)))
drawable->parasites = g_slist_remove (drawable->parasites, p);
parasite_free(p);
parasite_list_remove(drawable->parasites, parasite);
}
guint32
Tattoo
gimp_drawable_get_tattoo(const GimpDrawable *drawable)
{
return drawable->tattoo;
......@@ -556,7 +553,7 @@ gimp_drawable_init (GimpDrawable *drawable)
drawable->has_alpha = FALSE;
drawable->preview = NULL;
drawable->preview_valid = FALSE;
drawable->parasites = FALSE;
drawable->parasites = parasite_list_new();
drawable->tattoo = 0;
gimp_matrix_identity(drawable->transform);
......@@ -588,7 +585,7 @@ gimp_drawable_destroy (GtkObject *object)
temp_buf_free (drawable->preview);
if (drawable->parasites)
parasite_gslist_destroy(drawable->parasites);
gtk_object_unref(GTK_OBJECT(drawable->parasites));
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(*GTK_OBJECT_CLASS (parent_class)->destroy) (object);
......
......@@ -75,10 +75,10 @@ void gimp_drawable_set_name (GimpDrawable *, char *);
Parasite * gimp_drawable_find_parasite (const GimpDrawable *,
const char *name);
void gimp_drawable_attach_parasite (GimpDrawable *, const Parasite *);
void gimp_drawable_attach_parasite (GimpDrawable *, Parasite *);
void gimp_drawable_detach_parasite (GimpDrawable *,
const char *);
guint32 gimp_drawable_get_tattoo (const GimpDrawable *);
Tattoo gimp_drawable_get_tattoo (const GimpDrawable *);
GimpDrawable * gimp_drawable_get_ID (int);
void gimp_drawable_deallocate (GimpDrawable *);
......
......@@ -26,6 +26,7 @@
#include "paint_funcs.h"
#include "palette.h"
#include "libgimp/parasite.h"
#include "parasitelist.h"
#include "undo.h"
#include "gimpsignal.h"
......@@ -152,7 +153,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->parasites = NULL;
gimage->parasites = parasite_list_new();
gimp_matrix_identity(gimage->transform);
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
gimage->save_proc= NULL;
......@@ -493,7 +494,7 @@ gimp_image_destroy (GtkObject *object)
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
parasite_gslist_destroy(gimage->parasites);
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
......@@ -875,28 +876,28 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite *
gimp_image_find_parasite (const GimpImage *gimage, const char *name)
{
return parasite_find_in_gslist(gimage->parasites, name);
return parasite_list_find(gimage->parasites, name);
}
void
gimp_image_attach_parasite (GimpImage *gimage, const Parasite *parasite)
gimp_image_attach_parasite (GimpImage *gimage, Parasite *parasite)
{
gimage->parasites = parasite_add_to_gslist(parasite, gimage->parasites);
parasite_list_add(gimage->parasites, parasite);
}
void
gimp_image_detach_parasite (GimpImage *gimage, const char *parasite)
{
Parasite *p;
if ((p = parasite_find_in_gslist(gimage->parasites, parasite)))
gimage->parasites = g_slist_remove (gimage->parasites, p);
parasite_free(p);
parasite_list_remove(gimage->parasites, parasite);
}
guint32
Tattoo
gimp_image_get_new_tattoo(GimpImage *image)
{
return (++image->tattoo_state);
image->tattoo_state++;
if (image->tattoo_state <= 0)
g_warning("Tattoo state has become corrupt (2.1 billion operation limit exceded)");
return (image->tattoo_state);
}
......@@ -1417,7 +1418,7 @@ gimp_image_get_active_channel (GimpImage *gimage)
Layer *
gimp_image_get_layer_by_tattoo (GimpImage *gimage, guint32 tattoo)
gimp_image_get_layer_by_tattoo (GimpImage *gimage, Tattoo tattoo)
{
Layer *layer;
GSList *layers = gimage->layers;
......@@ -1434,7 +1435,7 @@ gimp_image_get_layer_by_tattoo (GimpImage *gimage, guint32 tattoo)
}
Channel *
gimp_image_get_channel_by_tattoo (GimpImage *gimage, guint32 tattoo)
gimp_image_get_channel_by_tattoo (GimpImage *gimage, Tattoo tattoo)
{
Channel *channel;
GSList *channels = gimage->channels;
......
......@@ -114,16 +114,23 @@ GimpImage * gimp_image_get_named (char *);
GimpImage * gimp_image_get_ID (int);
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
void gimp_image_free_shadow (GimpImage *);
void gimp_image_apply_image (GimpImage *, GimpDrawable *, PixelRegion *, int, int, int,
TileManager *, int, int);
void gimp_image_replace_image (GimpImage *, GimpDrawable *, PixelRegion *, int, int,
PixelRegion *, int, int);
void gimp_image_get_foreground (GimpImage *, GimpDrawable *, unsigned char *);
void gimp_image_get_background (GimpImage *, GimpDrawable *, unsigned char *);
void gimp_image_get_color (GimpImage *, int, unsigned char *,
unsigned char *);
void gimp_image_transform_color (GimpImage *, GimpDrawable *, unsigned char *,
unsigned char *, int);
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
PixelRegion *, int,
int, int,
TileManager *, int, int);
void gimp_image_replace_image (GimpImage *, GimpDrawable *,
PixelRegion *, int, int,
PixelRegion *, int, int);
void gimp_image_get_foreground (GimpImage *, GimpDrawable *,
unsigned char *);
void gimp_image_get_background (GimpImage *, GimpDrawable *,
unsigned char *);
void gimp_image_get_color (GimpImage *, int,
unsigned char *,
unsigned char *);
void gimp_image_transform_color (GimpImage *, GimpDrawable *,
unsigned char *,
unsigned char *, int);
Guide* gimp_image_add_hguide (GimpImage *);
Guide* gimp_image_add_vguide (GimpImage *);
void gimp_image_add_guide (GimpImage *, Guide *);
......@@ -132,10 +139,10 @@ void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *,
const char *name);
void gimp_image_attach_parasite (GimpImage *, const Parasite *);
void gimp_image_attach_parasite (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const char *);
guint32 gimp_image_get_new_tattoo (GimpImage *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
/* layer/channel functions */
......@@ -144,8 +151,8 @@ int gimp_image_get_layer_index (GimpImage *, Layer *);
int gimp_image_get_channel_index (GimpImage *, Channel *);
Layer * gimp_image_get_active_layer (GimpImage *);
Channel * gimp_image_get_active_channel (GimpImage *);
Layer * gimp_image_get_layer_by_tattoo (GimpImage *, guint32);
Channel * gimp_image_get_channel_by_tattoo (GimpImage *, guint32);
Layer * gimp_image_get_layer_by_tattoo (GimpImage *, Tattoo);
Channel * gimp_image_get_channel_by_tattoo (GimpImage *, Tattoo);
Channel * gimp_image_get_mask (GimpImage *);
int gimp_image_get_component_active (GimpImage *, ChannelType);
int gimp_image_get_component_visible (GimpImage *, ChannelType);
......
......@@ -26,6 +26,7 @@
#include "paint_funcs.h"
#include "palette.h"
#include "libgimp/parasite.h"
#include "parasitelist.h"
#include "undo.h"
#include "gimpsignal.h"
......@@ -152,7 +153,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->parasites = NULL;
gimage->parasites = parasite_list_new();
gimp_matrix_identity(gimage->transform);
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
gimage->save_proc= NULL;
......@@ -493,7 +494,7 @@ gimp_image_destroy (GtkObject *object)
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
parasite_gslist_destroy(gimage->parasites);
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
......@@ -875,28 +876,28 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite *
gimp_image_find_parasite (const GimpImage *gimage, const char *name)
{
return parasite_find_in_gslist(gimage->parasites, name);
return parasite_list_find(gimage->parasites, name);
}
void
gimp_image_attach_parasite (GimpImage *gimage, const Parasite *parasite)
gimp_image_attach_parasite (GimpImage *gimage, Parasite *parasite)
{
gimage->parasites = parasite_add_to_gslist(parasite, gimage->parasites);
parasite_list_add(gimage->parasites, parasite);
}
void
gimp_image_detach_parasite (GimpImage *gimage, const char *parasite)
{
Parasite *p;
if ((p = parasite_find_in_gslist(gimage->parasites, parasite)))
gimage->parasites = g_slist_remove (gimage->parasites, p);
parasite_free(p);
parasite_list_remove(gimage->parasites, parasite);
}
guint32
Tattoo
gimp_image_get_new_tattoo(GimpImage *image)
{
return (++image->tattoo_state);
image->tattoo_state++;
if (image->tattoo_state <= 0)
g_warning("Tattoo state has become corrupt (2.1 billion operation limit exceded)");
return (image->tattoo_state);
}
......@@ -1417,7 +1418,7 @@ gimp_image_get_active_channel (GimpImage *gimage)
Layer *
gimp_image_get_layer_by_tattoo (GimpImage *gimage, guint32 tattoo)
gimp_image_get_layer_by_tattoo (GimpImage *gimage, Tattoo tattoo)
{
Layer *layer;
GSList *layers = gimage->layers;
......@@ -1434,7 +1435,7 @@ gimp_image_get_layer_by_tattoo (GimpImage *gimage, guint32 tattoo)
}
Channel *
gimp_image_get_channel_by_tattoo (GimpImage *gimage, guint32 tattoo)
gimp_image_get_channel_by_tattoo (GimpImage *gimage, Tattoo tattoo)
{
Channel *channel;
GSList *channels = gimage->channels;
......
......@@ -114,16 +114,23 @@ GimpImage * gimp_image_get_named (char *);
GimpImage * gimp_image_get_ID (int);
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
void gimp_image_free_shadow (GimpImage *);
void gimp_image_apply_image (GimpImage *, GimpDrawable *, PixelRegion *, int, int, int,
TileManager *, int, int);
void gimp_image_replace_image (GimpImage *, GimpDrawable *, PixelRegion *, int, int,
PixelRegion *, int, int);
void gimp_image_get_foreground (GimpImage *, GimpDrawable *, unsigned char *);
void gimp_image_get_background (GimpImage *, GimpDrawable *, unsigned char *);
void gimp_image_get_color (GimpImage *, int, unsigned char *,
unsigned char *);
void gimp_image_transform_color (GimpImage *, GimpDrawable *, unsigned char *,
unsigned char *, int);
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
PixelRegion *, int,
int, int,
TileManager *, int, int);
void gimp_image_replace_image (GimpImage *, GimpDrawable *,
PixelRegion *, int, int,
PixelRegion *, int, int);
void gimp_image_get_foreground (GimpImage *, GimpDrawable *,
unsigned char *);
void gimp_image_get_background (GimpImage *, GimpDrawable *,
unsigned char *);
void gimp_image_get_color (GimpImage *, int,
unsigned char *,
unsigned char *);
void gimp_image_transform_color (GimpImage *, GimpDrawable *,
unsigned char *,
unsigned char *, int);
Guide* gimp_image_add_hguide (GimpImage *);
Guide* gimp_image_add_vguide (GimpImage *);
void gimp_image_add_guide (GimpImage *, Guide *);
......@@ -132,10 +139,10 @@ void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_find_parasite (const GimpImage *,
const char *name);
void gimp_image_attach_parasite (GimpImage *, const Parasite *);
void gimp_image_attach_parasite (GimpImage *, Parasite *);
void gimp_image_detach_parasite (GimpImage *, const char *);
guint32 gimp_image_get_new_tattoo (GimpImage *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
/* layer/channel functions */
......@@ -144,8 +151,8 @@ int gimp_image_get_layer_index (GimpImage *, Layer *);
int gimp_image_get_channel_index (GimpImage *, Channel *);
Layer * gimp_image_get_active_layer (GimpImage *);
Channel * gimp_image_get_active_channel (GimpImage *);
Layer * gimp_image_get_layer_by_tattoo (GimpImage *, guint32);
Channel * gimp_image_get_channel_by_tattoo (GimpImage *, guint32);
Layer * gimp_image_get_layer_by_tattoo (GimpImage *, Tattoo);
Channel * gimp_image_get_channel_by_tattoo (GimpImage *, Tattoo);
Channel * gimp_image_get_mask (GimpImage *);
int gimp_image_get_component_active (GimpImage *, ChannelType);
int gimp_image_get_component_visible (GimpImage *, ChannelType);
......
......@@ -26,6 +26,7 @@
#include "paint_funcs.h"
#include "palette.h"
#include "libgimp/parasite.h"
#include "parasitelist.h"
#include "undo.h"
#include "gimpsignal.h"
......@@ -152,7 +153,7 @@ static void gimp_image_init (GimpImage *gimage)
gimage->comp_preview_valid[1] = FALSE;
gimage->comp_preview_valid[2] = FALSE;
gimage->comp_preview = NULL;
gimage->parasites = NULL;
gimage->parasites = parasite_list_new();
gimp_matrix_identity(gimage->transform);
gimage->resolution = 72.0; /* maybe should be rc-supplied default? */
gimage->save_proc= NULL;
......@@ -493,7 +494,7 @@ gimp_image_destroy (GtkObject *object)
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
parasite_gslist_destroy(gimage->parasites);
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
......@@ -875,28 +876,28 @@ gimp_image_delete_guide (GimpImage *gimage,
Parasite *
gimp_image_find_parasite (const GimpImage *gimage, const char *name)
{
return parasite_find_in_gslist(gimage->parasites, name);
return parasite_list_find(gimage->parasites, name);
}
void
gimp_image_attach_parasite (GimpImage *gimage, const Parasite *parasite)
gimp_image_attach_parasite (GimpImage *gimage, Parasite *parasite)
{
gimage->parasites = parasite_add_to_gslist(parasite, gimage->parasites);
parasite_list_add(gimage->parasites, parasite);
}
void
gimp_image_detach_parasite (GimpImage *gimage, const char *parasite)
{
Parasite *p;
if ((p = parasite_find_in_gslist(gimage->parasites, parasite)))
gimage->parasites = g_slist_remove (gimage->parasites, p);
parasite_free(p);
parasite_list_remove(gimage->parasites, parasite);
}
guint32
Tattoo
gimp_image_get_new_tattoo(GimpImage *image)
{
return (++image->tattoo_state);
image->tattoo_state++;
if (image->tattoo_state <= 0)
g_warning("Tattoo state has become corrupt (2.1 billion operation limit exceded)");
return (image->tattoo_state);
}
......@@ -1417,7 +1418,7 @@ gimp_image_get_active_channel (GimpImage *gimage)
Layer *
gimp_image_get_layer_by_tattoo (GimpImage *gimage, guint32 tattoo)
gimp_image_get_layer_by_tattoo (GimpImage *gimage, Tattoo tattoo)
{
Layer *layer;
GSList *layers = gimage->layers;
......@@ -1434,7 +1435,7 @@ gimp_image_get_layer_by_tattoo (GimpImage *gimage, guint32 tattoo)
}
Channel *
gimp_image_get_channel_by_tattoo (GimpImage *gimage, guint32 tattoo)