renamed ChannelOffsetType to GimpOffsetType.

2001-04-18  Michael Natterer  <mitch@gimp.org>

	* app/gimpdrawable-offset.[ch]: renamed ChannelOffsetType to
	GimpOffsetType.

	* app/pdb/channel_ops_cmds.c
	* libgimp/gimpchannelops_pdb.[ch]
	* tools/pdbgen/pdb/channel_ops.pdb: removed.

	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/image.pdb: put the "offset" and "duplicate"
	functions where they belong.

	* app/gui/offset-dialog.c
	* app/pdb/Makefile.am
	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/internal_procs.c
	* libgimp/Makefile.am
	* libgimp/gimp_pdb.h
	* libgimp/gimpdrawable_pdb.[ch]
	* libgimp/gimpenums.h
	* libgimp/gimpimage.h
	* libgimp/gimpimage_pdb.[ch]
	* tools/pdbgen/Makefile.am
	* tools/pdbgen/enumcode.pl
	* tools/pdbgen/enums.pl
	* tools/pdbgen/groups.pl
	* plug-ins/common/guillotine.c
	* plug-ins/print/print.c
	* plug-ins/script-fu/script-fu-constants.c: changed accordingly.
This commit is contained in:
Michael Natterer 2001-04-18 20:41:15 +00:00 committed by Michael Natterer
parent 63d3ff388e
commit 8de3fb6452
32 changed files with 437 additions and 709 deletions

View File

@ -1,3 +1,35 @@
2001-04-18 Michael Natterer <mitch@gimp.org>
* app/gimpdrawable-offset.[ch]: renamed ChannelOffsetType to
GimpOffsetType.
* app/pdb/channel_ops_cmds.c
* libgimp/gimpchannelops_pdb.[ch]
* tools/pdbgen/pdb/channel_ops.pdb: removed.
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/image.pdb: put the "offset" and "duplicate"
functions where they belong.
* app/gui/offset-dialog.c
* app/pdb/Makefile.am
* app/pdb/drawable_cmds.c
* app/pdb/image_cmds.c
* app/pdb/internal_procs.c
* libgimp/Makefile.am
* libgimp/gimp_pdb.h
* libgimp/gimpdrawable_pdb.[ch]
* libgimp/gimpenums.h
* libgimp/gimpimage.h
* libgimp/gimpimage_pdb.[ch]
* tools/pdbgen/Makefile.am
* tools/pdbgen/enumcode.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/groups.pl
* plug-ins/common/guillotine.c
* plug-ins/print/print.c
* plug-ins/script-fu/script-fu-constants.c: changed accordingly.
2001-04-18 Michael Natterer <mitch@gimp.org>
* app/Makefile.am

View File

@ -40,11 +40,11 @@
void
gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
ChannelOffsetType fill_type,
gint offset_x,
gint offset_y)
gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y)
{
PixelRegion srcPR, destPR;
TileManager *new_tiles;

View File

@ -24,14 +24,14 @@ typedef enum
{
OFFSET_BACKGROUND,
OFFSET_TRANSPARENT
} ChannelOffsetType;
} GimpOffsetType;
void gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
ChannelOffsetType fill_type,
gint offset_x,
gint offset_y);
void gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y);
#endif /* __GIMP_DRAWABLE_OFFSET_H__ */

View File

@ -42,13 +42,13 @@ typedef struct _OffsetDialog OffsetDialog;
struct _OffsetDialog
{
GtkWidget *dlg;
GtkWidget *off_se;
GtkWidget *dlg;
GtkWidget *off_se;
gboolean wrap_around;
ChannelOffsetType fill_type;
gboolean wrap_around;
GimpOffsetType fill_type;
GimpImage *gimage;
GimpImage *gimage;
};

View File

@ -40,11 +40,11 @@
void
gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
ChannelOffsetType fill_type,
gint offset_x,
gint offset_y)
gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y)
{
PixelRegion srcPR, destPR;
TileManager *new_tiles;

View File

@ -24,14 +24,14 @@ typedef enum
{
OFFSET_BACKGROUND,
OFFSET_TRANSPARENT
} ChannelOffsetType;
} GimpOffsetType;
void gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
ChannelOffsetType fill_type,
gint offset_x,
gint offset_y);
void gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y);
#endif /* __GIMP_DRAWABLE_OFFSET_H__ */

View File

@ -42,13 +42,13 @@ typedef struct _OffsetDialog OffsetDialog;
struct _OffsetDialog
{
GtkWidget *dlg;
GtkWidget *off_se;
GtkWidget *dlg;
GtkWidget *off_se;
gboolean wrap_around;
ChannelOffsetType fill_type;
gboolean wrap_around;
GimpOffsetType fill_type;
GimpImage *gimage;
GimpImage *gimage;
};

View File

@ -11,7 +11,6 @@ libapppdb_la_SOURCES = \
brush_select_cmds.c \
brushes_cmds.c \
channel_cmds.c \
channel_ops_cmds.c \
color_cmds.c \
convert_cmds.c \
display_cmds.c \

View File

