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

« back to all changes in this revision

Viewing changes to libgimp/gimpgradient_pdb.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * Boston, MA 02111-1307, USA.
20
20
 */
21
21
 
22
 
/* NOTE: This file is autogenerated by pdbgen.pl */
 
22
/* NOTE: This file is auto-generated by pdbgen.pl */
23
23
 
24
24
#include "config.h"
25
25
 
44
44
{
45
45
  GimpParam *return_vals;
46
46
  gint nreturn_vals;
47
 
  gchar *ret_name = NULL;
 
47
  gchar *actual_name = NULL;
48
48
 
49
 
  return_vals = gimp_run_procedure ("gimp_gradient_new",
50
 
                                    &nreturn_vals,
51
 
                                    GIMP_PDB_STRING, name,
52
 
                                    GIMP_PDB_END);
 
49
  return_vals = gimp_run_procedure ("gimp-gradient-new",
 
50
                                    &nreturn_vals,
 
51
                                    GIMP_PDB_STRING, name,
 
52
                                    GIMP_PDB_END);
53
53
 
54
54
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
55
 
    ret_name = g_strdup (return_vals[1].data.d_string);
 
55
    actual_name = g_strdup (return_vals[1].data.d_string);
56
56
 
57
57
  gimp_destroy_params (return_vals, nreturn_vals);
58
58
 
59
 
  return ret_name;
 
59
  return actual_name;
60
60
}
61
61
 
62
62
/**
76
76
{
77
77
  GimpParam *return_vals;
78
78
  gint nreturn_vals;
79
 
  gchar *ret_name = NULL;
80
 
 
81
 
  return_vals = gimp_run_procedure ("gimp_gradient_duplicate",
82
 
                                    &nreturn_vals,
83
 
                                    GIMP_PDB_STRING, name,
84
 
                                    GIMP_PDB_END);
85
 
 
86
 
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
87
 
    ret_name = g_strdup (return_vals[1].data.d_string);
88
 
 
89
 
  gimp_destroy_params (return_vals, nreturn_vals);
90
 
 
91
 
  return ret_name;
 
79
  gchar *copy_name = NULL;
 
80
 
 
81
  return_vals = gimp_run_procedure ("gimp-gradient-duplicate",
 
82
                                    &nreturn_vals,
 
83
                                    GIMP_PDB_STRING, name,
 
84
                                    GIMP_PDB_END);
 
85
 
 
86
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
87
    copy_name = g_strdup (return_vals[1].data.d_string);
 
88
 
 
89
  gimp_destroy_params (return_vals, nreturn_vals);
 
90
 
 
91
  return copy_name;
 
92
}
 
93
 
 
94
/**
 
95
 * gimp_gradient_is_editable:
 
96
 * @name: The gradient name.
 
97
 *
 
98
 * Tests if gradient can be edited
 
99
 *
 
100
 * Returns TRUE if you have permission to change the gradient
 
101
 *
 
102
 * Returns: TRUE if the gradient can be edited.
 
103
 *
 
104
 * Since: GIMP 2.4
 
105
 */
 
106
gboolean
 
107
gimp_gradient_is_editable (const gchar *name)
 
108
{
 
109
  GimpParam *return_vals;
 
110
  gint nreturn_vals;
 
111
  gboolean editable = FALSE;
 
112
 
 
113
  return_vals = gimp_run_procedure ("gimp-gradient-is-editable",
 
114
                                    &nreturn_vals,
 
115
                                    GIMP_PDB_STRING, name,
 
116
                                    GIMP_PDB_END);
 
117
 
 
118
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
119
    editable = return_vals[1].data.d_int32;
 
120
 
 
121
  gimp_destroy_params (return_vals, nreturn_vals);
 
122
 
 
123
  return editable;
92
124
}
93
125
 
94
126
/**
106
138
 */
107
139
gchar *
108
140
gimp_gradient_rename (const gchar *name,
109
 
                      const gchar *new_name)
 
141
                      const gchar *new_name)
110
142
{
111
143
  GimpParam *return_vals;
112
144
  gint nreturn_vals;
113
 
  gchar *ret_name = NULL;
 
145
  gchar *actual_name = NULL;
114
146
 
115
 
  return_vals = gimp_run_procedure ("gimp_gradient_rename",
116
 
                                    &nreturn_vals,
117
 
                                    GIMP_PDB_STRING, name,
118
 
                                    GIMP_PDB_STRING, new_name,
119
 
                                    GIMP_PDB_END);
 
147
  return_vals = gimp_run_procedure ("gimp-gradient-rename",
 
148
                                    &nreturn_vals,
 
149
                                    GIMP_PDB_STRING, name,
 
150
                                    GIMP_PDB_STRING, new_name,
 
151
                                    GIMP_PDB_END);
120
152
 
121
153
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
122
 
    ret_name = g_strdup (return_vals[1].data.d_string);
 
154
    actual_name = g_strdup (return_vals[1].data.d_string);
123
155
 
124
156
  gimp_destroy_params (return_vals, nreturn_vals);
125
157
 
126
 
  return ret_name;
 
158
  return actual_name;
127
159
}
128
160
 
129
161
/**
145
177
  gint nreturn_vals;
146
178
  gboolean success = TRUE;
147
179
 
148
 
  return_vals = gimp_run_procedure ("gimp_gradient_delete",
149
 
                                    &nreturn_vals,
150
 
                                    GIMP_PDB_STRING, name,
151
 
                                    GIMP_PDB_END);
 
180
  return_vals = gimp_run_procedure ("gimp-gradient-delete",
 
181
                                    &nreturn_vals,
 
182
                                    GIMP_PDB_STRING, name,
 
183
                                    GIMP_PDB_END);
152
184
 
153
185
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
154
186
 
181
213
 */
