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

« back to all changes in this revision

Viewing changes to app/pdb/gimprc_cmds.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:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
16
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
17
 */
18
18
 
19
 
/* NOTE: This file is autogenerated by pdbgen.pl. */
 
19
/* NOTE: This file is auto-generated by pdbgen.pl. */
20
20
 
21
21
#include "config.h"
22
22
 
24
24
 
25
25
#include <glib-object.h>
26
26
 
 
27
#include "libgimpbase/gimpbase.h"
 
28
#include "libgimpconfig/gimpconfig.h"
27
29
#include "libgimpmodule/gimpmodule.h"
28
30
 
29
31
#include "pdb-types.h"
30
 
#include "procedural_db.h"
 
32
#include "gimppdb.h"
 
33
#include "gimpprocedure.h"
 
34
#include "core/gimpparamspecs.h"
31
35
 
32
 
#include "config/gimpconfig.h"
33
 
#include "config/gimpcoreconfig.h"
34
 
#include "config/gimpdisplayconfig.h"
35
36
#include "config/gimprc.h"
 
37
#include "core/gimp-utils.h"
36
38
#include "core/gimp.h"
37
39
#include "core/gimptemplate.h"
38
40
 
39
 
static ProcRecord gimprc_query_proc;
40
 
static ProcRecord gimprc_set_proc;
41
 
static ProcRecord get_default_comment_proc;
42
 
static ProcRecord get_monitor_resolution_proc;
43
 
static ProcRecord get_theme_dir_proc;
44
 
static ProcRecord get_module_load_inhibit_proc;
45
 
 
46
 
void
47
 
register_gimprc_procs (Gimp *gimp)
48
 
{
49
 
  procedural_db_register (gimp, &gimprc_query_proc);
50
 
  procedural_db_register (gimp, &gimprc_set_proc);
51
 
  procedural_db_register (gimp, &get_default_comment_proc);
52
 
  procedural_db_register (gimp, &get_monitor_resolution_proc);
53
 
  procedural_db_register (gimp, &get_theme_dir_proc);
54
 
  procedural_db_register (gimp, &get_module_load_inhibit_proc);
55
 
}
56
 
 
57
 
static Argument *
58
 
gimprc_query_invoker (Gimp         *gimp,
59
 
                      GimpContext  *context,
60
 
                      GimpProgress *progress,
61
 
                      Argument     *args)
 
41
#include "internal_procs.h"
 
42
 
 
43
 
 
44
static GValueArray *
 
45
gimprc_query_invoker (GimpProcedure     *procedure,
 
46
                      Gimp              *gimp,
 
47
                      GimpContext       *context,
 
48
                      GimpProgress      *progress,
 
49
                      const GValueArray *args)
62
50
{
63
51
  gboolean success = TRUE;
64
 
  Argument *return_args;
65
 
  gchar *token;
 
52
  GValueArray *return_vals;
 
53
  const gchar *token;
66
54
  gchar *value = NULL;
67
55
 
68
 
  token = (gchar *) args[0].value.pdb_pointer;
69
 
  if (token == NULL || !g_utf8_validate (token, -1, NULL))
70
 
    success = FALSE;
 
56
  token = g_value_get_string (&args->values[0]);
71
57
 
72
58
  if (success)
73
59
    {
75
61
        {
76
62
          /*  use edit_config because unknown tokens are set there  */
77
63
          value = gimp_rc_query (GIMP_RC (gimp->edit_config), token);
 
64
 
 
65
          if (! value)
 
66
            success = FALSE;
78
67
        }
79
 
 
80
 
      success = (value != NULL);
 
68
      else
 
69
        success = FALSE;
81
70
    }
82
71
 
83
 
  return_args = procedural_db_return_args (&gimprc_query_proc, success);
 
72
  return_vals = gimp_procedure_get_return_values (procedure, success);
84
73
 
85
74
  if (success)
86
 
    return_args[1].value.pdb_pointer = value;
 
75
    g_value_take_string (&return_vals->values[1], value);
87
76
 
88
 
  return return_args;
 
77
  return return_vals;
89
78
}
90
79
 
91
 
static ProcArg gimprc_query_inargs[] =
92
 
