1
/* The GIMP -- an 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 autogenerated by pdbgen.pl. */
24
#include <glib-object.h>
26
#include "libgimpcolor/gimpcolor.h"
28
#include "pdb-types.h"
29
#include "procedural_db.h"
31
#include "core/gimp.h"
32
#include "core/gimpcontainer.h"
33
#include "core/gimpcontext.h"
34
#include "core/gimpdatafactory.h"
35
#include "plug-in/plug-in-context.h"
36
#include "plug-in/plug-in.h"
38
static ProcRecord context_push_proc;
39
static ProcRecord context_pop_proc;
40
static ProcRecord context_get_foreground_proc;
41
static ProcRecord context_set_foreground_proc;
42
static ProcRecord context_get_background_proc;
43
static ProcRecord context_set_background_proc;
44
static ProcRecord context_set_default_colors_proc;
45
static ProcRecord context_swap_colors_proc;
46
static ProcRecord context_get_opacity_proc;
47
static ProcRecord context_set_opacity_proc;
48
static ProcRecord context_get_paint_mode_proc;
49
static ProcRecord context_set_paint_mode_proc;
50
static ProcRecord context_get_brush_proc;
51
static ProcRecord context_set_brush_proc;
52
static ProcRecord context_get_pattern_proc;
53
static ProcRecord context_set_pattern_proc;
54
static ProcRecord context_get_gradient_proc;
55
static ProcRecord context_set_gradient_proc;
56
static ProcRecord context_get_palette_proc;
57
static ProcRecord context_set_palette_proc;
58
static ProcRecord context_get_font_proc;
59
static ProcRecord context_set_font_proc;
62
register_context_procs (Gimp *gimp)
64
procedural_db_register (gimp, &context_push_proc);
65
procedural_db_register (gimp, &context_pop_proc);
66
procedural_db_register (gimp, &context_get_foreground_proc);
67
procedural_db_register (gimp, &context_set_foreground_proc);
68
procedural_db_register (gimp, &context_get_background_proc);
69
procedural_db_register (gimp, &context_set_background_proc);
70
procedural_db_register (gimp, &context_set_default_colors_proc);
71
procedural_db_register (gimp, &context_swap_colors_proc);
72
procedural_db_register (gimp, &context_get_opacity_proc);
73
procedural_db_register (gimp, &context_set_opacity_proc);
74
procedural_db_register (gimp, &context_get_paint_mode_proc);
75
procedural_db_register (gimp, &context_set_paint_mode_proc);
76
procedural_db_register (gimp, &context_get_brush_proc);
77
procedural_db_register (gimp, &context_set_brush_proc);
78
procedural_db_register (gimp, &context_get_pattern_proc);
79
procedural_db_register (gimp, &context_set_pattern_proc);
80
procedural_db_register (gimp, &context_get_gradient_proc);
81
procedural_db_register (gimp, &context_set_gradient_proc);
82
procedural_db_register (gimp, &context_get_palette_proc);
83
procedural_db_register (gimp, &context_set_palette_proc);
84
procedural_db_register (gimp, &context_get_font_proc);
85
procedural_db_register (gimp, &context_set_font_proc);
89
context_push_invoker (Gimp *gimp,
91
GimpProgress *progress,
94
gboolean success = TRUE;
95
if (gimp->current_plug_in && gimp->current_plug_in->open)
97
success = plug_in_context_push (gimp->current_plug_in);
103
return procedural_db_return_args (&context_push_proc, success);
106
static ProcRecord context_push_proc =
109
"Pushes a context to the top of the plug-in's context stack.",
110
"This procedure creates a new context by copying the current context. This copy becomes the new current context for the calling plug-in until it is popped again.",
111
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
112
"Michael Natterer & Sven Neumann",
120
{ { context_push_invoker } }
124
context_pop_invoker (Gimp *gimp,
125
GimpContext *context,
126
GimpProgress *progress,
129
gboolean success = TRUE;
130
if (gimp->current_plug_in && gimp->current_plug_in->open)
132
success = plug_in_context_pop (gimp->current_plug_in);
138
return procedural_db_return_args (&context_pop_proc, success);
141
static ProcRecord context_pop_proc =
144
"Pops the topmost context from the plug-in's context stack.",
145
"This procedure creates a new context and makes it the current context for the calling plug-in.",
146
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
147
"Michael Natterer & Sven Neumann",
155
{ { context_pop_invoker } }
159
context_get_foreground_invoker (Gimp *gimp,
160
GimpContext *context,
161
GimpProgress *progress,
164
Argument *return_args;
167
gimp_context_get_foreground (context, &color);
169
return_args = procedural_db_return_args (&context_get_foreground_proc, TRUE);
170
return_args[1].value.pdb_color = color;
175
static ProcArg context_get_foreground_outargs[] =
180
"The foreground color"
184
static ProcRecord context_get_foreground_proc =
186
"gimp_context_get_foreground",
187
"Get the current GIMP foreground color.",
188
"This procedure returns the current GIMP foreground color. The foreground color is used in a variety of tools such as paint tools, blending, and bucket fill.",
189
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
190
"Michael Natterer & Sven Neumann",
197
context_get_foreground_outargs,
198
{ { context_get_foreground_invoker } }
202
context_set_foreground_invoker (Gimp *gimp,
203
GimpContext *context,
204
GimpProgress *progress,
209
color = args[0].value.pdb_color;
211
gimp_rgb_set_alpha (&color, 1.0);
212
gimp_context_set_foreground (context, &color);
214
return procedural_db_return_args (&context_set_foreground_proc, TRUE);
217
static ProcArg context_set_foreground_inargs[] =
222
"The foreground color"
226
static ProcRecord context_set_foreground_proc =
228
"gimp_context_set_foreground",
229
"Set the current GIMP foreground color.",
230
"This procedure sets the current GIMP foreground color. After this is set, operations which use foreground such as paint tools, blending, and bucket fill will use the new value.",
231
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
232
"Michael Natterer & Sven Neumann",
237
context_set_foreground_inargs,
240
{ { context_set_foreground_invoker } }
244
context_get_background_invoker (Gimp *gimp,
245
GimpContext *context,
246
GimpProgress *progress,
249
Argument *return_args;
252
gimp_context_get_background (context, &color);
254
return_args = procedural_db_return_args (&context_get_background_proc, TRUE);
255
return_args[1].value.pdb_color = color;
260
static ProcArg context_get_background_outargs[] =
265
"The background color"
269
static ProcRecord context_get_background_proc =
271
"gimp_context_get_background",
272
"Get the current GIMP background color.",
273
"This procedure returns the current GIMP background color. The background color is used in a variety of tools such as blending, erasing (with non-alpha images), and image filling.",
274
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
275
"Michael Natterer & Sven Neumann",
282
context_get_background_outargs,
283
{ { context_get_background_invoker } }
287
context_set_background_invoker (Gimp *gimp,
288
GimpContext *context,
289
GimpProgress *progress,
294
color = args[0].value.pdb_color;
296
gimp_rgb_set_alpha (&color, 1.0);
297
gimp_context_set_background (context, &color);
299
return procedural_db_return_args (&context_set_background_proc, TRUE);
302
static ProcArg context_set_background_inargs[] =
307
"The background color"
311
static ProcRecord context_set_background_proc =
313
"gimp_context_set_background",
314
"Set the current GIMP background color.",
315
"This procedure sets the current GIMP background color. After this is set, operations which use background such as blending, filling images, clearing, and erasing (in non-alpha images) will use the new value.",
316
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
317
"Michael Natterer & Sven Neumann",
322
context_set_background_inargs,
325
{ { context_set_background_invoker } }
329
context_set_default_colors_invoker (Gimp *gimp,
330
GimpContext *context,
331
GimpProgress *progress,
334
gimp_context_set_default_colors (context);
335
return procedural_db_return_args (&context_set_default_colors_proc, TRUE);
338
static ProcRecord context_set_default_colors_proc =
340
"gimp_context_set_default_colors",
341
"Set the current GIMP foreground and background colors to black and white.",
342
"This procedure sets the current GIMP foreground and background colors to their initial default values, black and white.",
343
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
344
"Michael Natterer & Sven Neumann",
352
{ { context_set_default_colors_invoker } }
356
context_swap_colors_invoker (Gimp *gimp,
357
GimpContext *context,
358
GimpProgress *progress,
361
gimp_context_swap_colors (context);
362
return procedural_db_return_args (&context_swap_colors_proc, TRUE);
365
static ProcRecord context_swap_colors_proc =
367
"gimp_context_swap_colors",
368
"Swap the current GIMP foreground and background colors.",
369
"This procedure swaps the current GIMP foreground and background colors, so that the new foreground color becomes the old background color and vice versa.",
370
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
371
"Michael Natterer & Sven Neumann",
379
{ { context_swap_colors_invoker } }
383
context_get_opacity_invoker (Gimp *gimp,
384
GimpContext *context,
385
GimpProgress *progress,
388
Argument *return_args;
390
return_args = procedural_db_return_args (&context_get_opacity_proc, TRUE);
391
return_args[1].value.pdb_float = gimp_context_get_opacity (context) * 100.0;
396
static ProcArg context_get_opacity_outargs[] =
401
"The opacity: 0 <= opacity <= 100"
405
static ProcRecord context_get_opacity_proc =
407
"gimp_context_get_opacity",
409
"This procedure returns the opacity setting. The return value is a floating point number between 0 and 100.",
410
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
411
"Michael Natterer & Sven Neumann",
418
context_get_opacity_outargs,
419
{ { context_get_opacity_invoker } }
423
context_set_opacity_invoker (Gimp *gimp,
424
GimpContext *context,
425
GimpProgress *progress,
428
gboolean success = TRUE;
431
opacity = args[0].value.pdb_float;
432
if (opacity < 0.0 || opacity > 100.0)
436
gimp_context_set_opacity (context, opacity / 100.0);
438
return procedural_db_return_args (&context_set_opacity_proc, success);
441
static ProcArg context_set_opacity_inargs[] =
446
"The opacity: 0 <= opacity <= 100"
450
static ProcRecord context_set_opacity_proc =
452
"gimp_context_set_opacity",
454
"This procedure modifies the opacity setting. The value should be a floating point number between 0 and 100.",
455
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
456
"Michael Natterer & Sven Neumann",
461
context_set_opacity_inargs,
464
{ { context_set_opacity_invoker } }
468
context_get_paint_mode_invoker (Gimp *gimp,
469
GimpContext *context,
470
GimpProgress *progress,
473
Argument *return_args;
475
return_args = procedural_db_return_args (&context_get_paint_mode_proc, TRUE);
476
return_args[1].value.pdb_int = gimp_context_get_paint_mode (context);
481
static ProcArg context_get_paint_mode_outargs[] =
486
"The paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }"
490
static ProcRecord context_get_paint_mode_proc =
492
"gimp_context_get_paint_mode",
493
"Get the paint mode.",
494
"This procedure returns the paint-mode setting. The return value is an integer which corresponds to the values listed in the argument description.",
495
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
496
"Michael Natterer & Sven Neumann",
503
context_get_paint_mode_outargs,
504
{ { context_get_paint_mode_invoker } }
508
context_set_paint_mode_invoker (Gimp *gimp,
509
GimpContext *context,
510
GimpProgress *progress,
513
gboolean success = TRUE;
516
paint_mode = args[0].value.pdb_int;
517
if (paint_mode < GIMP_NORMAL_MODE || paint_mode > GIMP_COLOR_ERASE_MODE)
521
gimp_context_set_paint_mode (context, paint_mode);
523
return procedural_db_return_args (&context_set_paint_mode_proc, success);
526
static ProcArg context_set_paint_mode_inargs[] =
531
"The paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }"
535
static ProcRecord context_set_paint_mode_proc =
537
"gimp_context_set_paint_mode",
538
"Set the paint mode.",
539
"This procedure modifies the paint_mode setting.",
540
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
541
"Michael Natterer & Sven Neumann",
546
context_set_paint_mode_inargs,
549
{ { context_set_paint_mode_invoker } }
553
context_get_brush_invoker (Gimp *gimp,
554
GimpContext *context,
555
GimpProgress *progress,
558
gboolean success = TRUE;
559
Argument *return_args;
562
success = (brush = gimp_context_get_brush (context)) != NULL;
564
return_args = procedural_db_return_args (&context_get_brush_proc, success);
567
return_args[1].value.pdb_pointer = g_strdup (gimp_object_get_name (GIMP_OBJECT (brush)));
572
static ProcArg context_get_brush_outargs[] =
577
"The name of the active brush"
581
static ProcRecord context_get_brush_proc =
583
"gimp_context_get_brush",
584
"Retrieve the currently active brush.",
585
"This procedure returns the nme of the currently active brush. All paint operations and stroke operations use this brush to control the application of paint to the image.",
586
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
587
"Michael Natterer & Sven Neumann",
594
context_get_brush_outargs,
595
{ { context_get_brush_invoker } }
599
context_set_brush_invoker (Gimp *gimp,
600
GimpContext *context,
601
GimpProgress *progress,
604
gboolean success = TRUE;
608
name = (gchar *) args[0].value.pdb_pointer;
609
if (name == NULL || !g_utf8_validate (name, -1, NULL))
614
brush = (GimpBrush *)
615
gimp_container_get_child_by_name (gimp->brush_factory->container, name);
618
gimp_context_set_brush (context, brush);
623
return procedural_db_return_args (&context_set_brush_proc, success);
626
static ProcArg context_set_brush_inargs[] =
631
"The name o the brush"
635
static ProcRecord context_set_brush_proc =
637
"gimp_context_set_brush",
638
"Set the specified brush as the active brush.",
639
"This procedure allows the active brush to be set by specifying its name. The name is simply a string which corresponds to one of the names of the installed brushes. If there is no matching brush found, this procedure will return an error. Otherwise, the specified brush becomes active and will be used in all subsequent paint operations.",
640
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
641
"Michael Natterer & Sven Neumann",
646
context_set_brush_inargs,
649
{ { context_set_brush_invoker } }
653
context_get_pattern_invoker (Gimp *gimp,
654
GimpContext *context,
655
GimpProgress *progress,
658
gboolean success = TRUE;
659
Argument *return_args;
660
GimpPattern *pattern;
662
success = (pattern = gimp_context_get_pattern (context)) != NULL;
664
return_args = procedural_db_return_args (&context_get_pattern_proc, success);
667
return_args[1].value.pdb_pointer = g_strdup (gimp_object_get_name (GIMP_OBJECT (pattern)));
672
static ProcArg context_get_pattern_outargs[] =
677
"The name of the active pattern"
681
static ProcRecord context_get_pattern_proc =
683
"gimp_context_get_pattern",
684
"Retrieve the currently active pattern.",
685
"This procedure returns name of the the currently active pattern. All clone and bucket-fill operations with patterns will use this pattern to control the application of paint to the image.",
686
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
687
"Michael Natterer & Sven Neumann",
694
context_get_pattern_outargs,
695
{ { context_get_pattern_invoker } }
699
context_set_pattern_invoker (Gimp *gimp,
700
GimpContext *context,
701
GimpProgress *progress,
704
gboolean success = TRUE;
706
GimpPattern *pattern;
708
name = (gchar *) args[0].value.pdb_pointer;
709
if (name == NULL || !g_utf8_validate (name, -1, NULL))
714
pattern = (GimpPattern *)
715
gimp_container_get_child_by_name (gimp->pattern_factory->container, name);
718
gimp_context_set_pattern (context, pattern);
723
return procedural_db_return_args (&context_set_pattern_proc, success);
726
static ProcArg context_set_pattern_inargs[] =
731
"The name of the pattern"
735
static ProcRecord context_set_pattern_proc =
737
"gimp_context_set_pattern",
738
"Set the specified pattern as the active pattern.",
739
"This procedure allows the active pattern to be set by specifying its name. The name is simply a string which corresponds to one of the names of the installed patterns. If there is no matching pattern found, this procedure will return an error. Otherwise, the specified pattern becomes active and will be used in all subsequent paint operations.",
740
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
741
"Michael Natterer & Sven Neumann",
746
context_set_pattern_inargs,
749
{ { context_set_pattern_invoker } }
753
context_get_gradient_invoker (Gimp *gimp,
754
GimpContext *context,
755
GimpProgress *progress,
758
gboolean success = TRUE;
759
Argument *return_args;
760
GimpGradient *gradient;
762
success = (gradient = gimp_context_get_gradient (context)) != NULL;
764
return_args = procedural_db_return_args (&context_get_gradient_proc, success);
767
return_args[1].value.pdb_pointer = g_strdup (gimp_object_get_name (GIMP_OBJECT (gradient)));
772
static ProcArg context_get_gradient_outargs[] =
777
"The name of the active gradient"
781
static ProcRecord context_get_gradient_proc =
783
"gimp_context_get_gradient",
784
"Retrieve the currently active gradient.",
785
"This procedure returns the name of the currently active gradient.",
786
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
787
"Michael Natterer & Sven Neumann",
794
context_get_gradient_outargs,
795
{ { context_get_gradient_invoker } }
799
context_set_gradient_invoker (Gimp *gimp,
800
GimpContext *context,
801
GimpProgress *progress,
804
gboolean success = TRUE;
806
GimpGradient *gradient;
808
name = (gchar *) args[0].value.pdb_pointer;
809
if (name == NULL || !g_utf8_validate (name, -1, NULL))
814
gradient = (GimpGradient *)
815
gimp_container_get_child_by_name (gimp->gradient_factory->container, name);
818
gimp_context_set_gradient (context, gradient);
823
return procedural_db_return_args (&context_set_gradient_proc, success);
826
static ProcArg context_set_gradient_inargs[] =
831
"The name of the gradient"
835
static ProcRecord context_set_gradient_proc =
837
"gimp_context_set_gradient",
838
"Sets the specified gradient as the active gradient.",
839
"This procedure lets you set the specified gradient as the active or \"current\" one. The name is simply a string which corresponds to one of the loaded gradients. If no matching gradient is found, this procedure will return an error. Otherwise, the specified gradient will become active and will be used for subsequent custom gradient operations.",
840
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
841
"Michael Natterer & Sven Neumann",
846
context_set_gradient_inargs,
849
{ { context_set_gradient_invoker } }
853
context_get_palette_invoker (Gimp *gimp,
854
GimpContext *context,
855
GimpProgress *progress,
858
gboolean success = TRUE;
859
Argument *return_args;
860
GimpPalette *palette;
862
success = (palette = gimp_context_get_palette (context)) != NULL;
864
return_args = procedural_db_return_args (&context_get_palette_proc, success);
867
return_args[1].value.pdb_pointer = g_strdup (gimp_object_get_name (GIMP_OBJECT (palette)));
872
static ProcArg context_get_palette_outargs[] =
877
"The name of the active palette"
881
static ProcRecord context_get_palette_proc =
883
"gimp_context_get_palette",
884
"Retrieve the currently active palette.",
885
"This procedure returns the name of the the currently active palette.",
886
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
887
"Michael Natterer & Sven Neumann",
894
context_get_palette_outargs,
895
{ { context_get_palette_invoker } }
899
context_set_palette_invoker (Gimp *gimp,
900
GimpContext *context,
901
GimpProgress *progress,
904
gboolean success = TRUE;
906
GimpPalette *palette;
908
name = (gchar *) args[0].value.pdb_pointer;
909
if (name == NULL || !g_utf8_validate (name, -1, NULL))
914
palette = (GimpPalette *)
915
gimp_container_get_child_by_name (gimp->palette_factory->container, name);
918
gimp_context_set_palette (context, palette);
923
return procedural_db_return_args (&context_set_palette_proc, success);
926
static ProcArg context_set_palette_inargs[] =
931
"The name of the palette"
935
static ProcRecord context_set_palette_proc =
937
"gimp_context_set_palette",
938
"Set the specified palette as the active palette.",
939
"This procedure allows the active palette to be set by specifying its name. The name is simply a string which corresponds to one of the names of the installed palettes. If no matching palette is found, this procedure will return an error. Otherwise, the specified palette becomes active and will be used in all subsequent palette operations.",
940
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
941
"Michael Natterer & Sven Neumann",
946
context_set_palette_inargs,
949
{ { context_set_palette_invoker } }
953
context_get_font_invoker (Gimp *gimp,
954
GimpContext *context,
955
GimpProgress *progress,
958
gboolean success = TRUE;
959
Argument *return_args;
962
success = (font = gimp_context_get_font (context)) != NULL;
964
return_args = procedural_db_return_args (&context_get_font_proc, success);
967
return_args[1].value.pdb_pointer = g_strdup (gimp_object_get_name (GIMP_OBJECT (font)));
972
static ProcArg context_get_font_outargs[] =
977
"The name of the active font"
981
static ProcRecord context_get_font_proc =
983
"gimp_context_get_font",
984
"Retrieve the currently active font.",
985
"This procedure returns the name of the currently active font.",
986
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
987
"Michael Natterer & Sven Neumann",
994
context_get_font_outargs,
995
{ { context_get_font_invoker } }
999
context_set_font_invoker (Gimp *gimp,
1000
GimpContext *context,
1001
GimpProgress *progress,
1004
gboolean success = TRUE;
1008
name = (gchar *) args[0].value.pdb_pointer;
1009
if (name == NULL || !g_utf8_validate (name, -1, NULL))
1015
gimp_container_get_child_by_name (gimp->fonts, name);
1018
gimp_context_set_font (context, font);
1023
return procedural_db_return_args (&context_set_font_proc, success);
1026
static ProcArg context_set_font_inargs[] =
1031
"The name of the font"
1035
static ProcRecord context_set_font_proc =
1037
"gimp_context_set_font",
1038
"Set the specified font as the active font.",
1039
"This procedure allows the active font to be set by specifying its name. The name is simply a string which corresponds to one of the names of the installed fonts. If no matching font is found, this procedure will return an error. Otherwise, the specified font becomes active and will be used in all subsequent font operations.",
1040
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
1041
"Michael Natterer & Sven Neumann",
1046
context_set_font_inargs,
1049
{ { context_set_font_invoker } }