182
214
gboolean
183
215
gimp_gradient_get_uniform_samples (const gchar  *name,
184
 
                                   gint          num_samples,
185
 
                                   gboolean      reverse,
186
 
                                   gint         *num_color_samples,
187
 
                                   gdouble     **color_samples)
 
216
                                   gint          num_samples,
 
217
                                   gboolean      reverse,
 
218
                                   gint         *num_color_samples,
 
219
                                   gdouble     **color_samples)
188
220
{
189
221
  GimpParam *return_vals;
190
222
  gint nreturn_vals;
191
223
  gboolean success = TRUE;
192
224
 
193
 
  return_vals = gimp_run_procedure ("gimp_gradient_get_uniform_samples",
194
 
                                    &nreturn_vals,
195
 
                                    GIMP_PDB_STRING, name,
196
 
                                    GIMP_PDB_INT32, num_samples,
197
 
                                    GIMP_PDB_INT32, reverse,
198
 
                                    GIMP_PDB_END);
 
225
  return_vals = gimp_run_procedure ("gimp-gradient-get-uniform-samples",
 
226
                                    &nreturn_vals,
 
227
                                    GIMP_PDB_STRING, name,
 
228
                                    GIMP_PDB_INT32, num_samples,
 
229
                                    GIMP_PDB_INT32, reverse,
 
230
                                    GIMP_PDB_END);
199
231
 
200
232
  *num_color_samples = 0;
201
233
  *color_samples = NULL;
206
238
    {
207
239
      *num_color_samples = return_vals[1].data.d_int32;
208
240
      *color_samples = g_new (gdouble, *num_color_samples);
209
 
      memcpy (*color_samples, return_vals[2].data.d_floatarray,
210
 
              *num_color_samples * sizeof (gdouble));
 
241
      memcpy (*color_samples,
 
242
              return_vals[2].data.d_floatarray,
 
243
              *num_color_samples * sizeof (gdouble));
211
244
    }
212
245
 
213
246
  gimp_destroy_params (return_vals, nreturn_vals);
239
272
 */
240
273
gboolean
241
274
gimp_gradient_get_custom_samples (const gchar    *name,
242
 
                                  gint            num_samples,
243
 
                                  const gdouble  *positions,
244
 
                                  gboolean        reverse,
245
 
                                  gint           *num_color_samples,
246
 
                                  gdouble       **color_samples)
 
275
                                  gint            num_samples,
 
276
                                  const gdouble  *positions,
 
277
                                  gboolean        reverse,
 
278
                                  gint           *num_color_samples,
 
279
                                  gdouble       **color_samples)
247
280
{
248
281
  GimpParam *return_vals;
249
282
  gint nreturn_vals;
250
283
  gboolean success = TRUE;
251
284
 
252
 
  return_vals = gimp_run_procedure ("gimp_gradient_get_custom_samples",
253
 
                                    &nreturn_vals,
254
 
                                    GIMP_PDB_STRING, name,
255
 
                                    GIMP_PDB_INT32, num_samples,
256
 
                                    GIMP_PDB_FLOATARRAY, positions,
257
 
                                    GIMP_PDB_INT32, reverse,
258
 
                                    GIMP_PDB_END);
 
285
  return_vals = gimp_run_procedure ("gimp-gradient-get-custom-samples",
 
286
                                    &nreturn_vals,
 
287
                                    GIMP_PDB_STRING, name,
 
288
                                    GIMP_PDB_INT32, num_samples,
 
289
                                    GIMP_PDB_FLOATARRAY, positions,
 
290
                                    GIMP_PDB_INT32, reverse,
 
291
                                    GIMP_PDB_END);
259
292
 
260
293
  *num_color_samples = 0;
261
294
  *color_samples = NULL;
266
299
    {
267
300
      *num_color_samples = return_vals[1].data.d_int32;
268
301
      *color_samples = g_new (gdouble, *num_color_samples);
269
 
      memcpy (*color_samples, return_vals[2].data.d_floatarray,
270
 
              *num_color_samples * sizeof (gdouble));
 
302
      memcpy (*color_samples,
 
303
              return_vals[2].data.d_floatarray,
 
304
              *num_color_samples * sizeof (gdouble));
271
305
    }
272
306
 
273
307
  gimp_destroy_params (return_vals, nreturn_vals);
282
316
 * @color: The return color.
283
317
 * @opacity: The opacity of the endpoint.
284
318
 *
285
 
 * Retrieves the left endpoint color of the specified gradient and
286
 
 * segment
 
319
 * Retrieves the left endpoint color of the specified segment
287
320
 *
288
321
 * This procedure retrieves the left endpoint color of the specified
289
322
 * segment of the specified gradient.
294
327
 */
295
328
gboolean
296
329
gimp_gradient_segment_get_left_color (const gchar *name,
297
 
                                      gint         segment,
298
 
                                      GimpRGB     *color,
299
 
                                      gdouble     *opacity)
 
330
                                      gint         segment,
 
331
                                      GimpRGB     *color,
 
332
                                      gdouble     *opacity)
300
333
{
301
334
  GimpParam *return_vals;
302
335
  gint nreturn_vals;
303
336
  gboolean success = TRUE;
304
337
 
305
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_get_left_color",
306
 
                                    &nreturn_vals,
307
 
                                    GIMP_PDB_STRING, name,
308
 
                                    GIMP_PDB_INT32, segment,
309
 
                                    GIMP_PDB_END);
 
