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

« back to all changes in this revision

Viewing changes to tools/pdbgen/enumcode.pl

  • 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
1
#!/usr/bin/perl -w
2
2
 
3
 
# The GIMP -- an image manipulation program
 
3
# GIMP - The GNU Image Manipulation Program
4
4
# Copyright (C) 1999-2003 Manish Singh <yosh@gimp.org>
5
5
 
6
6
# This program is free software; you can redistribute it and/or modify
97
97
 
98
98
print ENUMFILE <<HEADER;
99
99
 
100
 
void           _gimp_enums_init          (void);
 
100
void           gimp_enums_init           (void);
101
101
 
102
102
const gchar ** gimp_enums_get_type_names (gint *n_type_names);
103
103
 
117
117
 
118
118
typedef GType (* GimpGetTypeFunc) (void);
119
119
 
120
 
static GimpGetTypeFunc get_type_funcs[] =
 
120
static const GimpGetTypeFunc get_type_funcs[] =
121
121
{
122
122
CODE
123
123
 
140
140
print ENUMFILE <<CODE;
141
141
};
142
142
 
143
 
static const gchar *type_names[] =
 
143
static const gchar * const type_names[] =
144
144
{
145
145
CODE
146
146
 
161
161
print ENUMFILE <<CODE;
162
162
};
163
163
 
 
164
static gboolean enums_initialized = FALSE;
 
165
 
 
166
/**
 
167
 * gimp_enums_init
 
168
 *
 
169
 * This function makes sure all the enum types are registered
 
170
 * with the GObject type system. This is intended for use by
 
171
 * language bindings that need the symbols early, before gimp_main
 
172
 * is run. It's not necessary for plug-ins to call this directly,
 
173
 * as the normal plug-in initialization code will handle it
 
174
 * implicitly.
 
175
 *
 
176
 * Since: GIMP 2.4
 
177
 **/
164
178
void
165
 
_gimp_enums_init (void)
 
179
gimp_enums_init (void)
166
180
{
167
 
  GimpGetTypeFunc *funcs;
168
 
  gint             i;
169
 
 
170
 
  for (i = 0, funcs = get_type_funcs;
171
 
       i < G_N_ELEMENTS (get_type_funcs);
172
 
       i++, funcs++)
 
181
  const GimpGetTypeFunc *funcs = get_type_funcs;
 
182
  gint                   i;
 
183
 
 
184
  if (enums_initialized)
 
185
    return;
 
186
 
 
187
  for (i = 0; i < G_N_ELEMENTS (get_type_funcs); i++, funcs++)
173
188
    {
174
189
      GType type = (*funcs) ();
175
190
 
176
191
      g_type_class_ref (type);
177
192
    }
 
193
 
 
194
  enums_initialized = TRUE;
178
195
}
179
196
 
180
197
/**
195
212
 
196
213
  *n_type_names = G_N_ELEMENTS (type_names);
197
214
 
198
 
  return type_names;
 
215
  return (const gchar **) type_names;
199
216
}
200
217
CODE
201
218