{
93
 
  {
94
 
    GIMP_PDB_STRING,
95
 
    "token",
96
 
    "The token to query for"
97
 
  }
98
 
};
99
 
 
100
 
static ProcArg gimprc_query_outargs[] =
101
 
{
102
 
  {
103
 
    GIMP_PDB_STRING,
104
 
    "value",
105
 
    "The value associated with the queried token"
106
 
  }
107
 
};
108
 
 
109
 
static ProcRecord gimprc_query_proc =
110
 
{
111
 
  "gimp_gimprc_query",
112
 
  "Queries the gimprc file parser for information on a specified token.",
113
 
  "This procedure is used to locate additional information contained in the gimprc file considered extraneous to the operation of the GIMP. Plug-ins that need configuration information can expect it will be stored in the user gimprc file and can use this procedure to retrieve it. This query procedure will return the value associated with the specified token. This corresponds _only_ to entries with the format: (<token> <value>). The value must be a string. Entries not corresponding to this format will cause warnings to be issued on gimprc parsing and will not be queryable.",
114
 
  "Spencer Kimball & Peter Mattis",
115
 
  "Spencer Kimball & Peter Mattis",
116
 
  "1997",
117
 
  NULL,
118
 
  GIMP_INTERNAL,
119
 
  1,
120
 
  gimprc_query_inargs,
121
 
  1,
122
 
  gimprc_query_outargs,
123
 
  { { gimprc_query_invoker } }
124
 
};
125
 
 
126
 
static Argument *
127
 
gimprc_set_invoker (Gimp         *gimp,
128
 
                    GimpContext  *context,
129
 
                    GimpProgress *progress,
130
 
                    Argument     *args)
 
80
static GValueArray *
 
81
gimprc_set_invoker (GimpProcedure     *procedure,
 
82
                    Gimp              *gimp,
 
83
                    GimpContext       *context,
 
84
                    GimpProgress      *progress,
 
85
                    const GValueArray *args)
131
86
{
132
87
  gboolean success = TRUE;
133
 
  gchar *token;
134
 
  gchar *value;
135
 
 
136
 
  token = (gchar *) args[0].value.pdb_pointer;
137
 
  if (token == NULL || !g_utf8_validate (token, -1, NULL))
138
 
    success = FALSE;
139
 
 
140
 
  value = (gchar *) args[1].value.pdb_pointer;
141
 
  if (value == NULL || !g_utf8_validate (value, -1, NULL))
142
 
    success = FALSE;
 
88
  const gchar *token;
 
89
  const gchar *value;
 
90
 
 
91
  token = g_value_get_string (&args->values[0]);
 
92
  value = g_value_get_string (&args->values[1]);
143
93
 
144
94
  if (success)
145
95
    {
152
102
        success = FALSE;
153
103
    }
154
104
 
155
 
  return procedural_db_return_args (&gimprc_set_proc, success);
 
105
  return gimp_procedure_get_return_values (procedure, success);
156
106
}
157
107
 
158
 
static ProcArg gimprc_set_inargs[] =
159
 
{
160
 
  {
161
 
    GIMP_PDB_STRING,
162
 
    "token",
163
 
    "The token to add or modify"
164
 
  },
165
 
  {
166
 
    GIMP_PDB_STRING,
167
 
    "value",
168
 
    "The value to set the token to"
169
 
  }
170
 
};
171
 
 
172
 
static ProcRecord gimprc_set_proc =
173
 
{
174
 
  "gimp_gimprc_set",
175
 
  "Sets a gimprc token to a value and saves it in the gimprc.",
176
 
  "This procedure is used to add or change additional information in the gimprc file that is considered extraneous to the operation of the GIMP. Plug-ins that need configuration information can use this function to store it, and gimp_gimprc_query to retrieve it. This will accept _only_ string values in UTF-8 encoding.",
177
 
  "Seth Burgess",
178
 
  "Seth Burgess",
179
 
  "1999",
180
 
  NULL,
181
 
  GIMP_INTERNAL,
182
 
  2,
183
 
  gimprc_set_inargs,
184
 
  0,
185
 
  NULL,
186
 
  { { gimprc_set_invoker } }
187
 
};
188
 
 
189
 
static Argument *
190
 
