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

app/pdb/Makefile.am new file which contains the stuff that makes PDB code

2001-01-29  Michael Natterer  <mitch@gimp.org>

	* app/pdb/Makefile.am
	* app/pdb/pdb_glue.h: new file which contains the stuff that makes
	PDB code generation easier but is ugly when used in the app
	(see my comment in the log below).

	Contains:
	gimp_drawable_[layer|layer_mask|channel]()
	[channel|gimp_layer]_[set|get]_[name|tattoo]()

	* app/channel.[ch]
	* app/channels_dialog.c
	* app/gimpdrawable.h
	* app/gimpimage.c
	* app/gimplayermask.h
	* app/layer.c
	* app/layer.h
	* app/toolbox.c
	* app/undo.c
	* app/xcf.c
	* app/pdb/channel_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/selection_cmds.c
	* app/tools/bezier_select.c
	* app/tools/bucket_fill.c
	* app/tools/by_color_select.c
	* app/tools/ellipse_select.c
	* app/tools/free_select.c
	* app/tools/fuzzy_select.c
	* app/tools/iscissors.c
	* app/tools/rect_select.c
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/selection.pdb: changed accordingly.
parent fe53c66c
2001-01-29 Michael Natterer <mitch@gimp.org>
* app/pdb/Makefile.am
* app/pdb/pdb_glue.h: new file which contains the stuff that makes
PDB code generation easier but is ugly when used in the app
(see my comment in the log below).
Contains:
gimp_drawable_[layer|layer_mask|channel]()
[channel|gimp_layer]_[set|get]_[name|tattoo]()
* app/channel.[ch]
* app/channels_dialog.c
* app/gimpdrawable.h
* app/gimpimage.c
* app/gimplayermask.h
* app/layer.c
* app/layer.h
* app/toolbox.c
* app/undo.c
* app/xcf.c
* app/pdb/channel_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/selection_cmds.c
* app/tools/bezier_select.c
* app/tools/bucket_fill.c
* app/tools/by_color_select.c
* app/tools/ellipse_select.c
* app/tools/free_select.c
* app/tools/fuzzy_select.c
* app/tools/iscissors.c
* app/tools/rect_select.c
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/layer.pdb
* tools/pdbgen/pdb/selection.pdb: changed accordingly.
2001-01-29 Sven Neumann <sven@gimp.org>
* AUTHORS
......
......@@ -208,19 +208,6 @@ channel_copy (const Channel *channel)
return new_channel;
}
void
channel_set_name (Channel *channel,
const gchar *name)
{
gimp_object_set_name (GIMP_OBJECT (channel), name);
}
const gchar *
channel_get_name (const Channel *channel)
{
return gimp_object_get_name (GIMP_OBJECT (channel));
}
void
channel_set_color (Channel *channel,
const GimpRGB *color)
......@@ -262,17 +249,6 @@ channel_set_opacity (Channel *channel,
channel->color.a = opacity / 100.0;
}
void
channel_delete (Channel *channel)
{
/* Channels are normally deleted by removing them from the associated
image. The only case where channel_delete() is useful is if you want
to remove a floating channel object that has not been added to an
image yet. We use gtk_object_sink() for this reason here.
*/
gtk_object_sink (GTK_OBJECT (channel));
}
static void
gimp_channel_destroy (GtkObject *object)
{
......@@ -546,19 +522,6 @@ channel_preview_private (Channel *channel,
}
}
Tattoo
channel_get_tattoo (const Channel *channel)
{
return gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
}
void
channel_set_tattoo (Channel *channel,
Tattoo value)
{
gimp_drawable_set_tattoo (GIMP_DRAWABLE (channel), value);
}
/******************************/
/* selection mask functions */
/******************************/
......@@ -1635,7 +1598,7 @@ channel_translate (Channel *mask,
copy_region (&srcPR, &destPR);
/* free the temporary mask */
channel_delete (tmp_mask);
gtk_object_unref (GTK_OBJECT (tmp_mask));
}
/* calculate new bounds */
......
......@@ -96,10 +96,6 @@ Channel * channel_new (GimpImage *gimage,
const GimpRGB *color);
Channel * channel_copy (const Channel *channel);
const gchar * channel_get_name (const Channel *channel);
void channel_set_name (Channel *channel,
const gchar *name);
gint channel_get_opacity (const Channel *channel);
void channel_set_opacity (Channel *channel,
gint opacity);
......@@ -108,7 +104,6 @@ const GimpRGB * channel_get_color (const Channel *channel);
void channel_set_color (Channel *channel,
const GimpRGB *color);
void channel_delete (Channel *channel);
void channel_scale (Channel *channel,
gint new_width,
gint new_height);
......@@ -126,10 +121,6 @@ TempBuf * channel_preview (Channel *channel,
gint width,
gint height);
Tattoo channel_get_tattoo (const Channel *channel);
void channel_set_tattoo (Channel *channel,
Tattoo value);
/* selection mask functions */
Channel * channel_new_mask (GimpImage *gimage,
......
......@@ -1094,8 +1094,8 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
Channel *active_channel;
Channel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
......@@ -1108,7 +1108,7 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
CHANNEL_OP_ADD,
0, 0); /* off x/y */
gimage_mask_load (gimage, new_channel);
channel_delete (new_channel);
gtk_object_unref (GTK_OBJECT (new_channel));
gdisplays_flush ();
}
}
......@@ -1118,8 +1118,8 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
Channel *active_channel;
Channel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
......@@ -1132,7 +1132,7 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
CHANNEL_OP_SUB,
0, 0); /* off x/y */
gimage_mask_load (gimage, new_channel);
channel_delete (new_channel);
gtk_object_unref (GTK_OBJECT (new_channel));
gdisplays_flush ();
}
}
......@@ -1142,8 +1142,8 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
Channel *active_channel;
Channel *new_channel;
Channel *active_channel;
Channel *new_channel;
if (!channelsD || !(gimage = channelsD->gimage))
return;
......@@ -1156,7 +1156,7 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget,
CHANNEL_OP_INTERSECT,
0, 0); /* off x/y */
gimage_mask_load (gimage, new_channel);
channel_delete (new_channel);
gtk_object_unref (GTK_OBJECT (new_channel));
gdisplays_flush ();
}
}
......
......@@ -208,19 +208,6 @@ channel_copy (const Channel *channel)
return new_channel;
}
void
channel_set_name (Channel *channel,
const gchar *name)
{
gimp_object_set_name (GIMP_OBJECT (channel), name);
}
const gchar *
channel_get_name (const Channel *channel)
{
return gimp_object_get_name (GIMP_OBJECT (channel));
}
void
channel_set_color (Channel *channel,
const GimpRGB *color)
......@@ -262,17 +249,6 @@ channel_set_opacity (Channel *channel,
channel->color.a = opacity / 100.0;
}
void
channel_delete (Channel *channel)
{
/* Channels are normally deleted by removing them from the associated
image. The only case where channel_delete() is useful is if you want
to remove a floating channel object that has not been added to an
image yet. We use gtk_object_sink() for this reason here.
*/
gtk_object_sink (GTK_OBJECT (channel));
}
static void
gimp_channel_destroy (GtkObject *object)
{
......@@ -546,19 +522,6 @@ channel_preview_private (Channel *channel,
}
}
Tattoo
channel_get_tattoo (const Channel *channel)
{
return gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
}
void
channel_set_tattoo (Channel *channel,
Tattoo value)
{
gimp_drawable_set_tattoo (GIMP_DRAWABLE (channel), value);
}
/******************************/
/* selection mask functions */
/******************************/
......@@ -1635,7 +1598,7 @@ channel_translate (Channel *mask,
copy_region (&srcPR, &destPR);
/* free the temporary mask */
channel_delete (tmp_mask);
gtk_object_unref (GTK_OBJECT (tmp_mask));
}
/* calculate new bounds */
......
......@@ -96,10 +96,6 @@ Channel * channel_new (GimpImage *gimage,
const GimpRGB *color);
Channel * channel_copy (const Channel *channel);
const gchar * channel_get_name (const Channel *channel);
void channel_set_name (Channel *channel,
const gchar *name);
gint channel_get_opacity (const Channel *channel);
void channel_set_opacity (Channel *channel,
gint opacity);
......@@ -108,7 +104,6 @@ const GimpRGB * channel_get_color (const Channel *channel);
void channel_set_color (Channel *channel,
const GimpRGB *color);
void channel_delete (Channel *channel);
void channel_scale (Channel *channel,
gint new_width,
gint new_height);
......@@ -126,10 +121,6 @@ TempBuf * channel_preview (Channel *channel,
gint width,
gint height);
Tattoo channel_get_tattoo (const Channel *channel);
void channel_set_tattoo (Channel *channel,
Tattoo value);
/* selection mask functions */
Channel * channel_new_mask (GimpImage *gimage,
......
......@@ -208,19 +208,6 @@ channel_copy (const Channel *channel)
return new_channel;
}
void
channel_set_name (Channel *channel,
const gchar *name)
{
gimp_object_set_name (GIMP_OBJECT (channel), name);
}
const gchar *
channel_get_name (const Channel *channel)
{
return gimp_object_get_name (GIMP_OBJECT (channel));
}
void
channel_set_color (Channel *channel,
const GimpRGB *color)
......@@ -262,17 +249,6 @@ channel_set_opacity (Channel *channel,
channel->color.a = opacity / 100.0;
}
void
channel_delete (Channel *channel)
{
/* Channels are normally deleted by removing them from the associated
image. The only case where channel_delete() is useful is if you want
to remove a floating channel object that has not been added to an
image yet. We use gtk_object_sink() for this reason here.
*/
gtk_object_sink (GTK_OBJECT (channel));
}
static void
gimp_channel_destroy (GtkObject *object)
{
......@@ -546,19 +522,6 @@ channel_preview_private (Channel *channel,
}
}
Tattoo
channel_get_tattoo (const Channel *channel)
{
return gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
}
void
channel_set_tattoo (Channel *channel,
Tattoo value)
{
gimp_drawable_set_tattoo (GIMP_DRAWABLE (channel), value);
}
/******************************/
/* selection mask functions */
/******************************/
......@@ -1635,7 +1598,7 @@ channel_translate (Channel *mask,
copy_region (&srcPR, &destPR);
/* free the temporary mask */
channel_delete (tmp_mask);
gtk_object_unref (GTK_OBJECT (tmp_mask));
}
/* calculate new bounds */
......
......@@ -96,10 +96,6 @@ Channel * channel_new (GimpImage *gimage,
const GimpRGB *color);
Channel * channel_copy (const Channel *channel);
const gchar * channel_get_name (const Channel *channel);
void channel_set_name (Channel *channel,
const gchar *name);
gint channel_get_opacity (const Channel *channel);
void channel_set_opacity (Channel *channel,
gint opacity);
......@@ -108,7 +104,6 @@ const GimpRGB * channel_get_color (const Channel *channel);
void channel_set_color (Channel *channel,
const GimpRGB *color);
void channel_delete (Channel *channel);
void channel_scale (Channel *channel,
gint new_width,
gint new_height);
......@@ -126,10 +121,6 @@ TempBuf * channel_preview (Channel *channel,
gint width,
gint height);
Tattoo channel_get_tattoo (const Channel *channel);
void channel_set_tattoo (Channel *channel,
Tattoo value);
/* selection mask functions */
Channel * channel_new_mask (GimpImage *gimage,
......
......@@ -23,12 +23,6 @@
#include "gimpobject.h"
/* PDB stuff */
#define gimp_drawable_layer GIMP_IS_LAYER
#define gimp_drawable_layer_mask GIMP_IS_LAYER_MASK
#define gimp_drawable_channel GIMP_IS_CHANNEL
#define GIMP_TYPE_DRAWABLE (gimp_drawable_get_type ())
#define GIMP_DRAWABLE(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_DRAWABLE, GimpDrawable))
#define GIMP_IS_DRAWABLE(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_DRAWABLE))
......
......@@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
Tattoo ctattoo;
channel = (Channel *) channels->data;
ctattoo = channel_get_tattoo (channel);
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval)
maxval = ctattoo;
/* Now check path an't got this tattoo */
......@@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
{
channel = (Channel *) channels->data;
if (channel_get_tattoo (channel) == tattoo)
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel;
}
......
......@@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
Tattoo ctattoo;
channel = (Channel *) channels->data;
ctattoo = channel_get_tattoo (channel);
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval)
maxval = ctattoo;
/* Now check path an't got this tattoo */
......@@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
{
channel = (Channel *) channels->data;
if (channel_get_tattoo (channel) == tattoo)
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel;
}
......
......@@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
Tattoo ctattoo;
channel = (Channel *) channels->data;
ctattoo = channel_get_tattoo (channel);
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval)
maxval = ctattoo;
/* Now check path an't got this tattoo */
......@@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
{
channel = (Channel *) channels->data;
if (channel_get_tattoo (channel) == tattoo)
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel;
}
......
......@@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
Tattoo ctattoo;
channel = (Channel *) channels->data;
ctattoo = channel_get_tattoo (channel);
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval)
maxval = ctattoo;
/* Now check path an't got this tattoo */
......@@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
{
channel = (Channel *) channels->data;
if (channel_get_tattoo (channel) == tattoo)
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel;
}
......
......@@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
Tattoo ctattoo;
channel = (Channel *) channels->data;
ctattoo = channel_get_tattoo (channel);
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval)
maxval = ctattoo;
/* Now check path an't got this tattoo */
......@@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
{
channel = (Channel *) channels->data;
if (channel_get_tattoo (channel) == tattoo)
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel;
}
......
......@@ -1439,7 +1439,9 @@ undo_push_layer (GimpImage *gimage,
/* if this is a remove layer, delete the layer */
if (type == LAYER_REMOVE_UNDO)
gtk_object_unref (GTK_OBJECT (lu->layer));
g_free (lu);
return FALSE;
}
}
......@@ -1797,7 +1799,7 @@ undo_push_channel (GimpImage *gimage,
else
{
if (type == CHANNEL_REMOVE_UNDO)
channel_delete (cu->channel);
gtk_object_unref (GTK_OBJECT (cu->channel));
g_free (cu);
return FALSE;
}
......@@ -1870,7 +1872,7 @@ undo_free_channel (UndoState state,
*/
if ((state == REDO && type == CHANNEL_ADD_UNDO) ||
(state == UNDO && type == CHANNEL_REMOVE_UNDO))
channel_delete (cu->channel);
gtk_object_unref (GTK_OBJECT (cu->channel));
g_free (cu);
}
......
......@@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
Tattoo ctattoo;
channel = (Channel *) channels->data;
ctattoo = channel_get_tattoo (channel);
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval)
maxval = ctattoo;
/* Now check path an't got this tattoo */
......@@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
{
channel = (Channel *) channels->data;
if (channel_get_tattoo (channel) == tattoo)
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel;
}
......
......@@ -75,7 +75,7 @@ static TempBuf * gimp_layer_mask_preview_private (GimpLayer *layer,
gint height);
static GimpDrawableClass *parent_class = NULL;
static GimpDrawableClass *parent_class = NULL;
GtkType
......@@ -505,17 +505,6 @@ gimp_layer_create_mask (GimpLayer *layer,
return mask;
}
void
gimp_layer_delete (GimpLayer *layer)
{
/* Layers are normally deleted by removing them from the associated
image. The only case where layer_delete() is useful is if you want
to remove a floating layer object that has not been added to an
image yet. We use gtk_object_sink() for this reason here.
*/
gtk_object_sink (GTK_OBJECT (layer));
}
static void
gimp_layer_destroy (GtkObject *object)
{
......
......@@ -23,13 +23,6 @@
#include "gimpdrawable.h"
/* PDB stuff */
#define gimp_layer_set_name(l,n) gimp_object_set_name(GIMP_OBJECT(l),(n))
#define gimp_layer_get_name(l) gimp_object_get_name(GIMP_OBJECT(l))
#define gimp_layer_set_tattoo(l,t) gimp_drawable_set_tattoo(GIMP_DRAWABLE(l),(t))
#define gimp_layer_get_tattoo(l) gimp_drawable_get_tattoo(GIMP_DRAWABLE(l))
#define GIMP_TYPE_LAYER (gimp_layer_get_type ())
#define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer))
#define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass))
......@@ -116,7 +109,6 @@ GimpLayerMask * gimp_layer_create_mask (GimpLayer *layer,
AddMaskType add_mask_type);
GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer,
GimpLayerMask *mask);
void gimp_layer_delete (GimpLayer *layer);
void gimp_layer_apply_mask (GimpLayer *layer,
MaskApplyMode mode);
void gimp_layer_translate (GimpLayer *layer,
......
......@@ -75,4 +75,3 @@ GimpLayer * gimp_layer_mask_get_layer (GimpLayerMask *layer_mask);
#endif /* __GIMP_LAYER_MASK_H__ */
......@@ -1413,7 +1413,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage,
Tattoo ctattoo;
channel = (Channel *) channels->data;
ctattoo = channel_get_tattoo (channel);
ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel));
if (ctattoo > maxval)
maxval = ctattoo;
/* Now check path an't got this tattoo */
......@@ -2250,7 +2250,7 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage,
{
channel = (Channel *) channels->data;
if (channel_get_tattoo (channel) == tattoo)
if (gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)) == tattoo)
return channel;
}
......
Markdown is supported
0%