Export gimp_drawable_set_image() to the PDB. Needed for the GAP plug-in.

--Sven
This commit is contained in:
Sven Neumann 1998-12-02 01:42:08 +00:00
parent 3fcc361159
commit 66ce5eea04
4 changed files with 85 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Wed Dec 2 02:40:34 MET 1998 Sven Neumann <sven@gimp.org>
* app/drawable_cmds.[ch]
* app/internal_procs.c: Export gimp_drawable_set_image() to the
PDB.. Needed for the GAP plug-in.
Tue Dec 1 15:12:29 PST 1998 Manish Singh <yosh@gimp.org>
* app/gradient.c

View File

@ -1678,3 +1678,79 @@ gimp_drawable_detach_parasite_invoker (Argument *args)
return return_args;
}
/************************/
/* DRAWABLE_SET_IMAGE */
static Argument *
drawable_set_image_invoker (Argument *args)
{
int int_value;
GimpImage *gimage;
GimpDrawable *gdrawable;
Argument *return_args;
success = TRUE;
/* the GimpDrawable */
if (success)
{
int_value = args[0].value.pdb_int;
if (! (gdrawable = gimp_drawable_get_ID (int_value)))
success = FALSE;
}
if (success)
{
int_value = args[1].value.pdb_int;
if ((gimage = gimage_get_ID (int_value)) == NULL)
success = FALSE;
}
if (success)
{
gimp_drawable_set_gimage (gdrawable, gimage);
}
return_args = procedural_db_return_args (&drawable_set_image_proc, success);
return return_args;
}
/* The procedure definition */
ProcArg drawable_set_image_args[] =
{
{ PDB_DRAWABLE,
"drawable",
"the drawable"
},
{ PDB_IMAGE,
"image",
"the image"
}
};
ProcRecord drawable_set_image_proc =
{
"gimp_drawable_set_image",
"Set image where drawable belongs to",
"Set the image the drawable should be a part of. (Use this before adding a drawable to another image)",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
PDB_INTERNAL,
/* Input arguments */
2,
drawable_set_image_args,
/* Output arguments */
0,
NULL,
/* Exec method */
{ { drawable_set_image_invoker } },
};

View File

@ -43,5 +43,6 @@ extern ProcRecord drawable_get_pixel_proc;
extern ProcRecord gimp_drawable_find_parasite_proc;
extern ProcRecord gimp_drawable_attach_parasite_proc;
extern ProcRecord gimp_drawable_detach_parasite_proc;
extern ProcRecord drawable_set_image_proc;
#endif /* __DRAWABLE_CMDS_H__ */

View File

@ -81,7 +81,7 @@ internal_procs_init ()
{
gfloat pcount = 0;
/* grep -c procedural_db_register internal_procs.c */
gfloat total_pcount = 257;
gfloat total_pcount = 258;
app_init_update_status(_("Internal Procedures"), _("Tool procedures"),
pcount/total_pcount);
@ -303,6 +303,7 @@ internal_procs_init ()
procedural_db_register (&gimp_drawable_find_parasite_proc); pcount++;
procedural_db_register (&gimp_drawable_attach_parasite_proc); pcount++;
procedural_db_register (&gimp_drawable_detach_parasite_proc); pcount++;
procedural_db_register (&drawable_set_image_proc); pcount++;
app_init_update_status(NULL, _("Floating selections"),
pcount/total_pcount);