get_default_comment_invoker (Gimp         *gimp,
191
 
                             GimpContext  *context,
192
 
                             GimpProgress *progress,
193
 
                             Argument     *args)
194
 
{
195
 
  Argument *return_args;
196
 
  gchar *comment;
 
108
static GValueArray *
 
109
get_default_comment_invoker (GimpProcedure     *procedure,
 
110
                             Gimp              *gimp,
 
111
                             GimpContext       *context,
 
112
                             GimpProgress      *progress,
 
113
                             const GValueArray *args)
 
114
{
 
115
  GValueArray *return_vals;
 
116
  gchar *comment = NULL;
197
117
 
198
118
  comment = g_strdup (gimp->config->default_image->comment);
199
119
 
200
 
  return_args = procedural_db_return_args (&get_default_comment_proc, TRUE);
201
 
  return_args[1].value.pdb_pointer = comment;
202
 
 
203
 
  return return_args;
204
 
}
205
 
 
206
 
static ProcArg get_default_comment_outargs[] =
207
 
{
208
 
  {
209
 
    GIMP_PDB_STRING,
210
 
    "comment",
211
 
    "Default Image Comment"
212
 
  }
213
 
};
214
 
 
215
 
static ProcRecord get_default_comment_proc =
216
 
{
217
 
  "gimp_get_default_comment",
218
 
  "Get the default image comment as specified in the Preferences.",
219
 
  "Returns a copy of the default image comment.",
220
 
  "Spencer Kimball & Peter Mattis",
221
 
  "Spencer Kimball & Peter Mattis",
222
 
  "1995-1996",
223
 
  NULL,
224
 
  GIMP_INTERNAL,
225
 
  0,
226
 
  NULL,
227
 
  1,
228
 
  get_default_comment_outargs,
229
 
  { { get_default_comment_invoker } }
230
 
};
231
 
 
232
 
static Argument *
233
 
get_monitor_resolution_invoker (Gimp         *gimp,
234
 
                                GimpContext  *context,
235
 
                                GimpProgress *progress,
236
 
                                Argument     *args)
237
 
{
238
 
  Argument *return_args;
239
 
  gdouble xres;
240
 
  gdouble yres;
 
120
  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
 
121
  g_value_take_string (&return_vals->values[1], comment);
 
122
 
 
123
  return return_vals;
 
124
}
 
125
 
 
126
static GValueArray *
 
127
get_default_unit_invoker (GimpProcedure     *procedure,
 
128
                          Gimp              *gimp,
 
129
                          GimpContext       *context,
 
130
                          GimpProgress      *progress,
 
131
                          const GValueArray *args)
 
132
{
 
133
  GValueArray *return_vals;
 
134
  GimpUnit unit_id = 0;
 
135
 
 
136
  unit_id = gimp_get_default_unit ();
 
137
 
 
138
  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
 
139
  g_value_set_int (&return_vals->values[1], unit_id);
 
140
 
 
141
  return return_vals;
 
142
}
 
143
 
 
144
static GValueArray *
 
145
get_monitor_resolution_invoker (GimpProcedure     *procedure,
 
146
                                Gimp              *gimp,
 
147
                                GimpContext       *context,
 
148
                                GimpProgress      *progress,
 
149
                                const GValueArray *args)
 
150
{
 
151
  GValueArray *return_vals;
 
152
  gdouble xres = 0.0;
 
153
  gdouble yres = 0.0;
241
154
 
242
155
  xres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_xres;
243
156
  yres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_yres;
244
157
 
245
 
  return_args = procedural_db_return_args (&get_monitor_resolution_proc, TRUE);
246
 
 
247
 
  return_args[1].value.pdb_float = xres;
248
 
  return_args[2].value.pdb_float = yres;
249
 
 
250
 
  return return_args;
 
158
  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
 
159
 
 
160
  g_value_set_double (&return_vals->values[1], xres);
 
161
  g_value_set_double (&return_vals->values[2], yres);
 
162
 
 
163
  return return_vals;
251
164
}
252
165
 
253
 
static ProcArg get_monitor_resolution_outargs[] =
254
 
{
255
 
  {
256
 
    GIMP_PDB_FLOAT,
257
 
    "xres",
258
 
    "X resolution"
259
 
  },
260
 
  {
261
 
    GIMP_PDB_FLOAT,
262
 
    "yres",
263
 
    "Y resolution"
264
 
  }
265
 
};
266
 
 
267
 
static ProcRecord get_monitor_resolution_proc =
268
 
{
269
 
  "gimp_get_monitor_resolution",
270
 
  "Get the monitor resolution as specified in the Preferences.",
271
 
  "Returns the resolution of the monitor in pixels/inch. This value is taken from the Preferences (or the windowing system if this is set in the Preferences) and there's no guarantee for the value to be reasonable.",
272
 
  "Spencer Kimball & Peter Mattis",
273
 
  "Spencer Kimball & Peter Mattis",
274
 
  "1995-1996",
275
 
  NULL,
276
 
  GIMP_INTERNAL,
277
 
  0,
278
 
  NULL,
279
 
  2,
280
 
  get_monitor_resolution_outargs,
281
 
  { { get_monitor_resolution_invoker } }
282
 
};
283
 
 
284
 
static Argument *
285
 
get_theme_dir_invoker (Gimp         *gimp,
286
 
                       GimpContext  *context,
287
 
                       GimpProgress *progress,
288
 
                       Argument     *args)
289
 
{
290
 
  Argument *return_args;
291
 
  gchar *theme_dir;
 
166
static GValueArray *
 
167
get_theme_dir_invoker (GimpProcedure     *procedure,
 
168
                       Gimp              *gimp,
 
169
                       GimpContext       *context,
 
170
                       GimpProgress      *progress,
 
171
                       const GValueArray *args)
 
172
{
 
173
  GValueArray *return_vals;
 
174
  gchar *theme_dir = NULL;
292
175
 
293
176
  theme_dir = g_strdup (gimp_get_theme_dir (gimp));
294
177
 
295
 
  return_args = procedural_db_return_args (&get_theme_dir_proc, TRUE);
296
 
  return_args[1].value.pdb_pointer = theme_dir;
297
 
 
298
 
  return return_args;
299
 
}
300
 
 
301
 
static ProcArg get_theme_dir_outargs[] =
302
 
{
303
 
  {
304
 
    GIMP_PDB_STRING,
305
 
    "theme_dir",
306
 
    "The GUI theme dir"
307
 
  }
308
 
};
309
 
 
310
 
static ProcRecord get_theme_dir_proc =
311
 
{
312
 
  "gimp_get_theme_dir",
313
 
  "Get the directory of the current GUI theme.",
314
 
  "Returns a copy of the current GUI theme dir.",
315
 
  "Spencer Kimball & Peter Mattis",
316
 
  "Spencer Kimball & Peter Mattis",
317
 
  "1995-1996",
318
 
  NULL,
319
 
  GIMP_INTERNAL,
320
 
  0,
321
 
  NULL,
322
 
  1,
323
 
  get_theme_dir_outargs,
324
 
  { { get_theme_dir_invoker } }
325
 
};
326
 
 
327
 
static Argument *
328
 
get_module_load_inhibit_invoker (Gimp         *gimp,
329
 
                                 GimpContext  *context,
330
 
                                 GimpProgress *progress,
331
 
                                 Argument     *args)
332
 
{
333
 
  Argument *return_args;
334
 
  gchar *load_inhibit;
 
178
  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
 
179
  g_value_take_string (&return_vals->values[1], theme_dir);
 
180
 
 
181
  return return_vals;
 
182
}
 
183
 
 
184
static GValueArray *
 
185
get_color_configuration_invoker (GimpProcedure     *procedure,
 
186
                                 Gimp              *gimp,
 
187
                                 GimpContext       *context,
 
188
                                 GimpProgress      *progress,
 
189
                                 const GValueArray *args)
 
190
{
 
191
  GValueArray *return_vals;
 
192
  gchar *config = NULL;
 
193
 
 
194
  config = gimp_config_serialize_to_string (GIMP_CONFIG (gimp->config->color_management), NULL);
 
195
 
 
196
  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
 
197
  g_value_take_string (&return_vals->values[1], config);
 
198
 
 
199
  return return_vals;
 
200
}
 
201
 
 
202
static GValueArray *
 
203
get_module_load_inhibit_invoker (GimpProcedure     *procedure,
 
204
                                 Gimp              *gimp,
 
205
                                 GimpContext       *context,
 
206
                                 GimpProgress      *progress,
 
207
                                 const GValueArray *args)
 
208
{
 
209
  GValueArray *return_vals;
 
210
  gchar *load_inhibit = NULL;
335
211
 
336
212
  load_inhibit = g_strdup (gimp_module_db_get_load_inhibit (gimp->module_db));
337
213
 
338
 
  return_args = procedural_db_return_args (&get_module_load_inhibit_proc, TRUE);
339
 
  return_args[1].value.pdb_pointer = load_inhibit;
340
 
 
341
 
  return return_args;
342
 
}
343
 
 
344
 
static ProcArg get_module_load_inhibit_outargs[] =
345
 
{
346
 
  {
347
 
    GIMP_PDB_STRING,
348
 
    "load_inhibit",
349
 
    "The list of modules"
350
 
  }
351
 
};
352
 
 
353
 
static ProcRecord get_module_load_inhibit_proc =
354
 
{
355
 
  "gimp_get_module_load_inhibit",
356
 
  "Get the list of modules which should not be loaded.",
357
 
  "Returns a copy of the list of modules which should not be loaded.",
358
 
  "Spencer Kimball & Peter Mattis",
359
 
  "Spencer Kimball & Peter Mattis",
360
 
  "1995-1996",
361
 
  NULL,
362
 
  GIMP_INTERNAL,
363
 
  0,
364
 
  NULL,
365
 
  1,
366
 
  get_module_load_inhibit_outargs,
367
 
  { { get_module_load_inhibit_invoker } }
368
 
};
 
214
  return_vals = gimp_procedure_get_return_values (procedure, TRUE);
 
215
  g_value_take_string (&return_vals->values[1], load_inhibit);
 
216
 
 
217
  return return_vals;
 
218
}
 
219
 
 
220
void
 
221
register_gimprc_procs (GimpPDB *pdb)
 
222
{
 
223
  GimpProcedure *procedure;
 
224
 
 
225
  /*
 
226
   * gimp-gimprc-query
 
227
   */
 
228
  procedure = gimp_procedure_new (gimprc_query_invoker);
 
229
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-gimprc-query");
 
230
  gimp_procedure_set_static_strings (procedure,
 
231
                                     "gimp-gimprc-query",
 
232
                                     "Queries the gimprc file parser for information on a specified token.",
 
233
                                     "This procedure is used to locate additional information contained in the gimprc file considered extraneous to the operation of the GIMP. Plug-ins that need configuration information can expect it will be stored in the user gimprc file and can use this procedure to retrieve it. This query procedure will return the value associated with the specified token. This corresponds _only_ to entries with the format: (<token> <value>). The value must be a string. Entries not corresponding to this format will cause warnings to be issued on gimprc parsing and will not be queryable.",
 
234
                                     "Spencer Kimball & Peter Mattis",
 
235
                                     "Spencer Kimball & Peter Mattis",
 
236
                                     "1997",
 
237
                                     NULL);
 
238
  gimp_procedure_add_argument (procedure,
 
239
                               gimp_param_spec_string ("token",
 
240
                                                       "token",
 
241
                                                       "The token to query for",
 
242
                                                       FALSE, FALSE,
 
243
                                                       NULL,
 
244
                                                       GIMP_PARAM_READWRITE));
 
245
  gimp_procedure_add_return_value (procedure,
 
246
                                   gimp_param_spec_string ("value",
 
247
                                                           "value",
 
248
                                                           "The value associated with the queried token",
 
249
                                                           FALSE, FALSE,
 
250
                                                           NULL,
 
251
                                                           GIMP_PARAM_READWRITE));
 
252
  gimp_pdb_register_procedure (pdb, procedure);
 
253
  g_object_unref (procedure);
 
254
 
 
255
  /*
 
256
   * gimp-gimprc-set
 
257
   */
 
258
  procedure = gimp_procedure_new (gimprc_set_invoker);
 
259
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-gimprc-set");
 
260
  gimp_procedure_set_static_strings (procedure,
 
261
                                     "gimp-gimprc-set",
 
262
                                     "Sets a gimprc token to a value and saves it in the gimprc.",
 
263
                                     "This procedure is used to add or change additional information in the gimprc file that is considered extraneous to the operation of the GIMP. Plug-ins that need configuration information can use this function to store it, and 'gimp-gimprc-query' to retrieve it. This will accept _only_ string values in UTF-8 encoding.",
 
264
                                     "Seth Burgess",
 
265
                                     "Seth Burgess",
 
266
                                     "1999",
 
267
                                     NULL);
 
268
  gimp_procedure_add_argument (procedure,
 
269
                               gimp_param_spec_string ("token",
 
270
                                                       "token",
 
271
                                                       "The token to add or modify",
 
272
                                                       FALSE, FALSE,
 
273
                                                       NULL,
 
274
                                                       GIMP_PARAM_READWRITE));
 
275
  gimp_procedure_add_argument (procedure,
 
276
                               gimp_param_spec_string ("value",
 
277
                                                       "value",
 
278
                                                       "The value to set the token to",
 
279
                                                       FALSE, FALSE,
 
280
                                                       NULL,
 
281
                                                       GIMP_PARAM_READWRITE));
 
282
  gimp_pdb_register_procedure (pdb, procedure);
 
283
  g_object_unref (procedure);
 
284
 
 
285
  /*
 
286
   * gimp-get-default-comment
 
287
   */
 
288
  procedure = gimp_procedure_new (get_default_comment_invoker);
 
289
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-get-default-comment");
 
290
  gimp_procedure_set_static_strings (procedure,
 
291
                                     "gimp-get-default-comment",
 
292
                                     "Get the default image comment as specified in the Preferences.",
 
293
                                     "Returns a copy of the default image comment.",
 
294
                                     "Spencer Kimball & Peter Mattis",
 
295
                                     "Spencer Kimball & Peter Mattis",
 
296
                                     "1995-1996",
 
297
                                     NULL);
 
298
  gimp_procedure_add_return_value (procedure,
 
299
                                   gimp_param_spec_string ("comment",
 
300
                                                           "comment",
 
301
                                                           "Default image comment",
 
302
                                                           FALSE, FALSE,
 
303
                                                           NULL,
 
304
                                                           GIMP_PARAM_READWRITE));
 
305
  gimp_pdb_register_procedure (pdb, procedure);
 
306
  g_object_unref (procedure);
 
307
 
 
308
  /*
 
309
   * gimp-get-default-unit
 
310
   */
 
311
  procedure = gimp_procedure_new (get_default_unit_invoker);
 
312
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-get-default-unit");
 
313
  gimp_procedure_set_static_strings (procedure,
 
314
                                     "gimp-get-default-unit",
 
315
                                     "Get the default unit (taken from the user's locale).",
 
316
                                     "Returns the default unit's integer ID.",
 
317
                                     "Spencer Kimball & Peter Mattis",
 
318
                                     "Spencer Kimball & Peter Mattis",
 
319
                                     "1995-1996",
 
320
                                     NULL);
 
321
  gimp_procedure_add_return_value (procedure,
 
322
                                   gimp_param_spec_unit ("unit-id",
 
323
                                                         "unit id",
 
324
                                                         "Default unit",
 
325
                                                         TRUE,
 
326
                                                         FALSE,
 
327
                                                         GIMP_UNIT_PIXEL,
 
328
                                                         GIMP_PARAM_READWRITE));
 
329
  gimp_pdb_register_procedure (pdb, procedure);
 
330
  g_object_unref (procedure);
 
331
 
 
332
  /*
 
333
   * gimp-get-monitor-resolution
 
334
   */
 
335
  procedure = gimp_procedure_new (get_monitor_resolution_invoker);
 
336
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-get-monitor-resolution");
 
337
  gimp_procedure_set_static_strings (procedure,
 
338
                                     "gimp-get-monitor-resolution",
 
339
                                     "Get the monitor resolution as specified in the Preferences.",
 
340
                                     "Returns the resolution of the monitor in pixels/inch. This value is taken from the Preferences (or the windowing system if this is set in the Preferences) and there's no guarantee for the value to be reasonable.",
 
341
                                     "Spencer Kimball & Peter Mattis",
 
342
                                     "Spencer Kimball & Peter Mattis",
 
343
                                     "1995-1996",
 
344
                                     NULL);
 
345
  gimp_procedure_add_return_value (procedure,
 
346
                                   g_param_spec_double ("xres",
 
347
                                                        "xres",
 
348
                                                        "X resolution",
 
349
                                                        -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
350
                                                        GIMP_PARAM_READWRITE));
 
351
  gimp_procedure_add_return_value (procedure,
 
352
                                   g_param_spec_double ("yres",
 
353
                                                        "yres",
 
354
                                                        "Y resolution",
 
355
                                                        -G_MAXDOUBLE, G_MAXDOUBLE, 0,
 
356
                                                        GIMP_PARAM_READWRITE));
 
357
  gimp_pdb_register_procedure (pdb, procedure);
 
358
  g_object_unref (procedure);
 
359
 
 
360
  /*
 
361
   * gimp-get-theme-dir
 
362
   */
 
363
  procedure = gimp_procedure_new (get_theme_dir_invoker);
 
364
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-get-theme-dir");
 
365
  gimp_procedure_set_static_strings (procedure,
 
366
                                     "gimp-get-theme-dir",
 
367
                                     "Get the directory of the current GUI theme.",
 
368
                                     "Returns a copy of the current GUI theme dir.",
 
369
                                     "Spencer Kimball & Peter Mattis",
 
370
                                     "Spencer Kimball & Peter Mattis",
 
371
                                     "1995-1996",
 
372
                                     NULL);
 
373
  gimp_procedure_add_return_value (procedure,
 
374
                                   gimp_param_spec_string ("theme-dir",
 
375
                                                           "theme dir",
 
376
                                                           "The GUI theme dir",
 
377
                                                           FALSE, FALSE,
 
378
                                                           NULL,
 
379
                                                           GIMP_PARAM_READWRITE));
 
380
  gimp_pdb_register_procedure (pdb, procedure);
 
381
  g_object_unref (procedure);
 
382
 
 
383
  /*
 
384
   * gimp-get-color-configuration
 
385
   */
 
386
  procedure = gimp_procedure_new (get_color_configuration_invoker);
 
387
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-get-color-configuration");
 
388
  gimp_procedure_set_static_strings (procedure,
 
389
                                     "gimp-get-color-configuration",
 
390
                                     "Get a serialized version of the color management configuration.",
 
391
                                     "Returns a string that can be deserialized into a GimpColorConfig object representing the current color management configuration.",
 
392
                                     "Sven Neumann <sven@gimp.org>",
 
393
                                     "Sven Neumann",
 
394
                                     "2005",
 
395
                                     NULL);
 
396
  gimp_procedure_add_return_value (procedure,
 
397
                                   gimp_param_spec_string ("config",
 
398
                                                           "config",
 
399
                                                           "Serialized color management configuration",
 
400
                                                           FALSE, FALSE,
 
401
                                                           NULL,
 
402
                                                           GIMP_PARAM_READWRITE));
 
403
  gimp_pdb_register_procedure (pdb, procedure);
 
404
  g_object_unref (procedure);
 
405
 
 
406
  /*
 
407
   * gimp-get-module-load-inhibit
 
408
   */
 
409
  procedure = gimp_procedure_new (get_module_load_inhibit_invoker);
 
410
  gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-get-module-load-inhibit");
 
411
  gimp_procedure_set_static_strings (procedure,
 
412
                                     "gimp-get-module-load-inhibit",
 
413
                                     "Get the list of modules which should not be loaded.",
 
414
                                     "Returns a copy of the list of modules which should not be loaded.",
 
415
                                     "Spencer Kimball & Peter Mattis",
 
416
                                     "Spencer Kimball & Peter Mattis",
 
417
                                     "1995-1996",
 
418
                                     NULL);
 
419
  gimp_procedure_add_return_value (procedure,
 
420
                                   gimp_param_spec_string ("load-inhibit",
 
421
                                                           "load inhibit",
 
422
                                                           "The list of modules",
 
423
                                                           FALSE, FALSE,
 
424
                                                           NULL,
 
425
                                                           GIMP_PARAM_READWRITE));
 
426
  gimp_pdb_register_procedure (pdb, procedure);
 
427
  g_object_unref (procedure);
 
428
}