~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/pdb/edit_cmds.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20081006133041-3panbkcanaymfsmp
Tags: upstream-2.6.0
ImportĀ upstreamĀ versionĀ 2.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* GIMP - The GNU Image Manipulation Program
2
 
 * Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
3
 
 *
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.
8
 
 *
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.
13
 
 *
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.
17
 
 */
18
 
 
19
 
/* NOTE: This file is auto-generated by pdbgen.pl. */
20
 
 
21
 
#include "config.h"
22
 
 
23
 
#include <string.h>
24
 
 
25
 
#include <glib-object.h>
26
 
 
27
 
#include "pdb-types.h"
28
 
#include "gimppdb.h"
29
 
#include "gimpprocedure.h"
30
 
#include "core/gimpparamspecs.h"
31
 
 
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"
45
 
 
46
 
#include "internal_procs.h"
47
 
 
48
 
 
49
 
static GValueArray *
50
 
edit_cut_invoker (GimpProcedure     *procedure,
51
 
                  Gimp              *gimp,
52
 
                  GimpContext       *context,
53
 
                  GimpProgress      *progress,
54
 
                  const GValueArray *args)
55
 
{
56
 
  gboolean success = TRUE;
57
 
  GValueArray *return_vals;
58
 
  GimpDrawable *drawable;
59
 
  gboolean non_empty = FALSE;
60
 
 
61
 
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
62
 
 
63
 
  if (success)
64
 
    {
65
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
66
 
        {
67
 
          GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
68
 
 
69
 
          non_empty = gimp_edit_cut (image, drawable, context) != NULL;
70
 
        }
71
 
      else
72
 
        success = FALSE;
73
 
    }
74
 
 
75
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
76
 
 
77
 
  if (success)
78
 
    g_value_set_boolean (&return_vals->values[1], non_empty);
79
 
 
80
 
  return return_vals;
81
 
}
82
 
 
83
 
static GValueArray *
84
 
edit_copy_invoker (GimpProcedure     *procedure,
85
 
                   Gimp              *gimp,
86
 
                   GimpContext       *context,
87
 
                   GimpProgress      *progress,
88
 
                   const GValueArray *args)
89
 
{
90
 
  gboolean success = TRUE;
91
 
  GValueArray *return_vals;
92
 
  GimpDrawable *drawable;
93
 
  gboolean non_empty = FALSE;
94
 
 
95
 
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
96
 
 
97
 
  if (success)
98
 
    {
99
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
100
 
        {
101
 
          GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
102
 
 
103
 
          non_empty = gimp_edit_copy (image, drawable, context) != NULL;
104
 
        }
105
 
      else
106
 
        success = FALSE;
107
 
    }
108
 
 
109
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
110
 
 
111
 
  if (success)
112
 
    g_value_set_boolean (&return_vals->values[1], non_empty);
113
 
 
114
 
  return return_vals;
115
 
}
116
 
 
117
 
static GValueArray *
118
 
edit_copy_visible_invoker (GimpProcedure     *procedure,
119
 
                           Gimp              *gimp,
120
 
                           GimpContext       *context,
121
 
                           GimpProgress      *progress,
122
 
                           const GValueArray *args)
123
 
{
124
 
  gboolean success = TRUE;
125
 
  GValueArray *return_vals;
126
 
  GimpImage *image;
127
 
  gboolean non_empty = FALSE;
128
 
 
129
 
  image = gimp_value_get_image (&args->values[0], gimp);
130
 
 
131
 
  if (success)
132
 
    {
133
 
      non_empty = gimp_edit_copy_visible (image, context) != NULL;
134
 
    }
135
 
 
136
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
137
 
 
138
 
  if (success)
139
 
    g_value_set_boolean (&return_vals->values[1], non_empty);
140
 
 
141
 
  return return_vals;
142
 
}
143
 
 
144
 
static GValueArray *
145
 
edit_paste_invoker (GimpProcedure     *procedure,
146
 
                    Gimp              *gimp,
147
 
                    GimpContext       *context,
148
 
                    GimpProgress      *progress,
149
 
                    const GValueArray *args)
150
 
{
151
 
  gboolean success = TRUE;
152
 
  GValueArray *return_vals;
153
 
  GimpDrawable *drawable;
154
 
  gboolean paste_into;
155
 
  GimpLayer *floating_sel = NULL;
156
 
 
157
 
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
158
 
  paste_into = g_value_get_boolean (&args->values[1]);
159
 
 
160
 
  if (success)
161
 
    {
162
 
      if (gimp->global_buffer && gimp_item_is_attached (GIMP_ITEM (drawable)))
163
 
        {
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);
167
 
 
168
 
          if (! floating_sel)
169
 
            success = FALSE;
170
 
        }
171
 
      else
172
 
        success = FALSE;
173
 
    }
174
 
 
175
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
176
 
 
177
 
  if (success)
178
 
    gimp_value_set_layer (&return_vals->values[1], floating_sel);
179
 
 
180
 
  return return_vals;
181
 
}
182
 
 
183
 
static GValueArray *
184
 
edit_paste_as_new_invoker (GimpProcedure     *procedure,
185
 
                           Gimp              *gimp,
186
 
                           GimpContext       *context,
187
 
                           GimpProgress      *progress,
188
 
                           const GValueArray *args)
189
 
{
190
 
  gboolean success = TRUE;
191
 
  GValueArray *return_vals;
192
 
  GimpImage *image = NULL;
193
 
 
194
 
  if (gimp->global_buffer)
195
 
    {
196
 
      image = gimp_edit_paste_as_new (gimp, NULL, gimp->global_buffer);
197
 
 
198
 
      if (! image)
199
 
        success = FALSE;
200
 
    }
201
 
  else
202
 
    {
203
 
      image = NULL;
204
 
    }
205
 
 
206
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
207
 
 
208
 
  if (success)
209
 
    gimp_value_set_image (&return_vals->values[1], image);
210
 
 
211
 
  return return_vals;
212
 
}
213
 
 
214
 
