1 /* LIBGIMP - The GIMP Library
2 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
3 *
4 * gimpedit_pdb.c
5 *
6 * This library is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see
18 * <https://www.gnu.org/licenses/>.
19 */
20
21 /* NOTE: This file is auto-generated by pdbgen.pl */
22
23 #include "config.h"
24
25 #include "gimp.h"
26
27
28 /**
29 * SECTION: gimpedit
30 * @title: gimpedit
31 * @short_description: Edit menu functions (cut, copy, paste, clear, etc.)
32 *
33 * Edit menu functions (cut, copy, paste, clear, etc.)
34 **/
35
36
37 /**
38 * gimp_edit_cut:
39 * @drawable_ID: The drawable to cut from.
40 *
41 * Cut from the specified drawable.
42 *
43 * If there is a selection in the image, then the area specified by the
44 * selection is cut from the specified drawable and placed in an
45 * internal GIMP edit buffer. It can subsequently be retrieved using
46 * the gimp_edit_paste() command. If there is no selection, then the
47 * specified drawable will be removed and its contents stored in the
48 * internal GIMP edit buffer. This procedure will fail if the selected
49 * area lies completely outside the bounds of the current drawable and
50 * there is nothing to copy from.
51 *
52 * Returns: TRUE if the cut was successful, FALSE if there was nothing
53 * to copy from.
54 **/
55 gboolean
gimp_edit_cut(gint32 drawable_ID)56 gimp_edit_cut (gint32 drawable_ID)
57 {
58 GimpParam *return_vals;
59 gint nreturn_vals;
60 gboolean non_empty = FALSE;
61
62 return_vals = gimp_run_procedure ("gimp-edit-cut",
63 &nreturn_vals,
64 GIMP_PDB_DRAWABLE, drawable_ID,
65 GIMP_PDB_END);
66
67 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
68 non_empty = return_vals[1].data.d_int32;
69
70 gimp_destroy_params (return_vals, nreturn_vals);
71
72 return non_empty;
73 }
74
75 /**
76 * gimp_edit_copy:
77 * @drawable_ID: The drawable to copy from.
78 *
79 * Copy from the specified drawable.
80 *
81 * If there is a selection in the image, then the area specified by the
82 * selection is copied from the specified drawable and placed in an
83 * internal GIMP edit buffer. It can subsequently be retrieved using
84 * the gimp_edit_paste() command. If there is no selection, then the
85 * specified drawable's contents will be stored in the internal GIMP
86 * edit buffer. This procedure will fail if the selected area lies
87 * completely outside the bounds of the current drawable and there is
88 * nothing to copy from.
89 *
90 * Returns: TRUE if the cut was successful, FALSE if there was nothing
91 * to copy from.
92 **/
93 gboolean
gimp_edit_copy(gint32 drawable_ID)94 gimp_edit_copy (gint32 drawable_ID)
95 {
96 GimpParam *return_vals;
97 gint nreturn_vals;
98 gboolean non_empty = FALSE;
99
100 return_vals = gimp_run_procedure ("gimp-edit-copy",
101 &nreturn_vals,
102 GIMP_PDB_DRAWABLE, drawable_ID,
103 GIMP_PDB_END);
104
105 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
106 non_empty = return_vals[1].data.d_int32;
107
108 gimp_destroy_params (return_vals, nreturn_vals);
109
110 return non_empty;
111 }
112
113 /**
114 * gimp_edit_copy_visible:
115 * @image_ID: The image to copy from.
116 *
117 * Copy from the projection.
118 *
119 * If there is a selection in the image, then the area specified by the
120 * selection is copied from the projection and placed in an internal
121 * GIMP edit buffer. It can subsequently be retrieved using the
122 * gimp_edit_paste() command. If there is no selection, then the
123 * projection's contents will be stored in the internal GIMP edit
124 * buffer.
125 *
126 * Returns: TRUE if the copy was successful.
127 *
128 * Since: 2.2
129 **/
130 gboolean
gimp_edit_copy_visible(gint32 image_ID)131 gimp_edit_copy_visible (gint32 image_ID)
132 {
133 GimpParam *return_vals;
134 gint nreturn_vals;
135 gboolean non_empty = FALSE;
136
137 return_vals = gimp_run_procedure ("gimp-edit-copy-visible",
138 &nreturn_vals,
139 GIMP_PDB_IMAGE, image_ID,
140 GIMP_PDB_END);
141
142 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
143 non_empty = return_vals[1].data.d_int32;
144
145 gimp_destroy_params (return_vals, nreturn_vals);
146
147 return non_empty;
148 }
149
150 /**
151 * gimp_edit_paste:
152 * @drawable_ID: The drawable to paste to.
153 * @paste_into: Clear selection, or paste behind it?
154 *
155 * Paste buffer to the specified drawable.
156 *
157 * This procedure pastes a copy of the internal GIMP edit buffer to the
158 * specified drawable. The GIMP edit buffer will be empty unless a call
159 * was previously made to either gimp_edit_cut() or gimp_edit_copy().
160 * The \"paste_into\" option specifies whether to clear the current
161 * image selection, or to paste the buffer \"behind\" the selection.
162 * This allows the selection to act as a mask for the pasted buffer.
163 * Anywhere that the selection mask is non-zero, the pasted buffer will
164 * show through. The pasted buffer will be a new layer in the image
165 * which is designated as the image floating selection. If the image
166 * has a floating selection at the time of pasting, the old floating
167 * selection will be anchored to its drawable before the new floating
168 * selection is added. This procedure returns the new floating layer.
169 * The resulting floating selection will already be attached to the
170 * specified drawable, and a subsequent call to floating_sel_attach is
171 * not needed.
172 *
173 * Returns: The new floating selection.
174 **/
175 gint32
gimp_edit_paste(gint32 drawable_ID,gboolean paste_into)176 gimp_edit_paste (gint32 drawable_ID,
177 gboolean paste_into)
178 {
179 GimpParam *return_vals;
180 gint nreturn_vals;
181 gint32 floating_sel_ID = -1;
182
183 return_vals = gimp_run_procedure ("gimp-edit-paste",
184 &nreturn_vals,
185 GIMP_PDB_DRAWABLE, drawable_ID,
186 GIMP_PDB_INT32, paste_into,
187 GIMP_PDB_END);
188
189 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
190 floating_sel_ID = return_vals[1].data.d_layer;
191
192 gimp_destroy_params (return_vals, nreturn_vals);
193
194 return floating_sel_ID;
195 }
196
197 /**
198 * gimp_edit_paste_as_new_image:
199 *
200 * Paste buffer to a new image.
201 *
202 * This procedure pastes a copy of the internal GIMP edit buffer to a
203 * new image. The GIMP edit buffer will be empty unless a call was
204 * previously made to either gimp_edit_cut() or gimp_edit_copy(). This
205 * procedure returns the new image or -1 if the edit buffer was empty.
206 *
207 * Returns: The new image.
208 *
209 * Since: 2.10
210 **/
211 gint32
gimp_edit_paste_as_new_image(void)212 gimp_edit_paste_as_new_image (void)
213 {
214 GimpParam *return_vals;
215 gint nreturn_vals;
216 gint32 image_ID = -1;
217
218 return_vals = gimp_run_procedure ("gimp-edit-paste-as-new-image",
219 &nreturn_vals,
220 GIMP_PDB_END);
221
222 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
223 image_ID = return_vals[1].data.d_image;
224
225 gimp_destroy_params (return_vals, nreturn_vals);
226
227 return image_ID;
228 }
229
230 /**
231 * gimp_edit_named_cut:
232 * @drawable_ID: The drawable to cut from.
233 * @buffer_name: The name of the buffer to create.
234 *
235 * Cut into a named buffer.
236 *
237 * This procedure works like gimp_edit_cut(), but additionally stores
238 * the cut buffer into a named buffer that will stay available for
239 * later pasting, regardless of any intermediate copy or cut
240 * operations.
241 *
242 * Returns: The real name given to the buffer, or NULL if the cut
243 * failed.
244 *
245 * Since: 2.4
246 **/
247 gchar *
gimp_edit_named_cut(gint32 drawable_ID,const gchar * buffer_name)248 gimp_edit_named_cut (gint32 drawable_ID,
249 const gchar *buffer_name)
250 {
251 GimpParam *return_vals;
252 gint nreturn_vals;
253 gchar *real_name = NULL;
254
255 return_vals = gimp_run_procedure ("gimp-edit-named-cut",
256 &nreturn_vals,
257 GIMP_PDB_DRAWABLE, drawable_ID,
258 GIMP_PDB_STRING, buffer_name,
259 GIMP_PDB_END);
260
261 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
262 real_name = g_strdup (return_vals[1].data.d_string);
263
264 gimp_destroy_params (return_vals, nreturn_vals);
265
266 return real_name;
267 }
268
269 /**
270 * gimp_edit_named_copy:
271 * @drawable_ID: The drawable to copy from.
272 * @buffer_name: The name of the buffer to create.
273 *
274 * Copy into a named buffer.
275 *
276 * This procedure works like gimp_edit_copy(), but additionally stores
277 * the copied buffer into a named buffer that will stay available for
278 * later pasting, regardless of any intermediate copy or cut
279 * operations.
280 *
281 * Returns: The real name given to the buffer, or NULL if the copy
282 * failed.
283 *
284 * Since: 2.4
285 **/
286 gchar *
gimp_edit_named_copy(gint32 drawable_ID,const gchar * buffer_name)287 gimp_edit_named_copy (gint32 drawable_ID,
288 const gchar *buffer_name)
289 {
290 GimpParam *return_vals;
291 gint nreturn_vals;
292 gchar *real_name = NULL;
293
294 return_vals = gimp_run_procedure ("gimp-edit-named-copy",
295 &nreturn_vals,
296 GIMP_PDB_DRAWABLE, drawable_ID,
297 GIMP_PDB_STRING, buffer_name,
298 GIMP_PDB_END);
299
300 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
301 real_name = g_strdup (return_vals[1].data.d_string);
302
303 gimp_destroy_params (return_vals, nreturn_vals);
304
305 return real_name;
306 }
307
308 /**
309 * gimp_edit_named_copy_visible:
310 * @image_ID: The image to copy from.
311 * @buffer_name: The name of the buffer to create.
312 *
313 * Copy from the projection into a named buffer.
314 *
315 * This procedure works like gimp_edit_copy_visible(), but additionally
316 * stores the copied buffer into a named buffer that will stay
317 * available for later pasting, regardless of any intermediate copy or
318 * cut operations.
319 *
320 * Returns: The real name given to the buffer, or NULL if the copy
321 * failed.
322 *
323 * Since: 2.4
324 **/
325 gchar *
gimp_edit_named_copy_visible(gint32 image_ID,const gchar * buffer_name)326 gimp_edit_named_copy_visible (gint32 image_ID,
327 const gchar *buffer_name)
328 {
329 GimpParam *return_vals;
330 gint nreturn_vals;
331 gchar *real_name = NULL;
332
333 return_vals = gimp_run_procedure ("gimp-edit-named-copy-visible",
334 &nreturn_vals,
335 GIMP_PDB_IMAGE, image_ID,
336 GIMP_PDB_STRING, buffer_name,
337 GIMP_PDB_END);
338
339 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
340 real_name = g_strdup (return_vals[1].data.d_string);
341
342 gimp_destroy_params (return_vals, nreturn_vals);
343
344 return real_name;
345 }
346
347 /**
348 * gimp_edit_named_paste:
349 * @drawable_ID: The drawable to paste to.
350 * @buffer_name: The name of the buffer to paste.
351 * @paste_into: Clear selection, or paste behind it?
352 *
353 * Paste named buffer to the specified drawable.
354 *
355 * This procedure works like gimp_edit_paste() but pastes a named
356 * buffer instead of the global buffer.
357 *
358 * Returns: The new floating selection.
359 *
360 * Since: 2.4
361 **/
362 gint32
gimp_edit_named_paste(gint32 drawable_ID,const gchar * buffer_name,gboolean paste_into)363 gimp_edit_named_paste (gint32 drawable_ID,
364 const gchar *buffer_name,
365 gboolean paste_into)
366 {
367 GimpParam *return_vals;
368 gint nreturn_vals;
369 gint32 floating_sel_ID = -1;
370
371 return_vals = gimp_run_procedure ("gimp-edit-named-paste",
372 &nreturn_vals,
373 GIMP_PDB_DRAWABLE, drawable_ID,
374 GIMP_PDB_STRING, buffer_name,
375 GIMP_PDB_INT32, paste_into,
376 GIMP_PDB_END);
377
378 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
379 floating_sel_ID = return_vals[1].data.d_layer;
380
381 gimp_destroy_params (return_vals, nreturn_vals);
382
383 return floating_sel_ID;
384 }
385
386 /**
387 * gimp_edit_named_paste_as_new_image:
388 * @buffer_name: The name of the buffer to paste.
389 *
390 * Paste named buffer to a new image.
391 *
392 * This procedure works like gimp_edit_paste_as_new_image() but pastes
393 * a named buffer instead of the global buffer.
394 *
395 * Returns: The new image.
396 *
397 * Since: 2.10
398 **/
399 gint32
gimp_edit_named_paste_as_new_image(const gchar * buffer_name)400 gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
401 {
402 GimpParam *return_vals;
403 gint nreturn_vals;
404 gint32 image_ID = -1;
405
406 return_vals = gimp_run_procedure ("gimp-edit-named-paste-as-new-image",
407 &nreturn_vals,
408 GIMP_PDB_STRING, buffer_name,
409 GIMP_PDB_END);
410
411 if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
412 image_ID = return_vals[1].data.d_image;
413
414 gimp_destroy_params (return_vals, nreturn_vals);
415
416 return image_ID;
417 }
418
419 /**
420 * gimp_edit_clear:
421 * @drawable_ID: The drawable to clear from.
422 *
423 * Clear selected area of drawable.
424 *
425 * This procedure clears the specified drawable. If the drawable has an
426 * alpha channel, the cleared pixels will become transparent. If the
427 * drawable does not have an alpha channel, cleared pixels will be set
428 * to the background color. This procedure only affects regions within
429 * a selection if there is a selection active.
430 *
431 * Deprecated: Use gimp_drawable_edit_clear() instead.
432 *
433 * Returns: TRUE on success.
434 **/
435 gboolean
gimp_edit_clear(gint32 drawable_ID)436 gimp_edit_clear (gint32 drawable_ID)
437 {
438 GimpParam *return_vals;
439 gint nreturn_vals;
440 gboolean success = TRUE;
441
442 return_vals = gimp_run_procedure ("gimp-edit-clear",
443 &nreturn_vals,
444 GIMP_PDB_DRAWABLE, drawable_ID,
445 GIMP_PDB_END);
446
447 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
448
449 gimp_destroy_params (return_vals, nreturn_vals);
450
451 return success;
452 }
453
454 /**
455 * gimp_edit_fill:
456 * @drawable_ID: The drawable to fill to.
457 * @fill_type: The type of fill.
458 *
459 * Fill selected area of drawable.
460 *
461 * This procedure fills the specified drawable with the fill mode. If
462 * the fill mode is foreground, the current foreground color is used.
463 * If the fill mode is background, the current background color is
464 * used. Other fill modes should not be used. This procedure only
465 * affects regions within a selection if there is a selection active.
466 * If you want to fill the whole drawable, regardless of the selection,
467 * use gimp_drawable_fill().
468 *
469 * Deprecated: Use gimp_drawable_edit_fill() instead.
470 *
471 * Returns: TRUE on success.
472 **/
473 gboolean
gimp_edit_fill(gint32 drawable_ID,GimpFillType fill_type)474 gimp_edit_fill (gint32 drawable_ID,
475 GimpFillType fill_type)
476 {
477 GimpParam *return_vals;
478 gint nreturn_vals;
479 gboolean success = TRUE;
480
481 return_vals = gimp_run_procedure ("gimp-edit-fill",
482 &nreturn_vals,
483 GIMP_PDB_DRAWABLE, drawable_ID,
484 GIMP_PDB_INT32, fill_type,
485 GIMP_PDB_END);
486
487 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
488
489 gimp_destroy_params (return_vals, nreturn_vals);
490
491 return success;
492 }
493
494 /**
495 * gimp_edit_bucket_fill:
496 * @drawable_ID: The affected drawable.
497 * @fill_mode: The type of fill.
498 * @paint_mode: The paint application mode.
499 * @opacity: The opacity of the final bucket fill.
500 * @threshold: 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.
501 * @sample_merged: Use the composite image, not the drawable.
502 * @x: The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
503 * @y: The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
504 *
505 * Fill the area specified either by the current selection if there is
506 * one, or by a seed fill starting at the specified coordinates.
507 *
508 * This tool requires information on the paint application mode, and
509 * the fill mode, which can either be in the foreground color, or in
510 * the currently active pattern. If there is no selection, a seed fill
511 * is executed at the specified coordinates and extends outward in
512 * keeping with the threshold parameter. If there is a selection in the
513 * target image, the threshold, sample merged, x, and y arguments are
514 * unused. If the sample_merged parameter is TRUE, the data of the
515 * composite image will be used instead of that for the specified
516 * drawable. This is equivalent to sampling for colors after merging
517 * all visible layers. In the case of merged sampling, the x and y
518 * coordinates are relative to the image's origin; otherwise, they are
519 * relative to the drawable's origin.
520 *
521 * Deprecated: Use gimp_drawable_edit_bucket_fill() instead.
522 *
523 * Returns: TRUE on success.
524 **/
525 gboolean
gimp_edit_bucket_fill(gint32 drawable_ID,GimpBucketFillMode fill_mode,GimpLayerMode paint_mode,gdouble opacity,gdouble threshold,gboolean sample_merged,gdouble x,gdouble y)526 gimp_edit_bucket_fill (gint32 drawable_ID,
527 GimpBucketFillMode fill_mode,
528 GimpLayerMode paint_mode,
529 gdouble opacity,
530 gdouble threshold,
531 gboolean sample_merged,
532 gdouble x,
533 gdouble y)
534 {
535 GimpParam *return_vals;
536 gint nreturn_vals;
537 gboolean success = TRUE;
538
539 return_vals = gimp_run_procedure ("gimp-edit-bucket-fill",
540 &nreturn_vals,
541 GIMP_PDB_DRAWABLE, drawable_ID,
542 GIMP_PDB_INT32, fill_mode,
543 GIMP_PDB_INT32, paint_mode,
544 GIMP_PDB_FLOAT, opacity,
545 GIMP_PDB_FLOAT, threshold,
546 GIMP_PDB_INT32, sample_merged,
547 GIMP_PDB_FLOAT, x,
548 GIMP_PDB_FLOAT, y,
549 GIMP_PDB_END);
550
551 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
552
553 gimp_destroy_params (return_vals, nreturn_vals);
554
555 return success;
556 }
557
558 /**
559 * gimp_edit_bucket_fill_full:
560 * @drawable_ID: The affected drawable.
561 * @fill_mode: The type of fill.
562 * @paint_mode: The paint application mode.
563 * @opacity: The opacity of the final bucket fill.
564 * @threshold: 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.
565 * @sample_merged: Use the composite image, not the drawable.
566 * @fill_transparent: Whether to consider transparent pixels for filling. If TRUE, transparency is considered as a unique fillable color.
567 * @select_criterion: The criterion used to determine color similarity. SELECT_CRITERION_COMPOSITE is the standard choice.
568 * @x: The x coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
569 * @y: The y coordinate of this bucket fill's application. This parameter is only valid when there is no selection in the specified image.
570 *
571 * Fill the area specified either by the current selection if there is
572 * one, or by a seed fill starting at the specified coordinates.
573 *
574 * This tool requires information on the paint application mode, and
575 * the fill mode, which can either be in the foreground color, or in
576 * the currently active pattern. If there is no selection, a seed fill
577 * is executed at the specified coordinates and extends outward in
578 * keeping with the threshold parameter. If there is a selection in the
579 * target image, the threshold, sample merged, x, and y arguments are
580 * unused. If the sample_merged parameter is TRUE, the data of the
581 * composite image will be used instead of that for the specified
582 * drawable. This is equivalent to sampling for colors after merging
583 * all visible layers. In the case of merged sampling, the x and y
584 * coordinates are relative to the image's origin; otherwise, they are
585 * relative to the drawable's origin.
586 *
587 * Deprecated: Use gimp_drawable_edit_bucket_fill() instead.
588 *
589 * Returns: TRUE on success.
590 *
591 * Since: 2.4
592 **/
593 gboolean
gimp_edit_bucket_fill_full(gint32 drawable_ID,GimpBucketFillMode fill_mode,GimpLayerMode paint_mode,gdouble opacity,gdouble threshold,gboolean sample_merged,gboolean fill_transparent,GimpSelectCriterion select_criterion,gdouble x,gdouble y)594 gimp_edit_bucket_fill_full (gint32 drawable_ID,
595 GimpBucketFillMode fill_mode,
596 GimpLayerMode paint_mode,
597 gdouble opacity,
598 gdouble threshold,
599 gboolean sample_merged,
600 gboolean fill_transparent,
601 GimpSelectCriterion select_criterion,
602 gdouble x,
603 gdouble y)
604 {
605 GimpParam *return_vals;
606 gint nreturn_vals;
607 gboolean success = TRUE;
608
609 return_vals = gimp_run_procedure ("gimp-edit-bucket-fill-full",
610 &nreturn_vals,
611 GIMP_PDB_DRAWABLE, drawable_ID,
612 GIMP_PDB_INT32, fill_mode,
613 GIMP_PDB_INT32, paint_mode,
614 GIMP_PDB_FLOAT, opacity,
615 GIMP_PDB_FLOAT, threshold,
616 GIMP_PDB_INT32, sample_merged,
617 GIMP_PDB_INT32, fill_transparent,
618 GIMP_PDB_INT32, select_criterion,
619 GIMP_PDB_FLOAT, x,
620 GIMP_PDB_FLOAT, y,
621 GIMP_PDB_END);
622
623 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
624
625 gimp_destroy_params (return_vals, nreturn_vals);
626
627 return success;
628 }
629
630 /**
631 * gimp_edit_blend:
632 * @drawable_ID: The affected drawable.
633 * @blend_mode: The type of blend.
634 * @paint_mode: The paint application mode.
635 * @gradient_type: The type of gradient.
636 * @opacity: The opacity of the final blend.
637 * @offset: Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent.
638 * @repeat: Repeat mode.
639 * @reverse: Use the reverse gradient.
640 * @supersample: Do adaptive supersampling.
641 * @max_depth: Maximum recursion levels for supersampling.
642 * @threshold: Supersampling threshold.
643 * @dither: Use dithering to reduce banding.
644 * @x1: The x coordinate of this blend's starting point.
645 * @y1: The y coordinate of this blend's starting point.
646 * @x2: The x coordinate of this blend's ending point.
647 * @y2: The y coordinate of this blend's ending point.
648 *
649 * Blend between the starting and ending coordinates with the specified
650 * blend mode and gradient type.
651 *
652 * This tool requires information on the paint application mode, the
653 * blend mode, and the gradient type. It creates the specified variety
654 * of blend using the starting and ending coordinates as defined for
655 * each gradient type. For shapeburst gradient types, the context's
656 * distance metric is also relevant and can be updated with
657 * gimp_context_set_distance_metric().
658 *
659 * Deprecated: Use gimp_drawable_edit_gradient_fill() instead.
660 *
661 * Returns: TRUE on success.
662 **/
663 gboolean
gimp_edit_blend(gint32 drawable_ID,GimpBlendMode blend_mode,GimpLayerMode paint_mode,GimpGradientType gradient_type,gdouble opacity,gdouble offset,GimpRepeatMode repeat,gboolean reverse,gboolean supersample,gint max_depth,gdouble threshold,gboolean dither,gdouble x1,gdouble y1,gdouble x2,gdouble y2)664 gimp_edit_blend (gint32 drawable_ID,
665 GimpBlendMode blend_mode,
666 GimpLayerMode paint_mode,
667 GimpGradientType gradient_type,
668 gdouble opacity,
669 gdouble offset,
670 GimpRepeatMode repeat,
671 gboolean reverse,
672 gboolean supersample,
673 gint max_depth,
674 gdouble threshold,
675 gboolean dither,
676 gdouble x1,
677 gdouble y1,
678 gdouble x2,
679 gdouble y2)
680 {
681 GimpParam *return_vals;
682 gint nreturn_vals;
683 gboolean success = TRUE;
684
685 return_vals = gimp_run_procedure ("gimp-edit-blend",
686 &nreturn_vals,
687 GIMP_PDB_DRAWABLE, drawable_ID,
688 GIMP_PDB_INT32, blend_mode,
689 GIMP_PDB_INT32, paint_mode,
690 GIMP_PDB_INT32, gradient_type,
691 GIMP_PDB_FLOAT, opacity,
692 GIMP_PDB_FLOAT, offset,
693 GIMP_PDB_INT32, repeat,
694 GIMP_PDB_INT32, reverse,
695 GIMP_PDB_INT32, supersample,
696 GIMP_PDB_INT32, max_depth,
697 GIMP_PDB_FLOAT, threshold,
698 GIMP_PDB_INT32, dither,
699 GIMP_PDB_FLOAT, x1,
700 GIMP_PDB_FLOAT, y1,
701 GIMP_PDB_FLOAT, x2,
702 GIMP_PDB_FLOAT, y2,
703 GIMP_PDB_END);
704
705 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
706
707 gimp_destroy_params (return_vals, nreturn_vals);
708
709 return success;
710 }
711
712 /**
713 * gimp_edit_stroke:
714 * @drawable_ID: The drawable to stroke to.
715 *
716 * Stroke the current selection
717 *
718 * This procedure strokes the current selection, painting along the
719 * selection boundary with the active brush and foreground color. The
720 * paint is applied to the specified drawable regardless of the active
721 * selection.
722 *
723 * Deprecated: Use gimp_drawable_edit_stroke_selection() instead.
724 *
725 * Returns: TRUE on success.
726 **/
727 gboolean
gimp_edit_stroke(gint32 drawable_ID)728 gimp_edit_stroke (gint32 drawable_ID)
729 {
730 GimpParam *return_vals;
731 gint nreturn_vals;
732 gboolean success = TRUE;
733
734 return_vals = gimp_run_procedure ("gimp-edit-stroke",
735 &nreturn_vals,
736 GIMP_PDB_DRAWABLE, drawable_ID,
737 GIMP_PDB_END);
738
739 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
740
741 gimp_destroy_params (return_vals, nreturn_vals);
742
743 return success;
744 }
745
746 /**
747 * gimp_edit_stroke_vectors:
748 * @drawable_ID: The drawable to stroke to.
749 * @vectors_ID: The vectors object.
750 *
751 * Stroke the specified vectors object
752 *
753 * This procedure strokes the specified vectors object, painting along
754 * the path with the active brush and foreground color.
755 *
756 * Deprecated: Use gimp_drawable_edit_stroke_item() instead.
757 *
758 * Returns: TRUE on success.
759 *
760 * Since: 2.4
761 **/
762 gboolean
gimp_edit_stroke_vectors(gint32 drawable_ID,gint32 vectors_ID)763 gimp_edit_stroke_vectors (gint32 drawable_ID,
764 gint32 vectors_ID)
765 {
766 GimpParam *return_vals;
767 gint nreturn_vals;
768 gboolean success = TRUE;
769
770 return_vals = gimp_run_procedure ("gimp-edit-stroke-vectors",
771 &nreturn_vals,
772 GIMP_PDB_DRAWABLE, drawable_ID,
773 GIMP_PDB_VECTORS, vectors_ID,
774 GIMP_PDB_END);
775
776 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
777
778 gimp_destroy_params (return_vals, nreturn_vals);
779
780 return success;
781 }
782