mirror of https://github.com/GNOME/gimp.git
made it a GObject. Removed member "static_proc". Renamed
2006-04-04 Michael Natterer <mitch@gimp.org> * app/pdb/gimpprocedure.[ch]: made it a GObject. Removed member "static_proc". Renamed gimp_procedure_init() to gimp_procedure_initialize(). * app/pdb/gimp-pdb.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-proc-def.c * app/plug-in/plug-in-rc.c * app/xcf/xcf.c: changed accordingly. * tools/pdbgen/app.pl: register all internal procs dynamically. The static proc structs are gone. * tools/pdbgen/pdb/fileops.pdb: cosmetic change. * app/pdb/*_cmds.c: regenerated.
This commit is contained in:
parent
ef505d9706
commit
ee0ebc0915
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
|||
2006-04-04 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/pdb/gimpprocedure.[ch]: made it a GObject. Removed member
|
||||
"static_proc". Renamed gimp_procedure_init() to
|
||||
gimp_procedure_initialize().
|
||||
|
||||
* app/pdb/gimp-pdb.c
|
||||
* app/plug-in/plug-in-message.c
|
||||
* app/plug-in/plug-in-proc-def.c
|
||||
* app/plug-in/plug-in-rc.c
|
||||
* app/xcf/xcf.c: changed accordingly.
|
||||
|
||||
* tools/pdbgen/app.pl: register all internal procs
|
||||
dynamically. The static proc structs are gone.
|
||||
|
||||
* tools/pdbgen/pdb/fileops.pdb: cosmetic change.
|
||||
|
||||
* app/pdb/*_cmds.c: regenerated.
|
||||
|
||||
2006-04-04 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/pdb/Makefile.am
|
||||
|
|
1686
app/pdb/brush_cmds.c
1686
app/pdb/brush_cmds.c
File diff suppressed because it is too large
Load Diff
|
@ -31,9 +31,104 @@
|
|||
#include "core/gimp.h"
|
||||
#include "core/gimpdatafactory.h"
|
||||
|
||||
static GimpProcedure brushes_popup_proc;
|
||||
static GimpProcedure brushes_close_popup_proc;
|
||||
static GimpProcedure brushes_set_popup_proc;
|
||||
|
||||
static GValueArray *
|
||||
brushes_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *brush_callback;
|
||||
const gchar *popup_title;
|
||||
const gchar *initial_brush;
|
||||
gdouble opacity;
|
||||
gint32 spacing;
|
||||
gint32 paint_mode;
|
||||
|
||||
brush_callback = g_value_get_string (&args->values[0]);
|
||||
popup_title = g_value_get_string (&args->values[1]);
|
||||
initial_brush = g_value_get_string (&args->values[2]);
|
||||
opacity = g_value_get_double (&args->values[3]);
|
||||
spacing = g_value_get_int (&args->values[4]);
|
||||
paint_mode = g_value_get_enum (&args->values[5]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->no_interface ||
|
||||
! gimp_pdb_lookup (gimp, brush_callback) ||
|
||||
! gimp_pdb_dialog_new (gimp, context, gimp->brush_factory->container,
|
||||
popup_title, brush_callback, initial_brush,
|
||||
"opacity", opacity / 100.0,
|
||||
"paint-mode", paint_mode,
|
||||
"spacing", spacing,
|
||||
NULL))
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
brushes_close_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *brush_callback;
|
||||
|
||||
brush_callback = g_value_get_string (&args->values[0]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->no_interface ||
|
||||
! gimp_pdb_lookup (gimp, brush_callback) ||
|
||||
! gimp_pdb_dialog_close (gimp, gimp->brush_factory->container,
|
||||
brush_callback))
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
brushes_set_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *brush_callback;
|
||||
const gchar *brush_name;
|
||||
gdouble opacity;
|
||||
gint32 spacing;
|
||||
gint32 paint_mode;
|
||||
|
||||
brush_callback = g_value_get_string (&args->values[0]);
|
||||
brush_name = g_value_get_string (&args->values[1]);
|
||||
opacity = g_value_get_double (&args->values[2]);
|
||||
spacing = g_value_get_int (&args->values[3]);
|
||||
paint_mode = g_value_get_enum (&args->values[4]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->no_interface ||
|
||||
! gimp_pdb_lookup (gimp, brush_callback) ||
|
||||
! gimp_pdb_dialog_set (gimp, gimp->brush_factory->container,
|
||||
brush_callback, brush_name,
|
||||
"opacity", opacity / 100.0,
|
||||
"paint-mode", paint_mode,
|
||||
"spacing", spacing,
|
||||
NULL))
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
void
|
||||
register_brush_select_procs (Gimp *gimp)
|
||||
|
@ -41,9 +136,21 @@ register_brush_select_procs (Gimp *gimp)
|
|||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* brushes_popup
|
||||
* gimp-brushes-popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&brushes_popup_proc, 6, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 6, 0,
|
||||
brushes_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-popup",
|
||||
"gimp-brushes-popup",
|
||||
"Invokes the Gimp brush selection.",
|
||||
"This procedure popups the brush selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("brush-callback",
|
||||
"brush callback",
|
||||
|
@ -87,9 +194,21 @@ register_brush_select_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* brushes_close_popup
|
||||
* gimp-brushes-close-popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&brushes_close_popup_proc, 1, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
brushes_close_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-close-popup",
|
||||
"gimp-brushes-close-popup",
|
||||
"Popdown the Gimp brush selection.",
|
||||
"This procedure closes an opened brush selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("brush-callback",
|
||||
"brush callback",
|
||||
|
@ -100,9 +219,21 @@ register_brush_select_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* brushes_set_popup
|
||||
* gimp-brushes-set-popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&brushes_set_popup_proc, 5, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 5, 0,
|
||||
brushes_set_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-set-popup",
|
||||
"gimp-brushes-set-popup",
|
||||
"Sets the current brush selection in a popup.",
|
||||
"Sets the current brush selection in a popup.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("brush-callback",
|
||||
"brush callback",
|
||||
|
@ -139,149 +270,3 @@ register_brush_select_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
brushes_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *brush_callback;
|
||||
const gchar *popup_title;
|
||||
const gchar *initial_brush;
|
||||
gdouble opacity;
|
||||
gint32 spacing;
|
||||
gint32 paint_mode;
|
||||
|
||||
brush_callback = g_value_get_string (&args->values[0]);
|
||||
popup_title = g_value_get_string (&args->values[1]);
|
||||
initial_brush = g_value_get_string (&args->values[2]);
|
||||
opacity = g_value_get_double (&args->values[3]);
|
||||
spacing = g_value_get_int (&args->values[4]);
|
||||
paint_mode = g_value_get_enum (&args->values[5]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->no_interface ||
|
||||
! gimp_pdb_lookup (gimp, brush_callback) ||
|
||||
! gimp_pdb_dialog_new (gimp, context, gimp->brush_factory->container,
|
||||
popup_title, brush_callback, initial_brush,
|
||||
"opacity", opacity / 100.0,
|
||||
"paint-mode", paint_mode,
|
||||
"spacing", spacing,
|
||||
NULL))
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure brushes_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-brushes-popup",
|
||||
"gimp-brushes-popup",
|
||||
"Invokes the Gimp brush selection.",
|
||||
"This procedure popups the brush selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { brushes_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
brushes_close_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *brush_callback;
|
||||
|
||||
brush_callback = g_value_get_string (&args->values[0]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->no_interface ||
|
||||
! gimp_pdb_lookup (gimp, brush_callback) ||
|
||||
! gimp_pdb_dialog_close (gimp, gimp->brush_factory->container,
|
||||
brush_callback))
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure brushes_close_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-brushes-close-popup",
|
||||
"gimp-brushes-close-popup",
|
||||
"Popdown the Gimp brush selection.",
|
||||
"This procedure closes an opened brush selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { brushes_close_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
brushes_set_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *brush_callback;
|
||||
const gchar *brush_name;
|
||||
gdouble opacity;
|
||||
gint32 spacing;
|
||||
gint32 paint_mode;
|
||||
|
||||
brush_callback = g_value_get_string (&args->values[0]);
|
||||
brush_name = g_value_get_string (&args->values[1]);
|
||||
opacity = g_value_get_double (&args->values[2]);
|
||||
spacing = g_value_get_int (&args->values[3]);
|
||||
paint_mode = g_value_get_enum (&args->values[4]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->no_interface ||
|
||||
! gimp_pdb_lookup (gimp, brush_callback) ||
|
||||
! gimp_pdb_dialog_set (gimp, gimp->brush_factory->container,
|
||||
brush_callback, brush_name,
|
||||
"opacity", opacity / 100.0,
|
||||
"paint-mode", paint_mode,
|
||||
"spacing", spacing,
|
||||
NULL))
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure brushes_set_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-brushes-set-popup",
|
||||
"gimp-brushes-set-popup",
|
||||
"Sets the current brush selection in a popup.",
|
||||
"Sets the current brush selection in a popup.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { brushes_set_popup_invoker } }
|
||||
};
|
||||
|
|
|
@ -37,166 +37,6 @@
|
|||
#include "core/gimpdatafactory.h"
|
||||
#include "core/gimplist.h"
|
||||
|
||||
static GimpProcedure brushes_refresh_proc;
|
||||
static GimpProcedure brushes_get_list_proc;
|
||||
static GimpProcedure brushes_get_brush_proc;
|
||||
static GimpProcedure brushes_get_spacing_proc;
|
||||
static GimpProcedure brushes_set_spacing_proc;
|
||||
static GimpProcedure brushes_get_brush_data_proc;
|
||||
|
||||
void
|
||||
register_brushes_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* brushes_refresh
|
||||
*/
|
||||
procedure = gimp_procedure_init (&brushes_refresh_proc, 0, 0);
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* brushes_get_list
|
||||
*/
|
||||
procedure = gimp_procedure_init (&brushes_get_list_proc, 1, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-brushes",
|
||||
"num brushes",
|
||||
"The number of brushes in the brush list",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("brush-list",
|
||||
"brush list",
|
||||
"The list of brush names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* brushes_get_brush
|
||||
*/
|
||||
procedure = gimp_procedure_init (&brushes_get_brush_proc, 0, 4);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The brush name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The brush width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The brush height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing (0 <= spacing <= 1000)",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* brushes_get_spacing
|
||||
*/
|
||||
procedure = gimp_procedure_init (&brushes_get_spacing_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing (0 <= spacing <= 1000)",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* brushes_set_spacing
|
||||
*/
|
||||
procedure = gimp_procedure_init (&brushes_set_spacing_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing (0 <= spacing <= 1000)",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* brushes_get_brush_data
|
||||
*/
|
||||
procedure = gimp_procedure_init (&brushes_get_brush_data_proc, 1, 8);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The brush name (\"\" means current active brush)",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The brush name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("opacity",
|
||||
"opacity",
|
||||
"The brush opacity (0 <= opacity <= 100)",
|
||||
0, 100, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing (0 <= spacing <= 1000)",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("paint-mode",
|
||||
"paint mode",
|
||||
"The paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }",
|
||||
GIMP_TYPE_LAYER_MODE_EFFECTS,
|
||||
GIMP_NORMAL_MODE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The brush width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The brush height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("length",
|
||||
"length",
|
||||
"Length of brush mask data",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("mask-data",
|
||||
"mask data",
|
||||
"The brush mask data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
brushes_refresh_invoker (GimpProcedure *procedure,
|
||||
|
@ -209,22 +49,6 @@ brushes_refresh_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, TRUE);
|
||||
}
|
||||
|
||||
static GimpProcedure brushes_refresh_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-brushes-refresh",
|
||||
"gimp-brushes-refresh",
|
||||
"Refresh current brushes. This function always succeeds.",
|
||||
"This procedure retrieves all brushes currently in the user's brush path and updates the brush dialogs accordingly.",
|
||||
"Seth Burgess",
|
||||
"Seth Burgess",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { brushes_refresh_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
brushes_get_list_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -257,22 +81,6 @@ brushes_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure brushes_get_list_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-brushes-get-list",
|
||||
"gimp-brushes-get-list",
|
||||
"Retrieve a complete listing of the available brushes.",
|
||||
"This procedure returns a complete listing of available GIMP brushes. Each name returned can be used as input to the 'gimp-context-set-brush' procedure.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { brushes_get_list_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
brushes_get_brush_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -312,22 +120,6 @@ brushes_get_brush_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure brushes_get_brush_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-brushes-get-brush",
|
||||
"gimp-brushes-get-brush",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-brush' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-brush' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-context-get-brush",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { brushes_get_brush_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
brushes_get_spacing_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -354,22 +146,6 @@ brushes_get_spacing_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure brushes_get_spacing_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-brushes-get-spacing",
|
||||
"gimp-brushes-get-spacing",
|
||||
"This procedure is deprecated! Use 'gimp-brush-get-spacing' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-brush-get-spacing' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-brush-get-spacing",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { brushes_get_spacing_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
brushes_set_spacing_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -390,22 +166,6 @@ brushes_set_spacing_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure brushes_set_spacing_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-brushes-set-spacing",
|
||||
"gimp-brushes-set-spacing",
|
||||
"This procedure is deprecated! Use 'gimp-brush-set-spacing' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-brush-set-spacing' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-brush-set-spacing",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { brushes_set_spacing_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
brushes_get_brush_data_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -473,18 +233,228 @@ brushes_get_brush_data_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure brushes_get_brush_data_proc =
|
||||
void
|
||||
register_brushes_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-brushes-get-brush-data",
|
||||
"gimp-brushes-get-brush-data",
|
||||
"This procedure is deprecated! Use 'gimp-brush-get-pixels' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-brush-get-pixels' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-brush-get-pixels",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { brushes_get_brush_data_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-brushes-refresh
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 0,
|
||||
brushes_refresh_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-refresh",
|
||||
"gimp-brushes-refresh",
|
||||
"Refresh current brushes. This function always succeeds.",
|
||||
"This procedure retrieves all brushes currently in the user's brush path and updates the brush dialogs accordingly.",
|
||||
"Seth Burgess",
|
||||
"Seth Burgess",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-brushes-get-list
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 2,
|
||||
brushes_get_list_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-get-list",
|
||||
"gimp-brushes-get-list",
|
||||
"Retrieve a complete listing of the available brushes.",
|
||||
"This procedure returns a complete listing of available GIMP brushes. Each name returned can be used as input to the 'gimp-context-set-brush' procedure.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-brushes",
|
||||
"num brushes",
|
||||
"The number of brushes in the brush list",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("brush-list",
|
||||
"brush list",
|
||||
"The list of brush names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-brushes-get-brush
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 4,
|
||||
brushes_get_brush_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-get-brush",
|
||||
"gimp-brushes-get-brush",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-brush' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-brush' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-context-get-brush");
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The brush name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The brush width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The brush height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing (0 <= spacing <= 1000)",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-brushes-get-spacing
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
brushes_get_spacing_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-get-spacing",
|
||||
"gimp-brushes-get-spacing",
|
||||
"This procedure is deprecated! Use 'gimp-brush-get-spacing' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-brush-get-spacing' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-brush-get-spacing");
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing (0 <= spacing <= 1000)",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-brushes-set-spacing
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
brushes_set_spacing_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-set-spacing",
|
||||
"gimp-brushes-set-spacing",
|
||||
"This procedure is deprecated! Use 'gimp-brush-set-spacing' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-brush-set-spacing' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-brush-set-spacing");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing (0 <= spacing <= 1000)",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-brushes-get-brush-data
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 8,
|
||||
brushes_get_brush_data_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-brushes-get-brush-data",
|
||||
"gimp-brushes-get-brush-data",
|
||||
"This procedure is deprecated! Use 'gimp-brush-get-pixels' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-brush-get-pixels' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-brush-get-pixels");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The brush name (\"\" means current active brush)",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The brush name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("opacity",
|
||||
"opacity",
|
||||
"The brush opacity (0 <= opacity <= 100)",
|
||||
0, 100, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("spacing",
|
||||
"spacing",
|
||||
"The brush spacing (0 <= spacing <= 1000)",
|
||||
0, 1000, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("paint-mode",
|
||||
"paint mode",
|
||||
"The paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }",
|
||||
GIMP_TYPE_LAYER_MODE_EFFECTS,
|
||||
GIMP_NORMAL_MODE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The brush width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The brush height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("length",
|
||||
"length",
|
||||
"Length of brush mask data",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("mask-data",
|
||||
"mask data",
|
||||
"The brush mask data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -35,161 +35,6 @@
|
|||
#include "core/gimpcontainer.h"
|
||||
#include "gimp-intl.h"
|
||||
|
||||
static GimpProcedure buffers_get_list_proc;
|
||||
static GimpProcedure buffer_rename_proc;
|
||||
static GimpProcedure buffer_delete_proc;
|
||||
static GimpProcedure buffer_get_width_proc;
|
||||
static GimpProcedure buffer_get_height_proc;
|
||||
static GimpProcedure buffer_get_bytes_proc;
|
||||
static GimpProcedure buffer_get_image_type_proc;
|
||||
|
||||
void
|
||||
register_buffer_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* buffers_get_list
|
||||
*/
|
||||
procedure = gimp_procedure_init (&buffers_get_list_proc, 1, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-buffers",
|
||||
"num buffers",
|
||||
"The number of buffers",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("buffer-list",
|
||||
"buffer list",
|
||||
"The list of buffer names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* buffer_rename
|
||||
*/
|
||||
procedure = gimp_procedure_init (&buffer_rename_proc, 2, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("new-name",
|
||||
"new name",
|
||||
"The buffer's new name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("real-name",
|
||||
"real name",
|
||||
"The real name given to the buffer",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* buffer_delete
|
||||
*/
|
||||
procedure = gimp_procedure_init (&buffer_delete_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* buffer_get_width
|
||||
*/
|
||||
procedure = gimp_procedure_init (&buffer_get_width_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The buffer width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* buffer_get_height
|
||||
*/
|
||||
procedure = gimp_procedure_init (&buffer_get_height_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The buffer height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* buffer_get_bytes
|
||||
*/
|
||||
procedure = gimp_procedure_init (&buffer_get_bytes_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bytes",
|
||||
"bytes",
|
||||
"The buffer bpp",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* buffer_get_image_type
|
||||
*/
|
||||
procedure = gimp_procedure_init (&buffer_get_image_type_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("image-type",
|
||||
"image type",
|
||||
"The buffer image type: { GIMP_RGB (0), GIMP_GRAY (1), GIMP_INDEXED (2) }",
|
||||
GIMP_TYPE_IMAGE_BASE_TYPE,
|
||||
GIMP_RGB,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
buffers_get_list_invoker (GimpProcedure *procedure,
|
||||
|
@ -223,22 +68,6 @@ buffers_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure buffers_get_list_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-buffers-get-list",
|
||||
"gimp-buffers-get-list",
|
||||
"Retrieve a complete listing of the available buffers.",
|
||||
"This procedure returns a complete listing of available named buffers.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { buffers_get_list_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
buffer_rename_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -277,22 +106,6 @@ buffer_rename_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure buffer_rename_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-buffer-rename",
|
||||
"gimp-buffer-rename",
|
||||
"Renames a named buffer.",
|
||||
"This procedure renames a named buffer.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { buffer_rename_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
buffer_delete_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -319,22 +132,6 @@ buffer_delete_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure buffer_delete_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-buffer-delete",
|
||||
"gimp-buffer-delete",
|
||||
"Deletes a named buffer.",
|
||||
"This procedure deletes a named buffer.",
|
||||
"David Gowers <neota@softhome.net>",
|
||||
"David Gowers <neota@softhome.net>",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { buffer_delete_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
buffer_get_width_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -368,22 +165,6 @@ buffer_get_width_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure buffer_get_width_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-buffer-get-width",
|
||||
"gimp-buffer-get-width",
|
||||
"Retrieves the specified buffer's width.",
|
||||
"This procedure retrieves the specified named buffer's width.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { buffer_get_width_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
buffer_get_height_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -417,22 +198,6 @@ buffer_get_height_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure buffer_get_height_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-buffer-get-height",
|
||||
"gimp-buffer-get-height",
|
||||
"Retrieves the specified buffer's height.",
|
||||
"This procedure retrieves the specified named buffer's height.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { buffer_get_height_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
buffer_get_bytes_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -466,22 +231,6 @@ buffer_get_bytes_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure buffer_get_bytes_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-buffer-get-bytes",
|
||||
"gimp-buffer-get-bytes",
|
||||
"Retrieves the specified buffer's bytes.",
|
||||
"This procedure retrieves the specified named buffer's bytes.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { buffer_get_bytes_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
buffer_get_image_type_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -515,18 +264,234 @@ buffer_get_image_type_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure buffer_get_image_type_proc =
|
||||
void
|
||||
register_buffer_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-buffer-get-image-type",
|
||||
"gimp-buffer-get-image-type",
|
||||
"Retrieves the specified buffer's image type.",
|
||||
"This procedure retrieves the specified named buffer's image type.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { buffer_get_image_type_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-buffers-get-list
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 2,
|
||||
buffers_get_list_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-buffers-get-list",
|
||||
"gimp-buffers-get-list",
|
||||
"Retrieve a complete listing of the available buffers.",
|
||||
"This procedure returns a complete listing of available named buffers.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-buffers",
|
||||
"num buffers",
|
||||
"The number of buffers",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("buffer-list",
|
||||
"buffer list",
|
||||
"The list of buffer names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-buffer-rename
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 1,
|
||||
buffer_rename_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-buffer-rename",
|
||||
"gimp-buffer-rename",
|
||||
"Renames a named buffer.",
|
||||
"This procedure renames a named buffer.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("new-name",
|
||||
"new name",
|
||||
"The buffer's new name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("real-name",
|
||||
"real name",
|
||||
"The real name given to the buffer",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-buffer-delete
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
buffer_delete_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-buffer-delete",
|
||||
"gimp-buffer-delete",
|
||||
"Deletes a named buffer.",
|
||||
"This procedure deletes a named buffer.",
|
||||
"David Gowers <neota@softhome.net>",
|
||||
"David Gowers <neota@softhome.net>",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-buffer-get-width
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
buffer_get_width_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-buffer-get-width",
|
||||
"gimp-buffer-get-width",
|
||||
"Retrieves the specified buffer's width.",
|
||||
"This procedure retrieves the specified named buffer's width.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The buffer width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-buffer-get-height
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
buffer_get_height_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-buffer-get-height",
|
||||
"gimp-buffer-get-height",
|
||||
"Retrieves the specified buffer's height.",
|
||||
"This procedure retrieves the specified named buffer's height.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The buffer height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-buffer-get-bytes
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
buffer_get_bytes_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-buffer-get-bytes",
|
||||
"gimp-buffer-get-bytes",
|
||||
"Retrieves the specified buffer's bytes.",
|
||||
"This procedure retrieves the specified named buffer's bytes.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bytes",
|
||||
"bytes",
|
||||
"The buffer bpp",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-buffer-get-image-type
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
buffer_get_image_type_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-buffer-get-image-type",
|
||||
"gimp-buffer-get-image-type",
|
||||
"Retrieves the specified buffer's image type.",
|
||||
"This procedure retrieves the specified named buffer's image type.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("buffer-name",
|
||||
"buffer name",
|
||||
"The buffer name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("image-type",
|
||||
"image type",
|
||||
"The buffer image type: { GIMP_RGB (0), GIMP_GRAY (1), GIMP_INDEXED (2) }",
|
||||
GIMP_TYPE_IMAGE_BASE_TYPE,
|
||||
GIMP_RGB,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -34,16 +34,296 @@
|
|||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
static GimpProcedure channel_new_proc;
|
||||
static GimpProcedure channel_new_from_component_proc;
|
||||
static GimpProcedure channel_copy_proc;
|
||||
static GimpProcedure channel_combine_masks_proc;
|
||||
static GimpProcedure channel_get_show_masked_proc;
|
||||
static GimpProcedure channel_set_show_masked_proc;
|
||||
static GimpProcedure channel_get_opacity_proc;
|
||||
static GimpProcedure channel_set_opacity_proc;
|
||||
static GimpProcedure channel_get_color_proc;
|
||||
static GimpProcedure channel_set_color_proc;
|
||||
|
||||
static GValueArray *
|
||||
channel_new_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
gint32 width;
|
||||
gint32 height;
|
||||
const gchar *name;
|
||||
gdouble opacity;
|
||||
GimpRGB color;
|
||||
GimpChannel *channel = NULL;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
width = g_value_get_int (&args->values[1]);
|
||||
height = g_value_get_int (&args->values[2]);
|
||||
name = g_value_get_string (&args->values[3]);
|
||||
opacity = g_value_get_double (&args->values[4]);
|
||||
gimp_value_get_rgb (&args->values[5], &color);
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpRGB rgb_color = color;
|
||||
|
||||
rgb_color.a = opacity / 100.0;
|
||||
channel = gimp_channel_new (image, width, height, name, &rgb_color);
|
||||
|
||||
if (! channel)
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_channel (&return_vals->values[1], channel);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_new_from_component_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
gint32 component;
|
||||
const gchar *name;
|
||||
GimpChannel *channel = NULL;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
component = g_value_get_enum (&args->values[1]);
|
||||
name = g_value_get_string (&args->values[2]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_image_get_component_index (image, component) != -1)
|
||||
channel = gimp_channel_new_from_component (image,
|
||||
component, name, NULL);
|
||||
|
||||
if (channel)
|
||||
gimp_item_set_visible (GIMP_ITEM (channel), FALSE, FALSE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_channel (&return_vals->values[1], channel);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_copy_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpChannel *channel;
|
||||
GimpChannel *channel_copy = NULL;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
channel_copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
|
||||
G_TYPE_FROM_INSTANCE (channel), FALSE));
|
||||
|
||||
if (! channel_copy)
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_channel (&return_vals->values[1], channel_copy);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_combine_masks_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel1;
|
||||
GimpChannel *channel2;
|
||||
gint32 operation;
|
||||
gint32 offx;
|
||||
gint32 offy;
|
||||
|
||||
channel1 = gimp_value_get_channel (&args->values[0], gimp);
|
||||
channel2 = gimp_value_get_channel (&args->values[1], gimp);
|
||||
operation = g_value_get_enum (&args->values[2]);
|
||||
offx = g_value_get_int (&args->values[3]);
|
||||
offy = g_value_get_int (&args->values[4]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_combine_mask (channel1, channel2, operation, offx, offy);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_get_show_masked_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpChannel *channel;
|
||||
gboolean show_masked = FALSE;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
show_masked = gimp_channel_get_show_masked (channel);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
g_value_set_boolean (&return_vals->values[1], show_masked);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_set_show_masked_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel;
|
||||
gboolean show_masked;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
show_masked = g_value_get_boolean (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_set_show_masked (channel, show_masked);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_get_opacity_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpChannel *channel;
|
||||
gdouble opacity = 0.0;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
opacity = gimp_channel_get_opacity (channel) * 100;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
g_value_set_double (&return_vals->values[1], opacity);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_set_opacity_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel;
|
||||
gdouble opacity;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
opacity = g_value_get_double (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_set_opacity (channel, opacity / 100.0, TRUE);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_get_color_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpChannel *channel;
|
||||
GimpRGB color = { 0.0, 0.0, 0.0, 1.0 };
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_get_color (channel, &color);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_rgb (&return_vals->values[1], &color);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_set_color_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel;
|
||||
GimpRGB color;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
gimp_value_get_rgb (&args->values[1], &color);
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpRGB rgb_color = color;
|
||||
|
||||
rgb_color.a = channel->color.a;
|
||||
gimp_channel_set_color (channel, &rgb_color, TRUE);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
void
|
||||
register_channel_procs (Gimp *gimp)
|
||||
|
@ -51,9 +331,21 @@ register_channel_procs (Gimp *gimp)
|
|||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* channel_new
|
||||
* gimp-channel-new
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_new_proc, 6, 1);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 6, 1,
|
||||
channel_new_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-new",
|
||||
"gimp-channel-new",
|
||||
"Create a new channel.",
|
||||
"This procedure creates a new channel with the specified width and height. Name, opacity, and color are also supplied parameters. The new channel still needs to be added to the image, as this is not automatic. Add the new channel with the 'gimp_image_add_channel' command. Other attributes such as channel show masked, should be set with explicit procedure calls. The channel's contents are undefined initially.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
|
@ -100,9 +392,21 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* channel_new_from_component
|
||||
* gimp-channel-new-from-component
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_new_from_component_proc, 3, 1);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 1,
|
||||
channel_new_from_component_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-new-from-component",
|
||||
"gimp-channel-new-from-component",
|
||||
"Create a new channel from a color component",
|
||||
"This procedure creates a new channel from a color component.",
|
||||
"Shlomi Fish <shlomif@iglu.org.il>",
|
||||
"Shlomi Fish",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
|
@ -132,9 +436,21 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* channel_copy
|
||||
* gimp-channel-copy
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_copy_proc, 1, 1);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
channel_copy_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-copy",
|
||||
"gimp-channel-copy",
|
||||
"Copy a channel.",
|
||||
"This procedure copies the specified channel and returns the copy.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
|
@ -150,9 +466,21 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* channel_combine_masks
|
||||
* gimp-channel-combine-masks
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_combine_masks_proc, 5, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 5, 0,
|
||||
channel_combine_masks_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-combine-masks",
|
||||
"gimp-channel-combine-masks",
|
||||
"Combine two channel masks.",
|
||||
"This procedure combines two channel masks. The result is stored in the first channel.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel1",
|
||||
"channel1",
|
||||
|
@ -187,9 +515,21 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* channel_get_show_masked
|
||||
* gimp-channel-get-show-masked
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_get_show_masked_proc, 1, 1);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
channel_get_show_masked_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-get-show-masked",
|
||||
"gimp-channel-get-show-masked",
|
||||
"Get the composite method of the specified channel.",
|
||||
"This procedure returns the specified channel's composite method. If it is TRUE, then the channel is composited with the image so that masked regions are shown. Otherwise, selected regions are shown.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
|
@ -205,9 +545,21 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* channel_set_show_masked
|
||||
* gimp-channel-set-show-masked
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_set_show_masked_proc, 2, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
channel_set_show_masked_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-set-show-masked",
|
||||
"gimp-channel-set-show-masked",
|
||||
"Set the composite method of the specified channel.",
|
||||
"This procedure sets the specified channel's composite method. If it is TRUE, then the channel is composited with the image so that masked regions are shown. Otherwise, selected regions are shown.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
|
@ -223,9 +575,21 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* channel_get_opacity
|
||||
* gimp-channel-get-opacity
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_get_opacity_proc, 1, 1);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
channel_get_opacity_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-get-opacity",
|
||||
"gimp-channel-get-opacity",
|
||||
"Get the opacity of the specified channel.",
|
||||
"This procedure returns the specified channel's opacity.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
|
@ -241,9 +605,21 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* channel_set_opacity
|
||||
* gimp-channel-set-opacity
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_set_opacity_proc, 2, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
channel_set_opacity_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-set-opacity",
|
||||
"gimp-channel-set-opacity",
|
||||
"Set the opacity of the specified channel.",
|
||||
"This procedure sets the specified channel's opacity.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
|
@ -259,9 +635,21 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* channel_get_color
|
||||
* gimp-channel-get-color
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_get_color_proc, 1, 1);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
channel_get_color_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-get-color",
|
||||
"gimp-channel-get-color",
|
||||
"Get the compositing color of the specified channel.",
|
||||
"This procedure returns the specified channel's compositing color.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
|
@ -277,9 +665,21 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* channel_set_color
|
||||
* gimp-channel-set-color
|
||||
*/
|
||||
procedure = gimp_procedure_init (&channel_set_color_proc, 2, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
channel_set_color_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-channel-set-color",
|
||||
"gimp-channel-set-color",
|
||||
"Set the compositing color of the specified channel.",
|
||||
"This procedure sets the specified channel's compositing color.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_channel_id ("channel",
|
||||
"channel",
|
||||
|
@ -295,453 +695,3 @@ register_channel_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
channel_new_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
gint32 width;
|
||||
gint32 height;
|
||||
const gchar *name;
|
||||
gdouble opacity;
|
||||
GimpRGB color;
|
||||
GimpChannel *channel = NULL;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
width = g_value_get_int (&args->values[1]);
|
||||
height = g_value_get_int (&args->values[2]);
|
||||
name = g_value_get_string (&args->values[3]);
|
||||
opacity = g_value_get_double (&args->values[4]);
|
||||
gimp_value_get_rgb (&args->values[5], &color);
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpRGB rgb_color = color;
|
||||
|
||||
rgb_color.a = opacity / 100.0;
|
||||
channel = gimp_channel_new (image, width, height, name, &rgb_color);
|
||||
|
||||
if (! channel)
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_channel (&return_vals->values[1], channel);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure channel_new_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-new",
|
||||
"gimp-channel-new",
|
||||
"Create a new channel.",
|
||||
"This procedure creates a new channel with the specified width and height. Name, opacity, and color are also supplied parameters. The new channel still needs to be added to the image, as this is not automatic. Add the new channel with the 'gimp_image_add_channel' command. Other attributes such as channel show masked, should be set with explicit procedure calls. The channel's contents are undefined initially.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_new_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
channel_new_from_component_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
gint32 component;
|
||||
const gchar *name;
|
||||
GimpChannel *channel = NULL;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
component = g_value_get_enum (&args->values[1]);
|
||||
name = g_value_get_string (&args->values[2]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp_image_get_component_index (image, component) != -1)
|
||||
channel = gimp_channel_new_from_component (image,
|
||||
component, name, NULL);
|
||||
|
||||
if (channel)
|
||||
gimp_item_set_visible (GIMP_ITEM (channel), FALSE, FALSE);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_channel (&return_vals->values[1], channel);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure channel_new_from_component_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-new-from-component",
|
||||
"gimp-channel-new-from-component",
|
||||
"Create a new channel from a color component",
|
||||
"This procedure creates a new channel from a color component.",
|
||||
"Shlomi Fish <shlomif@iglu.org.il>",
|
||||
"Shlomi Fish",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_new_from_component_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
channel_copy_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpChannel *channel;
|
||||
GimpChannel *channel_copy = NULL;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
channel_copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
|
||||
G_TYPE_FROM_INSTANCE (channel), FALSE));
|
||||
|
||||
if (! channel_copy)
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_channel (&return_vals->values[1], channel_copy);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure channel_copy_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-copy",
|
||||
"gimp-channel-copy",
|
||||
"Copy a channel.",
|
||||
"This procedure copies the specified channel and returns the copy.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_copy_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
channel_combine_masks_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel1;
|
||||
GimpChannel *channel2;
|
||||
gint32 operation;
|
||||
gint32 offx;
|
||||
gint32 offy;
|
||||
|
||||
channel1 = gimp_value_get_channel (&args->values[0], gimp);
|
||||
channel2 = gimp_value_get_channel (&args->values[1], gimp);
|
||||
operation = g_value_get_enum (&args->values[2]);
|
||||
offx = g_value_get_int (&args->values[3]);
|
||||
offy = g_value_get_int (&args->values[4]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_combine_mask (channel1, channel2, operation, offx, offy);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure channel_combine_masks_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-combine-masks",
|
||||
"gimp-channel-combine-masks",
|
||||
"Combine two channel masks.",
|
||||
"This procedure combines two channel masks. The result is stored in the first channel.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_combine_masks_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
channel_get_show_masked_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpChannel *channel;
|
||||
gboolean show_masked = FALSE;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
show_masked = gimp_channel_get_show_masked (channel);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
g_value_set_boolean (&return_vals->values[1], show_masked);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure channel_get_show_masked_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-get-show-masked",
|
||||
"gimp-channel-get-show-masked",
|
||||
"Get the composite method of the specified channel.",
|
||||
"This procedure returns the specified channel's composite method. If it is TRUE, then the channel is composited with the image so that masked regions are shown. Otherwise, selected regions are shown.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_get_show_masked_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
channel_set_show_masked_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel;
|
||||
gboolean show_masked;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
show_masked = g_value_get_boolean (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_set_show_masked (channel, show_masked);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure channel_set_show_masked_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-set-show-masked",
|
||||
"gimp-channel-set-show-masked",
|
||||
"Set the composite method of the specified channel.",
|
||||
"This procedure sets the specified channel's composite method. If it is TRUE, then the channel is composited with the image so that masked regions are shown. Otherwise, selected regions are shown.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_set_show_masked_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
channel_get_opacity_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpChannel *channel;
|
||||
gdouble opacity = 0.0;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
opacity = gimp_channel_get_opacity (channel) * 100;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
g_value_set_double (&return_vals->values[1], opacity);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure channel_get_opacity_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-get-opacity",
|
||||
"gimp-channel-get-opacity",
|
||||
"Get the opacity of the specified channel.",
|
||||
"This procedure returns the specified channel's opacity.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_get_opacity_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
channel_set_opacity_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel;
|
||||
gdouble opacity;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
opacity = g_value_get_double (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_set_opacity (channel, opacity / 100.0, TRUE);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure channel_set_opacity_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-set-opacity",
|
||||
"gimp-channel-set-opacity",
|
||||
"Set the opacity of the specified channel.",
|
||||
"This procedure sets the specified channel's opacity.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_set_opacity_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
channel_get_color_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpChannel *channel;
|
||||
GimpRGB color = { 0.0, 0.0, 0.0, 1.0 };
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_get_color (channel, &color);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success);
|
||||
|
||||
if (success)
|
||||
gimp_value_set_rgb (&return_vals->values[1], &color);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure channel_get_color_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-get-color",
|
||||
"gimp-channel-get-color",
|
||||
"Get the compositing color of the specified channel.",
|
||||
"This procedure returns the specified channel's compositing color.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_get_color_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
channel_set_color_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpChannel *channel;
|
||||
GimpRGB color;
|
||||
|
||||
channel = gimp_value_get_channel (&args->values[0], gimp);
|
||||
gimp_value_get_rgb (&args->values[1], &color);
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpRGB rgb_color = color;
|
||||
|
||||
rgb_color.a = channel->color.a;
|
||||
gimp_channel_set_color (channel, &rgb_color, TRUE);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure channel_set_color_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-channel-set-color",
|
||||
"gimp-channel-set-color",
|
||||
"Set the compositing color of the specified channel.",
|
||||
"This procedure sets the specified channel's compositing color.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { channel_set_color_invoker } }
|
||||
};
|
||||
|
|
1348
app/pdb/color_cmds.c
1348
app/pdb/color_cmds.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -35,91 +35,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
#include "core/gimppalette.h"
|
||||
|
||||
static GimpProcedure image_convert_rgb_proc;
|
||||
static GimpProcedure image_convert_grayscale_proc;
|
||||
static GimpProcedure image_convert_indexed_proc;
|
||||
|
||||
void
|
||||
register_convert_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* image_convert_rgb
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_convert_rgb_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_convert_grayscale
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_convert_grayscale_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_convert_indexed
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_convert_indexed_proc, 7, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("dither-type",
|
||||
"dither type",
|
||||
"The dither type to use: { GIMP_NO_DITHER (0), GIMP_FS_DITHER (1), GIMP_FSLOWBLEED_DITHER (2), GIMP_FIXED_DITHER (3) }",
|
||||
GIMP_TYPE_CONVERT_DITHER_TYPE,
|
||||
GIMP_NO_DITHER,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("palette-type",
|
||||
"palette type",
|
||||
"The type of palette to use: { GIMP_MAKE_PALETTE (0), GIMP_REUSE_PALETTE (1), GIMP_WEB_PALETTE (2), GIMP_MONO_PALETTE (3), GIMP_CUSTOM_PALETTE (4) }",
|
||||
GIMP_TYPE_CONVERT_PALETTE_TYPE,
|
||||
GIMP_MAKE_PALETTE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("num-cols",
|
||||
"num cols",
|
||||
"The number of colors to quantize to, ignored unless (palette_type == GIMP_MAKE_PALETTE)",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("alpha-dither",
|
||||
"alpha dither",
|
||||
"Dither transparency to fake partial opacity",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("remove-unused",
|
||||
"remove unused",
|
||||
"Remove unused or duplicate color entries from final palette, ignored if (palette_type == GIMP_MAKE_PALETTE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette",
|
||||
"palette",
|
||||
"The name of the custom palette to use, ignored unless (palette_type == GIMP_CUSTOM_PALETTE)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
image_convert_rgb_invoker (GimpProcedure *procedure,
|
||||
|
@ -144,22 +59,6 @@ image_convert_rgb_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_convert_rgb_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-convert-rgb",
|
||||
"gimp-image-convert-rgb",
|
||||
"Convert specified image to RGB color",
|
||||
"This procedure converts the specified image to RGB color. This process requires an image of type GIMP_GRAY or GIMP_INDEXED. No image content is lost in this process aside from the colormap for an indexed image.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_convert_rgb_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_convert_grayscale_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -183,22 +82,6 @@ image_convert_grayscale_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_convert_grayscale_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-convert-grayscale",
|
||||
"gimp-image-convert-grayscale",
|
||||
"Convert specified image to grayscale (256 intensity levels)",
|
||||
"This procedure converts the specified image to grayscale with 8 bits per pixel (256 intensity levels). This process requires an image of type GIMP_RGB or GIMP_INDEXED.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_convert_grayscale_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_convert_indexed_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -260,18 +143,120 @@ image_convert_indexed_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_convert_indexed_proc =
|
||||
void
|
||||
register_convert_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-convert-indexed",
|
||||
"gimp-image-convert-indexed",
|
||||
"Convert specified image to and Indexed image",
|
||||
"This procedure converts the specified image to 'indexed' color. This process requires an image of type GIMP_GRAY or GIMP_RGB. The 'palette_type' specifies what kind of palette to use, A type of '0' means to use an optimal palette of 'num_cols' generated from the colors in the image. A type of '1' means to re-use the previous palette (not currently implemented). A type of '2' means to use the so-called WWW-optimized palette. Type '3' means to use only black and white colors. A type of '4' means to use a palette from the gimp palettes directories. The 'dither type' specifies what kind of dithering to use. '0' means no dithering, '1' means standard Floyd-Steinberg error diffusion, '2' means Floyd-Steinberg error diffusion with reduced bleeding, '3' means dithering based on pixel location ('Fixed' dithering).",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_convert_indexed_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-image-convert-rgb
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
image_convert_rgb_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-convert-rgb",
|
||||
"gimp-image-convert-rgb",
|
||||
"Convert specified image to RGB color",
|
||||
"This procedure converts the specified image to RGB color. This process requires an image of type GIMP_GRAY or GIMP_INDEXED. No image content is lost in this process aside from the colormap for an indexed image.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-convert-grayscale
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
image_convert_grayscale_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-convert-grayscale",
|
||||
"gimp-image-convert-grayscale",
|
||||
"Convert specified image to grayscale (256 intensity levels)",
|
||||
"This procedure converts the specified image to grayscale with 8 bits per pixel (256 intensity levels). This process requires an image of type GIMP_RGB or GIMP_INDEXED.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-convert-indexed
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 7, 0,
|
||||
image_convert_indexed_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-convert-indexed",
|
||||
"gimp-image-convert-indexed",
|
||||
"Convert specified image to and Indexed image",
|
||||
"This procedure converts the specified image to 'indexed' color. This process requires an image of type GIMP_GRAY or GIMP_RGB. The 'palette_type' specifies what kind of palette to use, A type of '0' means to use an optimal palette of 'num_cols' generated from the colors in the image. A type of '1' means to re-use the previous palette (not currently implemented). A type of '2' means to use the so-called WWW-optimized palette. Type '3' means to use only black and white colors. A type of '4' means to use a palette from the gimp palettes directories. The 'dither type' specifies what kind of dithering to use. '0' means no dithering, '1' means standard Floyd-Steinberg error diffusion, '2' means Floyd-Steinberg error diffusion with reduced bleeding, '3' means dithering based on pixel location ('Fixed' dithering).",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("dither-type",
|
||||
"dither type",
|
||||
"The dither type to use: { GIMP_NO_DITHER (0), GIMP_FS_DITHER (1), GIMP_FSLOWBLEED_DITHER (2), GIMP_FIXED_DITHER (3) }",
|
||||
GIMP_TYPE_CONVERT_DITHER_TYPE,
|
||||
GIMP_NO_DITHER,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("palette-type",
|
||||
"palette type",
|
||||
"The type of palette to use: { GIMP_MAKE_PALETTE (0), GIMP_REUSE_PALETTE (1), GIMP_WEB_PALETTE (2), GIMP_MONO_PALETTE (3), GIMP_CUSTOM_PALETTE (4) }",
|
||||
GIMP_TYPE_CONVERT_PALETTE_TYPE,
|
||||
GIMP_MAKE_PALETTE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("num-cols",
|
||||
"num cols",
|
||||
"The number of colors to quantize to, ignored unless (palette_type == GIMP_MAKE_PALETTE)",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("alpha-dither",
|
||||
"alpha dither",
|
||||
"Dither transparency to fake partial opacity",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("remove-unused",
|
||||
"remove unused",
|
||||
"Remove unused or duplicate color entries from final palette, ignored if (palette_type == GIMP_MAKE_PALETTE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette",
|
||||
"palette",
|
||||
"The name of the custom palette to use, ignored unless (palette_type == GIMP_CUSTOM_PALETTE)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -32,90 +32,6 @@
|
|||
#include "core/gimpcontainer.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
static GimpProcedure display_new_proc;
|
||||
static GimpProcedure display_delete_proc;
|
||||
static GimpProcedure display_get_window_handle_proc;
|
||||
static GimpProcedure displays_flush_proc;
|
||||
static GimpProcedure displays_reconnect_proc;
|
||||
|
||||
void
|
||||
register_display_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* display_new
|
||||
*/
|
||||
procedure = gimp_procedure_init (&display_new_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_display_id ("display",
|
||||
"display",
|
||||
"The new display",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* display_delete
|
||||
*/
|
||||
procedure = gimp_procedure_init (&display_delete_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_display_id ("display",
|
||||
"display",
|
||||
"The display to delete",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* display_get_window_handle
|
||||
*/
|
||||
procedure = gimp_procedure_init (&display_get_window_handle_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_display_id ("display",
|
||||
"display",
|
||||
"The display to get the window handle from",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("window",
|
||||
"window",
|
||||
"The native window handle or 0",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* displays_flush
|
||||
*/
|
||||
procedure = gimp_procedure_init (&displays_flush_proc, 0, 0);
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* displays_reconnect
|
||||
*/
|
||||
procedure = gimp_procedure_init (&displays_reconnect_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("old-image",
|
||||
"old image",
|
||||
"The old image (must have at least one display)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("new-image",
|
||||
"new image",
|
||||
"The new image (must not have a display)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
display_new_invoker (GimpProcedure *procedure,
|
||||
|
@ -153,22 +69,6 @@ display_new_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure display_new_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-display-new",
|
||||
"gimp-display-new",
|
||||
"Create a new display for the specified image.",
|
||||
"Creates a new display for the specified image. If the image already has a display, another is added. Multiple displays are handled transparently by the GIMP. The newly created display is returned and can be subsequently destroyed with a call to 'gimp-display-delete'. This procedure only makes sense for use with the GIMP UI.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { display_new_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
display_delete_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -189,22 +89,6 @@ display_delete_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure display_delete_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-display-delete",
|
||||
"gimp-display-delete",
|
||||
"Delete the specified display.",
|
||||
"This procedure removes the specified display. If this is the last remaining display for the underlying image, then the image is deleted also.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { display_delete_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
display_get_window_handle_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -232,22 +116,6 @@ display_get_window_handle_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure display_get_window_handle_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-display-get-window-handle",
|
||||
"gimp-display-get-window-handle",
|
||||
"Get a handle to the native window for an image display.",
|
||||
"This procedure returns a handle to the native window for a given image display. For example in the X backend of GDK, a native window handle is an Xlib XID. A value of 0 is returned for an invalid display or if this function is unimplemented for the windowing system that is being used.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { display_get_window_handle_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
displays_flush_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -259,22 +127,6 @@ displays_flush_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, TRUE);
|
||||
}
|
||||
|
||||
static GimpProcedure displays_flush_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-displays-flush",
|
||||
"gimp-displays-flush",
|
||||
"Flush all internal changes to the user interface",
|
||||
"This procedure takes no arguments and returns nothing except a success status. Its purpose is to flush all pending updates of image manipulations to the user interface. It should be called whenever appropriate.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { displays_flush_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
displays_reconnect_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -308,18 +160,141 @@ displays_reconnect_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure displays_reconnect_proc =
|
||||
void
|
||||
register_display_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-displays-reconnect",
|
||||
"gimp-displays-reconnect",
|
||||
"Reconnect displays from one image to another image.",
|
||||
"This procedure connects all displays of the old_image to the new_image. If the old_image has no display or new_image already has a display the reconnect is not performed and the procedure returns without success. You should rarely need to use this function.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { displays_reconnect_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-display-new
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
display_new_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-display-new",
|
||||
"gimp-display-new",
|
||||
"Create a new display for the specified image.",
|
||||
"Creates a new display for the specified image. If the image already has a display, another is added. Multiple displays are handled transparently by the GIMP. The newly created display is returned and can be subsequently destroyed with a call to 'gimp-display-delete'. This procedure only makes sense for use with the GIMP UI.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_display_id ("display",
|
||||
"display",
|
||||
"The new display",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-display-delete
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
display_delete_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-display-delete",
|
||||
"gimp-display-delete",
|
||||
"Delete the specified display.",
|
||||
"This procedure removes the specified display. If this is the last remaining display for the underlying image, then the image is deleted also.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_display_id ("display",
|
||||
"display",
|
||||
"The display to delete",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-display-get-window-handle
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
display_get_window_handle_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-display-get-window-handle",
|
||||
"gimp-display-get-window-handle",
|
||||
"Get a handle to the native window for an image display.",
|
||||
"This procedure returns a handle to the native window for a given image display. For example in the X backend of GDK, a native window handle is an Xlib XID. A value of 0 is returned for an invalid display or if this function is unimplemented for the windowing system that is being used.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_display_id ("display",
|
||||
"display",
|
||||
"The display to get the window handle from",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("window",
|
||||
"window",
|
||||
"The native window handle or 0",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-displays-flush
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 0,
|
||||
displays_flush_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-displays-flush",
|
||||
"gimp-displays-flush",
|
||||
"Flush all internal changes to the user interface",
|
||||
"This procedure takes no arguments and returns nothing except a success status. Its purpose is to flush all pending updates of image manipulations to the user interface. It should be called whenever appropriate.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-displays-reconnect
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
displays_reconnect_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-displays-reconnect",
|
||||
"gimp-displays-reconnect",
|
||||
"Reconnect displays from one image to another image.",
|
||||
"This procedure connects all displays of the old_image to the new_image. If the old_image has no display or new_image already has a display the reconnect is not performed and the procedure returns without success. You should rarely need to use this function.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("old-image",
|
||||
"old image",
|
||||
"The old image (must have at least one display)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("new-image",
|
||||
"new image",
|
||||
"The new image (must not have a display)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1667
app/pdb/edit_cmds.c
1667
app/pdb/edit_cmds.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -32,109 +32,6 @@
|
|||
#include "core/gimplayer-floating-sel.h"
|
||||
#include "core/gimplayer.h"
|
||||
|
||||
static GimpProcedure floating_sel_remove_proc;
|
||||
static GimpProcedure floating_sel_anchor_proc;
|
||||
static GimpProcedure floating_sel_to_layer_proc;
|
||||
static GimpProcedure floating_sel_attach_proc;
|
||||
static GimpProcedure floating_sel_rigor_proc;
|
||||
static GimpProcedure floating_sel_relax_proc;
|
||||
|
||||
void
|
||||
register_floating_sel_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* floating_sel_remove
|
||||
*/
|
||||
procedure = gimp_procedure_init (&floating_sel_remove_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* floating_sel_anchor
|
||||
*/
|
||||
procedure = gimp_procedure_init (&floating_sel_anchor_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* floating_sel_to_layer
|
||||
*/
|
||||
procedure = gimp_procedure_init (&floating_sel_to_layer_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* floating_sel_attach
|
||||
*/
|
||||
procedure = gimp_procedure_init (&floating_sel_attach_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"The layer (is attached as floating selection)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The drawable (where to attach the floating selection)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* floating_sel_rigor
|
||||
*/
|
||||
procedure = gimp_procedure_init (&floating_sel_rigor_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("undo",
|
||||
"undo",
|
||||
"(TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* floating_sel_relax
|
||||
*/
|
||||
procedure = gimp_procedure_init (&floating_sel_relax_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("undo",
|
||||
"undo",
|
||||
"(TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
floating_sel_remove_invoker (GimpProcedure *procedure,
|
||||
|
@ -159,22 +56,6 @@ floating_sel_remove_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure floating_sel_remove_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-floating-sel-remove",
|
||||
"gimp-floating-sel-remove",
|
||||
"Remove the specified floating selection from its associated drawable.",
|
||||
"This procedure removes the floating selection completely, without any side effects. The associated drawable is then set to active.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { floating_sel_remove_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
floating_sel_anchor_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -198,22 +79,6 @@ floating_sel_anchor_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure floating_sel_anchor_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-floating-sel-anchor",
|
||||
"gimp-floating-sel-anchor",
|
||||
"Anchor the specified floating selection to its associated drawable.",
|
||||
"This procedure anchors the floating selection to its associated drawable. This is similar to merging with a merge type of ClipToBottomLayer. The floating selection layer is no longer valid after this operation.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { floating_sel_anchor_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
floating_sel_to_layer_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -237,22 +102,6 @@ floating_sel_to_layer_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure floating_sel_to_layer_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-floating-sel-to-layer",
|
||||
"gimp-floating-sel-to-layer",
|
||||
"Transforms the specified floating selection into a layer.",
|
||||
"This procedure transforms the specified floating selection into a layer with the same offsets and extents. The composited image will look precisely the same, but the floating selection layer will no longer be clipped to the extents of the drawable it was attached to. The floating selection will become the active layer. This procedure will not work if the floating selection has a different base type from the underlying image. This might be the case if the floating selection is above an auxillary channel or a layer mask.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { floating_sel_to_layer_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
floating_sel_attach_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -278,22 +127,6 @@ floating_sel_attach_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure floating_sel_attach_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-floating-sel-attach",
|
||||
"gimp-floating-sel-attach",
|
||||
"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",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { floating_sel_attach_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
floating_sel_rigor_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -319,22 +152,6 @@ floating_sel_rigor_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure floating_sel_rigor_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-floating-sel-rigor",
|
||||
"gimp-floating-sel-rigor",
|
||||
"Rigor the floating selection.",
|
||||
"This procedure rigors the floating selection.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { floating_sel_rigor_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
floating_sel_relax_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -360,18 +177,171 @@ floating_sel_relax_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure floating_sel_relax_proc =
|
||||
void
|
||||
register_floating_sel_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-floating-sel-relax",
|
||||
"gimp-floating-sel-relax",
|
||||
"Relax the floating selection.",
|
||||
"This procedure relaxes the floating selection.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { floating_sel_relax_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-floating-sel-remove
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
floating_sel_remove_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-floating-sel-remove",
|
||||
"gimp-floating-sel-remove",
|
||||
"Remove the specified floating selection from its associated drawable.",
|
||||
"This procedure removes the floating selection completely, without any side effects. The associated drawable is then set to active.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-floating-sel-anchor
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
floating_sel_anchor_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-floating-sel-anchor",
|
||||
"gimp-floating-sel-anchor",
|
||||
"Anchor the specified floating selection to its associated drawable.",
|
||||
"This procedure anchors the floating selection to its associated drawable. This is similar to merging with a merge type of ClipToBottomLayer. The floating selection layer is no longer valid after this operation.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-floating-sel-to-layer
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
floating_sel_to_layer_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-floating-sel-to-layer",
|
||||
"gimp-floating-sel-to-layer",
|
||||
"Transforms the specified floating selection into a layer.",
|
||||
"This procedure transforms the specified floating selection into a layer with the same offsets and extents. The composited image will look precisely the same, but the floating selection layer will no longer be clipped to the extents of the drawable it was attached to. The floating selection will become the active layer. This procedure will not work if the floating selection has a different base type from the underlying image. This might be the case if the floating selection is above an auxillary channel or a layer mask.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-floating-sel-attach
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
floating_sel_attach_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-floating-sel-attach",
|
||||
"gimp-floating-sel-attach",
|
||||
"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",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("layer",
|
||||
"layer",
|
||||
"The layer (is attached as floating selection)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The drawable (where to attach the floating selection)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-floating-sel-rigor
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
floating_sel_rigor_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-floating-sel-rigor",
|
||||
"gimp-floating-sel-rigor",
|
||||
"Rigor the floating selection.",
|
||||
"This procedure rigors the floating selection.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("undo",
|
||||
"undo",
|
||||
"(TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-floating-sel-relax
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
floating_sel_relax_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-floating-sel-relax",
|
||||
"gimp-floating-sel-relax",
|
||||
"Relax the floating selection.",
|
||||
"This procedure relaxes the floating selection.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_layer_id ("floating-sel",
|
||||
"floating sel",
|
||||
"The floating selection",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("undo",
|
||||
"undo",
|
||||
"(TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -30,76 +30,6 @@
|
|||
|
||||
#include "core/gimp.h"
|
||||
|
||||
static GimpProcedure fonts_popup_proc;
|
||||
static GimpProcedure fonts_close_popup_proc;
|
||||
static GimpProcedure fonts_set_popup_proc;
|
||||
|
||||
void
|
||||
register_font_select_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* fonts_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&fonts_popup_proc, 3, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("font-callback",
|
||||
"font callback",
|
||||
"The callback PDB proc to call when font selection is made",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("popup-title",
|
||||
"popup title",
|
||||
"Title to give the font popup window",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("initial-font",
|
||||
"initial font",
|
||||
"The name of the font to set as the first selected",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* fonts_close_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&fonts_close_popup_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("font-callback",
|
||||
"font callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* fonts_set_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&fonts_set_popup_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("font-callback",
|
||||
"font callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("font-name",
|
||||
"font name",
|
||||
"The name of the font to set as selected",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
fonts_popup_invoker (GimpProcedure *procedure,
|
||||
|
@ -130,22 +60,6 @@ fonts_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure fonts_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-fonts-popup",
|
||||
"gimp-fonts-popup",
|
||||
"Invokes the Gimp font selection.",
|
||||
"This procedure popups the font selection dialog.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { fonts_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
fonts_close_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -169,22 +83,6 @@ fonts_close_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure fonts_close_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-fonts-close-popup",
|
||||
"gimp-fonts-close-popup",
|
||||
"Popdown the Gimp font selection.",
|
||||
"This procedure closes an opened font selection dialog.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { fonts_close_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
fonts_set_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -211,18 +109,105 @@ fonts_set_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure fonts_set_popup_proc =
|
||||
void
|
||||
register_font_select_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-fonts-set-popup",
|
||||
"gimp-fonts-set-popup",
|
||||
"Sets the current font selection in a popup.",
|
||||
"Sets the current font selection in a popup.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { fonts_set_popup_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-fonts-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 0,
|
||||
fonts_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-fonts-popup",
|
||||
"gimp-fonts-popup",
|
||||
"Invokes the Gimp font selection.",
|
||||
"This procedure popups the font selection dialog.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("font-callback",
|
||||
"font callback",
|
||||
"The callback PDB proc to call when font selection is made",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("popup-title",
|
||||
"popup title",
|
||||
"Title to give the font popup window",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("initial-font",
|
||||
"initial font",
|
||||
"The name of the font to set as the first selected",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-fonts-close-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
fonts_close_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-fonts-close-popup",
|
||||
"gimp-fonts-close-popup",
|
||||
"Popdown the Gimp font selection.",
|
||||
"This procedure closes an opened font selection dialog.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("font-callback",
|
||||
"font callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-fonts-set-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
fonts_set_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-fonts-set-popup",
|
||||
"gimp-fonts-set-popup",
|
||||
"Sets the current font selection in a popup.",
|
||||
"Sets the current font selection in a popup.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("font-callback",
|
||||
"font callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("font-name",
|
||||
"font name",
|
||||
"The name of the font to set as selected",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -33,45 +33,6 @@
|
|||
#include "core/gimpcontainer.h"
|
||||
#include "text/gimp-fonts.h"
|
||||
|
||||
static GimpProcedure fonts_refresh_proc;
|
||||
static GimpProcedure fonts_get_list_proc;
|
||||
|
||||
void
|
||||
register_fonts_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* fonts_refresh
|
||||
*/
|
||||
procedure = gimp_procedure_init (&fonts_refresh_proc, 0, 0);
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* fonts_get_list
|
||||
*/
|
||||
procedure = gimp_procedure_init (&fonts_get_list_proc, 1, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-fonts",
|
||||
"num fonts",
|
||||
"The number of available fonts",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("font-list",
|
||||
"font list",
|
||||
"The list of font names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
fonts_refresh_invoker (GimpProcedure *procedure,
|
||||
|
@ -84,22 +45,6 @@ fonts_refresh_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, TRUE);
|
||||
}
|
||||
|
||||
static GimpProcedure fonts_refresh_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-fonts-refresh",
|
||||
"gimp-fonts-refresh",
|
||||
"Refresh current fonts. This function always succeeds.",
|
||||
"This procedure retrieves all fonts currently in the user's font path and updates the font dialogs accordingly.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { fonts_refresh_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
fonts_get_list_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -132,18 +77,63 @@ fonts_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure fonts_get_list_proc =
|
||||
void
|
||||
register_fonts_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-fonts-get-list",
|
||||
"gimp-fonts-get-list",
|
||||
"Retrieve the list of loaded fonts.",
|
||||
"This procedure returns a list of the fonts that are currently available.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { fonts_get_list_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-fonts-refresh
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 0,
|
||||
fonts_refresh_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-fonts-refresh",
|
||||
"gimp-fonts-refresh",
|
||||
"Refresh current fonts. This function always succeeds.",
|
||||
"This procedure retrieves all fonts currently in the user's font path and updates the font dialogs accordingly.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL);
|
||||
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-fonts-get-list
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 2,
|
||||
fonts_get_list_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-fonts-get-list",
|
||||
"gimp-fonts-get-list",
|
||||
"Retrieve the list of loaded fonts.",
|
||||
"This procedure returns a list of the fonts that are currently available.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2003",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-fonts",
|
||||
"num fonts",
|
||||
"The number of available fonts",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("font-list",
|
||||
"font list",
|
||||
"The list of font names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -160,10 +160,19 @@ gimp_pdb_init_procs (Gimp *gimp)
|
|||
{ "gimp-layer-set-preserve-trans", "gimp-drawable-set-lock-alpha" }
|
||||
};
|
||||
|
||||
GTimer *timer;
|
||||
|
||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||
|
||||
timer = g_timer_new ();
|
||||
g_timer_start (timer);
|
||||
|
||||
internal_procs_init (gimp);
|
||||
|
||||
g_printerr ("internal_procs_init took %f secs\n",
|
||||
g_timer_elapsed (timer, NULL));
|
||||
g_timer_destroy (timer);
|
||||
|
||||
if (gimp->pdb_compat_mode != GIMP_PDB_COMPAT_OFF)
|
||||
{
|
||||
gint i;
|
||||
|
@ -245,7 +254,6 @@ gimp_pdb_execute (Gimp *gimp,
|
|||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
|
||||
g_return_val_if_fail (procedure_name != NULL, NULL);
|
||||
g_return_val_if_fail (args != NULL, NULL);
|
||||
|
||||
list = g_hash_table_lookup (gimp->procedural_ht, procedure_name);
|
||||
|
||||
|
@ -260,6 +268,8 @@ gimp_pdb_execute (Gimp *gimp,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (args != NULL, NULL);
|
||||
|
||||
for (; list; list = g_list_next (list))
|
||||
{
|
||||
GimpProcedure *procedure = list->data;
|
||||
|
@ -392,7 +402,7 @@ gimp_pdb_free_entry (gpointer key,
|
|||
{
|
||||
if (value)
|
||||
{
|
||||
g_list_foreach (value, (GFunc) gimp_procedure_free, NULL);
|
||||
g_list_foreach (value, (GFunc) g_object_unref, NULL);
|
||||
g_list_free (value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,10 +160,19 @@ gimp_pdb_init_procs (Gimp *gimp)
|
|||
{ "gimp-layer-set-preserve-trans", "gimp-drawable-set-lock-alpha" }
|
||||
};
|
||||
|
||||
GTimer *timer;
|
||||
|
||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||
|
||||
timer = g_timer_new ();
|
||||
g_timer_start (timer);
|
||||
|
||||
internal_procs_init (gimp);
|
||||
|
||||
g_printerr ("internal_procs_init took %f secs\n",
|
||||
g_timer_elapsed (timer, NULL));
|
||||
g_timer_destroy (timer);
|
||||
|
||||
if (gimp->pdb_compat_mode != GIMP_PDB_COMPAT_OFF)
|
||||
{
|
||||
gint i;
|
||||
|
@ -245,7 +254,6 @@ gimp_pdb_execute (Gimp *gimp,
|
|||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
|
||||
g_return_val_if_fail (procedure_name != NULL, NULL);
|
||||
g_return_val_if_fail (args != NULL, NULL);
|
||||
|
||||
list = g_hash_table_lookup (gimp->procedural_ht, procedure_name);
|
||||
|
||||
|
@ -260,6 +268,8 @@ gimp_pdb_execute (Gimp *gimp,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (args != NULL, NULL);
|
||||
|
||||
for (; list; list = g_list_next (list))
|
||||
{
|
||||
GimpProcedure *procedure = list->data;
|
||||
|
@ -392,7 +402,7 @@ gimp_pdb_free_entry (gpointer key,
|
|||
{
|
||||
if (value)
|
||||
{
|
||||
g_list_foreach (value, (GFunc) gimp_procedure_free, NULL);
|
||||
g_list_foreach (value, (GFunc) g_object_unref, NULL);
|
||||
g_list_free (value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ plug_in_proc_def_free (PlugInProcDef *proc_def)
|
|||
{
|
||||
g_return_if_fail (proc_def != NULL);
|
||||
|
||||
gimp_procedure_free (proc_def->procedure);
|
||||
g_object_unref (proc_def->procedure);
|
||||
|
||||
g_free (proc_def->prog);
|
||||
g_free (proc_def->menu_label);
|
||||
|
|
|
@ -45,27 +45,42 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
static void gimp_procedure_finalize (GObject *object);
|
||||
|
||||
static void gimp_procedure_free_strings (GimpProcedure *procedure);
|
||||
static GValueArray * gimp_procedure_real_execute (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GValueArray *args);
|
||||
|
||||
static void gimp_procedure_free_strings (GimpProcedure *procedure);
|
||||
|
||||
|
||||
/* public functions */
|
||||
G_DEFINE_TYPE (GimpProcedure, gimp_procedure, GIMP_TYPE_OBJECT);
|
||||
|
||||
GimpProcedure *
|
||||
gimp_procedure_new (void)
|
||||
#define parent_class gimp_procedure_parent_class
|
||||
|
||||
|
||||
static void
|
||||
gimp_procedure_class_init (GimpProcedureClass *klass)
|
||||
{
|
||||
GimpProcedure *procedure = g_new0 (GimpProcedure, 1);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
return procedure;
|
||||
object_class->finalize = gimp_procedure_finalize;
|
||||
|
||||
klass->execute = gimp_procedure_real_execute;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_procedure_free (GimpProcedure *procedure)
|
||||
static void
|
||||
gimp_procedure_init (GimpProcedure *procedure)
|
||||
{
|
||||
gint i;
|
||||
}
|
||||
|
||||
g_return_if_fail (GIMP_IS_PROCEDURE (procedure));
|
||||
static void
|
||||
gimp_procedure_finalize (GObject *object)
|
||||
{
|
||||
GimpProcedure *procedure = GIMP_PROCEDURE (object);
|
||||
gint i;
|
||||
|
||||
gimp_procedure_free_strings (procedure);
|
||||
|
||||
|
@ -87,14 +102,56 @@ gimp_procedure_free (GimpProcedure *procedure)
|
|||
procedure->values = NULL;
|
||||
}
|
||||
|
||||
if (! procedure->static_proc)
|
||||
g_free (procedure);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
gimp_procedure_real_execute (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GValueArray *args)
|
||||
{
|
||||
switch (procedure->proc_type)
|
||||
{
|
||||
case GIMP_INTERNAL:
|
||||
g_return_val_if_fail (args->n_values >= procedure->num_args, NULL);
|
||||
|
||||
return procedure->exec_method.internal.marshal_func (procedure,
|
||||
gimp, context,
|
||||
progress,
|
||||
args);
|
||||
|
||||
case GIMP_PLUGIN:
|
||||
case GIMP_EXTENSION:
|
||||
case GIMP_TEMPORARY:
|
||||
return plug_in_run (gimp, context, progress, procedure,
|
||||
args, TRUE, FALSE, -1);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
GimpProcedure *
|
||||
gimp_procedure_new (void)
|
||||
{
|
||||
GimpProcedure *procedure = g_object_new (GIMP_TYPE_PROCEDURE, NULL);
|
||||
|
||||
return procedure;
|
||||
}
|
||||
|
||||
GimpProcedure *
|
||||
gimp_procedure_init (GimpProcedure *procedure,
|
||||
gint n_arguments,
|
||||
gint n_return_values)
|
||||
gimp_procedure_initialize (GimpProcedure *procedure,
|
||||
GimpPDBProcType proc_type,
|
||||
gint n_arguments,
|
||||
gint n_return_values,
|
||||
gpointer exec_method)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), procedure);
|
||||
g_return_val_if_fail (procedure->args == NULL, procedure);
|
||||
|
@ -102,12 +159,36 @@ gimp_procedure_init (GimpProcedure *procedure,
|
|||
g_return_val_if_fail (n_arguments >= 0, procedure);
|
||||
g_return_val_if_fail (n_return_values >= 0, procedure);
|
||||
|
||||
procedure->num_args = n_arguments;
|
||||
procedure->args = g_new0 (GParamSpec *, n_arguments);
|
||||
procedure->proc_type = proc_type;
|
||||
|
||||
procedure->num_args = n_arguments;
|
||||
procedure->args = g_new0 (GParamSpec *, n_arguments);
|
||||
|
||||
procedure->num_values = n_return_values;
|
||||
procedure->values = g_new0 (GParamSpec *, n_return_values);
|
||||
|
||||
if (exec_method)
|
||||
{
|
||||
switch (proc_type)
|
||||
{
|
||||
case GIMP_INTERNAL:
|
||||
procedure->exec_method.internal.marshal_func = exec_method;
|
||||
break;
|
||||
|
||||
case GIMP_PLUGIN:
|
||||
procedure->exec_method.plug_in.filename = g_strdup (exec_method);
|
||||
break;
|
||||
|
||||
case GIMP_EXTENSION:
|
||||
procedure->exec_method.extension.filename = g_strdup (exec_method);
|
||||
break;
|
||||
|
||||
case GIMP_TEMPORARY:
|
||||
procedure->exec_method.temporary.plug_in = exec_method;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return procedure;
|
||||
}
|
||||
|
||||
|
@ -283,27 +364,11 @@ gimp_procedure_execute (GimpProcedure *procedure,
|
|||
}
|
||||
|
||||
/* call the procedure */
|
||||
switch (procedure->proc_type)
|
||||
{
|
||||
case GIMP_INTERNAL:
|
||||
g_return_val_if_fail (args->n_values >= procedure->num_args, NULL);
|
||||
|
||||
return_vals = procedure->exec_method.internal.marshal_func (procedure,
|
||||
gimp, context,
|
||||
progress,
|
||||
args);
|
||||
break;
|
||||
|
||||
case GIMP_PLUGIN:
|
||||
case GIMP_EXTENSION:
|
||||
case GIMP_TEMPORARY:
|
||||
return_vals = plug_in_run (gimp, context, progress, procedure,
|
||||
args, TRUE, FALSE, -1);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return_vals = GIMP_PROCEDURE_GET_CLASS (procedure)->execute (procedure,
|
||||
gimp,
|
||||
context,
|
||||
progress,
|
||||
args);
|
||||
|
||||
/* If there are no return arguments, assume an execution error */
|
||||
if (! return_vals)
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
#define __GIMP_PROCEDURE_H__
|
||||
|
||||
|
||||
#include "core/gimpobject.h"
|
||||
|
||||
|
||||
/* Execution types */
|
||||
typedef struct _IntExec IntExec;
|
||||
typedef struct _PlugInExec PlugInExec;
|
||||
|
@ -56,13 +59,21 @@ struct _TempExec
|
|||
};
|
||||
|
||||
|
||||
#define GIMP_IS_PROCEDURE(obj) ((obj) != NULL)
|
||||
#define GIMP_TYPE_PROCEDURE (gimp_procedure_get_type ())
|
||||
#define GIMP_PROCEDURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PROCEDURE, GimpProcedure))
|
||||
#define GIMP_PROCEDURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PROCEDURE, GimpProcedureClass))
|
||||
#define GIMP_IS_PROCEDURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PROCEDURE))
|
||||
#define GIMP_IS_PROCEDURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PROCEDURE))
|
||||
#define GIMP_PROCEDURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PROCEDURE, GimpProcedureClass))
|
||||
|
||||
|
||||
typedef struct _GimpProcedureClass GimpProcedureClass;
|
||||
|
||||
struct _GimpProcedure
|
||||
{
|
||||
GimpObject parent_instance;
|
||||
|
||||
/* Flags */
|
||||
gboolean static_proc; /* Is the procedure allocated? */
|
||||
gboolean static_strings; /* Are the procedure's strings allocated? */
|
||||
|
||||
/* Procedure information */
|
||||
|
@ -96,13 +107,26 @@ struct _GimpProcedure
|
|||
} exec_method;
|
||||
};
|
||||
|
||||
struct _GimpProcedureClass
|
||||
{
|
||||
GimpObjectClass parent_class;
|
||||
|
||||
GValueArray * (* execute) (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GValueArray *args);
|
||||
};
|
||||
|
||||
|
||||
GType gimp_procedure_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GimpProcedure * gimp_procedure_new (void);
|
||||
void gimp_procedure_free (GimpProcedure *procedure);
|
||||
|
||||
GimpProcedure * gimp_procedure_init (GimpProcedure *procedure,
|
||||
GimpProcedure * gimp_procedure_initialize (GimpProcedure *procedure,
|
||||
GimpPDBProcType proc_type,
|
||||
gint n_arguments,
|
||||
gint n_return_vals);
|
||||
gint n_return_vals,
|
||||
gpointer exec_method);
|
||||
|
||||
void gimp_procedure_set_strings (GimpProcedure *procedure,
|
||||
gchar *name,
|
||||
|
|
|
@ -36,130 +36,6 @@
|
|||
#include "core/gimp.h"
|
||||
#include "core/gimptemplate.h"
|
||||
|
||||
static GimpProcedure gimprc_query_proc;
|
||||
static GimpProcedure gimprc_set_proc;
|
||||
static GimpProcedure get_default_comment_proc;
|
||||
static GimpProcedure get_monitor_resolution_proc;
|
||||
static GimpProcedure get_theme_dir_proc;
|
||||
static GimpProcedure get_color_configuration_proc;
|
||||
static GimpProcedure get_module_load_inhibit_proc;
|
||||
|
||||
void
|
||||
register_gimprc_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimprc_query
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gimprc_query_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("token",
|
||||
"token",
|
||||
"The token to query for",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("value",
|
||||
"value",
|
||||
"The value associated with the queried token",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimprc_set
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gimprc_set_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("token",
|
||||
"token",
|
||||
"The token to add or modify",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("value",
|
||||
"value",
|
||||
"The value to set the token to",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* get_default_comment
|
||||
*/
|
||||
procedure = gimp_procedure_init (&get_default_comment_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("comment",
|
||||
"comment",
|
||||
"Default Image Comment",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* get_monitor_resolution
|
||||
*/
|
||||
procedure = gimp_procedure_init (&get_monitor_resolution_proc, 0, 2);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("xres",
|
||||
"xres",
|
||||
"X resolution",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("yres",
|
||||
"yres",
|
||||
"Y resolution",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* get_theme_dir
|
||||
*/
|
||||
procedure = gimp_procedure_init (&get_theme_dir_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("theme-dir",
|
||||
"theme dir",
|
||||
"The GUI theme dir",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* get_color_configuration
|
||||
*/
|
||||
procedure = gimp_procedure_init (&get_color_configuration_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("config",
|
||||
"config",
|
||||
"Serialized color management configuration",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* get_module_load_inhibit
|
||||
*/
|
||||
procedure = gimp_procedure_init (&get_module_load_inhibit_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("load-inhibit",
|
||||
"load inhibit",
|
||||
"The list of modules",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
gimprc_query_invoker (GimpProcedure *procedure,
|
||||
|
@ -197,22 +73,6 @@ gimprc_query_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure gimprc_query_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gimprc-query",
|
||||
"gimp-gimprc-query",
|
||||
"Queries the gimprc file parser for information on a specified token.",
|
||||
"This procedure is used to locate additional information contained in the gimprc file considered extraneous to the operation of the GIMP. Plug-ins that need configuration information can expect it will be stored in the user gimprc file and can use this procedure to retrieve it. This query procedure will return the value associated with the specified token. This corresponds _only_ to entries with the format: (<token> <value>). The value must be a string. Entries not corresponding to this format will cause warnings to be issued on gimprc parsing and will not be queryable.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gimprc_query_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
gimprc_set_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -241,22 +101,6 @@ gimprc_set_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure gimprc_set_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gimprc-set",
|
||||
"gimp-gimprc-set",
|
||||
"Sets a gimprc token to a value and saves it in the gimprc.",
|
||||
"This procedure is used to add or change additional information in the gimprc file that is considered extraneous to the operation of the GIMP. Plug-ins that need configuration information can use this function to store it, and gimp_gimprc_query to retrieve it. This will accept _only_ string values in UTF-8 encoding.",
|
||||
"Seth Burgess",
|
||||
"Seth Burgess",
|
||||
"1999",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gimprc_set_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
get_default_comment_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -275,22 +119,6 @@ get_default_comment_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure get_default_comment_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-get-default-comment",
|
||||
"gimp-get-default-comment",
|
||||
"Get the default image comment as specified in the Preferences.",
|
||||
"Returns a copy of the default image comment.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { get_default_comment_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
get_monitor_resolution_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -313,22 +141,6 @@ get_monitor_resolution_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure get_monitor_resolution_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-get-monitor-resolution",
|
||||
"gimp-get-monitor-resolution",
|
||||
"Get the monitor resolution as specified in the Preferences.",
|
||||
"Returns the resolution of the monitor in pixels/inch. This value is taken from the Preferences (or the windowing system if this is set in the Preferences) and there's no guarantee for the value to be reasonable.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { get_monitor_resolution_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
get_theme_dir_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -347,22 +159,6 @@ get_theme_dir_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure get_theme_dir_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-get-theme-dir",
|
||||
"gimp-get-theme-dir",
|
||||
"Get the directory of the current GUI theme.",
|
||||
"Returns a copy of the current GUI theme dir.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { get_theme_dir_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
get_color_configuration_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -381,22 +177,6 @@ get_color_configuration_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure get_color_configuration_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-get-color-configuration",
|
||||
"gimp-get-color-configuration",
|
||||
"Get a serialized version of the color management configuration.",
|
||||
"Returns a string that can be deserialized into a GimpColorConfig object representing the current color management configuration.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { get_color_configuration_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
get_module_load_inhibit_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -415,18 +195,203 @@ get_module_load_inhibit_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure get_module_load_inhibit_proc =
|
||||
void
|
||||
register_gimprc_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-get-module-load-inhibit",
|
||||
"gimp-get-module-load-inhibit",
|
||||
"Get the list of modules which should not be loaded.",
|
||||
"Returns a copy of the list of modules which should not be loaded.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { get_module_load_inhibit_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-gimprc-query
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
gimprc_query_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gimprc-query",
|
||||
"gimp-gimprc-query",
|
||||
"Queries the gimprc file parser for information on a specified token.",
|
||||
"This procedure is used to locate additional information contained in the gimprc file considered extraneous to the operation of the GIMP. Plug-ins that need configuration information can expect it will be stored in the user gimprc file and can use this procedure to retrieve it. This query procedure will return the value associated with the specified token. This corresponds _only_ to entries with the format: (<token> <value>). The value must be a string. Entries not corresponding to this format will cause warnings to be issued on gimprc parsing and will not be queryable.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("token",
|
||||
"token",
|
||||
"The token to query for",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("value",
|
||||
"value",
|
||||
"The value associated with the queried token",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-gimprc-set
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
gimprc_set_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gimprc-set",
|
||||
"gimp-gimprc-set",
|
||||
"Sets a gimprc token to a value and saves it in the gimprc.",
|
||||
"This procedure is used to add or change additional information in the gimprc file that is considered extraneous to the operation of the GIMP. Plug-ins that need configuration information can use this function to store it, and gimp_gimprc_query to retrieve it. This will accept _only_ string values in UTF-8 encoding.",
|
||||
"Seth Burgess",
|
||||
"Seth Burgess",
|
||||
"1999",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("token",
|
||||
"token",
|
||||
"The token to add or modify",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("value",
|
||||
"value",
|
||||
"The value to set the token to",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-get-default-comment
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
get_default_comment_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-get-default-comment",
|
||||
"gimp-get-default-comment",
|
||||
"Get the default image comment as specified in the Preferences.",
|
||||
"Returns a copy of the default image comment.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("comment",
|
||||
"comment",
|
||||
"Default Image Comment",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-get-monitor-resolution
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 2,
|
||||
get_monitor_resolution_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-get-monitor-resolution",
|
||||
"gimp-get-monitor-resolution",
|
||||
"Get the monitor resolution as specified in the Preferences.",
|
||||
"Returns the resolution of the monitor in pixels/inch. This value is taken from the Preferences (or the windowing system if this is set in the Preferences) and there's no guarantee for the value to be reasonable.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("xres",
|
||||
"xres",
|
||||
"X resolution",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("yres",
|
||||
"yres",
|
||||
"Y resolution",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-get-theme-dir
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
get_theme_dir_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-get-theme-dir",
|
||||
"gimp-get-theme-dir",
|
||||
"Get the directory of the current GUI theme.",
|
||||
"Returns a copy of the current GUI theme dir.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("theme-dir",
|
||||
"theme dir",
|
||||
"The GUI theme dir",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-get-color-configuration
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
get_color_configuration_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-get-color-configuration",
|
||||
"gimp-get-color-configuration",
|
||||
"Get a serialized version of the color management configuration.",
|
||||
"Returns a string that can be deserialized into a GimpColorConfig object representing the current color management configuration.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("config",
|
||||
"config",
|
||||
"Serialized color management configuration",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-get-module-load-inhibit
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
get_module_load_inhibit_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-get-module-load-inhibit",
|
||||
"gimp-get-module-load-inhibit",
|
||||
"Get the list of modules which should not be loaded.",
|
||||
"Returns a copy of the list of modules which should not be loaded.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("load-inhibit",
|
||||
"load inhibit",
|
||||
"The list of modules",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -32,82 +32,6 @@
|
|||
#include "core/gimpdatafactory.h"
|
||||
#include "core/gimpgradient.h"
|
||||
|
||||
static GimpProcedure gradients_popup_proc;
|
||||
static GimpProcedure gradients_close_popup_proc;
|
||||
static GimpProcedure gradients_set_popup_proc;
|
||||
|
||||
void
|
||||
register_gradient_select_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gradients_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gradients_popup_proc, 4, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("gradient-callback",
|
||||
"gradient callback",
|
||||
"The callback PDB proc to call when gradient selection is made",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("popup-title",
|
||||
"popup title",
|
||||
"Title to give the gradient popup window",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("initial-gradient",
|
||||
"initial gradient",
|
||||
"The name of the pattern to set as the first selected",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("sample-size",
|
||||
"sample size",
|
||||
"Size of the sample to return when the gradient is changed: (1 <= sample_size <= 10000)",
|
||||
1, 10000, 1,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gradients_close_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gradients_close_popup_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("gradient-callback",
|
||||
"gradient callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gradients_set_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gradients_set_popup_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("gradient-callback",
|
||||
"gradient callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("gradient-name",
|
||||
"gradient name",
|
||||
"The name of the gradient to set as selected",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
gradients_popup_invoker (GimpProcedure *procedure,
|
||||
|
@ -144,22 +68,6 @@ gradients_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure gradients_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gradients-popup",
|
||||
"gimp-gradients-popup",
|
||||
"Invokes the Gimp gradients selection.",
|
||||
"This procedure popups the gradients selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gradients_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
gradients_close_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -184,22 +92,6 @@ gradients_close_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure gradients_close_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gradients-close-popup",
|
||||
"gimp-gradients-close-popup",
|
||||
"Popdown the Gimp gradient selection.",
|
||||
"This procedure closes an opened gradient selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gradients_close_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
gradients_set_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -227,18 +119,111 @@ gradients_set_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure gradients_set_popup_proc =
|
||||
void
|
||||
register_gradient_select_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gradients-set-popup",
|
||||
"gimp-gradients-set-popup",
|
||||
"Sets the current gradient selection in a popup.",
|
||||
"Sets the current gradient selection in a popup.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gradients_set_popup_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-gradients-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 4, 0,
|
||||
gradients_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-popup",
|
||||
"gimp-gradients-popup",
|
||||
"Invokes the Gimp gradients selection.",
|
||||
"This procedure popups the gradients selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("gradient-callback",
|
||||
"gradient callback",
|
||||
"The callback PDB proc to call when gradient selection is made",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("popup-title",
|
||||
"popup title",
|
||||
"Title to give the gradient popup window",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("initial-gradient",
|
||||
"initial gradient",
|
||||
"The name of the pattern to set as the first selected",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("sample-size",
|
||||
"sample size",
|
||||
"Size of the sample to return when the gradient is changed: (1 <= sample_size <= 10000)",
|
||||
1, 10000, 1,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-gradients-close-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
gradients_close_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-close-popup",
|
||||
"gimp-gradients-close-popup",
|
||||
"Popdown the Gimp gradient selection.",
|
||||
"This procedure closes an opened gradient selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("gradient-callback",
|
||||
"gradient callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-gradients-set-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
gradients_set_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-set-popup",
|
||||
"gimp-gradients-set-popup",
|
||||
"Sets the current gradient selection in a popup.",
|
||||
"Sets the current gradient selection in a popup.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("gradient-callback",
|
||||
"gradient callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("gradient-name",
|
||||
"gradient name",
|
||||
"The name of the gradient to set as selected",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -36,154 +36,6 @@
|
|||
#include "core/gimpgradient.h"
|
||||
#include "core/gimplist.h"
|
||||
|
||||
static GimpProcedure gradients_refresh_proc;
|
||||
static GimpProcedure gradients_get_list_proc;
|
||||
static GimpProcedure gradients_sample_uniform_proc;
|
||||
static GimpProcedure gradients_sample_custom_proc;
|
||||
static GimpProcedure gradients_get_gradient_data_proc;
|
||||
|
||||
void
|
||||
register_gradients_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gradients_refresh
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gradients_refresh_proc, 0, 0);
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gradients_get_list
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gradients_get_list_proc, 1, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-gradients",
|
||||
"num gradients",
|
||||
"The number of loaded gradients",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("gradient-list",
|
||||
"gradient list",
|
||||
"The list of gradient names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gradients_sample_uniform
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gradients_sample_uniform_proc, 2, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("num-samples",
|
||||
"num samples",
|
||||
"The number of samples to take",
|
||||
2, G_MAXINT32, 2,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("array-length",
|
||||
"array length",
|
||||
"Length of the color_samples array (4 * num_samples)",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("color-samples",
|
||||
"color samples",
|
||||
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gradients_sample_custom
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gradients_sample_custom_proc, 3, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("num-samples",
|
||||
"num samples",
|
||||
"The number of samples to take",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_float_array ("positions",
|
||||
"positions",
|
||||
"The list of positions to sample along the gradient",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("array-length",
|
||||
"array length",
|
||||
"Length of the color_samples array (4 * num_samples)",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("color-samples",
|
||||
"color samples",
|
||||
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gradients_get_gradient_data
|
||||
*/
|
||||
procedure = gimp_procedure_init (&gradients_get_gradient_data_proc, 3, 3);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The gradient name (\"\" means current active gradient)",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("sample-size",
|
||||
"sample size",
|
||||
"Size of the sample to return when the gradient is changed: (1 <= sample_size <= 10000)",
|
||||
1, 10000, 1,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The gradient name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The gradient sample width (r,g,b,a)",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("grad-data",
|
||||
"grad data",
|
||||
"The gradient sample data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
gradients_refresh_invoker (GimpProcedure *procedure,
|
||||
|
@ -196,22 +48,6 @@ gradients_refresh_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, TRUE);
|
||||
}
|
||||
|
||||
static GimpProcedure gradients_refresh_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gradients-refresh",
|
||||
"gimp-gradients-refresh",
|
||||
"Refresh current gradients. This function always succeeds.",
|
||||
"This procedure retrieves all gradients currently in the user's gradient path and updates the gradient dialogs accordingly.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gradients_refresh_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
gradients_get_list_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -244,22 +80,6 @@ gradients_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure gradients_get_list_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gradients-get-list",
|
||||
"gimp-gradients-get-list",
|
||||
"Retrieve the list of loaded gradients.",
|
||||
"This procedure returns a list of the gradients that are currently loaded. You can later use the 'gimp-context-set-gradient' function to set the active gradient.",
|
||||
"Federico Mena Quintero",
|
||||
"Federico Mena Quintero",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gradients_get_list_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
gradients_sample_uniform_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -318,22 +138,6 @@ gradients_sample_uniform_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure gradients_sample_uniform_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gradients-sample-uniform",
|
||||
"gimp-gradients-sample-uniform",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-gradient-get-uniform-samples",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gradients_sample_uniform_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
gradients_sample_custom_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -391,22 +195,6 @@ gradients_sample_custom_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure gradients_sample_custom_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gradients-sample-custom",
|
||||
"gimp-gradients-sample-custom",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-custom-samples' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-custom-samples' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-gradient-get-custom-samples",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gradients_sample_custom_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
gradients_get_gradient_data_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -489,18 +277,205 @@ gradients_get_gradient_data_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure gradients_get_gradient_data_proc =
|
||||
void
|
||||
register_gradients_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-gradients-get-gradient-data",
|
||||
"gimp-gradients-get-gradient-data",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-gradient-get-uniform-samples",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { gradients_get_gradient_data_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-gradients-refresh
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 0,
|
||||
gradients_refresh_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-refresh",
|
||||
"gimp-gradients-refresh",
|
||||
"Refresh current gradients. This function always succeeds.",
|
||||
"This procedure retrieves all gradients currently in the user's gradient path and updates the gradient dialogs accordingly.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL);
|
||||
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-gradients-get-list
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 2,
|
||||
gradients_get_list_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-get-list",
|
||||
"gimp-gradients-get-list",
|
||||
"Retrieve the list of loaded gradients.",
|
||||
"This procedure returns a list of the gradients that are currently loaded. You can later use the 'gimp-context-set-gradient' function to set the active gradient.",
|
||||
"Federico Mena Quintero",
|
||||
"Federico Mena Quintero",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-gradients",
|
||||
"num gradients",
|
||||
"The number of loaded gradients",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("gradient-list",
|
||||
"gradient list",
|
||||
"The list of gradient names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-gradients-sample-uniform
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 2,
|
||||
gradients_sample_uniform_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-sample-uniform",
|
||||
"gimp-gradients-sample-uniform",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-gradient-get-uniform-samples");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("num-samples",
|
||||
"num samples",
|
||||
"The number of samples to take",
|
||||
2, G_MAXINT32, 2,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("array-length",
|
||||
"array length",
|
||||
"Length of the color_samples array (4 * num_samples)",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("color-samples",
|
||||
"color samples",
|
||||
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-gradients-sample-custom
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 2,
|
||||
gradients_sample_custom_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-sample-custom",
|
||||
"gimp-gradients-sample-custom",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-custom-samples' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-custom-samples' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-gradient-get-custom-samples");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("num-samples",
|
||||
"num samples",
|
||||
"The number of samples to take",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_float_array ("positions",
|
||||
"positions",
|
||||
"The list of positions to sample along the gradient",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("array-length",
|
||||
"array length",
|
||||
"Length of the color_samples array (4 * num_samples)",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("color-samples",
|
||||
"color samples",
|
||||
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-gradients-get-gradient-data
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 3,
|
||||
gradients_get_gradient_data_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-gradients-get-gradient-data",
|
||||
"gimp-gradients-get-gradient-data",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-gradient-get-uniform-samples' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-gradient-get-uniform-samples");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The gradient name (\"\" means current active gradient)",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("sample-size",
|
||||
"sample size",
|
||||
"Size of the sample to return when the gradient is changed: (1 <= sample_size <= 10000)",
|
||||
1, 10000, 1,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("reverse",
|
||||
"reverse",
|
||||
"Use the reverse gradient (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The gradient name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The gradient sample width (r,g,b,a)",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_float_array ("grad-data",
|
||||
"grad data",
|
||||
"The gradient sample data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -35,229 +35,6 @@
|
|||
#include "core/gimpimage-grid.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
static GimpProcedure image_grid_get_spacing_proc;
|
||||
static GimpProcedure image_grid_set_spacing_proc;
|
||||
static GimpProcedure image_grid_get_offset_proc;
|
||||
static GimpProcedure image_grid_set_offset_proc;
|
||||
static GimpProcedure image_grid_get_foreground_color_proc;
|
||||
static GimpProcedure image_grid_set_foreground_color_proc;
|
||||
static GimpProcedure image_grid_get_background_color_proc;
|
||||
static GimpProcedure image_grid_set_background_color_proc;
|
||||
static GimpProcedure image_grid_get_style_proc;
|
||||
static GimpProcedure image_grid_set_style_proc;
|
||||
|
||||
void
|
||||
register_grid_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* image_grid_get_spacing
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_get_spacing_proc, 1, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("xspacing",
|
||||
"xspacing",
|
||||
"The image's grid horizontal spacing",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("yspacing",
|
||||
"yspacing",
|
||||
"The image's grid vertical spacing",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_grid_set_spacing
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_set_spacing_proc, 3, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("xspacing",
|
||||
"xspacing",
|
||||
"The image's grid horizontal spacing",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("yspacing",
|
||||
"yspacing",
|
||||
"The image's grid vertical spacing",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_grid_get_offset
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_get_offset_proc, 1, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("xoffset",
|
||||
"xoffset",
|
||||
"The image's grid horizontal offset",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("yoffset",
|
||||
"yoffset",
|
||||
"The image's grid vertical offset",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_grid_set_offset
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_set_offset_proc, 3, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("xoffset",
|
||||
"xoffset",
|
||||
"The image's grid horizontal offset",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("yoffset",
|
||||
"yoffset",
|
||||
"The image's grid vertical offset",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_grid_get_foreground_color
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_get_foreground_color_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_rgb ("fgcolor",
|
||||
"fgcolor",
|
||||
"The image's grid foreground color",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_grid_set_foreground_color
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_set_foreground_color_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_rgb ("fgcolor",
|
||||
"fgcolor",
|
||||
"The new foreground color",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_grid_get_background_color
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_get_background_color_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_rgb ("bgcolor",
|
||||
"bgcolor",
|
||||
"The image's grid background color",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_grid_set_background_color
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_set_background_color_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_rgb ("bgcolor",
|
||||
"bgcolor",
|
||||
"The new background color",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_grid_get_style
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_get_style_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("style",
|
||||
"style",
|
||||
"The image's grid style: { GIMP_GRID_DOTS (0), GIMP_GRID_INTERSECTIONS (1), GIMP_GRID_ON_OFF_DASH (2), GIMP_GRID_DOUBLE_DASH (3), GIMP_GRID_SOLID (4) }",
|
||||
GIMP_TYPE_GRID_STYLE,
|
||||
GIMP_GRID_DOTS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_grid_set_style
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_grid_set_style_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("style",
|
||||
"style",
|
||||
"The image's grid style: { GIMP_GRID_DOTS (0), GIMP_GRID_INTERSECTIONS (1), GIMP_GRID_ON_OFF_DASH (2), GIMP_GRID_DOUBLE_DASH (3), GIMP_GRID_SOLID (4) }",
|
||||
GIMP_TYPE_GRID_STYLE,
|
||||
GIMP_GRID_DOTS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
image_grid_get_spacing_invoker (GimpProcedure *procedure,
|
||||
|
@ -298,22 +75,6 @@ image_grid_get_spacing_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_get_spacing_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-get-spacing",
|
||||
"gimp-image-grid-get-spacing",
|
||||
"Gets the spacing of an image's grid.",
|
||||
"This procedure retrieves the horizontal and vertical spacing of an image's grid. It takes the image as parameter.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_get_spacing_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_grid_set_spacing_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -346,22 +107,6 @@ image_grid_set_spacing_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_set_spacing_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-set-spacing",
|
||||
"gimp-image-grid-set-spacing",
|
||||
"Sets the spacing of an image's grid.",
|
||||
"This procedure sets the horizontal and vertical spacing of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_set_spacing_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_grid_get_offset_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -401,22 +146,6 @@ image_grid_get_offset_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_get_offset_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-get-offset",
|
||||
"gimp-image-grid-get-offset",
|
||||
"Gets the offset of an image's grid.",
|
||||
"This procedure retrieves the horizontal and vertical offset of an image's grid. It takes the image as parameter.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_get_offset_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_grid_set_offset_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -449,22 +178,6 @@ image_grid_set_offset_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_set_offset_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-set-offset",
|
||||
"gimp-image-grid-set-offset",
|
||||
"Sets the offset of an image's grid.",
|
||||
"This procedure sets the horizontal and vertical offset of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_set_offset_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_grid_get_foreground_color_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -497,22 +210,6 @@ image_grid_get_foreground_color_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_get_foreground_color_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-get-foreground-color",
|
||||
"gimp-image-grid-get-foreground-color",
|
||||
"Sets the foreground color of an image's grid.",
|
||||
"This procedure gets the foreground color of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_get_foreground_color_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_grid_set_foreground_color_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -540,22 +237,6 @@ image_grid_set_foreground_color_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_set_foreground_color_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-set-foreground-color",
|
||||
"gimp-image-grid-set-foreground-color",
|
||||
"Gets the foreground color of an image's grid.",
|
||||
"This procedure sets the foreground color of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_set_foreground_color_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_grid_get_background_color_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -588,22 +269,6 @@ image_grid_get_background_color_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_get_background_color_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-get-background-color",
|
||||
"gimp-image-grid-get-background-color",
|
||||
"Sets the background color of an image's grid.",
|
||||
"This procedure gets the background color of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_get_background_color_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_grid_set_background_color_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -631,22 +296,6 @@ image_grid_set_background_color_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_set_background_color_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-set-background-color",
|
||||
"gimp-image-grid-set-background-color",
|
||||
"Gets the background color of an image's grid.",
|
||||
"This procedure sets the background color of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_set_background_color_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_grid_get_style_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -679,22 +328,6 @@ image_grid_get_style_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_get_style_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-get-style",
|
||||
"gimp-image-grid-get-style",
|
||||
"Gets the style of an image's grid.",
|
||||
"This procedure retrieves the style of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_get_style_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_grid_set_style_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -722,18 +355,335 @@ image_grid_set_style_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_grid_set_style_proc =
|
||||
void
|
||||
register_grid_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-grid-set-style",
|
||||
"gimp-image-grid-set-style",
|
||||
"Sets the style unit of an image's grid.",
|
||||
"This procedure sets the style of an image's grid. It takes the image and the new style as parameters.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_grid_set_style_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-image-grid-get-spacing
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 2,
|
||||
image_grid_get_spacing_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-get-spacing",
|
||||
"gimp-image-grid-get-spacing",
|
||||
"Gets the spacing of an image's grid.",
|
||||
"This procedure retrieves the horizontal and vertical spacing of an image's grid. It takes the image as parameter.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("xspacing",
|
||||
"xspacing",
|
||||
"The image's grid horizontal spacing",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("yspacing",
|
||||
"yspacing",
|
||||
"The image's grid vertical spacing",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-grid-set-spacing
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 0,
|
||||
image_grid_set_spacing_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-set-spacing",
|
||||
"gimp-image-grid-set-spacing",
|
||||
"Sets the spacing of an image's grid.",
|
||||
"This procedure sets the horizontal and vertical spacing of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("xspacing",
|
||||
"xspacing",
|
||||
"The image's grid horizontal spacing",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("yspacing",
|
||||
"yspacing",
|
||||
"The image's grid vertical spacing",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-grid-get-offset
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 2,
|
||||
image_grid_get_offset_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-get-offset",
|
||||
"gimp-image-grid-get-offset",
|
||||
"Gets the offset of an image's grid.",
|
||||
"This procedure retrieves the horizontal and vertical offset of an image's grid. It takes the image as parameter.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("xoffset",
|
||||
"xoffset",
|
||||
"The image's grid horizontal offset",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_double ("yoffset",
|
||||
"yoffset",
|
||||
"The image's grid vertical offset",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-grid-set-offset
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 0,
|
||||
image_grid_set_offset_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-set-offset",
|
||||
"gimp-image-grid-set-offset",
|
||||
"Sets the offset of an image's grid.",
|
||||
"This procedure sets the horizontal and vertical offset of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("xoffset",
|
||||
"xoffset",
|
||||
"The image's grid horizontal offset",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("yoffset",
|
||||
"yoffset",
|
||||
"The image's grid vertical offset",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-grid-get-foreground-color
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
image_grid_get_foreground_color_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-get-foreground-color",
|
||||
"gimp-image-grid-get-foreground-color",
|
||||
"Sets the foreground color of an image's grid.",
|
||||
"This procedure gets the foreground color of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_rgb ("fgcolor",
|
||||
"fgcolor",
|
||||
"The image's grid foreground color",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-grid-set-foreground-color
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
image_grid_set_foreground_color_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-set-foreground-color",
|
||||
"gimp-image-grid-set-foreground-color",
|
||||
"Gets the foreground color of an image's grid.",
|
||||
"This procedure sets the foreground color of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_rgb ("fgcolor",
|
||||
"fgcolor",
|
||||
"The new foreground color",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-grid-get-background-color
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
image_grid_get_background_color_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-get-background-color",
|
||||
"gimp-image-grid-get-background-color",
|
||||
"Sets the background color of an image's grid.",
|
||||
"This procedure gets the background color of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_rgb ("bgcolor",
|
||||
"bgcolor",
|
||||
"The image's grid background color",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-grid-set-background-color
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
image_grid_set_background_color_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-set-background-color",
|
||||
"gimp-image-grid-set-background-color",
|
||||
"Gets the background color of an image's grid.",
|
||||
"This procedure sets the background color of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_rgb ("bgcolor",
|
||||
"bgcolor",
|
||||
"The new background color",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-grid-get-style
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
image_grid_get_style_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-get-style",
|
||||
"gimp-image-grid-get-style",
|
||||
"Gets the style of an image's grid.",
|
||||
"This procedure retrieves the style of an image's grid.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("style",
|
||||
"style",
|
||||
"The image's grid style: { GIMP_GRID_DOTS (0), GIMP_GRID_INTERSECTIONS (1), GIMP_GRID_ON_OFF_DASH (2), GIMP_GRID_DOUBLE_DASH (3), GIMP_GRID_SOLID (4) }",
|
||||
GIMP_TYPE_GRID_STYLE,
|
||||
GIMP_GRID_DOTS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-grid-set-style
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
image_grid_set_style_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-grid-set-style",
|
||||
"gimp-image-grid-set-style",
|
||||
"Sets the style unit of an image's grid.",
|
||||
"This procedure sets the style of an image's grid. It takes the image and the new style as parameters.",
|
||||
"Sylvain Foret",
|
||||
"Sylvain Foret",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("style",
|
||||
"style",
|
||||
"The image's grid style: { GIMP_GRID_DOTS (0), GIMP_GRID_INTERSECTIONS (1), GIMP_GRID_ON_OFF_DASH (2), GIMP_GRID_DOUBLE_DASH (3), GIMP_GRID_SOLID (4) }",
|
||||
GIMP_TYPE_GRID_STYLE,
|
||||
GIMP_GRID_DOTS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -32,160 +32,6 @@
|
|||
#include "core/gimpimage-undo-push.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
static GimpProcedure image_add_hguide_proc;
|
||||
static GimpProcedure image_add_vguide_proc;
|
||||
static GimpProcedure image_delete_guide_proc;
|
||||
static GimpProcedure image_find_next_guide_proc;
|
||||
static GimpProcedure image_get_guide_orientation_proc;
|
||||
static GimpProcedure image_get_guide_position_proc;
|
||||
|
||||
void
|
||||
register_guides_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* image_add_hguide
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_add_hguide_proc, 2, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("yposition",
|
||||
"yposition",
|
||||
"The guide's y-offset from top of image",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The new guide",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_add_vguide
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_add_vguide_proc, 2, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("xposition",
|
||||
"xposition",
|
||||
"The guide's x-offset from left of image",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The new guide",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_delete_guide
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_delete_guide_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The ID of the guide to be removed",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_find_next_guide
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_find_next_guide_proc, 2, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The ID of the current guide (0 if first invocation)",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_uint ("next-guide",
|
||||
"next guide",
|
||||
"The next guide's ID",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_get_guide_orientation
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_get_guide_orientation_proc, 2, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The guide",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_enum ("orientation",
|
||||
"orientation",
|
||||
"The guide's orientation: { GIMP_ORIENTATION_HORIZONTAL (0), GIMP_ORIENTATION_VERTICAL (1) }",
|
||||
GIMP_TYPE_ORIENTATION_TYPE,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->values[0]),
|
||||
GIMP_ORIENTATION_UNKNOWN);
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_get_guide_position
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_get_guide_position_proc, 2, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The guide",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("position",
|
||||
"position",
|
||||
"The guide's position relative to top or left of image",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
image_add_hguide_invoker (GimpProcedure *procedure,
|
||||
|
@ -224,22 +70,6 @@ image_add_hguide_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_add_hguide_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-add-hguide",
|
||||
"gimp-image-add-hguide",
|
||||
"Add a horizontal guide to an image.",
|
||||
"This procedure adds a horizontal guide to an image. It takes the input image and the y-position of the new guide as parameters. It returns the guide ID of the new guide.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_add_hguide_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_add_vguide_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -277,22 +107,6 @@ image_add_vguide_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_add_vguide_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-add-vguide",
|
||||
"gimp-image-add-vguide",
|
||||
"Add a vertical guide to an image.",
|
||||
"This procedure adds a vertical guide to an image. It takes the input image and the x-position of the new guide as parameters. It returns the guide ID of the new guide.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_add_vguide_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_delete_guide_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -320,22 +134,6 @@ image_delete_guide_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_delete_guide_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-delete-guide",
|
||||
"gimp-image-delete-guide",
|
||||
"Deletes a guide from an image.",
|
||||
"This procedure takes an image and a guide ID as input and removes the specified guide from the specified image.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_delete_guide_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_find_next_guide_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -368,22 +166,6 @@ image_find_next_guide_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_find_next_guide_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-find-next-guide",
|
||||
"gimp-image-find-next-guide",
|
||||
"Find next guide on an image.",
|
||||
"This procedure takes an image and a guide ID as input and finds the guide ID of the successor of the given guide ID in the image's guide list. If the supplied guide ID is 0, the procedure will return the first Guide. The procedure will return 0 if given the final guide ID as an argument or the image has no guides.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_find_next_guide_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_get_guide_orientation_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -418,22 +200,6 @@ image_get_guide_orientation_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_get_guide_orientation_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-get-guide-orientation",
|
||||
"gimp-image-get-guide-orientation",
|
||||
"Get orientation of a guide on an image.",
|
||||
"This procedure takes an image and a guide ID as input and returns the orientations of the guide.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_get_guide_orientation_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_get_guide_position_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -468,18 +234,222 @@ image_get_guide_position_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_get_guide_position_proc =
|
||||
void
|
||||
register_guides_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-get-guide-position",
|
||||
"gimp-image-get-guide-position",
|
||||
"Get position of a guide on an image.",
|
||||
"This procedure takes an image and a guide ID as input and returns the position of the guide relative to the top or left of the image.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_get_guide_position_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-image-add-hguide
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 1,
|
||||
image_add_hguide_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-add-hguide",
|
||||
"gimp-image-add-hguide",
|
||||
"Add a horizontal guide to an image.",
|
||||
"This procedure adds a horizontal guide to an image. It takes the input image and the y-position of the new guide as parameters. It returns the guide ID of the new guide.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("yposition",
|
||||
"yposition",
|
||||
"The guide's y-offset from top of image",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The new guide",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-add-vguide
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 1,
|
||||
image_add_vguide_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-add-vguide",
|
||||
"gimp-image-add-vguide",
|
||||
"Add a vertical guide to an image.",
|
||||
"This procedure adds a vertical guide to an image. It takes the input image and the x-position of the new guide as parameters. It returns the guide ID of the new guide.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("xposition",
|
||||
"xposition",
|
||||
"The guide's x-offset from left of image",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The new guide",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-delete-guide
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
image_delete_guide_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-delete-guide",
|
||||
"gimp-image-delete-guide",
|
||||
"Deletes a guide from an image.",
|
||||
"This procedure takes an image and a guide ID as input and removes the specified guide from the specified image.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The ID of the guide to be removed",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-find-next-guide
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 1,
|
||||
image_find_next_guide_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-find-next-guide",
|
||||
"gimp-image-find-next-guide",
|
||||
"Find next guide on an image.",
|
||||
"This procedure takes an image and a guide ID as input and finds the guide ID of the successor of the given guide ID in the image's guide list. If the supplied guide ID is 0, the procedure will return the first Guide. The procedure will return 0 if given the final guide ID as an argument or the image has no guides.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The ID of the current guide (0 if first invocation)",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_uint ("next-guide",
|
||||
"next guide",
|
||||
"The next guide's ID",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-get-guide-orientation
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 1,
|
||||
image_get_guide_orientation_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-get-guide-orientation",
|
||||
"gimp-image-get-guide-orientation",
|
||||
"Get orientation of a guide on an image.",
|
||||
"This procedure takes an image and a guide ID as input and returns the orientations of the guide.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The guide",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_enum ("orientation",
|
||||
"orientation",
|
||||
"The guide's orientation: { GIMP_ORIENTATION_HORIZONTAL (0), GIMP_ORIENTATION_VERTICAL (1) }",
|
||||
GIMP_TYPE_ORIENTATION_TYPE,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->values[0]),
|
||||
GIMP_ORIENTATION_UNKNOWN);
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-get-guide-position
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 1,
|
||||
image_get_guide_position_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-get-guide-position",
|
||||
"gimp-image-get-guide-position",
|
||||
"Get position of a guide on an image.",
|
||||
"This procedure takes an image and a guide ID as input and returns the position of the guide relative to the top or left of the image.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_uint ("guide",
|
||||
"guide",
|
||||
"The guide",
|
||||
1, G_MAXUINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("position",
|
||||
"position",
|
||||
"The guide's position relative to top or left of image",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -32,34 +32,6 @@
|
|||
#include "plug-in/plug-in.h"
|
||||
#include "plug-in/plug-ins.h"
|
||||
|
||||
static GimpProcedure help_proc;
|
||||
|
||||
void
|
||||
register_help_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* help
|
||||
*/
|
||||
procedure = gimp_procedure_init (&help_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("help-domain",
|
||||
"help domain",
|
||||
"The help domain in which help_id is registered",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("help-id",
|
||||
"help id",
|
||||
"The help page's ID",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
help_invoker (GimpProcedure *procedure,
|
||||
|
@ -87,18 +59,41 @@ help_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure help_proc =
|
||||
void
|
||||
register_help_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-help",
|
||||
"gimp-help",
|
||||
"Load a help page.",
|
||||
"This procedure loads the specified help page into the helpbrowser or what ever is configured as help viewer. The help page is identified by its domain and ID: if help_domain is NULL, we use the help_domain which was registered using the gimp-plugin-help-register procedure. If help_domain is NULL and no help domain was registered, the help domain of the main GIMP installation is used.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2000",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { help_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-help
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
help_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-help",
|
||||
"gimp-help",
|
||||
"Load a help page.",
|
||||
"This procedure loads the specified help page into the helpbrowser or what ever is configured as help viewer. The help page is identified by its domain and ID: if help_domain is NULL, we use the help_domain which was registered using the gimp-plugin-help-register procedure. If help_domain is NULL and no help domain was registered, the help domain of the main GIMP installation is used.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2000",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("help-domain",
|
||||
"help domain",
|
||||
"The help domain in which help_id is registered",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("help-id",
|
||||
"help id",
|
||||
"The help page's ID",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
5204
app/pdb/image_cmds.c
5204
app/pdb/image_cmds.c
File diff suppressed because it is too large
Load Diff
2437
app/pdb/layer_cmds.c
2437
app/pdb/layer_cmds.c
File diff suppressed because it is too large
Load Diff
|
@ -34,55 +34,6 @@
|
|||
#include "plug-in/plug-in-progress.h"
|
||||
#include "plug-in/plug-in.h"
|
||||
|
||||
static GimpProcedure message_proc;
|
||||
static GimpProcedure message_get_handler_proc;
|
||||
static GimpProcedure message_set_handler_proc;
|
||||
|
||||
void
|
||||
register_message_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* message
|
||||
*/
|
||||
procedure = gimp_procedure_init (&message_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("message",
|
||||
"message",
|
||||
"Message to display in the dialog",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* message_get_handler
|
||||
*/
|
||||
procedure = gimp_procedure_init (&message_get_handler_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("handler",
|
||||
"handler",
|
||||
"The current handler type: { GIMP_MESSAGE_BOX (0), GIMP_CONSOLE (1), GIMP_ERROR_CONSOLE (2) }",
|
||||
GIMP_TYPE_MESSAGE_HANDLER_TYPE,
|
||||
GIMP_MESSAGE_BOX,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* message_set_handler
|
||||
*/
|
||||
procedure = gimp_procedure_init (&message_set_handler_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("handler",
|
||||
"handler",
|
||||
"The new handler type: { GIMP_MESSAGE_BOX (0), GIMP_CONSOLE (1), GIMP_ERROR_CONSOLE (2) }",
|
||||
GIMP_TYPE_MESSAGE_HANDLER_TYPE,
|
||||
GIMP_MESSAGE_BOX,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
message_invoker (GimpProcedure *procedure,
|
||||
|
@ -107,22 +58,6 @@ message_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure message_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-message",
|
||||
"gimp-message",
|
||||
"Displays a dialog box with a message.",
|
||||
"Displays a dialog box with a message. Useful for status or error reporting. The message must be in UTF-8 encoding.",
|
||||
"Manish Singh",
|
||||
"Manish Singh",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { message_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
message_get_handler_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -141,22 +76,6 @@ message_get_handler_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure message_get_handler_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-message-get-handler",
|
||||
"gimp-message-get-handler",
|
||||
"Returns the current state of where warning messages are displayed.",
|
||||
"This procedure returns the way g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.",
|
||||
"Manish Singh",
|
||||
"Manish Singh",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { message_get_handler_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
message_set_handler_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -177,18 +96,84 @@ message_set_handler_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure message_set_handler_proc =
|
||||
void
|
||||
register_message_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-message-set-handler",
|
||||
"gimp-message-set-handler",
|
||||
"Controls where warning messages are displayed.",
|
||||
"This procedure controls how g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.",
|
||||
"Manish Singh",
|
||||
"Manish Singh",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { message_set_handler_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-message
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
message_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-message",
|
||||
"gimp-message",
|
||||
"Displays a dialog box with a message.",
|
||||
"Displays a dialog box with a message. Useful for status or error reporting. The message must be in UTF-8 encoding.",
|
||||
"Manish Singh",
|
||||
"Manish Singh",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("message",
|
||||
"message",
|
||||
"Message to display in the dialog",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-message-get-handler
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
message_get_handler_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-message-get-handler",
|
||||
"gimp-message-get-handler",
|
||||
"Returns the current state of where warning messages are displayed.",
|
||||
"This procedure returns the way g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.",
|
||||
"Manish Singh",
|
||||
"Manish Singh",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("handler",
|
||||
"handler",
|
||||
"The current handler type: { GIMP_MESSAGE_BOX (0), GIMP_CONSOLE (1), GIMP_ERROR_CONSOLE (2) }",
|
||||
GIMP_TYPE_MESSAGE_HANDLER_TYPE,
|
||||
GIMP_MESSAGE_BOX,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-message-set-handler
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
message_set_handler_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-message-set-handler",
|
||||
"gimp-message-set-handler",
|
||||
"Controls where warning messages are displayed.",
|
||||
"This procedure controls how g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.",
|
||||
"Manish Singh",
|
||||
"Manish Singh",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("handler",
|
||||
"handler",
|
||||
"The new handler type: { GIMP_MESSAGE_BOX (0), GIMP_CONSOLE (1), GIMP_ERROR_CONSOLE (2) }",
|
||||
GIMP_TYPE_MESSAGE_HANDLER_TYPE,
|
||||
GIMP_MESSAGE_BOX,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -44,53 +44,6 @@
|
|||
|
||||
#include "core/gimp.h"
|
||||
|
||||
static GimpProcedure version_proc;
|
||||
static GimpProcedure getpid_proc;
|
||||
static GimpProcedure quit_proc;
|
||||
|
||||
void
|
||||
register_misc_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* version
|
||||
*/
|
||||
procedure = gimp_procedure_init (&version_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("version",
|
||||
"version",
|
||||
"The gimp version",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* getpid
|
||||
*/
|
||||
procedure = gimp_procedure_init (&getpid_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("pid",
|
||||
"pid",
|
||||
"The PID",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* quit
|
||||
*/
|
||||
procedure = gimp_procedure_init (&quit_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("force",
|
||||
"force",
|
||||
"Flag specifying whether to force the gimp to or exit normally",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
version_invoker (GimpProcedure *procedure,
|
||||
|
@ -110,22 +63,6 @@ version_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure version_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-version",
|
||||
"gimp-version",
|
||||
"Returns the host gimp version.",
|
||||
"This procedure returns the version number of the currently running gimp.",
|
||||
"Manish Singh",
|
||||
"Manish Singh",
|
||||
"1999",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { version_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
getpid_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -144,22 +81,6 @@ getpid_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure getpid_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-getpid",
|
||||
"gimp-getpid",
|
||||
"Returns the PID of the host gimp process.",
|
||||
"This procedure returns the process ID of the currently running gimp.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { getpid_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
quit_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -180,18 +101,82 @@ quit_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure quit_proc =
|
||||
void
|
||||
register_misc_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-quit",
|
||||
"gimp-quit",
|
||||
"Causes the gimp to exit gracefully.",
|
||||
"The internal procedure which can either be used to make the gimp quit. If there are unsaved images in an interactive GIMP session, the user will be asked for confirmation. If force is TRUE, the application is quit without querying the user to save any dirty images.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { quit_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-version
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
version_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-version",
|
||||
"gimp-version",
|
||||
"Returns the host gimp version.",
|
||||
"This procedure returns the version number of the currently running gimp.",
|
||||
"Manish Singh",
|
||||
"Manish Singh",
|
||||
"1999",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("version",
|
||||
"version",
|
||||
"The gimp version",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-getpid
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
getpid_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-getpid",
|
||||
"gimp-getpid",
|
||||
"Returns the PID of the host gimp process.",
|
||||
"This procedure returns the process ID of the currently running gimp.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("pid",
|
||||
"pid",
|
||||
"The PID",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-quit
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
quit_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-quit",
|
||||
"gimp-quit",
|
||||
"Causes the gimp to exit gracefully.",
|
||||
"The internal procedure which can either be used to make the gimp quit. If there are unsaved images in an interactive GIMP session, the user will be asked for confirmation. If force is TRUE, the application is quit without querying the user to save any dirty images.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("force",
|
||||
"force",
|
||||
"Flag specifying whether to force the gimp to or exit normally",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -31,76 +31,6 @@
|
|||
#include "core/gimp.h"
|
||||
#include "core/gimpdatafactory.h"
|
||||
|
||||
static GimpProcedure palettes_popup_proc;
|
||||
static GimpProcedure palettes_close_popup_proc;
|
||||
static GimpProcedure palettes_set_popup_proc;
|
||||
|
||||
void
|
||||
register_palette_select_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* palettes_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&palettes_popup_proc, 3, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette-callback",
|
||||
"palette callback",
|
||||
"The callback PDB proc to call when palette selection is made",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("popup-title",
|
||||
"popup title",
|
||||
"Title to give the palette popup window",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("initial-palette",
|
||||
"initial palette",
|
||||
"The name of the palette to set as the first selected",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* palettes_close_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&palettes_close_popup_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette-callback",
|
||||
"palette callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* palettes_set_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&palettes_set_popup_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette-callback",
|
||||
"palette callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette-name",
|
||||
"palette name",
|
||||
"The name of the palette to set as selected",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
palettes_popup_invoker (GimpProcedure *procedure,
|
||||
|
@ -131,22 +61,6 @@ palettes_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure palettes_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-palettes-popup",
|
||||
"gimp-palettes-popup",
|
||||
"Invokes the Gimp palette selection.",
|
||||
"This procedure popups the palette selection dialog.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { palettes_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
palettes_close_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -171,22 +85,6 @@ palettes_close_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure palettes_close_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-palettes-close-popup",
|
||||
"gimp-palettes-close-popup",
|
||||
"Popdown the Gimp palette selection.",
|
||||
"This procedure closes an opened palette selection dialog.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { palettes_close_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
palettes_set_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -214,18 +112,105 @@ palettes_set_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure palettes_set_popup_proc =
|
||||
void
|
||||
register_palette_select_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-palettes-set-popup",
|
||||
"gimp-palettes-set-popup",
|
||||
"Sets the current palette selection in a popup.",
|
||||
"Sets the current palette selection in a popup.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { palettes_set_popup_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-palettes-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 0,
|
||||
palettes_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-palettes-popup",
|
||||
"gimp-palettes-popup",
|
||||
"Invokes the Gimp palette selection.",
|
||||
"This procedure popups the palette selection dialog.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette-callback",
|
||||
"palette callback",
|
||||
"The callback PDB proc to call when palette selection is made",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("popup-title",
|
||||
"popup title",
|
||||
"Title to give the palette popup window",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("initial-palette",
|
||||
"initial palette",
|
||||
"The name of the palette to set as the first selected",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-palettes-close-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
palettes_close_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-palettes-close-popup",
|
||||
"gimp-palettes-close-popup",
|
||||
"Popdown the Gimp palette selection.",
|
||||
"This procedure closes an opened palette selection dialog.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette-callback",
|
||||
"palette callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-palettes-set-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
palettes_set_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-palettes-set-popup",
|
||||
"gimp-palettes-set-popup",
|
||||
"Sets the current palette selection in a popup.",
|
||||
"Sets the current palette selection in a popup.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette-callback",
|
||||
"palette callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("palette-name",
|
||||
"palette name",
|
||||
"The name of the palette to set as selected",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -38,104 +38,6 @@
|
|||
#include "core/gimplist.h"
|
||||
#include "core/gimppalette.h"
|
||||
|
||||
static GimpProcedure palettes_refresh_proc;
|
||||
static GimpProcedure palettes_get_list_proc;
|
||||
static GimpProcedure palettes_get_palette_proc;
|
||||
static GimpProcedure palettes_get_palette_entry_proc;
|
||||
|
||||
void
|
||||
register_palettes_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* palettes_refresh
|
||||
*/
|
||||
procedure = gimp_procedure_init (&palettes_refresh_proc, 0, 0);
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* palettes_get_list
|
||||
*/
|
||||
procedure = gimp_procedure_init (&palettes_get_list_proc, 1, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-palettes",
|
||||
"num palettes",
|
||||
"The number of palettes in the list",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("palette-list",
|
||||
"palette list",
|
||||
"The list of palette names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* palettes_get_palette
|
||||
*/
|
||||
procedure = gimp_procedure_init (&palettes_get_palette_proc, 0, 2);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The palette name",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-colors",
|
||||
"num colors",
|
||||
"The palette num_colors",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* palettes_get_palette_entry
|
||||
*/
|
||||
procedure = gimp_procedure_init (&palettes_get_palette_entry_proc, 2, 3);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The palette name (\"\" means currently active palette)",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("entry-num",
|
||||
"entry num",
|
||||
"The entry to retrieve",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The palette name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-colors",
|
||||
"num colors",
|
||||
"The palette num_colors",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_rgb ("color",
|
||||
"color",
|
||||
"The color requested",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
palettes_refresh_invoker (GimpProcedure *procedure,
|
||||
|
@ -148,22 +50,6 @@ palettes_refresh_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, TRUE);
|
||||
}
|
||||
|
||||
static GimpProcedure palettes_refresh_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-palettes-refresh",
|
||||
"gimp-palettes-refresh",
|
||||
"Refreshes current palettes. This function always succeeds.",
|
||||
"This procedure retrieves all palettes currently in the user's palette path and updates the palette dialogs accordingly.",
|
||||
"Adrian Likins <adrian@gimp.org>",
|
||||
"Adrian Likins",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { palettes_refresh_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
palettes_get_list_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -196,22 +82,6 @@ palettes_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure palettes_get_list_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-palettes-get-list",
|
||||
"gimp-palettes-get-list",
|
||||
"Retrieves a list of all of the available palettes",
|
||||
"This procedure returns a complete listing of available palettes. Each name returned can be used as input to the command 'gimp-context-set-palette'.",
|
||||
"Nathan Summers <rock@gimp.org>",
|
||||
"Nathan Summers",
|
||||
"2001",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { palettes_get_list_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
palettes_get_palette_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -245,22 +115,6 @@ palettes_get_palette_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure palettes_get_palette_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-palettes-get-palette",
|
||||
"gimp-palettes-get-palette",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-palette' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-palette' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-context-get-palette",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { palettes_get_palette_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
palettes_get_palette_entry_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -323,18 +177,144 @@ palettes_get_palette_entry_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure palettes_get_palette_entry_proc =
|
||||
void
|
||||
register_palettes_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-palettes-get-palette-entry",
|
||||
"gimp-palettes-get-palette-entry",
|
||||
"This procedure is deprecated! Use 'gimp-palette-entry-get-color' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-palette-entry-get-color' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-palette-entry-get-color",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { palettes_get_palette_entry_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-palettes-refresh
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 0,
|
||||
palettes_refresh_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-palettes-refresh",
|
||||
"gimp-palettes-refresh",
|
||||
"Refreshes current palettes. This function always succeeds.",
|
||||
"This procedure retrieves all palettes currently in the user's palette path and updates the palette dialogs accordingly.",
|
||||
"Adrian Likins <adrian@gimp.org>",
|
||||
"Adrian Likins",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-palettes-get-list
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 2,
|
||||
palettes_get_list_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-palettes-get-list",
|
||||
"gimp-palettes-get-list",
|
||||
"Retrieves a list of all of the available palettes",
|
||||
"This procedure returns a complete listing of available palettes. Each name returned can be used as input to the command 'gimp-context-set-palette'.",
|
||||
"Nathan Summers <rock@gimp.org>",
|
||||
"Nathan Summers",
|
||||
"2001",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-palettes",
|
||||
"num palettes",
|
||||
"The number of palettes in the list",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("palette-list",
|
||||
"palette list",
|
||||
"The list of palette names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-palettes-get-palette
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 2,
|
||||
palettes_get_palette_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-palettes-get-palette",
|
||||
"gimp-palettes-get-palette",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-palette' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-palette' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-context-get-palette");
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The palette name",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-colors",
|
||||
"num colors",
|
||||
"The palette num_colors",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-palettes-get-palette-entry
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 3,
|
||||
palettes_get_palette_entry_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-palettes-get-palette-entry",
|
||||
"gimp-palettes-get-palette-entry",
|
||||
"This procedure is deprecated! Use 'gimp-palette-entry-get-color' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-palette-entry-get-color' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-palette-entry-get-color");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The palette name (\"\" means currently active palette)",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("entry-num",
|
||||
"entry num",
|
||||
"The entry to retrieve",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The palette name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-colors",
|
||||
"num colors",
|
||||
"The palette num_colors",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_rgb ("color",
|
||||
"color",
|
||||
"The color requested",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
1372
app/pdb/paths_cmds.c
1372
app/pdb/paths_cmds.c
File diff suppressed because it is too large
Load Diff
|
@ -36,88 +36,6 @@
|
|||
#include "core/gimplist.h"
|
||||
#include "core/gimppattern.h"
|
||||
|
||||
static GimpProcedure pattern_get_info_proc;
|
||||
static GimpProcedure pattern_get_pixels_proc;
|
||||
|
||||
void
|
||||
register_pattern_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* pattern_get_info
|
||||
*/
|
||||
procedure = gimp_procedure_init (&pattern_get_info_proc, 1, 3);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name.",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bpp",
|
||||
"bpp",
|
||||
"The pattern bpp",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* pattern_get_pixels
|
||||
*/
|
||||
procedure = gimp_procedure_init (&pattern_get_pixels_proc, 1, 5);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name.",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bpp",
|
||||
"bpp",
|
||||
"The pattern bpp",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-color-bytes",
|
||||
"num color bytes",
|
||||
"Number of pattern bytes",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("color-bytes",
|
||||
"color bytes",
|
||||
"The pattern data.",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
pattern_get_info_invoker (GimpProcedure *procedure,
|
||||
|
@ -162,22 +80,6 @@ pattern_get_info_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure pattern_get_info_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-pattern-get-info",
|
||||
"gimp-pattern-get-info",
|
||||
"Retrieve information about the specified pattern.",
|
||||
"This procedure retrieves information about the specified pattern. This includes the pattern extents (width and height).",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { pattern_get_info_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
pattern_get_pixels_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -229,18 +131,106 @@ pattern_get_pixels_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure pattern_get_pixels_proc =
|
||||
void
|
||||
register_pattern_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-pattern-get-pixels",
|
||||
"gimp-pattern-get-pixels",
|
||||
"Retrieve information about the specified pattern (including pixels).",
|
||||
"This procedure retrieves information about the specified. This includes the pattern extents (width and height), its bpp and its pixel data.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { pattern_get_pixels_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-pattern-get-info
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 3,
|
||||
pattern_get_info_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-pattern-get-info",
|
||||
"gimp-pattern-get-info",
|
||||
"Retrieve information about the specified pattern.",
|
||||
"This procedure retrieves information about the specified pattern. This includes the pattern extents (width and height).",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name.",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bpp",
|
||||
"bpp",
|
||||
"The pattern bpp",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-pattern-get-pixels
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 5,
|
||||
pattern_get_pixels_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-pattern-get-pixels",
|
||||
"gimp-pattern-get-pixels",
|
||||
"Retrieve information about the specified pattern (including pixels).",
|
||||
"This procedure retrieves information about the specified. This includes the pattern extents (width and height), its bpp and its pixel data.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name.",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bpp",
|
||||
"bpp",
|
||||
"The pattern bpp",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-color-bytes",
|
||||
"num color bytes",
|
||||
"Number of pattern bytes",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("color-bytes",
|
||||
"color bytes",
|
||||
"The pattern data.",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -31,76 +31,6 @@
|
|||
#include "core/gimp.h"
|
||||
#include "core/gimpdatafactory.h"
|
||||
|
||||
static GimpProcedure patterns_popup_proc;
|
||||
static GimpProcedure patterns_close_popup_proc;
|
||||
static GimpProcedure patterns_set_popup_proc;
|
||||
|
||||
void
|
||||
register_pattern_select_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* patterns_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&patterns_popup_proc, 3, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("pattern-callback",
|
||||
"pattern callback",
|
||||
"The callback PDB proc to call when pattern selection is made",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("popup-title",
|
||||
"popup title",
|
||||
"Title to give the pattern popup window",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("initial-pattern",
|
||||
"initial pattern",
|
||||
"The name of the pattern to set as the first selected",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* patterns_close_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&patterns_close_popup_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("pattern-callback",
|
||||
"pattern callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* patterns_set_popup
|
||||
*/
|
||||
procedure = gimp_procedure_init (&patterns_set_popup_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("pattern-callback",
|
||||
"pattern callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("pattern-name",
|
||||
"pattern name",
|
||||
"The name of the pattern to set as selected",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
patterns_popup_invoker (GimpProcedure *procedure,
|
||||
|
@ -131,22 +61,6 @@ patterns_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure patterns_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-patterns-popup",
|
||||
"gimp-patterns-popup",
|
||||
"Invokes the Gimp pattern selection.",
|
||||
"This procedure popups the pattern selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { patterns_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
patterns_close_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -171,22 +85,6 @@ patterns_close_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure patterns_close_popup_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-patterns-close-popup",
|
||||
"gimp-patterns-close-popup",
|
||||
"Popdown the Gimp pattern selection.",
|
||||
"This procedure closes an opened pattern selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { patterns_close_popup_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
patterns_set_popup_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -214,18 +112,105 @@ patterns_set_popup_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure patterns_set_popup_proc =
|
||||
void
|
||||
register_pattern_select_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-patterns-set-popup",
|
||||
"gimp-patterns-set-popup",
|
||||
"Sets the current pattern selection in a popup.",
|
||||
"Sets the current pattern selection in a popup.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { patterns_set_popup_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-patterns-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 0,
|
||||
patterns_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-patterns-popup",
|
||||
"gimp-patterns-popup",
|
||||
"Invokes the Gimp pattern selection.",
|
||||
"This procedure popups the pattern selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("pattern-callback",
|
||||
"pattern callback",
|
||||
"The callback PDB proc to call when pattern selection is made",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("popup-title",
|
||||
"popup title",
|
||||
"Title to give the pattern popup window",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("initial-pattern",
|
||||
"initial pattern",
|
||||
"The name of the pattern to set as the first selected",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-patterns-close-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
patterns_close_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-patterns-close-popup",
|
||||
"gimp-patterns-close-popup",
|
||||
"Popdown the Gimp pattern selection.",
|
||||
"This procedure closes an opened pattern selection dialog.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("pattern-callback",
|
||||
"pattern callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-patterns-set-popup
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
patterns_set_popup_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-patterns-set-popup",
|
||||
"gimp-patterns-set-popup",
|
||||
"Sets the current pattern selection in a popup.",
|
||||
"Sets the current pattern selection in a popup.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("pattern-callback",
|
||||
"pattern callback",
|
||||
"The name of the callback registered for this popup",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("pattern-name",
|
||||
"pattern name",
|
||||
"The name of the pattern to set as selected",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -37,121 +37,6 @@
|
|||
#include "core/gimplist.h"
|
||||
#include "core/gimppattern.h"
|
||||
|
||||
static GimpProcedure patterns_refresh_proc;
|
||||
static GimpProcedure patterns_get_list_proc;
|
||||
static GimpProcedure patterns_get_pattern_proc;
|
||||
static GimpProcedure patterns_get_pattern_data_proc;
|
||||
|
||||
void
|
||||
register_patterns_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* patterns_refresh
|
||||
*/
|
||||
procedure = gimp_procedure_init (&patterns_refresh_proc, 0, 0);
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* patterns_get_list
|
||||
*/
|
||||
procedure = gimp_procedure_init (&patterns_get_list_proc, 1, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-patterns",
|
||||
"num patterns",
|
||||
"The number of patterns in the pattern list",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("pattern-list",
|
||||
"pattern list",
|
||||
"The list of pattern names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* patterns_get_pattern
|
||||
*/
|
||||
procedure = gimp_procedure_init (&patterns_get_pattern_proc, 0, 3);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* patterns_get_pattern_data
|
||||
*/
|
||||
procedure = gimp_procedure_init (&patterns_get_pattern_data_proc, 1, 6);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name (\"\" means currently active pattern)",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The pattern name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("mask-bpp",
|
||||
"mask bpp",
|
||||
"Pattern bytes per pixel",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("length",
|
||||
"length",
|
||||
"Length of pattern mask data",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("mask-data",
|
||||
"mask data",
|
||||
"The pattern mask data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
patterns_refresh_invoker (GimpProcedure *procedure,
|
||||
|
@ -164,22 +49,6 @@ patterns_refresh_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, TRUE);
|
||||
}
|
||||
|
||||
static GimpProcedure patterns_refresh_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-patterns-refresh",
|
||||
"gimp-patterns-refresh",
|
||||
"Refresh current patterns. This function always succeeds.",
|
||||
"This procedure retrieves all patterns currently in the user's pattern path and updates all pattern dialogs accordingly.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { patterns_refresh_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
patterns_get_list_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -212,22 +81,6 @@ patterns_get_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure patterns_get_list_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-patterns-get-list",
|
||||
"gimp-patterns-get-list",
|
||||
"Retrieve a complete listing of the available patterns.",
|
||||
"This procedure returns a complete listing of available GIMP patterns. Each name returned can be used as input to the 'gimp-context-set-pattern'.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { patterns_get_list_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
patterns_get_pattern_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -264,22 +117,6 @@ patterns_get_pattern_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure patterns_get_pattern_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-patterns-get-pattern",
|
||||
"gimp-patterns-get-pattern",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-pattern' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-pattern' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-context-get-pattern",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { patterns_get_pattern_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
patterns_get_pattern_data_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -343,18 +180,161 @@ patterns_get_pattern_data_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure patterns_get_pattern_data_proc =
|
||||
void
|
||||
register_patterns_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-patterns-get-pattern-data",
|
||||
"gimp-patterns-get-pattern-data",
|
||||
"This procedure is deprecated! Use 'gimp-pattern-get-pixels' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-pattern-get-pixels' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-pattern-get-pixels",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { patterns_get_pattern_data_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-patterns-refresh
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 0,
|
||||
patterns_refresh_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-patterns-refresh",
|
||||
"gimp-patterns-refresh",
|
||||
"Refresh current patterns. This function always succeeds.",
|
||||
"This procedure retrieves all patterns currently in the user's pattern path and updates all pattern dialogs accordingly.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2002",
|
||||
NULL);
|
||||
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-patterns-get-list
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 2,
|
||||
patterns_get_list_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-patterns-get-list",
|
||||
"gimp-patterns-get-list",
|
||||
"Retrieve a complete listing of the available patterns.",
|
||||
"This procedure returns a complete listing of available GIMP patterns. Each name returned can be used as input to the 'gimp-context-set-pattern'.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filter",
|
||||
"filter",
|
||||
"An optional regular expression used to filter the list",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-patterns",
|
||||
"num patterns",
|
||||
"The number of patterns in the pattern list",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("pattern-list",
|
||||
"pattern list",
|
||||
"The list of pattern names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-patterns-get-pattern
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 3,
|
||||
patterns_get_pattern_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-patterns-get-pattern",
|
||||
"gimp-patterns-get-pattern",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-pattern' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-context-get-pattern' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-context-get-pattern");
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-patterns-get-pattern-data
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 6,
|
||||
patterns_get_pattern_data_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-patterns-get-pattern-data",
|
||||
"gimp-patterns-get-pattern-data",
|
||||
"This procedure is deprecated! Use 'gimp-pattern-get-pixels' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-pattern-get-pixels' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-pattern-get-pixels");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The pattern name (\"\" means currently active pattern)",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("actual-name",
|
||||
"actual name",
|
||||
"The pattern name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The pattern width",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The pattern height",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("mask-bpp",
|
||||
"mask bpp",
|
||||
"Pattern bytes per pixel",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("length",
|
||||
"length",
|
||||
"Length of pattern mask data",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("mask-data",
|
||||
"mask data",
|
||||
"The pattern mask data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -41,12 +41,225 @@
|
|||
#include "plug-in/plug-ins-query.h"
|
||||
#include "plug-in/plug-ins.h"
|
||||
|
||||
static GimpProcedure plugins_query_proc;
|
||||
static GimpProcedure plugin_domain_register_proc;
|
||||
static GimpProcedure plugin_help_register_proc;
|
||||
static GimpProcedure plugin_menu_register_proc;
|
||||
static GimpProcedure plugin_menu_branch_register_proc;
|
||||
static GimpProcedure plugin_icon_register_proc;
|
||||
|
||||
static GValueArray *
|
||||
plugins_query_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
GValueArray *return_vals;
|
||||
const gchar *search_string;
|
||||
gint32 num_plugins = 0;
|
||||
gchar **menu_path = NULL;
|
||||
gchar **plugin_accelerator = NULL;
|
||||
gchar **plugin_location = NULL;
|
||||
gchar **plugin_image_type = NULL;
|
||||
gint32 *plugin_install_time = NULL;
|
||||
gchar **plugin_real_name = NULL;
|
||||
|
||||
search_string = g_value_get_string (&args->values[0]);
|
||||
|
||||
num_plugins = plug_ins_query (gimp, search_string,
|
||||
&menu_path,
|
||||
&plugin_accelerator,
|
||||
&plugin_location,
|
||||
&plugin_image_type,
|
||||
&plugin_real_name,
|
||||
&plugin_install_time);
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
|
||||
|
||||
g_value_set_int (&return_vals->values[1], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[2], menu_path, num_plugins);
|
||||
g_value_set_int (&return_vals->values[3], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[4], plugin_accelerator, num_plugins);
|
||||
g_value_set_int (&return_vals->values[5], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[6], plugin_location, num_plugins);
|
||||
g_value_set_int (&return_vals->values[7], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[8], plugin_image_type, num_plugins);
|
||||
g_value_set_int (&return_vals->values[9], num_plugins);
|
||||
gimp_value_take_int32array (&return_vals->values[10], plugin_install_time, num_plugins);
|
||||
g_value_set_int (&return_vals->values[11], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[12], plugin_real_name, num_plugins);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
plugin_domain_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *domain_name;
|
||||
const gchar *domain_path;
|
||||
|
||||
domain_name = g_value_get_string (&args->values[0]);
|
||||
domain_path = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in && gimp->current_plug_in->query)
|
||||
{
|
||||
plug_in_def_set_locale_domain_name (gimp->current_plug_in->plug_in_def,
|
||||
domain_name);
|
||||
plug_in_def_set_locale_domain_path (gimp->current_plug_in->plug_in_def,
|
||||
domain_path);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
plugin_help_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *domain_name;
|
||||
const gchar *domain_uri;
|
||||
|
||||
domain_name = g_value_get_string (&args->values[0]);
|
||||
domain_uri = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in && gimp->current_plug_in->query)
|
||||
{
|
||||
plug_in_def_set_help_domain_name (gimp->current_plug_in->plug_in_def,
|
||||
domain_name);
|
||||
plug_in_def_set_help_domain_uri (gimp->current_plug_in->plug_in_def,
|
||||
domain_uri);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
plugin_menu_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *procedure_name;
|
||||
const gchar *menu_path;
|
||||
|
||||
procedure_name = g_value_get_string (&args->values[0]);
|
||||
menu_path = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in)
|
||||
{
|
||||
gchar *canonical = gimp_canonicalize_identifier (procedure_name);
|
||||
|
||||
success = plug_in_menu_register (gimp->current_plug_in,
|
||||
canonical, menu_path);
|
||||
g_free (canonical);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
plugin_menu_branch_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *menu_path;
|
||||
const gchar *menu_name;
|
||||
|
||||
menu_path = g_value_get_string (&args->values[0]);
|
||||
menu_name = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in)
|
||||
{
|
||||
plug_ins_menu_branch_add (gimp, gimp->current_plug_in->prog,
|
||||
menu_path, menu_name);
|
||||
|
||||
if (! gimp->no_interface)
|
||||
{
|
||||
gimp_menus_create_branch (gimp, gimp->current_plug_in->prog,
|
||||
menu_path, menu_name);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
plugin_icon_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *procedure_name;
|
||||
gint32 icon_type;
|
||||
gint32 icon_data_length;
|
||||
const guint8 *icon_data;
|
||||
|
||||
procedure_name = g_value_get_string (&args->values[0]);
|
||||
icon_type = g_value_get_enum (&args->values[1]);
|
||||
icon_data_length = g_value_get_int (&args->values[2]);
|
||||
icon_data = gimp_value_get_int8array (&args->values[3]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in && gimp->current_plug_in->query)
|
||||
{
|
||||
PlugInProcDef *proc_def;
|
||||
gchar *canonical;
|
||||
|
||||
canonical = gimp_canonicalize_identifier (procedure_name);
|
||||
|
||||
proc_def = plug_in_proc_def_find (gimp->current_plug_in->plug_in_def->proc_defs,
|
||||
canonical);
|
||||
|
||||
g_free (canonical);
|
||||
|
||||
if (proc_def)
|
||||
plug_in_proc_def_set_icon (proc_def, icon_type,
|
||||
icon_data, icon_data_length);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
void
|
||||
register_plug_in_procs (Gimp *gimp)
|
||||
|
@ -54,9 +267,21 @@ register_plug_in_procs (Gimp *gimp)
|
|||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* plugins_query
|
||||
* gimp-plugins-query
|
||||
*/
|
||||
procedure = gimp_procedure_init (&plugins_query_proc, 1, 12);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 12,
|
||||
plugins_query_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-plugins-query",
|
||||
"gimp-plugins-query",
|
||||
"Queries the plugin database for its contents.",
|
||||
"This procedure queries the contents of the plugin database.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("search-string",
|
||||
"search string",
|
||||
|
@ -133,9 +358,21 @@ register_plug_in_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* plugin_domain_register
|
||||
* gimp-plugin-domain-register
|
||||
*/
|
||||
procedure = gimp_procedure_init (&plugin_domain_register_proc, 2, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
plugin_domain_register_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-plugin-domain-register",
|
||||
"gimp-plugin-domain-register",
|
||||
"Registers a textdomain for localisation.",
|
||||
"This procedure adds a textdomain to the list of domains Gimp searches for strings when translating its menu entries. There is no need to call this function for plug-ins that have their strings included in the gimp-std-plugins domain as that is used by default. If the compiled message catalog is not in the standard location, you may specify an absolute path to another location. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2000",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("domain-name",
|
||||
"domain name",
|
||||
|
@ -153,9 +390,21 @@ register_plug_in_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* plugin_help_register
|
||||
* gimp-plugin-help-register
|
||||
*/
|
||||
procedure = gimp_procedure_init (&plugin_help_register_proc, 2, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
plugin_help_register_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-plugin-help-register",
|
||||
"gimp-plugin-help-register",
|
||||
"Register a help path for a plug-in.",
|
||||
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2000",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("domain-name",
|
||||
"domain name",
|
||||
|
@ -173,9 +422,21 @@ register_plug_in_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* plugin_menu_register
|
||||
* gimp-plugin-menu-register
|
||||
*/
|
||||
procedure = gimp_procedure_init (&plugin_menu_register_proc, 2, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
plugin_menu_register_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-plugin-menu-register",
|
||||
"gimp-plugin-menu-register",
|
||||
"Register an additional menu path for a plug-in procedure.",
|
||||
"This procedure installs an additional menu entry for the given procedure.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("procedure-name",
|
||||
"procedure name",
|
||||
|
@ -193,9 +454,21 @@ register_plug_in_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* plugin_menu_branch_register
|
||||
* gimp-plugin-menu-branch-register
|
||||
*/
|
||||
procedure = gimp_procedure_init (&plugin_menu_branch_register_proc, 2, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
plugin_menu_branch_register_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-plugin-menu-branch-register",
|
||||
"gimp-plugin-menu-branch-register",
|
||||
"Register a sub-menu.",
|
||||
"This procedure installs an sub-menu which does not belong to any procedure.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("menu-path",
|
||||
"menu path",
|
||||
|
@ -213,9 +486,21 @@ register_plug_in_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* plugin_icon_register
|
||||
* gimp-plugin-icon-register
|
||||
*/
|
||||
procedure = gimp_procedure_init (&plugin_icon_register_proc, 4, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 4, 0,
|
||||
plugin_icon_register_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-plugin-icon-register",
|
||||
"gimp-plugin-icon-register",
|
||||
"Register an icon for a plug-in procedure.",
|
||||
"This procedure installs an icon for the given procedure.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("procedure-name",
|
||||
"procedure name",
|
||||
|
@ -244,318 +529,3 @@ register_plug_in_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
plugins_query_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
GValueArray *return_vals;
|
||||
const gchar *search_string;
|
||||
gint32 num_plugins = 0;
|
||||
gchar **menu_path = NULL;
|
||||
gchar **plugin_accelerator = NULL;
|
||||
gchar **plugin_location = NULL;
|
||||
gchar **plugin_image_type = NULL;
|
||||
gint32 *plugin_install_time = NULL;
|
||||
gchar **plugin_real_name = NULL;
|
||||
|
||||
search_string = g_value_get_string (&args->values[0]);
|
||||
|
||||
num_plugins = plug_ins_query (gimp, search_string,
|
||||
&menu_path,
|
||||
&plugin_accelerator,
|
||||
&plugin_location,
|
||||
&plugin_image_type,
|
||||
&plugin_real_name,
|
||||
&plugin_install_time);
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
|
||||
|
||||
g_value_set_int (&return_vals->values[1], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[2], menu_path, num_plugins);
|
||||
g_value_set_int (&return_vals->values[3], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[4], plugin_accelerator, num_plugins);
|
||||
g_value_set_int (&return_vals->values[5], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[6], plugin_location, num_plugins);
|
||||
g_value_set_int (&return_vals->values[7], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[8], plugin_image_type, num_plugins);
|
||||
g_value_set_int (&return_vals->values[9], num_plugins);
|
||||
gimp_value_take_int32array (&return_vals->values[10], plugin_install_time, num_plugins);
|
||||
g_value_set_int (&return_vals->values[11], num_plugins);
|
||||
gimp_value_take_stringarray (&return_vals->values[12], plugin_real_name, num_plugins);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure plugins_query_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-plugins-query",
|
||||
"gimp-plugins-query",
|
||||
"Queries the plugin database for its contents.",
|
||||
"This procedure queries the contents of the plugin database.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { plugins_query_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
plugin_domain_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *domain_name;
|
||||
const gchar *domain_path;
|
||||
|
||||
domain_name = g_value_get_string (&args->values[0]);
|
||||
domain_path = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in && gimp->current_plug_in->query)
|
||||
{
|
||||
plug_in_def_set_locale_domain_name (gimp->current_plug_in->plug_in_def,
|
||||
domain_name);
|
||||
plug_in_def_set_locale_domain_path (gimp->current_plug_in->plug_in_def,
|
||||
domain_path);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure plugin_domain_register_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-plugin-domain-register",
|
||||
"gimp-plugin-domain-register",
|
||||
"Registers a textdomain for localisation.",
|
||||
"This procedure adds a textdomain to the list of domains Gimp searches for strings when translating its menu entries. There is no need to call this function for plug-ins that have their strings included in the gimp-std-plugins domain as that is used by default. If the compiled message catalog is not in the standard location, you may specify an absolute path to another location. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2000",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { plugin_domain_register_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
plugin_help_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *domain_name;
|
||||
const gchar *domain_uri;
|
||||
|
||||
domain_name = g_value_get_string (&args->values[0]);
|
||||
domain_uri = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in && gimp->current_plug_in->query)
|
||||
{
|
||||
plug_in_def_set_help_domain_name (gimp->current_plug_in->plug_in_def,
|
||||
domain_name);
|
||||
plug_in_def_set_help_domain_uri (gimp->current_plug_in->plug_in_def,
|
||||
domain_uri);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure plugin_help_register_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-plugin-help-register",
|
||||
"gimp-plugin-help-register",
|
||||
"Register a help path for a plug-in.",
|
||||
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2000",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { plugin_help_register_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
plugin_menu_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *procedure_name;
|
||||
const gchar *menu_path;
|
||||
|
||||
procedure_name = g_value_get_string (&args->values[0]);
|
||||
menu_path = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in)
|
||||
{
|
||||
gchar *canonical = gimp_canonicalize_identifier (procedure_name);
|
||||
|
||||
success = plug_in_menu_register (gimp->current_plug_in,
|
||||
canonical, menu_path);
|
||||
g_free (canonical);
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure plugin_menu_register_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-plugin-menu-register",
|
||||
"gimp-plugin-menu-register",
|
||||
"Register an additional menu path for a plug-in procedure.",
|
||||
"This procedure installs an additional menu entry for the given procedure.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { plugin_menu_register_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
plugin_menu_branch_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *menu_path;
|
||||
const gchar *menu_name;
|
||||
|
||||
menu_path = g_value_get_string (&args->values[0]);
|
||||
menu_name = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in)
|
||||
{
|
||||
plug_ins_menu_branch_add (gimp, gimp->current_plug_in->prog,
|
||||
menu_path, menu_name);
|
||||
|
||||
if (! gimp->no_interface)
|
||||
{
|
||||
gimp_menus_create_branch (gimp, gimp->current_plug_in->prog,
|
||||
menu_path, menu_name);
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure plugin_menu_branch_register_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-plugin-menu-branch-register",
|
||||
"gimp-plugin-menu-branch-register",
|
||||
"Register a sub-menu.",
|
||||
"This procedure installs an sub-menu which does not belong to any procedure.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { plugin_menu_branch_register_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
plugin_icon_register_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
const gchar *procedure_name;
|
||||
gint32 icon_type;
|
||||
gint32 icon_data_length;
|
||||
const guint8 *icon_data;
|
||||
|
||||
procedure_name = g_value_get_string (&args->values[0]);
|
||||
icon_type = g_value_get_enum (&args->values[1]);
|
||||
icon_data_length = g_value_get_int (&args->values[2]);
|
||||
icon_data = gimp_value_get_int8array (&args->values[3]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (gimp->current_plug_in && gimp->current_plug_in->query)
|
||||
{
|
||||
PlugInProcDef *proc_def;
|
||||
gchar *canonical;
|
||||
|
||||
canonical = gimp_canonicalize_identifier (procedure_name);
|
||||
|
||||
proc_def = plug_in_proc_def_find (gimp->current_plug_in->plug_in_def->proc_defs,
|
||||
canonical);
|
||||
|
||||
g_free (canonical);
|
||||
|
||||
if (proc_def)
|
||||
plug_in_proc_def_set_icon (proc_def, icon_type,
|
||||
icon_data, icon_data_length);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure plugin_icon_register_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-plugin-icon-register",
|
||||
"gimp-plugin-icon-register",
|
||||
"Register an icon for a plug-in procedure.",
|
||||
"This procedure installs an icon for the given procedure.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { plugin_icon_register_invoker } }
|
||||
};
|
||||
|
|
|
@ -35,332 +35,6 @@
|
|||
#include "gimp-pdb-query.h"
|
||||
#include "plug-in/plug-in-data.h"
|
||||
|
||||
static GimpProcedure procedural_db_temp_name_proc;
|
||||
static GimpProcedure procedural_db_dump_proc;
|
||||
static GimpProcedure procedural_db_query_proc;
|
||||
static GimpProcedure procedural_db_proc_info_proc;
|
||||
static GimpProcedure procedural_db_proc_arg_proc;
|
||||
static GimpProcedure procedural_db_proc_val_proc;
|
||||
static GimpProcedure procedural_db_get_data_proc;
|
||||
static GimpProcedure procedural_db_get_data_size_proc;
|
||||
static GimpProcedure procedural_db_set_data_proc;
|
||||
|
||||
void
|
||||
register_procedural_db_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* procedural_db_temp_name
|
||||
*/
|
||||
procedure = gimp_procedure_init (&procedural_db_temp_name_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("temp-name",
|
||||
"temp name",
|
||||
"A unique temporary name for a temporary PDB entry",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* procedural_db_dump
|
||||
*/
|
||||
procedure = gimp_procedure_init (&procedural_db_dump_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filename",
|
||||
"filename",
|
||||
"The dump filename",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* procedural_db_query
|
||||
*/
|
||||
procedure = gimp_procedure_init (&procedural_db_query_proc, 7, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The regex for procedure name",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("blurb",
|
||||
"blurb",
|
||||
"The regex for procedure blurb",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("help",
|
||||
"help",
|
||||
"The regex for procedure help",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("author",
|
||||
"author",
|
||||
"The regex for procedure author",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("copyright",
|
||||
"copyright",
|
||||
"The regex for procedure copyright",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("date",
|
||||
"date",
|
||||
"The regex for procedure date",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("proc-type",
|
||||
"proc type",
|
||||
"The regex for procedure type: { 'Internal GIMP procedure', 'GIMP Plug-In', 'GIMP Extension', 'Temporary Procedure' }",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-matches",
|
||||
"num matches",
|
||||
"The number of matching procedures",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("procedure-names",
|
||||
"procedure names",
|
||||
"The list of procedure names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* procedural_db_proc_info
|
||||
*/
|
||||
procedure = gimp_procedure_init (&procedural_db_proc_info_proc, 1, 8);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("procedure-name",
|
||||
"procedure name",
|
||||
"The procedure name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("blurb",
|
||||
"blurb",
|
||||
"A short blurb",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("help",
|
||||
"help",
|
||||
"Detailed procedure help",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("author",
|
||||
"author",
|
||||
"Author(s) of the procedure",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("copyright",
|
||||
"copyright",
|
||||
"The copyright",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("date",
|
||||
"date",
|
||||
"Copyright date",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("proc-type",
|
||||
"proc type",
|
||||
"The procedure type: { GIMP_INTERNAL (0), GIMP_PLUGIN (1), GIMP_EXTENSION (2), GIMP_TEMPORARY (3) }",
|
||||
GIMP_TYPE_PDB_PROC_TYPE,
|
||||
GIMP_INTERNAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-args",
|
||||
"num args",
|
||||
"The number of input arguments",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-values",
|
||||
"num values",
|
||||
"The number of return values",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* procedural_db_proc_arg
|
||||
*/
|
||||
procedure = gimp_procedure_init (&procedural_db_proc_arg_proc, 2, 3);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("procedure-name",
|
||||
"procedure name",
|
||||
"The procedure name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("arg-num",
|
||||
"arg num",
|
||||
"The argument number",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_enum ("arg-type",
|
||||
"arg type",
|
||||
"The type of argument: { GIMP_PDB_INT32 (0), GIMP_PDB_INT16 (1), GIMP_PDB_INT8 (2), GIMP_PDB_FLOAT (3), GIMP_PDB_STRING (4), GIMP_PDB_INT32ARRAY (5), GIMP_PDB_INT16ARRAY (6), GIMP_PDB_INT8ARRAY (7), GIMP_PDB_FLOATARRAY (8), GIMP_PDB_STRINGARRAY (9), GIMP_PDB_COLOR (10), GIMP_PDB_REGION (11), GIMP_PDB_DISPLAY (12), GIMP_PDB_IMAGE (13), GIMP_PDB_LAYER (14), GIMP_PDB_CHANNEL (15), GIMP_PDB_DRAWABLE (16), GIMP_PDB_SELECTION (17), GIMP_PDB_BOUNDARY (18), GIMP_PDB_VECTORS (19), GIMP_PDB_PARASITE (20), GIMP_PDB_STATUS (21), GIMP_PDB_PATH (GIMP_PDB_VECTORS) }",
|
||||
GIMP_TYPE_PDB_ARG_TYPE,
|
||||
GIMP_PDB_INT32,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->values[0]),
|
||||
GIMP_PDB_END);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("arg-name",
|
||||
"arg name",
|
||||
"The name of the argument",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("arg-desc",
|
||||
"arg desc",
|
||||
"A description of the argument",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* procedural_db_proc_val
|
||||
*/
|
||||
procedure = gimp_procedure_init (&procedural_db_proc_val_proc, 2, 3);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("procedure-name",
|
||||
"procedure name",
|
||||
"The procedure name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("val-num",
|
||||
"val num",
|
||||
"The return value number",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_enum ("val-type",
|
||||
"val type",
|
||||
"The type of return value: { GIMP_PDB_INT32 (0), GIMP_PDB_INT16 (1), GIMP_PDB_INT8 (2), GIMP_PDB_FLOAT (3), GIMP_PDB_STRING (4), GIMP_PDB_INT32ARRAY (5), GIMP_PDB_INT16ARRAY (6), GIMP_PDB_INT8ARRAY (7), GIMP_PDB_FLOATARRAY (8), GIMP_PDB_STRINGARRAY (9), GIMP_PDB_COLOR (10), GIMP_PDB_REGION (11), GIMP_PDB_DISPLAY (12), GIMP_PDB_IMAGE (13), GIMP_PDB_LAYER (14), GIMP_PDB_CHANNEL (15), GIMP_PDB_DRAWABLE (16), GIMP_PDB_SELECTION (17), GIMP_PDB_BOUNDARY (18), GIMP_PDB_VECTORS (19), GIMP_PDB_PARASITE (20), GIMP_PDB_STATUS (21), GIMP_PDB_PATH (GIMP_PDB_VECTORS) }",
|
||||
GIMP_TYPE_PDB_ARG_TYPE,
|
||||
GIMP_PDB_INT32,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->values[0]),
|
||||
GIMP_PDB_END);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("val-name",
|
||||
"val name",
|
||||
"The name of the return value",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("val-desc",
|
||||
"val desc",
|
||||
"A description of the return value",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* procedural_db_get_data
|
||||
*/
|
||||
procedure = gimp_procedure_init (&procedural_db_get_data_proc, 1, 2);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("identifier",
|
||||
"identifier",
|
||||
"The identifier associated with data",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bytes",
|
||||
"bytes",
|
||||
"The number of bytes in the data",
|
||||
1, G_MAXINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("data",
|
||||
"data",
|
||||
"A byte array containing data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* procedural_db_get_data_size
|
||||
*/
|
||||
procedure = gimp_procedure_init (&procedural_db_get_data_size_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("identifier",
|
||||
"identifier",
|
||||
"The identifier associated with data",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bytes",
|
||||
"bytes",
|
||||
"The number of bytes in the data",
|
||||
1, G_MAXINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* procedural_db_set_data
|
||||
*/
|
||||
procedure = gimp_procedure_init (&procedural_db_set_data_proc, 3, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("identifier",
|
||||
"identifier",
|
||||
"The identifier associated with data",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("bytes",
|
||||
"bytes",
|
||||
"The number of bytes in the data",
|
||||
1, G_MAXINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int8_array ("data",
|
||||
"data",
|
||||
"A byte array containing data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
procedural_db_temp_name_invoker (GimpProcedure *procedure,
|
||||
|
@ -382,22 +56,6 @@ procedural_db_temp_name_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure procedural_db_temp_name_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-procedural-db-temp-name",
|
||||
"gimp-procedural-db-temp-name",
|
||||
"Generates a unique temporary PDB name.",
|
||||
"This procedure generates a temporary PDB entry name that is guaranteed to be unique. It is mainly used by the interactive popup dialogs to generate a PDB entry name.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { procedural_db_temp_name_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
procedural_db_dump_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -418,22 +76,6 @@ procedural_db_dump_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure procedural_db_dump_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-procedural-db-dump",
|
||||
"gimp-procedural-db-dump",
|
||||
"Dumps the current contents of the procedural database",
|
||||
"This procedure dumps the contents of the procedural database to the specified file. The file will contain all of the information provided for each registered procedure. This file is in a format appropriate for use with the supplied \"pdb_self_doc.el\" Elisp script, which generates a texinfo document.",
|
||||
"Spencer Kimball & Josh MacDonald",
|
||||
"Spencer Kimball & Josh MacDonald & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { procedural_db_dump_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
procedural_db_query_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -480,22 +122,6 @@ procedural_db_query_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure procedural_db_query_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-procedural-db-query",
|
||||
"gimp-procedural-db-query",
|
||||
"Queries the procedural database for its contents using regular expression matching.",
|
||||
"This procedure queries the contents of the procedural database. It is supplied with seven arguments matching procedures on { name, blurb, help, author, copyright, date, procedure type}. This is accomplished using regular expression matching. For instance, to find all procedures with \"jpeg\" listed in the blurb, all seven arguments can be supplied as \".*\", except for the second, which can be supplied as \".*jpeg.*\". There are two return arguments for this procedure. The first is the number of procedures matching the query. The second is a concatenated list of procedure names corresponding to those matching the query. If no matching entries are found, then the returned string is NULL and the number of entries is 0.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { procedural_db_query_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
procedural_db_proc_info_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -550,22 +176,6 @@ procedural_db_proc_info_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure procedural_db_proc_info_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-procedural-db-proc-info",
|
||||
"gimp-procedural-db-proc-info",
|
||||
"Queries the procedural database for information on the specified procedure.",
|
||||
"This procedure returns information on the specified procedure. A short blurb, detailed help, author(s), copyright information, procedure type, number of input, and number of return values are returned. For specific information on each input argument and return value, use the 'gimp_procedural_db_proc_arg' and 'gimp_procedural_db_proc_val' procedures.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { procedural_db_proc_info_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
procedural_db_proc_arg_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -629,22 +239,6 @@ procedural_db_proc_arg_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure procedural_db_proc_arg_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-procedural-db-proc-arg",
|
||||
"gimp-procedural-db-proc-arg",
|
||||
"Queries the procedural database for information on the specified procedure's argument.",
|
||||
"This procedure returns information on the specified procedure's argument. The argument type, name, and a description are retrieved.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { procedural_db_proc_arg_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
procedural_db_proc_val_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -708,22 +302,6 @@ procedural_db_proc_val_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure procedural_db_proc_val_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-procedural-db-proc-val",
|
||||
"gimp-procedural-db-proc-val",
|
||||
"Queries the procedural database for information on the specified procedure's return value.",
|
||||
"This procedure returns information on the specified procedure's return value. The return value type, name, and a description are retrieved.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { procedural_db_proc_val_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
procedural_db_get_data_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -767,22 +345,6 @@ procedural_db_get_data_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure procedural_db_get_data_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-procedural-db-get-data",
|
||||
"gimp-procedural-db-get-data",
|
||||
"Returns data associated with the specified identifier.",
|
||||
"This procedure returns any data which may have been associated with the specified identifier. The data is a variable length array of bytes. If no data has been associated with the identifier, an error is returned.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { procedural_db_get_data_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
procedural_db_get_data_size_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -821,22 +383,6 @@ procedural_db_get_data_size_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure procedural_db_get_data_size_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-procedural-db-get-data-size",
|
||||
"gimp-procedural-db-get-data-size",
|
||||
"Returns size of data associated with the specified identifier.",
|
||||
"This procedure returns the size of any data which may have been associated with the specified identifier. If no data has been associated with the identifier, an error is returned.",
|
||||
"Nick Lamb",
|
||||
"Nick Lamb",
|
||||
"1998",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { procedural_db_get_data_size_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
procedural_db_set_data_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -867,18 +413,427 @@ procedural_db_set_data_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure procedural_db_set_data_proc =
|
||||
void
|
||||
register_procedural_db_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-procedural-db-set-data",
|
||||
"gimp-procedural-db-set-data",
|
||||
"Associates the specified identifier with the supplied data.",
|
||||
"This procedure associates the supplied data with the provided identifier. The data may be subsequently retrieved by a call to 'procedural-db-get-data'.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { procedural_db_set_data_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-procedural-db-temp-name
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
procedural_db_temp_name_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-procedural-db-temp-name",
|
||||
"gimp-procedural-db-temp-name",
|
||||
"Generates a unique temporary PDB name.",
|
||||
"This procedure generates a temporary PDB entry name that is guaranteed to be unique. It is mainly used by the interactive popup dialogs to generate a PDB entry name.",
|
||||
"Andy Thomas",
|
||||
"Andy Thomas",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("temp-name",
|
||||
"temp name",
|
||||
"A unique temporary name for a temporary PDB entry",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-procedural-db-dump
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
procedural_db_dump_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-procedural-db-dump",
|
||||
"gimp-procedural-db-dump",
|
||||
"Dumps the current contents of the procedural database",
|
||||
"This procedure dumps the contents of the procedural database to the specified file. The file will contain all of the information provided for each registered procedure. This file is in a format appropriate for use with the supplied \"pdb_self_doc.el\" Elisp script, which generates a texinfo document.",
|
||||
"Spencer Kimball & Josh MacDonald",
|
||||
"Spencer Kimball & Josh MacDonald & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filename",
|
||||
"filename",
|
||||
"The dump filename",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-procedural-db-query
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 7, 2,
|
||||
procedural_db_query_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-procedural-db-query",
|
||||
"gimp-procedural-db-query",
|
||||
"Queries the procedural database for its contents using regular expression matching.",
|
||||
"This procedure queries the contents of the procedural database. It is supplied with seven arguments matching procedures on { name, blurb, help, author, copyright, date, procedure type}. This is accomplished using regular expression matching. For instance, to find all procedures with \"jpeg\" listed in the blurb, all seven arguments can be supplied as \".*\", except for the second, which can be supplied as \".*jpeg.*\". There are two return arguments for this procedure. The first is the number of procedures matching the query. The second is a concatenated list of procedure names corresponding to those matching the query. If no matching entries are found, then the returned string is NULL and the number of entries is 0.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The regex for procedure name",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("blurb",
|
||||
"blurb",
|
||||
"The regex for procedure blurb",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("help",
|
||||
"help",
|
||||
"The regex for procedure help",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("author",
|
||||
"author",
|
||||
"The regex for procedure author",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("copyright",
|
||||
"copyright",
|
||||
"The regex for procedure copyright",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("date",
|
||||
"date",
|
||||
"The regex for procedure date",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("proc-type",
|
||||
"proc type",
|
||||
"The regex for procedure type: { 'Internal GIMP procedure', 'GIMP Plug-In', 'GIMP Extension', 'Temporary Procedure' }",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-matches",
|
||||
"num matches",
|
||||
"The number of matching procedures",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("procedure-names",
|
||||
"procedure names",
|
||||
"The list of procedure names",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-procedural-db-proc-info
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 8,
|
||||
procedural_db_proc_info_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-procedural-db-proc-info",
|
||||
"gimp-procedural-db-proc-info",
|
||||
"Queries the procedural database for information on the specified procedure.",
|
||||
"This procedure returns information on the specified procedure. A short blurb, detailed help, author(s), copyright information, procedure type, number of input, and number of return values are returned. For specific information on each input argument and return value, use the 'gimp_procedural_db_proc_arg' and 'gimp_procedural_db_proc_val' procedures.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("procedure-name",
|
||||
"procedure name",
|
||||
"The procedure name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("blurb",
|
||||
"blurb",
|
||||
"A short blurb",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("help",
|
||||
"help",
|
||||
"Detailed procedure help",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("author",
|
||||
"author",
|
||||
"Author(s) of the procedure",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("copyright",
|
||||
"copyright",
|
||||
"The copyright",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("date",
|
||||
"date",
|
||||
"Copyright date",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_enum ("proc-type",
|
||||
"proc type",
|
||||
"The procedure type: { GIMP_INTERNAL (0), GIMP_PLUGIN (1), GIMP_EXTENSION (2), GIMP_TEMPORARY (3) }",
|
||||
GIMP_TYPE_PDB_PROC_TYPE,
|
||||
GIMP_INTERNAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-args",
|
||||
"num args",
|
||||
"The number of input arguments",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-values",
|
||||
"num values",
|
||||
"The number of return values",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-procedural-db-proc-arg
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 3,
|
||||
procedural_db_proc_arg_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-procedural-db-proc-arg",
|
||||
"gimp-procedural-db-proc-arg",
|
||||
"Queries the procedural database for information on the specified procedure's argument.",
|
||||
"This procedure returns information on the specified procedure's argument. The argument type, name, and a description are retrieved.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("procedure-name",
|
||||
"procedure name",
|
||||
"The procedure name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("arg-num",
|
||||
"arg num",
|
||||
"The argument number",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_enum ("arg-type",
|
||||
"arg type",
|
||||
"The type of argument: { GIMP_PDB_INT32 (0), GIMP_PDB_INT16 (1), GIMP_PDB_INT8 (2), GIMP_PDB_FLOAT (3), GIMP_PDB_STRING (4), GIMP_PDB_INT32ARRAY (5), GIMP_PDB_INT16ARRAY (6), GIMP_PDB_INT8ARRAY (7), GIMP_PDB_FLOATARRAY (8), GIMP_PDB_STRINGARRAY (9), GIMP_PDB_COLOR (10), GIMP_PDB_REGION (11), GIMP_PDB_DISPLAY (12), GIMP_PDB_IMAGE (13), GIMP_PDB_LAYER (14), GIMP_PDB_CHANNEL (15), GIMP_PDB_DRAWABLE (16), GIMP_PDB_SELECTION (17), GIMP_PDB_BOUNDARY (18), GIMP_PDB_VECTORS (19), GIMP_PDB_PARASITE (20), GIMP_PDB_STATUS (21), GIMP_PDB_PATH (GIMP_PDB_VECTORS) }",
|
||||
GIMP_TYPE_PDB_ARG_TYPE,
|
||||
GIMP_PDB_INT32,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->values[0]),
|
||||
GIMP_PDB_END);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("arg-name",
|
||||
"arg name",
|
||||
"The name of the argument",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("arg-desc",
|
||||
"arg desc",
|
||||
"A description of the argument",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-procedural-db-proc-val
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 3,
|
||||
procedural_db_proc_val_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-procedural-db-proc-val",
|
||||
"gimp-procedural-db-proc-val",
|
||||
"Queries the procedural database for information on the specified procedure's return value.",
|
||||
"This procedure returns information on the specified procedure's return value. The return value type, name, and a description are retrieved.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("procedure-name",
|
||||
"procedure name",
|
||||
"The procedure name",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("val-num",
|
||||
"val num",
|
||||
"The return value number",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_enum ("val-type",
|
||||
"val type",
|
||||
"The type of return value: { GIMP_PDB_INT32 (0), GIMP_PDB_INT16 (1), GIMP_PDB_INT8 (2), GIMP_PDB_FLOAT (3), GIMP_PDB_STRING (4), GIMP_PDB_INT32ARRAY (5), GIMP_PDB_INT16ARRAY (6), GIMP_PDB_INT8ARRAY (7), GIMP_PDB_FLOATARRAY (8), GIMP_PDB_STRINGARRAY (9), GIMP_PDB_COLOR (10), GIMP_PDB_REGION (11), GIMP_PDB_DISPLAY (12), GIMP_PDB_IMAGE (13), GIMP_PDB_LAYER (14), GIMP_PDB_CHANNEL (15), GIMP_PDB_DRAWABLE (16), GIMP_PDB_SELECTION (17), GIMP_PDB_BOUNDARY (18), GIMP_PDB_VECTORS (19), GIMP_PDB_PARASITE (20), GIMP_PDB_STATUS (21), GIMP_PDB_PATH (GIMP_PDB_VECTORS) }",
|
||||
GIMP_TYPE_PDB_ARG_TYPE,
|
||||
GIMP_PDB_INT32,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->values[0]),
|
||||
GIMP_PDB_END);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("val-name",
|
||||
"val name",
|
||||
"The name of the return value",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("val-desc",
|
||||
"val desc",
|
||||
"A description of the return value",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-procedural-db-get-data
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 2,
|
||||
procedural_db_get_data_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-procedural-db-get-data",
|
||||
"gimp-procedural-db-get-data",
|
||||
"Returns data associated with the specified identifier.",
|
||||
"This procedure returns any data which may have been associated with the specified identifier. The data is a variable length array of bytes. If no data has been associated with the identifier, an error is returned.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("identifier",
|
||||
"identifier",
|
||||
"The identifier associated with data",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bytes",
|
||||
"bytes",
|
||||
"The number of bytes in the data",
|
||||
1, G_MAXINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int8_array ("data",
|
||||
"data",
|
||||
"A byte array containing data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-procedural-db-get-data-size
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
procedural_db_get_data_size_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-procedural-db-get-data-size",
|
||||
"gimp-procedural-db-get-data-size",
|
||||
"Returns size of data associated with the specified identifier.",
|
||||
"This procedure returns the size of any data which may have been associated with the specified identifier. If no data has been associated with the identifier, an error is returned.",
|
||||
"Nick Lamb",
|
||||
"Nick Lamb",
|
||||
"1998",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("identifier",
|
||||
"identifier",
|
||||
"The identifier associated with data",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("bytes",
|
||||
"bytes",
|
||||
"The number of bytes in the data",
|
||||
1, G_MAXINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-procedural-db-set-data
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 0,
|
||||
procedural_db_set_data_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-procedural-db-set-data",
|
||||
"gimp-procedural-db-set-data",
|
||||
"Associates the specified identifier with the supplied data.",
|
||||
"This procedure associates the supplied data with the provided identifier. The data may be subsequently retrieved by a call to 'procedural-db-get-data'.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("identifier",
|
||||
"identifier",
|
||||
"The identifier associated with data",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("bytes",
|
||||
"bytes",
|
||||
"The number of bytes in the data",
|
||||
1, G_MAXINT32, 1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int8_array ("data",
|
||||
"data",
|
||||
"A byte array containing data",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -32,122 +32,6 @@
|
|||
#include "plug-in/plug-in-progress.h"
|
||||
#include "plug-in/plug-in.h"
|
||||
|
||||
static GimpProcedure progress_init_proc;
|
||||
static GimpProcedure progress_update_proc;
|
||||
static GimpProcedure progress_pulse_proc;
|
||||
static GimpProcedure progress_set_text_proc;
|
||||
static GimpProcedure progress_get_window_handle_proc;
|
||||
static GimpProcedure progress_install_proc;
|
||||
static GimpProcedure progress_uninstall_proc;
|
||||
static GimpProcedure progress_cancel_proc;
|
||||
|
||||
void
|
||||
register_progress_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* progress_init
|
||||
*/
|
||||
procedure = gimp_procedure_init (&progress_init_proc, 2, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("message",
|
||||
"message",
|
||||
"Message to use in the progress dialog",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_display_id ("gdisplay",
|
||||
"gdisplay",
|
||||
"GimpDisplay to update progressbar in, or -1 for a seperate window",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* progress_update
|
||||
*/
|
||||
procedure = gimp_procedure_init (&progress_update_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("percentage",
|
||||
"percentage",
|
||||
"Percentage of progress completed which must be between 0.0 and 1.0",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* progress_pulse
|
||||
*/
|
||||
procedure = gimp_procedure_init (&progress_pulse_proc, 0, 0);
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* progress_set_text
|
||||
*/
|
||||
procedure = gimp_procedure_init (&progress_set_text_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("message",
|
||||
"message",
|
||||
"Message to use in the progress dialog",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* progress_get_window_handle
|
||||
*/
|
||||
procedure = gimp_procedure_init (&progress_get_window_handle_proc, 0, 1);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("window",
|
||||
"window",
|
||||
"The progress bar's toplevel window",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* progress_install
|
||||
*/
|
||||
procedure = gimp_procedure_init (&progress_install_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("progress-callback",
|
||||
"progress callback",
|
||||
"The callback PDB proc to call",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* progress_uninstall
|
||||
*/
|
||||
procedure = gimp_procedure_init (&progress_uninstall_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("progress-callback",
|
||||
"progress callback",
|
||||
"The name of the callback registered for this progress",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* progress_cancel
|
||||
*/
|
||||
procedure = gimp_procedure_init (&progress_cancel_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("progress-callback",
|
||||
"progress callback",
|
||||
"The name of the callback registered for this progress",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
progress_init_invoker (GimpProcedure *procedure,
|
||||
|
@ -177,22 +61,6 @@ progress_init_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure progress_init_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-progress-init",
|
||||
"gimp-progress-init",
|
||||
"Initializes the progress bar for the current plug-in.",
|
||||
"Initializes the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { progress_init_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
progress_update_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -219,22 +87,6 @@ progress_update_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure progress_update_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-progress-update",
|
||||
"gimp-progress-update",
|
||||
"Updates the progress bar for the current plug-in.",
|
||||
"Updates the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { progress_update_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
progress_pulse_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -253,22 +105,6 @@ progress_pulse_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure progress_pulse_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-progress-pulse",
|
||||
"gimp-progress-pulse",
|
||||
"Pulses the progress bar for the current plug-in.",
|
||||
"Updates the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in. Use this function instead of gimp_progress_update() if you cannot tell how much progress has been made. This usually causes the the progress bar to enter \"activity mode\", where a block bounces back and forth.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { progress_pulse_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
progress_set_text_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -295,22 +131,6 @@ progress_set_text_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure progress_set_text_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-progress-set-text",
|
||||
"gimp-progress-set-text",
|
||||
"Changes the text in the progress bar for the current plug-in.",
|
||||
"This function allows to change the text in the progress bar for the current plug-in. Unlike gimp_progress_init() it does not change the displayed value.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2005",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { progress_set_text_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
progress_get_window_handle_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -338,22 +158,6 @@ progress_get_window_handle_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure progress_get_window_handle_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-progress-get-window-handle",
|
||||
"gimp-progress-get-window-handle",
|
||||
"Returns the native window ID of the toplevel window this plug-in's progress is displayed in.",
|
||||
"This function returns the native window ID of the toplevel window this plug-in\'s progress is displayed in.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { progress_get_window_handle_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
progress_install_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -378,22 +182,6 @@ progress_install_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure progress_install_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-progress-install",
|
||||
"gimp-progress-install",
|
||||
"Installs a progress callback for the current plug-in.",
|
||||
"This function installs a temporary PDB procedure which will handle all progress calls made by this plug-in and any procedure it calls. Calling this function multiple times simply replaces the old progress callbacks.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { progress_install_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
progress_uninstall_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -418,22 +206,6 @@ progress_uninstall_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure progress_uninstall_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-progress-uninstall",
|
||||
"gimp-progress-uninstall",
|
||||
"Uninstalls the progress callback for the current plug-in.",
|
||||
"This function uninstalls any progress callback installed with gimp_progress_install() before.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { progress_uninstall_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
progress_cancel_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -458,18 +230,206 @@ progress_cancel_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure progress_cancel_proc =
|
||||
void
|
||||
register_progress_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-progress-cancel",
|
||||
"gimp-progress-cancel",
|
||||
"Cancels a running progress.",
|
||||
"This function cancels the currently running progress.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { progress_cancel_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-progress-init
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 0,
|
||||
progress_init_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-progress-init",
|
||||
"gimp-progress-init",
|
||||
"Initializes the progress bar for the current plug-in.",
|
||||
"Initializes the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("message",
|
||||
"message",
|
||||
"Message to use in the progress dialog",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_display_id ("gdisplay",
|
||||
"gdisplay",
|
||||
"GimpDisplay to update progressbar in, or -1 for a seperate window",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-progress-update
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
progress_update_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-progress-update",
|
||||
"gimp-progress-update",
|
||||
"Updates the progress bar for the current plug-in.",
|
||||
"Updates the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("percentage",
|
||||
"percentage",
|
||||
"Percentage of progress completed which must be between 0.0 and 1.0",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-progress-pulse
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 0,
|
||||
progress_pulse_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-progress-pulse",
|
||||
"gimp-progress-pulse",
|
||||
"Pulses the progress bar for the current plug-in.",
|
||||
"Updates the progress bar for the current plug-in. It is only valid to call this procedure from a plug-in. Use this function instead of gimp_progress_update() if you cannot tell how much progress has been made. This usually causes the the progress bar to enter \"activity mode\", where a block bounces back and forth.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-progress-set-text
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
progress_set_text_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-progress-set-text",
|
||||
"gimp-progress-set-text",
|
||||
"Changes the text in the progress bar for the current plug-in.",
|
||||
"This function allows to change the text in the progress bar for the current plug-in. Unlike gimp_progress_init() it does not change the displayed value.",
|
||||
"Sven Neumann <sven@gimp.org>",
|
||||
"Sven Neumann",
|
||||
"2005",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("message",
|
||||
"message",
|
||||
"Message to use in the progress dialog",
|
||||
FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-progress-get-window-handle
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 0, 1,
|
||||
progress_get_window_handle_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-progress-get-window-handle",
|
||||
"gimp-progress-get-window-handle",
|
||||
"Returns the native window ID of the toplevel window this plug-in's progress is displayed in.",
|
||||
"This function returns the native window ID of the toplevel window this plug-in\'s progress is displayed in.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("window",
|
||||
"window",
|
||||
"The progress bar's toplevel window",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-progress-install
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
progress_install_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-progress-install",
|
||||
"gimp-progress-install",
|
||||
"Installs a progress callback for the current plug-in.",
|
||||
"This function installs a temporary PDB procedure which will handle all progress calls made by this plug-in and any procedure it calls. Calling this function multiple times simply replaces the old progress callbacks.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("progress-callback",
|
||||
"progress callback",
|
||||
"The callback PDB proc to call",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-progress-uninstall
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
progress_uninstall_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-progress-uninstall",
|
||||
"gimp-progress-uninstall",
|
||||
"Uninstalls the progress callback for the current plug-in.",
|
||||
"This function uninstalls any progress callback installed with gimp_progress_install() before.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("progress-callback",
|
||||
"progress callback",
|
||||
"The name of the callback registered for this progress",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-progress-cancel
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
progress_cancel_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-progress-cancel",
|
||||
"gimp-progress-cancel",
|
||||
"Cancels a running progress.",
|
||||
"This function cancels the currently running progress.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2004",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("progress-callback",
|
||||
"progress callback",
|
||||
"The name of the callback registered for this progress",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -35,11 +35,222 @@
|
|||
#include "core/gimpimage.h"
|
||||
#include "gimp-intl.h"
|
||||
|
||||
static GimpProcedure by_color_select_proc;
|
||||
static GimpProcedure ellipse_select_proc;
|
||||
static GimpProcedure free_select_proc;
|
||||
static GimpProcedure fuzzy_select_proc;
|
||||
static GimpProcedure rect_select_proc;
|
||||
|
||||
static GValueArray *
|
||||
by_color_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
GimpRGB color;
|
||||
gint32 threshold;
|
||||
gint32 operation;
|
||||
gboolean antialias;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
gboolean sample_merged;
|
||||
|
||||
drawable = gimp_value_get_drawable (&args->values[0], gimp);
|
||||
gimp_value_get_rgb (&args->values[1], &color);
|
||||
threshold = g_value_get_int (&args->values[2]);
|
||||
operation = g_value_get_enum (&args->values[3]);
|
||||
antialias = g_value_get_boolean (&args->values[4]);
|
||||
feather = g_value_get_boolean (&args->values[5]);
|
||||
feather_radius = g_value_get_double (&args->values[6]);
|
||||
sample_merged = g_value_get_boolean (&args->values[7]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
|
||||
sample_merged,
|
||||
&color,
|
||||
threshold,
|
||||
FALSE /* don't select transparent */,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
ellipse_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble width;
|
||||
gdouble height;
|
||||
gint32 operation;
|
||||
gboolean antialias;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
x = g_value_get_double (&args->values[1]);
|
||||
y = g_value_get_double (&args->values[2]);
|
||||
width = g_value_get_double (&args->values[3]);
|
||||
height = g_value_get_double (&args->values[4]);
|
||||
operation = g_value_get_enum (&args->values[5]);
|
||||
antialias = g_value_get_boolean (&args->values[6]);
|
||||
feather = g_value_get_boolean (&args->values[7]);
|
||||
feather_radius = g_value_get_double (&args->values[8]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_select_ellipse (gimp_image_get_mask (image),
|
||||
(gint) x, (gint) y,
|
||||
(gint) width, (gint) height,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
free_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
gint32 num_segs;
|
||||
const gdouble *segs;
|
||||
gint32 operation;
|
||||
gboolean antialias;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
num_segs = g_value_get_int (&args->values[1]);
|
||||
segs = gimp_value_get_floatarray (&args->values[2]);
|
||||
operation = g_value_get_enum (&args->values[3]);
|
||||
antialias = g_value_get_boolean (&args->values[4]);
|
||||
feather = g_value_get_boolean (&args->values[5]);
|
||||
feather_radius = g_value_get_double (&args->values[6]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_select_polygon (gimp_image_get_mask (image),
|
||||
_("Free Select"),
|
||||
num_segs / 2,
|
||||
(GimpVector2 *) segs,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
fuzzy_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gint32 threshold;
|
||||
gint32 operation;
|
||||
gboolean antialias;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
gboolean sample_merged;
|
||||
|
||||
drawable = gimp_value_get_drawable (&args->values[0], gimp);
|
||||
x = g_value_get_double (&args->values[1]);
|
||||
y = g_value_get_double (&args->values[2]);
|
||||
threshold = g_value_get_int (&args->values[3]);
|
||||
operation = g_value_get_enum (&args->values[4]);
|
||||
antialias = g_value_get_boolean (&args->values[5]);
|
||||
feather = g_value_get_boolean (&args->values[6]);
|
||||
feather_radius = g_value_get_double (&args->values[7]);
|
||||
sample_merged = g_value_get_boolean (&args->values[8]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
gimp_channel_select_fuzzy (gimp_image_get_mask (image),
|
||||
drawable,
|
||||
sample_merged,
|
||||
x, y,
|
||||
threshold,
|
||||
FALSE /* don't select transparent */,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
rect_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble width;
|
||||
gdouble height;
|
||||
gint32 operation;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
x = g_value_get_double (&args->values[1]);
|
||||
y = g_value_get_double (&args->values[2]);
|
||||
width = g_value_get_double (&args->values[3]);
|
||||
height = g_value_get_double (&args->values[4]);
|
||||
operation = g_value_get_enum (&args->values[5]);
|
||||
feather = g_value_get_boolean (&args->values[6]);
|
||||
feather_radius = g_value_get_double (&args->values[7]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_select_rectangle (gimp_image_get_mask (image),
|
||||
(gint) x, (gint) y,
|
||||
(gint) width, (gint) height,
|
||||
operation,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
void
|
||||
register_selection_tools_procs (Gimp *gimp)
|
||||
|
@ -47,9 +258,21 @@ register_selection_tools_procs (Gimp *gimp)
|
|||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* by_color_select
|
||||
* gimp-by-color-select
|
||||
*/
|
||||
procedure = gimp_procedure_init (&by_color_select_proc, 8, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 8, 0,
|
||||
by_color_select_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-by-color-select",
|
||||
"gimp-by-color-select",
|
||||
"Create a selection by selecting all pixels (in the specified drawable) with the same (or similar) color to that specified.",
|
||||
"This tool creates a selection over the specified image. A by-color selection is determined by the supplied color under the constraints of the specified threshold. Essentially, all pixels (in the drawable) that have color sufficiently close to the specified color (as determined by the threshold value) are included in the selection. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar. Feathering can be enabled optionally and is controlled with the \"feather_radius\" parameter. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
|
@ -102,9 +325,21 @@ register_selection_tools_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* ellipse_select
|
||||
* gimp-ellipse-select
|
||||
*/
|
||||
procedure = gimp_procedure_init (&ellipse_select_proc, 9, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 9, 0,
|
||||
ellipse_select_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-ellipse-select",
|
||||
"gimp-ellipse-select",
|
||||
"Create an elliptical selection over the specified image.",
|
||||
"This tool creates an elliptical selection over the specified image. The elliptical region can be either added to, subtracted from, or replace the contents of the previous selection mask. If antialiasing is turned on, the edges of the elliptical region will contain intermediate values which give the appearance of a sharper, less pixelized edge. This should be set as TRUE most of the time. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
|
@ -163,9 +398,21 @@ register_selection_tools_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* free_select
|
||||
* gimp-free-select
|
||||
*/
|
||||
procedure = gimp_procedure_init (&free_select_proc, 7, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 7, 0,
|
||||
free_select_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-free-select",
|
||||
"gimp-free-select",
|
||||
"Create a polygonal selection over the specified image.",
|
||||
"This tool creates a polygonal selection over the specified image. The polygonal region can be either added to, subtracted from, or replace the contents of the previous selection mask. The polygon is specified through an array of floating point numbers and its length. The length of array must be 2n, where n is the number of points. Each point is defined by 2 floating point values which correspond to the x and y coordinates. If the final point does not connect to the starting point, a connecting segment is automatically added. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
|
@ -211,9 +458,22 @@ register_selection_tools_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* fuzzy_select
|
||||
* gimp-fuzzy-select
|
||||
*/
|
||||
procedure = gimp_procedure_init (&fuzzy_select_proc, 9, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 9, 0,
|
||||
fuzzy_select_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-fuzzy-select",
|
||||
"gimp-fuzzy-select",
|
||||
"Create a fuzzy selection starting at the specified coordinates on the specified drawable.",
|
||||
"This tool creates a fuzzy selection over the specified image. A fuzzy selection is determined by a seed fill under the constraints of the specified threshold. Essentially, the color at the specified coordinates (in the drawable) is measured and the selection expands outwards from that point to any adjacent pixels which are not significantly different (as determined by the threshold value). This process continues until no more expansion is possible. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar at pixels along the seed fill boundary. Feathering can be enabled optionally and is controlled with the \"feather_radius\" paramter. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored. If"
|
||||
"the sample is merged, the specified coordinates are relative to the image origin; otherwise, they are relative to the drawable's origin.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
|
@ -272,9 +532,21 @@ register_selection_tools_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* rect_select
|
||||
* gimp-rect-select
|
||||
*/
|
||||
procedure = gimp_procedure_init (&rect_select_proc, 8, 0);
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 8, 0,
|
||||
rect_select_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-rect-select",
|
||||
"gimp-rect-select",
|
||||
"Create a rectangular selection over the specified image;",
|
||||
"This tool creates a rectangular selection over the specified image. The rectangular region can be either added to, subtracted from, or replace the contents of the previous selection mask. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
|
@ -327,300 +599,3 @@ register_selection_tools_procs (Gimp *gimp)
|
|||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
by_color_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
GimpRGB color;
|
||||
gint32 threshold;
|
||||
gint32 operation;
|
||||
gboolean antialias;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
gboolean sample_merged;
|
||||
|
||||
drawable = gimp_value_get_drawable (&args->values[0], gimp);
|
||||
gimp_value_get_rgb (&args->values[1], &color);
|
||||
threshold = g_value_get_int (&args->values[2]);
|
||||
operation = g_value_get_enum (&args->values[3]);
|
||||
antialias = g_value_get_boolean (&args->values[4]);
|
||||
feather = g_value_get_boolean (&args->values[5]);
|
||||
feather_radius = g_value_get_double (&args->values[6]);
|
||||
sample_merged = g_value_get_boolean (&args->values[7]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
|
||||
sample_merged,
|
||||
&color,
|
||||
threshold,
|
||||
FALSE /* don't select transparent */,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure by_color_select_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-by-color-select",
|
||||
"gimp-by-color-select",
|
||||
"Create a selection by selecting all pixels (in the specified drawable) with the same (or similar) color to that specified.",
|
||||
"This tool creates a selection over the specified image. A by-color selection is determined by the supplied color under the constraints of the specified threshold. Essentially, all pixels (in the drawable) that have color sufficiently close to the specified color (as determined by the threshold value) are included in the selection. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar. Feathering can be enabled optionally and is controlled with the \"feather_radius\" parameter. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { by_color_select_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
ellipse_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble width;
|
||||
gdouble height;
|
||||
gint32 operation;
|
||||
gboolean antialias;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
x = g_value_get_double (&args->values[1]);
|
||||
y = g_value_get_double (&args->values[2]);
|
||||
width = g_value_get_double (&args->values[3]);
|
||||
height = g_value_get_double (&args->values[4]);
|
||||
operation = g_value_get_enum (&args->values[5]);
|
||||
antialias = g_value_get_boolean (&args->values[6]);
|
||||
feather = g_value_get_boolean (&args->values[7]);
|
||||
feather_radius = g_value_get_double (&args->values[8]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_select_ellipse (gimp_image_get_mask (image),
|
||||
(gint) x, (gint) y,
|
||||
(gint) width, (gint) height,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure ellipse_select_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-ellipse-select",
|
||||
"gimp-ellipse-select",
|
||||
"Create an elliptical selection over the specified image.",
|
||||
"This tool creates an elliptical selection over the specified image. The elliptical region can be either added to, subtracted from, or replace the contents of the previous selection mask. If antialiasing is turned on, the edges of the elliptical region will contain intermediate values which give the appearance of a sharper, less pixelized edge. This should be set as TRUE most of the time. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { ellipse_select_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
free_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
gint32 num_segs;
|
||||
const gdouble *segs;
|
||||
gint32 operation;
|
||||
gboolean antialias;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
num_segs = g_value_get_int (&args->values[1]);
|
||||
segs = gimp_value_get_floatarray (&args->values[2]);
|
||||
operation = g_value_get_enum (&args->values[3]);
|
||||
antialias = g_value_get_boolean (&args->values[4]);
|
||||
feather = g_value_get_boolean (&args->values[5]);
|
||||
feather_radius = g_value_get_double (&args->values[6]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_select_polygon (gimp_image_get_mask (image),
|
||||
_("Free Select"),
|
||||
num_segs / 2,
|
||||
(GimpVector2 *) segs,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure free_select_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-free-select",
|
||||
"gimp-free-select",
|
||||
"Create a polygonal selection over the specified image.",
|
||||
"This tool creates a polygonal selection over the specified image. The polygonal region can be either added to, subtracted from, or replace the contents of the previous selection mask. The polygon is specified through an array of floating point numbers and its length. The length of array must be 2n, where n is the number of points. Each point is defined by 2 floating point values which correspond to the x and y coordinates. If the final point does not connect to the starting point, a connecting segment is automatically added. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { free_select_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
fuzzy_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpDrawable *drawable;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gint32 threshold;
|
||||
gint32 operation;
|
||||
gboolean antialias;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
gboolean sample_merged;
|
||||
|
||||
drawable = gimp_value_get_drawable (&args->values[0], gimp);
|
||||
x = g_value_get_double (&args->values[1]);
|
||||
y = g_value_get_double (&args->values[2]);
|
||||
threshold = g_value_get_int (&args->values[3]);
|
||||
operation = g_value_get_enum (&args->values[4]);
|
||||
antialias = g_value_get_boolean (&args->values[5]);
|
||||
feather = g_value_get_boolean (&args->values[6]);
|
||||
feather_radius = g_value_get_double (&args->values[7]);
|
||||
sample_merged = g_value_get_boolean (&args->values[8]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
gimp_channel_select_fuzzy (gimp_image_get_mask (image),
|
||||
drawable,
|
||||
sample_merged,
|
||||
x, y,
|
||||
threshold,
|
||||
FALSE /* don't select transparent */,
|
||||
operation,
|
||||
antialias,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure fuzzy_select_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-fuzzy-select",
|
||||
"gimp-fuzzy-select",
|
||||
"Create a fuzzy selection starting at the specified coordinates on the specified drawable.",
|
||||
"This tool creates a fuzzy selection over the specified image. A fuzzy selection is determined by a seed fill under the constraints of the specified threshold. Essentially, the color at the specified coordinates (in the drawable) is measured and the selection expands outwards from that point to any adjacent pixels which are not significantly different (as determined by the threshold value). This process continues until no more expansion is possible. The antialiasing parameter allows the final selection mask to contain intermediate values based on close misses to the threshold bar at pixels along the seed fill boundary. Feathering can be enabled optionally and is controlled with the \"feather_radius\" paramter. If the sample_merged parameter is TRUE, the data of the composite image will be used instead of that for the specified drawable. This is equivalent to sampling for colors after merging all visible layers. In the case of a merged sampling, the supplied drawable is ignored. If"
|
||||
"the sample is merged, the specified coordinates are relative to the image origin; otherwise, they are relative to the drawable's origin.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { fuzzy_select_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
rect_select_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *image;
|
||||
gdouble x;
|
||||
gdouble y;
|
||||
gdouble width;
|
||||
gdouble height;
|
||||
gint32 operation;
|
||||
gboolean feather;
|
||||
gdouble feather_radius;
|
||||
|
||||
image = gimp_value_get_image (&args->values[0], gimp);
|
||||
x = g_value_get_double (&args->values[1]);
|
||||
y = g_value_get_double (&args->values[2]);
|
||||
width = g_value_get_double (&args->values[3]);
|
||||
height = g_value_get_double (&args->values[4]);
|
||||
operation = g_value_get_enum (&args->values[5]);
|
||||
feather = g_value_get_boolean (&args->values[6]);
|
||||
feather_radius = g_value_get_double (&args->values[7]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_channel_select_rectangle (gimp_image_get_mask (image),
|
||||
(gint) x, (gint) y,
|
||||
(gint) width, (gint) height,
|
||||
operation,
|
||||
feather,
|
||||
feather_radius,
|
||||
feather_radius);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure rect_select_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-rect-select",
|
||||
"gimp-rect-select",
|
||||
"Create a rectangular selection over the specified image;",
|
||||
"This tool creates a rectangular selection over the specified image. The rectangular region can be either added to, subtracted from, or replace the contents of the previous selection mask. If the feather option is enabled, the resulting selection is blurred before combining. The blur is a gaussian blur with the specified feather radius.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { rect_select_invoker } }
|
||||
};
|
||||
|
|
|
@ -35,379 +35,6 @@
|
|||
#include "core/gimplayer.h"
|
||||
#include "text/gimptext-compat.h"
|
||||
|
||||
static GimpProcedure text_fontname_proc;
|
||||
static GimpProcedure text_get_extents_fontname_proc;
|
||||
static GimpProcedure text_proc;
|
||||
static GimpProcedure text_get_extents_proc;
|
||||
|
||||
void
|
||||
register_text_tool_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* text_fontname
|
||||
*/
|
||||
procedure = gimp_procedure_init (&text_fontname_proc, 10, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable: (-1 for a new text layer)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x",
|
||||
"x",
|
||||
"The x coordinate for the left of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y",
|
||||
"y",
|
||||
"The y coordinate for the top of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("border",
|
||||
"border",
|
||||
"The size of the border (-1 <= border)",
|
||||
-1, G_MAXINT32, -1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("antialias",
|
||||
"antialias",
|
||||
"Antialiasing (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size: { GIMP_PIXELS (0), GIMP_POINTS (1) }",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("fontname",
|
||||
"fontname",
|
||||
"The name of the font",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_layer_id ("text-layer",
|
||||
"text layer",
|
||||
"The new text layer or -1 if no layer was created.",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* text_get_extents_fontname
|
||||
*/
|
||||
procedure = gimp_procedure_init (&text_get_extents_fontname_proc, 4, 4);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size: { GIMP_PIXELS (0), GIMP_POINTS (1) }",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("fontname",
|
||||
"fontname",
|
||||
"The name of the font",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The width of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The height of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("ascent",
|
||||
"ascent",
|
||||
"The ascent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("descent",
|
||||
"descent",
|
||||
"The descent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* text
|
||||
*/
|
||||
procedure = gimp_procedure_init (&text_proc, 17, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable: (-1 for a new text layer)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x",
|
||||
"x",
|
||||
"The x coordinate for the left of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y",
|
||||
"y",
|
||||
"The y coordinate for the top of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("border",
|
||||
"border",
|
||||
"The size of the border (-1 <= border)",
|
||||
-1, G_MAXINT32, -1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("antialias",
|
||||
"antialias",
|
||||
"Antialiasing (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size: { GIMP_PIXELS (0), GIMP_POINTS (1) }",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("foundry",
|
||||
"foundry",
|
||||
"The font foundry",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("family",
|
||||
"family",
|
||||
"The font family",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("weight",
|
||||
"weight",
|
||||
"The font weight",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("slant",
|
||||
"slant",
|
||||
"The font slant",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("set-width",
|
||||
"set width",
|
||||
"The font set-width",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("spacing",
|
||||
"spacing",
|
||||
"The font spacing",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("registry",
|
||||
"registry",
|
||||
"The font registry",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("encoding",
|
||||
"encoding",
|
||||
"The font encoding",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_layer_id ("text-layer",
|
||||
"text layer",
|
||||
"The new text layer or -1 if no layer was created.",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* text_get_extents
|
||||
*/
|
||||
procedure = gimp_procedure_init (&text_get_extents_proc, 11, 4);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size: { GIMP_PIXELS (0), GIMP_POINTS (1) }",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("foundry",
|
||||
"foundry",
|
||||
"The font foundry",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("family",
|
||||
"family",
|
||||
"The font family",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("weight",
|
||||
"weight",
|
||||
"The font weight",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("slant",
|
||||
"slant",
|
||||
"The font slant",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("set-width",
|
||||
"set width",
|
||||
"The font set-width",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("spacing",
|
||||
"spacing",
|
||||
"The font spacing",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("registry",
|
||||
"registry",
|
||||
"The font registry",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("encoding",
|
||||
"encoding",
|
||||
"The font encoding",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The width of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The height of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("ascent",
|
||||
"ascent",
|
||||
"The ascent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("descent",
|
||||
"descent",
|
||||
"The descent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
text_fontname_invoker (GimpProcedure *procedure,
|
||||
|
@ -466,22 +93,6 @@ text_fontname_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure text_fontname_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-text-fontname",
|
||||
"gimp-text-fontname",
|
||||
"Add text at the specified location as a floating selection or a new layer.",
|
||||
"This tool requires a fontname matching an installed PangoFT2 font. You can specify the fontsize in units of pixels or points, and the appropriate metric is specified using the size_type argument. The x and y parameters together control the placement of the new text by specifying the upper left corner of the text bounding box. If the specified drawable parameter is valid, the text will be created as a floating selection attached to the drawable. If the drawable parameter is not valid (-1), the text will appear as a new layer. Finally, a border can be specified around the final rendered text. The border is measured in pixels.",
|
||||
"Martin Edlman & Sven Neumann",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1998- 2001",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { text_fontname_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
text_get_extents_fontname_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -529,22 +140,6 @@ text_get_extents_fontname_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure text_get_extents_fontname_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-text-get-extents-fontname",
|
||||
"gimp-text-get-extents-fontname",
|
||||
"Get extents of the bounding box for the specified text.",
|
||||
"This tool returns the width and height of a bounding box for the specified text string with the specified font information. Ascent and descent for the specified font are returned as well.",
|
||||
"Martin Edlman & Sven Neumann",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1998- 2001",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { text_get_extents_fontname_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
text_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -616,22 +211,6 @@ text_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure text_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-text",
|
||||
"gimp-text",
|
||||
"This procedure is deprecated! Use 'gimp-text-fontname' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-text-fontname' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-text-fontname",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { text_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
text_get_extents_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -693,18 +272,419 @@ text_get_extents_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure text_get_extents_proc =
|
||||
void
|
||||
register_text_tool_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-text-get-extents",
|
||||
"gimp-text-get-extents",
|
||||
"This procedure is deprecated! Use 'gimp-text-get-extents-fontname' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-text-get-extents-fontname' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-text-get-extents-fontname",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { text_get_extents_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-text-fontname
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 10, 1,
|
||||
text_fontname_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-text-fontname",
|
||||
"gimp-text-fontname",
|
||||
"Add text at the specified location as a floating selection or a new layer.",
|
||||
"This tool requires a fontname matching an installed PangoFT2 font. You can specify the fontsize in units of pixels or points, and the appropriate metric is specified using the size_type argument. The x and y parameters together control the placement of the new text by specifying the upper left corner of the text bounding box. If the specified drawable parameter is valid, the text will be created as a floating selection attached to the drawable. If the drawable parameter is not valid (-1), the text will appear as a new layer. Finally, a border can be specified around the final rendered text. The border is measured in pixels.",
|
||||
"Martin Edlman & Sven Neumann",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1998- 2001",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable: (-1 for a new text layer)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x",
|
||||
"x",
|
||||
"The x coordinate for the left of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y",
|
||||
"y",
|
||||
"The y coordinate for the top of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("border",
|
||||
"border",
|
||||
"The size of the border (-1 <= border)",
|
||||
-1, G_MAXINT32, -1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("antialias",
|
||||
"antialias",
|
||||
"Antialiasing (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size: { GIMP_PIXELS (0), GIMP_POINTS (1) }",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("fontname",
|
||||
"fontname",
|
||||
"The name of the font",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_layer_id ("text-layer",
|
||||
"text layer",
|
||||
"The new text layer or -1 if no layer was created.",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-text-get-extents-fontname
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 4, 4,
|
||||
text_get_extents_fontname_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-text-get-extents-fontname",
|
||||
"gimp-text-get-extents-fontname",
|
||||
"Get extents of the bounding box for the specified text.",
|
||||
"This tool returns the width and height of a bounding box for the specified text string with the specified font information. Ascent and descent for the specified font are returned as well.",
|
||||
"Martin Edlman & Sven Neumann",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1998- 2001",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size: { GIMP_PIXELS (0), GIMP_POINTS (1) }",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("fontname",
|
||||
"fontname",
|
||||
"The name of the font",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The width of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The height of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("ascent",
|
||||
"ascent",
|
||||
"The ascent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("descent",
|
||||
"descent",
|
||||
"The descent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-text
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 17, 1,
|
||||
text_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-text",
|
||||
"gimp-text",
|
||||
"This procedure is deprecated! Use 'gimp-text-fontname' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-text-fontname' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-text-fontname");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable: (-1 for a new text layer)",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x",
|
||||
"x",
|
||||
"The x coordinate for the left of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y",
|
||||
"y",
|
||||
"The y coordinate for the top of the text bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_int32 ("border",
|
||||
"border",
|
||||
"The size of the border (-1 <= border)",
|
||||
-1, G_MAXINT32, -1,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("antialias",
|
||||
"antialias",
|
||||
"Antialiasing (TRUE or FALSE)",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size: { GIMP_PIXELS (0), GIMP_POINTS (1) }",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("foundry",
|
||||
"foundry",
|
||||
"The font foundry",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("family",
|
||||
"family",
|
||||
"The font family",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("weight",
|
||||
"weight",
|
||||
"The font weight",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("slant",
|
||||
"slant",
|
||||
"The font slant",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("set-width",
|
||||
"set width",
|
||||
"The font set-width",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("spacing",
|
||||
"spacing",
|
||||
"The font spacing",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("registry",
|
||||
"registry",
|
||||
"The font registry",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("encoding",
|
||||
"encoding",
|
||||
"The font encoding",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_layer_id ("text-layer",
|
||||
"text layer",
|
||||
"The new text layer or -1 if no layer was created.",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-text-get-extents
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 11, 4,
|
||||
text_get_extents_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-text-get-extents",
|
||||
"gimp-text-get-extents",
|
||||
"This procedure is deprecated! Use 'gimp-text-get-extents-fontname' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-text-get-extents-fontname' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-text-get-extents-fontname");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("text",
|
||||
"text",
|
||||
"The text to generate (in UTF-8 encoding)",
|
||||
FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("size",
|
||||
"size",
|
||||
"The size of text in either pixels or points",
|
||||
0, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_enum ("size-type",
|
||||
"size type",
|
||||
"The units of specified size: { GIMP_PIXELS (0), GIMP_POINTS (1) }",
|
||||
GIMP_TYPE_SIZE_TYPE,
|
||||
GIMP_PIXELS,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("foundry",
|
||||
"foundry",
|
||||
"The font foundry",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("family",
|
||||
"family",
|
||||
"The font family",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("weight",
|
||||
"weight",
|
||||
"The font weight",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("slant",
|
||||
"slant",
|
||||
"The font slant",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("set-width",
|
||||
"set width",
|
||||
"The font set-width",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("spacing",
|
||||
"spacing",
|
||||
"The font spacing",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("registry",
|
||||
"registry",
|
||||
"The font registry",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("encoding",
|
||||
"encoding",
|
||||
"The font encoding",
|
||||
TRUE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("width",
|
||||
"width",
|
||||
"The width of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("height",
|
||||
"height",
|
||||
"The height of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("ascent",
|
||||
"ascent",
|
||||
"The ascent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("descent",
|
||||
"descent",
|
||||
"The descent of the specified font",
|
||||
G_MININT32, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -39,301 +39,6 @@
|
|||
#include "core/gimpprogress.h"
|
||||
#include "gimp-intl.h"
|
||||
|
||||
static GimpProcedure flip_proc;
|
||||
static GimpProcedure perspective_proc;
|
||||
static GimpProcedure rotate_proc;
|
||||
static GimpProcedure scale_proc;
|
||||
static GimpProcedure shear_proc;
|
||||
static GimpProcedure transform_2d_proc;
|
||||
|
||||
void
|
||||
register_transform_tools_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* flip
|
||||
*/
|
||||
procedure = gimp_procedure_init (&flip_proc, 2, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_enum ("flip-type",
|
||||
"flip type",
|
||||
"Type of flip: { GIMP_ORIENTATION_HORIZONTAL (0), GIMP_ORIENTATION_VERTICAL (1) }",
|
||||
GIMP_TYPE_ORIENTATION_TYPE,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[1]),
|
||||
GIMP_ORIENTATION_UNKNOWN);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The flipped drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* perspective
|
||||
*/
|
||||
procedure = gimp_procedure_init (&perspective_proc, 10, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x0",
|
||||
"x0",
|
||||
"The new x coordinate of upper-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y0",
|
||||
"y0",
|
||||
"The new y coordinate of upper-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x1",
|
||||
"x1",
|
||||
"The new x coordinate of upper-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y1",
|
||||
"y1",
|
||||
"The new y coordinate of upper-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x2",
|
||||
"x2",
|
||||
"The new x coordinate of lower-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y2",
|
||||
"y2",
|
||||
"The new y coordinate of lower-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x3",
|
||||
"x3",
|
||||
"The new x coordinate of lower-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y3",
|
||||
"y3",
|
||||
"The new y coordinate of lower-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The newly mapped drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* rotate
|
||||
*/
|
||||
procedure = gimp_procedure_init (&rotate_proc, 3, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("angle",
|
||||
"angle",
|
||||
"The angle of rotation (radians)",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The rotated drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* scale
|
||||
*/
|
||||
procedure = gimp_procedure_init (&scale_proc, 6, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x0",
|
||||
"x0",
|
||||
"The new x coordinate of the upper-left corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y0",
|
||||
"y0",
|
||||
"The new y coordinate of the upper-left corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x1",
|
||||
"x1",
|
||||
"The new x coordinate of the lower-right corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y1",
|
||||
"y1",
|
||||
"The new y coordinate of the lower-right corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The scaled drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* shear
|
||||
*/
|
||||
procedure = gimp_procedure_init (&shear_proc, 4, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_enum ("shear-type",
|
||||
"shear type",
|
||||
"Type of shear: { GIMP_ORIENTATION_HORIZONTAL (0), GIMP_ORIENTATION_VERTICAL (1) }",
|
||||
GIMP_TYPE_ORIENTATION_TYPE,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[2]),
|
||||
GIMP_ORIENTATION_UNKNOWN);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("magnitude",
|
||||
"magnitude",
|
||||
"The magnitude of the shear",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The sheared drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* transform_2d
|
||||
*/
|
||||
procedure = gimp_procedure_init (&transform_2d_proc, 9, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("source-x",
|
||||
"source x",
|
||||
"X coordinate of the transformation center",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("source-y",
|
||||
"source y",
|
||||
"Y coordinate of the transformation center",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("scale-x",
|
||||
"scale x",
|
||||
"Amount to scale in x direction",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("scale-y",
|
||||
"scale y",
|
||||
"Amount to scale in y direction",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("angle",
|
||||
"angle",
|
||||
"The angle of rotation (radians)",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("dest-x",
|
||||
"dest x",
|
||||
"X coordinate of where the centre goes",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("dest-y",
|
||||
"dest y",
|
||||
"Y coordinate of where the centre goes",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The transformed drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
flip_invoker (GimpProcedure *procedure,
|
||||
|
@ -372,22 +77,6 @@ flip_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure flip_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-flip",
|
||||
"gimp-flip",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-flip-simple' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-flip-simple' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-flip-simple",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { flip_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
perspective_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -466,22 +155,6 @@ perspective_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure perspective_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-perspective",
|
||||
"gimp-perspective",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-perspective-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-perspective-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-perspective-default",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { perspective_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
rotate_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -542,22 +215,6 @@ rotate_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure rotate_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-rotate",
|
||||
"gimp-rotate",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-rotate-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-rotate-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-rotate-default",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { rotate_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
scale_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -628,22 +285,6 @@ scale_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure scale_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-scale",
|
||||
"gimp-scale",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-scale-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-scale-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-scale-default",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { scale_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
shear_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -707,22 +348,6 @@ shear_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure shear_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-shear",
|
||||
"gimp-shear",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-shear-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-shear-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-shear-default",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { shear_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
transform_2d_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -796,18 +421,363 @@ transform_2d_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure transform_2d_proc =
|
||||
void
|
||||
register_transform_tools_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-transform-2d",
|
||||
"gimp-transform-2d",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-2d-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-2d-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-2d-default",
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { transform_2d_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-flip
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 2, 1,
|
||||
flip_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-flip",
|
||||
"gimp-flip",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-flip-simple' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-flip-simple' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-flip-simple");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_enum ("flip-type",
|
||||
"flip type",
|
||||
"Type of flip: { GIMP_ORIENTATION_HORIZONTAL (0), GIMP_ORIENTATION_VERTICAL (1) }",
|
||||
GIMP_TYPE_ORIENTATION_TYPE,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[1]),
|
||||
GIMP_ORIENTATION_UNKNOWN);
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The flipped drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-perspective
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 10, 1,
|
||||
perspective_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-perspective",
|
||||
"gimp-perspective",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-perspective-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-perspective-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-perspective-default");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x0",
|
||||
"x0",
|
||||
"The new x coordinate of upper-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y0",
|
||||
"y0",
|
||||
"The new y coordinate of upper-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x1",
|
||||
"x1",
|
||||
"The new x coordinate of upper-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y1",
|
||||
"y1",
|
||||
"The new y coordinate of upper-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x2",
|
||||
"x2",
|
||||
"The new x coordinate of lower-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y2",
|
||||
"y2",
|
||||
"The new y coordinate of lower-left corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x3",
|
||||
"x3",
|
||||
"The new x coordinate of lower-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y3",
|
||||
"y3",
|
||||
"The new y coordinate of lower-right corner of original bounding box",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The newly mapped drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-rotate
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 1,
|
||||
rotate_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-rotate",
|
||||
"gimp-rotate",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-rotate-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-rotate-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-rotate-default");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("angle",
|
||||
"angle",
|
||||
"The angle of rotation (radians)",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The rotated drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-scale
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 6, 1,
|
||||
scale_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-scale",
|
||||
"gimp-scale",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-scale-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-scale-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-scale-default");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x0",
|
||||
"x0",
|
||||
"The new x coordinate of the upper-left corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y0",
|
||||
"y0",
|
||||
"The new y coordinate of the upper-left corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("x1",
|
||||
"x1",
|
||||
"The new x coordinate of the lower-right corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("y1",
|
||||
"y1",
|
||||
"The new y coordinate of the lower-right corner of the scaled region",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The scaled drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-shear
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 4, 1,
|
||||
shear_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-shear",
|
||||
"gimp-shear",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-shear-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-shear-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-shear-default");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_enum ("shear-type",
|
||||
"shear type",
|
||||
"Type of shear: { GIMP_ORIENTATION_HORIZONTAL (0), GIMP_ORIENTATION_VERTICAL (1) }",
|
||||
GIMP_TYPE_ORIENTATION_TYPE,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[2]),
|
||||
GIMP_ORIENTATION_UNKNOWN);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("magnitude",
|
||||
"magnitude",
|
||||
"The magnitude of the shear",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The sheared drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-transform-2d
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 9, 1,
|
||||
transform_2d_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-transform-2d",
|
||||
"gimp-transform-2d",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-2d-default' instead.",
|
||||
"This procedure is deprecated! Use 'gimp-drawable-transform-2d-default' instead.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"gimp-drawable-transform-2d-default");
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The affected drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_boolean ("interpolation",
|
||||
"interpolation",
|
||||
"Whether to use interpolation",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("source-x",
|
||||
"source x",
|
||||
"X coordinate of the transformation center",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("source-y",
|
||||
"source y",
|
||||
"Y coordinate of the transformation center",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("scale-x",
|
||||
"scale x",
|
||||
"Amount to scale in x direction",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("scale-y",
|
||||
"scale y",
|
||||
"Amount to scale in y direction",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("angle",
|
||||
"angle",
|
||||
"The angle of rotation (radians)",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("dest-x",
|
||||
"dest x",
|
||||
"X coordinate of where the centre goes",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_double ("dest-y",
|
||||
"dest y",
|
||||
"Y coordinate of where the centre goes",
|
||||
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
"The transformed drawable",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
|
@ -33,134 +33,6 @@
|
|||
#include "core/gimpimage.h"
|
||||
#include "plug-in/plug-in.h"
|
||||
|
||||
static GimpProcedure image_undo_group_start_proc;
|
||||
static GimpProcedure image_undo_group_end_proc;
|
||||
static GimpProcedure image_undo_is_enabled_proc;
|
||||
static GimpProcedure image_undo_disable_proc;
|
||||
static GimpProcedure image_undo_enable_proc;
|
||||
static GimpProcedure image_undo_freeze_proc;
|
||||
static GimpProcedure image_undo_thaw_proc;
|
||||
|
||||
void
|
||||
register_undo_procs (Gimp *gimp)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* image_undo_group_start
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_undo_group_start_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The ID of the image in which to open an undo group",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_undo_group_end
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_undo_group_end_proc, 1, 0);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The ID of the image in which to close an undo group",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_undo_is_enabled
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_undo_is_enabled_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("enabled",
|
||||
"enabled",
|
||||
"TRUE if undo is enabled for this image",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_undo_disable
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_undo_disable_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("disabled",
|
||||
"disabled",
|
||||
"TRUE if the image undo has been disabled",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_undo_enable
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_undo_enable_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("enabled",
|
||||
"enabled",
|
||||
"TRUE if the image undo has been enabled",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_undo_freeze
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_undo_freeze_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("frozen",
|
||||
"frozen",
|
||||
"TRUE if the image undo has been frozen",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* image_undo_thaw
|
||||
*/
|
||||
procedure = gimp_procedure_init (&image_undo_thaw_proc, 1, 1);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("thawed",
|
||||
"thawed",
|
||||
"TRUE if the image undo has been thawed",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
image_undo_group_start_invoker (GimpProcedure *procedure,
|
||||
|
@ -190,22 +62,6 @@ image_undo_group_start_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_undo_group_start_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-undo-group-start",
|
||||
"gimp-image-undo-group-start",
|
||||
"Starts a group undo.",
|
||||
"This function is used to start a group undo--necessary for logically combining two or more undo operations into a single operation. This call must be used in conjunction with a 'gimp-image-undo-group-end' call.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_undo_group_start_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_undo_group_end_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -226,22 +82,6 @@ image_undo_group_end_invoker (GimpProcedure *procedure,
|
|||
return gimp_procedure_get_return_values (procedure, success);
|
||||
}
|
||||
|
||||
static GimpProcedure image_undo_group_end_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-undo-group-end",
|
||||
"gimp-image-undo-group-end",
|
||||
"Finish a group undo.",
|
||||
"This function must be called once for each 'gimp-image-undo-group-start' call that is made.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_undo_group_end_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_undo_is_enabled_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -269,22 +109,6 @@ image_undo_is_enabled_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_undo_is_enabled_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-undo-is-enabled",
|
||||
"gimp-image-undo-is-enabled",
|
||||
"Check if the image's undo stack is enabled.",
|
||||
"This procedure checks if the image's undo stack is currently enabled or disabled. This is useful when several plugins or scripts call each other and want to check if their caller has already used 'gimp_image_undo_disable' or 'gimp_image_undo_freeze'.",
|
||||
"Raphael Quinet",
|
||||
"Raphael Quinet",
|
||||
"1999",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_undo_is_enabled_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_undo_disable_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -312,22 +136,6 @@ image_undo_disable_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_undo_disable_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-undo-disable",
|
||||
"gimp-image-undo-disable",
|
||||
"Disable the image's undo stack.",
|
||||
"This procedure disables the image's undo stack, allowing subsequent operations to ignore their undo steps. This is generally called in conjunction with 'gimp_image_undo_enable' to temporarily disable an image undo stack. This is advantageous because saving undo steps can be time and memory intensive.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_undo_disable_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_undo_enable_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -355,22 +163,6 @@ image_undo_enable_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_undo_enable_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-undo-enable",
|
||||
"gimp-image-undo-enable",
|
||||
"Enable the image's undo stack.",
|
||||
"This procedure enables the image's undo stack, allowing subsequent operations to store their undo steps. This is generally called in conjunction with 'gimp_image_undo_disable' to temporarily disable an image undo stack.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_undo_enable_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_undo_freeze_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -398,22 +190,6 @@ image_undo_freeze_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_undo_freeze_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-undo-freeze",
|
||||
"gimp-image-undo-freeze",
|
||||
"Freeze the image's undo stack.",
|
||||
"This procedure freezes the image's undo stack, allowing subsequent operations to ignore their undo steps. This is generally called in conjunction with 'gimp_image_undo_thaw' to temporarily disable an image undo stack. This is advantageous because saving undo steps can be time and memory intensive. 'gimp_image_undo_{freeze,thaw}' and 'gimp_image_undo_{disable,enable}' differ in that the former does not free up all undo steps when undo is thawed, so is more suited to interactive in-situ previews. It is important in this case that the image is back to the same state it was frozen in before thawing, else 'undo' behaviour is undefined.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1999",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_undo_freeze_invoker } }
|
||||
};
|
||||
|
||||
static GValueArray *
|
||||
image_undo_thaw_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -441,18 +217,207 @@ image_undo_thaw_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GimpProcedure image_undo_thaw_proc =
|
||||
void
|
||||
register_undo_procs (Gimp *gimp)
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-image-undo-thaw",
|
||||
"gimp-image-undo-thaw",
|
||||
"Thaw the image's undo stack.",
|
||||
"This procedure thaws the image's undo stack, allowing subsequent operations to store their undo steps. This is generally called in conjunction with 'gimp_image_undo_freeze' to temporarily freeze an image undo stack. 'gimp_image_undo_thaw' does NOT free the undo stack as 'gimp_image_undo_enable' does, so is suited for situations where one wishes to leave the undo stack in the same state in which one found it despite non-destructively playing with the image in the meantime. An example would be in-situ plugin previews. Balancing freezes and thaws and ensuring image consistancy is the responsibility of the caller.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1999",
|
||||
NULL,
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { image_undo_thaw_invoker } }
|
||||
};
|
||||
GimpProcedure *procedure;
|
||||
|
||||
/*
|
||||
* gimp-image-undo-group-start
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
image_undo_group_start_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-undo-group-start",
|
||||
"gimp-image-undo-group-start",
|
||||
"Starts a group undo.",
|
||||
"This function is used to start a group undo--necessary for logically combining two or more undo operations into a single operation. This call must be used in conjunction with a 'gimp-image-undo-group-end' call.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The ID of the image in which to open an undo group",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-undo-group-end
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 0,
|
||||
image_undo_group_end_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-undo-group-end",
|
||||
"gimp-image-undo-group-end",
|
||||
"Finish a group undo.",
|
||||
"This function must be called once for each 'gimp-image-undo-group-start' call that is made.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1997",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The ID of the image in which to close an undo group",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-undo-is-enabled
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
image_undo_is_enabled_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-undo-is-enabled",
|
||||
"gimp-image-undo-is-enabled",
|
||||
"Check if the image's undo stack is enabled.",
|
||||
"This procedure checks if the image's undo stack is currently enabled or disabled. This is useful when several plugins or scripts call each other and want to check if their caller has already used 'gimp_image_undo_disable' or 'gimp_image_undo_freeze'.",
|
||||
"Raphael Quinet",
|
||||
"Raphael Quinet",
|
||||
"1999",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("enabled",
|
||||
"enabled",
|
||||
"TRUE if undo is enabled for this image",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-undo-disable
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
image_undo_disable_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-undo-disable",
|
||||
"gimp-image-undo-disable",
|
||||
"Disable the image's undo stack.",
|
||||
"This procedure disables the image's undo stack, allowing subsequent operations to ignore their undo steps. This is generally called in conjunction with 'gimp_image_undo_enable' to temporarily disable an image undo stack. This is advantageous because saving undo steps can be time and memory intensive.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("disabled",
|
||||
"disabled",
|
||||
"TRUE if the image undo has been disabled",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-undo-enable
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
image_undo_enable_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-undo-enable",
|
||||
"gimp-image-undo-enable",
|
||||
"Enable the image's undo stack.",
|
||||
"This procedure enables the image's undo stack, allowing subsequent operations to store their undo steps. This is generally called in conjunction with 'gimp_image_undo_disable' to temporarily disable an image undo stack.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("enabled",
|
||||
"enabled",
|
||||
"TRUE if the image undo has been enabled",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-undo-freeze
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
image_undo_freeze_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-undo-freeze",
|
||||
"gimp-image-undo-freeze",
|
||||
"Freeze the image's undo stack.",
|
||||
"This procedure freezes the image's undo stack, allowing subsequent operations to ignore their undo steps. This is generally called in conjunction with 'gimp_image_undo_thaw' to temporarily disable an image undo stack. This is advantageous because saving undo steps can be time and memory intensive. 'gimp_image_undo_{freeze,thaw}' and 'gimp_image_undo_{disable,enable}' differ in that the former does not free up all undo steps when undo is thawed, so is more suited to interactive in-situ previews. It is important in this case that the image is back to the same state it was frozen in before thawing, else 'undo' behaviour is undefined.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1999",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("frozen",
|
||||
"frozen",
|
||||
"TRUE if the image undo has been frozen",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
/*
|
||||
* gimp-image-undo-thaw
|
||||
*/
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 1, 1,
|
||||
image_undo_thaw_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-image-undo-thaw",
|
||||
"gimp-image-undo-thaw",
|
||||
"Thaw the image's undo stack.",
|
||||
"This procedure thaws the image's undo stack, allowing subsequent operations to store their undo steps. This is generally called in conjunction with 'gimp_image_undo_freeze' to temporarily freeze an image undo stack. 'gimp_image_undo_thaw' does NOT free the undo stack as 'gimp_image_undo_enable' does, so is suited for situations where one wishes to leave the undo stack in the same state in which one found it despite non-destructively playing with the image in the meantime. An example would be in-situ plugin previews. Balancing freezes and thaws and ensuring image consistancy is the responsibility of the caller.",
|
||||
"Adam D. Moss",
|
||||
"Adam D. Moss",
|
||||
"1999",
|
||||
NULL);
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_image_id ("image",
|
||||
"image",
|
||||
"The image",
|
||||
gimp,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
g_param_spec_boolean ("thawed",
|
||||
"thawed",
|
||||
"TRUE if the image undo has been thawed",
|
||||
FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register (gimp, procedure);
|
||||
|
||||
}
|
||||
|
|
1024
app/pdb/unit_cmds.c
1024
app/pdb/unit_cmds.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -708,10 +708,12 @@ plug_in_handle_proc_install (PlugIn *plug_in,
|
|||
|
||||
g_free (canonical);
|
||||
|
||||
procedure->proc_type = proc_install->type;
|
||||
|
||||
gimp_procedure_init (procedure,
|
||||
proc_install->nparams, proc_install->nreturn_vals);
|
||||
gimp_procedure_initialize (procedure,
|
||||
proc_install->type,
|
||||
proc_install->nparams,
|
||||
proc_install->nreturn_vals,
|
||||
proc_install->type == GIMP_TEMPORARY ?
|
||||
(gpointer) plug_in : (gpointer) prog);
|
||||
|
||||
for (i = 0; i < proc_install->nparams; i++)
|
||||
{
|
||||
|
@ -782,9 +784,6 @@ plug_in_handle_proc_install (PlugIn *plug_in,
|
|||
case GIMP_TEMPORARY:
|
||||
plug_in->temp_proc_defs = g_slist_prepend (plug_in->temp_proc_defs,
|
||||
proc_def);
|
||||
|
||||
procedure->exec_method.temporary.plug_in = plug_in;
|
||||
|
||||
plug_ins_temp_proc_def_add (plug_in->gimp, proc_def);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ plug_in_proc_def_free (PlugInProcDef *proc_def)
|
|||
{
|
||||
g_return_if_fail (proc_def != NULL);
|
||||
|
||||
gimp_procedure_free (proc_def->procedure);
|
||||
g_object_unref (proc_def->procedure);
|
||||
|
||||
g_free (proc_def->prog);
|
||||
g_free (proc_def->menu_label);
|
||||
|
|
|
@ -708,10 +708,12 @@ plug_in_handle_proc_install (PlugIn *plug_in,
|
|||
|
||||
g_free (canonical);
|
||||
|
||||
procedure->proc_type = proc_install->type;
|
||||
|
||||
gimp_procedure_init (procedure,
|
||||
proc_install->nparams, proc_install->nreturn_vals);
|
||||
gimp_procedure_initialize (procedure,
|
||||
proc_install->type,
|
||||
proc_install->nparams,
|
||||
proc_install->nreturn_vals,
|
||||
proc_install->type == GIMP_TEMPORARY ?
|
||||
(gpointer) plug_in : (gpointer) prog);
|
||||
|
||||
for (i = 0; i < proc_install->nparams; i++)
|
||||
{
|
||||
|
@ -782,9 +784,6 @@ plug_in_handle_proc_install (PlugIn *plug_in,
|
|||
case GIMP_TEMPORARY:
|
||||
plug_in->temp_proc_defs = g_slist_prepend (plug_in->temp_proc_defs,
|
||||
proc_def);
|
||||
|
||||
procedure->exec_method.temporary.plug_in = plug_in;
|
||||
|
||||
plug_ins_temp_proc_def_add (plug_in->gimp, proc_def);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ plug_in_proc_def_free (PlugInProcDef *proc_def)
|
|||
{
|
||||
g_return_if_fail (proc_def != NULL);
|
||||
|
||||
gimp_procedure_free (proc_def->procedure);
|
||||
g_object_unref (proc_def->procedure);
|
||||
|
||||
g_free (proc_def->prog);
|
||||
g_free (proc_def->menu_label);
|
||||
|
|
|
@ -314,12 +314,13 @@ plug_in_proc_def_deserialize (GScanner *scanner,
|
|||
Gimp *gimp,
|
||||
PlugInProcDef *proc_def)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
GTokenType token;
|
||||
gint n_args;
|
||||
gint n_return_vals;
|
||||
gint n_menu_paths;
|
||||
gint i;
|
||||
GimpProcedure *procedure;
|
||||
GTokenType token;
|
||||
gint proc_type;
|
||||
gint n_args;
|
||||
gint n_return_vals;
|
||||
gint n_menu_paths;
|
||||
gint i;
|
||||
|
||||
procedure = proc_def->procedure;
|
||||
|
||||
|
@ -328,8 +329,9 @@ plug_in_proc_def_deserialize (GScanner *scanner,
|
|||
|
||||
procedure->name = gimp_canonicalize_identifier (procedure->original_name);
|
||||
|
||||
if (! gimp_scanner_parse_int (scanner, (gint *) &procedure->proc_type))
|
||||
if (! gimp_scanner_parse_int (scanner, &proc_type))
|
||||
return G_TOKEN_INT;
|
||||
|
||||
if (! gimp_scanner_parse_string (scanner, &procedure->blurb))
|
||||
return G_TOKEN_STRING;
|
||||
if (! gimp_scanner_parse_string (scanner, &procedure->help))
|
||||
|
@ -372,7 +374,7 @@ plug_in_proc_def_deserialize (GScanner *scanner,
|
|||
if (! gimp_scanner_parse_int (scanner, (gint *) &n_return_vals))
|
||||
return G_TOKEN_INT;
|
||||
|
||||
gimp_procedure_init (procedure, n_args, n_return_vals);
|
||||
gimp_procedure_initialize (procedure, proc_type, n_args, n_return_vals, NULL);
|
||||
|
||||
for (i = 0; i < n_args; i++)
|
||||
{
|
||||
|
|
|
@ -137,9 +137,7 @@ xcf_init (Gimp *gimp)
|
|||
|
||||
/* gimp-xcf-save */
|
||||
procedure = xcf_plug_in_save_proc.procedure = gimp_procedure_new ();
|
||||
gimp_procedure_init (procedure, 5, 0);
|
||||
procedure->proc_type = GIMP_INTERNAL;
|
||||
procedure->exec_method.internal.marshal_func = xcf_save_invoker;
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 5, 0, xcf_save_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-xcf-save",
|
||||
"gimp-xcf-save",
|
||||
|
@ -197,9 +195,7 @@ xcf_init (Gimp *gimp)
|
|||
|
||||
/* gimp-xcf-load */
|
||||
procedure = xcf_plug_in_load_proc.procedure = gimp_procedure_new ();
|
||||
gimp_procedure_init (procedure, 3, 1);
|
||||
procedure->proc_type = GIMP_INTERNAL;
|
||||
procedure->exec_method.internal.marshal_func = xcf_load_invoker;
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, 3, 1, xcf_load_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-xcf-load",
|
||||
"gimp-xcf-load",
|
||||
|
|
|
@ -523,13 +523,23 @@ sub generate {
|
|||
|
||||
$out->{pcount}++; $total++;
|
||||
|
||||
$out->{procs} .= "static GimpProcedure ${name}_proc;\n";
|
||||
|
||||
$out->{register} .= <<CODE;
|
||||
/*
|
||||
* ${name}
|
||||
* gimp-$proc->{canonical_name}
|
||||
*/
|
||||
procedure = gimp_procedure_init (\&${name}_proc, @{[scalar @inargs]}, @{[scalar @outargs]});
|
||||
procedure = gimp_procedure_new ();
|
||||
gimp_procedure_initialize (procedure, GIMP_INTERNAL, @{[scalar @inargs]}, @{[scalar @outargs]},
|
||||
${name}_invoker);
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-$proc->{canonical_name}",
|
||||
"gimp-$proc->{canonical_name}",
|
||||
@{[ "ewrap($proc->{blurb}, 2) ]},
|
||||
@{[ "ewrap($proc->{help}, 2) ]},
|
||||
"$proc->{author}",
|
||||
"$proc->{copyright}",
|
||||
"$proc->{date}",
|
||||
@{[$proc->{deprecated} ? "\"$proc->{deprecated}\"" : 'NULL']});
|
||||
|
||||
CODE
|
||||
|
||||
$argc = 0;
|
||||
|
@ -544,7 +554,7 @@ CODE
|
|||
${pspec});
|
||||
CODE
|
||||
|
||||
if (! ($postproc eq '')) {
|
||||
if ($postproc ne '') {
|
||||
$pspec = "procedure->args[$argc]";
|
||||
$postproc =~ s/^/' '/meg;
|
||||
$out->{register} .= eval qq/"$postproc"/;
|
||||
|
@ -566,7 +576,7 @@ CODE
|
|||
${pspec});
|
||||
CODE
|
||||
|
||||
if (! ($postproc eq '')) {
|
||||
if ($postproc ne '') {
|
||||
$pspec = "procedure->values[$argc]";
|
||||
$postproc =~ s/^/' '/meg;
|
||||
$out->{register} .= eval qq/"$postproc"/;
|
||||
|
@ -631,25 +641,6 @@ CODE
|
|||
}
|
||||
|
||||
$out->{code} .= $code;
|
||||
|
||||
$out->{code} .= <<CODE;
|
||||
|
||||
static GimpProcedure ${name}_proc =
|
||||
{
|
||||
TRUE, TRUE,
|
||||
"gimp-$proc->{canonical_name}",
|
||||
"gimp-$proc->{canonical_name}",
|
||||
@{[ "ewrap($proc->{blurb}, 2) ]},
|
||||
@{[ "ewrap($proc->{help}, 2) ]},
|
||||
"$proc->{author}",
|
||||
"$proc->{copyright}",
|
||||
"$proc->{date}",
|
||||
@{[$proc->{deprecated} ? "\"$proc->{deprecated}\"" : 'NULL']},
|
||||
GIMP_INTERNAL,
|
||||
0, NULL, 0, NULL,
|
||||
{ { ${name}_invoker } }
|
||||
};
|
||||
CODE
|
||||
}
|
||||
|
||||
my $gpl = <<'GPL';
|
||||
|
@ -786,11 +777,10 @@ GPL
|
|||
print CFILE qq/#include "config.h"\n\n/;
|
||||
print CFILE $headers, "\n";
|
||||
print CFILE $extra->{decls}, "\n" if exists $extra->{decls};
|
||||
print CFILE $out->{procs};
|
||||
print CFILE "\nvoid\nregister_${group}_procs (Gimp *gimp)\n";
|
||||
print CFILE "{\n GimpProcedure *procedure;\n\n$out->{register}}\n";
|
||||
print CFILE "\n", $extra->{code} if exists $extra->{code};
|
||||
print CFILE $out->{code};
|
||||
print CFILE "\nvoid\nregister_${group}_procs (Gimp *gimp)\n";
|
||||
print CFILE "{\n GimpProcedure *procedure;\n\n$out->{register}}\n";
|
||||
close CFILE;
|
||||
&write_file($cfile);
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ HELP
|
|||
|
||||
for (i = 3; i < proc->num_args; i++)
|
||||
if (G_IS_PARAM_SPEC_STRING (proc->args[i]))
|
||||
g_value_set_static_string (&new_args->values[i], "") ;
|
||||
g_value_set_static_string (&new_args->values[i], "");
|
||||
|
||||
return_vals = gimp_pdb_execute (gimp, context, progress,
|
||||
proc->name, new_args);
|
||||
|
|
Loading…
Reference in New Issue