static GValueArray *
215
 
edit_named_cut_invoker (GimpProcedure     *procedure,
216
 
                        Gimp              *gimp,
217
 
                        GimpContext       *context,
218
 
                        GimpProgress      *progress,
219
 
                        const GValueArray *args)
220
 
{
221
 
  gboolean success = TRUE;
222
 
  GValueArray *return_vals;
223
 
  GimpDrawable *drawable;
224
 
  const gchar *buffer_name;
225
 
  gchar *real_name = NULL;
226
 
 
227
 
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
228
 
  buffer_name = g_value_get_string (&args->values[1]);
229
 
 
230
 
  if (success)
231
 
    {
232
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
233
 
        {
234
 
           GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
235
 
 
236
 
           real_name = (gchar *) gimp_edit_named_cut (image, buffer_name,
237
 
                                                      drawable, context);
238
 
 
239
 
           if (real_name)
240
 
             real_name = g_strdup (real_name);
241
 
           else
242
 
             success = FALSE;
243
 
        }
244
 
      else
245
 
        success = FALSE;
246
 
    }
247
 
 
248
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
249
 
 
250
 
  if (success)
251
 
    g_value_take_string (&return_vals->values[1], real_name);
252
 
 
253
 
  return return_vals;
254
 
}
255
 
 
256
 
static GValueArray *
257
 
edit_named_copy_invoker (GimpProcedure     *procedure,
258
 
                         Gimp              *gimp,
259
 
                         GimpContext       *context,
260
 
                         GimpProgress      *progress,
261
 
                         const GValueArray *args)
262
 
{
263
 
  gboolean success = TRUE;
264
 
  GValueArray *return_vals;
265
 
  GimpDrawable *drawable;
266
 
  const gchar *buffer_name;
267
 
  gchar *real_name = NULL;
268
 
 
269
 
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
270
 
  buffer_name = g_value_get_string (&args->values[1]);
271
 
 
272
 
  if (success)
273
 
    {
274
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
275
 
        {
276
 
           GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
277
 
 
278
 
           real_name = (gchar *) gimp_edit_named_copy (image, buffer_name,
279
 
                                                       drawable, context);
280
 
 
281
 
           if (real_name)
282
 
             real_name = g_strdup (real_name);
283
 
           else
284
 
             success = FALSE;
285
 
        }
286
 
      else
287
 
        success = FALSE;
288
 
    }
289
 
 
290
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
291
 
 
292
 
  if (success)
293
 
    g_value_take_string (&return_vals->values[1], real_name);
294
 
 
295
 
  return return_vals;
296
 
}
297
 
 
298
 
static GValueArray *
299
 
edit_named_copy_visible_invoker (GimpProcedure     *procedure,
300
 
                                 Gimp              *gimp,
301
 
                                 GimpContext       *context,
302
 
                                 GimpProgress      *progress,
303
 
                                 const GValueArray *args)
304
 
{
305
 
  gboolean success = TRUE;
306
 
  GValueArray *return_vals;
307
 
  GimpImage *image;
308
 
  const gchar *buffer_name;
309
 
  gchar *real_name = NULL;
310
 
 
311
 
  image = gimp_value_get_image (&args->values[0], gimp);
312
 
  buffer_name = g_value_get_string (&args->values[1]);
313
 
 
314
 
  if (success)
315
 
    {
316
 
      real_name = (gchar *) gimp_edit_named_copy_visible (image, buffer_name,
317
 
                                                          context);
318
 
 
319
 
      if (real_name)
320
 
        real_name = g_strdup (real_name);
321
 
      else
322
 
        success = FALSE;
323
 
    }
324
 
 
325
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
326
 
 
327
 
  if (success)
328
 
    g_value_take_string (&return_vals->values[1], real_name);
329
 
 
330
 
  return return_vals;
331
 
}
332
 
 
333
 
static GValueArray *
334
 
edit_named_paste_invoker (GimpProcedure     *procedure,
335
 
                          Gimp              *gimp,
336
 
                          GimpContext       *context,
337
 
                          GimpProgress      *progress,
338
 
                          const GValueArray *args)
339
 
{
340
 
  gboolean success = TRUE;
341
 
  GValueArray *return_vals;
342
 
  GimpDrawable *drawable;
343
 
  const gchar *buffer_name;
344
 
  gboolean paste_into;
345
 
  GimpLayer *floating_sel = NULL;
346
 
 
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]);
350
 
 
351
 
  if (success)
352
 
    {
353
 
      GimpBuffer *buffer = (GimpBuffer *)
354
 
        gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
355
 
 
356
 
      if (buffer && gimp_item_is_attached (GIMP_ITEM (drawable)))
357
 
        {
358
 
          floating_sel = gimp_edit_paste (gimp_item_get_image (GIMP_ITEM (drawable)),
359
 
                                          drawable, buffer,
360
 
                                          paste_into, -1, -1, -1, -1);
361
 
          if (! floating_sel)
362
 
            success = FALSE;
363
 
        }
364
 
      else
365
 
        success = FALSE;
366
 
    }
367
 
 
368
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
369
 
 
370
 
  if (success)
371
 
    gimp_value_set_layer (&return_vals->values[1], floating_sel);
372
 
 
373
 
  return return_vals;
374
 
}
375
 
 
376
 
static GValueArray *
377
 
edit_named_paste_as_new_invoker (GimpProcedure     *procedure,
378
 
                                 Gimp              *gimp,
379
 
                                 GimpContext       *context,
380
 
                                 GimpProgress      *progress,
381
 
                                 const GValueArray *args)
