#include <libgimp/gimp.h>
/* Local function prototypes */
static void query (void);
static void run (
const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
query, /* query_proc */
run, /* run_proc */
};
MAIN ()
static void query (void)
{
static GimpParamDef args[] = {
{ GIMP_PDB_INT32, "run-mode", "Run mode" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
gimp_install_procedure (
"plug-in-hello",
"Hello, world!",
"Displays \"Hello, world!\" in a dialog",
"David Neary",
"Copyright David Neary",
"2004",
"_Hello world...",
//"RGB*, GRAY*",
"RGB*, GRAY*, INDEXED*",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
args, NULL);
//gimp_plugin_menu_register ("plug-in-hello", "/Filters/Misc");
gimp_plugin_menu_register ("plug-in-hello", "<Image>/Filters/Misc/");
}
static void run (
const gchar *name,
gint n_params,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
GimpDrawable *drawable;
/* Setting mandatory output values */
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
/* Getting run_mode - we won't display a dialog if we are in NONINTERACTIVE mode */
run_mode = param[0].data.d_int32;
if (run_mode != GIMP_RUN_NONINTERACTIVE)
g_message("Hello, world!\n");
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_progress_init ("Modification de l'image...");
/* appel d'une fonction qui contient le code qui va modifier l'image */
modification (drawable);
gimp_displays_flush ();
gimp_drawable_detach (drawable);
}
|