@ -1,176 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2000 Spencer Kimball and Peter Mattis
*
* 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.
*/
/* NOTE: This file is autogenerated by pdbgen.pl. */
#include "config.h"
#include <gtk/gtk.h>
#include "apptypes.h"
#include "procedural_db.h"
#include "drawable.h"
#include "gimpdrawable-offset.h"
#include "gimpimage-duplicate.h"
#include "gimpimage.h"
static ProcRecord channel_ops_offset_proc;
static ProcRecord channel_ops_duplicate_proc;
void
register_channel_ops_procs (void)
{
procedural_db_register (&channel_ops_offset_proc);
procedural_db_register (&channel_ops_duplicate_proc);
}
static Argument *
channel_ops_offset_invoker (Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gboolean wrap_around;
gint32 fill_type;
gint32 offset_x;
gint32 offset_y;
drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
wrap_around = args[1].value.pdb_int ? TRUE : FALSE;
fill_type = args[2].value.pdb_int;
if (fill_type < OFFSET_BACKGROUND || fill_type > OFFSET_TRANSPARENT)
success = FALSE;
offset_x = args[3].value.pdb_int;
offset_y = args[4].value.pdb_int;
if (success)
{
gimp_drawable_offset (drawable, wrap_around, fill_type, offset_x, offset_y);
}
return procedural_db_return_args (&channel_ops_offset_proc, success);
}
static ProcArg channel_ops_offset_inargs[] =
{
{
PDB_DRAWABLE,
"drawable",
"The drawable to offset"
},
{
PDB_INT32,
"wrap_around",
"wrap image around or fill vacated regions"
},
{
PDB_INT32,
"fill_type",
"fill vacated regions of drawable with background or transparent: OFFSET_BACKGROUND (0) or OFFSET_TRANSPARENT (1)"
},
{
PDB_INT32,
"offset_x",
"offset by this amount in X direction"
},
{
PDB_INT32,
"offset_y",
"offset by this amount in Y direction"
}
};
static ProcRecord channel_ops_offset_proc =
{
"gimp_channel_ops_offset",
"Offset the drawable by the specified amounts in the X and Y directions",
"This procedure offsets the specified drawable by the amounts specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to TRUE, then portions of the drawable which are offset out of bounds are wrapped around. Alternatively, the undefined regions of the drawable can be filled with transparency or the background color, as specified by the 'fill_type' parameter.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997",
PDB_INTERNAL,
5,
channel_ops_offset_inargs,
0,
NULL,
{ { channel_ops_offset_invoker } }
};
static Argument *
channel_ops_duplicate_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
GimpImage *new_gimage = NULL;
gimage = gimp_image_get_by_ID (args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
if (success)
success = (new_gimage = gimp_image_duplicate (gimage)) != NULL;
return_args = procedural_db_return_args (&channel_ops_duplicate_proc, success);
if (success)
return_args[1].value.pdb_int = gimp_image_get_ID (new_gimage);
return return_args;
}
static ProcArg channel_ops_duplicate_inargs[] =
{
{
PDB_IMAGE,
"image",
"The image"
}
};
static ProcArg channel_ops_duplicate_outargs[] =
{
{
PDB_IMAGE,
"new_image",
"The new, duplicated image"
}
};
static ProcRecord channel_ops_duplicate_proc =
{
"gimp_channel_ops_duplicate",
"Duplicate the specified image",
"This procedure duplicates the specified image, copying all layers, channels, and image information.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997",
PDB_INTERNAL,
1,
channel_ops_duplicate_inargs,
1,
channel_ops_duplicate_outargs,
{ { channel_ops_duplicate_invoker } }
};

View File

@ -28,6 +28,7 @@
#include "procedural_db.h"
#include "drawable.h"
#include "gimpdrawable-offset.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
@ -58,6 +59,7 @@ static ProcRecord drawable_get_pixel_proc;
static ProcRecord drawable_set_pixel_proc;
static ProcRecord drawable_set_image_proc;
static ProcRecord drawable_thumbnail_proc;
static ProcRecord drawable_offset_proc;
void
register_drawable_procs (void)
@ -84,6 +86,7 @@ register_drawable_procs (void)
procedural_db_register (&drawable_set_pixel_proc);
procedural_db_register (&drawable_set_image_proc);
procedural_db_register (&drawable_thumbnail_proc);
procedural_db_register (&drawable_offset_proc);
}
static Argument *
@ -1495,3 +1498,80 @@ static ProcRecord drawable_thumbnail_proc =
drawable_thumbnail_outargs,
{ { drawable_thumbnail_invoker } }
};
static Argument *
drawable_offset_invoker (Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gboolean wrap_around;
gint32 fill_type;
gint32 offset_x;
gint32 offset_y;
drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int);
if (drawable == NULL)
success = FALSE;
wrap_around = args[1].value.pdb_int ? TRUE : FALSE;
fill_type = args[2].value.pdb_int;
if (fill_type < OFFSET_BACKGROUND || fill_type > OFFSET_TRANSPARENT)
success = FALSE;
offset_x = args[3].value.pdb_int;
offset_y = args[4].value.pdb_int;
if (success)
{
gimp_drawable_offset (drawable, wrap_around, fill_type, offset_x, offset_y);
}
return procedural_db_return_args (&drawable_offset_proc, success);
}
static ProcArg drawable_offset_inargs[] =
{
{
PDB_DRAWABLE,
"drawable",
"The drawable to offset"
},
{
PDB_INT32,
"wrap_around",
"wrap image around or fill vacated regions"
},
{
PDB_INT32,
"fill_type",
"fill vacated regions of drawable with background or transparent: OFFSET_BACKGROUND (0) or OFFSET_TRANSPARENT (1)"
},
{
PDB_INT32,
"offset_x",
"offset by this amount in X direction"
},
{
PDB_INT32,
"offset_y",
"offset by this amount in Y direction"
}
};
static ProcRecord drawable_offset_proc =
{
"gimp_drawable_offset",
"Offset the drawable by the specified amounts in the X and Y directions",
"This procedure offsets the specified drawable by the amounts specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to TRUE, then portions of the drawable which are offset out of bounds are wrapped around. Alternatively, the undefined regions of the drawable can be filled with transparency or the background color, as specified by the 'fill_type' parameter.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997",
PDB_INTERNAL,
5,
drawable_offset_inargs,
0,
NULL,
{ { drawable_offset_invoker } }
};

View File