338
  return_vals = gimp_run_procedure ("gimp-gradient-segment-get-left-color",
 
339
                                    &nreturn_vals,
 
340
                                    GIMP_PDB_STRING, name,
 
341
                                    GIMP_PDB_INT32, segment,
 
342
                                    GIMP_PDB_END);
310
343
 
311
344
  *opacity = 0.0;
312
345
 
330
363
 * @color: The color to set.
331
364
 * @opacity: The opacity to set for the endpoint.
332
365
 *
333
 
 * Retrieves the left endpoint color of the specified gradient and
334
 
 * segment
 
366
 * Sets the left endpoint color of the specified segment
335
367
 *
336
 
 * This procedure retrieves the left endpoint color of the specified
337
 
 * segment of the specified gradient.
 
368
 * This procedure sets the left endpoint color of the specified segment
 
369
 * of the specified gradient.
338
370
 *
339
371
 * Returns: TRUE on success.
340
372
 *
342
374
 */
343
375
gboolean
344
376
gimp_gradient_segment_set_left_color (const gchar   *name,
345
 
                                      gint           segment,
346
 
                                      const GimpRGB *color,
347
 
                                      gdouble        opacity)
 
377
                                      gint           segment,
 
378
                                      const GimpRGB *color,
 
379
                                      gdouble        opacity)
348
380
{
349
381
  GimpParam *return_vals;
350
382
  gint nreturn_vals;
351
383
  gboolean success = TRUE;
352
384
 
353
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_set_left_color",
354
 
                                    &nreturn_vals,
355
 
                                    GIMP_PDB_STRING, name,
356
 
                                    GIMP_PDB_INT32, segment,
357
 
                                    GIMP_PDB_COLOR, color,
358
 
                                    GIMP_PDB_FLOAT, opacity,
359
 
                                    GIMP_PDB_END);
 
385
  return_vals = gimp_run_procedure ("gimp-gradient-segment-set-left-color",
 
386
                                    &nreturn_vals,
 
387
                                    GIMP_PDB_STRING, name,
 
388
                                    GIMP_PDB_INT32, segment,
 
389
                                    GIMP_PDB_COLOR, color,
 
390
                                    GIMP_PDB_FLOAT, opacity,
 
391
                                    GIMP_PDB_END);
360
392
 
361
393
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
362
394
 
372
404
 * @color: The return color.
373
405
 * @opacity: The opacity of the endpoint.
374
406
 *
375
 
 * Retrieves the right endpoint color of the specified gradient and
376
 
 * segment
 
407
 * Retrieves the right endpoint color of the specified segment
377
408
 *
378
409
 * This procedure retrieves the right endpoint color of the specified
379
410
 * segment of the specified gradient.
384
415
 */
385
416
gboolean
386
417
gimp_gradient_segment_get_right_color (const gchar *name,
387
 
                                       gint         segment,
388
 
                                       GimpRGB     *color,
389
 
                                       gdouble     *opacity)
 
418
                                       gint         segment,
 
419
                                       GimpRGB     *color,
 
420
                                       gdouble     *opacity)
390
421
{
391
422
  GimpParam *return_vals;
392
423
  gint nreturn_vals;
393
424
  gboolean success = TRUE;
394
425
 
395
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_get_right_color",
396
 
                                    &nreturn_vals,
397
 
                                    GIMP_PDB_STRING, name,
398
 
                                    GIMP_PDB_INT32, segment,
399
 
                                    GIMP_PDB_END);
 
426
  return_vals = gimp_run_procedure ("gimp-gradient-segment-get-right-color",
 
427
                                    &nreturn_vals,
 
428
                                    GIMP_PDB_STRING, name,
 
429
                                    GIMP_PDB_INT32, segment,
 
430
                                    GIMP_PDB_END);
400
431
 
401
432
  *opacity = 0.0;
402
433
 
420
451
 * @color: The color to set.
421
452
 * @opacity: The opacity to set for the endpoint.
422
453
 *
423
 
 * Retrieves the right endpoint color of the specified gradient and
424
 
 * segment
 
454
 * Sets the right endpoint color of the specified segment
425
455
 *
426
 
 * This procedure retrieves the right endpoint color of the specified
 
456
 * This procedure sets the right endpoint color of the specified
427
457
 * segment of the specified gradient.
428
458
 *
429
459
 * Returns: TRUE on success.
432
462
 */
433
463
gboolean
434
464
gimp_gradient_segment_set_right_color (const gchar   *name,
435
 
                                       gint           segment,
436
 
                                       const GimpRGB *color,
437
 
                                       gdouble        opacity)
 
465
                                       gint           segment,
 
466
                                       const GimpRGB *color,
 
467
                                       gdouble        opacity)
438
468
{
439
469
  GimpParam *return_vals;
440
470
  gint nreturn_vals;
441
471
  gboolean success = TRUE;
442
472
 
443
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_set_right_color",
444
 
                                    &nreturn_vals,
445
 
                                    GIMP_PDB_STRING, name,
446
 
                                    GIMP_PDB_INT32, segment,
447
 
                                    GIMP_PDB_COLOR, color,
448
 
                                    GIMP_PDB_FLOAT, opacity,
449
 
                                    GIMP_PDB_END);
 
