diff --git a/ChangeLog b/ChangeLog index 7fc9ba3903..295b4d9150 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Dec 2 02:40:34 MET 1998 Sven Neumann + + * 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 * app/gradient.c diff --git a/app/drawable_cmds.c b/app/drawable_cmds.c index 5be9f2f5ce..5acddbfde8 100644 --- a/app/drawable_cmds.c +++ b/app/drawable_cmds.c @@ -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 } }, +}; + + + + diff --git a/app/drawable_cmds.h b/app/drawable_cmds.h index 90f76852e5..651738a2e9 100644 --- a/app/drawable_cmds.h +++ b/app/drawable_cmds.h @@ -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__ */ diff --git a/app/internal_procs.c b/app/internal_procs.c index 0e77ab05fb..3fa23887a8 100644 --- a/app/internal_procs.c +++ b/app/internal_procs.c @@ -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);