382
 
{
383
 
  gboolean success = TRUE;
384
 
  GValueArray *return_vals;
385
 
  const gchar *buffer_name;
386
 
  GimpImage *image = NULL;
387
 
 
388
 
  buffer_name = g_value_get_string (&args->values[0]);
389
 
 
390
 
  if (success)
391
 
    {
392
 
      GimpBuffer *buffer = (GimpBuffer *)
393
 
        gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
394
 
 
395
 
      if (buffer)
396
 
        {
397
 
          image = gimp_edit_paste_as_new (gimp, NULL, buffer);
398
 
 
399
 
          if (! image)
400
 
            success = FALSE;
401
 
        }
402
 
      else
403
 
        success = FALSE;
404
 
    }
405
 
 
406
 
  return_vals = gimp_procedure_get_return_values (procedure, success);
407
 
 
408
 
  if (success)
409
 
    gimp_value_set_image (&return_vals->values[1], image);
410
 
 
411
 
  return return_vals;
412
 
}
413
 
 
414
 
static GValueArray *
415
 
edit_clear_invoker (GimpProcedure     *procedure,
416
 
                    Gimp              *gimp,
417
 
                    GimpContext       *context,
418
 
                    GimpProgress      *progress,
419
 
                    const GValueArray *args)
420
 
{
421
 
  gboolean success = TRUE;
422
 
  GimpDrawable *drawable;
423
 
 
424
 
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
425
 
 
426
 
  if (success)
427
 
    {
428
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
429
 
        {
430
 
          GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
431
 
 
432
 
          success = gimp_edit_clear (image, drawable, context);
433
 
        }
434
 
      else
435
 
        success = FALSE;
436
 
    }
437
 
 
438
 
  return gimp_procedure_get_return_values (procedure, success);
439
 
}
440
 
 
441
 
static GValueArray *
442
 
edit_fill_invoker (GimpProcedure     *procedure,
443
 
                   Gimp              *gimp,
444
 
                   GimpContext       *context,
445
 
                   GimpProgress      *progress,
446
 
                   const GValueArray *args)
447
 
{
448
 
  gboolean success = TRUE;
449
 
  GimpDrawable *drawable;
450
 
  gint32 fill_type;
451
 
 
452
 
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
453
 
  fill_type = g_value_get_enum (&args->values[1]);
454
 
 
455
 
  if (success)
456
 
    {
457
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
458
 
        {
459
 
          GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
460
 
 
461
 
          success = gimp_edit_fill (image, drawable, context,
462
 
                                    (GimpFillType) fill_type);
463
 
        }
464
 
      else
465
 
        success = FALSE;
466
 
    }
467
 
 
468
 
  return gimp_procedure_get_return_values (procedure, success);
469
 
}
470
 
 
471
 
static GValueArray *
472
 
edit_bucket_fill_invoker (GimpProcedure     *procedure,
473
 
                          Gimp              *gimp,
474
 
                          GimpContext       *context,
475
 
                          GimpProgress      *progress,
476
 
                          const GValueArray *args)
477
 
{
478
 
  gboolean success = TRUE;
479
 
  GimpDrawable *drawable;
480
 
  gint32 fill_mode;
481
 
  gint32 paint_mode;
482
 
  gdouble opacity;
483
 
  gdouble threshold;
484
 
  gboolean sample_merged;
485
 
  gdouble x;
486
 
  gdouble y;
487
 
 
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]);
496
 
 
497
 
  if (success)
498
 
    {
499
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
500
 
        {
501
 
          GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
502
 
          gboolean   do_seed_fill;
503
 
 
504
 
          do_seed_fill = gimp_channel_is_empty (gimp_image_get_mask (image));
505
 
 
506
 
          gimp_drawable_bucket_fill (drawable, context, fill_mode,
507
 
                                     paint_mode, opacity / 100.0,
508
 
                                     do_seed_fill,
509
 
                                     FALSE /* don't fill transparent */,
510
 
                                     GIMP_SELECT_CRITERION_COMPOSITE,
511
 
                                     threshold, sample_merged, x, y);
512
 
        }
513
 
      else
514
 
        success = FALSE;
515
 
    }
516
 
 
517
 
  return gimp_procedure_get_return_values (procedure, success);
518
 
}
519
 
 
520
 
static GValueArray *
521
 
edit_bucket_fill_full_invoker (GimpProcedure     *procedure,
522
 
                               Gimp              *gimp,
523
 
                               GimpContext       *context,
524
 
                               GimpProgress      *progress,
525
 
                               const GValueArray *args)
526
 
{
527
 
  gboolean success = TRUE;
528
 
  GimpDrawable *drawable;
529
 
  gint32 fill_mode;
530
 
  gint32 paint_mode;
531
 
  gdouble opacity;
532
 
  gdouble threshold;
533
 
  gboolean sample_merged;
534
 
  gboolean fill_transparent;
535
 
  gint32 select_criterion;
536
 
  gdouble x;
537
 
  gdouble y;
538
 
 
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]);
549
 
 
550
 
  if (success)
551
 
    {
552
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
553
 
        {
554
 
          GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
555
 
          gboolean   do_seed_fill;
556
 
 
557
 
          do_seed_fill = gimp_channel_is_empty (gimp_image_get_mask (image));
558
 
 
559
 
          gimp_drawable_bucket_fill (drawable, context, fill_mode,
560
 
                                     paint_mode, opacity / 100.0,
561
 
                                     do_seed_fill,
562
 
                                     fill_transparent,
563
 
                                     select_criterion,
564
 
                                     threshold, sample_merged, x, y);
565
 
        }
566
 
      else
567
 
        success = FALSE;
568
 
    }