473
  return_vals = gimp_run_procedure ("gimp-gradient-segment-set-right-color",
 
474
                                    &nreturn_vals,
 
475
                                    GIMP_PDB_STRING, name,
 
476
                                    GIMP_PDB_INT32, segment,
 
477
                                    GIMP_PDB_COLOR, color,
 
478
                                    GIMP_PDB_FLOAT, opacity,
 
479
                                    GIMP_PDB_END);
450
480
 
451
481
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
452
482
 
461
491
 * @segment: The index of the segment within the gradient.
462
492
 * @pos: The return position.
463
493
 *
464
 
 * Retrieves the left endpoint position of the specified gradient and
465
 
 * segment
 
494
 * Retrieves the left endpoint position of the specified segment
466
495
 *
467
496
 * This procedure retrieves the left endpoint position of the specified
468
497
 * segment of the specified gradient.
473
502
 */
474
503
gboolean
475
504
gimp_gradient_segment_get_left_pos (const gchar *name,
476
 
                                    gint         segment,
477
 
                                    gdouble     *pos)
 
505
                                    gint         segment,
 
506
                                    gdouble     *pos)
478
507
{
479
508
  GimpParam *return_vals;
480
509
  gint nreturn_vals;
481
510
  gboolean success = TRUE;
482
511
 
483
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_get_left_pos",
484
 
                                    &nreturn_vals,
485
 
                                    GIMP_PDB_STRING, name,
486
 
                                    GIMP_PDB_INT32, segment,
487
 
                                    GIMP_PDB_END);
 
512
  return_vals = gimp_run_procedure ("gimp-gradient-segment-get-left-pos",
 
513
                                    &nreturn_vals,
 
514
                                    GIMP_PDB_STRING, name,
 
515
                                    GIMP_PDB_INT32, segment,
 
516
                                    GIMP_PDB_END);
488
517
 
489
518
  *pos = 0.0;
490
519
 
502
531
 * gimp_gradient_segment_set_left_pos:
503
532
 * @name: The gradient name.
504
533
 * @segment: The index of the segment within the gradient.
505
 
 * @pos: The position to set the guidepoint in.
 
534
 * @pos: The position to set the guidepoint to.
506
535
 * @final_pos: The return position.
507
536
 *
508
 
 * Sets the left endpoint position of the specified gradient and
509
 
 * segment
 
537
 * Sets the left endpoint position of the specified segment
510
538
 *
511
539
 * This procedure sets the left endpoint position of the specified
512
540
 * segment of the specified gradient. The final position will be
520
548
 */
521
549
gboolean
522
550
gimp_gradient_segment_set_left_pos (const gchar *name,
523
 
                                    gint         segment,
524
 
                                    gdouble      pos,
525
 
                                    gdouble     *final_pos)
 
551
                                    gint         segment,
 
552
                                    gdouble      pos,
 
553
                                    gdouble     *final_pos)
526
554
{
527
555
  GimpParam *return_vals;
528
556
  gint nreturn_vals;
529
557
  gboolean success = TRUE;
530
558
 
531
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_set_left_pos",
532
 
                                    &nreturn_vals,
533
 
                                    GIMP_PDB_STRING, name,
534
 
                                    GIMP_PDB_INT32, segment,
535
 
                                    GIMP_PDB_FLOAT, pos,
536
 
                                    GIMP_PDB_END);
 
559
  return_vals = gimp_run_procedure ("gimp-gradient-segment-set-left-pos",
 
560
                                    &nreturn_vals,
 
561
                                    GIMP_PDB_STRING, name,
 
562
                                    GIMP_PDB_INT32, segment,
 
563
                                    GIMP_PDB_FLOAT, pos,
 
564
                                    GIMP_PDB_END);
537
565
 
538
566
  *final_pos = 0.0;
539
567
 
553
581
 * @segment: The index of the segment within the gradient.
554
582
 * @pos: The return position.
555
583
 *
556
 
 * Retrieves the middle point position of the specified gradient and
557
 
 * segment
 
584
 * Retrieves the middle point position of the specified segment
558
585
 *
559
586
 * This procedure retrieves the middle point position of the specified
560
587
 * segment of the specified gradient.
565
592
 */
566
593
gboolean
567
594
gimp_gradient_segment_get_middle_pos (const gchar *name,
568
 
                                      gint         segment,
569
 
                                      gdouble     *pos)
 
595
                                      gint         segment,
 
596
                                      gdouble     *pos)
570
597
{
571
598
  GimpParam *return_vals;
572
599
  gint nreturn_vals;
573
600
  gboolean success = TRUE;
574
601
 
575
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_get_middle_pos",
576
 
                                    &nreturn_vals,
577
 
                                    GIMP_PDB_STRING, name,
578
 
                                    GIMP_PDB_INT32, segment,
579
 
                                    GIMP_PDB_END);
 
602
  return_vals = gimp_run_procedure ("gimp-gradient-segment-get-middle-pos",
 
603
                                    &nreturn_vals,
 
604
                                    GIMP_PDB_STRING, name,
 
605
                                    GIMP_PDB_INT32, segment,
 
606
                                    GIMP_PDB_END);
580
607
 
581
608
  *pos = 0.0;
582
609
 
594
621
 * gimp_gradient_segment_set_middle_pos:
595
622
 * @name: The gradient name.
596
623
 * @segment: The index of the segment within the gradient.
597
 
 * @pos: The position to set the guidepoint in.
 
624
 * @pos: The position to set the guidepoint to.
598
625
 * @final_pos: The return position.
599
626
 *
600
 
 * Sets the middle point position of the specified gradient and segment
 
