diff --git a/ChangeLog b/ChangeLog index 7d0e680380..751f27ee5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Nov 16 19:04:54 MET 1998 Sven Neumann + + * app/gimage_cmds.[ch] + * app/internal_procs.c: new function to get the drawable a + floating selection is attached to (for the gap plug-in) + Sun Nov 15 19:36:02 MET 1998 Sven Neumann * app/floating_sel_cmds.[ch] diff --git a/app/gimage_cmds.c b/app/gimage_cmds.c index b27ce7141e..d4eab12ee7 100644 --- a/app/gimage_cmds.c +++ b/app/gimage_cmds.c @@ -3622,6 +3622,78 @@ ProcRecord gimage_floating_sel_proc = { { gimage_floating_sel_invoker } }, }; +/*************************************/ +/* GIMAGE_FLOATING_SEL_ATTACHED_TO */ + +static Argument * +gimage_floating_sel_attached_to_invoker (Argument *args) +{ + GImage *gimage; + Layer *floating_sel; + Argument *return_args; + + floating_sel = NULL; + + success = TRUE; + if (success) + { + int_value = args[0].value.pdb_int; + if ((gimage = gimage_get_ID (int_value))) + floating_sel = gimage_floating_sel (gimage); + else + success = FALSE; + } + + return_args = procedural_db_return_args (&gimage_floating_sel_attached_to_proc, success); + + if (success) + return_args[1].value.pdb_int = (floating_sel) + ? drawable_ID (GIMP_DRAWABLE( GIMP_LAYER(floating_sel)->fs.drawable )) + : -1; + + return return_args; +} + +/* The procedure definition */ +ProcArg gimage_floating_sel_attached_to_args[] = +{ + { PDB_IMAGE, + "image", + "the image" + } +}; + +ProcArg gimage_floating_sel_attached_to_out_args[] = +{ + { PDB_DRAWABLE, + "drawable", + "the drawable the floating selection is attached to" + } +}; + +ProcRecord gimage_floating_sel_attached_to_proc = +{ + "gimp_image_floating_sel_attached_to", + "Return the drawable the floating selection is attached to", + "This procedure returns the drawable the image's floating selection is attached to, if it exists. If it doesn't exist, -1 is returned as the drawable ID.", + "Wolfgang Hofer", + "Wolfgang Hofer", + "1998", + PDB_INTERNAL, + + /* Input arguments */ + 1, + gimage_floating_sel_attached_to_args, + + /* Output arguments */ + 1, + gimage_floating_sel_attached_to_out_args, + + /* Exec method */ + { { gimage_floating_sel_attached_to_invoker } }, +}; + + static GImage * duplicate (GImage *gimage) { diff --git a/app/gimage_cmds.h b/app/gimage_cmds.h index f42bf412d8..d5c4c9e093 100644 --- a/app/gimage_cmds.h +++ b/app/gimage_cmds.h @@ -70,6 +70,7 @@ extern ProcRecord gimage_enable_undo_proc; extern ProcRecord gimage_disable_undo_proc; extern ProcRecord gimage_clean_all_proc; extern ProcRecord gimage_floating_sel_proc; +extern ProcRecord gimage_floating_sel_attached_to_proc; extern ProcRecord channel_ops_duplicate_proc; extern ProcRecord gimp_image_add_hguide_proc; diff --git a/app/internal_procs.c b/app/internal_procs.c index 6901e651c7..31d27b0e43 100644 --- a/app/internal_procs.c +++ b/app/internal_procs.c @@ -80,7 +80,7 @@ internal_procs_init () { gfloat pcount = 0; /* grep -c procedural_db_register internal_procs.c */ - gfloat total_pcount = 256; + gfloat total_pcount = 257; app_init_update_status("Internal Procedures", "Tool procedures", pcount/total_pcount); @@ -186,6 +186,7 @@ internal_procs_init () procedural_db_register (&gimage_disable_undo_proc); pcount++; procedural_db_register (&gimage_clean_all_proc); pcount++; procedural_db_register (&gimage_floating_sel_proc); pcount++; + procedural_db_register (&gimage_floating_sel_attached_to_proc); pcount++; procedural_db_register (&gimp_image_add_hguide_proc); pcount++; procedural_db_register (&gimp_image_add_vguide_proc); pcount++; procedural_db_register (&gimp_image_delete_guide_proc); pcount++;