@ -34,6 +34,7 @@
#include "gimage.h"
#include "gimpchannel.h"
#include "gimpcontainer.h"
#include "gimpimage-duplicate.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
@ -84,6 +85,7 @@ static ProcRecord image_floating_sel_attached_to_proc;
static ProcRecord image_thumbnail_proc;
static ProcRecord image_set_tattoo_state_proc;
static ProcRecord image_get_tattoo_state_proc;
static ProcRecord image_duplicate_proc;
static ProcRecord image_width_proc;
static ProcRecord image_height_proc;
static ProcRecord image_get_active_layer_proc;
@ -147,6 +149,7 @@ register_image_procs (void)
procedural_db_register (&image_thumbnail_proc);
procedural_db_register (&image_set_tattoo_state_proc);
procedural_db_register (&image_get_tattoo_state_proc);
procedural_db_register (&image_duplicate_proc);
procedural_db_register (&image_width_proc);
procedural_db_register (&image_height_proc);
procedural_db_register (&image_get_active_layer_proc);
@ -2615,6 +2618,63 @@ static ProcRecord image_get_tattoo_state_proc =
{ { image_get_tattoo_state_invoker } }
};
static Argument *
image_duplicate_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
GimpImage *new_gimage = NULL;
gimage = gimp_image_get_by_ID (args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
if (success)
success = (new_gimage = gimp_image_duplicate (gimage)) != NULL;
return_args = procedural_db_return_args (&image_duplicate_proc, success);
if (success)
return_args[1].value.pdb_int = gimp_image_get_ID (new_gimage);
return return_args;
}
static ProcArg image_duplicate_inargs[] =
{
{
PDB_IMAGE,
"image",
"The image"
}
};
static ProcArg image_duplicate_outargs[] =
{
{
PDB_IMAGE,
"new_image",
"The new, duplicated image"
}
};
static ProcRecord image_duplicate_proc =
{
"gimp_image_duplicate",
"Duplicate the specified image",
"This procedure duplicates the specified image, copying all layers, channels, and image information.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1997",
PDB_INTERNAL,
1,
image_duplicate_inargs,
1,
image_duplicate_outargs,
{ { image_duplicate_invoker } }
};
static Argument *
image_width_invoker (Argument *args)
{

View File

@ -30,7 +30,6 @@
void register_brush_select_procs (void);
void register_brushes_procs (void);
void register_channel_procs (void);
void register_channel_ops_procs (void);
void register_color_procs (void);
void register_convert_procs (void);
void register_display_procs (void);
@ -74,46 +73,43 @@ internal_procs_init (void)
app_init_update_status (NULL, _("Channel"), 0.044);
register_channel_procs ();
app_init_update_status (NULL, _("Channel Ops"), 0.094);
register_channel_ops_procs ();
app_init_update_status (NULL, _("Color"), 0.1);
app_init_update_status (NULL, _("Color"), 0.094);
register_color_procs ();
app_init_update_status (NULL, _("Convert"), 0.138);
app_init_update_status (NULL, _("Convert"), 0.132);
register_convert_procs ();
app_init_update_status (NULL, _("GDisplay procedures"), 0.147);
app_init_update_status (NULL, _("GDisplay procedures"), 0.141);
register_display_procs ();
app_init_update_status (NULL, _("Drawable procedures"), 0.157);
app_init_update_status (NULL, _("Drawable procedures"), 0.15);
register_drawable_procs ();
app_init_update_status (NULL, _("Edit procedures"), 0.226);
app_init_update_status (NULL, _("Edit procedures"), 0.223);
register_edit_procs ();
app_init_update_status (NULL, _("File Operations"), 0.245);
app_init_update_status (NULL, _("File Operations"), 0.241);
register_fileops_procs ();
app_init_update_status (NULL, _("Floating selections"), 0.27);
app_init_update_status (NULL, _("Floating selections"), 0.266);
register_floating_sel_procs ();
app_init_update_status (NULL, _("Gimprc procedures"), 0.288);
app_init_update_status (NULL, _("Gimprc procedures"), 0.285);
register_gimprc_procs ();
app_init_update_status (NULL, _("Gradients"), 0.298);
app_init_update_status (NULL, _("Gradients"), 0.295);
register_gradients_procs ();
app_init_update_status (NULL, _("Gradient UI"), 0.313);
app_init_update_status (NULL, _("Gradient UI"), 0.31);
register_gradient_select_procs ();
app_init_update_status (NULL, _("Guide procedures"), 0.326);
app_init_update_status (NULL, _("Guide procedures"), 0.323);
register_guides_procs ();
app_init_update_status (NULL, _("Help procedures"), 0.345);
app_init_update_status (NULL, _("Help procedures"), 0.342);
register_help_procs ();
app_init_update_status (NULL, _("Image"), 0.348);
app_init_update_status (NULL, _("Image"), 0.345);
register_image_procs ();
app_init_update_status (NULL, _("Layer"), 0.533);

View File

@ -31,7 +31,6 @@ PDB_WRAPPERS_C = \
gimpbrushes_pdb.c \
gimpbrushselect_pdb.c \
gimpchannel_pdb.c \
gimpchannelops_pdb.c \
gimpcolor_pdb.c \
gimpconvert_pdb.c \
gimpdisplay_pdb.c \
@ -66,7 +65,6 @@ PDB_WRAPPERS_H = \
gimpbrushes_pdb.h \
gimpbrushselect_pdb.h \
gimpchannel_pdb.h \
gimpchannelops_pdb.h \
gimpcolor_pdb.h \
gimpconvert_pdb.h \
gimpdisplay_pdb.h \

View File

@ -25,7 +25,6 @@
#include <libgimp/gimpbrushes_pdb.h>
#include <libgimp/gimpbrushselect_pdb.h>
#include <libgimp/gimpchannel_pdb.h>
#include <libgimp/gimpchannelops_pdb.h>
#include <libgimp/gimpcolor_pdb.h>
#include <libgimp/gimpconvert_pdb.h>
#include <libgimp/gimpdisplay_pdb.h>

View File

@ -1,102 +0,0 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpchannelops_pdb.c
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#include "gimp.h"
/**
* gimp_channel_ops_offset:
* @drawable_ID: The drawable to offset.
* @wrap_around: wrap image around or fill vacated regions.
* @fill_type: fill vacated regions of drawable with background or transparent.
* @offset_x: offset by this amount in X direction.
* @offset_y: offset by this amount in Y direction.
*
* Offset the drawable by the specified amounts in the X and Y
* directions
*
* This procedure offsets the specified drawable by the amounts
* specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to
* TRUE, then portions of the drawable which are offset out of bounds
* are wrapped around. Alternatively, the undefined regions of the
* drawable can be filled with transparency or the background color, as
* specified by the 'fill_type' parameter.
*
* Returns: TRUE on success.
*/
gboolean
gimp_channel_ops_offset (gint32 drawable_ID,
gboolean wrap_around,
GimpChannelOffsetType fill_type,
gint offset_x,
gint offset_y)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_channel_ops_offset",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, wrap_around,
GIMP_PDB_INT32, fill_type,
GIMP_PDB_INT32, offset_x,
GIMP_PDB_INT32, offset_y,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_channel_ops_duplicate:
* @image_ID: The image.
*
* Duplicate the specified image
*
* This procedure duplicates the specified image, copying all layers,
* channels, and image information.
*
* Returns: The new, duplicated image.
*/
gint32
gimp_channel_ops_duplicate (gint32 image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 new_image_ID = -1;
return_vals = gimp_run_procedure ("gimp_channel_ops_duplicate",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
new_image_ID = return_vals[1].data.d_image;
gimp_destroy_params (return_vals, nreturn_vals);
return new_image_ID;
}

View File

@ -1,46 +0,0 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpchannelops_pdb.h
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* NOTE: This file is autogenerated by pdbgen.pl */
#ifndef __GIMP_CHANNEL_OPS_PDB_H__
#define __GIMP_CHANNEL_OPS_PDB_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* For information look into the C source or the html documentation */
gboolean gimp_channel_ops_offset (gint32 drawable_ID,
gboolean wrap_around,
GimpChannelOffsetType fill_type,
gint offset_x,
gint offset_y);
gint32 gimp_channel_ops_duplicate (gint32 image_ID);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GIMP_CHANNEL_OPS_PDB_H__ */

View File

@ -703,3 +703,50 @@ _gimp_drawable_thumbnail (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_offset:
* @drawable_ID: The drawable to offset.
* @wrap_around: wrap image around or fill vacated regions.
* @fill_type: fill vacated regions of drawable with background or transparent.
* @offset_x: offset by this amount in X direction.
* @offset_y: offset by this amount in Y direction.
*
* Offset the drawable by the specified amounts in the X and Y
* directions
*
* This procedure offsets the specified drawable by the amounts
* specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to
* TRUE, then portions of the drawable which are offset out of bounds
* are wrapped around. Alternatively, the undefined regions of the
* drawable can be filled with transparency or the background color, as
* specified by the 'fill_type' parameter.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_offset (gint32 drawable_ID,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_drawable_offset",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_INT32, wrap_around,
GIMP_PDB_INT32, fill_type,
GIMP_PDB_INT32, offset_x,
GIMP_PDB_INT32, offset_y,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}

View File

@ -31,44 +31,49 @@ extern "C" {
/* For information look into the C source or the html documentation */
gboolean gimp_drawable_merge_shadow (gint32 drawable_ID,
gboolean undo);
gboolean gimp_drawable_fill (gint32 drawable_ID,
GimpFillType fill_type);
gboolean gimp_drawable_update (gint32 drawable_ID,
gint x,
gint y,
gint width,
gint height);
gboolean gimp_drawable_mask_bounds (gint32 drawable_ID,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gint32 gimp_drawable_image (gint32 drawable_ID);
GimpImageType gimp_drawable_type (gint32 drawable_ID);
gboolean gimp_drawable_has_alpha (gint32 drawable_ID);
GimpImageType gimp_drawable_type_with_alpha (gint32 drawable_ID);
gboolean gimp_drawable_is_rgb (gint32 drawable_ID);
gboolean gimp_drawable_is_gray (gint32 drawable_ID);
gboolean gimp_drawable_is_indexed (gint32 drawable_ID);
gint gimp_drawable_bytes (gint32 drawable_ID);
gint gimp_drawable_width (gint32 drawable_ID);
gint gimp_drawable_height (gint32 drawable_ID);
gboolean gimp_drawable_offsets (gint32 drawable_ID,
gint *offset_x,
gint *offset_y);
gboolean gimp_drawable_is_layer (gint32 drawable_ID);
gboolean gimp_drawable_is_layer_mask (gint32 drawable_ID);
gboolean gimp_drawable_is_channel (gint32 drawable_ID);
gboolean _gimp_drawable_thumbnail (gint32 drawable_ID,
gint width,
gint height,
gint *ret_width,
gint *ret_height,
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
gboolean gimp_drawable_merge_shadow (gint32 drawable_ID,
gboolean undo);
gboolean gimp_drawable_fill (gint32 drawable_ID,
GimpFillType fill_type);
gboolean gimp_drawable_update (gint32 drawable_ID,
gint x,
gint y,
gint width,
gint height);
gboolean gimp_drawable_mask_bounds (gint32 drawable_ID,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
gint32 gimp_drawable_image (gint32 drawable_ID);
GimpImageType gimp_drawable_type (gint32 drawable_ID);
gboolean gimp_drawable_has_alpha (gint32 drawable_ID);
GimpImageType gimp_drawable_type_with_alpha (gint32 drawable_ID);
gboolean gimp_drawable_is_rgb (gint32 drawable_ID);
gboolean gimp_drawable_is_gray (gint32 drawable_ID);
gboolean gimp_drawable_is_indexed (gint32 drawable_ID);
gint gimp_drawable_bytes (gint32 drawable_ID);
gint gimp_drawable_width (gint32 drawable_ID);
gint gimp_drawable_height (gint32 drawable_ID);
gboolean gimp_drawable_offsets (gint32 drawable_ID,
gint *offset_x,
gint *offset_y);
gboolean gimp_drawable_is_layer (gint32 drawable_ID);
gboolean gimp_drawable_is_layer_mask (gint32 drawable_ID);
gboolean gimp_drawable_is_channel (gint32 drawable_ID);
gboolean _gimp_drawable_thumbnail (gint32 drawable_ID,
gint width,
gint height,
gint *ret_width,
gint *ret_height,
gint *bpp,
gint *thumbnail_data_count,
guint8 **thumbnail_data);
gboolean gimp_drawable_offset (gint32 drawable_ID,
gboolean wrap_around,
GimpOffsetType fill_type,
gint offset_x,
gint offset_y);
#ifdef __cplusplus

View File

@ -66,12 +66,6 @@ typedef enum
GIMP_ALPHA_LUT
} GimpChannelLutType;
typedef enum
{
GIMP_OFFSET_BACKGROUND,
GIMP_OFFSET_TRANSPARENT
} GimpChannelOffsetType;
typedef enum
{
GIMP_ADD,
@ -168,6 +162,12 @@ typedef enum
GIMP_INDEXEDA_IMAGE
} GimpImageType;
typedef enum
{
GIMP_OFFSET_BACKGROUND,
GIMP_OFFSET_TRANSPARENT
} GimpOffsetType;
typedef enum
{
GIMP_ONCE_FORWARD,
@ -345,102 +345,6 @@ typedef enum
GIMP_HIGHLIGHTS
} GimpTransferMode;
/* This is for backwards compatibility. Don't use these for new plug-ins. */
#ifdef GIMP_ENABLE_COMPAT_CRUFT
typedef GimpFillType GFillType;
typedef GimpImageBaseType GImageType;
typedef GimpImageType GDrawableType;
typedef GimpLayerModeEffects GLayerMode;
typedef GimpRunModeType GRunModeType;
typedef GimpOrientationType GOrientation;
typedef GimpPDBArgType GParamType;
typedef GimpPDBProcType GProcedureType;
typedef GimpPDBStatusType GStatusType;
#define PARAM_INT32 GIMP_PDB_INT32
#define PARAM_INT16 GIMP_PDB_INT16
#define PARAM_INT8 GIMP_PDB_INT8
#define PARAM_FLOAT GIMP_PDB_FLOAT
#define PARAM_STRING GIMP_PDB_STRING
#define PARAM_INT32ARRAY GIMP_PDB_INT32ARRAY
#define PARAM_INT16ARRAY GIMP_PDB_INT16ARRAY
#define PARAM_INT8ARRAY GIMP_PDB_INT8ARRAY
#define PARAM_FLOATARRAY GIMP_PDB_FLOATARRAY
#define PARAM_STRINGARRAY GIMP_PDB_STRINGARRAY
#define PARAM_COLOR GIMP_PDB_COLOR
#define PARAM_REGION GIMP_PDB_REGION
#define PARAM_DISPLAY GIMP_PDB_DISPLAY
#define PARAM_IMAGE GIMP_PDB_IMAGE
#define PARAM_LAYER GIMP_PDB_LAYER
#define PARAM_CHANNEL GIMP_PDB_CHANNEL
#define PARAM_DRAWABLE GIMP_PDB_DRAWABLE
#define PARAM_SELECTION GIMP_PDB_SELECTION
#define PARAM_BOUNDARY GIMP_PDB_BOUNDARY
#define PARAM_PATH GIMP_PDB_PATH
#define PARAM_PARASITE GIMP_PDB_PARASITE
#define PARAM_STATUS GIMP_PDB_STATUS
#define PARAM_END GIMP_PDB_END
#define STATUS_EXECUTION_ERROR GIMP_PDB_EXECUTION_ERROR
#define STATUS_CALLING_ERROR GIMP_PDB_CALLING_ERROR
#define STATUS_PASS_THROUGH GIMP_PDB_PASS_THROUGH
#define STATUS_SUCCESS GIMP_PDB_SUCCESS
#define STATUS_CANCEL GIMP_PDB_CANCEL
#define PROC_INTERNAL GIMP_INTERNAL
#define PROC_PLUG_IN GIMP_PLUGIN
#define PROC_EXTENSION GIMP_EXTENSION
#define PROC_TEMPORARY GIMP_TEMPORARY
#define ORIENTATION_HORIZONTAL GIMP_HORIZONTAL
#define ORIENTATION_VERTICAL GIMP_VERTICAL
#define ORIENTATION_UNKNOWN GIMP_UNKNOWN
#define FG_IMAGE_FILL GIMP_FG_IMAGE_FILL
#define BG_IMAGE_FILL GIMP_BG_IMAGE_FILL
#define WHITE_IMAGE_FILL GIMP_WHITE_IMAGE_FILL
#define TRANS_IMAGE_FILL GIMP_TRANS_IMAGE_FILL
#define NO_IMAGE_FILL GIMP_NO_IMAGE_FILL
#define RGB GIMP_RGB
#define GRAY GIMP_GRAY
#define INDEXED GIMP_INDEXED
#define RGB_IMAGE GIMP_RGB_IMAGE
#define RGBA_IMAGE GIMP_RGBA_IMAGE
#define GRAY_IMAGE GIMP_GRAY_IMAGE
#define GRAYA_IMAGE GIMP_GRAYA_IMAGE
#define INDEXED_IMAGE GIMP_INDEXED_IMAGE
#define INDEXEDA_IMAGE GIMP_INDEXEDA_IMAGE
#define NORMAL_MODE GIMP_NORMAL_MODE
#define DISSOLVE_MODE GIMP_DISSOLVE_MODE
#define BEHIND_MODE GIMP_BEHIND_MODE
#define MULTIPLY_MODE GIMP_MULTIPLY_MODE
#define SCREEN_MODE GIMP_SCREEN_MODE
#define OVERLAY_MODE GIMP_OVERLAY_MODE
#define DIFFERENCE_MODE GIMP_DIFFERENCE_MODE
#define ADDITION_MODE GIMP_ADDITION_MODE
#define SUBTRACT_MODE GIMP_SUBTRACT_MODE
#define DARKEN_ONLY_MODE GIMP_DARKEN_ONLY_MODE
#define LIGHTEN_ONLY_MODE GIMP_LIGHTEN_ONLY_MODE
#define HUE_MODE GIMP_HUE_MODE
#define SATURATION_MODE GIMP_SATURATION_MODE
#define COLOR_MODE GIMP_COLOR_MODE
#define VALUE_MODE GIMP_VALUE_MODE
#define DIVIDE_MODE GIMP_DIVIDE_MODE
#define DODGE_MODE GIMP_DODGE_MODE
#define BURN_MODE GIMP_BURN_MODE
#define HARDLIGHT_MODE GIMP_HARDLIGHT_MODE
#define RUN_INTERACTIVE GIMP_RUN_INTERACTIVE
#define RUN_NONINTERACTIVE GIMP_RUN_NONINTERACTIVE
#define RUN_WITH_LAST_VALS GIMP_RUN_WITH_LAST_VALS
#endif /* GIMP_ENABLE_COMPAT_CRUFT */
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -31,7 +31,6 @@ extern "C" {
#define gimp_image_convert_rgb gimp_convert_rgb
#define gimp_image_convert_grayscale gimp_convert_grayscale
#define gimp_image_convert_indexed gimp_convert_indexed
#define gimp_image_duplicate gimp_channel_ops_duplicate
guchar * gimp_image_get_cmap (gint32 image_ID,

View File

@ -1513,6 +1513,37 @@ gimp_image_get_tattoo_state (gint32 image_ID)
return tattoo;
}
/**
* gimp_image_duplicate:
* @image_ID: The image.
*
* Duplicate the specified image
*
* This procedure duplicates the specified image, copying all layers,
* channels, and image information.
*
* Returns: The new, duplicated image.
*/
gint32
gimp_image_duplicate (gint32 image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 new_image_ID = -1;
return_vals = gimp_run_procedure ("gimp_image_duplicate",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
new_image_ID = return_vals[1].data.d_image;
gimp_destroy_params (return_vals, nreturn_vals);
return new_image_ID;
}
/**
* gimp_image_width:
* @image_ID: The image.

View File

@ -113,6 +113,7 @@ gboolean _gimp_image_thumbnail (gint32 image
gboolean gimp_image_set_tattoo_state (gint32 image_ID,
gint tattoo);
gint gimp_image_get_tattoo_state (gint32 image_ID);
gint32 gimp_image_duplicate (gint32 image_ID);
gint gimp_image_width (gint32 image_ID);
gint gimp_image_height (gint32 image_ID);
gint32 gimp_image_get_active_layer (gint32 image_ID);

View File

@ -223,7 +223,7 @@ guillotine (gint32 image_ID)
{
gint32 new_image;
new_image = gimp_channel_ops_duplicate (image_ID);
new_image = gimp_image_duplicate (image_ID);
if (new_image == -1)
{

View File

@ -216,42 +216,14 @@ query (void)
static gchar *copy = "Copyright 1997-2000 by Michael Sweet and Robert Krawitz";
static gchar *types = "RGB*,GRAY*,INDEXED*";
#ifdef NEW_UI_ONLY
gimp_install_procedure ("file_print_gimp",
blurb, help, auth, copy,
PLUG_IN_VERSION,
N_("<Image>/File/Print..."),
types,
PROC_PLUG_IN,
GIMP_PLUGIN,
nargs, 0,
args, NULL);
#elif defined(GIMP_1_0)
gimp_install_procedure ("file_print",
blurb, help, auth, copy,
PLUG_IN_VERSION,
N_("<Image>/File/Print..."),
types,
PROC_PLUG_IN,
nargs, 0,
args, NULL);
#else
gimp_install_procedure ("file_print_gtk",
blurb, help, auth, copy,
PLUG_IN_VERSION,
N_("<Image>/File/Print (Gtk)..."),
types,
PROC_PLUG_IN,
nargs, 0,
args, NULL);
gimp_install_procedure ("file_print_gimp",
blurb, help, auth, copy,
PLUG_IN_VERSION,
N_("<Image>/File/Print (Gimp)..."),
types,
PROC_PLUG_IN,
nargs, 0,
args, NULL);
#endif
}
@ -338,7 +310,7 @@ run (char *name, /* I - Name of print program. */
*/
current_printer = get_printer_by_index (0);
run_mode = (GRunModeType)param[0].data.d_int32;
run_mode = (GimpRunModeType)param[0].data.d_int32;
values = g_new (GimpParam, 1);
@ -359,8 +331,8 @@ run (char *name, /* I - Name of print program. */
/* eventually export the image */
switch (run_mode)
{
case RUN_INTERACTIVE:
case RUN_WITH_LAST_VALS:
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("print", TRUE);
export = gimp_export_image (&image_ID, &drawable_ID, "Print",
(GIMP_EXPORT_CAN_HANDLE_RGB |
@ -394,7 +366,7 @@ run (char *name, /* I - Name of print program. */
switch (run_mode)
{
case RUN_INTERACTIVE:
case GIMP_RUN_INTERACTIVE:
/*
* Get information from the dialog...
*/
@ -403,12 +375,12 @@ run (char *name, /* I - Name of print program. */
goto cleanup;
break;
case RUN_NONINTERACTIVE:
case GIMP_RUN_NONINTERACTIVE:
/*
* Make sure all the arguments are present...
*/
if (nparams < 11)
values[0].data.d_status = STATUS_CALLING_ERROR;
values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
else
{
strcpy (vars.output_to, param[3].data.d_string);
@ -509,7 +481,7 @@ run (char *name, /* I - Name of print program. */
current_printer = get_printer_by_driver (vars.driver);
break;
case RUN_WITH_LAST_VALS:
case GIMP_RUN_WITH_LAST_VALS:
/*
* Possibly retrieve data...
*/
@ -521,14 +493,14 @@ run (char *name, /* I - Name of print program. */
break;
default:
values[0].data.d_status = STATUS_CALLING_ERROR;
values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
break;;
}
/*
* Print the image...
*/
if (values[0].data.d_status == STATUS_SUCCESS)
if (values[0].data.d_status == GIMP_PDB_SUCCESS)
{
/*
* Set the tile cache size...
@ -633,7 +605,7 @@ run (char *name, /* I - Name of print program. */
* Is the image an Indexed type? If so we need the colormap...
*/
if (gimp_image_base_type (image_ID) == INDEXED)
if (gimp_image_base_type (image_ID) == GIMP_INDEXED)
vars.cmap = gimp_image_get_cmap (image_ID, &ncolors);
else
vars.cmap = NULL;
@ -646,7 +618,7 @@ run (char *name, /* I - Name of print program. */
if (verify_printer_params(current_printer, &vars))
(*current_printer->print) (current_printer, 1, prn, image, &vars);
else
values[0].data.d_status = STATUS_EXECUTION_ERROR;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (plist_current > 0)
#ifndef __EMX__
@ -661,7 +633,7 @@ run (char *name, /* I - Name of print program. */
fclose (prn);
s = g_strconcat (vars.output_to, tmpfile, NULL);
if (system(s) != 0)
values[0].data.d_status = STATUS_EXECUTION_ERROR;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
g_free (s);
remove (tmpfile);
g_free( tmpfile);
@ -672,13 +644,13 @@ run (char *name, /* I - Name of print program. */
print_finished = 1;
}
else
values[0].data.d_status = STATUS_EXECUTION_ERROR;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
/*
* Store data...
*/
if (run_mode == RUN_INTERACTIVE)
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_set_data (PLUG_IN_NAME, &vars, sizeof (vars));
}

View File

@ -48,9 +48,6 @@ init_generated_constants (void)
setvar (cintern ("BLUE-LUT"), flocons (3), NIL);
setvar (cintern ("ALPHA-LUT"), flocons (4), NIL);
setvar (cintern ("OFFSET-BACKGROUND"), flocons (0), NIL);
setvar (cintern ("OFFSET-TRANSPARENT"), flocons (1), NIL);
setvar (cintern ("ADD"), flocons (0), NIL);
setvar (cintern ("SUB"), flocons (1), NIL);
setvar (cintern ("REPLACE"), flocons (2), NIL);
@ -111,6 +108,9 @@ init_generated_constants (void)
setvar (cintern ("INDEXED-IMAGE"), flocons (4), NIL);
setvar (cintern ("INDEXEDA-IMAGE"), flocons (5), NIL);
setvar (cintern ("OFFSET-BACKGROUND"), flocons (0), NIL);
setvar (cintern ("OFFSET-TRANSPARENT"), flocons (1), NIL);
setvar (cintern ("ONCE-FORWARD"), flocons (0), NIL);
setvar (cintern ("ONCE-BACKWARDS"), flocons (1), NIL);
setvar (cintern ("LOOP-SAWTOOTH"), flocons (2), NIL);

View File

@ -5,7 +5,6 @@ pdb_sources = \
pdb/brush_select.pdb \
pdb/brushes.pdb \
pdb/channel.pdb \
pdb/channel_ops.pdb \
pdb/color.pdb \
pdb/convert.pdb \
pdb/display.pdb \

View File

@ -141,53 +141,7 @@ foreach (sort keys %enums) {
print ENUMFILE $body
}
# Sigh - this is full of backwards compat hacks. We'll clean this up for 1.3
print ENUMFILE <<'CRUFT';
/* This is for backwards compatibility. Don't use these for new plug-ins. */
#ifdef GIMP_ENABLE_COMPAT_CRUFT
typedef GimpFillType GFillType;
typedef GimpImageBaseType GImageType;
typedef GimpImageType GDrawableType;
typedef GimpLayerModeEffects GLayerMode;
typedef GimpRunModeType GRunModeType;
typedef GimpOrientationType GOrientation;
typedef GimpPDBArgType GParamType;
typedef GimpPDBProcType GProcedureType;
typedef GimpPDBStatusType GStatusType;
CRUFT
@xforms = (
{ enum => 'PDBArgType', xform => [ qw(s/PDB/PARAM/) ] },
{ enum => 'PDBStatusType', xform => [ qw(s/PDB/STATUS/) ] },
{ enum => 'PDBProcType', xform => [ qw(s/^/PROC_/ s/PLUGIN/PLUG_IN/) ] },
{ enum => 'OrientationType', xform => [ qw(s/^/ORIENTATION_/) ] },
{ enum => 'GimpFillType', xform => [] },
{ enum => 'GimpImageBaseType', xform => [] },
{ enum => 'GimpImageType', xform => [] },
{ enum => 'LayerModeEffects', xform => [] },
{ enum => 'RunModeType', xform => [] },
);
foreach $xform (@xforms) {
my $enum = $enums{$xform->{enum}};
foreach (@{$enum->{symbols}}) {
my $symbol = $_;
$symbol = $enum->{nicks}->{$symbol} if exists $enum->{nicks}->{$symbol};
my $sym = $symbol;
foreach $xform (@{$xform->{xform}}) { eval "\$sym =~ $xform" }
$symbol = "GIMP_$symbol";
print ENUMFILE "#define $sym $symbol\n";
}
print ENUMFILE "\n";
}
print ENUMFILE <<HEADER;
#endif /* GIMP_ENABLE_COMPAT_CRUFT */
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -256,7 +256,7 @@ package Gimp::CodeGen::enums;
STACK_TRACE_QUERY => '1',
STACK_TRACE_ALWAYS => '2' }
},
ChannelOffsetType =>
GimpOffsetType =>
{ contig => 1,
header => 'gimpdrawable-offset.h',
symbols => [ qw(OFFSET_BACKGROUND OFFSET_TRANSPARENT) ],

View File

@ -3,7 +3,6 @@
brush_select
brushes
channel
channel_ops
color
convert
display

View File

@ -1,92 +0,0 @@
# The GIMP -- an image manipulation program
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
# 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.
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub channel_ops_offset {
$blurb = <<'BLURB';
Offset the drawable by the specified amounts in the X and Y directions
BLURB
$help = <<'HELP';
This procedure offsets the specified drawable by the amounts specified by
'offset_x' and 'offset_y'. If 'wrap_around' is set to TRUE, then portions of
the drawable which are offset out of bounds are wrapped around. Alternatively,
the undefined regions of the drawable can be filled with transparency or the
background color, as specified by the 'fill_type' parameter.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable to offset' },
{ name => 'wrap_around', type => 'boolean',
desc => 'wrap image around or fill vacated regions' },
{ name => 'fill_type', type => 'enum ChannelOffsetType',
desc => 'fill vacated regions of drawable with background or
transparent: %%desc%%' },
{ name => 'offset_x', type => 'int32',
desc => 'offset by this amount in X direction' },
{ name => 'offset_y', type => 'int32',
desc => 'offset by this amount in Y direction' }
);
%invoke = (
headers => [ qw("gimpdrawable-offset.h") ],
code => <<'CODE'
{
gimp_drawable_offset (drawable, wrap_around, fill_type, offset_x, offset_y);
}
CODE
);
}
sub channel_ops_duplicate {
$blurb = 'Duplicate the specified image';
$help = <<'HELP';
This procedure duplicates the specified image, copying all layers, channels,
and image information.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = ( &std_image_arg );
@outargs = (
{ name => 'new_image', type => 'image',
desc => 'The new, duplicated image',
alias => 'new_gimage', init => 1 }
);
%invoke = (
headers => [ qw("gimpimage-duplicate.h") ],
code => <<'CODE'
success = (new_gimage = gimp_image_duplicate (gimage)) != NULL;
CODE
);
}
@procs = qw(channel_ops_offset channel_ops_duplicate);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Channel Ops';
1;

View File

@ -497,6 +497,46 @@ CODE
);
}
sub drawable_offset {
$blurb = <<'BLURB';
Offset the drawable by the specified amounts in the X and Y directions
BLURB
$help = <<'HELP';
This procedure offsets the specified drawable by the amounts specified by
'offset_x' and 'offset_y'. If 'wrap_around' is set to TRUE, then portions of
the drawable which are offset out of bounds are wrapped around. Alternatively,
the undefined regions of the drawable can be filled with transparency or the
background color, as specified by the 'fill_type' parameter.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable to offset' },
{ name => 'wrap_around', type => 'boolean',
desc => 'wrap image around or fill vacated regions' },
{ name => 'fill_type', type => 'enum GimpOffsetType',
desc => 'fill vacated regions of drawable with background or
transparent: %%desc%%' },
{ name => 'offset_x', type => 'int32',
desc => 'offset by this amount in X direction' },
{ name => 'offset_y', type => 'int32',
desc => 'offset by this amount in Y direction' }
);
%invoke = (
headers => [ qw("gimpdrawable-offset.h") ],
code => <<'CODE'
{
gimp_drawable_offset (drawable, wrap_around, fill_type, offset_x, offset_y);
}
CODE
);
}
@headers = qw("gimplayermask.h" "drawable.h"
"pdb_glue.h" "tile.h" "tile_manager.h" "temp_buf.h");
@ -506,8 +546,9 @@ CODE
drawable_is_gray drawable_is_indexed drawable_bytes drawable_width
drawable_height drawable_offsets drawable_is_layer
drawable_is_layer_mask drawable_is_channel drawable_get_pixel
drawable_set_pixel drawable_set_image drawable_thumbnail);
%exports = (app => [@procs], lib => [@procs[0..17,21]]);
drawable_set_pixel drawable_set_image drawable_thumbnail
drawable_offset);
%exports = (app => [@procs], lib => [@procs[0..17,21..22]]);
$desc = 'Drawable procedures';

View File

@ -1432,6 +1432,33 @@ CODE
);
}
sub image_duplicate {
$blurb = 'Duplicate the specified image';
$help = <<'HELP';
This procedure duplicates the specified image, copying all layers, channels,
and image information.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = ( &std_image_arg );
@outargs = (
{ name => 'new_image', type => 'image',
desc => 'The new, duplicated image',
alias => 'new_gimage', init => 1 }
);
%invoke = (
headers => [ qw("gimpimage-duplicate.h") ],
code => <<'CODE'
success = (new_gimage = gimp_image_duplicate (gimage)) != NULL;
CODE
);
}
@headers = qw(<string.h> "gimage.h" "context_manager.h" "gimpcontainer.h"
"gimplist.h" "temp_buf.h"
@ -1464,7 +1491,8 @@ unshift @procs, qw(image_list image_new image_resize image_scale image_delete
image_undo_disable image_undo_freeze image_undo_thaw
image_clean_all image_floating_selection
image_floating_sel_attached_to image_thumbnail
image_set_tattoo_state image_get_tattoo_state);
image_set_tattoo_state image_get_tattoo_state
image_duplicate);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Image';