627
 * Sets the middle point position of the specified segment
601
628
 *
602
629
 * This procedure sets the middle point position of the specified
603
630
 * segment of the specified gradient. The final position will be
610
637
 */
611
638
gboolean
612
639
gimp_gradient_segment_set_middle_pos (const gchar *name,
613
 
                                      gint         segment,
614
 
                                      gdouble      pos,
615
 
                                      gdouble     *final_pos)
 
640
                                      gint         segment,
 
641
                                      gdouble      pos,
 
642
                                      gdouble     *final_pos)
616
643
{
617
644
  GimpParam *return_vals;
618
645
  gint nreturn_vals;
619
646
  gboolean success = TRUE;
620
647
 
621
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_set_middle_pos",
622
 
                                    &nreturn_vals,
623
 
                                    GIMP_PDB_STRING, name,
624
 
                                    GIMP_PDB_INT32, segment,
625
 
                                    GIMP_PDB_FLOAT, pos,
626
 
                                    GIMP_PDB_END);
 
648
  return_vals = gimp_run_procedure ("gimp-gradient-segment-set-middle-pos",
 
649
                                    &nreturn_vals,
 
650
                                    GIMP_PDB_STRING, name,
 
651
                                    GIMP_PDB_INT32, segment,
 
652
                                    GIMP_PDB_FLOAT, pos,
 
653
                                    GIMP_PDB_END);
627
654
 
628
655
  *final_pos = 0.0;
629
656
 
643
670
 * @segment: The index of the segment within the gradient.
644
671
 * @pos: The return position.
645
672
 *
646
 
 * Retrieves the right endpoint position of the specified gradient and
647
 
 * segment
 
673
 * Retrieves the right endpoint position of the specified segment
648
674
 *
649
675
 * This procedure retrieves the right endpoint position of the
650
676
 * specified segment of the specified gradient.
655
681
 */
656
682
gboolean
657
683
gimp_gradient_segment_get_right_pos (const gchar *name,
658
 
                                     gint         segment,
659
 
                                     gdouble     *pos)
 
684
                                     gint         segment,
 
685
                                     gdouble     *pos)
660
686
{
661
687
  GimpParam *return_vals;
662
688
  gint nreturn_vals;
663
689
  gboolean success = TRUE;
664
690
 
665
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_get_right_pos",
666
 
                                    &nreturn_vals,
667
 
                                    GIMP_PDB_STRING, name,
668
 
                                    GIMP_PDB_INT32, segment,
669
 
                                    GIMP_PDB_END);
 
691
  return_vals = gimp_run_procedure ("gimp-gradient-segment-get-right-pos",
 
692
                                    &nreturn_vals,
 
693
                                    GIMP_PDB_STRING, name,
 
694
                                    GIMP_PDB_INT32, segment,
 
695
                                    GIMP_PDB_END);
670
696
 
671
697
  *pos = 0.0;
672
698
 
684
710
 * gimp_gradient_segment_set_right_pos:
685
711
 * @name: The gradient name.
686
712
 * @segment: The index of the segment within the gradient.
687
 
 * @pos: The position to set the guidepoint in.
 
713
 * @pos: The position to set the guidepoint to.
688
714
 * @final_pos: The return position.
689
715
 *
690
 
 * Sets the right endpoint position of the specified gradient and
691
 
 * segment
 
716
 * Sets the right endpoint position of the specified segment
692
717
 *
693
718
 * This procedure sets the right endpoint position of the specified
694
719
 * segment of the specified gradient. The final position will be
702
727
 */
703
728
gboolean
704
729
gimp_gradient_segment_set_right_pos (const gchar *name,
705
 
                                     gint         segment,
706
 
                                     gdouble      pos,
707
 
                                     gdouble     *final_pos)
 
730
                                     gint         segment,
 
731
                                     gdouble      pos,
 
732
                                     gdouble     *final_pos)
708
733
{
709
734
  GimpParam *return_vals;
710
735
  gint nreturn_vals;
711
736
  gboolean success = TRUE;
712
737
 
713
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_set_right_pos",
714
 
                                    &nreturn_vals,
715
 
                                    GIMP_PDB_STRING, name,
716
 
                                    GIMP_PDB_INT32, segment,
717
 
                                    GIMP_PDB_FLOAT, pos,
718
 
                                    GIMP_PDB_END);
 
738
  return_vals = gimp_run_procedure ("gimp-gradient-segment-set-right-pos",
 
739
                                    &nreturn_vals,
 
740
                                    GIMP_PDB_STRING, name,
 
741
                                    GIMP_PDB_INT32, segment,
 
742
                                    GIMP_PDB_FLOAT, pos,
 
743
                                    GIMP_PDB_END);
719
744
 
720
745
  *final_pos = 0.0;
721
746
 
746
771
 */
747
772
gboolean
748
773
gimp_gradient_segment_get_blending_function (const gchar             *name,
749
 
                                             gint                     segment,
750
 
                                             GimpGradientSegmentType *blend_func)
 
774
                                             gint                     segment,
 
775
                                             GimpGradientSegmentType *blend_func)
751
776
{
752
777
  GimpParam *return_vals;
753
778
  gint nreturn_vals;
754
779
  gboolean success = TRUE;
755
780
 
756
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_get_blending_function",
757
 
                                    &nreturn_vals,
758
 
                                    GIMP_PDB_STRING, name,
759
 
                                    GIMP_PDB_INT32, segment,
760
 
                                    GIMP_PDB_END);
 