569
 
 
570
 
  return gimp_procedure_get_return_values (procedure, success);
571
 
}
572
 
 
573
 
static GValueArray *
574
 
edit_blend_invoker (GimpProcedure     *procedure,
575
 
                    Gimp              *gimp,
576
 
                    GimpContext       *context,
577
 
                    GimpProgress      *progress,
578
 
                    const GValueArray *args)
579
 
{
580
 
  gboolean success = TRUE;
581
 
  GimpDrawable *drawable;
582
 
  gint32 blend_mode;
583
 
  gint32 paint_mode;
584
 
  gint32 gradient_type;
585
 
  gdouble opacity;
586
 
  gdouble offset;
587
 
  gint32 repeat;
588
 
  gboolean reverse;
589
 
  gboolean supersample;
590
 
  gint32 max_depth;
591
 
  gdouble threshold;
592
 
  gboolean dither;
593
 
  gdouble x1;
594
 
  gdouble y1;
595
 
  gdouble x2;
596
 
  gdouble y2;
597
 
 
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]);
614
 
 
615
 
  if (success)
616
 
    {
617
 
      success = gimp_item_is_attached (GIMP_ITEM (drawable));
618
 
 
619
 
      if (success && supersample)
620
 
        {
621
 
          if (max_depth < 1 || max_depth > 9)
622
 
            success = FALSE;
623
 
 
624
 
          if (threshold < 0.0 || threshold > 4.0)
625
 
            success = FALSE;
626
 
        }
627
 
 
628
 
      if (success)
629
 
        {
630
 
          if (progress)
631
 
            gimp_progress_start (progress, _("Blending"), FALSE);
632
 
 
633
 
          gimp_drawable_blend (drawable,
634
 
                               context,
635
 
                               blend_mode,
636
 
                               paint_mode,
637
 
                               gradient_type,
638
 
                               opacity / 100.0,
639
 
                               offset, repeat, reverse,
640
 
                               supersample, max_depth,
641
 
                               threshold, dither,
642
 
                               x1, y1, x2, y2,
643
 
                               progress);
644
 
 
645
 
          if (progress)
646
 
            gimp_progress_end (progress);
647
 
        }
648
 
    }
649
 
 
650
 
  return gimp_procedure_get_return_values (procedure, success);
651
 
}
652
 
 
653
 
static GValueArray *
654
 
edit_stroke_invoker (GimpProcedure     *procedure,
655
 
                     Gimp              *gimp,
656
 
                     GimpContext       *context,
657
 
                     GimpProgress      *progress,
658
 
                     const GValueArray *args)
659
 
{
660
 
  gboolean success = TRUE;
661
 
  GimpDrawable *drawable;
662
 
 
663
 
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
664
 
 
665
 
  if (success)
666
 
    {
667
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
668
 
        {
669
 
          GimpImage      *image = gimp_item_get_image (GIMP_ITEM (drawable));
670
 
          GimpStrokeDesc *desc  = gimp_stroke_desc_new (gimp, context);
671
 
 
672
 
          g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
673
 
 
674
 
          success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
675
 
                                      drawable, context, desc, TRUE, progress);
676
 
 
677
 
          g_object_unref (desc);
678
 
        }
679
 
      else
680
 
        success = FALSE;
681
 
    }
682
 
 
683
 
  return gimp_procedure_get_return_values (procedure, success);
684
 
}
685
 
 
686
 
static GValueArray *
687
 
edit_stroke_vectors_invoker (GimpProcedure     *procedure,
688
 
                             Gimp              *gimp,
689
 
                             GimpContext       *context,
690
 
                             GimpProgress      *progress,
691
 
                             const GValueArray *args)
692
 
{
693
 
  gboolean success = TRUE;
694
 
  GimpDrawable *drawable;
695
 
  GimpVectors *vectors;
696
 
 
697
 
  drawable = gimp_value_get_drawable (&args->values[0], gimp);
698
 
  vectors = gimp_value_get_vectors (&args->values[1], gimp);
699
 
 
700
 
  if (success)
701
 
    {
702
 
      if (gimp_item_is_attached (GIMP_ITEM (drawable)))
703
 
        {
704
 
          GimpStrokeDesc *desc  = gimp_stroke_desc_new (gimp, context);
705
 
 
706
 
          g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
707
 
 
708
 
          success = gimp_item_stroke (GIMP_ITEM (vectors),
709
 
                                      drawable, context, desc, TRUE, progress);
710
 
 
711
 
          g_object_unref (desc);
712
 
        }
713
 
      else
714
 
        success = FALSE;
715
 
    }
716
 
 
717
 
  return gimp_procedure_get_return_values (procedure, success);
718
 
}
719
 
 
720
 
void
721
 
register_edit_procs (GimpPDB *pdb)
722
 
{
723
 
  GimpProcedure *procedure;
724
 
 
725
 
  /*
726
 
   * gimp-edit-cut
727
 
   */
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,
731
 
                                     "gimp-edit-cut",
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",
736
 
                                     "1995-1996",
737
 
                                     NULL);
738
 
  gimp_procedure_add_argument (procedure,
739
 
                               gimp_param_spec_drawable_id ("drawable",
740
 
                                                            "drawable",
741
 
                                                            "The drawable to cut from",
742
 
                                                            pdb->gimp, FALSE,
743
 
                                                            GIMP_PARAM_READWRITE));
744
 
  gimp_procedure_add_return_value (procedure,
745
 
                                   g_param_spec_boolean ("non-empty",
746
 
                                                         "non empty",
747
 
                                                         "TRUE if the cut was successful, FALSE if the selection contained only transparent pixels",
748
 
                                                         FALSE,
749
 
                                                         GIMP_PARAM_READWRITE));
