Commit 62a4c057 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

removed (was not used).

2001-05-15  Michael Natterer  <mitch@gimp.org>

	* app/gimpcontextpreview.[ch]: removed (was not used).

	* app/apptypes.h: removed the Guide typedef.

	* app/core/core-types.h: added it here as GimpGuide (everything in
	core/ must be "Gimp"-prefixed).

	* app/gimage.[ch]: removed the global "next_guide_id" variable,
	don't destroy the guides in the "destroy" handler.

	* app/core/gimpimage.[ch]: destroy them in destroy().

	* app/xcf.c: use GimpImage accessors to add the guides, so we
	don't need "next_guide_id".

	* app/gdisplay.[ch]
	* app/undo.c
	* app/core/gimpimage-duplicate.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.[ch]
	* tools/pdbgen/pdb/guides.pdb: s/Guide/GimpGuide/, cleanup.
parent d64ae879
2001-05-15 Michael Natterer <mitch@gimp.org>
* app/gimpcontextpreview.[ch]: removed (was not used).
* app/apptypes.h: removed the Guide typedef.
* app/core/core-types.h: added it here as GimpGuide (everything in
core/ must be "Gimp"-prefixed).
* app/gimage.[ch]: removed the global "next_guide_id" variable,
don't destroy the guides in the "destroy" handler.
* app/core/gimpimage.[ch]: destroy them in destroy().
* app/xcf.c: use GimpImage accessors to add the guides, so we
don't need "next_guide_id".
* app/gdisplay.[ch]
* app/undo.c
* app/core/gimpimage-duplicate.c
* app/tools/gimpcroptool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.[ch]
* tools/pdbgen/pdb/guides.pdb: s/Guide/GimpGuide/, cleanup.
2001-05-15 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
......
......@@ -48,8 +48,6 @@ typedef struct _GimpParasite GimpParasite;
typedef struct _GimpProgress GimpProgress;
typedef struct _Guide Guide;
typedef gpointer ImageMap;
typedef struct _InfoDialog InfoDialog;
......
......@@ -112,6 +112,11 @@ typedef struct _GimpUndo GimpUndo;
typedef struct _GimpUndoStack GimpUndoStack;
/* non-object types */
typedef struct _GimpGuide GimpGuide;
/* functions */
typedef void (* GimpDataFileLoaderFunc) (const gchar *filename,
......
......@@ -60,7 +60,7 @@ gimp_image_duplicate (GimpImage *gimage)
GimpLayer *floating_layer;
GimpChannel *channel, *new_channel;
GList *list;
Guide *guide = NULL;
GimpGuide *guide = NULL;
GimpLayer *active_layer = NULL;
GimpChannel *active_channel = NULL;
GimpDrawable *new_floating_sel_drawable = NULL;
......@@ -190,9 +190,9 @@ gimp_image_duplicate (GimpImage *gimage)
/* Copy any Guides */
for (list = gimage->guides; list; list = g_list_next (list))
{
Guide* new_guide;
GimpGuide *new_guide;
guide = (Guide*) list->data;
guide = (GimpGuide *) list->data;
switch (guide->orientation)
{
......
......@@ -153,8 +153,6 @@ gint valid_combinations[][MAX_CHANNELS + 1] =
{ -1, -1, COMBINE_INDEXED_A_INDEXED_A, -1, -1 },
};
guint32 next_guide_id = 1; /* For generating guide_ID handles for PDB stuff */
/*
* Static variables
......@@ -186,6 +184,8 @@ static GimpViewableClass *parent_class = NULL;
static gint global_image_ID = 1;
static GHashTable *gimp_image_table = NULL;
static guint32 next_guide_id = 1;
GtkType
gimp_image_get_type (void)
......@@ -488,6 +488,9 @@ gimp_image_destroy (GtkObject *object)
if (gimage->parasites)
gtk_object_unref (GTK_OBJECT (gimage->parasites));
g_list_foreach (gimage->guides, (GFunc) g_free, NULL);
g_list_free (gimage->guides);
gtk_object_unref (GTK_OBJECT (gimage->new_undo_stack));
gtk_object_unref (GTK_OBJECT (gimage->new_redo_stack));
}
......@@ -781,9 +784,9 @@ gimp_image_resize (GimpImage *gimage,
guide_list = gimage->guides;
while (guide_list)
{
Guide *guide;
GimpGuide *guide;
guide = (Guide*) guide_list->data;
guide = (GimpGuide *) guide_list->data;
guide_list = g_list_next (guide_list);
switch (guide->orientation)
......@@ -847,7 +850,7 @@ gimp_image_scale (GimpImage *gimage,
GList *list;
GSList *remove = NULL;
GSList *slist;
Guide *guide;
GimpGuide *guide;
gint old_width;
gint old_height;
gdouble img_scale_w = 1.0;
......@@ -934,7 +937,7 @@ gimp_image_scale (GimpImage *gimage,
/* Scale any Guides */
for (list = gimage->guides; list; list = g_list_next (list))
{
guide = (Guide*) list->data;
guide = (GimpGuide *) list->data;
switch (guide->orientation)
{
......@@ -1380,14 +1383,15 @@ gimp_image_transform_color (const GimpImage *gimage,
}
}
Guide *
GimpGuide *
gimp_image_add_hguide (GimpImage *gimage)
{
Guide *guide;
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
guide = g_new (Guide, 1);
guide = g_new (GimpGuide, 1);
guide->ref_count = 0;
guide->position = -1;
guide->guide_ID = next_guide_id++;
......@@ -1398,14 +1402,15 @@ gimp_image_add_hguide (GimpImage *gimage)
return guide;
}
Guide *
GimpGuide *
gimp_image_add_vguide (GimpImage *gimage)
{
Guide *guide;
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
guide = g_new (Guide, 1);
guide = g_new (GimpGuide, 1);
guide->ref_count = 0;
guide->position = -1;
guide->guide_ID = next_guide_id++;
......@@ -1418,7 +1423,7 @@ gimp_image_add_vguide (GimpImage *gimage)
void
gimp_image_add_guide (GimpImage *gimage,
Guide *guide)
GimpGuide *guide)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
......@@ -1427,7 +1432,7 @@ gimp_image_add_guide (GimpImage *gimage,
void
gimp_image_remove_guide (GimpImage *gimage,
Guide *guide)
GimpGuide *guide)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
......@@ -1436,7 +1441,7 @@ gimp_image_remove_guide (GimpImage *gimage,
void
gimp_image_delete_guide (GimpImage *gimage,
Guide *guide)
GimpGuide *guide)
{
guide->position = -1;
......
......@@ -23,9 +23,12 @@
#include "gimpviewable.h"
#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE)
#define COLORMAP_SIZE 768
#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t) == RGBA_GIMAGE || \
(t) == GRAYA_GIMAGE || \
(t) == INDEXEDA_GIMAGE)
#define COLORMAP_SIZE 768
typedef enum
{
......@@ -36,6 +39,15 @@ typedef enum
} MergeType;
struct _GimpGuide
{
gint ref_count;
gint position;
InternalOrientationType orientation;
guint32 guide_ID;
};
#define GIMP_TYPE_IMAGE (gimp_image_get_type ())
#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage))
#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE))
......@@ -154,17 +166,6 @@ struct _GimpImageClass
};
/* Ugly! Move this someplace else! Prolly to gdisplay.. */
struct _Guide
{
gint ref_count;
gint position;
InternalOrientationType orientation;
guint32 guide_ID;
};
/* function declarations */
GtkType gimp_image_get_type (void);
......@@ -240,14 +241,14 @@ void gimp_image_transform_color (const GimpImage *gimage,
guchar *src,
guchar *dest,
GimpImageBaseType type);
Guide * gimp_image_add_hguide (GimpImage *gimage);
Guide * gimp_image_add_vguide (GimpImage *gimage);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
Guide *guide);
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
Guide *guide);
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
Guide *guide);
GimpGuide *guide);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
......
......@@ -153,8 +153,6 @@ gint valid_combinations[][MAX_CHANNELS + 1] =
{ -1, -1, COMBINE_INDEXED_A_INDEXED_A, -1, -1 },
};
guint32 next_guide_id = 1; /* For generating guide_ID handles for PDB stuff */
/*
* Static variables
......@@ -186,6 +184,8 @@ static GimpViewableClass *parent_class = NULL;
static gint global_image_ID = 1;
static GHashTable *gimp_image_table = NULL;
static guint32 next_guide_id = 1;
GtkType
gimp_image_get_type (void)
......@@ -488,6 +488,9 @@ gimp_image_destroy (GtkObject *object)
if (gimage->parasites)
gtk_object_unref (GTK_OBJECT (gimage->parasites));
g_list_foreach (gimage->guides, (GFunc) g_free, NULL);
g_list_free (gimage->guides);
gtk_object_unref (GTK_OBJECT (gimage->new_undo_stack));
gtk_object_unref (GTK_OBJECT (gimage->new_redo_stack));
}
......@@ -781,9 +784,9 @@ gimp_image_resize (GimpImage *gimage,
guide_list = gimage->guides;
while (guide_list)
{
Guide *guide;
GimpGuide *guide;
guide = (Guide*) guide_list->data;
guide = (GimpGuide *) guide_list->data;
guide_list = g_list_next (guide_list);
switch (guide->orientation)
......@@ -847,7 +850,7 @@ gimp_image_scale (GimpImage *gimage,
GList *list;
GSList *remove = NULL;
GSList *slist;
Guide *guide;
GimpGuide *guide;
gint old_width;
gint old_height;
gdouble img_scale_w = 1.0;
......@@ -934,7 +937,7 @@ gimp_image_scale (GimpImage *gimage,
/* Scale any Guides */
for (list = gimage->guides; list; list = g_list_next (list))
{
guide = (Guide*) list->data;
guide = (GimpGuide *) list->data;
switch (guide->orientation)
{
......@@ -1380,14 +1383,15 @@ gimp_image_transform_color (const GimpImage *gimage,
}
}
Guide *
GimpGuide *
gimp_image_add_hguide (GimpImage *gimage)
{
Guide *guide;
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
guide = g_new (Guide, 1);
guide = g_new (GimpGuide, 1);
guide->ref_count = 0;
guide->position = -1;
guide->guide_ID = next_guide_id++;
......@@ -1398,14 +1402,15 @@ gimp_image_add_hguide (GimpImage *gimage)
return guide;
}
Guide *
GimpGuide *
gimp_image_add_vguide (GimpImage *gimage)
{
Guide *guide;
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
guide = g_new (Guide, 1);
guide = g_new (GimpGuide, 1);
guide->ref_count = 0;
guide->position = -1;
guide->guide_ID = next_guide_id++;
......@@ -1418,7 +1423,7 @@ gimp_image_add_vguide (GimpImage *gimage)
void
gimp_image_add_guide (GimpImage *gimage,
Guide *guide)
GimpGuide *guide)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
......@@ -1427,7 +1432,7 @@ gimp_image_add_guide (GimpImage *gimage,
void
gimp_image_remove_guide (GimpImage *gimage,
Guide *guide)
GimpGuide *guide)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
......@@ -1436,7 +1441,7 @@ gimp_image_remove_guide (GimpImage *gimage,
void
gimp_image_delete_guide (GimpImage *gimage,
Guide *guide)
GimpGuide *guide)
{
guide->position = -1;
......
......@@ -23,9 +23,12 @@
#include "gimpviewable.h"
#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE)
#define COLORMAP_SIZE 768
#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t) == RGBA_GIMAGE || \
(t) == GRAYA_GIMAGE || \
(t) == INDEXEDA_GIMAGE)
#define COLORMAP_SIZE 768
typedef enum
{
......@@ -36,6 +39,15 @@ typedef enum
} MergeType;
struct _GimpGuide
{
gint ref_count;
gint position;
InternalOrientationType orientation;
guint32 guide_ID;
};
#define GIMP_TYPE_IMAGE (gimp_image_get_type ())
#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage))
#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE))
......@@ -154,17 +166,6 @@ struct _GimpImageClass
};
/* Ugly! Move this someplace else! Prolly to gdisplay.. */
struct _Guide
{
gint ref_count;
gint position;
InternalOrientationType orientation;
guint32 guide_ID;
};
/* function declarations */
GtkType gimp_image_get_type (void);
......@@ -240,14 +241,14 @@ void gimp_image_transform_color (const GimpImage *gimage,
guchar *src,
guchar *dest,
GimpImageBaseType type);
Guide * gimp_image_add_hguide (GimpImage *gimage);
Guide * gimp_image_add_vguide (GimpImage *gimage);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
Guide *guide);
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
Guide *guide);
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
Guide *guide);
GimpGuide *guide);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
......
......@@ -153,8 +153,6 @@ gint valid_combinations[][MAX_CHANNELS + 1] =
{ -1, -1, COMBINE_INDEXED_A_INDEXED_A, -1, -1 },
};
guint32 next_guide_id = 1; /* For generating guide_ID handles for PDB stuff */
/*
* Static variables
......@@ -186,6 +184,8 @@ static GimpViewableClass *parent_class = NULL;
static gint global_image_ID = 1;
static GHashTable *gimp_image_table = NULL;
static guint32 next_guide_id = 1;
GtkType
gimp_image_get_type (void)
......@@ -488,6 +488,9 @@ gimp_image_destroy (GtkObject *object)
if (gimage->parasites)
gtk_object_unref (GTK_OBJECT (gimage->parasites));
g_list_foreach (gimage->guides, (GFunc) g_free, NULL);
g_list_free (gimage->guides);
gtk_object_unref (GTK_OBJECT (gimage->new_undo_stack));
gtk_object_unref (GTK_OBJECT (gimage->new_redo_stack));
}
......@@ -781,9 +784,9 @@ gimp_image_resize (GimpImage *gimage,
guide_list = gimage->guides;
while (guide_list)
{
Guide *guide;
GimpGuide *guide;
guide = (Guide*) guide_list->data;
guide = (GimpGuide *) guide_list->data;
guide_list = g_list_next (guide_list);
switch (guide->orientation)
......@@ -847,7 +850,7 @@ gimp_image_scale (GimpImage *gimage,
GList *list;
GSList *remove = NULL;
GSList *slist;
Guide *guide;
GimpGuide *guide;
gint old_width;
gint old_height;
gdouble img_scale_w = 1.0;
......@@ -934,7 +937,7 @@ gimp_image_scale (GimpImage *gimage,
/* Scale any Guides */
for (list = gimage->guides; list; list = g_list_next (list))
{
guide = (Guide*) list->data;
guide = (GimpGuide *) list->data;
switch (guide->orientation)
{
......@@ -1380,14 +1383,15 @@ gimp_image_transform_color (const GimpImage *gimage,
}
}
Guide *
GimpGuide *
gimp_image_add_hguide (GimpImage *gimage)
{
Guide *guide;
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
guide = g_new (Guide, 1);
guide = g_new (GimpGuide, 1);
guide->ref_count = 0;
guide->position = -1;
guide->guide_ID = next_guide_id++;
......@@ -1398,14 +1402,15 @@ gimp_image_add_hguide (GimpImage *gimage)
return guide;
}
Guide *
GimpGuide *
gimp_image_add_vguide (GimpImage *gimage)
{
Guide *guide;
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
guide = g_new (Guide, 1);
guide = g_new (GimpGuide, 1);
guide->ref_count = 0;
guide->position = -1;
guide->guide_ID = next_guide_id++;
......@@ -1418,7 +1423,7 @@ gimp_image_add_vguide (GimpImage *gimage)
void
gimp_image_add_guide (GimpImage *gimage,
Guide *guide)
GimpGuide *guide)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
......@@ -1427,7 +1432,7 @@ gimp_image_add_guide (GimpImage *gimage,
void
gimp_image_remove_guide (GimpImage *gimage,
Guide *guide)
GimpGuide *guide)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
......@@ -1436,7 +1441,7 @@ gimp_image_remove_guide (GimpImage *gimage,
void
gimp_image_delete_guide (GimpImage *gimage,
Guide *guide)
GimpGuide *guide)
{
guide->position = -1;
......
......@@ -23,9 +23,12 @@
#include "gimpviewable.h"
#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t)==RGBA_GIMAGE || (t)==GRAYA_GIMAGE || (t)==INDEXEDA_GIMAGE)
#define COLORMAP_SIZE 768
#define GIMP_IMAGE_TYPE_HAS_ALPHA(t) ((t) == RGBA_GIMAGE || \
(t) == GRAYA_GIMAGE || \
(t) == INDEXEDA_GIMAGE)
#define COLORMAP_SIZE 768
typedef enum
{
......@@ -36,6 +39,15 @@ typedef enum
} MergeType;
struct _GimpGuide
{
gint ref_count;
gint position;
InternalOrientationType orientation;
guint32 guide_ID;
};
#define GIMP_TYPE_IMAGE (gimp_image_get_type ())
#define GIMP_IMAGE(obj) (GTK_CHECK_CAST (obj, GIMP_TYPE_IMAGE, GimpImage))
#define GIMP_IS_IMAGE(obj) (GTK_CHECK_TYPE (obj, GIMP_TYPE_IMAGE))
......@@ -154,17 +166,6 @@ struct _GimpImageClass
};
/* Ugly! Move this someplace else! Prolly to gdisplay.. */
struct _Guide
{
gint ref_count;
gint position;
InternalOrientationType orientation;
guint32 guide_ID;
};
/* function declarations */
GtkType gimp_image_get_type (void);
......@@ -240,14 +241,14 @@ void gimp_image_transform_color (const GimpImage *gimage,
guchar *src,
guchar *dest,
GimpImageBaseType type);
Guide * gimp_image_add_hguide (GimpImage *gimage);
Guide * gimp_image_add_vguide (GimpImage *gimage);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
Guide *guide);
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
Guide *guide);
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
Guide *guide);