781
  return_vals = gimp_run_procedure ("gimp-gradient-segment-get-blending-function",
 
782
                                    &nreturn_vals,
 
783
                                    GIMP_PDB_STRING, name,
 
784
                                    GIMP_PDB_INT32, segment,
 
785
                                    GIMP_PDB_END);
761
786
 
762
787
  *blend_func = 0;
763
788
 
788
813
 */
789
814
gboolean
790
815
gimp_gradient_segment_get_coloring_type (const gchar              *name,
791
 
                                         gint                      segment,
792
 
                                         GimpGradientSegmentColor *coloring_type)
 
816
                                         gint                      segment,
 
817
                                         GimpGradientSegmentColor *coloring_type)
793
818
{
794
819
  GimpParam *return_vals;
795
820
  gint nreturn_vals;
796
821
  gboolean success = TRUE;
797
822
 
798
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_get_coloring_type",
799
 
                                    &nreturn_vals,
800
 
                                    GIMP_PDB_STRING, name,
801
 
                                    GIMP_PDB_INT32, segment,
802
 
                                    GIMP_PDB_END);
 
823
  return_vals = gimp_run_procedure ("gimp-gradient-segment-get-coloring-type",
 
824
                                    &nreturn_vals,
 
825
                                    GIMP_PDB_STRING, name,
 
826
                                    GIMP_PDB_INT32, segment,
 
827
                                    GIMP_PDB_END);
803
828
 
804
829
  *coloring_type = 0;
805
830
 
818
843
 * @name: The gradient name.
819
844
 * @start_segment: The index of the first segment to operate on.
820
845
 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
821
 
 * @blending_function: The Blending Function.
 
846
 * @blending_function: The blending function.
822
847
 *
823
848
 * Change the blending function of a segments range
824
849
 *
831
856
 */
832
857
gboolean
833
858
gimp_gradient_segment_range_set_blending_function (const gchar             *name,
834
 
                                                   gint                     start_segment,
835
 
                                                   gint                     end_segment,
836
 
                                                   GimpGradientSegmentType  blending_function)
 
859
                                                   gint                     start_segment,
 
860
                                                   gint                     end_segment,
 
861
                                                   GimpGradientSegmentType  blending_function)
837
862
{
838
863
  GimpParam *return_vals;
839
864
  gint nreturn_vals;
840
865
  gboolean success = TRUE;
841
866
 
842
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_set_blending_function",
843
 
                                    &nreturn_vals,
844
 
                                    GIMP_PDB_STRING, name,
845
 
                                    GIMP_PDB_INT32, start_segment,
846
 
                                    GIMP_PDB_INT32, end_segment,
847
 
                                    GIMP_PDB_INT32, blending_function,
848
 
                                    GIMP_PDB_END);
 
867
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-set-blending-function",
 
868
                                    &nreturn_vals,
 
869
                                    GIMP_PDB_STRING, name,
 
870
                                    GIMP_PDB_INT32, start_segment,
 
871
                                    GIMP_PDB_INT32, end_segment,
 
872
                                    GIMP_PDB_INT32, blending_function,
 
873
                                    GIMP_PDB_END);
849
874
 
850
875
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
851
876
 
859
884
 * @name: The gradient name.
860
885
 * @start_segment: The index of the first segment to operate on.
861
886
 * @end_segment: The index of the last segment to operate on. If negative, the selection will extend to the end of the string.
862
 
 * @coloring_type: The Coloring Type.
 
887
 * @coloring_type: The coloring type.
863
888
 *
864
889
 * Change the coloring type of a segments range
865
890
 *
872
897
 */
873
898
gboolean
874
899
gimp_gradient_segment_range_set_coloring_type (const gchar              *name,
875
 
                                               gint                      start_segment,
876
 
                                               gint                      end_segment,
877
 
                                               GimpGradientSegmentColor  coloring_type)
 
900
                                               gint                      start_segment,
 
901
                                               gint                      end_segment,
 
902
                                               GimpGradientSegmentColor  coloring_type)
878
903
{
879
904
  GimpParam *return_vals;
880
905
  gint nreturn_vals;
881
906
  gboolean success = TRUE;
882
907
 
883
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_set_coloring_type",
884
 
                                    &nreturn_vals,
885
 
                                    GIMP_PDB_STRING, name,
886
 
                                    GIMP_PDB_INT32, start_segment,
887
 
                                    GIMP_PDB_INT32, end_segment,
888
 
                                    GIMP_PDB_INT32, coloring_type,
889
 
                                    GIMP_PDB_END);
 
908
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-set-coloring-type",
 
909
                                    &nreturn_vals,
 
910
                                    GIMP_PDB_STRING, name,
 
911
                                    GIMP_PDB_INT32, start_segment,
 
912
                                    GIMP_PDB_INT32, end_segment,
 
913
                                    GIMP_PDB_INT32, coloring_type,
 
914
                                    GIMP_PDB_END);
890
915
 
891
916
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
892
917
 
911
936
 */
912
937
gboolean
913
938
gimp_gradient_segment_range_flip (const gchar *name,
914
 
                                  gint         start_segment,
915
 
                                  gint         end_segment)
 
939
                                  gint         start_segment,
 
940
                                  gint         end_segment)
916
941
{
917
942
  GimpParam *return_vals;
918
943
  gint nreturn_vals;
919
944
  gboolean success = TRUE;
920
945
 
921
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_flip",
922
 
                                    &nreturn_vals,
923
 
                                    GIMP_PDB_STRING, name,
924
 
                                    GIMP_PDB_INT32, start_segment,
925
 
                                    GIMP_PDB_INT32, end_segment,
926
 
                                    GIMP_PDB_END);
 
