2004-10-28 06:46:40 +08:00
|
|
|
|
|
|
|
typedef GType (* GimpGetTypeFunc) (void);
|
|
|
|
|
2005-04-30 02:29:24 +08:00
|
|
|
static const GimpGetTypeFunc get_type_funcs[] =
|
2004-10-28 06:46:40 +08:00
|
|
|
{
|
|
|
|
gimp_add_mask_type_get_type,
|
|
|
|
gimp_blend_mode_get_type,
|
|
|
|
gimp_brush_application_mode_get_type,
|
2006-03-22 17:58:08 +08:00
|
|
|
gimp_brush_generated_shape_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_bucket_fill_mode_get_type,
|
2015-11-09 09:16:03 +08:00
|
|
|
gimp_cap_style_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_channel_ops_get_type,
|
|
|
|
gimp_channel_type_get_type,
|
|
|
|
gimp_clone_type_get_type,
|
2015-06-10 07:38:20 +08:00
|
|
|
gimp_color_management_mode_get_type,
|
|
|
|
gimp_color_rendering_intent_get_type,
|
2016-10-29 22:50:13 +08:00
|
|
|
gimp_color_tag_get_type,
|
2013-06-23 22:51:24 +08:00
|
|
|
gimp_component_type_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_convert_dither_type_get_type,
|
|
|
|
gimp_convert_palette_type_get_type,
|
|
|
|
gimp_convolve_type_get_type,
|
2005-04-16 22:51:49 +08:00
|
|
|
gimp_desaturate_mode_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_dodge_burn_type_get_type,
|
|
|
|
gimp_fill_type_get_type,
|
2005-07-29 10:35:12 +08:00
|
|
|
gimp_foreground_extract_mode_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_gradient_segment_color_get_type,
|
|
|
|
gimp_gradient_segment_type_get_type,
|
|
|
|
gimp_gradient_type_get_type,
|
2005-10-01 00:35:04 +08:00
|
|
|
gimp_grid_style_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_histogram_channel_get_type,
|
|
|
|
gimp_hue_range_get_type,
|
|
|
|
gimp_icon_type_get_type,
|
|
|
|
gimp_image_base_type_get_type,
|
|
|
|
gimp_image_type_get_type,
|
2012-03-01 19:58:26 +08:00
|
|
|
gimp_ink_blob_type_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_interpolation_type_get_type,
|
2015-11-09 09:16:03 +08:00
|
|
|
gimp_join_style_get_type,
|
2017-02-20 08:17:07 +08:00
|
|
|
gimp_layer_color_space_get_type,
|
2017-02-02 07:38:25 +08:00
|
|
|
gimp_layer_composite_mode_get_type,
|
2017-01-09 06:00:19 +08:00
|
|
|
gimp_layer_mode_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_mask_apply_mode_get_type,
|
|
|
|
gimp_merge_type_get_type,
|
|
|
|
gimp_message_handler_type_get_type,
|
|
|
|
gimp_offset_type_get_type,
|
|
|
|
gimp_orientation_type_get_type,
|
|
|
|
gimp_pdb_arg_type_get_type,
|
2008-08-19 06:54:26 +08:00
|
|
|
gimp_pdb_error_handler_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_pdb_proc_type_get_type,
|
|
|
|
gimp_pdb_status_type_get_type,
|
|
|
|
gimp_paint_application_mode_get_type,
|
2012-04-26 02:16:29 +08:00
|
|
|
gimp_precision_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_progress_command_get_type,
|
|
|
|
gimp_repeat_mode_get_type,
|
|
|
|
gimp_rotation_type_get_type,
|
|
|
|
gimp_run_mode_get_type,
|
2006-08-16 00:20:46 +08:00
|
|
|
gimp_select_criterion_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_size_type_get_type,
|
|
|
|
gimp_stack_trace_mode_get_type,
|
2015-11-09 05:48:48 +08:00
|
|
|
gimp_stroke_method_get_type,
|
2008-04-01 06:18:45 +08:00
|
|
|
gimp_text_direction_get_type,
|
2008-10-27 15:59:32 +08:00
|
|
|
gimp_text_hint_style_get_type,
|
2008-04-01 06:18:45 +08:00
|
|
|
gimp_text_justification_get_type,
|
2004-10-28 06:46:40 +08:00
|
|
|
gimp_transfer_mode_get_type,
|
2006-10-24 22:23:29 +08:00
|
|
|
gimp_transform_direction_get_type,
|
2006-12-25 00:48:08 +08:00
|
|
|
gimp_transform_resize_get_type,
|
2007-05-14 00:49:23 +08:00
|
|
|
gimp_user_directory_get_type,
|
2006-10-24 22:23:29 +08:00
|
|
|
gimp_vectors_stroke_type_get_type
|
2004-10-28 06:46:40 +08:00
|
|
|
};
|
|
|
|
|
2006-04-06 21:20:39 +08:00
|
|
|
static const gchar * const type_names[] =
|
2004-10-28 06:46:40 +08:00
|
|
|
{
|
|
|
|
"GimpAddMaskType",
|
|
|
|
"GimpBlendMode",
|
|
|
|
"GimpBrushApplicationMode",
|
2006-03-22 17:58:08 +08:00
|
|
|
"GimpBrushGeneratedShape",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpBucketFillMode",
|
2015-11-09 09:16:03 +08:00
|
|
|
"GimpCapStyle",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpChannelOps",
|
|
|
|
"GimpChannelType",
|
|
|
|
"GimpCloneType",
|
2015-06-10 07:38:20 +08:00
|
|
|
"GimpColorManagementMode",
|
|
|
|
"GimpColorRenderingIntent",
|
2016-10-29 22:50:13 +08:00
|
|
|
"GimpColorTag",
|
2013-06-23 22:51:24 +08:00
|
|
|
"GimpComponentType",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpConvertDitherType",
|
|
|
|
"GimpConvertPaletteType",
|
|
|
|
"GimpConvolveType",
|
2005-04-16 22:51:49 +08:00
|
|
|
"GimpDesaturateMode",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpDodgeBurnType",
|
|
|
|
"GimpFillType",
|
2005-07-29 10:35:12 +08:00
|
|
|
"GimpForegroundExtractMode",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpGradientSegmentColor",
|
|
|
|
"GimpGradientSegmentType",
|
|
|
|
"GimpGradientType",
|
2005-10-01 00:35:04 +08:00
|
|
|
"GimpGridStyle",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpHistogramChannel",
|
|
|
|
"GimpHueRange",
|
|
|
|
"GimpIconType",
|
|
|
|
"GimpImageBaseType",
|
|
|
|
"GimpImageType",
|
2012-03-01 19:58:26 +08:00
|
|
|
"GimpInkBlobType",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpInterpolationType",
|
2015-11-09 09:16:03 +08:00
|
|
|
"GimpJoinStyle",
|
2017-02-20 08:17:07 +08:00
|
|
|
"GimpLayerColorSpace",
|
2017-02-02 07:38:25 +08:00
|
|
|
"GimpLayerCompositeMode",
|
2017-01-09 06:00:19 +08:00
|
|
|
"GimpLayerMode",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpMaskApplyMode",
|
|
|
|
"GimpMergeType",
|
|
|
|
"GimpMessageHandlerType",
|
|
|
|
"GimpOffsetType",
|
|
|
|
"GimpOrientationType",
|
|
|
|
"GimpPDBArgType",
|
2008-08-19 06:54:26 +08:00
|
|
|
"GimpPDBErrorHandler",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpPDBProcType",
|
|
|
|
"GimpPDBStatusType",
|
|
|
|
"GimpPaintApplicationMode",
|
2012-04-26 02:16:29 +08:00
|
|
|
"GimpPrecision",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpProgressCommand",
|
|
|
|
"GimpRepeatMode",
|
|
|
|
"GimpRotationType",
|
|
|
|
"GimpRunMode",
|
2006-08-16 00:20:46 +08:00
|
|
|
"GimpSelectCriterion",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpSizeType",
|
|
|
|
"GimpStackTraceMode",
|
2015-11-09 05:48:48 +08:00
|
|
|
"GimpStrokeMethod",
|
2008-04-01 06:18:45 +08:00
|
|
|
"GimpTextDirection",
|
2008-10-27 15:59:32 +08:00
|
|
|
"GimpTextHintStyle",
|
2008-04-01 06:18:45 +08:00
|
|
|
"GimpTextJustification",
|
2004-10-28 06:46:40 +08:00
|
|
|
"GimpTransferMode",
|
2006-10-24 22:23:29 +08:00
|
|
|
"GimpTransformDirection",
|
2006-12-25 00:48:08 +08:00
|
|
|
"GimpTransformResize",
|
2007-05-14 00:49:23 +08:00
|
|
|
"GimpUserDirectory",
|
2006-10-24 22:23:29 +08:00
|
|
|
"GimpVectorsStrokeType"
|
2004-10-28 06:46:40 +08:00
|
|
|
};
|
|
|
|
|
2005-06-04 07:25:44 +08:00
|
|
|
static gboolean enums_initialized = FALSE;
|
|
|
|
|
2017-02-27 03:10:54 +08:00
|
|
|
GType gimp_convert_dither_type_compat_get_type (void);
|
|
|
|
GType gimp_layer_mode_effects_get_type (void);
|
2017-01-25 06:25:02 +08:00
|
|
|
|
2005-06-04 07:25:44 +08:00
|
|
|
/**
|
2010-07-15 02:20:58 +08:00
|
|
|
* gimp_enums_init:
|
2005-06-04 07:25:44 +08:00
|
|
|
*
|
|
|
|
* This function makes sure all the enum types are registered
|
2010-07-15 02:20:58 +08:00
|
|
|
* with the #GType 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, because
|
|
|
|
* the normal plug-in initialization code will handle it implicitly.
|
2005-06-04 07:25:44 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.4
|
2005-06-04 07:25:44 +08:00
|
|
|
**/
|
2004-10-28 06:46:40 +08:00
|
|
|
void
|
2005-06-04 07:25:44 +08:00
|
|
|
gimp_enums_init (void)
|
2004-10-28 06:46:40 +08:00
|
|
|
{
|
2005-04-30 02:29:24 +08:00
|
|
|
const GimpGetTypeFunc *funcs = get_type_funcs;
|
2017-01-09 06:00:19 +08:00
|
|
|
GQuark quark;
|
2005-04-30 02:29:24 +08:00
|
|
|
gint i;
|
2004-10-28 06:46:40 +08:00
|
|
|
|
2005-06-04 07:25:44 +08:00
|
|
|
if (enums_initialized)
|
|
|
|
return;
|
|
|
|
|
2005-04-30 02:29:24 +08:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (get_type_funcs); i++, funcs++)
|
2004-10-28 06:46:40 +08:00
|
|
|
{
|
|
|
|
GType type = (*funcs) ();
|
|
|
|
|
|
|
|
g_type_class_ref (type);
|
|
|
|
}
|
2005-06-04 07:25:44 +08:00
|
|
|
|
2017-01-09 06:00:19 +08:00
|
|
|
/* keep compat enum code in sync with app/app.c (app_libs_init) */
|
|
|
|
quark = g_quark_from_static_string ("gimp-compat-enum");
|
|
|
|
|
2017-02-27 03:10:54 +08:00
|
|
|
g_type_set_qdata (GIMP_TYPE_CONVERT_DITHER_TYPE, quark,
|
|
|
|
(gpointer) gimp_convert_dither_type_compat_get_type ());
|
2017-01-09 06:00:19 +08:00
|
|
|
g_type_set_qdata (GIMP_TYPE_LAYER_MODE, quark,
|
2017-01-25 06:25:02 +08:00
|
|
|
(gpointer) gimp_layer_mode_effects_get_type ());
|
2017-01-09 06:00:19 +08:00
|
|
|
|
2005-06-04 07:25:44 +08:00
|
|
|
enums_initialized = TRUE;
|
2004-10-28 06:46:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_enums_get_type_names:
|
|
|
|
* @n_type_names: return location for the number of names
|
|
|
|
*
|
|
|
|
* This function gives access to the list of enums registered by libgimp.
|
|
|
|
* The returned array is static and must not be modified.
|
|
|
|
*
|
|
|
|
* Return value: an array with type names
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.2
|
2004-10-28 06:46:40 +08:00
|
|
|
**/
|
|
|
|
const gchar **
|
|
|
|
gimp_enums_get_type_names (gint *n_type_names)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (n_type_names != NULL, NULL);
|
|
|
|
|
|
|
|
*n_type_names = G_N_ELEMENTS (type_names);
|
|
|
|
|
2006-05-27 23:19:15 +08:00
|
|
|
return (const gchar **) type_names;
|
2004-10-28 06:46:40 +08:00
|
|
|
}
|