1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
/* NOTE: This file is auto-generated by pdbgen.pl. */
24
#include <glib-object.h>
26
#include "libgimpbase/gimpbaseenums.h"
27
#include "libgimpcolor/gimpcolor.h"
29
#include "pdb-types.h"
31
#include "gimpprocedure.h"
32
#include "core/gimpparamspecs.h"
34
#include "core/gimpgrid.h"
35
#include "core/gimpimage-grid.h"
36
#include "core/gimpimage.h"
38
#include "internal_procs.h"
42
image_grid_get_spacing_invoker (GimpProcedure *procedure,
45
GimpProgress *progress,
46
const GValueArray *args)
48
gboolean success = TRUE;
49
GValueArray *return_vals;
51
gdouble xspacing = 0.0;
52
gdouble yspacing = 0.0;
54
image = gimp_value_get_image (&args->values[0], gimp);
58
GimpGrid *grid = gimp_image_get_grid (image);
62
"xspacing", &xspacing,
63
"yspacing", &yspacing,
69
return_vals = gimp_procedure_get_return_values (procedure, success);
73
g_value_set_double (&return_vals->values[1], xspacing);
74
g_value_set_double (&return_vals->values[2], yspacing);
81
image_grid_set_spacing_invoker (GimpProcedure *procedure,
84
GimpProgress *progress,
85
const GValueArray *args)
87
gboolean success = TRUE;
92
image = gimp_value_get_image (&args->values[0], gimp);
93
xspacing = g_value_get_double (&args->values[1]);
94
yspacing = g_value_get_double (&args->values[2]);
98
GimpGrid *grid = gimp_image_get_grid (image);
102
"xspacing", xspacing,
103
"yspacing", yspacing,
109
return gimp_procedure_get_return_values (procedure, success);
113
image_grid_get_offset_invoker (GimpProcedure *procedure,
115
GimpContext *context,
116
GimpProgress *progress,
117
const GValueArray *args)
119
gboolean success = TRUE;
120
GValueArray *return_vals;
122
gdouble xoffset = 0.0;
123
gdouble yoffset = 0.0;
125
image = gimp_value_get_image (&args->values[0], gimp);
129
GimpGrid *grid = gimp_image_get_grid (image);
140
return_vals = gimp_procedure_get_return_values (procedure, success);
144
g_value_set_double (&return_vals->values[1], xoffset);
145
g_value_set_double (&return_vals->values[2], yoffset);
152
image_grid_set_offset_invoker (GimpProcedure *procedure,
154
GimpContext *context,
155
GimpProgress *progress,
156
const GValueArray *args)
158
gboolean success = TRUE;
163
image = gimp_value_get_image (&args->values[0], gimp);
164
xoffset = g_value_get_double (&args->values[1]);
165
yoffset = g_value_get_double (&args->values[2]);
169
GimpGrid *grid = gimp_image_get_grid (image);
180
return gimp_procedure_get_return_values (procedure, success);
184
image_grid_get_foreground_color_invoker (GimpProcedure *procedure,
186
GimpContext *context,
187
GimpProgress *progress,
188
const GValueArray *args)
190
gboolean success = TRUE;
191
GValueArray *return_vals;
193
GimpRGB fgcolor = { 0.0, 0.0, 0.0, 1.0 };
195
image = gimp_value_get_image (&args->values[0], gimp);
199
GimpGrid *grid = gimp_image_get_grid (image);
202
fgcolor = grid->fgcolor;
207
return_vals = gimp_procedure_get_return_values (procedure, success);
210
gimp_value_set_rgb (&return_vals->values[1], &fgcolor);
216
image_grid_set_foreground_color_invoker (GimpProcedure *procedure,
218
GimpContext *context,
219
GimpProgress *progress,
220
const GValueArray *args)
222
gboolean success = TRUE;
226
image = gimp_value_get_image (&args->values[0], gimp);
227
gimp_value_get_rgb (&args->values[1], &fgcolor);
231
GimpGrid *grid = gimp_image_get_grid (image);
234
g_object_set (grid, "fgcolor", &fgcolor, NULL);
239
return gimp_procedure_get_return_values (procedure, success);
243
image_grid_get_background_color_invoker (GimpProcedure *procedure,
245
GimpContext *context,
246
GimpProgress *progress,
247
const GValueArray *args)
249
gboolean success = TRUE;
250
GValueArray *return_vals;
252
GimpRGB bgcolor = { 0.0, 0.0, 0.0, 1.0 };
254
image = gimp_value_get_image (&args->values[0], gimp);
258
GimpGrid *grid = gimp_image_get_grid (image);
261
bgcolor = grid->bgcolor;
266
return_vals = gimp_procedure_get_return_values (procedure, success);
269
gimp_value_set_rgb (&return_vals->values[1], &bgcolor);
275
image_grid_set_background_color_invoker (GimpProcedure *procedure,
277
GimpContext *context,
278
GimpProgress *progress,
279
const GValueArray *args)
281
gboolean success = TRUE;
285
image = gimp_value_get_image (&args->values[0], gimp);
286
gimp_value_get_rgb (&args->values[1], &bgcolor);
290
GimpGrid *grid = gimp_image_get_grid (image);
293
g_object_set (grid, "bgcolor", &bgcolor, NULL);
298
return gimp_procedure_get_return_values (procedure, success);
302
image_grid_get_style_invoker (GimpProcedure *procedure,
304
GimpContext *context,
305
GimpProgress *progress,
306
const GValueArray *args)
308
gboolean success = TRUE;
309
GValueArray *return_vals;
313
image = gimp_value_get_image (&args->values[0], gimp);
317
GimpGrid *grid = gimp_image_get_grid (image);
320
g_object_get (grid, "style", &style, NULL);
325
return_vals = gimp_procedure_get_return_values (procedure, success);
328
g_value_set_enum (&return_vals->values[1], style);
334
image_grid_set_style_invoker (GimpProcedure *procedure,
336
GimpContext *context,
337
GimpProgress *progress,
338
const GValueArray *args)
340
gboolean success = TRUE;
344
image = gimp_value_get_image (&args->values[0], gimp);
345
style = g_value_get_enum (&args->values[1]);
349
GimpGrid *grid = gimp_image_get_grid (image);
352
g_object_set (grid, "style", style, NULL);
357
return gimp_procedure_get_return_values (procedure, success);
361
register_grid_procs (GimpPDB *pdb)
363
GimpProcedure *procedure;
366
* gimp-image-grid-get-spacing
368
procedure = gimp_procedure_new (image_grid_get_spacing_invoker);
369
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-get-spacing");
370
gimp_procedure_set_static_strings (procedure,
371
"gimp-image-grid-get-spacing",
372
"Gets the spacing of an image's grid.",
373
"This procedure retrieves the horizontal and vertical spacing of an image's grid. It takes the image as parameter.",
378
gimp_procedure_add_argument (procedure,
379
gimp_param_spec_image_id ("image",
383
GIMP_PARAM_READWRITE));
384
gimp_procedure_add_return_value (procedure,
385
g_param_spec_double ("xspacing",
387
"The image's grid horizontal spacing",
388
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
389
GIMP_PARAM_READWRITE));
390
gimp_procedure_add_return_value (procedure,
391
g_param_spec_double ("yspacing",
393
"The image's grid vertical spacing",
394
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
395
GIMP_PARAM_READWRITE));
396
gimp_pdb_register_procedure (pdb, procedure);
397
g_object_unref (procedure);
400
* gimp-image-grid-set-spacing
402
procedure = gimp_procedure_new (image_grid_set_spacing_invoker);
403
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-set-spacing");
404
gimp_procedure_set_static_strings (procedure,
405
"gimp-image-grid-set-spacing",
406
"Sets the spacing of an image's grid.",
407
"This procedure sets the horizontal and vertical spacing of an image's grid.",
412
gimp_procedure_add_argument (procedure,
413
gimp_param_spec_image_id ("image",
417
GIMP_PARAM_READWRITE));
418
gimp_procedure_add_argument (procedure,
419
g_param_spec_double ("xspacing",
421
"The image's grid horizontal spacing",
422
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
423
GIMP_PARAM_READWRITE));
424
gimp_procedure_add_argument (procedure,
425
g_param_spec_double ("yspacing",
427
"The image's grid vertical spacing",
428
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
429
GIMP_PARAM_READWRITE));
430
gimp_pdb_register_procedure (pdb, procedure);
431
g_object_unref (procedure);
434
* gimp-image-grid-get-offset
436
procedure = gimp_procedure_new (image_grid_get_offset_invoker);
437
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-get-offset");
438
gimp_procedure_set_static_strings (procedure,
439
"gimp-image-grid-get-offset",
440
"Gets the offset of an image's grid.",
441
"This procedure retrieves the horizontal and vertical offset of an image's grid. It takes the image as parameter.",
446
gimp_procedure_add_argument (procedure,
447
gimp_param_spec_image_id ("image",
451
GIMP_PARAM_READWRITE));
452
gimp_procedure_add_return_value (procedure,
453
g_param_spec_double ("xoffset",
455
"The image's grid horizontal offset",
456
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
457
GIMP_PARAM_READWRITE));
458
gimp_procedure_add_return_value (procedure,
459
g_param_spec_double ("yoffset",
461
"The image's grid vertical offset",
462
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
463
GIMP_PARAM_READWRITE));
464
gimp_pdb_register_procedure (pdb, procedure);
465
g_object_unref (procedure);
468
* gimp-image-grid-set-offset
470
procedure = gimp_procedure_new (image_grid_set_offset_invoker);
471
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-set-offset");
472
gimp_procedure_set_static_strings (procedure,
473
"gimp-image-grid-set-offset",
474
"Sets the offset of an image's grid.",
475
"This procedure sets the horizontal and vertical offset of an image's grid.",
480
gimp_procedure_add_argument (procedure,
481
gimp_param_spec_image_id ("image",
485
GIMP_PARAM_READWRITE));
486
gimp_procedure_add_argument (procedure,
487
g_param_spec_double ("xoffset",
489
"The image's grid horizontal offset",
490
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
491
GIMP_PARAM_READWRITE));
492
gimp_procedure_add_argument (procedure,
493
g_param_spec_double ("yoffset",
495
"The image's grid vertical offset",
496
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
497
GIMP_PARAM_READWRITE));
498
gimp_pdb_register_procedure (pdb, procedure);
499
g_object_unref (procedure);
502
* gimp-image-grid-get-foreground-color
504
procedure = gimp_procedure_new (image_grid_get_foreground_color_invoker);
505
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-get-foreground-color");
506
gimp_procedure_set_static_strings (procedure,
507
"gimp-image-grid-get-foreground-color",
508
"Sets the foreground color of an image's grid.",
509
"This procedure gets the foreground color of an image's grid.",
514
gimp_procedure_add_argument (procedure,
515
gimp_param_spec_image_id ("image",
519
GIMP_PARAM_READWRITE));
520
gimp_procedure_add_return_value (procedure,
521
gimp_param_spec_rgb ("fgcolor",
523
"The image's grid foreground color",
526
GIMP_PARAM_READWRITE));
527
gimp_pdb_register_procedure (pdb, procedure);
528
g_object_unref (procedure);
531
* gimp-image-grid-set-foreground-color
533
procedure = gimp_procedure_new (image_grid_set_foreground_color_invoker);
534
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-set-foreground-color");
535
gimp_procedure_set_static_strings (procedure,
536
"gimp-image-grid-set-foreground-color",
537
"Gets the foreground color of an image's grid.",
538
"This procedure sets the foreground color of an image's grid.",
543
gimp_procedure_add_argument (procedure,
544
gimp_param_spec_image_id ("image",
548
GIMP_PARAM_READWRITE));
549
gimp_procedure_add_argument (procedure,
550
gimp_param_spec_rgb ("fgcolor",
552
"The new foreground color",
555
GIMP_PARAM_READWRITE));
556
gimp_pdb_register_procedure (pdb, procedure);
557
g_object_unref (procedure);
560
* gimp-image-grid-get-background-color
562
procedure = gimp_procedure_new (image_grid_get_background_color_invoker);
563
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-get-background-color");
564
gimp_procedure_set_static_strings (procedure,
565
"gimp-image-grid-get-background-color",
566
"Sets the background color of an image's grid.",
567
"This procedure gets the background color of an image's grid.",
572
gimp_procedure_add_argument (procedure,
573
gimp_param_spec_image_id ("image",
577
GIMP_PARAM_READWRITE));
578
gimp_procedure_add_return_value (procedure,
579
gimp_param_spec_rgb ("bgcolor",
581
"The image's grid background color",
584
GIMP_PARAM_READWRITE));
585
gimp_pdb_register_procedure (pdb, procedure);
586
g_object_unref (procedure);
589
* gimp-image-grid-set-background-color
591
procedure = gimp_procedure_new (image_grid_set_background_color_invoker);
592
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-set-background-color");
593
gimp_procedure_set_static_strings (procedure,
594
"gimp-image-grid-set-background-color",
595
"Gets the background color of an image's grid.",
596
"This procedure sets the background color of an image's grid.",
601
gimp_procedure_add_argument (procedure,
602
gimp_param_spec_image_id ("image",
606
GIMP_PARAM_READWRITE));
607
gimp_procedure_add_argument (procedure,
608
gimp_param_spec_rgb ("bgcolor",
610
"The new background color",
613
GIMP_PARAM_READWRITE));
614
gimp_pdb_register_procedure (pdb, procedure);
615
g_object_unref (procedure);
618
* gimp-image-grid-get-style
620
procedure = gimp_procedure_new (image_grid_get_style_invoker);
621
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-get-style");
622
gimp_procedure_set_static_strings (procedure,
623
"gimp-image-grid-get-style",
624
"Gets the style of an image's grid.",
625
"This procedure retrieves the style of an image's grid.",
630
gimp_procedure_add_argument (procedure,
631
gimp_param_spec_image_id ("image",
635
GIMP_PARAM_READWRITE));
636
gimp_procedure_add_return_value (procedure,
637
g_param_spec_enum ("style",
639
"The image's grid style",
640
GIMP_TYPE_GRID_STYLE,
642
GIMP_PARAM_READWRITE));
643
gimp_pdb_register_procedure (pdb, procedure);
644
g_object_unref (procedure);
647
* gimp-image-grid-set-style
649
procedure = gimp_procedure_new (image_grid_set_style_invoker);
650
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-grid-set-style");
651
gimp_procedure_set_static_strings (procedure,
652
"gimp-image-grid-set-style",
653
"Sets the style unit of an image's grid.",
654
"This procedure sets the style of an image's grid. It takes the image and the new style as parameters.",
659
gimp_procedure_add_argument (procedure,
660
gimp_param_spec_image_id ("image",
664
GIMP_PARAM_READWRITE));
665
gimp_procedure_add_argument (procedure,
666
g_param_spec_enum ("style",
668
"The image's grid style",
669
GIMP_TYPE_GRID_STYLE,
671
GIMP_PARAM_READWRITE));
672
gimp_pdb_register_procedure (pdb, procedure);
673
g_object_unref (procedure);