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:

committed by
Manish Singh

parent
93490ae76b
commit
b77ca997a7
12
ChangeLog
12
ChangeLog
@ -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>
|
2005-06-03 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* configure.in: require python 2.2.1, so True and False are always
|
* configure.in: require python 2.2.1, so True and False are always
|
||||||
|
@ -361,7 +361,7 @@ gimp_main (const GimpPlugInInfo *info,
|
|||||||
wire_set_flusher (gimp_flush);
|
wire_set_flusher (gimp_flush);
|
||||||
|
|
||||||
g_type_init ();
|
g_type_init ();
|
||||||
_gimp_enums_init ();
|
gimp_enums_init ();
|
||||||
|
|
||||||
/* initialize units */
|
/* initialize units */
|
||||||
{
|
{
|
||||||
|
@ -173,6 +173,7 @@ EXPORTS
|
|||||||
gimp_edit_stroke
|
gimp_edit_stroke
|
||||||
gimp_ellipse_select
|
gimp_ellipse_select
|
||||||
gimp_enums_get_type_names
|
gimp_enums_get_type_names
|
||||||
|
gimp_enums_init
|
||||||
gimp_equalize
|
gimp_equalize
|
||||||
gimp_eraser
|
gimp_eraser
|
||||||
gimp_eraser_default
|
gimp_eraser_default
|
||||||
|
@ -91,18 +91,37 @@ static const gchar *type_names[] =
|
|||||||
"GimpTransformDirection"
|
"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
|
void
|
||||||
_gimp_enums_init (void)
|
gimp_enums_init (void)
|
||||||
{
|
{
|
||||||
const GimpGetTypeFunc *funcs = get_type_funcs;
|
const GimpGetTypeFunc *funcs = get_type_funcs;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
if (enums_initialized)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (get_type_funcs); i++, funcs++)
|
for (i = 0; i < G_N_ELEMENTS (get_type_funcs); i++, funcs++)
|
||||||
{
|
{
|
||||||
GType type = (*funcs) ();
|
GType type = (*funcs) ();
|
||||||
|
|
||||||
g_type_class_ref (type);
|
g_type_class_ref (type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enums_initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -259,7 +259,7 @@ typedef enum
|
|||||||
} GimpRunMode;
|
} GimpRunMode;
|
||||||
|
|
||||||
|
|
||||||
void _gimp_enums_init (void);
|
void gimp_enums_init (void);
|
||||||
|
|
||||||
const gchar ** gimp_enums_get_type_names (gint *n_type_names);
|
const gchar ** gimp_enums_get_type_names (gint *n_type_names);
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ foreach (sort keys %enums) {
|
|||||||
|
|
||||||
print ENUMFILE <<HEADER;
|
print ENUMFILE <<HEADER;
|
||||||
|
|
||||||
void _gimp_enums_init (void);
|
void gimp_enums_init (void);
|
||||||
|
|
||||||
const gchar ** gimp_enums_get_type_names (gint *n_type_names);
|
const gchar ** gimp_enums_get_type_names (gint *n_type_names);
|
||||||
|
|
||||||
@ -161,18 +161,37 @@ print ENUMFILE "\n" unless $first;
|
|||||||
print ENUMFILE <<CODE;
|
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
|
void
|
||||||
_gimp_enums_init (void)
|
gimp_enums_init (void)
|
||||||
{
|
{
|
||||||
const GimpGetTypeFunc *funcs = get_type_funcs;
|
const GimpGetTypeFunc *funcs = get_type_funcs;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
if (enums_initialized)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (get_type_funcs); i++, funcs++)
|
for (i = 0; i < G_N_ELEMENTS (get_type_funcs); i++, funcs++)
|
||||||
{
|
{
|
||||||
GType type = (*funcs) ();
|
GType type = (*funcs) ();
|
||||||
|
|
||||||
g_type_class_ref (type);
|
g_type_class_ref (type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enums_initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user