155
return procedural_db_return_args (&gimprc_set_proc, success);
105
return gimp_procedure_get_return_values (procedure, success);
158
static ProcArg gimprc_set_inargs[] =
163
"The token to add or modify"
168
"The value to set the token to"
172
static ProcRecord gimprc_set_proc =
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.",
186
{ { gimprc_set_invoker } }
190
get_default_comment_invoker (Gimp *gimp,
191
GimpContext *context,
192
GimpProgress *progress,
195
Argument *return_args;
109
get_default_comment_invoker (GimpProcedure *procedure,
111
GimpContext *context,
112
GimpProgress *progress,
113
const GValueArray *args)
115
GValueArray *return_vals;
116
gchar *comment = NULL;
198
118
comment = g_strdup (gimp->config->default_image->comment);
200
return_args = procedural_db_return_args (&get_default_comment_proc, TRUE);
201
return_args[1].value.pdb_pointer = comment;
206
static ProcArg get_default_comment_outargs[] =
211
"Default Image Comment"
215
static ProcRecord get_default_comment_proc =
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",
228
get_default_comment_outargs,
229
{ { get_default_comment_invoker } }
233
get_monitor_resolution_invoker (Gimp *gimp,
234
GimpContext *context,
235
GimpProgress *progress,
238
Argument *return_args;
120
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
121
g_value_take_string (&return_vals->values[1], comment);
127
get_default_unit_invoker (GimpProcedure *procedure,
129
GimpContext *context,
130
GimpProgress *progress,
131
const GValueArray *args)
133
GValueArray *return_vals;
134
GimpUnit unit_id = 0;
136
unit_id = gimp_get_default_unit ();
138
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
139
g_value_set_int (&return_vals->values[1], unit_id);
145
get_monitor_resolution_invoker (GimpProcedure *procedure,
147
GimpContext *context,
148
GimpProgress *progress,
149
const GValueArray *args)
151
GValueArray *return_vals;
242
155
xres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_xres;
243
156
yres = GIMP_DISPLAY_CONFIG (gimp->config)->monitor_yres;
245
return_args = procedural_db_return_args (&get_monitor_resolution_proc, TRUE);
247
return_args[1].value.pdb_float = xres;
248
return_args[2].value.pdb_float = yres;
158
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
160
g_value_set_double (&return_vals->values[1], xres);
161
g_value_set_double (&return_vals->values[2], yres);
253
static ProcArg get_monitor_resolution_outargs[] =
267
static ProcRecord get_monitor_resolution_proc =
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",
280
get_monitor_resolution_outargs,
281
{ { get_monitor_resolution_invoker } }
285
get_theme_dir_invoker (Gimp *gimp,
286
GimpContext *context,
287
GimpProgress *progress,
290
Argument *return_args;
167
get_theme_dir_invoker (GimpProcedure *procedure,
169
GimpContext *context,
170
GimpProgress *progress,
171
const GValueArray *args)
173
GValueArray *return_vals;
174
gchar *theme_dir = NULL;
293
176
theme_dir = g_strdup (gimp_get_theme_dir (gimp));
295
return_args = procedural_db_return_args (&get_theme_dir_proc, TRUE);
296
return_args[1].value.pdb_pointer = theme_dir;
301
static ProcArg get_theme_dir_outargs[] =
310
static ProcRecord get_theme_dir_proc =
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",
323
get_theme_dir_outargs,
324
{ { get_theme_dir_invoker } }
328
get_module_load_inhibit_invoker (Gimp *gimp,
329
GimpContext *context,
330
GimpProgress *progress,
333
Argument *return_args;
178
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
179
g_value_take_string (&return_vals->values[1], theme_dir);
185
get_color_configuration_invoker (GimpProcedure *procedure,
187
GimpContext *context,
188
GimpProgress *progress,
189
const GValueArray *args)
191
GValueArray *return_vals;
192
gchar *config = NULL;
194
config = gimp_config_serialize_to_string (GIMP_CONFIG (gimp->config->color_management), NULL);
196
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
197
g_value_take_string (&return_vals->values[1], config);
203
get_module_load_inhibit_invoker (GimpProcedure *procedure,
205
GimpContext *context,
206
GimpProgress *progress,
207
const GValueArray *args)
209
GValueArray *return_vals;
210
gchar *load_inhibit = NULL;
336
212
load_inhibit = g_strdup (gimp_module_db_get_load_inhibit (gimp->module_db));
338
return_args = procedural_db_return_args (&get_module_load_inhibit_proc, TRUE);
339
return_args[1].value.pdb_pointer = load_inhibit;
344
static ProcArg get_module_load_inhibit_outargs[] =
349
"The list of modules"
353
static ProcRecord get_module_load_inhibit_proc =
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",
366
get_module_load_inhibit_outargs,
367
{ { get_module_load_inhibit_invoker } }
214
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
215
g_value_take_string (&return_vals->values[1], load_inhibit);
221
register_gimprc_procs (GimpPDB *pdb)
223
GimpProcedure *procedure;
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,
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",
238
gimp_procedure_add_argument (procedure,
239
gimp_param_spec_string ("token",
241
"The token to query for",
244
GIMP_PARAM_READWRITE));
245
gimp_procedure_add_return_value (procedure,
246
gimp_param_spec_string ("value",
248
"The value associated with the queried token",
251
GIMP_PARAM_READWRITE));
252
gimp_pdb_register_procedure (pdb, procedure);
253
g_object_unref (procedure);
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,
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.",
268
gimp_procedure_add_argument (procedure,
269
gimp_param_spec_string ("token",
271
"The token to add or modify",
274
GIMP_PARAM_READWRITE));
275
gimp_procedure_add_argument (procedure,
276
gimp_param_spec_string ("value",
278
"The value to set the token to",
281
GIMP_PARAM_READWRITE));
282
gimp_pdb_register_procedure (pdb, procedure);
283
g_object_unref (procedure);
286
* gimp-get-default-comment
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",
298
gimp_procedure_add_return_value (procedure,
299
gimp_param_spec_string ("comment",
301
"Default image comment",
304
GIMP_PARAM_READWRITE));
305
gimp_pdb_register_procedure (pdb, procedure);
306
g_object_unref (procedure);
309
* gimp-get-default-unit
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",
321
gimp_procedure_add_return_value (procedure,
322
gimp_param_spec_unit ("unit-id",
328
GIMP_PARAM_READWRITE));
329
gimp_pdb_register_procedure (pdb, procedure);
330
g_object_unref (procedure);
333
* gimp-get-monitor-resolution
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",
345
gimp_procedure_add_return_value (procedure,
346
g_param_spec_double ("xres",
349
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
350
GIMP_PARAM_READWRITE));
351
gimp_procedure_add_return_value (procedure,
352
g_param_spec_double ("yres",
355
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
356
GIMP_PARAM_READWRITE));
357
gimp_pdb_register_procedure (pdb, procedure);
358
g_object_unref (procedure);
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",
373
gimp_procedure_add_return_value (procedure,
374
gimp_param_spec_string ("theme-dir",
379
GIMP_PARAM_READWRITE));
380
gimp_pdb_register_procedure (pdb, procedure);
381
g_object_unref (procedure);
384
* gimp-get-color-configuration
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>",
396
gimp_procedure_add_return_value (procedure,
397
gimp_param_spec_string ("config",
399
"Serialized color management configuration",
402
GIMP_PARAM_READWRITE));
403
gimp_pdb_register_procedure (pdb, procedure);
404
g_object_unref (procedure);
407
* gimp-get-module-load-inhibit
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",
419
gimp_procedure_add_return_value (procedure,
420
gimp_param_spec_string ("load-inhibit",
422
"The list of modules",
425
GIMP_PARAM_READWRITE));
426
gimp_pdb_register_procedure (pdb, procedure);
427
g_object_unref (procedure);