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

« back to all changes in this revision

Viewing changes to app/plug-in/plug-in-rc.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 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * plug-in-rc.c
25
25
 
26
26
#include "libgimpbase/gimpbase.h"
27
27
#include "libgimpbase/gimpprotocol.h"
 
28
#include "libgimpconfig/gimpconfig.h"
28
29
 
29
30
#include "plug-in-types.h"
30
31
 
31
 
#include "config/gimpconfig-error.h"
32
 
#include "config/gimpconfigwriter.h"
33
 
#include "config/gimpscanner.h"
34
 
 
35
32
#include "core/gimp.h"
36
33
 
37
 
#include "plug-ins.h"
38
 
#include "plug-in-def.h"
39
 
#include "plug-in-proc-def.h"
 
34
#include "pdb/gimp-pdb-compat.h"
 
35
 
 
36
#include "gimpplugindef.h"
 
37
#include "gimppluginprocedure.h"
40
38
#include "plug-in-rc.h"
41
39
 
42
40
#include "gimp-intl.h"
47
45
 *  or the GTokenType they would have expected but didn't get.
48
46
 */
49
47
 
50
 
static GTokenType plug_in_def_deserialize        (Gimp          *gimp,
51
 
                                                  GScanner      *scanner);
52
 
static GTokenType plug_in_proc_def_deserialize   (GScanner      *scanner,
53
 
                                                  PlugInProcDef *proc_def);
54
 
static GTokenType plug_in_menu_path_deserialize  (GScanner      *scanner,
55
 
                                                  PlugInProcDef *proc_def);
56
 
static GTokenType plug_in_icon_deserialize       (GScanner      *scanner,
57
 
                                                  PlugInProcDef *proc_def);
58
 
static GTokenType plug_in_proc_arg_deserialize   (GScanner      *scanner,
59
 
                                                  ProcArg       *arg);
60
 
static GTokenType plug_in_extra_deserialize      (GScanner      *scanner,
61
 
                                                  PlugInProcDef *proc_def);
62
 
static GTokenType plug_in_locale_def_deserialize (GScanner      *scanner,
63
 
                                                  PlugInDef     *plug_in_def);
64
 
static GTokenType plug_in_help_def_deserialize   (GScanner      *scanner,
65
 
                                                  PlugInDef     *plug_in_def);
66
 
static GTokenType plug_in_has_init_deserialize   (GScanner      *scanner,
67
 
                                                  PlugInDef     *plug_in_def);
 
48
static GTokenType plug_in_def_deserialize        (Gimp                 *gimp,
 
49
                                                  GScanner             *scanner,
 
50
                                                  GSList              **plug_in_defs);
 
51
static GTokenType plug_in_procedure_deserialize  (GScanner             *scanner,
 
52
                                                  Gimp                 *gimp,
 
53
                                                  const gchar          *prog,
 
54
                                                  GimpPlugInProcedure **proc);
 
55
static GTokenType plug_in_menu_path_deserialize  (GScanner             *scanner,
 
56
                                                  GimpPlugInProcedure  *proc);
 
57
static GTokenType plug_in_icon_deserialize       (GScanner             *scanner,
 
58
                                                  GimpPlugInProcedure  *proc);
 
59
static GTokenType plug_in_file_proc_deserialize  (GScanner             *scanner,
 
60
                                                  GimpPlugInProcedure  *proc);
 
61
static GTokenType plug_in_proc_arg_deserialize   (GScanner             *scanner,
 
62
                                                  Gimp                 *gimp,
 
63
                                                  GimpProcedure        *procedure,
 
64
                                                  gboolean              return_value);
 
65
static GTokenType plug_in_locale_def_deserialize (GScanner             *scanner,
 
66
                                                  GimpPlugInDef        *plug_in_def);
 
67
static GTokenType plug_in_help_def_deserialize   (GScanner             *scanner,
 
68
                                                  GimpPlugInDef        *plug_in_def);
 
69
static GTokenType plug_in_has_init_deserialize   (GScanner             *scanner,
 
70
                                                  GimpPlugInDef        *plug_in_def);
68
71
 
69
72
 
70
73
enum
78
81
  PROC_ARG,
79
82
  MENU_PATH,
80
83
  ICON,
 
84
  LOAD_PROC,
 
85
  SAVE_PROC,
 
86
  EXTENSION,
 
87
  PREFIX,
 
88
  MAGIC,
81
89
  MIME_TYPE,
82
90
  THUMB_LOADER
83
91
};
84
92
 
85
93
 
86
 
gboolean
 
94
GSList *
87
95
plug_in_rc_parse (Gimp         *gimp,
88
96
                  const gchar  *filename,
89
97
                  GError      **error)
90
98
{
91
99
  GScanner   *scanner;
92
100
  GEnumClass *enum_class;
 
101
  GSList     *plug_in_defs = NULL;
 
102
  gint        version      = GIMP_PROTOCOL_VERSION;
93
103
  GTokenType  token;
94
 
  gboolean    retval  = FALSE;
95
 
  gint        version = GIMP_PROTOCOL_VERSION;
96
104
 
97
105
  g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
98
106
  g_return_val_if_fail (filename != NULL, FALSE);
101
109
  scanner = gimp_scanner_new_file (filename, error);
102
110
 
103
111
  if (! scanner)
104
 
    return FALSE;
 
112
    return NULL;
105
113
 
106
114
  enum_class = g_type_class_ref (GIMP_TYPE_ICON_TYPE);
107
115
 
110
118
                              GINT_TO_POINTER (PROTOCOL_VERSION));
111
119
  g_scanner_scope_add_symbol (scanner, 0,
112
120
                              "plug-in-def", GINT_TO_POINTER (PLUG_IN_DEF));
 
121
 
113
122
  g_scanner_scope_add_symbol (scanner, PLUG_IN_DEF,
114
123
                              "proc-def", GINT_TO_POINTER (PROC_DEF));
