make _gimp_enums_init public, so language bindings can do early enum

2005-06-03  Manish Singh  <yosh@gimp.org>

        * tools/pdbgen/enumcode.pl: make _gimp_enums_init public, so
        language bindings can do early enum registration if needed.

        * libgimp/gimpenums.h
        * libgimp/gimpenums.c.tail: regenerated

        * gimp.c: call gimp_enums_init instead of _gimp_enums_init.

        * gimp.def: add newly exported function.
This commit is contained in:
Manish Singh 2005-06-03 23:25:44 +00:00 committed by Manish Singh
parent 93490ae76b
commit b77ca997a7
6 changed files with 56 additions and 5 deletions

View File

@ -1,3 +1,15 @@
2005-06-03 Manish Singh <yosh@gimp.org>
* tools/pdbgen/enumcode.pl: make _gimp_enums_init public, so
language bindings can do early enum registration if needed.
* libgimp/gimpenums.h
* libgimp/gimpenums.c.tail: regenerated
* gimp.c: call gimp_enums_init instead of _gimp_enums_init.
* gimp.def: add newly exported function.
2005-06-03 Manish Singh <yosh@gimp.org>
* configure.in: require python 2.2.1, so True and False are always

View File

@ -361,7 +361,7 @@ gimp_main (const GimpPlugInInfo *info,
wire_set_flusher (gimp_flush);
g_type_init ();
_gimp_enums_init ();
gimp_enums_init ();
/* initialize units */
{

View File

@ -173,6 +173,7 @@ EXPORTS
gimp_edit_stroke
gimp_ellipse_select
gimp_enums_get_type_names
gimp_enums_init
gimp_equalize
gimp_eraser
gimp_eraser_default

View File

@ -91,18 +91,37 @@ static const gchar *type_names[] =
"GimpTransformDirection"
};
static gboolean enums_initialized = FALSE;
/**
* gimp_enums_init
*
* This function makes sure all the enum types are registered
* with the GObject type system. This is intended for use by
* language bindings that need the symbols early, before gimp_main
* is run. It's not necessary for plug-ins to call this directly,
* as the normal plug-in initialization code will handle it
* implicitly.
*
* Since: GIMP 2.4
**/
void
_gimp_enums_init (void)
gimp_enums_init (void)
{
const GimpGetTypeFunc *funcs = get_type_funcs;
gint i;
if (enums_initialized)
return;
for (i = 0; i < G_N_ELEMENTS (get_type_funcs); i++, funcs++)
{
GType type = (*funcs) ();
g_type_class_ref (type);
}
enums_initialized = TRUE;
}
/**

View File

@ -259,7 +259,7 @@ typedef enum
} GimpRunMode;
void _gimp_enums_init (void);
void gimp_enums_init (void);
const gchar ** gimp_enums_get_type_names (gint *n_type_names);

View File

@ -97,7 +97,7 @@ foreach (sort keys %enums) {
print ENUMFILE <<HEADER;
void _gimp_enums_init (void);
void gimp_enums_init (void);
const gchar ** gimp_enums_get_type_names (gint *n_type_names);
@ -161,18 +161,37 @@ print ENUMFILE "\n" unless $first;
print ENUMFILE <<CODE;
};
static gboolean enums_initialized = FALSE;
/**
* gimp_enums_init
*
* This function makes sure all the enum types are registered
* with the GObject type system. This is intended for use by
* language bindings that need the symbols early, before gimp_main
* is run. It's not necessary for plug-ins to call this directly,
* as the normal plug-in initialization code will handle it
* implicitly.
*
* Since: GIMP 2.4
**/
void
_gimp_enums_init (void)
gimp_enums_init (void)
{
const GimpGetTypeFunc *funcs = get_type_funcs;
gint i;
if (enums_initialized)
return;
for (i = 0; i < G_N_ELEMENTS (get_type_funcs); i++, funcs++)
{
GType type = (*funcs) ();
g_type_class_ref (type);
}
enums_initialized = TRUE;
}
/**