750
 
  gimp_pdb_register_procedure (pdb, procedure);
751
 
  g_object_unref (procedure);
752
 
 
753
 
  /*
754
 
   * gimp-edit-copy
755
 
   */
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,
759
 
                                     "gimp-edit-copy",
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",
764
 
                                     "1995-1996",
765
 
                                     NULL);
766
 
  gimp_procedure_add_argument (procedure,
767
 
                               gimp_param_spec_drawable_id ("drawable",
768
 
                                                            "drawable",
769
 
                                                            "The drawable to copy from",
770
 
                                                            pdb->gimp, FALSE,
771
 
                                                            GIMP_PARAM_READWRITE));
772
 
  gimp_procedure_add_return_value (procedure,
773
 
                                   g_param_spec_boolean ("non-empty",
774
 
                                                         "non empty",
775
 
                                                         "TRUE if the copy was successful, FALSE if the selection contained only transparent pixels",
776
 
                                                         FALSE,
777
 
                                                         GIMP_PARAM_READWRITE));
778
 
  gimp_pdb_register_procedure (pdb, procedure);
779
 
  g_object_unref (procedure);
780
 
 
781
 
  /*
782
 
   * gimp-edit-copy-visible
783
 
   */
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>",
791
 
                                     "Michael Natterer",
792
 
                                     "2004",
793
 
                                     NULL);
794
 
  gimp_procedure_add_argument (procedure,
795
 
                               gimp_param_spec_image_id ("image",
796
 
                                                         "image",
797
 
                                                         "The image to copy from",
798
 
                                                         pdb->gimp, FALSE,
799
 
                                                         GIMP_PARAM_READWRITE));
800
 
  gimp_procedure_add_return_value (procedure,
801
 
                                   g_param_spec_boolean ("non-empty",
802
 
                                                         "non empty",
803
 
                                                         "TRUE if the copy was successful, FALSE if the selection contained only transparent pixels",
804
 
                                                         FALSE,
805
 
                                                         GIMP_PARAM_READWRITE));
806
 
  gimp_pdb_register_procedure (pdb, procedure);
807
 
  g_object_unref (procedure);
808
 
 
809
 
  /*
810
 
   * gimp-edit-paste
811
 
   */
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,
815
 
                                     "gimp-edit-paste",
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",
820
 
                                     "1995-1996",
821
 
                                     NULL);
822
 
  gimp_procedure_add_argument (procedure,
823
 
                               gimp_param_spec_drawable_id ("drawable",
824
 
                                                            "drawable",
825
 
                                                            "The drawable to paste to",
826
 
                                                            pdb->gimp, FALSE,
827
 
                                                            GIMP_PARAM_READWRITE));
828
 
  gimp_procedure_add_argument (procedure,
829
 
                               g_param_spec_boolean ("paste-into",
830
 
                                                     "paste into",
831
 
                                                     "Clear selection, or paste behind it?",
832
 
                                                     FALSE,
833
 
                                                     GIMP_PARAM_READWRITE));
834
 
  gimp_procedure_add_return_value (procedure,
835
 
                                   gimp_param_spec_layer_id ("floating-sel",
836
 
                                                             "floating sel",
837
 
                                                             "The new floating selection",
838
 
                                                             pdb->gimp, FALSE,
839
 
                                                             GIMP_PARAM_READWRITE));
840
 
  gimp_pdb_register_procedure (pdb, procedure);
841
 
  g_object_unref (procedure);
842
 
 
843
 
  /*
844
 
   * gimp-edit-paste-as-new
845
 
   */
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>",
853
 
                                     "Michael Natterer",
854
 
                                     "2005",
855
 
                                     NULL);
856
 
  gimp_procedure_add_return_value (procedure,
857
 
                                   gimp_param_spec_image_id ("image",
858
 
                                                             "image",
859
 
                                                             "The new image",
860
 
                                                             pdb->gimp, FALSE,
861
 
                                                             GIMP_PARAM_READWRITE));
862
 
  gimp_pdb_register_procedure (pdb, procedure);
863
 
  g_object_unref (procedure);
864
 
 
865
 
  /*
866
 
   * gimp-edit-named-cut
867
 
   */
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>",
875
 
                                     "Michael Natterer",
876
 
                                     "2005",
877
 
                                     NULL);
878
 
  gimp_procedure_add_argument (procedure,
879
 
                               gimp_param_spec_drawable_id ("drawable",
880
 
                                                            "drawable",
881
 
                                                            "The drawable to cut from",
882
 
                                                            pdb->gimp, FALSE,
883
 
                                                            GIMP_PARAM_READWRITE));
884
 
  gimp_procedure_add_argument (procedure,
885
 
                               gimp_param_spec_string ("buffer-name",
886
 
                                                       "buffer name",
887
 
                                                       "The name of the buffer to create",
888
 
                                                       FALSE, FALSE, TRUE,
889
 
                                                       NULL,
890
 
                                                       GIMP_PARAM_READWRITE));
891
 
  gimp_procedure_add_return_value (procedure,
892
 
                                   gimp_param_spec_string ("real-name",
893
 
                                                           "real name",
894
 
                                                           "The real name given to the buffer, or NULL if the selection contained only transparent pixels",
895
 
                                                           FALSE, FALSE, FALSE,
896
 
                                                           NULL,
897
 
                                                           GIMP_PARAM_READWRITE));
898
 
  gimp_pdb_register_procedure (pdb, procedure);
899
 
  g_object_unref (procedure);
900
 
 
901
 
  /*
902
 
   * gimp-edit-named-copy
903
 
   */
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>",
911
 
                                     "Michael Natterer",
912
 
                                     "2005",
913
 
                                     NULL);