115
124
  g_scanner_scope_add_symbol (scanner, PLUG_IN_DEF,
125
134
  g_scanner_scope_add_symbol (scanner, PLUG_IN_DEF,
126
135
                              "icon", GINT_TO_POINTER (ICON));
127
136
  g_scanner_scope_add_symbol (scanner, PLUG_IN_DEF,
 
137
                              "load-proc", GINT_TO_POINTER (LOAD_PROC));
 
138
  g_scanner_scope_add_symbol (scanner, PLUG_IN_DEF,
 
139
                              "save-proc", GINT_TO_POINTER (SAVE_PROC));
 
140
 
 
141
  g_scanner_scope_add_symbol (scanner, LOAD_PROC,
 
142
                              "extension", GINT_TO_POINTER (EXTENSION));
 
143
  g_scanner_scope_add_symbol (scanner, LOAD_PROC,
 
144
                              "prefix", GINT_TO_POINTER (PREFIX));
 
145
  g_scanner_scope_add_symbol (scanner, LOAD_PROC,
 
146
                              "magic", GINT_TO_POINTER (MAGIC));
 
147
  g_scanner_scope_add_symbol (scanner, LOAD_PROC,
128
148
                              "mime-type", GINT_TO_POINTER (MIME_TYPE));
129
 
  g_scanner_scope_add_symbol (scanner, PLUG_IN_DEF,
 
149
  g_scanner_scope_add_symbol (scanner, LOAD_PROC,
130
150
                              "thumb-loader", GINT_TO_POINTER (THUMB_LOADER));
131
151
 
 
152
  g_scanner_scope_add_symbol (scanner, SAVE_PROC,
 
153
                              "extension", GINT_TO_POINTER (EXTENSION));
 
154
  g_scanner_scope_add_symbol (scanner, SAVE_PROC,
 
155
                              "prefix", GINT_TO_POINTER (PREFIX));
 
156
  g_scanner_scope_add_symbol (scanner, SAVE_PROC,
 
157
                              "mime-type", GINT_TO_POINTER (MIME_TYPE));
 
158
 
132
159
  token = G_TOKEN_LEFT_PAREN;
133
160
 
134
161
  while (version == GIMP_PROTOCOL_VERSION &&
152
179
              break;
153
180
            case PLUG_IN_DEF:
154
181
              g_scanner_set_scope (scanner, PLUG_IN_DEF);
155
 
              token = plug_in_def_deserialize (gimp, scanner);
 
182
              token = plug_in_def_deserialize (gimp, scanner, &plug_in_defs);
156
183
              g_scanner_set_scope (scanner, 0);
157
184
              break;
158
185
            default:
169
196
        }
170
197
    }
171
198
 
172
 
  if (version != GIMP_PROTOCOL_VERSION)
173
 
    {
174
 
      g_set_error (error,
175
 
                   GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_VERSION,
176
 
                   _("Skipping '%s': wrong GIMP protocol version."),
177
 
                   gimp_filename_to_utf8 (filename));
178
 
    }
179
 
  else if (token != G_TOKEN_LEFT_PAREN)
180
 
    {
181
 
      g_scanner_get_next_token (scanner);
182
 
      g_scanner_unexp_token (scanner, token, NULL, NULL, NULL,
183
 
                             _("fatal parse error"), TRUE);
184
 
    }
185
 
  else
186
 
    {
187
 
      retval = TRUE;
 
199
  if (version != GIMP_PROTOCOL_VERSION ||
 
200
      token   != G_TOKEN_LEFT_PAREN)
 
201
    {
 
202
      if (version != GIMP_PROTOCOL_VERSION)
 
203
        {
 
204
          g_set_error (error,
 
205
                       GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_VERSION,
 
206
                       _("Skipping '%s': wrong GIMP protocol version."),
 
207
                       gimp_filename_to_utf8 (filename));
 
208
        }
 
209
      else
 
210
        {
 
211
          g_scanner_get_next_token (scanner);
 
212
          g_scanner_unexp_token (scanner, token, NULL, NULL, NULL,
 
213
                                 _("fatal parse error"), TRUE);
 
214
        }
 
215
 
 
216
      g_slist_foreach (plug_in_defs, (GFunc) g_object_unref, NULL);
 
217
      g_slist_free (plug_in_defs);
 
218
      plug_in_defs = NULL;
188
219
    }
189
220
 
190
221
  g_type_class_unref (enum_class);
191
222
 
192
223
  gimp_scanner_destroy (scanner);
193
224
 
194
 
  return retval;
 
225
  return g_slist_reverse (plug_in_defs);
195
226
}
196
227
 
197
228
static GTokenType
198
 
plug_in_def_deserialize (Gimp     *gimp,
199
 
                         GScanner *scanner)
 
229
plug_in_def_deserialize (Gimp      *gimp,
 
230
                         GScanner  *scanner,
 
231
                         GSList   **plug_in_defs)
200
232
{
201
 
  gchar         *name;
202
 
  PlugInDef     *plug_in_def;
203
 
  PlugInProcDef *proc_def;
204
 
  GTokenType     token;
 
233
  GimpPlugInDef       *plug_in_def;
 
234
  GimpPlugInProcedure *proc = NULL;
 
235
  gchar               *name;
 
236
  gchar               *path;
 
237
  gint                 mtime;
 
238
  GTokenType           token;
205
239
 
206
240
  if (! gimp_scanner_parse_string (scanner, &name))
207
241
    return G_TOKEN_STRING;
208
242
 
209
 
  plug_in_def = plug_in_def_new (name);
 
243
  path = gimp_config_path_expand (name, TRUE, NULL);
210
244
  g_free (name);
211
245
 
212
 
  if (! gimp_scanner_parse_int (scanner, (gint *) &plug_in_def->mtime))
 
246
  plug_in_def = gimp_plug_in_def_new (path);
 
247
  g_free (path);
 
248
 
 
249
  if (! gimp_scanner_parse_int (scanner, &mtime))
213
250
    {
214
 
      plug_in_def_free (plug_in_def, TRUE);
 
251
      g_object_unref (plug_in_def);
215
252
      return G_TOKEN_INT;
216
253
    }
217
254
 
 
255
  plug_in_def->mtime = mtime;
 
256
 
218
257
  token = G_TOKEN_LEFT_PAREN;
219
258
 
220
259
  while (g_scanner_peek_next_token (scanner) == token)
231
270
          switch (GPOINTER_TO_INT (scanner->value.v_symbol))
232
271
            {
233
272
            case PROC_DEF:
234
 
              proc_def = plug_in_proc_def_new ();
235
 
              token = plug_in_proc_def_deserialize (scanner, proc_def);
 
273
              token = plug_in_procedure_deserialize (scanner, gimp,
 
274
                                                     plug_in_def->prog,
 
275
                                                     &proc);
236
276
 
237
277
              if (token == G_TOKEN_LEFT_PAREN)
238
 
                plug_in_def_add_proc_def (plug_in_def, proc_def);
239
 
              else
240
 
                plug_in_proc_def_free (proc_def);
 
278
                gimp_plug_in_def_add_procedure (plug_in_def, proc);
 
279
 
 
280
              if (proc)
 
281
                g_object_unref (proc);
241
282
              break;
242
283
 
243
284
            case LOCALE_DEF:
272
313
 
273
314
      if (gimp_scanner_parse_token (scanner, token))
274
315
        {
275
 
          plug_ins_def_add_from_rc (gimp, plug_in_def);
 
316
          *plug_in_defs = g_slist_prepend (*plug_in_defs, plug_in_def);
276
317
          return G_TOKEN_LEFT_PAREN;
277
318
        }
278
319
    }
279
320
 
280
 
  plug_in_def_free (plug_in_def, TRUE);
 
321
  g_object_unref (plug_in_def);
281
322
 
282
323
  return token;
283
324
}
284
325
 
285
326
static GTokenType
286
 
plug_in_proc_def_deserialize (GScanner      *scanner,
287
 
                              PlugInProcDef *proc_def)
 
327
plug_in_procedure_deserialize (GScanner             *scanner,
 
328
                               Gimp                 *gimp,
 
329
                               const gchar          *prog,
 
330
                               GimpPlugInProcedure **proc)
288
331
{
289
 
  GTokenType token;
290
 
  gint       n_menu_paths;
291
 
  gint       i;
292
 
 
293
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->db_info.name))
294
 
    return G_TOKEN_STRING;
