Export floating-selection functions to the PDB (needed for the XJT-plug-in

by Wolfgang Hofer).


--Sven
This commit is contained in:
Sven Neumann 1998-11-15 18:41:53 +00:00
parent 63e3d52df8
commit 00873eadcc
4 changed files with 230 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Sun Nov 15 19:36:02 MET 1998 Sven Neumann <sven@gimp.org>
* app/floating_sel_cmds.[ch]
* app/internal_procs.c: export floating-selection functions
to the PDB (needed for the XJT-plug-in by Wolfgang Hofer)
Sun Nov 15 17:54:18 MET 1998 Sven Neumann <sven@gimp.org>
* plugins/script-fu/scripts/waves-anim.scm: cosmetic fix
@ -9,7 +15,7 @@ Sun Nov 15 17:54:18 MET 1998 Sven Neumann <sven@gimp.org>
* app/gimpimage.[ch]
* layer_cmds.[ch]
* layers_dialog.c: first set of changes to integrate GAP
(Gimp Animation Plugin written by Michael Hofer)
(Gimp Animation Plugin written by Wolfgang Hofer)
new functions: gimp_layer_[get|set]_linked
gimp_image_raise_layer_to_top
gimp_image_lower_layer_to_bottom

View File

@ -202,3 +202,219 @@ ProcRecord floating_sel_to_layer_proc =
/* Exec method */
{ { floating_sel_to_layer_invoker } },
};
/**************************/
/* FLOATING_SEL_ATTACH */
static Argument *
floating_sel_attach_invoker (Argument *args)
{
Layer *layer;
GimpDrawable *drawable;
success = TRUE;
if (success)
{
int_value = args[0].value.pdb_int;
if ((layer = layer_get_ID (int_value)) == NULL)
success = FALSE;
}
if (success)
{
int_value = args[1].value.pdb_int;
if ((drawable = drawable_get_ID (int_value)) == NULL)
success = FALSE;
}
if (success)
floating_sel_attach (layer, drawable);
return procedural_db_return_args (&floating_sel_attach_proc, success);
}
/* The procedure definition */
ProcArg floating_sel_attach_args[] =
{
{ PDB_LAYER,
"layer",
N_("the layer (is attached as floating selection)")
},
{ PDB_DRAWABLE,
"drawable",
N_("the drawable (where to attach the floating selection)")
}
};
ProcRecord floating_sel_attach_proc =
{
"gimp_floating_sel_attach",
N_("Attach the specified layer as floating to the specified drawable"),
"This procedure attaches the layer as floating selection to the drawable.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
PDB_INTERNAL,
/* Input arguments */
2,
floating_sel_attach_args,
/* Output arguments */
0,
NULL,
/* Exec method */
{ { floating_sel_attach_invoker } },
};
/************************/
/* FLOATING_SEL_RIGOR */
static Argument *
floating_sel_rigor_invoker (Argument *args)
{
Layer *floating_sel;
int undo;
success = TRUE;
if (success)
{
int_value = args[0].value.pdb_int;
if ((floating_sel = layer_get_ID (int_value)) == NULL)
success = FALSE;
}
if (success)
{
int_value = args[1].value.pdb_int;
undo = int_value;
}
/* Make sure it's a floating selection */
if (success)
if (! layer_is_floating_sel (floating_sel))
success = FALSE;
if (success)
floating_sel_rigor (floating_sel, undo);
return procedural_db_return_args (&floating_sel_rigor_proc, success);
}
/* The procedure definition */
ProcArg floating_sel_rigor_args[] =
{
{ PDB_LAYER,
"floating_sel",
N_("the floating selection")
},
{ PDB_INT32,
"undo",
N_("TRUE or FALSE")
}
};
ProcRecord floating_sel_rigor_proc =
{
"gimp_floating_sel_rigor",
N_("Rigor the floating selection"),
"This procedure rigors the floating selection.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
PDB_INTERNAL,
/* Input arguments */
2,
floating_sel_rigor_args,
/* Output arguments */
0,
NULL,
/* Exec method */
{ { floating_sel_rigor_invoker } },
};
/***********************/
/* floating_sel_relax */
static Argument *
floating_sel_relax_invoker (Argument *args)
{
Layer *floating_sel;
int undo;
success = TRUE;
if (success)
{
int_value = args[0].value.pdb_int;
if ((floating_sel = layer_get_ID (int_value)) == NULL)
success = FALSE;
}
if (success)
{
int_value = args[1].value.pdb_int;
undo = int_value;
}
/* Make sure it's a floating selection */
if (success)
if (! layer_is_floating_sel (floating_sel))
success = FALSE;
if (success)
floating_sel_relax (floating_sel, undo);
return procedural_db_return_args (&floating_sel_relax_proc, success);
}
/* The procedure definition */
ProcArg floating_sel_relax_args[] =
{
{ PDB_LAYER,
"floating_sel",
N_("the floating selection")
},
{ PDB_INT32,
"undo",
N_("TRUE or FALSE")
}
};
ProcRecord floating_sel_relax_proc =
{
"gimp_floating_sel_relax",
N_("Relax the floating selection"),
"This procedure relaxes the floating selection.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
PDB_INTERNAL,
/* Input arguments */
2,
floating_sel_relax_args,
/* Output arguments */
0,
NULL,
/* Exec method */
{ { floating_sel_relax_invoker } },
};

View File

@ -23,5 +23,8 @@
extern ProcRecord floating_sel_remove_proc;
extern ProcRecord floating_sel_anchor_proc;
extern ProcRecord floating_sel_to_layer_proc;
extern ProcRecord floating_sel_attach_proc;
extern ProcRecord floating_sel_rigor_proc;
extern ProcRecord floating_sel_relax_proc;
#endif /* __FLOATING_SEL_CMDS_H__ */

View File

@ -80,7 +80,7 @@ internal_procs_init ()
{
gfloat pcount = 0;
/* grep -c procedural_db_register internal_procs.c */
gfloat total_pcount = 253;
gfloat total_pcount = 256;
app_init_update_status("Internal Procedures", "Tool procedures",
pcount/total_pcount);
@ -309,6 +309,9 @@ internal_procs_init ()
procedural_db_register (&floating_sel_remove_proc); pcount++;
procedural_db_register (&floating_sel_anchor_proc); pcount++;
procedural_db_register (&floating_sel_to_layer_proc); pcount++;
procedural_db_register (&floating_sel_attach_proc); pcount++;
procedural_db_register (&floating_sel_rigor_proc); pcount++;
procedural_db_register (&floating_sel_relax_proc); pcount++;
app_init_update_status(NULL, "Undo",
pcount/total_pcount);