914
 
  gimp_procedure_add_argument (procedure,
915
 
                               gimp_param_spec_drawable_id ("drawable",
916
 
                                                            "drawable",
917
 
                                                            "The drawable to copy from",
918
 
                                                            pdb->gimp, FALSE,
919
 
                                                            GIMP_PARAM_READWRITE));
920
 
  gimp_procedure_add_argument (procedure,
921
 
                               gimp_param_spec_string ("buffer-name",
922
 
                                                       "buffer name",
923
 
                                                       "The name of the buffer to create",
924
 
                                                       FALSE, FALSE, TRUE,
925
 
                                                       NULL,
926
 
                                                       GIMP_PARAM_READWRITE));
927
 
  gimp_procedure_add_return_value (procedure,
928
 
                                   gimp_param_spec_string ("real-name",
929
 
                                                           "real name",
930
 
                                                           "The real name given to the buffer, or NULL if the selection contained only transparent pixels",
931
 
                                                           FALSE, FALSE, FALSE,
932
 
                                                           NULL,
933
 
                                                           GIMP_PARAM_READWRITE));
934
 
  gimp_pdb_register_procedure (pdb, procedure);
935
 
  g_object_unref (procedure);
936
 
 
937
 
  /*
938
 
   * gimp-edit-named-copy-visible
939
 
   */
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>",
947
 
                                     "Michael Natterer",
948
 
                                     "2005",
949
 
                                     NULL);
950
 
  gimp_procedure_add_argument (procedure,
951
 
                               gimp_param_spec_image_id ("image",
952
 
                                                         "image",
953
 
                                                         "The image to copy from",
954
 
                                                         pdb->gimp, FALSE,
955
 
                                                         GIMP_PARAM_READWRITE));
956
 
  gimp_procedure_add_argument (procedure,
957
 
                               gimp_param_spec_string ("buffer-name",
958
 
                                                       "buffer name",
959
 
                                                       "The name of the buffer to create",
960
 
                                                       FALSE, FALSE, TRUE,
961
 
                                                       NULL,
962
 
                                                       GIMP_PARAM_READWRITE));
963
 
  gimp_procedure_add_return_value (procedure,
964
 
                                   gimp_param_spec_string ("real-name",
965
 
                                                           "real name",
966
 
                                                           "The real name given to the buffer",
967
 
                                                           FALSE, FALSE, FALSE,
968
 
                                                           NULL,
969
 
                                                           GIMP_PARAM_READWRITE));
970
 
  gimp_pdb_register_procedure (pdb, procedure);
971
 
  g_object_unref (procedure);
972
 
 
973
 
  /*
974
 
   * gimp-edit-named-paste
975
 
   */
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>",
983
 
                                     "Michael Natterer",
984
 
                                     "2005",
985
 
                                     NULL);
986
 
  gimp_procedure_add_argument (procedure,
987
 
                               gimp_param_spec_drawable_id ("drawable",
988
 
                                                            "drawable",
989
 
                                                            "The drawable to paste to",
990
 
                                                            pdb->gimp, FALSE,
991
 
                                                            GIMP_PARAM_READWRITE));
992
 
  gimp_procedure_add_argument (procedure,
993
 
                               gimp_param_spec_string ("buffer-name",
994
 
                                                       "buffer name",
995
 
                                                       "The name of the buffer to paste",
996
 
                                                       FALSE, FALSE, FALSE,
997
 
                                                       NULL,
998
 
                                                       GIMP_PARAM_READWRITE));
999
 
  gimp_procedure_add_argument (procedure,
1000
 
                               g_param_spec_boolean ("paste-into",
1001
 
                                                     "paste into",
1002
 
                                                     "Clear selection, or paste behind it?",
1003
 
                                                     FALSE,
1004
 
                                                     GIMP_PARAM_READWRITE));
1005
 
  gimp_procedure_add_return_value (procedure,
1006
 
                                   gimp_param_spec_layer_id ("floating-sel",
1007
 
                                                             "floating sel",
1008
 
                                                             "The new floating selection",
1009
 
                                                             pdb->gimp, FALSE,
1010
 
                                                             GIMP_PARAM_READWRITE));
1011
 
  gimp_pdb_register_procedure (pdb, procedure);
1012
 
  g_object_unref (procedure);
1013
 
 
1014
 
  /*
1015
 
   * gimp-edit-named-paste-as-new
1016
 
   */
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>",
1024
 
                                     "Michael Natterer",
1025
 
                                     "2005",
1026
 
                                     NULL);
1027
 
  gimp_procedure_add_argument (procedure,
1028
 
                               gimp_param_spec_string ("buffer-name",
1029
 
                                                       "buffer name",
1030
 
                                                       "The name of the buffer to paste",
1031
 
                                                       FALSE, FALSE, FALSE,
1032
 
                                                       NULL,
1033
 
                                                       GIMP_PARAM_READWRITE));
1034
 
  gimp_procedure_add_return_value (procedure,
1035
 
                                   gimp_param_spec_image_id ("image",
1036
 
                                                             "image",
1037
 
                                                             "The new image",
1038
 
                                                             pdb->gimp, FALSE,
1039
 
                                                             GIMP_PARAM_READWRITE));
1040
 
  gimp_pdb_register_procedure (pdb, procedure);
1041
 
  g_object_unref (procedure);
1042
 
 
1043
 
  /*
1044
 
   * gimp-edit-clear
1045
 
   */
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,
1049
 
                                     "gimp-edit-clear",
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",
1054
 
                                     "1995-1996",
1055
 
                                     NULL);
1056
 
  gimp_procedure_add_argument (procedure,
1057
 
                               gimp_param_spec_drawable_id ("drawable",
1058
 
                                                            "drawable",
1059
 
                                                            "The drawable to clear from",
1060
 
                                                            pdb->gimp, FALSE,
1061
 
                                                            GIMP_PARAM_READWRITE));