295
 
  if (! gimp_scanner_parse_int (scanner, (gint *) &proc_def->db_info.proc_type))
296
 
    return G_TOKEN_INT;
297
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->db_info.blurb))
298
 
    return G_TOKEN_STRING;
299
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->db_info.help))
300
 
    return G_TOKEN_STRING;
301
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->db_info.author))
302
 
    return G_TOKEN_STRING;
303
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->db_info.copyright))
304
 
    return G_TOKEN_STRING;
305
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->db_info.date))
306
 
    return G_TOKEN_STRING;
307
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->menu_label))
 
332
  GimpProcedure   *procedure;
 
333
  GTokenType       token;
 
334
  gchar           *str;
 
335
  gint             proc_type;
 
336
  gint             n_args;
 
337
  gint             n_return_vals;
 
338
  gint             n_menu_paths;
 
339
  gint             i;
 
340
 
 
341
  if (! gimp_scanner_parse_string (scanner, &str))
 
342
    return G_TOKEN_STRING;
 
343
 
 
344
  if (! gimp_scanner_parse_int (scanner, &proc_type))
 
345
    {
 
346
      g_free (str);
 
347
      return G_TOKEN_INT;
 
348
    }
 
349
 
 
350
  procedure = gimp_plug_in_procedure_new (proc_type, prog);
 
351
 
 
352
  *proc = GIMP_PLUG_IN_PROCEDURE (procedure);
 
353
 
 
354
  gimp_object_take_name (GIMP_OBJECT (procedure),
 
355
                         gimp_canonicalize_identifier (str));
 
356
 
 
357
  procedure->original_name = str;
 
358
 
 
359
  if (! gimp_scanner_parse_string (scanner, &procedure->blurb))
 
360
    return G_TOKEN_STRING;
 
361
  if (! gimp_scanner_parse_string (scanner, &procedure->help))
 
362
    return G_TOKEN_STRING;
 
363
  if (! gimp_scanner_parse_string (scanner, &procedure->author))
 
364
    return G_TOKEN_STRING;
 
365
  if (! gimp_scanner_parse_string (scanner, &procedure->copyright))
 
366
    return G_TOKEN_STRING;
 
367
  if (! gimp_scanner_parse_string (scanner, &procedure->date))
 
368
    return G_TOKEN_STRING;
 
369
  if (! gimp_scanner_parse_string (scanner, &(*proc)->menu_label))
308
370
    return G_TOKEN_STRING;
309
371
 
310
372
  if (! gimp_scanner_parse_int (scanner, &n_menu_paths))
311
 
    return G_TOKEN_STRING;
 
373
    return G_TOKEN_INT;
312
374
 
313
375
  for (i = 0; i < n_menu_paths; i++)
314
376
    {
315
 
      token = plug_in_menu_path_deserialize (scanner, proc_def);
316
 
      if (token != G_TOKEN_LEFT_PAREN)
317
 
        return token;
318
 
    }
319
 
 
320
 
  token = plug_in_icon_deserialize (scanner, proc_def);
321
 
  if (token != G_TOKEN_LEFT_PAREN)
322
 
    return token;
323
 
 
324
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->extensions))
325
 
    return G_TOKEN_STRING;
326
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->prefixes))
327
 
    return G_TOKEN_STRING;
328
 
  if (! gimp_scanner_parse_string_no_validate (scanner, &proc_def->magics))
329
 
    return G_TOKEN_STRING;
330
 
  if (! gimp_scanner_parse_string (scanner, &proc_def->image_types))
331
 
    return G_TOKEN_STRING;
332
 
 
333
 
  proc_def->image_types_val =
334
 
    plug_ins_image_types_parse (proc_def->image_types);
335
 
 
336
 
  if (! gimp_scanner_parse_int (scanner, (gint *) &proc_def->db_info.num_args))
337
 
    return G_TOKEN_INT;
338
 
  if (! gimp_scanner_parse_int (scanner, (gint *) &proc_def->db_info.num_values))
339
 
    return G_TOKEN_INT;
340
 
 
341
 
  if (proc_def->db_info.num_args > 0)
342
 
    proc_def->db_info.args = g_new0 (ProcArg, proc_def->db_info.num_args);
343
 
 
344
 
  for (i = 0; i < proc_def->db_info.num_args; i++)
345
 
    {
346
 
      token = plug_in_proc_arg_deserialize (scanner,
347
 
                                            &proc_def->db_info.args[i]);
348
 
      if (token != G_TOKEN_LEFT_PAREN)
349
 
        return token;
350
 
    }