946
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-flip",
 
947
                                    &nreturn_vals,
 
948
                                    GIMP_PDB_STRING, name,
 
949
                                    GIMP_PDB_INT32, start_segment,
 
950
                                    GIMP_PDB_INT32, end_segment,
 
951
                                    GIMP_PDB_END);
927
952
 
928
953
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
929
954
 
951
976
 */
952
977
gboolean
953
978
gimp_gradient_segment_range_replicate (const gchar *name,
954
 
                                       gint         start_segment,
955
 
                                       gint         end_segment,
956
 
                                       gint         replicate_times)
 
979
                                       gint         start_segment,
 
980
                                       gint         end_segment,
 
981
                                       gint         replicate_times)
957
982
{
958
983
  GimpParam *return_vals;
959
984
  gint nreturn_vals;
960
985
  gboolean success = TRUE;
961
986
 
962
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_replicate",
963
 
                                    &nreturn_vals,
964
 
                                    GIMP_PDB_STRING, name,
965
 
                                    GIMP_PDB_INT32, start_segment,
966
 
                                    GIMP_PDB_INT32, end_segment,
967
 
                                    GIMP_PDB_INT32, replicate_times,
968
 
                                    GIMP_PDB_END);
 
987
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-replicate",
 
988
                                    &nreturn_vals,
 
989
                                    GIMP_PDB_STRING, name,
 
990
                                    GIMP_PDB_INT32, start_segment,
 
991
                                    GIMP_PDB_INT32, end_segment,
 
992
                                    GIMP_PDB_INT32, replicate_times,
 
993
                                    GIMP_PDB_END);
969
994
 
970
995
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
971
996
 
991
1016
 */
992
1017
gboolean
993
1018
gimp_gradient_segment_range_split_midpoint (const gchar *name,
994
 
                                            gint         start_segment,
995
 
                                            gint         end_segment)
 
1019
                                            gint         start_segment,
 
1020
                                            gint         end_segment)
996
1021
{
997
1022
  GimpParam *return_vals;
998
1023
  gint nreturn_vals;
999
1024
  gboolean success = TRUE;
1000
1025
 
1001
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_split_midpoint",
1002
 
                                    &nreturn_vals,
1003
 
                                    GIMP_PDB_STRING, name,
1004
 
                                    GIMP_PDB_INT32, start_segment,
1005
 
                                    GIMP_PDB_INT32, end_segment,
1006
 
                                    GIMP_PDB_END);
 
1026
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-split-midpoint",
 
1027
                                    &nreturn_vals,
 
1028
                                    GIMP_PDB_STRING, name,
 
1029
                                    GIMP_PDB_INT32, start_segment,
 
1030
                                    GIMP_PDB_INT32, end_segment,
 
1031
                                    GIMP_PDB_END);
1007
1032
 
1008
1033
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1009
1034
 
1030
1055
 */
1031
1056
gboolean
1032
1057
gimp_gradient_segment_range_split_uniform (const gchar *name,
1033
 
                                           gint         start_segment,
1034
 
                                           gint         end_segment,
1035
 
                                           gint         split_parts)
 
1058
                                           gint         start_segment,
 
1059
                                           gint         end_segment,
 
1060
                                           gint         split_parts)
1036
1061
{
1037
1062
  GimpParam *return_vals;
1038
1063
  gint nreturn_vals;
1039
1064
  gboolean success = TRUE;
1040
1065
 
1041
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_split_uniform",
1042
 
                                    &nreturn_vals,
1043
 
                                    GIMP_PDB_STRING, name,
1044
 
                                    GIMP_PDB_INT32, start_segment,
1045
 
                                    GIMP_PDB_INT32, end_segment,
1046
 
                                    GIMP_PDB_INT32, split_parts,
1047
 
                                    GIMP_PDB_END);
 
1066
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-split-uniform",
 
1067
                                    &nreturn_vals,
 
1068
                                    GIMP_PDB_STRING, name,
 
1069
                                    GIMP_PDB_INT32, start_segment,
 
1070
                                    GIMP_PDB_INT32, end_segment,
 
1071
                                    GIMP_PDB_INT32, split_parts,
 
1072
                                    GIMP_PDB_END);
1048
1073
 
1049
1074
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1050
1075
 
1069
1094
 */
1070
1095
gboolean
1071
1096
gimp_gradient_segment_range_delete (const gchar *name,
1072
 
                                    gint         start_segment,
1073
 
                                    gint         end_segment)
 
1097
                                    gint         start_segment,
 
1098
                                    gint         end_segment)
1074
1099
{
1075
1100
  GimpParam *return_vals;
1076
1101
  gint nreturn_vals;
1077
1102
  gboolean success = TRUE;
1078
1103
 
1079
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_delete",
1080
 
                                    &nreturn_vals,
1081
 
                                    GIMP_PDB_STRING, name,
1082
 
                                    GIMP_PDB_INT32, start_segment,
1083
 
                                    GIMP_PDB_INT32, end_segment,
1084
 
                                    GIMP_PDB_END);
 
1104
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-delete",
 
1105
                                    &nreturn_vals,
 
1106
                                    GIMP_PDB_STRING, name,
 
1107
                                    GIMP_PDB_INT32, start_segment,
 
1108
                                    GIMP_PDB_INT32, end_segment,
 
1109
                                    GIMP_PDB_END);