1062
 
  gimp_pdb_register_procedure (pdb, procedure);
1063
 
  g_object_unref (procedure);
1064
 
 
1065
 
  /*
1066
 
   * gimp-edit-fill
1067
 
   */
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,
1071
 
                                     "gimp-edit-fill",
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",
1076
 
                                     "1995-2000",
1077
 
                                     NULL);
1078
 
  gimp_procedure_add_argument (procedure,
1079
 
                               gimp_param_spec_drawable_id ("drawable",
1080
 
                                                            "drawable",
1081
 
                                                            "The drawable to fill to",
1082
 
                                                            pdb->gimp, FALSE,
1083
 
                                                            GIMP_PARAM_READWRITE));
1084
 
  gimp_procedure_add_argument (procedure,
1085
 
                               g_param_spec_enum ("fill-type",
1086
 
                                                  "fill type",
1087
 
                                                  "The type of fill",
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);
1093
 
 
1094
 
  /*
1095
 
   * gimp-edit-bucket-fill
1096
 
   */
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",
1105
 
                                     "1995-1996",
1106
 
                                     NULL);
1107
 
  gimp_procedure_add_argument (procedure,
1108
 
                               gimp_param_spec_drawable_id ("drawable",
1109
 
                                                            "drawable",
1110
 
                                                            "The affected drawable",
1111
 
                                                            pdb->gimp, FALSE,
1112
 
                                                            GIMP_PARAM_READWRITE));
1113
 
  gimp_procedure_add_argument (procedure,
1114
 
                               g_param_spec_enum ("fill-mode",
1115
 
                                                  "fill mode",
1116
 
                                                  "The type of fill",
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",
1122
 
                                                  "paint mode",
1123
 
                                                  "The paint application mode",
1124
 
                                                  GIMP_TYPE_LAYER_MODE_EFFECTS,
1125
 
                                                  GIMP_NORMAL_MODE,
1126
 
                                                  GIMP_PARAM_READWRITE));
1127
 
  gimp_procedure_add_argument (procedure,
1128
 
                               g_param_spec_double ("opacity",
1129
 
                                                    "opacity",
1130
 
                                                    "The opacity of the final bucket fill",
1131
 
                                                    0, 100, 0,
1132
 
                                                    GIMP_PARAM_READWRITE));
1133
 
  gimp_procedure_add_argument (procedure,
1134
 
                               g_param_spec_double ("threshold",
1135
 
                                                    "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.",
1137
 
                                                    0, 255, 0,
1138
 
                                                    GIMP_PARAM_READWRITE));
1139
 
  gimp_procedure_add_argument (procedure,
1140
 
                               g_param_spec_boolean ("sample-merged",
1141
 
                                                     "sample merged",
1142
 
                                                     "Use the composite image, not the drawable",
1143
 
                                                     FALSE,
1144
 
                                                     GIMP_PARAM_READWRITE));