351
 
 
352
 
  if (proc_def->db_info.num_values > 0)
353
 
    proc_def->db_info.values = g_new0 (ProcArg, proc_def->db_info.num_values);
354
 
 
355
 
  for (i = 0; i < proc_def->db_info.num_values; i++)
356
 
    {
357
 
      token = plug_in_proc_arg_deserialize (scanner,
358
 
                                            &proc_def->db_info.values[i]);
359
 
      if (token != G_TOKEN_LEFT_PAREN)
360
 
        return token;
361
 
    }
362
 
 
363
 
  token = plug_in_extra_deserialize (scanner, proc_def);
364
 
 
365
 
  if (token != G_TOKEN_LEFT_PAREN)
366
 
    return token;
 
377
      token = plug_in_menu_path_deserialize (scanner, *proc);
 
378
      if (token != G_TOKEN_LEFT_PAREN)
 
379
        return token;
 
380
    }
 
381
 
 
382
  token = plug_in_icon_deserialize (scanner, *proc);
 
383
  if (token != G_TOKEN_LEFT_PAREN)
 
384
    return token;
 
385
 
 
386
  token = plug_in_file_proc_deserialize (scanner, *proc);
 
387
  if (token != G_TOKEN_LEFT_PAREN)
 
388
    return token;
 
389
 
 
390
  if (! gimp_scanner_parse_string (scanner, &str))
 
391
    return G_TOKEN_STRING;
 
392
 
 
393
  gimp_plug_in_procedure_set_image_types (*proc, str);
 
394
  g_free (str);
 
395
 
 
396
  if (! gimp_scanner_parse_int (scanner, (gint *) &n_args))
 
397
    return G_TOKEN_INT;
 
398
  if (! gimp_scanner_parse_int (scanner, (gint *) &n_return_vals))
 
399
    return G_TOKEN_INT;
 
400
 
 
401
  for (i = 0; i < n_args; i++)
 
402
    {
 
403
      token = plug_in_proc_arg_deserialize (scanner, gimp, procedure, FALSE);
 
404
      if (token != G_TOKEN_LEFT_PAREN)
 
405
        return token;
 
406
    }
 
407
 
 
408
  for (i = 0; i < n_return_vals; i++)
 
409
    {
 
410
      token = plug_in_proc_arg_deserialize (scanner, gimp, procedure, TRUE);
 
411
      if (token != G_TOKEN_LEFT_PAREN)
 
412
        return token;
 
413
    }
367
414
 
368
415
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
369
416
    return G_TOKEN_RIGHT_PAREN;
372
419
}
373
420
 
374
421
static GTokenType
375
 
plug_in_menu_path_deserialize (GScanner      *scanner,
376
 
                               PlugInProcDef *proc_def)
 
422
plug_in_menu_path_deserialize (GScanner            *scanner,
 
423
                               GimpPlugInProcedure *proc)
377
424
{
378
425
  gchar *menu_path;
379
426
 
387
434
  if (! gimp_scanner_parse_string (scanner, &menu_path))
388
435
    return G_TOKEN_STRING;
389
436
 
390
 
  proc_def->menu_paths = g_list_append (proc_def->menu_paths, menu_path);
 
437
  proc->menu_paths = g_list_append (proc->menu_paths, menu_path);
391
438
 
392
439
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
393
440
    return G_TOKEN_RIGHT_PAREN;
396
443
}
397
444
 
398
445
static GTokenType
399
 
plug_in_icon_deserialize (GScanner      *scanner,
400
 
                          PlugInProcDef *proc_def)
 
446
plug_in_icon_deserialize (GScanner            *scanner,
 
447
                          GimpPlugInProcedure *proc)
401
448
{
402
449
  GEnumClass   *enum_class;
403
450
  GEnumValue   *enum_value;
468
515
      if (! gimp_scanner_parse_string_no_validate (scanner, &icon_name))
469
516
        return G_TOKEN_STRING;
470
517
 
471
 
      icon_data = icon_name;
 
518
      icon_data = (guint8 *) icon_name;
472
519
      break;
473
520
 
474
521
    case GIMP_ICON_TYPE_INLINE_PIXBUF:
480
527
      break;
481
528
    }
482
529
 
483
 
  proc_def->icon_type        = icon_type;
484
 
  proc_def->icon_data_length = icon_data_length;
485
 
  proc_def->icon_data        = icon_data;
 
530
  proc->icon_type        = icon_type;
 
531
  proc->icon_data_length = icon_data_length;
 
532
  proc->icon_data        = icon_data;
486
533
 
487
534
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
488
535
    return G_TOKEN_RIGHT_PAREN;
490
537
  return G_TOKEN_LEFT_PAREN;
491
538
}
492
539
 
493
 
 
494
 
/*  Handle extra info such as mime-type and thumb-loader.  */
495
540
static GTokenType
496
 
plug_in_extra_deserialize (GScanner      *scanner,
497
 
                           PlugInProcDef *proc_def)
 
541
plug_in_file_proc_deserialize (GScanner            *scanner,
 
542
                               GimpPlugInProcedure *proc)
498
543
{
499
544
  GTokenType  token;
 
545
  gint        symbol;
500
546
  gchar      *value;
501
547
 
 
548
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_LEFT_PAREN))
 
549
    return G_TOKEN_LEFT_PAREN;
 
550
 
 
551
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_SYMBOL))
 
552
    return G_TOKEN_SYMBOL;
 
553
 
 
554
  symbol = GPOINTER_TO_INT (scanner->value.v_symbol);
 
555
  if (symbol != LOAD_PROC && symbol != SAVE_PROC)
 
556
    return G_TOKEN_SYMBOL;
 
557
 
 
558
  proc->file_proc = TRUE;
 
559
 
 
560
  g_scanner_set_scope (scanner, symbol);
 
561
 
502
562
  while (g_scanner_peek_next_token (scanner) == G_TOKEN_LEFT_PAREN)
