tools/pdbgen/pdb/display.pdb applied a modified version of a patch from

2002-12-03  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/pdb/display.pdb
	* tools/pdbgen/pdb/layer.pdb: applied a modified version of a
	patch from Wolfgang Hofer <hof@gimp.org> that adds two new PDB
	functions needed for GAP: gimp_displays_reconnect() and
	gimp_layer_new_from_drawable() (bug #77508).

	* app/pdb/display_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/layer_cmds.c
	* libgimp/gimpdisplay_pdb.[ch]
	* libgimp/gimplayer_pdb.[ch]: regenerated.
This commit is contained in:
Sven Neumann
2002-12-03 12:10:21 +00:00
committed by Sven Neumann
parent 1c60f4e045
commit 2193d83a26
14 changed files with 342 additions and 38 deletions

View File

@ -119,3 +119,38 @@ gimp_displays_flush (void)
return success;
}
/**
* gimp_displays_reconnect:
* @old_image_ID: The old image (should have at least one display).
* @new_image_ID: The new image (must not have a display).
*
* Reconnect displays from one image to another image.
*
* This procedure connects all displays of the old_image to the
* new_image. If the new_image already has a display the reconnect is
* not performed and the procedure returns without success. You should
* rarely need to use this function.
*
* Returns: TRUE on success.
*/
gboolean
gimp_displays_reconnect (gint32 old_image_ID,
gint32 new_image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_displays_reconnect",
&nreturn_vals,
GIMP_PDB_IMAGE, old_image_ID,
GIMP_PDB_IMAGE, new_image_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}

View File

@ -29,9 +29,11 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gint32 gimp_display_new (gint32 image_ID);
gboolean gimp_display_delete (gint32 display_ID);
gboolean gimp_displays_flush (void);
gint32 gimp_display_new (gint32 image_ID);
gboolean gimp_display_delete (gint32 display_ID);
gboolean gimp_displays_flush (void);
gboolean gimp_displays_reconnect (gint32 old_image_ID,
gint32 new_image_ID);
G_END_DECLS

View File

@ -450,6 +450,43 @@ gimp_layer_is_floating_sel (gint32 layer_ID)
return is_floating_sel;
}
/**
* gimp_layer_new_from_drawable:
* @drawable_ID: The source drawable from where the new layer is copied.
* @dest_image_ID: The destination image to which to add the layer.
*
* Create a new layer by copying an existing drawable.
*
* This procedure creates a new layer as a copy of the specified
* drawable. The new layer still needs to be added to the image, as
* this is not automatic. Add the new layer with the
* 'gimp_image_add_layer' command. Other attributes such as layer mask
* modes, and offsets should be set with explicit procedure calls.
*
* Returns: The newly copied layer.
*/
gint32
gimp_layer_new_from_drawable (gint32 drawable_ID,
gint32 dest_image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gint32 layer_copy_ID = -1;
return_vals = gimp_run_procedure ("gimp_layer_new_from_drawable",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_IMAGE, dest_image_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
layer_copy_ID = return_vals[1].data.d_layer;
gimp_destroy_params (return_vals, nreturn_vals);
return layer_copy_ID;
}
/**
* gimp_layer_get_name:
* @layer_ID: The layer.

View File

@ -59,6 +59,8 @@ gboolean gimp_layer_set_offsets (gint32 layer_
gint offy);
gint32 gimp_layer_mask (gint32 layer_ID);
gboolean gimp_layer_is_floating_sel (gint32 layer_ID);
gint32 gimp_layer_new_from_drawable (gint32 drawable_ID,
gint32 dest_image_ID);
gchar* gimp_layer_get_name (gint32 layer_ID);
gboolean gimp_layer_set_name (gint32 layer_ID,
gchar *name);