2004-10-27 15:46:40 -07:00
|
|
|
|
|
|
|
|
typedef GType (* GimpGetTypeFunc) (void);
|
|
|
|
|
|
2005-04-29 11:29:24 -07:00
|
|
|
static const GimpGetTypeFunc get_type_funcs[] =
|
2004-10-27 15:46:40 -07:00
|
|
|
{
|
2018-03-17 12:19:58 -07:00
|
|
|
gegl_distance_metric_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_add_mask_type_get_type,
|
|
|
|
|
gimp_blend_mode_get_type,
|
|
|
|
|
gimp_brush_application_mode_get_type,
|
2006-03-22 01:58:08 -08:00
|
|
|
gimp_brush_generated_shape_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_bucket_fill_mode_get_type,
|
2015-11-08 17:16:03 -08:00
|
|
|
gimp_cap_style_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_channel_ops_get_type,
|
|
|
|
|
gimp_channel_type_get_type,
|
|
|
|
|
gimp_clone_type_get_type,
|
2015-06-09 16:38:20 -07:00
|
|
|
gimp_color_management_mode_get_type,
|
|
|
|
|
gimp_color_rendering_intent_get_type,
|
2016-10-29 07:50:13 -07:00
|
|
|
gimp_color_tag_get_type,
|
2013-06-23 07:51:24 -07:00
|
|
|
gimp_component_type_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_convert_dither_type_get_type,
|
|
|
|
|
gimp_convert_palette_type_get_type,
|
|
|
|
|
gimp_convolve_type_get_type,
|
2005-04-16 07:51:49 -07:00
|
|
|
gimp_desaturate_mode_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_dodge_burn_type_get_type,
|
|
|
|
|
gimp_fill_type_get_type,
|
2005-07-28 19:35:12 -07:00
|
|
|
gimp_foreground_extract_mode_get_type,
|
2018-04-13 13:33:16 -07:00
|
|
|
gimp_gradient_blend_color_space_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_gradient_segment_color_get_type,
|
|
|
|
|
gimp_gradient_segment_type_get_type,
|
|
|
|
|
gimp_gradient_type_get_type,
|
2005-09-30 09:35:04 -07:00
|
|
|
gimp_grid_style_get_type,
|
2004-10-27 15:46:40 -07: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 03:58:26 -08:00
|
|
|
gimp_ink_blob_type_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_interpolation_type_get_type,
|
2015-11-08 17:16:03 -08:00
|
|
|
gimp_join_style_get_type,
|
2017-02-19 16:17:07 -08:00
|
|
|
gimp_layer_color_space_get_type,
|
2017-02-01 15:38:25 -08:00
|
|
|
gimp_layer_composite_mode_get_type,
|
2017-01-08 14:00:19 -08:00
|
|
|
gimp_layer_mode_get_type,
|
2004-10-27 15:46:40 -07: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-18 15:54:26 -07:00
|
|
|
gimp_pdb_error_handler_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_pdb_proc_type_get_type,
|
|
|
|
|
gimp_pdb_status_type_get_type,
|
|
|
|
|
gimp_paint_application_mode_get_type,
|
2012-04-25 11:16:29 -07:00
|
|
|
gimp_precision_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_progress_command_get_type,
|
|
|
|
|
gimp_repeat_mode_get_type,
|
|
|
|
|
gimp_rotation_type_get_type,
|
|
|
|
|
gimp_run_mode_get_type,
|
2006-08-15 09:20:46 -07:00
|
|
|
gimp_select_criterion_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_size_type_get_type,
|
|
|
|
|
gimp_stack_trace_mode_get_type,
|
2015-11-08 13:48:48 -08:00
|
|
|
gimp_stroke_method_get_type,
|
2008-03-31 15:18:45 -07:00
|
|
|
gimp_text_direction_get_type,
|
2008-10-27 00:59:32 -07:00
|
|
|
gimp_text_hint_style_get_type,
|
2008-03-31 15:18:45 -07:00
|
|
|
gimp_text_justification_get_type,
|
2004-10-27 15:46:40 -07:00
|
|
|
gimp_transfer_mode_get_type,
|
2006-10-24 07:23:29 -07:00
|
|
|
gimp_transform_direction_get_type,
|
2006-12-24 08:48:08 -08:00
|
|
|
gimp_transform_resize_get_type,
|
2007-05-13 09:49:23 -07:00
|
|
|
gimp_user_directory_get_type,
|
2006-10-24 07:23:29 -07:00
|
|
|
gimp_vectors_stroke_type_get_type
|
2004-10-27 15:46:40 -07:00
|
|
|
};
|
|
|
|
|
|
2006-04-06 06:20:39 -07:00
|
|
|
static const gchar * const type_names[] =
|
2004-10-27 15:46:40 -07:00
|
|
|
{
|
2018-03-17 12:19:58 -07:00
|
|
|
"GeglDistanceMetric",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpAddMaskType",
|
|
|
|
|
"GimpBlendMode",
|
|
|
|
|
"GimpBrushApplicationMode",
|
2006-03-22 01:58:08 -08:00
|
|
|
"GimpBrushGeneratedShape",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpBucketFillMode",
|
2015-11-08 17:16:03 -08:00
|
|
|
"GimpCapStyle",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpChannelOps",
|
|
|
|
|
"GimpChannelType",
|
|
|
|
|
"GimpCloneType",
|
2015-06-09 16:38:20 -07:00
|
|
|
"GimpColorManagementMode",
|
|
|
|
|
"GimpColorRenderingIntent",
|
2016-10-29 07:50:13 -07:00
|
|
|
"GimpColorTag",
|
2013-06-23 07:51:24 -07:00
|
|
|
"GimpComponentType",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpConvertDitherType",
|
|
|
|
|
"GimpConvertPaletteType",
|
|
|
|
|
"GimpConvolveType",
|
2005-04-16 07:51:49 -07:00
|
|
|
"GimpDesaturateMode",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpDodgeBurnType",
|
|
|
|
|
"GimpFillType",
|
2005-07-28 19:35:12 -07:00
|
|
|
"GimpForegroundExtractMode",
|
2018-04-13 13:33:16 -07:00
|
|
|
"GimpGradientBlendColorSpace",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpGradientSegmentColor",
|
|
|
|
|
"GimpGradientSegmentType",
|
|
|
|
|
"GimpGradientType",
|
2005-09-30 09:35:04 -07:00
|
|
|
"GimpGridStyle",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpHistogramChannel",
|
|
|
|
|
"GimpHueRange",
|
|
|
|
|
"GimpIconType",
|
|
|
|
|
"GimpImageBaseType",
|
|
|
|
|
"GimpImageType",
|
2012-03-01 03:58:26 -08:00
|
|
|
"GimpInkBlobType",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpInterpolationType",
|
2015-11-08 17:16:03 -08:00
|
|
|
"GimpJoinStyle",
|
2017-02-19 16:17:07 -08:00
|
|
|
"GimpLayerColorSpace",
|
2017-02-01 15:38:25 -08:00
|
|
|
"GimpLayerCompositeMode",
|
2017-01-08 14:00:19 -08:00
|
|
|
"GimpLayerMode",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpMaskApplyMode",
|
|
|
|
|
"GimpMergeType",
|
|
|
|
|
"GimpMessageHandlerType",
|
|
|
|
|
"GimpOffsetType",
|
|
|
|
|
"GimpOrientationType",
|
|
|
|
|
"GimpPDBArgType",
|
2008-08-18 15:54:26 -07:00
|
|
|
"GimpPDBErrorHandler",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpPDBProcType",
|
|
|
|
|
"GimpPDBStatusType",
|
|
|
|
|
"GimpPaintApplicationMode",
|
2012-04-25 11:16:29 -07:00
|
|
|
"GimpPrecision",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpProgressCommand",
|
|
|
|
|
"GimpRepeatMode",
|
|
|
|
|
"GimpRotationType",
|
|
|
|
|
"GimpRunMode",
|
2006-08-15 09:20:46 -07:00
|
|
|
"GimpSelectCriterion",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpSizeType",
|
|
|
|
|
"GimpStackTraceMode",
|
2015-11-08 13:48:48 -08:00
|
|
|
"GimpStrokeMethod",
|
2008-03-31 15:18:45 -07:00
|
|
|
"GimpTextDirection",
|
2008-10-27 00:59:32 -07:00
|
|
|
"GimpTextHintStyle",
|
2008-03-31 15:18:45 -07:00
|
|
|
"GimpTextJustification",
|
2004-10-27 15:46:40 -07:00
|
|
|
"GimpTransferMode",
|
2006-10-24 07:23:29 -07:00
|
|
|
"GimpTransformDirection",
|
2006-12-24 08:48:08 -08:00
|
|
|
"GimpTransformResize",
|
2007-05-13 09:49:23 -07:00
|
|
|
"GimpUserDirectory",
|
2006-10-24 07:23:29 -07:00
|
|
|
"GimpVectorsStrokeType"
|
2004-10-27 15:46:40 -07:00
|
|
|
};
|
|
|
|
|
|
2005-06-03 16:25:44 -07:00
|
|
|
static gboolean enums_initialized = FALSE;
|
|
|
|
|
|
2017-02-26 11:10:54 -08:00
|
|
|
GType gimp_convert_dither_type_compat_get_type (void);
|
|
|
|
|
GType gimp_layer_mode_effects_get_type (void);
|
2017-01-24 14:25:02 -08:00
|
|
|
|
2005-06-03 16:25:44 -07:00
|
|
|
/**
|
2010-07-14 11:20:58 -07:00
|
|
|
* gimp_enums_init:
|
2005-06-03 16:25:44 -07:00
|
|
|
*
|
|
|
|
|
* This function makes sure all the enum types are registered
|
2010-07-14 11:20:58 -07: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-03 16:25:44 -07:00
|
|
|
*
|
2015-05-31 12:18:09 -07:00
|
|
|
* Since: 2.4
|
2005-06-03 16:25:44 -07:00
|
|
|
**/
|
2004-10-27 15:46:40 -07:00
|
|
|
void
|
2005-06-03 16:25:44 -07:00
|
|
|
gimp_enums_init (void)
|
2004-10-27 15:46:40 -07:00
|
|
|
{
|
2005-04-29 11:29:24 -07:00
|
|
|
const GimpGetTypeFunc *funcs = get_type_funcs;
|
2017-01-08 14:00:19 -08:00
|
|
|
GQuark quark;
|
2005-04-29 11:29:24 -07:00
|
|
|
gint i;
|
2004-10-27 15:46:40 -07:00
|
|
|
|
2005-06-03 16:25:44 -07:00
|
|
|
if (enums_initialized)
|
|
|
|
|
return;
|
|
|
|
|
|
2005-04-29 11:29:24 -07:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (get_type_funcs); i++, funcs++)
|
2004-10-27 15:46:40 -07:00
|
|
|
{
|
|
|
|
|
GType type = (*funcs) ();
|
|
|
|
|
|
|
|
|
|
g_type_class_ref (type);
|
|
|
|
|
}
|
2005-06-03 16:25:44 -07:00
|
|
|
|
2017-01-08 14: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-26 11:10:54 -08:00
|
|
|
g_type_set_qdata (GIMP_TYPE_CONVERT_DITHER_TYPE, quark,
|
|
|
|
|
(gpointer) gimp_convert_dither_type_compat_get_type ());
|
2017-01-08 14:00:19 -08:00
|
|
|
g_type_set_qdata (GIMP_TYPE_LAYER_MODE, quark,
|
2017-01-24 14:25:02 -08:00
|
|
|
(gpointer) gimp_layer_mode_effects_get_type ());
|
2017-01-08 14:00:19 -08:00
|
|
|
|
2017-10-29 10:37:18 -07:00
|
|
|
gimp_base_compat_enums_init ();
|
2017-06-30 05:52:44 -07:00
|
|
|
|
2005-06-03 16:25:44 -07:00
|
|
|
enums_initialized = TRUE;
|
2004-10-27 15:46:40 -07: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-05-31 12:18:09 -07:00
|
|
|
* Since: 2.2
|
2004-10-27 15:46:40 -07: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 08:19:15 -07:00
|
|
|
return (const gchar **) type_names;
|
2004-10-27 15:46:40 -07:00
|
|
|
}
|