503
563
    {
504
564
      token = g_scanner_get_next_token (scanner);
509
569
      if (! gimp_scanner_parse_token (scanner, G_TOKEN_SYMBOL))
510
570
        return G_TOKEN_SYMBOL;
511
571
 
512
 
      switch (GPOINTER_TO_INT (scanner->value.v_symbol))
513
 
        {
 
572
      symbol = GPOINTER_TO_INT (scanner->value.v_symbol);
 
573
 
 
574
      if (symbol == MAGIC)
 
575
        {
 
576
          if (! gimp_scanner_parse_string_no_validate (scanner, &value))
 
577
            return G_TOKEN_STRING;
 
578
        }
 
579
      else
 
580
        {
 
581
          if (! gimp_scanner_parse_string (scanner, &value))
 
582
            return G_TOKEN_STRING;
 
583
        }
 
584
 
 
585
      switch (symbol)
 
586
        {
 
587
        case EXTENSION:
 
588
          g_free (proc->extensions);
 
589
          proc->extensions = value;
 
590
          break;
 
591
 
 
592
        case PREFIX:
 
593
          g_free (proc->prefixes);
 
594
          proc->prefixes = value;
 
595
          break;
 
596
 
 
597
        case MAGIC:
 
598
          g_free (proc->magics);
 
599
          proc->magics = value;
 
600
          break;
 
601
 
514
602
        case MIME_TYPE:
515
 
          if (! gimp_scanner_parse_string (scanner, &value))
516
 
            return G_TOKEN_STRING;
517
 
 
518
 
          g_free (proc_def->mime_type);
519
 
          proc_def->mime_type = value;
 
603
          gimp_plug_in_procedure_set_mime_type (proc, value);
 
604
          g_free (value);
520
605
          break;
521
606
 
522
607
        case THUMB_LOADER:
523
 
          if (! gimp_scanner_parse_string (scanner, &value))
524
 
            return G_TOKEN_STRING;
525
 
 
526
 
          g_free (proc_def->thumb_loader);
527
 
          proc_def->thumb_loader = value;
 
608
          gimp_plug_in_procedure_set_thumb_loader (proc, value);
 
609
          g_free (value);
528
610
          break;
529
611
 
530
612
        default:
531
613
           return G_TOKEN_SYMBOL;
532
614
        }
533
 
 
534
615
      if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
535
616
        return G_TOKEN_RIGHT_PAREN;
536
617
    }
537
618
 
 
619
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
 
620
    return G_TOKEN_RIGHT_PAREN;
 
621
 
 
622
  g_scanner_set_scope (scanner, PLUG_IN_DEF);
 
623
 
538
624
  return G_TOKEN_LEFT_PAREN;
539
625
}
540
626
 
541
627
static GTokenType
542
 
plug_in_proc_arg_deserialize (GScanner *scanner,
543
 
                              ProcArg  *arg)
 
628
plug_in_proc_arg_deserialize (GScanner      *scanner,
 
629
                              Gimp          *gimp,
 
630
                              GimpProcedure *procedure,
 
631
                              gboolean       return_value)
544
632
{
 
633
  GTokenType  token;
 
634
  gint        arg_type;
 
635
  gchar      *name = NULL;
 
636
  gchar      *desc = NULL;
 
637
  GParamSpec *pspec;
 
638
 
545
639
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_LEFT_PAREN))
546
 
    return G_TOKEN_LEFT_PAREN;
 
640
    {
 
641
      token = G_TOKEN_LEFT_PAREN;
 
642
      goto error;
 
643
    }
547
644
 
548
645
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_SYMBOL) ||
549
646
      GPOINTER_TO_INT (scanner->value.v_symbol) != PROC_ARG)
550
 
    return G_TOKEN_SYMBOL;
551
 
 
552
 
  if (! gimp_scanner_parse_int (scanner, (gint *) &arg->arg_type))
553
 
    return G_TOKEN_INT;
554
 
  if (! gimp_scanner_parse_string (scanner, &arg->name))
555
 
    return G_TOKEN_STRING;
556
 
  if (! gimp_scanner_parse_string (scanner, &arg->description))
557
 
    return G_TOKEN_STRING;
558
 
 
559
 
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
560
 
    return G_TOKEN_RIGHT_PAREN;
561
 
 
562
 
  return G_TOKEN_LEFT_PAREN;
563
 
}
564
 
 
565
 
static GTokenType
566
 
plug_in_locale_def_deserialize (GScanner  *scanner,
567
 
                                PlugInDef *plug_in_def)
568
 
{
569
 
  gchar *string;
570
 
 
571
 
  if (! gimp_scanner_parse_string (scanner, &string))
572
 
    return G_TOKEN_STRING;
573
 
 
574
 
  plug_in_def_set_locale_domain_name (plug_in_def, string);
575
 
  g_free (string);
576
 
 
577
 
  if (gimp_scanner_parse_string (scanner, &string))
578
 
    {
579
 
      plug_in_def_set_locale_domain_path (plug_in_def, string);
580
 
      g_free (string);
581
 
    }
582
 
 
583
 
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
584
 
    return G_TOKEN_RIGHT_PAREN;
585
 
 
586
 
  return G_TOKEN_LEFT_PAREN;
587
 
}
588
 
 
589
 
static GTokenType
590
 
plug_in_help_def_deserialize (GScanner  *scanner,
591
 
                              PlugInDef *plug_in_def)
592
 
{
593
 
  gchar *string;
594
 
 
595
 
  if (! gimp_scanner_parse_string (scanner, &string))
596
 
    return G_TOKEN_STRING;
597
 
 
598
 
  plug_in_def_set_help_domain_name (plug_in_def, string);
599
 
  g_free (string);
600
 
 
601
 
  if (gimp_scanner_parse_string (scanner, &string))
602
 
    {
603
 
      plug_in_def_set_help_domain_uri (plug_in_def, string);
604
 
      g_free (string);
605
 
    }
606
 
 
607
 
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
608
 
    return G_TOKEN_RIGHT_PAREN;
609
 
 
610
 
  return G_TOKEN_LEFT_PAREN;
611
 
}
612
 
 
613
 
static GTokenType
614
 
plug_in_has_init_deserialize (GScanner  *scanner,
615
 
                              PlugInDef *plug_in_def)
616
 
