mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
plug-ins: fix many GimpImageProcedure to new run() API.
No logics change so far.
This commit is contained in:
parent
3f9c736592
commit
79e608694e
33 changed files with 715 additions and 101 deletions
|
@ -96,7 +96,8 @@ static GimpProcedure * align_layers_create_procedure (GimpPlugIn
|
|||
static GimpValueArray * align_layers_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -187,6 +188,10 @@ align_layers_create_procedure (GimpPlugIn *plug_in,
|
|||
align_layers_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Align Visi_ble Layers..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Image/Arrange");
|
||||
|
@ -226,7 +231,8 @@ static GimpValueArray *
|
|||
align_layers_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
|
|
@ -86,7 +86,8 @@ static GimpProcedure * optimize_create_procedure (GimpPlugIn *plug_in
|
|||
static GimpValueArray * optimize_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -168,6 +169,11 @@ optimize_create_procedure (GimpPlugIn *plug_in,
|
|||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
optimize_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Optimize (for _GIF)"));
|
||||
|
||||
gimp_procedure_set_documentation (procedure,
|
||||
|
@ -191,6 +197,11 @@ optimize_create_procedure (GimpPlugIn *plug_in,
|
|||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
optimize_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Optimize (Difference)"));
|
||||
|
||||
gimp_procedure_set_documentation (procedure,
|
||||
|
@ -211,6 +222,11 @@ optimize_create_procedure (GimpPlugIn *plug_in,
|
|||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
optimize_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Unoptimize"));
|
||||
|
||||
gimp_procedure_set_documentation (procedure,
|
||||
|
@ -228,6 +244,11 @@ optimize_create_procedure (GimpPlugIn *plug_in,
|
|||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
optimize_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Remove Backdrop"));
|
||||
|
||||
gimp_procedure_set_documentation (procedure,
|
||||
|
@ -244,6 +265,11 @@ optimize_create_procedure (GimpPlugIn *plug_in,
|
|||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
optimize_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Find Backdrop"));
|
||||
|
||||
gimp_procedure_set_documentation (procedure,
|
||||
|
@ -281,7 +307,8 @@ static GimpValueArray *
|
|||
optimize_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
|
|
@ -93,7 +93,8 @@ static GimpProcedure * play_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * play_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -242,6 +243,10 @@ play_create_procedure (GimpPlugIn *plug_in,
|
|||
play_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Playback..."));
|
||||
gimp_procedure_set_icon_name (procedure, "media-playback-start");
|
||||
|
@ -265,7 +270,8 @@ static GimpValueArray *
|
|||
play_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *_image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
|
|
@ -82,7 +82,8 @@ static GimpProcedure * blinds_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * blinds_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -149,6 +150,8 @@ blinds_create_procedure (GimpPlugIn *plug_in,
|
|||
blinds_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Blinds..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Distorts");
|
||||
|
@ -196,13 +199,33 @@ static GimpValueArray *
|
|||
blinds_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
case GIMP_RUN_INTERACTIVE:
|
||||
|
|
|
@ -57,7 +57,8 @@ static GimpProcedure * border_average_create_procedure (GimpPlugIn
|
|||
static GimpValueArray * border_average_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -130,6 +131,8 @@ border_average_create_procedure (GimpPlugIn *plug_in,
|
|||
border_average_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Border Average..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Colors/Info");
|
||||
|
@ -169,10 +172,12 @@ static GimpValueArray *
|
|||
border_average_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
GimpValueArray *return_vals = NULL;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
GimpRGB result_color = { 0.0, };
|
||||
|
@ -181,6 +186,23 @@ border_average_run (GimpProcedure *procedure,
|
|||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
buffer = gimp_drawable_get_buffer (drawable);
|
||||
|
||||
switch (run_mode)
|
||||
|
|
|
@ -66,7 +66,8 @@ static GimpProcedure * checkerboard_create_procedure (GimpPlugIn *plu
|
|||
static GimpValueArray * checkerboard_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -127,6 +128,8 @@ checkerboard_create_procedure (GimpPlugIn *plug_in,
|
|||
checkerboard_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure,
|
||||
N_("_Checkerboard (legacy)..."));
|
||||
|
@ -162,13 +165,33 @@ static GimpValueArray *
|
|||
checkerboard_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
case GIMP_RUN_INTERACTIVE:
|
||||
|
|
|
@ -338,7 +338,8 @@ static GimpProcedure * explorer_create_procedure (GimpPlugIn *plug_in
|
|||
static GimpValueArray * explorer_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -499,6 +500,8 @@ explorer_create_procedure (GimpPlugIn *plug_in,
|
|||
explorer_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("CML _Explorer..."));
|
||||
gimp_procedure_add_menu_path (procedure,
|
||||
|
@ -540,13 +543,29 @@ static GimpValueArray *
|
|||
explorer_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *_drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
INIT_I18N ();
|
||||
|
||||
drawable = _drawable;
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
|
|
|
@ -69,7 +69,8 @@ static GimpProcedure * remap_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * remap_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -124,6 +125,10 @@ remap_create_procedure (GimpPlugIn *plug_in,
|
|||
remap_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "INDEXED*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("R_earrange Colormap..."));
|
||||
gimp_procedure_set_icon_name (procedure, GIMP_ICON_COLORMAP);
|
||||
|
@ -160,6 +165,10 @@ remap_create_procedure (GimpPlugIn *plug_in,
|
|||
remap_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "INDEXED*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Swap Colors"));
|
||||
gimp_procedure_set_icon_name (procedure, GIMP_ICON_COLORMAP);
|
||||
|
@ -197,7 +206,8 @@ static GimpValueArray *
|
|||
remap_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
|
|
@ -94,7 +94,8 @@ static GimpProcedure * retinex_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * retinex_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -186,6 +187,8 @@ retinex_create_procedure (GimpPlugIn *plug_in,
|
|||
retinex_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Retine_x..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Colors/Tone Mapping");
|
||||
|
@ -239,15 +242,34 @@ static GimpValueArray *
|
|||
retinex_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
gint x, y, width, height;
|
||||
GimpDrawable *drawable;
|
||||
gint x, y, width, height;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
if (! gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height) ||
|
||||
width < MIN_GAUSSIAN_SCALE ||
|
||||
height < MIN_GAUSSIAN_SCALE)
|
||||
|
|
|
@ -55,7 +55,8 @@ static GimpProcedure * crop_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * crop_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -105,6 +106,8 @@ crop_create_procedure (GimpPlugIn *plug_in,
|
|||
crop_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Zealous Crop"));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Image/Crop");
|
||||
|
@ -127,15 +130,35 @@ static GimpValueArray *
|
|||
crop_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
gimp_progress_init (_("Zealous cropping"));
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
do_zcrop (drawable, image);
|
||||
|
||||
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
||||
|
|
|
@ -255,7 +255,8 @@ static GimpProcedure * bender_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * bender_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -422,6 +423,8 @@ bender_create_procedure (GimpPlugIn *plug_in,
|
|||
bender_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, PLUG_IN_IMAGE_TYPES);
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Curve Bend..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Distorts");
|
||||
|
@ -640,7 +643,8 @@ static GimpValueArray *
|
|||
bender_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
@ -648,6 +652,7 @@ bender_run (GimpProcedure *procedure,
|
|||
GimpValueArray *return_vals;
|
||||
BenderDialog *cd = NULL;
|
||||
GimpDrawable *active_drawable = NULL;
|
||||
GimpDrawable *drawable;
|
||||
GimpLayer *layer = NULL;
|
||||
GimpLayer *bent_layer = NULL;
|
||||
GError *error = NULL;
|
||||
|
@ -655,6 +660,23 @@ bender_run (GimpProcedure *procedure,
|
|||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_EXECUTION_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
env = g_getenv ("BEND_DEBUG");
|
||||
if (env != NULL)
|
||||
if ((*env != 'n') && (*env != 'N')) gb_debug = 1;
|
||||
|
|
|
@ -98,7 +98,8 @@ static GimpProcedure * decompose_create_procedure (GimpPlugIn *plug_i
|
|||
static GimpValueArray * decompose_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -273,6 +274,8 @@ decompose_create_procedure (GimpPlugIn *plug_in,
|
|||
decompose_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Decompose..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Colors/Components");
|
||||
|
@ -344,12 +347,14 @@ static GimpValueArray *
|
|||
decompose_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpProcedureConfig *config;
|
||||
GimpValueArray *return_vals;
|
||||
GimpDrawable *drawable;
|
||||
gint num_images;
|
||||
GimpImage *image_extract[MAX_EXTRACT_IMAGES];
|
||||
GimpLayer *layer_extract[MAX_EXTRACT_IMAGES];
|
||||
|
@ -362,6 +367,23 @@ decompose_run (GimpProcedure *procedure,
|
|||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
config = gimp_procedure_create_config (procedure);
|
||||
gimp_procedure_config_begin_run (config, NULL, run_mode, args);
|
||||
|
||||
|
|
|
@ -124,7 +124,8 @@ static GimpProcedure * merge_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * merge_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -209,6 +210,8 @@ merge_create_procedure (GimpPlugIn *plug_in,
|
|||
merge_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Depth Merge..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Combine");
|
||||
|
@ -284,15 +287,34 @@ static GimpValueArray *
|
|||
merge_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
DepthMerge dm;
|
||||
GimpDrawable *drawable;
|
||||
DepthMerge dm;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
DepthMerge_initParams (&dm);
|
||||
|
||||
switch (run_mode)
|
||||
|
|
|
@ -92,7 +92,8 @@ static GimpProcedure * despeckle_create_procedure (GimpPlugIn *plug_i
|
|||
static GimpValueArray * despeckle_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -171,6 +172,8 @@ despeckle_create_procedure (GimpPlugIn *plug_in,
|
|||
despeckle_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Des_peckle..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Enhance");
|
||||
|
@ -220,15 +223,34 @@ static GimpValueArray *
|
|||
despeckle_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpProcedureConfig *config;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
if (! gimp_drawable_is_rgb (drawable) &&
|
||||
! gimp_drawable_is_gray (drawable))
|
||||
{
|
||||
|
|
|
@ -72,7 +72,8 @@ static GimpProcedure * destripe_create_procedure (GimpPlugIn *plug_in
|
|||
static GimpValueArray * destripe_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -132,6 +133,8 @@ destripe_create_procedure (GimpPlugIn *plug_in,
|
|||
destripe_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Des_tripe..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Colors/Tone Mapping");
|
||||
|
@ -161,13 +164,33 @@ static GimpValueArray *
|
|||
destripe_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
case GIMP_RUN_INTERACTIVE:
|
||||
|
|
|
@ -99,7 +99,8 @@ static GimpProcedure * film_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * film_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -224,6 +225,10 @@ film_create_procedure (GimpPlugIn *plug_in,
|
|||
film_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Filmstrip..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Combine");
|
||||
|
@ -306,7 +311,8 @@ static GimpValueArray *
|
|||
film_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
|
|
@ -66,7 +66,8 @@ static GimpProcedure * map_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * map_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -123,6 +124,8 @@ map_create_procedure (GimpPlugIn *plug_in,
|
|||
NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Gradient Map"));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Colors/Map");
|
||||
|
@ -157,6 +160,8 @@ map_create_procedure (GimpPlugIn *plug_in,
|
|||
NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Palette Map"));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Colors/Map");
|
||||
|
@ -186,20 +191,39 @@ map_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
map_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
map_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
MapMode mode = GPOINTER_TO_INT (run_data);
|
||||
GeglBuffer *shadow_buffer;
|
||||
GeglBuffer *buffer;
|
||||
MapMode mode = GPOINTER_TO_INT (run_data);
|
||||
GeglBuffer *shadow_buffer;
|
||||
GeglBuffer *buffer;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
gimp_procedure_get_name (procedure));
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
shadow_buffer = gimp_drawable_get_shadow_buffer (drawable);
|
||||
buffer = gimp_drawable_get_buffer (drawable);
|
||||
|
||||
|
|
|
@ -96,7 +96,8 @@ static GimpProcedure * grid_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * grid_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -164,6 +165,8 @@ grid_create_procedure (GimpPlugIn *plug_in,
|
|||
grid_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Grid (legacy)..."));
|
||||
gimp_procedure_add_menu_path (procedure,
|
||||
|
@ -261,13 +264,33 @@ static GimpValueArray *
|
|||
grid_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
if (run_mode == GIMP_RUN_NONINTERACTIVE)
|
||||
{
|
||||
grid_cfg.hwidth = GIMP_VALUES_GET_INT (args, 0);
|
||||
|
|
|
@ -57,7 +57,8 @@ static GimpProcedure * guillotine_create_procedure (GimpPlugIn *plug_
|
|||
static GimpValueArray * guillotine_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GList * guillotine (GimpImage *image,
|
||||
|
@ -101,6 +102,10 @@ guillotine_create_procedure (GimpPlugIn *plug_in,
|
|||
guillotine_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Slice Using G_uides"));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Image/Crop");
|
||||
|
@ -138,7 +143,8 @@ static GimpValueArray *
|
|||
guillotine_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
|
|
@ -210,7 +210,8 @@ static GimpProcedure * jigsaw_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * jigsaw_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -392,6 +393,8 @@ jigsaw_create_procedure (GimpPlugIn *plug_in,
|
|||
jigsaw_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Jigsaw..."));
|
||||
gimp_procedure_add_menu_path (procedure,
|
||||
|
@ -445,13 +448,33 @@ static GimpValueArray *
|
|||
jigsaw_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
case GIMP_RUN_INTERACTIVE:
|
||||
|
|
|
@ -88,14 +88,16 @@ static GimpProcedure * mail_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * mail_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
static GimpPDBStatusType send_image (const gchar *filename,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint32 run_mode);
|
||||
static GimpPDBStatusType send_image (const gchar *filename,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
gint32 run_mode);
|
||||
|
||||
static gboolean send_dialog (void);
|
||||
static void mail_entry_callback (GtkWidget *widget,
|
||||
|
@ -192,6 +194,10 @@ mail_create_procedure (GimpPlugIn *plug_in,
|
|||
mail_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Send by E_mail..."));
|
||||
gimp_procedure_set_icon_name (procedure, GIMP_ICON_EDIT);
|
||||
|
@ -253,7 +259,8 @@ static GimpValueArray *
|
|||
mail_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
@ -306,7 +313,7 @@ mail_run (GimpProcedure *procedure,
|
|||
|
||||
status = send_image (mail_info.filename,
|
||||
image,
|
||||
drawable,
|
||||
n_drawables, drawables,
|
||||
run_mode);
|
||||
|
||||
if (status == GIMP_PDB_SUCCESS)
|
||||
|
@ -321,13 +328,13 @@ mail_run (GimpProcedure *procedure,
|
|||
}
|
||||
|
||||
static GimpPDBStatusType
|
||||
send_image (const gchar *filename,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint32 run_mode)
|
||||
send_image (const gchar *filename,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
gint32 run_mode)
|
||||
{
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
GimpItem **drawables;
|
||||
gchar *ext;
|
||||
GFile *tmpfile;
|
||||
gchar *tmpname;
|
||||
|
@ -353,18 +360,13 @@ send_image (const gchar *filename,
|
|||
tmpfile = gimp_temp_file (ext + 1);
|
||||
tmpname = g_file_get_path (tmpfile);
|
||||
|
||||
drawables = g_new (GimpItem *, 1);
|
||||
drawables[0] = (GimpItem *) drawable;
|
||||
if (! (gimp_file_save (run_mode,
|
||||
image, 1,
|
||||
if (! (gimp_file_save (run_mode, image, n_drawables,
|
||||
(const GimpItem **) drawables,
|
||||
tmpfile) &&
|
||||
valid_file (tmpfile)))
|
||||
{
|
||||
g_free (drawables);
|
||||
goto error;
|
||||
}
|
||||
g_free (drawables);
|
||||
|
||||
#ifndef SENDMAIL /* xdg-email */
|
||||
/* From xdg-email doc:
|
||||
|
|
|
@ -110,7 +110,8 @@ static GimpProcedure * qbist_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * qbist_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -176,6 +177,8 @@ qbist_create_procedure (GimpPlugIn *plug_in,
|
|||
qbist_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Qbist..."));
|
||||
gimp_procedure_add_menu_path (procedure,
|
||||
|
@ -203,7 +206,8 @@ static GimpValueArray *
|
|||
qbist_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
@ -211,13 +215,30 @@ qbist_run (GimpProcedure *procedure,
|
|||
gint img_height, img_width;
|
||||
GeglBuffer *buffer;
|
||||
GeglBufferIterator *iter;
|
||||
GimpDrawable *drawable;
|
||||
gint total_pixels;
|
||||
gint done_pixels;
|
||||
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
img_width = gimp_drawable_width (drawable);
|
||||
img_height = gimp_drawable_height (drawable);
|
||||
|
||||
|
|
|
@ -195,7 +195,8 @@ static GimpProcedure * colorize_create_procedure (GimpPlugIn *plug_in
|
|||
static GimpValueArray * colorize_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -321,6 +322,8 @@ colorize_create_procedure (GimpPlugIn *plug_in,
|
|||
colorize_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Sample Colorize..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Colors/Map");
|
||||
|
@ -408,15 +411,34 @@ static GimpValueArray *
|
|||
colorize_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
const gchar *env;
|
||||
const gchar *env;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
env = g_getenv ("SAMPLE_COLORIZE_DEBUG");
|
||||
if (env != NULL && (*env != 'n') && (*env != 'N'))
|
||||
g_Sdebug = TRUE;
|
||||
|
|
|
@ -60,7 +60,8 @@ static GimpProcedure * palette_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * palette_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -125,6 +126,8 @@ palette_create_procedure (GimpPlugIn *plug_in,
|
|||
palette_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Smoo_th Palette..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Colors/Info");
|
||||
|
@ -183,17 +186,36 @@ static GimpValueArray *
|
|||
palette_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *new_image;
|
||||
GimpLayer *new_layer;
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
case GIMP_RUN_INTERACTIVE:
|
||||
|
|
|
@ -94,7 +94,8 @@ static GimpProcedure * sparkle_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * sparkle_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -199,6 +200,8 @@ sparkle_create_procedure (GimpPlugIn *plug_in,
|
|||
sparkle_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Sparkle..."));
|
||||
gimp_procedure_add_menu_path (procedure,
|
||||
|
@ -305,15 +308,34 @@ static GimpValueArray *
|
|||
sparkle_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
gint x, y, w, h;
|
||||
GimpDrawable *drawable;
|
||||
gint x, y, w, h;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
if (! gimp_drawable_mask_intersect (drawable, &x, &y, &w, &h))
|
||||
{
|
||||
g_message (_("Region selected for filter is empty"));
|
||||
|
|
|
@ -283,7 +283,8 @@ static GimpProcedure * designer_create_procedure (GimpPlugIn *plug_in
|
|||
static GimpValueArray * designer_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -401,6 +402,8 @@ designer_create_procedure (GimpPlugIn *plug_in,
|
|||
designer_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Sphere _Designer..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Render");
|
||||
|
@ -3156,15 +3159,34 @@ static GimpValueArray *
|
|||
designer_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
gint x, y, w, h;
|
||||
GimpDrawable *drawable;
|
||||
gint x, y, w, h;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
if (! gimp_drawable_mask_intersect (drawable, &x, &y, &w, &h))
|
||||
{
|
||||
g_message (_("Region selected for plug-in is empty"));
|
||||
|
|
|
@ -109,7 +109,8 @@ static GimpProcedure * tile_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * tile_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -256,6 +257,8 @@ tile_create_procedure (GimpPlugIn *plug_in,
|
|||
tile_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Small Tiles..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Map");
|
||||
|
@ -284,16 +287,35 @@ static GimpValueArray *
|
|||
tile_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
gint pwidth;
|
||||
gint pheight;
|
||||
GimpDrawable *drawable;
|
||||
gint pwidth;
|
||||
gint pheight;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
has_alpha = gimp_drawable_has_alpha (drawable);
|
||||
|
||||
if (! gimp_drawable_mask_intersect (drawable,
|
||||
|
|
|
@ -88,7 +88,8 @@ static GimpProcedure * lic_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * lic_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static void lic_scale_entry_update (GimpLabelSpin *entry,
|
||||
|
@ -869,6 +870,8 @@ lic_create_procedure (GimpPlugIn *plug_in,
|
|||
lic_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Van Gogh (LIC)..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Artistic");
|
||||
|
@ -891,13 +894,33 @@ static GimpValueArray *
|
|||
lic_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
/* Set default values */
|
||||
/* ================== */
|
||||
|
||||
|
|
|
@ -132,7 +132,8 @@ static GimpProcedure * warp_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * warp_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -241,6 +242,8 @@ warp_create_procedure (GimpPlugIn *plug_in,
|
|||
warp_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*, GRAY*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Warp..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Map");
|
||||
|
@ -352,15 +355,34 @@ static GimpValueArray *
|
|||
warp_run (GimpProcedure *procedure,
|
||||
GimpRunMode _run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpRGB color;
|
||||
GimpDrawable *drawable;
|
||||
GimpRGB color;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
/* get currently selected foreground pixel color */
|
||||
gimp_context_get_foreground (&color);
|
||||
gimp_rgb_get_uchar (&color,
|
||||
|
|
|
@ -87,7 +87,8 @@ static GimpValueArray * dds_save (GimpProcedure *procedure,
|
|||
static GimpValueArray * dds_decode (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
#endif
|
||||
|
@ -307,6 +308,8 @@ dds_create_procedure (GimpPlugIn *plug_in,
|
|||
dds_decode, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGBA");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Decode YCoCg"));
|
||||
/* gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Colors"); */
|
||||
|
@ -327,6 +330,8 @@ dds_create_procedure (GimpPlugIn *plug_in,
|
|||
dds_decode, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGBA");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Decode YCoCg (scaled)"));
|
||||
/* gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Colors"); */
|
||||
|
@ -349,6 +354,8 @@ dds_create_procedure (GimpPlugIn *plug_in,
|
|||
dds_decode, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGBA");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("Decode Alpha exponent"));
|
||||
/* gimp_procedure_add_menu_path (procedure, "<Image>/Filters/Colors"); */
|
||||
|
@ -488,11 +495,30 @@ static GimpValueArray *
|
|||
dds_decode (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
const gchar *name = gimp_procedure_get_name (procedure);
|
||||
const gchar *name = gimp_procedure_get_name (procedure);
|
||||
GimpDrawable *drawable,
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
name);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_EXECUTION_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
if (! strcmp (name, DECODE_YCOCG_PROC))
|
||||
{
|
||||
|
|
|
@ -86,7 +86,8 @@ static GimpProcedure * flame_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * flame_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -166,6 +167,8 @@ flame_create_procedure (GimpPlugIn *plug_in,
|
|||
flame_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "RGB*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Flame..."));
|
||||
gimp_procedure_add_menu_path (procedure,
|
||||
|
@ -219,13 +222,33 @@ static GimpValueArray *
|
|||
flame_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
|
||||
INIT_I18N ();
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
if (n_drawables != 1)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_set_error (&error, GIMP_PLUG_IN_ERROR, 0,
|
||||
_("Procedure '%s' only works with one drawable."),
|
||||
PLUG_IN_PROC);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_CALLING_ERROR,
|
||||
error);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable = drawables[0];
|
||||
}
|
||||
|
||||
if (run_mode == GIMP_RUN_NONINTERACTIVE)
|
||||
{
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
|
|
|
@ -70,7 +70,8 @@ static GimpProcedure * print_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * print_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -156,6 +157,10 @@ print_create_procedure (GimpPlugIn *plug_in,
|
|||
print_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Print..."));
|
||||
gimp_procedure_set_icon_name (procedure, GIMP_ICON_DOCUMENT_PRINT);
|
||||
|
@ -206,7 +211,8 @@ static GimpValueArray *
|
|||
print_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
|
|
@ -153,7 +153,8 @@ static GimpProcedure * twain_create_procedure (GimpPlugIn *plug_in,
|
|||
static GimpValueArray * twain_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
|
@ -194,6 +195,11 @@ twain_create_procedure (GimpPlugIn *plug_in,
|
|||
twain_run, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_image_types (procedure, "*");
|
||||
gimp_procedure_set_sensitivity_mask (procedure,
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLE |
|
||||
GIMP_PROCEDURE_SENSITIVE_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_DRAWABLES |
|
||||
GIMP_PROCEDURE_SENSITIVE_NO_IMAGE);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, N_("_Scanner/Camera..."));
|
||||
gimp_procedure_add_menu_path (procedure, "<Image>/File/Create/Acquire");
|
||||
|
@ -380,7 +386,8 @@ static GimpValueArray *
|
|||
twain_run (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue