Commit 66060e33 authored by Michael Natterer's avatar Michael Natterer 😴

app, libgimp*, plug-ins: replace enum GimpLayerModeEffects by GimpLayerMode

with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
parent 4fb62427
......@@ -48,35 +48,35 @@
#include "gimp-intl.h"
static const GimpLayerModeEffects paint_modes[] =
{
GIMP_NORMAL_MODE,
GIMP_DISSOLVE_MODE,
GIMP_BEHIND_MODE,
GIMP_COLOR_ERASE_MODE,
GIMP_MULTIPLY_MODE,
GIMP_DIVIDE_MODE,
GIMP_SCREEN_MODE,
GIMP_NEW_OVERLAY_MODE,
GIMP_DODGE_MODE,
GIMP_BURN_MODE,
GIMP_HARDLIGHT_MODE,
GIMP_SOFTLIGHT_MODE,
GIMP_GRAIN_EXTRACT_MODE,
GIMP_GRAIN_MERGE_MODE,
GIMP_DIFFERENCE_MODE,
GIMP_ADDITION_MODE,
GIMP_SUBTRACT_MODE,
GIMP_DARKEN_ONLY_MODE,
GIMP_LIGHTEN_ONLY_MODE,
GIMP_HUE_MODE,
GIMP_SATURATION_MODE,
GIMP_COLOR_MODE,
GIMP_VALUE_MODE,
GIMP_LCH_HUE_MODE,
GIMP_LCH_CHROMA_MODE,
GIMP_LCH_COLOR_MODE,
GIMP_LCH_LIGHTNESS_MODE
static const GimpLayerMode paint_modes[] =
{
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_BEHIND,
GIMP_LAYER_MODE_COLOR_ERASE,
GIMP_LAYER_MODE_MULTIPLY_BROKEN,
GIMP_LAYER_MODE_DIVIDE_BROKEN,
GIMP_LAYER_MODE_SCREEN_BROKEN,
GIMP_LAYER_MODE_OVERLAY,
GIMP_LAYER_MODE_DODGE_BROKEN,
GIMP_LAYER_MODE_BURN_BROKEN,
GIMP_LAYER_MODE_HARDLIGHT_BROKEN,
GIMP_LAYER_MODE_SOFTLIGHT_BROKEN,
GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN,
GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN,
GIMP_LAYER_MODE_DIFFERENCE_BROKEN,
GIMP_LAYER_MODE_ADDITION_BROKEN,
GIMP_LAYER_MODE_SUBTRACT_BROKEN,
GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN,
GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN,
GIMP_LAYER_MODE_HSV_HUE_BROKEN,
GIMP_LAYER_MODE_HSV_SATURATION_BROKEN,
GIMP_LAYER_MODE_HSV_COLOR_BROKEN,
GIMP_LAYER_MODE_HSV_VALUE_BROKEN,
GIMP_LAYER_MODE_LCH_HUE,
GIMP_LAYER_MODE_LCH_CHROMA,
GIMP_LAYER_MODE_LCH_COLOR,
GIMP_LAYER_MODE_LCH_LIGHTNESS
};
......@@ -85,7 +85,7 @@ static const GimpLayerModeEffects paint_modes[] =
static void context_select_object (GimpActionSelectType select_type,
GimpContext *context,
GimpContainer *container);
static gint context_paint_mode_index (GimpLayerModeEffects paint_mode);
static gint context_paint_mode_index (GimpLayerMode paint_mode);
static void context_select_color (GimpActionSelectType select_type,
GimpRGB *color,
......@@ -399,10 +399,10 @@ context_paint_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpContext *context;
GimpToolInfo *tool_info;
GimpLayerModeEffects paint_mode;
gint index;
GimpContext *context;
GimpToolInfo *tool_info;
GimpLayerMode paint_mode;
gint index;
return_if_no_context (context, data);
paint_mode = gimp_context_get_paint_mode (context);
......@@ -420,7 +420,7 @@ context_paint_mode_cmd_callback (GtkAction *action,
GimpDisplay *display;
const char *value_desc;
gimp_enum_get_value (GIMP_TYPE_LAYER_MODE_EFFECTS, index,
gimp_enum_get_value (GIMP_TYPE_LAYER_MODE, index,
NULL, NULL, &value_desc, NULL);
display = action_data_get_display (data);
......@@ -748,7 +748,7 @@ context_select_object (GimpActionSelectType select_type,
}
static gint
context_paint_mode_index (GimpLayerModeEffects paint_mode)
context_paint_mode_index (GimpLayerMode paint_mode)
{
gint i = 0;
......
......@@ -81,33 +81,33 @@
#include "gimp-intl.h"
static const GimpLayerModeEffects layer_modes[] =
static const GimpLayerMode layer_modes[] =
{
GIMP_NORMAL_MODE,
GIMP_DISSOLVE_MODE,
GIMP_MULTIPLY_MODE,
GIMP_DIVIDE_MODE,
GIMP_SCREEN_MODE,
GIMP_NEW_OVERLAY_MODE,
GIMP_DODGE_MODE,
GIMP_BURN_MODE,
GIMP_HARDLIGHT_MODE,
GIMP_SOFTLIGHT_MODE,
GIMP_GRAIN_EXTRACT_MODE,
GIMP_GRAIN_MERGE_MODE,
GIMP_DIFFERENCE_MODE,
GIMP_ADDITION_MODE,
GIMP_SUBTRACT_MODE,
GIMP_DARKEN_ONLY_MODE,
GIMP_LIGHTEN_ONLY_MODE,
GIMP_HUE_MODE,
GIMP_SATURATION_MODE,
GIMP_COLOR_MODE,
GIMP_VALUE_MODE,
GIMP_LCH_HUE_MODE,
GIMP_LCH_CHROMA_MODE,
GIMP_LCH_COLOR_MODE,
GIMP_LCH_LIGHTNESS_MODE
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_MULTIPLY_BROKEN,
GIMP_LAYER_MODE_DIVIDE_BROKEN,
GIMP_LAYER_MODE_SCREEN_BROKEN,
GIMP_LAYER_MODE_OVERLAY,
GIMP_LAYER_MODE_DODGE_BROKEN,
GIMP_LAYER_MODE_BURN_BROKEN,
GIMP_LAYER_MODE_HARDLIGHT_BROKEN,
GIMP_LAYER_MODE_SOFTLIGHT_BROKEN,
GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN,
GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN,
GIMP_LAYER_MODE_DIFFERENCE_BROKEN,
GIMP_LAYER_MODE_ADDITION_BROKEN,
GIMP_LAYER_MODE_SUBTRACT_BROKEN,
GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN,
GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN,
GIMP_LAYER_MODE_HSV_HUE_BROKEN,
GIMP_LAYER_MODE_HSV_SATURATION_BROKEN,
GIMP_LAYER_MODE_HSV_COLOR_BROKEN,
GIMP_LAYER_MODE_HSV_VALUE_BROKEN,
GIMP_LAYER_MODE_LCH_HUE,
GIMP_LAYER_MODE_LCH_CHROMA,
GIMP_LAYER_MODE_LCH_COLOR,
GIMP_LAYER_MODE_LCH_LIGHTNESS
};
......@@ -118,7 +118,7 @@ static void layers_new_callback (GtkWidget *dialog,
GimpLayer *layer,
GimpContext *context,
const gchar *layer_name,
GimpLayerModeEffects layer_mode,
GimpLayerMode layer_mode,
gdouble layer_opacity,
GimpFillType layer_fill_type,
gint layer_width,
......@@ -138,7 +138,7 @@ static void layers_edit_attributes_callback (GtkWidget *dialog,
GimpLayer *layer,
GimpContext *context,
const gchar *layer_name,
GimpLayerModeEffects layer_mode,
GimpLayerMode layer_mode,
gdouble layer_opacity,
GimpFillType layer_fill_type,
gint layer_width,
......@@ -182,7 +182,7 @@ static void layers_resize_callback (GtkWidget *dialog,
gboolean unused2,
gpointer data);
static gint layers_mode_index (GimpLayerModeEffects layer_mode);
static gint layers_mode_index (GimpLayerMode layer_mode);
/* private variables */
......@@ -346,15 +346,15 @@ void
layers_new_last_vals_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *image;
GtkWidget *widget;
GimpLayer *floating_sel;
GimpLayer *new_layer;
gint width, height;
gint off_x, off_y;
gdouble opacity;
GimpLayerModeEffects mode;
GimpDialogConfig *config;
GimpImage *image;
GtkWidget *widget;
GimpLayer *floating_sel;
GimpLayer *new_layer;
gint width, height;
gint off_x, off_y;
gdouble opacity;
GimpLayerMode mode;
GimpDialogConfig *config;
return_if_no_image (image, data);
return_if_no_widget (widget, data);
......@@ -386,7 +386,7 @@ layers_new_last_vals_cmd_callback (GtkAction *action,
off_x = 0;
off_y = 0;
opacity = 1.0;
mode = GIMP_NORMAL_MODE;
mode = GIMP_LAYER_MODE_NORMAL;
}
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
......@@ -432,7 +432,7 @@ layers_new_from_visible_cmd_callback (GtkAction *action,
TRUE),
_("Visible"),
GIMP_OPACITY_OPAQUE,
GIMP_NORMAL_MODE,
GIMP_LAYER_MODE_NORMAL,
profile);
gimp_image_add_layer (image, layer, GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
......@@ -1109,12 +1109,12 @@ layers_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GimpLayerModeEffects layer_mode;
gint index;
GimpUndo *undo;
gboolean push_undo = TRUE;
GimpImage *image;
GimpLayer *layer;
GimpLayerMode layer_mode;
gint index;
GimpUndo *undo;
gboolean push_undo = TRUE;
return_if_no_layer (image, layer, data);
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
......@@ -1221,26 +1221,26 @@ layers_color_tag_cmd_callback (GtkAction *action,
/* private functions */
static void
layers_new_callback (GtkWidget *dialog,
GimpImage *image,
GimpLayer *layer,
GimpContext *context,
const gchar *layer_name,
GimpLayerModeEffects layer_mode,
gdouble layer_opacity,
GimpFillType layer_fill_type,
gint layer_width,
gint layer_height,
gint layer_offset_x,
gint layer_offset_y,
gboolean layer_visible,
gboolean layer_linked,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_alpha,
gboolean rename_text_layer, /* unused */
gpointer user_data)
layers_new_callback (GtkWidget *dialog,
GimpImage *image,
GimpLayer *layer,
GimpContext *context,
const gchar *layer_name,
GimpLayerMode layer_mode,
gdouble layer_opacity,
GimpFillType layer_fill_type,
gint layer_width,
gint layer_height,
gint layer_offset_x,
gint layer_offset_y,
gboolean layer_visible,
gboolean layer_linked,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_alpha,
gboolean rename_text_layer, /* unused */
gpointer user_data)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
......@@ -1284,26 +1284,26 @@ layers_new_callback (GtkWidget *dialog,
}
static void
layers_edit_attributes_callback (GtkWidget *dialog,
GimpImage *image,
GimpLayer *layer,
GimpContext *context,
const gchar *layer_name,
GimpLayerModeEffects layer_mode,
gdouble layer_opacity,
GimpFillType unused1,
gint unused2,
gint unused3,
gint layer_offset_x,
gint layer_offset_y,
gboolean layer_visible,
gboolean layer_linked,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_alpha,
gboolean rename_text_layer,
gpointer user_data)
layers_edit_attributes_callback (GtkWidget *dialog,
GimpImage *image,
GimpLayer *layer,
GimpContext *context,
const gchar *layer_name,
GimpLayerMode layer_mode,
gdouble layer_opacity,
GimpFillType unused1,
gint unused2,
gint unused3,
gint layer_offset_x,
gint layer_offset_y,
gboolean layer_visible,
gboolean layer_linked,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_alpha,
gboolean rename_text_layer,
gpointer user_data)
{
GimpItem *item = GIMP_ITEM (layer);
......@@ -1528,7 +1528,7 @@ layers_resize_callback (GtkWidget *dialog,
}
static gint
layers_mode_index (GimpLayerModeEffects layer_mode)
layers_mode_index (GimpLayerMode layer_mode)
{
gint i = 0;
......
......@@ -38,7 +38,9 @@
#include <winnls.h>
#endif
#undef GIMP_DISABLE_DEPRECATED /* for compat enums */
#include "libgimpbase/gimpbase.h"
#define GIMP_DISABLE_DEPRECATED
#include "libgimpconfig/gimpconfig.h"
#include "core/core-types.h"
......@@ -91,6 +93,8 @@ void
app_libs_init (GOptionContext *context,
gboolean no_interface)
{
GQuark quark;
/* disable OpenCL before GEGL is even initialized; this way we only
* enable if wanted in gimprc, instead of always enabling, and then
* disabling again if wanted in gimprc
......@@ -108,6 +112,12 @@ app_libs_init (GOptionContext *context,
gui_libs_init (context);
}
#endif
/* keep compat enum code in sync with tools/pdbgen/enumcode.pl */
quark = g_quark_from_static_string ("gimp-compat-enum");
g_type_set_qdata (GIMP_TYPE_LAYER_MODE, quark,
(gpointer) GIMP_TYPE_LAYER_MODE_EFFECTS);
}
void
......
......@@ -298,8 +298,8 @@ gimp_dialog_config_class_init (GimpDialogConfigClass *klass)
"layer-new-mode",
"Default new layer mode",
LAYER_NEW_MODE_BLURB,
GIMP_TYPE_LAYER_MODE_EFFECTS,
GIMP_NORMAL_MODE,
GIMP_TYPE_LAYER_MODE,
GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_DOUBLE (object_class, PROP_LAYER_NEW_OPACITY,
......
......@@ -65,7 +65,7 @@ struct _GimpDialogConfig
gboolean image_resize_resize_text_layers;
gchar *layer_new_name;
GimpLayerModeEffects layer_new_mode;
GimpLayerMode layer_new_mode;
gdouble layer_new_opacity;
GimpFillType layer_new_fill_type;
......
......@@ -285,77 +285,77 @@ gimp_histogram_channel_get_type (void)
}
GType
gimp_layer_mode_effects_get_type (void)
gimp_layer_mode_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_NORMAL_MODE, "GIMP_NORMAL_MODE", "normal-mode" },
{ GIMP_DISSOLVE_MODE, "GIMP_DISSOLVE_MODE", "dissolve-mode" },
{ GIMP_BEHIND_MODE, "GIMP_BEHIND_MODE", "behind-mode" },
{ GIMP_MULTIPLY_MODE, "GIMP_MULTIPLY_MODE", "multiply-mode" },
{ GIMP_SCREEN_MODE, "GIMP_SCREEN_MODE", "screen-mode" },
{ GIMP_OVERLAY_MODE, "GIMP_OVERLAY_MODE", "overlay-mode" },
{ GIMP_DIFFERENCE_MODE, "GIMP_DIFFERENCE_MODE", "difference-mode" },
{ GIMP_ADDITION_MODE, "GIMP_ADDITION_MODE", "addition-mode" },
{ GIMP_SUBTRACT_MODE, "GIMP_SUBTRACT_MODE", "subtract-mode" },
{ GIMP_DARKEN_ONLY_MODE, "GIMP_DARKEN_ONLY_MODE", "darken-only-mode" },
{ GIMP_LIGHTEN_ONLY_MODE, "GIMP_LIGHTEN_ONLY_MODE", "lighten-only-mode" },
{ GIMP_HUE_MODE, "GIMP_HUE_MODE", "hue-mode" },
{ GIMP_SATURATION_MODE, "GIMP_SATURATION_MODE", "saturation-mode" },
{ GIMP_COLOR_MODE, "GIMP_COLOR_MODE", "color-mode" },
{ GIMP_VALUE_MODE, "GIMP_VALUE_MODE", "value-mode" },
{ GIMP_DIVIDE_MODE, "GIMP_DIVIDE_MODE", "divide-mode" },
{ GIMP_DODGE_MODE, "GIMP_DODGE_MODE", "dodge-mode" },
{ GIMP_BURN_MODE, "GIMP_BURN_MODE", "burn-mode" },
{ GIMP_HARDLIGHT_MODE, "GIMP_HARDLIGHT_MODE", "hardlight-mode" },
{ GIMP_SOFTLIGHT_MODE, "GIMP_SOFTLIGHT_MODE", "softlight-mode" },
{ GIMP_GRAIN_EXTRACT_MODE, "GIMP_GRAIN_EXTRACT_MODE", "grain-extract-mode" },
{ GIMP_GRAIN_MERGE_MODE, "GIMP_GRAIN_MERGE_MODE", "grain-merge-mode" },
{ GIMP_COLOR_ERASE_MODE, "GIMP_COLOR_ERASE_MODE", "color-erase-mode" },
{ GIMP_NEW_OVERLAY_MODE, "GIMP_NEW_OVERLAY_MODE", "new-overlay-mode" },
{ GIMP_LCH_HUE_MODE, "GIMP_LCH_HUE_MODE", "lch-hue-mode" },
{ GIMP_LCH_CHROMA_MODE, "GIMP_LCH_CHROMA_MODE", "lch-chroma-mode" },
{ GIMP_LCH_COLOR_MODE, "GIMP_LCH_COLOR_MODE", "lch-color-mode" },
{ GIMP_LCH_LIGHTNESS_MODE, "GIMP_LCH_LIGHTNESS_MODE", "lch-lightness-mode" },
{ GIMP_ERASE_MODE, "GIMP_ERASE_MODE", "erase-mode" },
{ GIMP_REPLACE_MODE, "GIMP_REPLACE_MODE", "replace-mode" },
{ GIMP_ANTI_ERASE_MODE, "GIMP_ANTI_ERASE_MODE", "anti-erase-mode" },
{ GIMP_LAYER_MODE_NORMAL, "GIMP_LAYER_MODE_NORMAL", "normal" },
{ GIMP_LAYER_MODE_DISSOLVE, "GIMP_LAYER_MODE_DISSOLVE", "dissolve" },
{ GIMP_LAYER_MODE_BEHIND, "GIMP_LAYER_MODE_BEHIND", "behind" },
{ GIMP_LAYER_MODE_MULTIPLY_BROKEN, "GIMP_LAYER_MODE_MULTIPLY_BROKEN", "multiply-broken" },
{ GIMP_LAYER_MODE_SCREEN_BROKEN, "GIMP_LAYER_MODE_SCREEN_BROKEN", "screen-broken" },
{ GIMP_LAYER_MODE_OVERLAY_BROKEN, "GIMP_LAYER_MODE_OVERLAY_BROKEN", "overlay-broken" },
{ GIMP_LAYER_MODE_DIFFERENCE_BROKEN, "GIMP_LAYER_MODE_DIFFERENCE_BROKEN", "difference-broken" },
{ GIMP_LAYER_MODE_ADDITION_BROKEN, "GIMP_LAYER_MODE_ADDITION_BROKEN", "addition-broken" },
{ GIMP_LAYER_MODE_SUBTRACT_BROKEN, "GIMP_LAYER_MODE_SUBTRACT_BROKEN", "subtract-broken" },
{ GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN, "GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN", "darken-only-broken" },
{ GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN, "GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN", "lighten-only-broken" },
{ GIMP_LAYER_MODE_HSV_HUE_BROKEN, "GIMP_LAYER_MODE_HSV_HUE_BROKEN", "hsv-hue-broken" },
{ GIMP_LAYER_MODE_HSV_SATURATION_BROKEN, "GIMP_LAYER_MODE_HSV_SATURATION_BROKEN", "hsv-saturation-broken" },
{ GIMP_LAYER_MODE_HSV_COLOR_BROKEN, "GIMP_LAYER_MODE_HSV_COLOR_BROKEN", "hsv-color-broken" },
{ GIMP_LAYER_MODE_HSV_VALUE_BROKEN, "GIMP_LAYER_MODE_HSV_VALUE_BROKEN", "hsv-value-broken" },
{ GIMP_LAYER_MODE_DIVIDE_BROKEN, "GIMP_LAYER_MODE_DIVIDE_BROKEN", "divide-broken" },
{ GIMP_LAYER_MODE_DODGE_BROKEN, "GIMP_LAYER_MODE_DODGE_BROKEN", "dodge-broken" },
{ GIMP_LAYER_MODE_BURN_BROKEN, "GIMP_LAYER_MODE_BURN_BROKEN", "burn-broken" },
{ GIMP_LAYER_MODE_HARDLIGHT_BROKEN, "GIMP_LAYER_MODE_HARDLIGHT_BROKEN", "hardlight-broken" },
{ GIMP_LAYER_MODE_SOFTLIGHT_BROKEN, "GIMP_LAYER_MODE_SOFTLIGHT_BROKEN", "softlight-broken" },
{ GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN, "GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN", "grain-extract-broken" },
{ GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN, "GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN", "grain-merge-broken" },
{ GIMP_LAYER_MODE_COLOR_ERASE, "GIMP_LAYER_MODE_COLOR_ERASE", "color-erase" },
{ GIMP_LAYER_MODE_OVERLAY, "GIMP_LAYER_MODE_OVERLAY", "overlay" },
{ GIMP_LAYER_MODE_LCH_HUE, "GIMP_LAYER_MODE_LCH_HUE", "lch-hue" },
{ GIMP_LAYER_MODE_LCH_CHROMA, "GIMP_LAYER_MODE_LCH_CHROMA", "lch-chroma" },
{ GIMP_LAYER_MODE_LCH_COLOR, "GIMP_LAYER_MODE_LCH_COLOR", "lch-color" },
{ GIMP_LAYER_MODE_LCH_LIGHTNESS, "GIMP_LAYER_MODE_LCH_LIGHTNESS", "lch-lightness" },
{ GIMP_LAYER_MODE_ERASE, "GIMP_LAYER_MODE_ERASE", "erase" },
{ GIMP_LAYER_MODE_REPLACE, "GIMP_LAYER_MODE_REPLACE", "replace" },
{ GIMP_LAYER_MODE_ANTI_ERASE, "GIMP_LAYER_MODE_ANTI_ERASE", "anti-erase" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_NORMAL_MODE, NC_("layer-mode-effects", "Normal"), NULL },
{ GIMP_DISSOLVE_MODE, NC_("layer-mode-effects", "Dissolve"), NULL },
{ GIMP_BEHIND_MODE, NC_("layer-mode-effects", "Behind"), NULL },
{ GIMP_MULTIPLY_MODE, NC_("layer-mode-effects", "Multiply"), NULL },
{ GIMP_SCREEN_MODE, NC_("layer-mode-effects", "Screen"), NULL },
{ GIMP_OVERLAY_MODE, NC_("layer-mode-effects", "Old broken Overlay"), NULL },
{ GIMP_DIFFERENCE_MODE, NC_("layer-mode-effects", "Difference"), NULL },
{ GIMP_ADDITION_MODE, NC_("layer-mode-effects", "Addition"), NULL },
{ GIMP_SUBTRACT_MODE, NC_("layer-mode-effects", "Subtract"), NULL },
{ GIMP_DARKEN_ONLY_MODE, NC_("layer-mode-effects", "Darken only"), NULL },
{ GIMP_LIGHTEN_ONLY_MODE, NC_("layer-mode-effects", "Lighten only"), NULL },
{ GIMP_HUE_MODE, NC_("layer-mode-effects", "Hue (HSV)"), NULL },
{ GIMP_SATURATION_MODE, NC_("layer-mode-effects", "Saturation (HSV)"), NULL },
{ GIMP_COLOR_MODE, NC_("layer-mode-effects", "Color (HSV)"), NULL },
{ GIMP_VALUE_MODE, NC_("layer-mode-effects", "Value (HSV)"), NULL },
{ GIMP_DIVIDE_MODE, NC_("layer-mode-effects", "Divide"), NULL },
{ GIMP_DODGE_MODE, NC_("layer-mode-effects", "Dodge"), NULL },
{ GIMP_BURN_MODE, NC_("layer-mode-effects", "Burn"), NULL },
{ GIMP_HARDLIGHT_MODE, NC_("layer-mode-effects", "Hard light"), NULL },
{ GIMP_SOFTLIGHT_MODE, NC_("layer-mode-effects", "Soft light"), NULL },
{ GIMP_GRAIN_EXTRACT_MODE, NC_("layer-mode-effects", "Grain extract"), NULL },
{ GIMP_GRAIN_MERGE_MODE, NC_("layer-mode-effects", "Grain merge"), NULL },
{ GIMP_COLOR_ERASE_MODE, NC_("layer-mode-effects", "Color erase"), NULL },
{ GIMP_NEW_OVERLAY_MODE, NC_("layer-mode-effects", "Overlay"), NULL },
{ GIMP_LCH_HUE_MODE, NC_("layer-mode-effects", "Hue (LCH)"), NULL },
{ GIMP_LCH_CHROMA_MODE, NC_("layer-mode-effects", "Chroma (LCH)"), NULL },
{ GIMP_LCH_COLOR_MODE, NC_("layer-mode-effects", "Color (LCH)"), NULL },
{ GIMP_LCH_LIGHTNESS_MODE, NC_("layer-mode-effects", "Lightness (LCH)"), NULL },
{ GIMP_ERASE_MODE, NC_("layer-mode-effects", "Erase"), NULL },
{ GIMP_REPLACE_MODE, NC_("layer-mode-effects", "Replace"), NULL },
{ GIMP_ANTI_ERASE_MODE, NC_("layer-mode-effects", "Anti erase"), NULL },
{ GIMP_LAYER_MODE_NORMAL, NC_("layer-mode", "Normal"), NULL },
{ GIMP_LAYER_MODE_DISSOLVE, NC_("layer-mode", "Dissolve"), NULL },
{ GIMP_LAYER_MODE_BEHIND, NC_("layer-mode", "Behind"), NULL },
{ GIMP_LAYER_MODE_MULTIPLY_BROKEN, NC_("layer-mode", "Multiply"), NULL },
{ GIMP_LAYER_MODE_SCREEN_BROKEN, NC_("layer-mode", "Screen"), NULL },
{ GIMP_LAYER_MODE_OVERLAY_BROKEN, NC_("layer-mode", "Old broken Overlay"), NULL },
{ GIMP_LAYER_MODE_DIFFERENCE_BROKEN, NC_("layer-mode", "Difference"), NULL },
{ GIMP_LAYER_MODE_ADDITION_BROKEN, NC_("layer-mode", "Addition"), NULL },
{ GIMP_LAYER_MODE_SUBTRACT_BROKEN, NC_("layer-mode", "Subtract"), NULL },
{ GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN, NC_("layer-mode", "Darken only"), NULL },
{ GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN, NC_("layer-mode", "Lighten only"), NULL },
{ GIMP_LAYER_MODE_HSV_HUE_BROKEN, NC_("layer-mode", "Hue (HSV)"), NULL },
{ GIMP_LAYER_MODE_HSV_SATURATION_BROKEN, NC_("layer-mode", "Saturation (HSV)"), NULL },
{ GIMP_LAYER_MODE_HSV_COLOR_BROKEN, NC_("layer-mode", "Color (HSV)"), NULL },
{ GIMP_LAYER_MODE_HSV_VALUE_BROKEN, NC_("layer-mode", "Value (HSV)"), NULL },
{ GIMP_LAYER_MODE_DIVIDE_BROKEN, NC_("layer-mode", "Divide"), NULL },
{ GIMP_LAYER_MODE_DODGE_BROKEN, NC_("layer-mode", "Dodge"), NULL },
{ GIMP_LAYER_MODE_BURN_BROKEN, NC_("layer-mode", "Burn"), NULL },
{ GIMP_LAYER_MODE_HARDLIGHT_BROKEN, NC_("layer-mode", "Hard light"), NULL },
{ GIMP_LAYER_MODE_SOFTLIGHT_BROKEN, NC_("layer-mode", "Soft light"), NULL },
{ GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN, NC_("layer-mode", "Grain extract"), NULL },
{ GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN, NC_("layer-mode", "Grain merge"), NULL },
{ GIMP_LAYER_MODE_COLOR_ERASE, NC_("layer-mode", "Color erase"), NULL },
{ GIMP_LAYER_MODE_OVERLAY, NC_("layer-mode", "Overlay"), NULL },
{ GIMP_LAYER_MODE_LCH_HUE, NC_("layer-mode", "Hue (LCH)"), NULL },
{ GIMP_LAYER_MODE_LCH_CHROMA, NC_("layer-mode", "Chroma (LCH)"), NULL },
{ GIMP_LAYER_MODE_LCH_COLOR, NC_("layer-mode", "Color (LCH)"), NULL },
{ GIMP_LAYER_MODE_LCH_LIGHTNESS, NC_("layer-mode", "Lightness (LCH)"), NULL },
{ GIMP_LAYER_MODE_ERASE, NC_("layer-mode", "Erase"), NULL },
{ GIMP_LAYER_MODE_REPLACE, NC_("layer-mode", "Replace"), NULL },
{ GIMP_LAYER_MODE_ANTI_ERASE, NC_("layer-mode", "Anti erase"), NULL },
{ 0, NULL, NULL }
};
......@@ -363,8 +363,8 @@ gimp_layer_mode_effects_get_type (void)
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpLayerModeEffects", values);
gimp_type_set_translation_context (type, "layer-mode-effects");
type = g_enum_register_static ("GimpLayerMode", values);
gimp_type_set_translation_context (type, "layer-mode");
gimp_enum_set_value_descriptions (type, descs);
}
......
......@@ -148,46 +148,46 @@ typedef enum
} GimpHistogramChannel;
#define GIMP_TYPE_LAYER_MODE_EFFECTS (gimp_layer_mode_effects_get_type ())
#define GIMP_TYPE_LAYER_MODE (gimp_layer_mode_get_type ())
GType gimp_layer_mode_effects_get_type (void) G_GNUC_CONST;
GType gimp_layer_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_NORMAL_MODE, /*< desc="Normal" >*/
GIMP_DISSOLVE_MODE, /*< desc="Dissolve" >*/
GIMP_BEHIND_MODE, /*< desc="Behind" >*/
GIMP_MULTIPLY_MODE, /*< desc="Multiply" >*/
GIMP_SCREEN_MODE, /*< desc="Screen" >*/
GIMP_OVERLAY_MODE, /*< desc="Old broken Overlay" >*/
GIMP_DIFFERENCE_MODE, /*< desc="Difference" >*/
GIMP_ADDITION_MODE, /*< desc="Addition" >*/
GIMP_SUBTRACT_MODE, /*< desc="Subtract" >*/
GIMP_DARKEN_ONLY_MODE, /*< desc="Darken only" >*/
GIMP_LIGHTEN_ONLY_MODE, /*< desc="Lighten only" >*/
GIMP_HUE_MODE, /*< desc="Hue (HSV)" >*/
GIMP_SATURATION_MODE, /*< desc="Saturation (HSV)" >*/
GIMP_COLOR_MODE, /*< desc="Color (HSV)" >*/
GIMP_VALUE_MODE, /*< desc="Value (HSV)" >*/
GIMP_DIVIDE_MODE, /*< desc="Divide" >*/
GIMP_DODGE_MODE, /*< desc="Dodge" >*/
GIMP_BURN_MODE, /*< desc="Burn" >*/
GIMP_HARDLIGHT_MODE, /*< desc="Hard light" >*/
GIMP_SOFTLIGHT_MODE, /*< desc="Soft light" >*/
GIMP_GRAIN_EXTRACT_MODE, /*< desc="Grain extract" >*/
GIMP_GRAIN_MERGE_MODE, /*< desc="Grain merge" >*/
GIMP_COLOR_ERASE_MODE, /*< desc="Color erase" >*/
GIMP_NEW_OVERLAY_MODE, /*< desc="Overlay" >*/
GIMP_LCH_HUE_MODE, /*< desc="Hue (LCH)" >*/
GIMP_LCH_CHROMA_MODE, /*< desc="Chroma (LCH)" >*/
GIMP_LCH_COLOR_MODE, /*< desc="Color (LCH)" >*/
GIMP_LCH_LIGHTNESS_MODE, /*< desc="Lightness (LCH)" >*/
GIMP_LAYER_MODE_NORMAL, /*< desc="Normal" >*/
GIMP_LAYER_MODE_DISSOLVE, /*< desc="Dissolve" >*/
GIMP_LAYER_MODE_BEHIND, /*< desc="Behind" >*/
GIMP_LAYER_MODE_MULTIPLY_BROKEN, /*< desc="Multiply" >*/
GIMP_LAYER_MODE_SCREEN_BROKEN, /*< desc="Screen" >*/
GIMP_LAYER_MODE_OVERLAY_BROKEN, /*< desc="Old broken Overlay" >*/
GIMP_LAYER_MODE_DIFFERENCE_BROKEN, /*< desc="Difference" >*/
GIMP_LAYER_MODE_ADDITION_BROKEN, /*< desc="Addition" >*/
GIMP_LAYER_MODE_SUBTRACT_BROKEN, /*< desc="Subtract" >*/
GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN, /*< desc="Darken only" >*/
GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN, /*< desc="Lighten only" >*/
GIMP_LAYER_MODE_HSV_HUE_BROKEN, /*< desc="Hue (HSV)" >*/
GIMP_LAYER_MODE_HSV_SATURATION_BROKEN, /*< desc="Saturation (HSV)" >*/
GIMP_LAYER_MODE_HSV_COLOR_BROKEN, /*< desc="Color (HSV)" >*/
GIMP_LAYER_MODE_HSV_VALUE_BROKEN, /*< desc="Value (HSV)" >*/
GIMP_LAYER_MODE_DIVIDE_BROKEN, /*< desc="Divide" >*/
GIMP_LAYER_MODE_DODGE_BROKEN, /*< desc="Dodge" >*/
GIMP_LAYER_MODE_BURN_BROKEN, /*< desc="Burn" >*/
GIMP_LAYER_MODE_HARDLIGHT_BROKEN, /*< desc="Hard light" >*/
GIMP_LAYER_MODE_SOFTLIGHT_BROKEN, /*< desc="Soft light" >*/
GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN, /*< desc="Grain extract" >*/
GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN, /*< desc="Grain merge" >*/
GIMP_LAYER_MODE_COLOR_ERASE, /*< desc="Color erase" >*/
GIMP_LAYER_MODE_OVERLAY, /*< desc="Overlay" >*/
GIMP_LAYER_MODE_LCH_HUE, /*< desc="Hue (LCH)" >*/
GIMP_LAYER_MODE_LCH_CHROMA, /*< desc="Chroma (LCH)" >*/
GIMP_LAYER_MODE_LCH_COLOR, /*< desc="Color (LCH)" >*/
GIMP_LAYER_MODE_LCH_LIGHTNESS, /*< desc="Lightness (LCH)" >*/
/* internal modes, not available to the PDB */
GIMP_ERASE_MODE = 1000, /*< pdb-skip, desc="Erase" >*/
GIMP_REPLACE_MODE = 1001, /*< pdb-skip, desc="Replace" >*/
GIMP_ANTI_ERASE_MODE = 1002 /*< pdb-skip, desc="Anti erase" >*/
} GimpLayerModeEffects;