{
617
 
  plug_in_def_set_has_init (plug_in_def, TRUE);
 
647
    {
 
648
      token = G_TOKEN_SYMBOL;
 
649
      goto error;
 
650
    }
 
651
 
 
652
  if (! gimp_scanner_parse_int (scanner, (gint *) &arg_type))
 
653
    {
 
654
      token = G_TOKEN_INT;
 
655
      goto error;
 
656
    }
 
657
  if (! gimp_scanner_parse_string (scanner, &name))
 
658
    {
 
659
      token = G_TOKEN_STRING;
 
660
      goto error;
 
661
    }
 
662
  if (! gimp_scanner_parse_string (scanner, &desc))
 
663
    {
 
664
      token = G_TOKEN_STRING;
 
665
      goto error;
 
666
    }
 
667
 
 
668
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
 
669
    {
 
670
      token = G_TOKEN_RIGHT_PAREN;
 
671
      goto error;
 
672
    }
 
673
 
 
674
  token = G_TOKEN_LEFT_PAREN;
 
675
 
 
676
  pspec = gimp_pdb_compat_param_spec (gimp, arg_type, name, desc);
 
677
 
 
678
  if (return_value)
 
679
    gimp_procedure_add_return_value (procedure, pspec);
 
680
  else
 
681
    gimp_procedure_add_argument (procedure, pspec);
 
682
 
 
683
 error:
 
684
 
 
685
  g_free (name);
 
686
  g_free (desc);
 
687
 
 
688
  return token;
 
689
}
 
690
 
 
691
static GTokenType
 
692
plug_in_locale_def_deserialize (GScanner      *scanner,
 
693
                                GimpPlugInDef *plug_in_def)
 
694
{
 
695
  gchar *domain_name;
 
696
  gchar *domain_path;
 
697
 
 
698
  if (! gimp_scanner_parse_string (scanner, &domain_name))
 
699
    return G_TOKEN_STRING;
 
700
 
 
701
  if (! gimp_scanner_parse_string (scanner, &domain_path))
 
702
    domain_path = NULL;
 
703
 
 
704
  gimp_plug_in_def_set_locale_domain (plug_in_def, domain_name, domain_path);
 
705
 
 
706
  g_free (domain_name);
 
707
  g_free (domain_path);
 
708
 
 
709
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
 
710
    return G_TOKEN_RIGHT_PAREN;
 
711
 
 
712
  return G_TOKEN_LEFT_PAREN;
 
713
}
 
714
 
 
715
static GTokenType
 
716
plug_in_help_def_deserialize (GScanner      *scanner,
 
717
                              GimpPlugInDef *plug_in_def)
 
718
{
 
719
  gchar *domain_name;
 
720
  gchar *domain_uri;
 
721
 
 
722
  if (! gimp_scanner_parse_string (scanner, &domain_name))
 
723
    return G_TOKEN_STRING;
 
724
 
 
725
  if (! gimp_scanner_parse_string (scanner, &domain_uri))
 
726
    domain_uri = NULL;
 
727
 
 
728
  gimp_plug_in_def_set_help_domain (plug_in_def, domain_name, domain_uri);
 
729
 
 
730
  g_free (domain_name);
 
731
  g_free (domain_uri);
 
732
 
 
733
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
 
734
    return G_TOKEN_RIGHT_PAREN;
 
735
 
 
736
  return G_TOKEN_LEFT_PAREN;
 
737
}
 
738
 
 
739
static GTokenType
 
740
plug_in_has_init_deserialize (GScanner      *scanner,
 
741
                              GimpPlugInDef *plug_in_def)
 
