1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
/* NOTE: This file is auto-generated by pdbgen.pl. */
25
#include <glib-object.h>
27
#include "pdb-types.h"
29
#include "gimpprocedure.h"
30
#include "core/gimpparamspecs.h"
32
#include "core/gimp-edit.h"
33
#include "core/gimp.h"
34
#include "core/gimpchannel.h"
35
#include "core/gimpcontainer.h"
36
#include "core/gimpdrawable-blend.h"
37
#include "core/gimpdrawable-bucket-fill.h"
38
#include "core/gimpdrawable.h"
39
#include "core/gimpimage.h"
40
#include "core/gimplayer.h"
41
#include "core/gimpprogress.h"
42
#include "core/gimpstrokedesc.h"
43
#include "gimp-intl.h"
44
#include "vectors/gimpvectors.h"
46
#include "internal_procs.h"
50
edit_cut_invoker (GimpProcedure *procedure,
53
GimpProgress *progress,
54
const GValueArray *args)
56
gboolean success = TRUE;
57
GValueArray *return_vals;
58
GimpDrawable *drawable;
59
gboolean non_empty = FALSE;
61
drawable = gimp_value_get_drawable (&args->values[0], gimp);
65
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
67
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
69
non_empty = gimp_edit_cut (image, drawable, context) != NULL;
75
return_vals = gimp_procedure_get_return_values (procedure, success);
78
g_value_set_boolean (&return_vals->values[1], non_empty);
84
edit_copy_invoker (GimpProcedure *procedure,
87
GimpProgress *progress,
88
const GValueArray *args)
90
gboolean success = TRUE;
91
GValueArray *return_vals;
92
GimpDrawable *drawable;
93
gboolean non_empty = FALSE;
95
drawable = gimp_value_get_drawable (&args->values[0], gimp);
99
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
101
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
103
non_empty = gimp_edit_copy (image, drawable, context) != NULL;
109
return_vals = gimp_procedure_get_return_values (procedure, success);
112
g_value_set_boolean (&return_vals->values[1], non_empty);
118
edit_copy_visible_invoker (GimpProcedure *procedure,
120
GimpContext *context,
121
GimpProgress *progress,
122
const GValueArray *args)
124
gboolean success = TRUE;
125
GValueArray *return_vals;
127
gboolean non_empty = FALSE;
129
image = gimp_value_get_image (&args->values[0], gimp);
133
non_empty = gimp_edit_copy_visible (image, context) != NULL;
136
return_vals = gimp_procedure_get_return_values (procedure, success);
139
g_value_set_boolean (&return_vals->values[1], non_empty);
145
edit_paste_invoker (GimpProcedure *procedure,
147
GimpContext *context,
148
GimpProgress *progress,
149
const GValueArray *args)
151
gboolean success = TRUE;
152
GValueArray *return_vals;
153
GimpDrawable *drawable;
155
GimpLayer *floating_sel = NULL;
157
drawable = gimp_value_get_drawable (&args->values[0], gimp);
158
paste_into = g_value_get_boolean (&args->values[1]);
162
if (gimp->global_buffer && gimp_item_is_attached (GIMP_ITEM (drawable)))
164
floating_sel = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
165
drawable, gimp->global_buffer,
166
paste_into, -1, -1, -1, -1);
175
return_vals = gimp_procedure_get_return_values (procedure, success);
178
gimp_value_set_layer (&return_vals->values[1], floating_sel);
184
edit_paste_as_new_invoker (GimpProcedure *procedure,
186
GimpContext *context,
187
GimpProgress *progress,
188
const GValueArray *args)
190
gboolean success = TRUE;
191
GValueArray *return_vals;
192
GimpImage *image = NULL;
194
if (gimp->global_buffer)
196
image = gimp_edit_paste_as_new (gimp, NULL, gimp->global_buffer);
206
return_vals = gimp_procedure_get_return_values (procedure, success);
209
gimp_value_set_image (&return_vals->values[1], image);
215
edit_named_cut_invoker (GimpProcedure *procedure,
217
GimpContext *context,
218
GimpProgress *progress,
219
const GValueArray *args)
221
gboolean success = TRUE;
222
GValueArray *return_vals;
223
GimpDrawable *drawable;
224
const gchar *buffer_name;
225
gchar *real_name = NULL;
227
drawable = gimp_value_get_drawable (&args->values[0], gimp);
228
buffer_name = g_value_get_string (&args->values[1]);
232
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
234
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
236
real_name = (gchar *) gimp_edit_named_cut (image, buffer_name,
240
real_name = g_strdup (real_name);
248
return_vals = gimp_procedure_get_return_values (procedure, success);
251
g_value_take_string (&return_vals->values[1], real_name);
257
edit_named_copy_invoker (GimpProcedure *procedure,
259
GimpContext *context,
260
GimpProgress *progress,
261
const GValueArray *args)
263
gboolean success = TRUE;
264
GValueArray *return_vals;
265
GimpDrawable *drawable;
266
const gchar *buffer_name;
267
gchar *real_name = NULL;
269
drawable = gimp_value_get_drawable (&args->values[0], gimp);
270
buffer_name = g_value_get_string (&args->values[1]);
274
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
276
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
278
real_name = (gchar *) gimp_edit_named_copy (image, buffer_name,
282
real_name = g_strdup (real_name);
290
return_vals = gimp_procedure_get_return_values (procedure, success);
293
g_value_take_string (&return_vals->values[1], real_name);
299
edit_named_copy_visible_invoker (GimpProcedure *procedure,
301
GimpContext *context,
302
GimpProgress *progress,
303
const GValueArray *args)
305
gboolean success = TRUE;
306
GValueArray *return_vals;
308
const gchar *buffer_name;
309
gchar *real_name = NULL;
311
image = gimp_value_get_image (&args->values[0], gimp);
312
buffer_name = g_value_get_string (&args->values[1]);
316
real_name = (gchar *) gimp_edit_named_copy_visible (image, buffer_name,
320
real_name = g_strdup (real_name);
325
return_vals = gimp_procedure_get_return_values (procedure, success);
328
g_value_take_string (&return_vals->values[1], real_name);
334
edit_named_paste_invoker (GimpProcedure *procedure,
336
GimpContext *context,
337
GimpProgress *progress,
338
const GValueArray *args)
340
gboolean success = TRUE;
341
GValueArray *return_vals;
342
GimpDrawable *drawable;
343
const gchar *buffer_name;
345
GimpLayer *floating_sel = NULL;
347
drawable = gimp_value_get_drawable (&args->values[0], gimp);
348
buffer_name = g_value_get_string (&args->values[1]);
349
paste_into = g_value_get_boolean (&args->values[2]);
353
GimpBuffer *buffer = (GimpBuffer *)
354
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
356
if (buffer && gimp_item_is_attached (GIMP_ITEM (drawable)))
358
floating_sel = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
360
paste_into, -1, -1, -1, -1);
368
return_vals = gimp_procedure_get_return_values (procedure, success);
371
gimp_value_set_layer (&return_vals->values[1], floating_sel);
377
edit_named_paste_as_new_invoker (GimpProcedure *procedure,
379
GimpContext *context,
380
GimpProgress *progress,
381
const GValueArray *args)
383
gboolean success = TRUE;
384
GValueArray *return_vals;
385
const gchar *buffer_name;
386
GimpImage *image = NULL;
388
buffer_name = g_value_get_string (&args->values[0]);
392
GimpBuffer *buffer = (GimpBuffer *)
393
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
397
image = gimp_edit_paste_as_new (gimp, NULL, buffer);
406
return_vals = gimp_procedure_get_return_values (procedure, success);
409
gimp_value_set_image (&return_vals->values[1], image);
415
edit_clear_invoker (GimpProcedure *procedure,
417
GimpContext *context,
418
GimpProgress *progress,
419
const GValueArray *args)
421
gboolean success = TRUE;
422
GimpDrawable *drawable;
424
drawable = gimp_value_get_drawable (&args->values[0], gimp);
428
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
430
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
432
success = gimp_edit_clear (image, drawable, context);
438
return gimp_procedure_get_return_values (procedure, success);
442
edit_fill_invoker (GimpProcedure *procedure,
444
GimpContext *context,
445
GimpProgress *progress,
446
const GValueArray *args)
448
gboolean success = TRUE;
449
GimpDrawable *drawable;
452
drawable = gimp_value_get_drawable (&args->values[0], gimp);
453
fill_type = g_value_get_enum (&args->values[1]);
457
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
459
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
461
success = gimp_edit_fill (image, drawable, context,
462
(GimpFillType) fill_type);
468
return gimp_procedure_get_return_values (procedure, success);
472
edit_bucket_fill_invoker (GimpProcedure *procedure,
474
GimpContext *context,
475
GimpProgress *progress,
476
const GValueArray *args)
478
gboolean success = TRUE;
479
GimpDrawable *drawable;
484
gboolean sample_merged;
488
drawable = gimp_value_get_drawable (&args->values[0], gimp);
489
fill_mode = g_value_get_enum (&args->values[1]);
490
paint_mode = g_value_get_enum (&args->values[2]);
491
opacity = g_value_get_double (&args->values[3]);
492
threshold = g_value_get_double (&args->values[4]);
493
sample_merged = g_value_get_boolean (&args->values[5]);
494
x = g_value_get_double (&args->values[6]);
495
y = g_value_get_double (&args->values[7]);
499
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
501
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
502
gboolean do_seed_fill;
504
do_seed_fill = gimp_channel_is_empty (gimp_image_get_mask (image));
506
gimp_drawable_bucket_fill (drawable, context, fill_mode,
507
paint_mode, opacity / 100.0,
509
FALSE /* don't fill transparent */,
510
GIMP_SELECT_CRITERION_COMPOSITE,
511
threshold, sample_merged, x, y);
517
return gimp_procedure_get_return_values (procedure, success);
521
edit_bucket_fill_full_invoker (GimpProcedure *procedure,
523
GimpContext *context,
524
GimpProgress *progress,
525
const GValueArray *args)
527
gboolean success = TRUE;
528
GimpDrawable *drawable;
533
gboolean sample_merged;
534
gboolean fill_transparent;
535
gint32 select_criterion;
539
drawable = gimp_value_get_drawable (&args->values[0], gimp);
540
fill_mode = g_value_get_enum (&args->values[1]);
541
paint_mode = g_value_get_enum (&args->values[2]);
542
opacity = g_value_get_double (&args->values[3]);
543
threshold = g_value_get_double (&args->values[4]);
544
sample_merged = g_value_get_boolean (&args->values[5]);
545
fill_transparent = g_value_get_boolean (&args->values[6]);
546
select_criterion = g_value_get_enum (&args->values[7]);
547
x = g_value_get_double (&args->values[8]);
548
y = g_value_get_double (&args->values[9]);
552
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
554
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
555
gboolean do_seed_fill;
557
do_seed_fill = gimp_channel_is_empty (gimp_image_get_mask (image));
559
gimp_drawable_bucket_fill (drawable, context, fill_mode,
560
paint_mode, opacity / 100.0,
564
threshold, sample_merged, x, y);
570
return gimp_procedure_get_return_values (procedure, success);
574
edit_blend_invoker (GimpProcedure *procedure,
576
GimpContext *context,
577
GimpProgress *progress,
578
const GValueArray *args)
580
gboolean success = TRUE;
581
GimpDrawable *drawable;
584
gint32 gradient_type;
589
gboolean supersample;
598
drawable = gimp_value_get_drawable (&args->values[0], gimp);
599
blend_mode = g_value_get_enum (&args->values[1]);
600
paint_mode = g_value_get_enum (&args->values[2]);
601
gradient_type = g_value_get_enum (&args->values[3]);
602
opacity = g_value_get_double (&args->values[4]);
603
offset = g_value_get_double (&args->values[5]);
604
repeat = g_value_get_enum (&args->values[6]);
605
reverse = g_value_get_boolean (&args->values[7]);
606
supersample = g_value_get_boolean (&args->values[8]);
607
max_depth = g_value_get_int (&args->values[9]);
608
threshold = g_value_get_double (&args->values[10]);
609
dither = g_value_get_boolean (&args->values[11]);
610
x1 = g_value_get_double (&args->values[12]);
611
y1 = g_value_get_double (&args->values[13]);
612
x2 = g_value_get_double (&args->values[14]);
613
y2 = g_value_get_double (&args->values[15]);
617
success = gimp_item_is_attached (GIMP_ITEM (drawable));
619
if (success && supersample)
621
if (max_depth < 1 || max_depth > 9)
624
if (threshold < 0.0 || threshold > 4.0)
631
gimp_progress_start (progress, _("Blending"), FALSE);
633
gimp_drawable_blend (drawable,
639
offset, repeat, reverse,
640
supersample, max_depth,
646
gimp_progress_end (progress);
650
return gimp_procedure_get_return_values (procedure, success);
654
edit_stroke_invoker (GimpProcedure *procedure,
656
GimpContext *context,
657
GimpProgress *progress,
658
const GValueArray *args)
660
gboolean success = TRUE;
661
GimpDrawable *drawable;
663
drawable = gimp_value_get_drawable (&args->values[0], gimp);
667
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
669
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
670
GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
672
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
674
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
675
drawable, context, desc, TRUE, progress);
677
g_object_unref (desc);
683
return gimp_procedure_get_return_values (procedure, success);
687
edit_stroke_vectors_invoker (GimpProcedure *procedure,
689
GimpContext *context,
690
GimpProgress *progress,
691
const GValueArray *args)
693
gboolean success = TRUE;
694
GimpDrawable *drawable;
695
GimpVectors *vectors;
697
drawable = gimp_value_get_drawable (&args->values[0], gimp);
698
vectors = gimp_value_get_vectors (&args->values[1], gimp);
702
if (gimp_item_is_attached (GIMP_ITEM (drawable)))
704
GimpStrokeDesc *desc = gimp_stroke_desc_new (gimp, context);
706
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
708
success = gimp_item_stroke (GIMP_ITEM (vectors),
709
drawable, context, desc, TRUE, progress);
711
g_object_unref (desc);
717
return gimp_procedure_get_return_values (procedure, success);
721
register_edit_procs (GimpPDB *pdb)
723
GimpProcedure *procedure;
728
procedure = gimp_procedure_new (edit_cut_invoker);
729
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-cut");
730
gimp_procedure_set_static_strings (procedure,
732
"Cut from the specified drawable.",
733
"If there is a selection in the image, then the area specified by the selection is cut from the specified drawable and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the specified drawable will be removed and its contents stored in the internal GIMP edit buffer.",
734
"Spencer Kimball & Peter Mattis",
735
"Spencer Kimball & Peter Mattis",
738
gimp_procedure_add_argument (procedure,
739
gimp_param_spec_drawable_id ("drawable",
741
"The drawable to cut from",
743
GIMP_PARAM_READWRITE));
744
gimp_procedure_add_return_value (procedure,
745
g_param_spec_boolean ("non-empty",
747
"TRUE if the cut was successful, FALSE if the selection contained only transparent pixels",
749
GIMP_PARAM_READWRITE));
750
gimp_pdb_register_procedure (pdb, procedure);
751
g_object_unref (procedure);
756
procedure = gimp_procedure_new (edit_copy_invoker);
757
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-copy");
758
gimp_procedure_set_static_strings (procedure,
760
"Copy from the specified drawable.",
761
"If there is a selection in the image, then the area specified by the selection is copied from the specified drawable and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the specified drawable's contents will be stored in the internal GIMP edit buffer.",
762
"Spencer Kimball & Peter Mattis",
763
"Spencer Kimball & Peter Mattis",
766
gimp_procedure_add_argument (procedure,
767
gimp_param_spec_drawable_id ("drawable",
769
"The drawable to copy from",
771
GIMP_PARAM_READWRITE));
772
gimp_procedure_add_return_value (procedure,
773
g_param_spec_boolean ("non-empty",
775
"TRUE if the copy was successful, FALSE if the selection contained only transparent pixels",
777
GIMP_PARAM_READWRITE));
778
gimp_pdb_register_procedure (pdb, procedure);
779
g_object_unref (procedure);
782
* gimp-edit-copy-visible
784
procedure = gimp_procedure_new (edit_copy_visible_invoker);
785
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-copy-visible");
786
gimp_procedure_set_static_strings (procedure,
787
"gimp-edit-copy-visible",
788
"Copy from the projection.",
789
"If there is a selection in the image, then the area specified by the selection is copied from the projection and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the projection's contents will be stored in the internal GIMP edit buffer.",
790
"Michael Natterer <mitch@gimp.org>",
794
gimp_procedure_add_argument (procedure,
795
gimp_param_spec_image_id ("image",
797
"The image to copy from",
799
GIMP_PARAM_READWRITE));
800
gimp_procedure_add_return_value (procedure,
801
g_param_spec_boolean ("non-empty",
803
"TRUE if the copy was successful, FALSE if the selection contained only transparent pixels",
805
GIMP_PARAM_READWRITE));
806
gimp_pdb_register_procedure (pdb, procedure);
807
g_object_unref (procedure);
812
procedure = gimp_procedure_new (edit_paste_invoker);
813
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-paste");
814
gimp_procedure_set_static_strings (procedure,
816
"Paste buffer to the specified drawable.",
817
"This procedure pastes a copy of the internal GIMP edit buffer to the specified drawable. The GIMP edit buffer will be empty unless a call was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. The \"paste_into\" option specifies whether to clear the current image selection, or to paste the buffer \"behind\" the selection. This allows the selection to act as a mask for the pasted buffer. Anywhere that the selection mask is non-zero, the pasted buffer will show through. The pasted buffer will be a new layer in the image which is designated as the image floating selection. If the image has a floating selection at the time of pasting, the old floating selection will be anchored to it's drawable before the new floating selection is added. This procedure returns the new floating layer. The resulting floating selection will already be attached to the specified drawable, and a subsequent call to floating_sel_attach is not needed.",
818
"Spencer Kimball & Peter Mattis",
819
"Spencer Kimball & Peter Mattis",
822
gimp_procedure_add_argument (procedure,
823
gimp_param_spec_drawable_id ("drawable",
825
"The drawable to paste to",
827
GIMP_PARAM_READWRITE));
828
gimp_procedure_add_argument (procedure,
829
g_param_spec_boolean ("paste-into",
831
"Clear selection, or paste behind it?",
833
GIMP_PARAM_READWRITE));
834
gimp_procedure_add_return_value (procedure,
835
gimp_param_spec_layer_id ("floating-sel",
837
"The new floating selection",
839
GIMP_PARAM_READWRITE));
840
gimp_pdb_register_procedure (pdb, procedure);
841
g_object_unref (procedure);
844
* gimp-edit-paste-as-new
846
procedure = gimp_procedure_new (edit_paste_as_new_invoker);
847
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-paste-as-new");
848
gimp_procedure_set_static_strings (procedure,
849
"gimp-edit-paste-as-new",
850
"Paste buffer to a new image.",
851
"This procedure pastes a copy of the internal GIMP edit buffer to a new image. The GIMP edit buffer will be empty unless a call was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. This procedure returns the new image or -1 if the edit buffer was empty.",
852
"Michael Natterer <mitch@gimp.org>",
856
gimp_procedure_add_return_value (procedure,
857
gimp_param_spec_image_id ("image",
861
GIMP_PARAM_READWRITE));
862
gimp_pdb_register_procedure (pdb, procedure);
863
g_object_unref (procedure);
866
* gimp-edit-named-cut
868
procedure = gimp_procedure_new (edit_named_cut_invoker);
869
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-named-cut");
870
gimp_procedure_set_static_strings (procedure,
871
"gimp-edit-named-cut",
872
"Cut into a named buffer.",
873
"This procedure works like 'gimp-edit-cut', but additionally stores the cut buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.",
874
"Michael Natterer <mitch@gimp.org>",
878
gimp_procedure_add_argument (procedure,
879
gimp_param_spec_drawable_id ("drawable",
881
"The drawable to cut from",
883
GIMP_PARAM_READWRITE));
884
gimp_procedure_add_argument (procedure,
885
gimp_param_spec_string ("buffer-name",
887
"The name of the buffer to create",
890
GIMP_PARAM_READWRITE));
891
gimp_procedure_add_return_value (procedure,
892
gimp_param_spec_string ("real-name",
894
"The real name given to the buffer, or NULL if the selection contained only transparent pixels",
897
GIMP_PARAM_READWRITE));
898
gimp_pdb_register_procedure (pdb, procedure);
899
g_object_unref (procedure);
902
* gimp-edit-named-copy
904
procedure = gimp_procedure_new (edit_named_copy_invoker);
905
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-named-copy");
906
gimp_procedure_set_static_strings (procedure,
907
"gimp-edit-named-copy",
908
"Copy into a named buffer.",
909
"This procedure works like 'gimp-edit-copy', but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.",
910
"Michael Natterer <mitch@gimp.org>",
914
gimp_procedure_add_argument (procedure,
915
gimp_param_spec_drawable_id ("drawable",
917
"The drawable to copy from",
919
GIMP_PARAM_READWRITE));
920
gimp_procedure_add_argument (procedure,
921
gimp_param_spec_string ("buffer-name",
923
"The name of the buffer to create",
926
GIMP_PARAM_READWRITE));
927
gimp_procedure_add_return_value (procedure,
928
gimp_param_spec_string ("real-name",
930
"The real name given to the buffer, or NULL if the selection contained only transparent pixels",
933
GIMP_PARAM_READWRITE));
934
gimp_pdb_register_procedure (pdb, procedure);
935
g_object_unref (procedure);
938
* gimp-edit-named-copy-visible
940
procedure = gimp_procedure_new (edit_named_copy_visible_invoker);
941
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-named-copy-visible");
942
gimp_procedure_set_static_strings (procedure,
943
"gimp-edit-named-copy-visible",
944
"Copy from the projection into a named buffer.",
945
"This procedure works like 'gimp-edit-copy-visible', but additionally stores the copied buffer into a named buffer that will stay available for later pasting, regardless of any intermediate copy or cut operations.",
946
"Michael Natterer <mitch@gimp.org>",
950
gimp_procedure_add_argument (procedure,
951
gimp_param_spec_image_id ("image",
953
"The image to copy from",
955
GIMP_PARAM_READWRITE));
956
gimp_procedure_add_argument (procedure,
957
gimp_param_spec_string ("buffer-name",
959
"The name of the buffer to create",
962
GIMP_PARAM_READWRITE));
963
gimp_procedure_add_return_value (procedure,
964
gimp_param_spec_string ("real-name",
966
"The real name given to the buffer",
969
GIMP_PARAM_READWRITE));
970
gimp_pdb_register_procedure (pdb, procedure);
971
g_object_unref (procedure);
974
* gimp-edit-named-paste
976
procedure = gimp_procedure_new (edit_named_paste_invoker);
977
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-named-paste");
978
gimp_procedure_set_static_strings (procedure,
979
"gimp-edit-named-paste",
980
"Paste named buffer to the specified drawable.",
981
"This procedure works like 'gimp-edit-paste' but pastes a named buffer instead of the global buffer.",
982
"Michael Natterer <mitch@gimp.org>",
986
gimp_procedure_add_argument (procedure,
987
gimp_param_spec_drawable_id ("drawable",
989
"The drawable to paste to",
991
GIMP_PARAM_READWRITE));
992
gimp_procedure_add_argument (procedure,
993
gimp_param_spec_string ("buffer-name",
995
"The name of the buffer to paste",
998
GIMP_PARAM_READWRITE));
999
gimp_procedure_add_argument (procedure,
1000
g_param_spec_boolean ("paste-into",
1002
"Clear selection, or paste behind it?",
1004
GIMP_PARAM_READWRITE));
1005
gimp_procedure_add_return_value (procedure,
1006
gimp_param_spec_layer_id ("floating-sel",
1008
"The new floating selection",
1010
GIMP_PARAM_READWRITE));
1011
gimp_pdb_register_procedure (pdb, procedure);
1012
g_object_unref (procedure);
1015
* gimp-edit-named-paste-as-new
1017
procedure = gimp_procedure_new (edit_named_paste_as_new_invoker);
1018
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-named-paste-as-new");
1019
gimp_procedure_set_static_strings (procedure,
1020
"gimp-edit-named-paste-as-new",
1021
"Paste named buffer to a new image.",
1022
"This procedure works like 'gimp-edit-paste-as-new' but pastes a named buffer instead of the global buffer.",
1023
"Michael Natterer <mitch@gimp.org>",
1027
gimp_procedure_add_argument (procedure,
1028
gimp_param_spec_string ("buffer-name",
1030
"The name of the buffer to paste",
1031
FALSE, FALSE, FALSE,
1033
GIMP_PARAM_READWRITE));
1034
gimp_procedure_add_return_value (procedure,
1035
gimp_param_spec_image_id ("image",
1039
GIMP_PARAM_READWRITE));
1040
gimp_pdb_register_procedure (pdb, procedure);
1041
g_object_unref (procedure);
1046
procedure = gimp_procedure_new (edit_clear_invoker);
1047
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-clear");
1048
gimp_procedure_set_static_strings (procedure,
1050
"Clear selected area of drawable.",
1051
"This procedure clears the specified drawable. If the drawable has an alpha channel, the cleared pixels will become transparent. If the drawable does not have an alpha channel, cleared pixels will be set to the background color. This procedure only affects regions within a selection if there is a selection active.",
1052
"Spencer Kimball & Peter Mattis",
1053
"Spencer Kimball & Peter Mattis",
1056
gimp_procedure_add_argument (procedure,
1057
gimp_param_spec_drawable_id ("drawable",
1059
"The drawable to clear from",
1061
GIMP_PARAM_READWRITE));
1062
gimp_pdb_register_procedure (pdb, procedure);
1063
g_object_unref (procedure);
1068
procedure = gimp_procedure_new (edit_fill_invoker);
1069
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-fill");
1070
gimp_procedure_set_static_strings (procedure,
1072
"Fill selected area of drawable.",
1073
"This procedure fills the specified drawable with the fill mode. If the fill mode is foreground, the current foreground color is used. If the fill mode is background, the current background color is used. Other fill modes should not be used. This procedure only affects regions within a selection if there is a selection active. If you want to fill the whole drawable, regardless of the selection, use 'gimp-drawable-fill'.",
1074
"Spencer Kimball & Peter Mattis & Raphael Quinet",
1075
"Spencer Kimball & Peter Mattis",
1078
gimp_procedure_add_argument (procedure,
1079
gimp_param_spec_drawable_id ("drawable",
1081
"The drawable to fill to",
1083
GIMP_PARAM_READWRITE));
1084
gimp_procedure_add_argument (procedure,
1085
g_param_spec_enum ("fill-type",
1088
GIMP_TYPE_FILL_TYPE,
1089
GIMP_FOREGROUND_FILL,
1090
GIMP_PARAM_READWRITE));
1091
gimp_pdb_register_procedure (pdb, procedure);
1092
g_object_unref (procedure);
1095
* gimp-edit-bucket-fill
1097
procedure = gimp_procedure_new (edit_bucket_fill_invoker);
1098
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-bucket-fill");
1099
gimp_procedure_set_static_strings (procedure,
1100
"gimp-edit-bucket-fill",
1101
"Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates.",
1102
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. 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 merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.",
1103
"Spencer Kimball & Peter Mattis",
1104
"Spencer Kimball & Peter Mattis",
1107
gimp_procedure_add_argument (procedure,
1108
gimp_param_spec_drawable_id ("drawable",
1110
"The affected drawable",
1112
GIMP_PARAM_READWRITE));
1113
gimp_procedure_add_argument (procedure,
1114
g_param_spec_enum ("fill-mode",
1117
GIMP_TYPE_BUCKET_FILL_MODE,
1118
GIMP_FG_BUCKET_FILL,
1119
GIMP_PARAM_READWRITE));
1120
gimp_procedure_add_argument (procedure,
1121
g_param_spec_enum ("paint-mode",
1123
"The paint application mode",
1124
GIMP_TYPE_LAYER_MODE_EFFECTS,
1126
GIMP_PARAM_READWRITE));
1127
gimp_procedure_add_argument (procedure,
1128
g_param_spec_double ("opacity",
1130
"The opacity of the final bucket fill",
1132
GIMP_PARAM_READWRITE));
1133
gimp_procedure_add_argument (procedure,
1134
g_param_spec_double ("threshold",
1136
"The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels. This parameter is only valid when there is no selection in the specified image.",
1138
GIMP_PARAM_READWRITE));
1139
gimp_procedure_add_argument (procedure,
1140
g_param_spec_boolean ("sample-merged",
1142
"Use the composite image, not the drawable",
1144
GIMP_PARAM_READWRITE));
1145
gimp_procedure_add_argument (procedure,
1146
g_param_spec_double ("x",
1148
"The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.",
1149
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1150
GIMP_PARAM_READWRITE));
1151
gimp_procedure_add_argument (procedure,
1152
g_param_spec_double ("y",
1154
"The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.",
1155
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1156
GIMP_PARAM_READWRITE));
1157
gimp_pdb_register_procedure (pdb, procedure);
1158
g_object_unref (procedure);
1161
* gimp-edit-bucket-fill-full
1163
procedure = gimp_procedure_new (edit_bucket_fill_full_invoker);
1164
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-bucket-fill-full");
1165
gimp_procedure_set_static_strings (procedure,
1166
"gimp-edit-bucket-fill-full",
1167
"Fill the area specified either by the current selection if there is one, or by a seed fill starting at the specified coordinates.",
1168
"This tool requires information on the paint application mode, and the fill mode, which can either be in the foreground color, or in the currently active pattern. If there is no selection, a seed fill is executed at the specified coordinates and extends outward in keeping with the threshold parameter. If there is a selection in the target image, the threshold, sample merged, x, and y arguments are unused. 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 merged sampling, the x and y coordinates are relative to the image's origin; otherwise, they are relative to the drawable's origin.",
1173
gimp_procedure_add_argument (procedure,
1174
gimp_param_spec_drawable_id ("drawable",
1176
"The affected drawable",
1178
GIMP_PARAM_READWRITE));
1179
gimp_procedure_add_argument (procedure,
1180
g_param_spec_enum ("fill-mode",
1183
GIMP_TYPE_BUCKET_FILL_MODE,
1184
GIMP_FG_BUCKET_FILL,
1185
GIMP_PARAM_READWRITE));
1186
gimp_procedure_add_argument (procedure,
1187
g_param_spec_enum ("paint-mode",
1189
"The paint application mode",
1190
GIMP_TYPE_LAYER_MODE_EFFECTS,
1192
GIMP_PARAM_READWRITE));
1193
gimp_procedure_add_argument (procedure,
1194
g_param_spec_double ("opacity",
1196
"The opacity of the final bucket fill",
1198
GIMP_PARAM_READWRITE));
1199
gimp_procedure_add_argument (procedure,
1200
g_param_spec_double ("threshold",
1202
"The threshold determines how extensive the seed fill will be. It's value is specified in terms of intensity levels. This parameter is only valid when there is no selection in the specified image.",
1204
GIMP_PARAM_READWRITE));
1205
gimp_procedure_add_argument (procedure,
1206
g_param_spec_boolean ("sample-merged",
1208
"Use the composite image, not the drawable",
1210
GIMP_PARAM_READWRITE));
1211
gimp_procedure_add_argument (procedure,
1212
g_param_spec_boolean ("fill-transparent",
1214
"Whether to consider transparent pixels for filling. If TRUE, transparency is considered as a unique fillable color.",
1216
GIMP_PARAM_READWRITE));
1217
gimp_procedure_add_argument (procedure,
1218
g_param_spec_enum ("select-criterion",
1220
"The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.",
1221
GIMP_TYPE_SELECT_CRITERION,
1222
GIMP_SELECT_CRITERION_COMPOSITE,
1223
GIMP_PARAM_READWRITE));
1224
gimp_procedure_add_argument (procedure,
1225
g_param_spec_double ("x",
1227
"The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.",
1228
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1229
GIMP_PARAM_READWRITE));
1230
gimp_procedure_add_argument (procedure,
1231
g_param_spec_double ("y",
1233
"The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.",
1234
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1235
GIMP_PARAM_READWRITE));
1236
gimp_pdb_register_procedure (pdb, procedure);
1237
g_object_unref (procedure);
1242
procedure = gimp_procedure_new (edit_blend_invoker);
1243
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-blend");
1244
gimp_procedure_set_static_strings (procedure,
1246
"Blend between the starting and ending coordinates with the specified blend mode and gradient type.",
1247
"This tool requires information on the paint application mode, the blend mode, and the gradient type. It creates the specified variety of blend using the starting and ending coordinates as defined for each gradient type.",
1248
"Spencer Kimball & Peter Mattis",
1249
"Spencer Kimball & Peter Mattis",
1252
gimp_procedure_add_argument (procedure,
1253
gimp_param_spec_drawable_id ("drawable",
1255
"The affected drawable",
1257
GIMP_PARAM_READWRITE));
1258
gimp_procedure_add_argument (procedure,
1259
g_param_spec_enum ("blend-mode",
1261
"The type of blend",
1262
GIMP_TYPE_BLEND_MODE,
1263
GIMP_FG_BG_RGB_MODE,
1264
GIMP_PARAM_READWRITE));
1265
gimp_procedure_add_argument (procedure,
1266
g_param_spec_enum ("paint-mode",
1268
"The paint application mode",
1269
GIMP_TYPE_LAYER_MODE_EFFECTS,
1271
GIMP_PARAM_READWRITE));
1272
gimp_procedure_add_argument (procedure,
1273
g_param_spec_enum ("gradient-type",
1275
"The type of gradient",
1276
GIMP_TYPE_GRADIENT_TYPE,
1277
GIMP_GRADIENT_LINEAR,
1278
GIMP_PARAM_READWRITE));
1279
gimp_procedure_add_argument (procedure,
1280
g_param_spec_double ("opacity",
1282
"The opacity of the final blend",
1284
GIMP_PARAM_READWRITE));
1285
gimp_procedure_add_argument (procedure,
1286
g_param_spec_double ("offset",
1288
"Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.",
1290
GIMP_PARAM_READWRITE));
1291
gimp_procedure_add_argument (procedure,
1292
g_param_spec_enum ("repeat",
1295
GIMP_TYPE_REPEAT_MODE,
1297
GIMP_PARAM_READWRITE));
1298
gimp_procedure_add_argument (procedure,
1299
g_param_spec_boolean ("reverse",
1301
"Use the reverse gradient",
1303
GIMP_PARAM_READWRITE));
1304
gimp_procedure_add_argument (procedure,
1305
g_param_spec_boolean ("supersample",
1307
"Do adaptive supersampling",
1309
GIMP_PARAM_READWRITE));
1310
gimp_procedure_add_argument (procedure,
1311
gimp_param_spec_int32 ("max-depth",
1313
"Maximum recursion levels for supersampling",
1315
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
1316
gimp_procedure_add_argument (procedure,
1317
g_param_spec_double ("threshold",
1319
"Supersampling threshold",
1321
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
1322
gimp_procedure_add_argument (procedure,
1323
g_param_spec_boolean ("dither",
1325
"Use dithering to reduce banding",
1327
GIMP_PARAM_READWRITE));
1328
gimp_procedure_add_argument (procedure,
1329
g_param_spec_double ("x1",
1331
"The x coordinate of this blend's starting point",
1332
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1333
GIMP_PARAM_READWRITE));
1334
gimp_procedure_add_argument (procedure,
1335
g_param_spec_double ("y1",
1337
"The y coordinate of this blend's starting point",
1338
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1339
GIMP_PARAM_READWRITE));
1340
gimp_procedure_add_argument (procedure,
1341
g_param_spec_double ("x2",
1343
"The x coordinate of this blend's ending point",
1344
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1345
GIMP_PARAM_READWRITE));
1346
gimp_procedure_add_argument (procedure,
1347
g_param_spec_double ("y2",
1349
"The y coordinate of this blend's ending point",
1350
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1351
GIMP_PARAM_READWRITE));
1352
gimp_pdb_register_procedure (pdb, procedure);
1353
g_object_unref (procedure);
1358
procedure = gimp_procedure_new (edit_stroke_invoker);
1359
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-stroke");
1360
gimp_procedure_set_static_strings (procedure,
1362
"Stroke the current selection",
1363
"This procedure strokes the current selection, painting along the selection boundary with the active brush and foreground color. The paint is applied to the specified drawable regardless of the active selection.",
1364
"Spencer Kimball & Peter Mattis",
1365
"Spencer Kimball & Peter Mattis",
1368
gimp_procedure_add_argument (procedure,
1369
gimp_param_spec_drawable_id ("drawable",
1371
"The drawable to stroke to",
1373
GIMP_PARAM_READWRITE));
1374
gimp_pdb_register_procedure (pdb, procedure);
1375
g_object_unref (procedure);
1378
* gimp-edit-stroke-vectors
1380
procedure = gimp_procedure_new (edit_stroke_vectors_invoker);
1381
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-edit-stroke-vectors");
1382
gimp_procedure_set_static_strings (procedure,
1383
"gimp-edit-stroke-vectors",
1384
"Stroke the specified vectors object",
1385
"This procedure strokes the specified vectors object, painting along the path with the active brush and foreground color.",
1390
gimp_procedure_add_argument (procedure,
1391
gimp_param_spec_drawable_id ("drawable",
1393
"The drawable to stroke to",
1395
GIMP_PARAM_READWRITE));
1396
gimp_procedure_add_argument (procedure,
1397
gimp_param_spec_vectors_id ("vectors",
1399
"The vectors object",
1401
GIMP_PARAM_READWRITE));
1402
gimp_pdb_register_procedure (pdb, procedure);
1403
g_object_unref (procedure);