1085
1110
 
1086
1111
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1087
1112
 
1107
1132
 */
1108
1133
gboolean
1109
1134
gimp_gradient_segment_range_redistribute_handles (const gchar *name,
1110
 
                                                  gint         start_segment,
1111
 
                                                  gint         end_segment)
 
1135
                                                  gint         start_segment,
 
1136
                                                  gint         end_segment)
1112
1137
{
1113
1138
  GimpParam *return_vals;
1114
1139
  gint nreturn_vals;
1115
1140
  gboolean success = TRUE;
1116
1141
 
1117
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_redistribute_handles",
1118
 
                                    &nreturn_vals,
1119
 
                                    GIMP_PDB_STRING, name,
1120
 
                                    GIMP_PDB_INT32, start_segment,
1121
 
                                    GIMP_PDB_INT32, end_segment,
1122
 
                                    GIMP_PDB_END);
 
1142
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-redistribute-handles",
 
1143
                                    &nreturn_vals,
 
1144
                                    GIMP_PDB_STRING, name,
 
1145
                                    GIMP_PDB_INT32, start_segment,
 
1146
                                    GIMP_PDB_INT32, end_segment,
 
1147
                                    GIMP_PDB_END);
1123
1148
 
1124
1149
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1125
1150
 
1146
1171
 */
1147
1172
gboolean
1148
1173
gimp_gradient_segment_range_blend_colors (const gchar *name,
1149
 
                                          gint         start_segment,
1150
 
                                          gint         end_segment)
 
1174
                                          gint         start_segment,
 
1175
                                          gint         end_segment)
1151
1176
{
1152
1177
  GimpParam *return_vals;
1153
1178
  gint nreturn_vals;
1154
1179
  gboolean success = TRUE;
1155
1180
 
1156
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_blend_colors",
1157
 
                                    &nreturn_vals,
1158
 
                                    GIMP_PDB_STRING, name,
1159
 
                                    GIMP_PDB_INT32, start_segment,
1160
 
                                    GIMP_PDB_INT32, end_segment,
1161
 
                                    GIMP_PDB_END);
 
1181
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-blend-colors",
 
1182
                                    &nreturn_vals,
 
1183
                                    GIMP_PDB_STRING, name,
 
1184
                                    GIMP_PDB_INT32, start_segment,
 
1185
                                    GIMP_PDB_INT32, end_segment,
 
1186
                                    GIMP_PDB_END);
1162
1187
 
1163
1188
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1164
1189
 
1185
1210
 */
1186
1211
gboolean
1187
1212
gimp_gradient_segment_range_blend_opacity (const gchar *name,
1188
 
                                           gint         start_segment,
1189
 
                                           gint         end_segment)
 
1213
                                           gint         start_segment,
 
1214
                                           gint         end_segment)
1190
1215
{
1191
1216
  GimpParam *return_vals;
1192
1217
  gint nreturn_vals;
1193
1218
  gboolean success = TRUE;
1194
1219
 
1195
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_blend_opacity",
1196
 
                                    &nreturn_vals,
1197
 
                                    GIMP_PDB_STRING, name,
1198
 
                                    GIMP_PDB_INT32, start_segment,
1199
 
                                    GIMP_PDB_INT32, end_segment,
1200
 
                                    GIMP_PDB_END);
 
1220
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-blend-opacity",
 
1221
                                    &nreturn_vals,
 
1222
                                    GIMP_PDB_STRING, name,
 
1223
                                    GIMP_PDB_INT32, start_segment,
 
1224
                                    GIMP_PDB_INT32, end_segment,
 
1225
                                    GIMP_PDB_END);
1201
1226
 
1202
1227
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1203
1228
 
1226
1251
 */
1227
1252
gdouble
1228
1253
gimp_gradient_segment_range_move (const gchar *name,
1229
 
                                  gint         start_segment,
1230
 
                                  gint         end_segment,
1231
 
                                  gdouble      delta,
1232
 
                                  gboolean     control_compress)
 
1254
                                  gint         start_segment,
 
1255
                                  gint         end_segment,
 
1256
                                  gdouble      delta,
 
1257
                                  gboolean     control_compress)
1233
1258
{
1234
1259
  GimpParam *return_vals;
1235
1260
  gint nreturn_vals;
1236
 
  gdouble final_delta = 0;
 
1261
  gdouble final_delta = 0.0;
1237
1262
 
1238
 
  return_vals = gimp_run_procedure ("gimp_gradient_segment_range_move",
1239
 
                                    &nreturn_vals,
1240
 
                                    GIMP_PDB_STRING, name,
1241
 
                                    GIMP_PDB_INT32, start_segment,
1242
 
                                    GIMP_PDB_INT32, end_segment,
1243
 
                                    GIMP_PDB_FLOAT, delta,
1244
 
                                    GIMP_PDB_INT32, control_compress,
1245
 
                                    GIMP_PDB_END);
 
1263
  return_vals = gimp_run_procedure ("gimp-gradient-segment-range-move",
 
1264
                                    &nreturn_vals,
 
1265
                                    GIMP_PDB_STRING, name,
 
1266
                                    GIMP_PDB_INT32, start_segment,
 
1267
                                    GIMP_PDB_INT32, end_segment,
 
1268
                                    GIMP_PDB_FLOAT, delta,
 
1269
                                    GIMP_PDB_INT32, control_compress,
 
1270
                                    GIMP_PDB_END);
1246
1271
 
1247
1272
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
1248
1273
    final_delta = return_vals[1].data.d_float;