742
{
 
743
  gimp_plug_in_def_set_has_init (plug_in_def, TRUE);
618
744
 
619
745
  if (! gimp_scanner_parse_token (scanner, G_TOKEN_RIGHT_PAREN))
620
746
    return G_TOKEN_RIGHT_PAREN;
632
758
{
633
759
  GimpConfigWriter *writer;
634
760
  GEnumClass       *enum_class;
635
 
  PlugInDef        *plug_in_def;
636
 
  PlugInProcDef    *proc_def;
637
761
  GSList           *list;
638
 
  GSList           *list2;
639
 
  GList            *list3;
640
 
  gint              i;
641
762
 
642
763
  writer = gimp_config_writer_new_file (filename,
643
 
                                        FALSE,
644
 
                                        "GIMP pluginrc\n\n"
645
 
                                        "This file can safely be removed and "
646
 
                                        "will be automatically regenerated by "
647
 
                                        "querying the installed plugins.",
648
 
                                        error);
 
764
                                        FALSE,
 
765
                                        "GIMP pluginrc\n\n"
 
766
                                        "This file can safely be removed and "
 
767
                                        "will be automatically regenerated by "
 
768
                                        "querying the installed plugins.",
 
769
                                        error);
649
770
  if (!writer)
650
771
    return FALSE;
651
772
 
658
779
 
659
780
  for (list = plug_in_defs; list; list = list->next)
660
781
    {
661
 
      plug_in_def = list->data;
662
 
 
663
 
      if (plug_in_def->proc_defs)
664
 
        {
 
782
      GimpPlugInDef *plug_in_def = list->data;
 
783
 
 
784
      if (plug_in_def->procedures)
 
785
        {
 
786
          GSList *list2;
 
787
          gchar  *utf8;
 
788
 
 
789
          utf8 = g_filename_to_utf8 (plug_in_def->prog, -1, NULL, NULL, NULL);
 
790
 
 
791
          if (! utf8)
 
792
            continue;
 
793
 
665
794
          gimp_config_writer_open (writer, "plug-in-def");
666
 
          gimp_config_writer_string (writer, plug_in_def->prog);
 
795
          gimp_config_writer_string (writer, utf8);
667
796
          gimp_config_writer_printf (writer, "%ld", plug_in_def->mtime);
668
797
 
669
 
          for (list2 = plug_in_def->proc_defs; list2; list2 = list2->next)
670
 
            {
671
 
              GEnumValue *enum_value;
672
 
 
673
 
              proc_def = list2->data;
674
 
 
675
 
              if (proc_def->installed_during_init)
676
 
                continue;
 
798
          g_free (utf8);
 
799
 
 
800
          for (list2 = plug_in_def->procedures; list2; list2 = list2->next)
 
801
            {
 
802
              GimpPlugInProcedure *proc      = list2->data;
 
803
              GimpProcedure       *procedure = GIMP_PROCEDURE (proc);
 
804
              GEnumValue          *enum_value;
 
805
              GList               *list3;
 
806
              gint                 i;
 
807
 
 
808
              if (proc->installed_during_init)
 
809
                continue;
677
810
 
678
811
              gimp_config_writer_open (writer, "proc-def");
679
812
              gimp_config_writer_printf (writer, "\"%s\" %d",
680
 
                                         proc_def->db_info.name,
681
 
                                         proc_def->db_info.proc_type);
682
 
              gimp_config_writer_linefeed (writer);
683
 
              gimp_config_writer_string (writer, proc_def->db_info.blurb);
684
 
              gimp_config_writer_linefeed (writer);
685
 
              gimp_config_writer_string (writer, proc_def->db_info.help);
686
 
              gimp_config_writer_linefeed (writer);
687
 
              gimp_config_writer_string (writer, proc_def->db_info.author);
688
 
              gimp_config_writer_linefeed (writer);
689
 
              gimp_config_writer_string (writer, proc_def->db_info.copyright);
690
 
              gimp_config_writer_linefeed (writer);
691
 
              gimp_config_writer_string (writer, proc_def->db_info.date);
692
 
              gimp_config_writer_linefeed (writer);
693
 
              gimp_config_writer_string (writer, proc_def->menu_label);
694
 
              gimp_config_writer_linefeed (writer);
 
813
                                         procedure->original_name,
 
814
                                         procedure->proc_type);
 
815
              gimp_config_writer_linefeed (writer);
 
816
              gimp_config_writer_string (writer, procedure->blurb);
 
817
              gimp_config_writer_linefeed (writer);
 
818
              gimp_config_writer_string (writer, procedure->help);
 
819
              gimp_config_writer_linefeed (writer);
 
820
              gimp_config_writer_string (writer, procedure->author);
 
821
              gimp_config_writer_linefeed (writer);
 
822
              gimp_config_writer_string (writer, procedure->copyright);
 
823
              gimp_config_writer_linefeed (writer);
 
824
              gimp_config_writer_string (writer, procedure->date);
 
825
              gimp_config_writer_linefeed (writer);
 
826
              gimp_config_writer_string (writer, proc->menu_label);
 
827
              gimp_config_writer_linefeed (writer);
695
828
 
696
829
              gimp_config_writer_printf (writer, "%d",
697
 
                                         g_list_length (proc_def->menu_paths));
698
 
              for (list3 = proc_def->menu_paths; list3; list3 = list3->next)
 
830
                                         g_list_length (proc->menu_paths));
 
831
              for (list3 = proc->menu_paths; list3; list3 = list3->next)
699
832
                {
700
833
                  gimp_config_writer_open (writer, "menu-path");
701
834
                  gimp_config_writer_string (writer, list3->data);
703
836
                }
704
837
 
705
838
              gimp_config_writer_open (writer, "icon");
706
 
              enum_value = g_enum_get_value (enum_class, proc_def->icon_type);
 
839
              enum_value = g_enum_get_value (enum_class, proc->icon_type);
707
840
              gimp_config_writer_identifier (writer, enum_value->value_nick);
708
841
              gimp_config_writer_printf (writer, "%d",
709
 
                                         proc_def->icon_data_length);
 
842
                                         proc->icon_data_length);
710
843
 
711
 
              switch (proc_def->icon_type)
 
844
              switch (proc->icon_type)
712
845
                {
713
846
                case GIMP_ICON_TYPE_STOCK_ID:
714
847
                case GIMP_ICON_TYPE_IMAGE_FILE:
715
 
                  gimp_config_writer_string (writer, proc_def->icon_data);
 
848
                  gimp_config_writer_string (writer, (gchar *) proc->icon_data);
716
849
                  break;
717
850
 
718
851
                case GIMP_ICON_TYPE_INLINE_PIXBUF:
719
 
                  gimp_config_writer_data (writer, proc_def->icon_data_length,
720
 
                                           proc_def->icon_data);
 
852
                  gimp_config_writer_data (writer, proc->icon_data_length,
 
853
                                           proc->icon_data);
721
854
                  break;
722
855
                }
723
856
 
724
857
              gimp_config_writer_close (writer);
725
858
 
726
 
              gimp_config_writer_linefeed (writer);
727
 
 
728
 
              gimp_config_writer_string (writer, proc_def->extensions);
729
 
              gimp_config_writer_linefeed (writer);
730
 
              gimp_config_writer_string (writer, proc_def->prefixes);
731
 
              gimp_config_writer_linefeed (writer);
732
 
              gimp_config_writer_string (writer, proc_def->magics);
733
 
              gimp_config_writer_linefeed (writer);
734
 
              gimp_config_writer_string (writer, proc_def->image_types);
735
 
              gimp_config_writer_linefeed (writer);
736
 
 
737
 
              gimp_config_writer_printf (writer, "%d %d",
738
 
                                         proc_def->db_info.num_args,
739
 
                                         proc_def->db_info.num_values);
740
 
 
741
 
              for (i = 0; i < proc_def->db_info.num_args; i++)
742
 
                {
743
 
                  gimp_config_writer_open (writer, "proc-arg");
744
 
                  gimp_config_writer_printf (writer, "%d",
745
 
                                             proc_def->db_info.args[i].arg_type);
746
 
 
747
 
                  gimp_config_writer_string (writer,
748
 
                                             proc_def->db_info.args[i].name);
749
 
                  gimp_config_writer_string (writer,
750
 
                                             proc_def->db_info.args[i].description);
751
 
 
752
 
                  gimp_config_writer_close (writer);
753
 
                }
754
 
 
755
 
              for (i = 0; i < proc_def->db_info.num_values; i++)
756
 
                {
757
 
                  gimp_config_writer_open (writer, "proc-arg");
758
 
                  gimp_config_writer_printf (writer, "%d",
759
 
                                             proc_def->db_info.values[i].arg_type);
760
 
 
761
 
                  gimp_config_writer_string (writer,
762
 
                                             proc_def->db_info.values[i].name);
763
 
                  gimp_config_writer_string (writer,
764
 
                                             proc_def->db_info.values[i].description);
765
 
 
766
 
                  gimp_config_writer_close (writer);
767
 
                }
768
 
 
769
 
              if (proc_def->mime_type)
770
 
                {
771
 
                  gimp_config_writer_open (writer, "mime-type");
772
 
                  gimp_config_writer_string (writer, proc_def->mime_type);
773
 
                  gimp_config_writer_close (writer);
774
 
                }
775
 
 
776
 
              if (proc_def->thumb_loader)
777
 
                {
778
 
                  gimp_config_writer_open (writer, "thumb-loader");
779
 
                  gimp_config_writer_string (writer, proc_def->thumb_loader);
780
 
                  gimp_config_writer_close (writer);
781
 
                }
782
 
 
783
 
              gimp_config_writer_close (writer);
784
 
            }
785
 
 
786
 
          if (plug_in_def->locale_domain_name)
787
 
            {
 
859
              if (proc->file_proc)
 
860
                {
 
861
                  gimp_config_writer_open (writer,
 
862
                                           proc->image_types ?
 
863
                                           "save-proc" : "load-proc");
 
864
 
 
865
                  if (proc->extensions && *proc->extensions)
 
866
                    {
 
867
                      gimp_config_writer_open (writer, "extension");
 
868
                      gimp_config_writer_string (writer, proc->extensions);
 
869
                      gimp_config_writer_close (writer);
 
870
                    }
 
871
 
 
872
                  if (proc->prefixes && *proc->prefixes)
 
873
                    {
 
874
                      gimp_config_writer_open (writer, "prefix");
 
875
                      gimp_config_writer_string (writer, proc->prefixes);
 
876
                      gimp_config_writer_close (writer);
 
877
                    }
 
878
 
 
879
                  if (proc->magics && *proc->magics)
 
880
                    {
 
881
                      gimp_config_writer_open (writer, "magic");
 
882
                      gimp_config_writer_string (writer, proc->magics);
 
883
                      gimp_config_writer_close (writer);
 
884
                    }
 
885
 
 
886
                  if (proc->mime_type)
 
887
                    {
 
888
                      gimp_config_writer_open (writer, "mime-type");
 
889
                      gimp_config_writer_string (writer, proc->mime_type);
 
890
                      gimp_config_writer_close (writer);
 
891
                    }
 
892
 
 
893
                  if (proc->thumb_loader)
 
894
                    {
 
895
                      gimp_config_writer_open (writer, "thumb-loader");
 
896
                      gimp_config_writer_string (writer, proc->thumb_loader);
 
897
                      gimp_config_writer_close (writer);
 
898
                    }
 
899
 
 
900
                  gimp_config_writer_close (writer);
 
901
                }
 
902
 
 
903
              gimp_config_writer_linefeed (writer);
 
904
 
 
905
              gimp_config_writer_string (writer, proc->image_types);
 
906
              gimp_config_writer_linefeed (writer);
 
907
 
 
908
              gimp_config_writer_printf (writer, "%d %d",
 
909
                                         procedure->num_args,
 
910
                                         procedure->num_values);
 
911
 
 
912
              for (i = 0; i < procedure->num_args; i++)
 
913
                {
 
914
                  GParamSpec *pspec = procedure->args[i];
 
915
 
 
916
                  gimp_config_writer_open (writer, "proc-arg");
 
917
                  gimp_config_writer_printf (writer, "%d",
 
918
                                             gimp_pdb_compat_arg_type_from_gtype (G_PARAM_SPEC_VALUE_TYPE (pspec)));
 
919
 
 
920
                  gimp_config_writer_string (writer,
 
921
                                             g_param_spec_get_name (pspec));
 
922
                  gimp_config_writer_string (writer,
 
923
                                             g_param_spec_get_blurb (pspec));
 
924
 
 
925
                  gimp_config_writer_close (writer);
 
926
                }
 
927
 
 
928
              for (i = 0; i < procedure->num_values; i++)
 
929
                {
 
930
                  GParamSpec *pspec = procedure->values[i];
 
931
 
 
932
                  gimp_config_writer_open (writer, "proc-arg");
 
933
                  gimp_config_writer_printf (writer, "%d",
 
934
                                             gimp_pdb_compat_arg_type_from_gtype (G_PARAM_SPEC_VALUE_TYPE (pspec)));
 
935
 
 
936
                  gimp_config_writer_string (writer,
 
937
                                             g_param_spec_get_name (pspec));
 
938
                  gimp_config_writer_string (writer,
 
939
                                             g_param_spec_get_blurb (pspec));
 
940
 
 
941
                  gimp_config_writer_close (writer);
 
942
                }
 
943
 
 
944
              gimp_config_writer_close (writer);
 
945
            }
 
946
 
 
947
          if (plug_in_def->locale_domain_name)
 
948
            {
788
949
              gimp_config_writer_open (writer, "locale-def");
789
950
              gimp_config_writer_string (writer,
790
951
                                         plug_in_def->locale_domain_name);
791
952
 
792
 
              if (plug_in_def->locale_domain_path)
793
 
                gimp_config_writer_string (writer,
 
953
              if (plug_in_def->locale_domain_path)
 
954
                gimp_config_writer_string (writer,
794
955
                                           plug_in_def->locale_domain_path);
795
956
 
796
957
              gimp_config_writer_close (writer);
797
 
            }
 
958
            }
798
959
 
799
 
          if (plug_in_def->help_domain_name)
800
 
            {
801
 
              gimp_config_writer_open (writer, "help-def");
 
960
          if (plug_in_def->help_domain_name)
 
961
            {
 
962
              gimp_config_writer_open (writer, "help-def");
802
963
              gimp_config_writer_string (writer,
803
964
                                         plug_in_def->help_domain_name);
804
965
 
805
 
              if (plug_in_def->help_domain_uri)
806
 
                gimp_config_writer_string (writer,
 
966
              if (plug_in_def->help_domain_uri)
 
967
                gimp_config_writer_string (writer,
807
968
                                           plug_in_def->help_domain_uri);
808
969
 
809
970
             gimp_config_writer_close (writer);
810
 
            }
 
971
            }
811
972
 
812
 
          if (plug_in_def->has_init)
813
 
            {
814
 
              gimp_config_writer_open (writer, "has-init");
 
973
          if (plug_in_def->has_init)
 
974
            {
 
975
              gimp_config_writer_open (writer, "has-init");
815
976
              gimp_config_writer_close (writer);
816
 
            }
 
977
            }
817
978
 
818
 
          gimp_config_writer_close (writer);
819
 
        }
 
979
          gimp_config_writer_close (writer);
 
980
        }
820
981
    }
821
982
 
822
983
  g_type_class_unref (enum_class);