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 "pdb-types.h"
27
#include "procedural_db.h"
29
#include "core/gimp.h"
30
#include "core/gimpdatafactory.h"
32
static ProcRecord patterns_popup_proc;
33
static ProcRecord patterns_close_popup_proc;
34
static ProcRecord patterns_set_popup_proc;
37
register_pattern_select_procs (Gimp *gimp)
39
procedural_db_register (gimp, &patterns_popup_proc);
40
procedural_db_register (gimp, &patterns_close_popup_proc);
41
procedural_db_register (gimp, &patterns_set_popup_proc);
45
patterns_popup_invoker (Gimp *gimp,
47
GimpProgress *progress,
50
gboolean success = TRUE;
51
gchar *pattern_callback;
53
gchar *initial_pattern;
55
pattern_callback = (gchar *) args[0].value.pdb_pointer;
56
if (pattern_callback == NULL || !g_utf8_validate (pattern_callback, -1, NULL))
59
popup_title = (gchar *) args[1].value.pdb_pointer;
60
if (popup_title == NULL || !g_utf8_validate (popup_title, -1, NULL))
63
initial_pattern = (gchar *) args[2].value.pdb_pointer;
64
if (initial_pattern && !g_utf8_validate (initial_pattern, -1, NULL))
69
if (gimp->no_interface ||
70
! procedural_db_lookup (gimp, pattern_callback) ||
71
! gimp_pdb_dialog_new (gimp, context, gimp->pattern_factory->container,
72
popup_title, pattern_callback, initial_pattern,
77
return procedural_db_return_args (&patterns_popup_proc, success);
80
static ProcArg patterns_popup_inargs[] =
85
"The callback PDB proc to call when pattern selection is made"
90
"Title to give the pattern popup window"
95
"The name of the pattern to set as the first selected"
99
static ProcRecord patterns_popup_proc =
101
"gimp_patterns_popup",
102
"Invokes the Gimp pattern selection.",
103
"This procedure popups the pattern selection dialog.",
110
patterns_popup_inargs,
113
{ { patterns_popup_invoker } }
117
patterns_close_popup_invoker (Gimp *gimp,
118
GimpContext *context,
119
GimpProgress *progress,
122
gboolean success = TRUE;
123
gchar *pattern_callback;
125
pattern_callback = (gchar *) args[0].value.pdb_pointer;
126
if (pattern_callback == NULL || !g_utf8_validate (pattern_callback, -1, NULL))
131
if (gimp->no_interface ||
132
! procedural_db_lookup (gimp, pattern_callback) ||
133
! gimp_pdb_dialog_close (gimp, gimp->pattern_factory->container,
138
return procedural_db_return_args (&patterns_close_popup_proc, success);
141
static ProcArg patterns_close_popup_inargs[] =
146
"The name of the callback registered for this popup"
150
static ProcRecord patterns_close_popup_proc =
152
"gimp_patterns_close_popup",
153
"Popdown the Gimp pattern selection.",
154
"This procedure closes an opened pattern selection dialog.",
161
patterns_close_popup_inargs,
164
{ { patterns_close_popup_invoker } }
168
patterns_set_popup_invoker (Gimp *gimp,
169
GimpContext *context,
170
GimpProgress *progress,
173
gboolean success = TRUE;
174
gchar *pattern_callback;
177
pattern_callback = (gchar *) args[0].value.pdb_pointer;
178
if (pattern_callback == NULL || !g_utf8_validate (pattern_callback, -1, NULL))
181
pattern_name = (gchar *) args[1].value.pdb_pointer;
182
if (pattern_name == NULL || !g_utf8_validate (pattern_name, -1, NULL))
187
if (gimp->no_interface ||
188
! procedural_db_lookup (gimp, pattern_callback) ||
189
! gimp_pdb_dialog_set (gimp, gimp->pattern_factory->container,
190
pattern_callback, pattern_name,
195
return procedural_db_return_args (&patterns_set_popup_proc, success);
198
static ProcArg patterns_set_popup_inargs[] =
203
"The name of the callback registered for this popup"
208
"The name of the pattern to set as selected"
212
static ProcRecord patterns_set_popup_proc =
214
"gimp_patterns_set_popup",
215
"Sets the current pattern selection in a popup.",
216
"Sets the current pattern selection in a popup.",
223
patterns_set_popup_inargs,
226
{ { patterns_set_popup_invoker } }