1145
 
  gimp_procedure_add_argument (procedure,
1146
 
                               g_param_spec_double ("x",
1147
 
                                                    "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",
1153
 
                                                    "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);
1159
 
 
1160
 
  /*
1161
 
   * gimp-edit-bucket-fill-full
1162
 
   */
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.",
1169
 
                                     "David Gowers",
1170
 
                                     "David Gowers",
1171
 
                                     "2006",
1172
 
                                     NULL);
1173
 
  gimp_procedure_add_argument (procedure,
1174
 
                               gimp_param_spec_drawable_id ("drawable",
1175
 
                                                            "drawable",
1176
 
                                                            "The affected drawable",
1177
 
                                                            pdb->gimp, FALSE,
1178
 
                                                            GIMP_PARAM_READWRITE));
1179
 
  gimp_procedure_add_argument (procedure,
1180
 
                               g_param_spec_enum ("fill-mode",
1181
 
                                                  "fill mode",
1182
 
                                                  "The type of fill",
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",
1188
 
                                                  "paint mode",
1189
 
                                                  "The paint application mode",
1190
 
                                                  GIMP_TYPE_LAYER_MODE_EFFECTS,
1191
 
                                                  GIMP_NORMAL_MODE,
1192
 
                                                  GIMP_PARAM_READWRITE));
1193
 
  gimp_procedure_add_argument (procedure,
1194
 
                               g_param_spec_double ("opacity",
1195
 
                                                    "opacity",
1196
 
                                                    "The opacity of the final bucket fill",
1197
 
                                                    0, 100, 0,
1198
 
                                                    GIMP_PARAM_READWRITE));
1199
 
  gimp_procedure_add_argument (procedure,
1200
 
                               g_param_spec_double ("threshold",
1201
 
                                                    "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.",
1203
 
                                                    0, 255, 0,
1204
 
                                                    GIMP_PARAM_READWRITE));
1205
 
  gimp_procedure_add_argument (procedure,
1206
 
                               g_param_spec_boolean ("sample-merged",
1207
 
                                                     "sample merged",
1208
 
                                                     "Use the composite image, not the drawable",
1209
 
                                                     FALSE,
1210
 
                                                     GIMP_PARAM_READWRITE));
1211
 
  gimp_procedure_add_argument (procedure,
1212
 
                               g_param_spec_boolean ("fill-transparent",
1213
 
                                                     "fill transparent",
1214
 
                                                     "Whether to consider transparent pixels for filling. If TRUE, transparency is considered as a unique fillable color.",
1215
 
                                                     FALSE,
1216
 
                                                     GIMP_PARAM_READWRITE));
1217
 
  gimp_procedure_add_argument (procedure,
1218
 
                               g_param_spec_enum ("select-criterion",
1219
 
                                                  "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",
1226
 
                                                    "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",
1232
 
                                                    "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);
1238
 
 
1239
 
  /*
1240
 
   * gimp-edit-blend
1241
 
   */
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,
1245
 
                                     "gimp-edit-blend",
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",
1250
 
                                     "1995-1996",
1251
 
                                     NULL);
1252
 
  gimp_procedure_add_argument (procedure,
1253
 
                               gimp_param_spec_drawable_id ("drawable",
1254
 
                                                            "drawable",
1255
 
                                                            "The affected drawable",
1256
 
                                                            pdb->gimp, FALSE,
1257
 
                                                            GIMP_PARAM_READWRITE));
1258
 
  gimp_procedure_add_argument (procedure,
1259
 
                               g_param_spec_enum ("blend-mode",
1260
 
                                                  "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",
1267
 
                                                  "paint mode",
1268
 
                                                  "The paint application mode",
1269
 
                                                  GIMP_TYPE_LAYER_MODE_EFFECTS,
1270
 
                                                  GIMP_NORMAL_MODE,
1271
 
                                                  GIMP_PARAM_READWRITE));
1272
 
  gimp_procedure_add_argument (procedure,
1273
 
                               g_param_spec_enum ("gradient-type",
1274
 
                                                  "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",
1281
 
                                                    "opacity",
1282
 
                                                    "The opacity of the final blend",
1283
 
                                                    0, 100, 0,
1284
 
                                                    GIMP_PARAM_READWRITE));
1285
 
  gimp_procedure_add_argument (procedure,
1286
 
                               g_param_spec_double ("offset",
1287
 
                                                    "offset",
1288
 
                                                    "Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.",
1289
 
                                                    0, G_MAXDOUBLE, 0,
1290
 
                                                    GIMP_PARAM_READWRITE));
1291
 
  gimp_procedure_add_argument (procedure,
1292
 
                               g_param_spec_enum ("repeat",
1293
 
                                                  "repeat",
1294
 
                                                  "Repeat mode",
1295
 
                                                  GIMP_TYPE_REPEAT_MODE,
1296
 
                                                  GIMP_REPEAT_NONE,
1297
 
                                                  GIMP_PARAM_READWRITE));
1298
 
  gimp_procedure_add_argument (procedure,
1299
 
                               g_param_spec_boolean ("reverse",
1300
 
                                                     "reverse",
1301
 
                                                     "Use the reverse gradient",
1302
 
                                                     FALSE,
1303
 
                                                     GIMP_PARAM_READWRITE));
1304
 
  gimp_procedure_add_argument (procedure,
1305
 
                               g_param_spec_boolean ("supersample",
1306
 
                                                     "supersample",
1307
 
                                                     "Do adaptive supersampling",
1308
 
                                                     FALSE,
1309
 
                                                     GIMP_PARAM_READWRITE));
1310
 
  gimp_procedure_add_argument (procedure,
1311
 
                               gimp_param_spec_int32 ("max-depth",
1312
 
                                                      "max depth",
1313
 
                                                      "Maximum recursion levels for supersampling",
1314
 
                                                      1, 9, 1,
1315
 
                                                      GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
1316
 
  gimp_procedure_add_argument (procedure,
1317
 
                               g_param_spec_double ("threshold",
1318
 
                                                    "threshold",
1319
 
                                                    "Supersampling threshold",
1320
 
                                                    0, 4, 0,
1321
 
                                                    GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
1322
 
  gimp_procedure_add_argument (procedure,
1323
 
                               g_param_spec_boolean ("dither",
1324
 
                                                     "dither",
1325
 
                                                     "Use dithering to reduce banding",
1326
 
                                                     FALSE,
1327
 
                                                     GIMP_PARAM_READWRITE));
1328
 
  gimp_procedure_add_argument (procedure,
1329
 
                               g_param_spec_double ("x1",
1330
 
                                                    "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",
1336
 
                                                    "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",
1342
 
                                                    "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",
1348
 
                                                    "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);
1354
 
 
1355
 
  /*
1356
 
   * gimp-edit-stroke
1357
 
   */
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,
1361
 
                                     "gimp-edit-stroke",
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",
1366
 
                                     "1995-1996",
1367
 
                                     NULL);
1368
 
  gimp_procedure_add_argument (procedure,
1369
 
                               gimp_param_spec_drawable_id ("drawable",
1370
 
                                                            "drawable",
1371
 
                                                            "The drawable to stroke to",
1372
 
                                                            pdb->gimp, FALSE,
1373
 
                                                            GIMP_PARAM_READWRITE));
1374
 
  gimp_pdb_register_procedure (pdb, procedure);
1375
 
  g_object_unref (procedure);
1376
 
 
1377
 
  /*
1378
 
   * gimp-edit-stroke-vectors
1379
 
   */
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.",
1386
 
                                     "Simon Budig",
1387
 
                                     "Simon Budig",
1388
 
                                     "2006",
1389
 
                                     NULL);
1390
 
  gimp_procedure_add_argument (procedure,
1391
 
                               gimp_param_spec_drawable_id ("drawable",
1392
 
                                                            "drawable",
1393
 
                                                            "The drawable to stroke to",
1394
 
                                                            pdb->gimp, FALSE,
1395
 
                                                            GIMP_PARAM_READWRITE));
1396
 
  gimp_procedure_add_argument (procedure,
1397
 
                               gimp_param_spec_vectors_id ("vectors",
1398
 
                                                           "vectors",
1399
 
                                                           "The vectors object",
1400
 
                                                           pdb->gimp, FALSE,
1401
 
                                                           GIMP_PARAM_READWRITE));
1402
 
  gimp_pdb_register_procedure (pdb, procedure);
1403
 
  g_object_unref (procedure);
1404
 
}