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.
This commit is contained in:
Michael Natterer 2017-01-08 23:00:19 +01:00
parent 4fb62427a2
commit 66060e3307
171 changed files with 1921 additions and 1445 deletions

View File

@ -48,35 +48,35 @@
#include "gimp-intl.h" #include "gimp-intl.h"
static const GimpLayerModeEffects paint_modes[] = static const GimpLayerMode paint_modes[] =
{ {
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_DISSOLVE_MODE, GIMP_LAYER_MODE_DISSOLVE,
GIMP_BEHIND_MODE, GIMP_LAYER_MODE_BEHIND,
GIMP_COLOR_ERASE_MODE, GIMP_LAYER_MODE_COLOR_ERASE,
GIMP_MULTIPLY_MODE, GIMP_LAYER_MODE_MULTIPLY_BROKEN,
GIMP_DIVIDE_MODE, GIMP_LAYER_MODE_DIVIDE_BROKEN,
GIMP_SCREEN_MODE, GIMP_LAYER_MODE_SCREEN_BROKEN,
GIMP_NEW_OVERLAY_MODE, GIMP_LAYER_MODE_OVERLAY,
GIMP_DODGE_MODE, GIMP_LAYER_MODE_DODGE_BROKEN,
GIMP_BURN_MODE, GIMP_LAYER_MODE_BURN_BROKEN,
GIMP_HARDLIGHT_MODE, GIMP_LAYER_MODE_HARDLIGHT_BROKEN,
GIMP_SOFTLIGHT_MODE, GIMP_LAYER_MODE_SOFTLIGHT_BROKEN,
GIMP_GRAIN_EXTRACT_MODE, GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN,
GIMP_GRAIN_MERGE_MODE, GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN,
GIMP_DIFFERENCE_MODE, GIMP_LAYER_MODE_DIFFERENCE_BROKEN,
GIMP_ADDITION_MODE, GIMP_LAYER_MODE_ADDITION_BROKEN,
GIMP_SUBTRACT_MODE, GIMP_LAYER_MODE_SUBTRACT_BROKEN,
GIMP_DARKEN_ONLY_MODE, GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN,
GIMP_LIGHTEN_ONLY_MODE, GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN,
GIMP_HUE_MODE, GIMP_LAYER_MODE_HSV_HUE_BROKEN,
GIMP_SATURATION_MODE, GIMP_LAYER_MODE_HSV_SATURATION_BROKEN,
GIMP_COLOR_MODE, GIMP_LAYER_MODE_HSV_COLOR_BROKEN,
GIMP_VALUE_MODE, GIMP_LAYER_MODE_HSV_VALUE_BROKEN,
GIMP_LCH_HUE_MODE, GIMP_LAYER_MODE_LCH_HUE,
GIMP_LCH_CHROMA_MODE, GIMP_LAYER_MODE_LCH_CHROMA,
GIMP_LCH_COLOR_MODE, GIMP_LAYER_MODE_LCH_COLOR,
GIMP_LCH_LIGHTNESS_MODE GIMP_LAYER_MODE_LCH_LIGHTNESS
}; };
@ -85,7 +85,7 @@ static const GimpLayerModeEffects paint_modes[] =
static void context_select_object (GimpActionSelectType select_type, static void context_select_object (GimpActionSelectType select_type,
GimpContext *context, GimpContext *context,
GimpContainer *container); 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, static void context_select_color (GimpActionSelectType select_type,
GimpRGB *color, GimpRGB *color,
@ -399,10 +399,10 @@ context_paint_mode_cmd_callback (GtkAction *action,
gint value, gint value,
gpointer data) gpointer data)
{ {
GimpContext *context; GimpContext *context;
GimpToolInfo *tool_info; GimpToolInfo *tool_info;
GimpLayerModeEffects paint_mode; GimpLayerMode paint_mode;
gint index; gint index;
return_if_no_context (context, data); return_if_no_context (context, data);
paint_mode = gimp_context_get_paint_mode (context); paint_mode = gimp_context_get_paint_mode (context);
@ -420,7 +420,7 @@ context_paint_mode_cmd_callback (GtkAction *action,
GimpDisplay *display; GimpDisplay *display;
const char *value_desc; 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); NULL, NULL, &value_desc, NULL);
display = action_data_get_display (data); display = action_data_get_display (data);
@ -748,7 +748,7 @@ context_select_object (GimpActionSelectType select_type,
} }
static gint static gint
context_paint_mode_index (GimpLayerModeEffects paint_mode) context_paint_mode_index (GimpLayerMode paint_mode)
{ {
gint i = 0; gint i = 0;

View File

@ -81,33 +81,33 @@
#include "gimp-intl.h" #include "gimp-intl.h"
static const GimpLayerModeEffects layer_modes[] = static const GimpLayerMode layer_modes[] =
{ {
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_DISSOLVE_MODE, GIMP_LAYER_MODE_DISSOLVE,
GIMP_MULTIPLY_MODE, GIMP_LAYER_MODE_MULTIPLY_BROKEN,
GIMP_DIVIDE_MODE, GIMP_LAYER_MODE_DIVIDE_BROKEN,
GIMP_SCREEN_MODE, GIMP_LAYER_MODE_SCREEN_BROKEN,
GIMP_NEW_OVERLAY_MODE, GIMP_LAYER_MODE_OVERLAY,
GIMP_DODGE_MODE, GIMP_LAYER_MODE_DODGE_BROKEN,
GIMP_BURN_MODE, GIMP_LAYER_MODE_BURN_BROKEN,
GIMP_HARDLIGHT_MODE, GIMP_LAYER_MODE_HARDLIGHT_BROKEN,
GIMP_SOFTLIGHT_MODE, GIMP_LAYER_MODE_SOFTLIGHT_BROKEN,
GIMP_GRAIN_EXTRACT_MODE, GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN,
GIMP_GRAIN_MERGE_MODE, GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN,
GIMP_DIFFERENCE_MODE, GIMP_LAYER_MODE_DIFFERENCE_BROKEN,
GIMP_ADDITION_MODE, GIMP_LAYER_MODE_ADDITION_BROKEN,
GIMP_SUBTRACT_MODE, GIMP_LAYER_MODE_SUBTRACT_BROKEN,
GIMP_DARKEN_ONLY_MODE, GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN,
GIMP_LIGHTEN_ONLY_MODE, GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN,
GIMP_HUE_MODE, GIMP_LAYER_MODE_HSV_HUE_BROKEN,
GIMP_SATURATION_MODE, GIMP_LAYER_MODE_HSV_SATURATION_BROKEN,
GIMP_COLOR_MODE, GIMP_LAYER_MODE_HSV_COLOR_BROKEN,
GIMP_VALUE_MODE, GIMP_LAYER_MODE_HSV_VALUE_BROKEN,
GIMP_LCH_HUE_MODE, GIMP_LAYER_MODE_LCH_HUE,
GIMP_LCH_CHROMA_MODE, GIMP_LAYER_MODE_LCH_CHROMA,
GIMP_LCH_COLOR_MODE, GIMP_LAYER_MODE_LCH_COLOR,
GIMP_LCH_LIGHTNESS_MODE GIMP_LAYER_MODE_LCH_LIGHTNESS
}; };
@ -118,7 +118,7 @@ static void layers_new_callback (GtkWidget *dialog,
GimpLayer *layer, GimpLayer *layer,
GimpContext *context, GimpContext *context,
const gchar *layer_name, const gchar *layer_name,
GimpLayerModeEffects layer_mode, GimpLayerMode layer_mode,
gdouble layer_opacity, gdouble layer_opacity,
GimpFillType layer_fill_type, GimpFillType layer_fill_type,
gint layer_width, gint layer_width,
@ -138,7 +138,7 @@ static void layers_edit_attributes_callback (GtkWidget *dialog,
GimpLayer *layer, GimpLayer *layer,
GimpContext *context, GimpContext *context,
const gchar *layer_name, const gchar *layer_name,
GimpLayerModeEffects layer_mode, GimpLayerMode layer_mode,
gdouble layer_opacity, gdouble layer_opacity,
GimpFillType layer_fill_type, GimpFillType layer_fill_type,
gint layer_width, gint layer_width,
@ -182,7 +182,7 @@ static void layers_resize_callback (GtkWidget *dialog,
gboolean unused2, gboolean unused2,
gpointer data); gpointer data);
static gint layers_mode_index (GimpLayerModeEffects layer_mode); static gint layers_mode_index (GimpLayerMode layer_mode);
/* private variables */ /* private variables */
@ -346,15 +346,15 @@ void
layers_new_last_vals_cmd_callback (GtkAction *action, layers_new_last_vals_cmd_callback (GtkAction *action,
gpointer data) gpointer data)
{ {
GimpImage *image; GimpImage *image;
GtkWidget *widget; GtkWidget *widget;
GimpLayer *floating_sel; GimpLayer *floating_sel;
GimpLayer *new_layer; GimpLayer *new_layer;
gint width, height; gint width, height;
gint off_x, off_y; gint off_x, off_y;
gdouble opacity; gdouble opacity;
GimpLayerModeEffects mode; GimpLayerMode mode;
GimpDialogConfig *config; GimpDialogConfig *config;
return_if_no_image (image, data); return_if_no_image (image, data);
return_if_no_widget (widget, data); return_if_no_widget (widget, data);
@ -386,7 +386,7 @@ layers_new_last_vals_cmd_callback (GtkAction *action,
off_x = 0; off_x = 0;
off_y = 0; off_y = 0;
opacity = 1.0; opacity = 1.0;
mode = GIMP_NORMAL_MODE; mode = GIMP_LAYER_MODE_NORMAL;
} }
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
@ -432,7 +432,7 @@ layers_new_from_visible_cmd_callback (GtkAction *action,
TRUE), TRUE),
_("Visible"), _("Visible"),
GIMP_OPACITY_OPAQUE, GIMP_OPACITY_OPAQUE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
profile); profile);
gimp_image_add_layer (image, layer, GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE); gimp_image_add_layer (image, layer, GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
@ -1109,12 +1109,12 @@ layers_mode_cmd_callback (GtkAction *action,
gint value, gint value,
gpointer data) gpointer data)
{ {
GimpImage *image; GimpImage *image;
GimpLayer *layer; GimpLayer *layer;
GimpLayerModeEffects layer_mode; GimpLayerMode layer_mode;
gint index; gint index;
GimpUndo *undo; GimpUndo *undo;
gboolean push_undo = TRUE; gboolean push_undo = TRUE;
return_if_no_layer (image, layer, data); return_if_no_layer (image, layer, data);
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
@ -1221,26 +1221,26 @@ layers_color_tag_cmd_callback (GtkAction *action,
/* private functions */ /* private functions */
static void static void
layers_new_callback (GtkWidget *dialog, layers_new_callback (GtkWidget *dialog,
GimpImage *image, GimpImage *image,
GimpLayer *layer, GimpLayer *layer,
GimpContext *context, GimpContext *context,
const gchar *layer_name, const gchar *layer_name,
GimpLayerModeEffects layer_mode, GimpLayerMode layer_mode,
gdouble layer_opacity, gdouble layer_opacity,
GimpFillType layer_fill_type, GimpFillType layer_fill_type,
gint layer_width, gint layer_width,
gint layer_height, gint layer_height,
gint layer_offset_x, gint layer_offset_x,
gint layer_offset_y, gint layer_offset_y,
gboolean layer_visible, gboolean layer_visible,
gboolean layer_linked, gboolean layer_linked,
GimpColorTag layer_color_tag, GimpColorTag layer_color_tag,
gboolean layer_lock_pixels, gboolean layer_lock_pixels,
gboolean layer_lock_position, gboolean layer_lock_position,
gboolean layer_lock_alpha, gboolean layer_lock_alpha,
gboolean rename_text_layer, /* unused */ gboolean rename_text_layer, /* unused */
gpointer user_data) gpointer user_data)
{ {
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config); GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
@ -1284,26 +1284,26 @@ layers_new_callback (GtkWidget *dialog,
} }
static void static void
layers_edit_attributes_callback (GtkWidget *dialog, layers_edit_attributes_callback (GtkWidget *dialog,
GimpImage *image, GimpImage *image,
GimpLayer *layer, GimpLayer *layer,
GimpContext *context, GimpContext *context,
const gchar *layer_name, const gchar *layer_name,
GimpLayerModeEffects layer_mode, GimpLayerMode layer_mode,
gdouble layer_opacity, gdouble layer_opacity,
GimpFillType unused1, GimpFillType unused1,
gint unused2, gint unused2,
gint unused3, gint unused3,
gint layer_offset_x, gint layer_offset_x,
gint layer_offset_y, gint layer_offset_y,
gboolean layer_visible, gboolean layer_visible,
gboolean layer_linked, gboolean layer_linked,
GimpColorTag layer_color_tag, GimpColorTag layer_color_tag,
gboolean layer_lock_pixels, gboolean layer_lock_pixels,
gboolean layer_lock_position, gboolean layer_lock_position,
gboolean layer_lock_alpha, gboolean layer_lock_alpha,
gboolean rename_text_layer, gboolean rename_text_layer,
gpointer user_data) gpointer user_data)
{ {
GimpItem *item = GIMP_ITEM (layer); GimpItem *item = GIMP_ITEM (layer);
@ -1528,7 +1528,7 @@ layers_resize_callback (GtkWidget *dialog,
} }
static gint static gint
layers_mode_index (GimpLayerModeEffects layer_mode) layers_mode_index (GimpLayerMode layer_mode)
{ {
gint i = 0; gint i = 0;

View File

@ -38,7 +38,9 @@
#include <winnls.h> #include <winnls.h>
#endif #endif
#undef GIMP_DISABLE_DEPRECATED /* for compat enums */
#include "libgimpbase/gimpbase.h" #include "libgimpbase/gimpbase.h"
#define GIMP_DISABLE_DEPRECATED
#include "libgimpconfig/gimpconfig.h" #include "libgimpconfig/gimpconfig.h"
#include "core/core-types.h" #include "core/core-types.h"
@ -91,6 +93,8 @@ void
app_libs_init (GOptionContext *context, app_libs_init (GOptionContext *context,
gboolean no_interface) gboolean no_interface)
{ {
GQuark quark;
/* disable OpenCL before GEGL is even initialized; this way we only /* disable OpenCL before GEGL is even initialized; this way we only
* enable if wanted in gimprc, instead of always enabling, and then * enable if wanted in gimprc, instead of always enabling, and then
* disabling again if wanted in gimprc * disabling again if wanted in gimprc
@ -108,6 +112,12 @@ app_libs_init (GOptionContext *context,
gui_libs_init (context); gui_libs_init (context);
} }
#endif #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 void

View File

@ -298,8 +298,8 @@ gimp_dialog_config_class_init (GimpDialogConfigClass *klass)
"layer-new-mode", "layer-new-mode",
"Default new layer mode", "Default new layer mode",
LAYER_NEW_MODE_BLURB, LAYER_NEW_MODE_BLURB,
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_STATIC_STRINGS); GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_DOUBLE (object_class, PROP_LAYER_NEW_OPACITY, GIMP_CONFIG_PROP_DOUBLE (object_class, PROP_LAYER_NEW_OPACITY,

View File

@ -65,7 +65,7 @@ struct _GimpDialogConfig
gboolean image_resize_resize_text_layers; gboolean image_resize_resize_text_layers;
gchar *layer_new_name; gchar *layer_new_name;
GimpLayerModeEffects layer_new_mode; GimpLayerMode layer_new_mode;
gdouble layer_new_opacity; gdouble layer_new_opacity;
GimpFillType layer_new_fill_type; GimpFillType layer_new_fill_type;

View File

@ -285,77 +285,77 @@ gimp_histogram_channel_get_type (void)
} }
GType GType
gimp_layer_mode_effects_get_type (void) gimp_layer_mode_get_type (void)
{ {
static const GEnumValue values[] = static const GEnumValue values[] =
{ {
{ GIMP_NORMAL_MODE, "GIMP_NORMAL_MODE", "normal-mode" }, { GIMP_LAYER_MODE_NORMAL, "GIMP_LAYER_MODE_NORMAL", "normal" },
{ GIMP_DISSOLVE_MODE, "GIMP_DISSOLVE_MODE", "dissolve-mode" }, { GIMP_LAYER_MODE_DISSOLVE, "GIMP_LAYER_MODE_DISSOLVE", "dissolve" },
{ GIMP_BEHIND_MODE, "GIMP_BEHIND_MODE", "behind-mode" }, { GIMP_LAYER_MODE_BEHIND, "GIMP_LAYER_MODE_BEHIND", "behind" },
{ GIMP_MULTIPLY_MODE, "GIMP_MULTIPLY_MODE", "multiply-mode" }, { GIMP_LAYER_MODE_MULTIPLY_BROKEN, "GIMP_LAYER_MODE_MULTIPLY_BROKEN", "multiply-broken" },
{ GIMP_SCREEN_MODE, "GIMP_SCREEN_MODE", "screen-mode" }, { GIMP_LAYER_MODE_SCREEN_BROKEN, "GIMP_LAYER_MODE_SCREEN_BROKEN", "screen-broken" },
{ GIMP_OVERLAY_MODE, "GIMP_OVERLAY_MODE", "overlay-mode" }, { GIMP_LAYER_MODE_OVERLAY_BROKEN, "GIMP_LAYER_MODE_OVERLAY_BROKEN", "overlay-broken" },
{ GIMP_DIFFERENCE_MODE, "GIMP_DIFFERENCE_MODE", "difference-mode" }, { GIMP_LAYER_MODE_DIFFERENCE_BROKEN, "GIMP_LAYER_MODE_DIFFERENCE_BROKEN", "difference-broken" },
{ GIMP_ADDITION_MODE, "GIMP_ADDITION_MODE", "addition-mode" }, { GIMP_LAYER_MODE_ADDITION_BROKEN, "GIMP_LAYER_MODE_ADDITION_BROKEN", "addition-broken" },
{ GIMP_SUBTRACT_MODE, "GIMP_SUBTRACT_MODE", "subtract-mode" }, { GIMP_LAYER_MODE_SUBTRACT_BROKEN, "GIMP_LAYER_MODE_SUBTRACT_BROKEN", "subtract-broken" },
{ GIMP_DARKEN_ONLY_MODE, "GIMP_DARKEN_ONLY_MODE", "darken-only-mode" }, { GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN, "GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN", "darken-only-broken" },
{ GIMP_LIGHTEN_ONLY_MODE, "GIMP_LIGHTEN_ONLY_MODE", "lighten-only-mode" }, { GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN, "GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN", "lighten-only-broken" },
{ GIMP_HUE_MODE, "GIMP_HUE_MODE", "hue-mode" }, { GIMP_LAYER_MODE_HSV_HUE_BROKEN, "GIMP_LAYER_MODE_HSV_HUE_BROKEN", "hsv-hue-broken" },
{ GIMP_SATURATION_MODE, "GIMP_SATURATION_MODE", "saturation-mode" }, { GIMP_LAYER_MODE_HSV_SATURATION_BROKEN, "GIMP_LAYER_MODE_HSV_SATURATION_BROKEN", "hsv-saturation-broken" },
{ GIMP_COLOR_MODE, "GIMP_COLOR_MODE", "color-mode" }, { GIMP_LAYER_MODE_HSV_COLOR_BROKEN, "GIMP_LAYER_MODE_HSV_COLOR_BROKEN", "hsv-color-broken" },
{ GIMP_VALUE_MODE, "GIMP_VALUE_MODE", "value-mode" }, { GIMP_LAYER_MODE_HSV_VALUE_BROKEN, "GIMP_LAYER_MODE_HSV_VALUE_BROKEN", "hsv-value-broken" },
{ GIMP_DIVIDE_MODE, "GIMP_DIVIDE_MODE", "divide-mode" }, { GIMP_LAYER_MODE_DIVIDE_BROKEN, "GIMP_LAYER_MODE_DIVIDE_BROKEN", "divide-broken" },
{ GIMP_DODGE_MODE, "GIMP_DODGE_MODE", "dodge-mode" }, { GIMP_LAYER_MODE_DODGE_BROKEN, "GIMP_LAYER_MODE_DODGE_BROKEN", "dodge-broken" },
{ GIMP_BURN_MODE, "GIMP_BURN_MODE", "burn-mode" }, { GIMP_LAYER_MODE_BURN_BROKEN, "GIMP_LAYER_MODE_BURN_BROKEN", "burn-broken" },
{ GIMP_HARDLIGHT_MODE, "GIMP_HARDLIGHT_MODE", "hardlight-mode" }, { GIMP_LAYER_MODE_HARDLIGHT_BROKEN, "GIMP_LAYER_MODE_HARDLIGHT_BROKEN", "hardlight-broken" },
{ GIMP_SOFTLIGHT_MODE, "GIMP_SOFTLIGHT_MODE", "softlight-mode" }, { GIMP_LAYER_MODE_SOFTLIGHT_BROKEN, "GIMP_LAYER_MODE_SOFTLIGHT_BROKEN", "softlight-broken" },
{ GIMP_GRAIN_EXTRACT_MODE, "GIMP_GRAIN_EXTRACT_MODE", "grain-extract-mode" }, { GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN, "GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN", "grain-extract-broken" },
{ GIMP_GRAIN_MERGE_MODE, "GIMP_GRAIN_MERGE_MODE", "grain-merge-mode" }, { GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN, "GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN", "grain-merge-broken" },
{ GIMP_COLOR_ERASE_MODE, "GIMP_COLOR_ERASE_MODE", "color-erase-mode" }, { GIMP_LAYER_MODE_COLOR_ERASE, "GIMP_LAYER_MODE_COLOR_ERASE", "color-erase" },
{ GIMP_NEW_OVERLAY_MODE, "GIMP_NEW_OVERLAY_MODE", "new-overlay-mode" }, { GIMP_LAYER_MODE_OVERLAY, "GIMP_LAYER_MODE_OVERLAY", "overlay" },
{ GIMP_LCH_HUE_MODE, "GIMP_LCH_HUE_MODE", "lch-hue-mode" }, { GIMP_LAYER_MODE_LCH_HUE, "GIMP_LAYER_MODE_LCH_HUE", "lch-hue" },
{ GIMP_LCH_CHROMA_MODE, "GIMP_LCH_CHROMA_MODE", "lch-chroma-mode" }, { GIMP_LAYER_MODE_LCH_CHROMA, "GIMP_LAYER_MODE_LCH_CHROMA", "lch-chroma" },
{ GIMP_LCH_COLOR_MODE, "GIMP_LCH_COLOR_MODE", "lch-color-mode" }, { GIMP_LAYER_MODE_LCH_COLOR, "GIMP_LAYER_MODE_LCH_COLOR", "lch-color" },
{ GIMP_LCH_LIGHTNESS_MODE, "GIMP_LCH_LIGHTNESS_MODE", "lch-lightness-mode" }, { GIMP_LAYER_MODE_LCH_LIGHTNESS, "GIMP_LAYER_MODE_LCH_LIGHTNESS", "lch-lightness" },
{ GIMP_ERASE_MODE, "GIMP_ERASE_MODE", "erase-mode" }, { GIMP_LAYER_MODE_ERASE, "GIMP_LAYER_MODE_ERASE", "erase" },
{ GIMP_REPLACE_MODE, "GIMP_REPLACE_MODE", "replace-mode" }, { GIMP_LAYER_MODE_REPLACE, "GIMP_LAYER_MODE_REPLACE", "replace" },
{ GIMP_ANTI_ERASE_MODE, "GIMP_ANTI_ERASE_MODE", "anti-erase-mode" }, { GIMP_LAYER_MODE_ANTI_ERASE, "GIMP_LAYER_MODE_ANTI_ERASE", "anti-erase" },
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
static const GimpEnumDesc descs[] = static const GimpEnumDesc descs[] =
{ {
{ GIMP_NORMAL_MODE, NC_("layer-mode-effects", "Normal"), NULL }, { GIMP_LAYER_MODE_NORMAL, NC_("layer-mode", "Normal"), NULL },
{ GIMP_DISSOLVE_MODE, NC_("layer-mode-effects", "Dissolve"), NULL }, { GIMP_LAYER_MODE_DISSOLVE, NC_("layer-mode", "Dissolve"), NULL },
{ GIMP_BEHIND_MODE, NC_("layer-mode-effects", "Behind"), NULL }, { GIMP_LAYER_MODE_BEHIND, NC_("layer-mode", "Behind"), NULL },
{ GIMP_MULTIPLY_MODE, NC_("layer-mode-effects", "Multiply"), NULL }, { GIMP_LAYER_MODE_MULTIPLY_BROKEN, NC_("layer-mode", "Multiply"), NULL },
{ GIMP_SCREEN_MODE, NC_("layer-mode-effects", "Screen"), NULL }, { GIMP_LAYER_MODE_SCREEN_BROKEN, NC_("layer-mode", "Screen"), NULL },
{ GIMP_OVERLAY_MODE, NC_("layer-mode-effects", "Old broken Overlay"), NULL }, { GIMP_LAYER_MODE_OVERLAY_BROKEN, NC_("layer-mode", "Old broken Overlay"), NULL },
{ GIMP_DIFFERENCE_MODE, NC_("layer-mode-effects", "Difference"), NULL }, { GIMP_LAYER_MODE_DIFFERENCE_BROKEN, NC_("layer-mode", "Difference"), NULL },
{ GIMP_ADDITION_MODE, NC_("layer-mode-effects", "Addition"), NULL }, { GIMP_LAYER_MODE_ADDITION_BROKEN, NC_("layer-mode", "Addition"), NULL },
{ GIMP_SUBTRACT_MODE, NC_("layer-mode-effects", "Subtract"), NULL }, { GIMP_LAYER_MODE_SUBTRACT_BROKEN, NC_("layer-mode", "Subtract"), NULL },
{ GIMP_DARKEN_ONLY_MODE, NC_("layer-mode-effects", "Darken only"), NULL }, { GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN, NC_("layer-mode", "Darken only"), NULL },
{ GIMP_LIGHTEN_ONLY_MODE, NC_("layer-mode-effects", "Lighten only"), NULL }, { GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN, NC_("layer-mode", "Lighten only"), NULL },
{ GIMP_HUE_MODE, NC_("layer-mode-effects", "Hue (HSV)"), NULL }, { GIMP_LAYER_MODE_HSV_HUE_BROKEN, NC_("layer-mode", "Hue (HSV)"), NULL },
{ GIMP_SATURATION_MODE, NC_("layer-mode-effects", "Saturation (HSV)"), NULL }, { GIMP_LAYER_MODE_HSV_SATURATION_BROKEN, NC_("layer-mode", "Saturation (HSV)"), NULL },
{ GIMP_COLOR_MODE, NC_("layer-mode-effects", "Color (HSV)"), NULL }, { GIMP_LAYER_MODE_HSV_COLOR_BROKEN, NC_("layer-mode", "Color (HSV)"), NULL },
{ GIMP_VALUE_MODE, NC_("layer-mode-effects", "Value (HSV)"), NULL }, { GIMP_LAYER_MODE_HSV_VALUE_BROKEN, NC_("layer-mode", "Value (HSV)"), NULL },
{ GIMP_DIVIDE_MODE, NC_("layer-mode-effects", "Divide"), NULL }, { GIMP_LAYER_MODE_DIVIDE_BROKEN, NC_("layer-mode", "Divide"), NULL },
{ GIMP_DODGE_MODE, NC_("layer-mode-effects", "Dodge"), NULL }, { GIMP_LAYER_MODE_DODGE_BROKEN, NC_("layer-mode", "Dodge"), NULL },
{ GIMP_BURN_MODE, NC_("layer-mode-effects", "Burn"), NULL }, { GIMP_LAYER_MODE_BURN_BROKEN, NC_("layer-mode", "Burn"), NULL },
{ GIMP_HARDLIGHT_MODE, NC_("layer-mode-effects", "Hard light"), NULL }, { GIMP_LAYER_MODE_HARDLIGHT_BROKEN, NC_("layer-mode", "Hard light"), NULL },
{ GIMP_SOFTLIGHT_MODE, NC_("layer-mode-effects", "Soft light"), NULL }, { GIMP_LAYER_MODE_SOFTLIGHT_BROKEN, NC_("layer-mode", "Soft light"), NULL },
{ GIMP_GRAIN_EXTRACT_MODE, NC_("layer-mode-effects", "Grain extract"), NULL }, { GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN, NC_("layer-mode", "Grain extract"), NULL },
{ GIMP_GRAIN_MERGE_MODE, NC_("layer-mode-effects", "Grain merge"), NULL }, { GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN, NC_("layer-mode", "Grain merge"), NULL },
{ GIMP_COLOR_ERASE_MODE, NC_("layer-mode-effects", "Color erase"), NULL }, { GIMP_LAYER_MODE_COLOR_ERASE, NC_("layer-mode", "Color erase"), NULL },
{ GIMP_NEW_OVERLAY_MODE, NC_("layer-mode-effects", "Overlay"), NULL }, { GIMP_LAYER_MODE_OVERLAY, NC_("layer-mode", "Overlay"), NULL },
{ GIMP_LCH_HUE_MODE, NC_("layer-mode-effects", "Hue (LCH)"), NULL }, { GIMP_LAYER_MODE_LCH_HUE, NC_("layer-mode", "Hue (LCH)"), NULL },
{ GIMP_LCH_CHROMA_MODE, NC_("layer-mode-effects", "Chroma (LCH)"), NULL }, { GIMP_LAYER_MODE_LCH_CHROMA, NC_("layer-mode", "Chroma (LCH)"), NULL },
{ GIMP_LCH_COLOR_MODE, NC_("layer-mode-effects", "Color (LCH)"), NULL }, { GIMP_LAYER_MODE_LCH_COLOR, NC_("layer-mode", "Color (LCH)"), NULL },
{ GIMP_LCH_LIGHTNESS_MODE, NC_("layer-mode-effects", "Lightness (LCH)"), NULL }, { GIMP_LAYER_MODE_LCH_LIGHTNESS, NC_("layer-mode", "Lightness (LCH)"), NULL },
{ GIMP_ERASE_MODE, NC_("layer-mode-effects", "Erase"), NULL }, { GIMP_LAYER_MODE_ERASE, NC_("layer-mode", "Erase"), NULL },
{ GIMP_REPLACE_MODE, NC_("layer-mode-effects", "Replace"), NULL }, { GIMP_LAYER_MODE_REPLACE, NC_("layer-mode", "Replace"), NULL },
{ GIMP_ANTI_ERASE_MODE, NC_("layer-mode-effects", "Anti erase"), NULL }, { GIMP_LAYER_MODE_ANTI_ERASE, NC_("layer-mode", "Anti erase"), NULL },
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
@ -363,8 +363,8 @@ gimp_layer_mode_effects_get_type (void)
if (G_UNLIKELY (! type)) if (G_UNLIKELY (! type))
{ {
type = g_enum_register_static ("GimpLayerModeEffects", values); type = g_enum_register_static ("GimpLayerMode", values);
gimp_type_set_translation_context (type, "layer-mode-effects"); gimp_type_set_translation_context (type, "layer-mode");
gimp_enum_set_value_descriptions (type, descs); gimp_enum_set_value_descriptions (type, descs);
} }

View File

@ -148,46 +148,46 @@ typedef enum
} GimpHistogramChannel; } 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 typedef enum
{ {
GIMP_NORMAL_MODE, /*< desc="Normal" >*/ GIMP_LAYER_MODE_NORMAL, /*< desc="Normal" >*/
GIMP_DISSOLVE_MODE, /*< desc="Dissolve" >*/ GIMP_LAYER_MODE_DISSOLVE, /*< desc="Dissolve" >*/
GIMP_BEHIND_MODE, /*< desc="Behind" >*/ GIMP_LAYER_MODE_BEHIND, /*< desc="Behind" >*/
GIMP_MULTIPLY_MODE, /*< desc="Multiply" >*/ GIMP_LAYER_MODE_MULTIPLY_BROKEN, /*< desc="Multiply" >*/
GIMP_SCREEN_MODE, /*< desc="Screen" >*/ GIMP_LAYER_MODE_SCREEN_BROKEN, /*< desc="Screen" >*/
GIMP_OVERLAY_MODE, /*< desc="Old broken Overlay" >*/ GIMP_LAYER_MODE_OVERLAY_BROKEN, /*< desc="Old broken Overlay" >*/
GIMP_DIFFERENCE_MODE, /*< desc="Difference" >*/ GIMP_LAYER_MODE_DIFFERENCE_BROKEN, /*< desc="Difference" >*/
GIMP_ADDITION_MODE, /*< desc="Addition" >*/ GIMP_LAYER_MODE_ADDITION_BROKEN, /*< desc="Addition" >*/
GIMP_SUBTRACT_MODE, /*< desc="Subtract" >*/ GIMP_LAYER_MODE_SUBTRACT_BROKEN, /*< desc="Subtract" >*/
GIMP_DARKEN_ONLY_MODE, /*< desc="Darken only" >*/ GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN, /*< desc="Darken only" >*/
GIMP_LIGHTEN_ONLY_MODE, /*< desc="Lighten only" >*/ GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN, /*< desc="Lighten only" >*/
GIMP_HUE_MODE, /*< desc="Hue (HSV)" >*/ GIMP_LAYER_MODE_HSV_HUE_BROKEN, /*< desc="Hue (HSV)" >*/
GIMP_SATURATION_MODE, /*< desc="Saturation (HSV)" >*/ GIMP_LAYER_MODE_HSV_SATURATION_BROKEN, /*< desc="Saturation (HSV)" >*/
GIMP_COLOR_MODE, /*< desc="Color (HSV)" >*/ GIMP_LAYER_MODE_HSV_COLOR_BROKEN, /*< desc="Color (HSV)" >*/
GIMP_VALUE_MODE, /*< desc="Value (HSV)" >*/ GIMP_LAYER_MODE_HSV_VALUE_BROKEN, /*< desc="Value (HSV)" >*/
GIMP_DIVIDE_MODE, /*< desc="Divide" >*/ GIMP_LAYER_MODE_DIVIDE_BROKEN, /*< desc="Divide" >*/
GIMP_DODGE_MODE, /*< desc="Dodge" >*/ GIMP_LAYER_MODE_DODGE_BROKEN, /*< desc="Dodge" >*/
GIMP_BURN_MODE, /*< desc="Burn" >*/ GIMP_LAYER_MODE_BURN_BROKEN, /*< desc="Burn" >*/
GIMP_HARDLIGHT_MODE, /*< desc="Hard light" >*/ GIMP_LAYER_MODE_HARDLIGHT_BROKEN, /*< desc="Hard light" >*/
GIMP_SOFTLIGHT_MODE, /*< desc="Soft light" >*/ GIMP_LAYER_MODE_SOFTLIGHT_BROKEN, /*< desc="Soft light" >*/
GIMP_GRAIN_EXTRACT_MODE, /*< desc="Grain extract" >*/ GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN, /*< desc="Grain extract" >*/
GIMP_GRAIN_MERGE_MODE, /*< desc="Grain merge" >*/ GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN, /*< desc="Grain merge" >*/
GIMP_COLOR_ERASE_MODE, /*< desc="Color erase" >*/ GIMP_LAYER_MODE_COLOR_ERASE, /*< desc="Color erase" >*/
GIMP_NEW_OVERLAY_MODE, /*< desc="Overlay" >*/ GIMP_LAYER_MODE_OVERLAY, /*< desc="Overlay" >*/
GIMP_LCH_HUE_MODE, /*< desc="Hue (LCH)" >*/ GIMP_LAYER_MODE_LCH_HUE, /*< desc="Hue (LCH)" >*/
GIMP_LCH_CHROMA_MODE, /*< desc="Chroma (LCH)" >*/ GIMP_LAYER_MODE_LCH_CHROMA, /*< desc="Chroma (LCH)" >*/
GIMP_LCH_COLOR_MODE, /*< desc="Color (LCH)" >*/ GIMP_LAYER_MODE_LCH_COLOR, /*< desc="Color (LCH)" >*/
GIMP_LCH_LIGHTNESS_MODE, /*< desc="Lightness (LCH)" >*/ GIMP_LAYER_MODE_LCH_LIGHTNESS, /*< desc="Lightness (LCH)" >*/
/* internal modes, not available to the PDB */ /* internal modes, not available to the PDB */
GIMP_ERASE_MODE = 1000, /*< pdb-skip, desc="Erase" >*/ GIMP_LAYER_MODE_ERASE = 1000, /*< pdb-skip, desc="Erase" >*/
GIMP_REPLACE_MODE = 1001, /*< pdb-skip, desc="Replace" >*/ GIMP_LAYER_MODE_REPLACE = 1001, /*< pdb-skip, desc="Replace" >*/
GIMP_ANTI_ERASE_MODE = 1002 /*< pdb-skip, desc="Anti erase" >*/ GIMP_LAYER_MODE_ANTI_ERASE = 1002 /*< pdb-skip, desc="Anti erase" >*/
} GimpLayerModeEffects; } GimpLayerMode;
#define GIMP_TYPE_MATTING_ENGINE (gimp_matting_engine_get_type ()) #define GIMP_TYPE_MATTING_ENGINE (gimp_matting_engine_get_type ())

View File

@ -419,7 +419,8 @@ gimp_edit_paste (GimpImage *image,
layer = gimp_layer_new_from_buffer (GIMP_BUFFER (paste), image, layer = gimp_layer_new_from_buffer (GIMP_BUFFER (paste), image,
floating_format, floating_format,
_("Pasted Layer"), _("Pasted Layer"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
} }
if (! layer) if (! layer)

View File

@ -868,7 +868,7 @@ gimp_create_image_from_buffer (Gimp *gimp,
layer = gimp_layer_new_from_gegl_buffer (buffer, image, format, layer = gimp_layer_new_from_gegl_buffer (buffer, image, format,
image_name, image_name,
GIMP_OPACITY_OPAQUE, GIMP_OPACITY_OPAQUE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
NULL /* same image */); NULL /* same image */);
gimp_image_add_layer (image, layer, NULL, -1, FALSE); gimp_image_add_layer (image, layer, NULL, -1, FALSE);

View File

@ -163,7 +163,7 @@ static void gimp_channel_apply_buffer (GimpDrawable *drawable,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
GeglBuffer *base_buffer, GeglBuffer *base_buffer,
gint base_x, gint base_x,
gint base_y); gint base_y);
@ -1007,16 +1007,16 @@ gimp_channel_get_active_mask (GimpDrawable *drawable)
} }
static void static void
gimp_channel_apply_buffer (GimpDrawable *drawable, gimp_channel_apply_buffer (GimpDrawable *drawable,
GeglBuffer *buffer, GeglBuffer *buffer,
const GeglRectangle *buffer_region, const GeglRectangle *buffer_region,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
GeglBuffer *base_buffer, GeglBuffer *base_buffer,
gint base_x, gint base_x,
gint base_y) gint base_y)
{ {
gimp_drawable_invalidate_boundary (drawable); gimp_drawable_invalidate_boundary (drawable);

View File

@ -153,7 +153,7 @@ static void gimp_context_real_set_opacity (GimpContext *context,
/* paint mode */ /* paint mode */
static void gimp_context_real_set_paint_mode (GimpContext *context, static void gimp_context_real_set_paint_mode (GimpContext *context,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
/* brush */ /* brush */
static void gimp_context_brush_dirty (GimpBrush *brush, static void gimp_context_brush_dirty (GimpBrush *brush,
@ -471,7 +471,7 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL, NULL, NULL,
gimp_marshal_VOID__ENUM, gimp_marshal_VOID__ENUM,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
GIMP_TYPE_LAYER_MODE_EFFECTS); GIMP_TYPE_LAYER_MODE);
gimp_context_signals[BRUSH_CHANGED] = gimp_context_signals[BRUSH_CHANGED] =
g_signal_new ("brush-changed", g_signal_new ("brush-changed",
@ -695,8 +695,8 @@ gimp_context_class_init (GimpContextClass *klass)
gimp_context_prop_names[GIMP_CONTEXT_PROP_PAINT_MODE], gimp_context_prop_names[GIMP_CONTEXT_PROP_PAINT_MODE],
_("Paint Mode"), _("Paint Mode"),
_("Paint Mode"), _("Paint Mode"),
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_STATIC_STRINGS); GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_BRUSH, GIMP_CONFIG_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_BRUSH,
@ -1339,16 +1339,18 @@ gimp_context_deserialize (GimpConfig *config,
gint nest_level, gint nest_level,
gpointer data) gpointer data)
{ {
GimpContext *context = GIMP_CONTEXT (config); GimpContext *context = GIMP_CONTEXT (config);
GimpLayerModeEffects old_paint_mode = context->paint_mode; GimpLayerMode old_paint_mode = context->paint_mode;
gboolean success; gboolean success;
success = gimp_config_deserialize_properties (config, scanner, nest_level); success = gimp_config_deserialize_properties (config, scanner, nest_level);
if (context->paint_mode != old_paint_mode) if (context->paint_mode != old_paint_mode)
{ {
if (context->paint_mode == GIMP_OVERLAY_MODE) if (context->paint_mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
g_object_set (context, "paint-mode", GIMP_SOFTLIGHT_MODE, NULL); g_object_set (context,
"paint-mode", GIMP_LAYER_MODE_SOFTLIGHT_BROKEN,
NULL);
} }
return success; return success;
@ -2584,17 +2586,17 @@ gimp_context_real_set_opacity (GimpContext *context,
/*****************************************************************************/ /*****************************************************************************/
/* paint mode **************************************************************/ /* paint mode **************************************************************/
GimpLayerModeEffects GimpLayerMode
gimp_context_get_paint_mode (GimpContext *context) gimp_context_get_paint_mode (GimpContext *context)
{ {
g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_NORMAL_MODE); g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_LAYER_MODE_NORMAL);
return context->paint_mode; return context->paint_mode;
} }
void void
gimp_context_set_paint_mode (GimpContext *context, gimp_context_set_paint_mode (GimpContext *context,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (GIMP_IS_CONTEXT (context));
context_find_defined (context, GIMP_CONTEXT_PROP_PAINT_MODE); context_find_defined (context, GIMP_CONTEXT_PROP_PAINT_MODE);
@ -2613,8 +2615,8 @@ gimp_context_paint_mode_changed (GimpContext *context)
} }
static void static void
gimp_context_real_set_paint_mode (GimpContext *context, gimp_context_real_set_paint_mode (GimpContext *context,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
if (context->paint_mode == paint_mode) if (context->paint_mode == paint_mode)
return; return;

View File

@ -68,7 +68,7 @@ struct _GimpContext
GimpRGB background; GimpRGB background;
gdouble opacity; gdouble opacity;
GimpLayerModeEffects paint_mode; GimpLayerMode paint_mode;
GimpBrush *brush; GimpBrush *brush;
gchar *brush_name; gchar *brush_name;
@ -125,7 +125,7 @@ struct _GimpContextClass
void (* opacity_changed) (GimpContext *context, void (* opacity_changed) (GimpContext *context,
gdouble opacity); gdouble opacity);
void (* paint_mode_changed) (GimpContext *context, void (* paint_mode_changed) (GimpContext *context,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
void (* brush_changed) (GimpContext *context, void (* brush_changed) (GimpContext *context,
GimpBrush *brush); GimpBrush *brush);
void (* dynamics_changed) (GimpContext *context, void (* dynamics_changed) (GimpContext *context,
@ -271,10 +271,9 @@ void gimp_context_opacity_changed (GimpContext *context);
/* paint mode */ /* paint mode */
GimpLayerModeEffects GimpLayerMode gimp_context_get_paint_mode (GimpContext *context);
gimp_context_get_paint_mode (GimpContext *context);
void gimp_context_set_paint_mode (GimpContext *context, void gimp_context_set_paint_mode (GimpContext *context,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
void gimp_context_paint_mode_changed (GimpContext *context); void gimp_context_paint_mode_changed (GimpContext *context);

View File

@ -67,24 +67,24 @@ typedef struct
/* public functions */ /* public functions */
void void
gimp_drawable_blend (GimpDrawable *drawable, gimp_drawable_blend (GimpDrawable *drawable,
GimpContext *context, GimpContext *context,
GimpGradient *gradient, GimpGradient *gradient,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpGradientType gradient_type, GimpGradientType gradient_type,
gdouble opacity, gdouble opacity,
gdouble offset, gdouble offset,
GimpRepeatMode repeat, GimpRepeatMode repeat,
gboolean reverse, gboolean reverse,
gboolean supersample, gboolean supersample,
gint max_depth, gint max_depth,
gdouble threshold, gdouble threshold,
gboolean dither, gboolean dither,
gdouble startx, gdouble startx,
gdouble starty, gdouble starty,
gdouble endx, gdouble endx,
gdouble endy, gdouble endy,
GimpProgress *progress) GimpProgress *progress)
{ {
GimpImage *image; GimpImage *image;
GeglBuffer *buffer; GeglBuffer *buffer;

View File

@ -19,24 +19,24 @@
#define __GIMP_DRAWABLE_BLEND_H__ #define __GIMP_DRAWABLE_BLEND_H__
void gimp_drawable_blend (GimpDrawable *drawable, void gimp_drawable_blend (GimpDrawable *drawable,
GimpContext *context, GimpContext *context,
GimpGradient *gradient, GimpGradient *gradient,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpGradientType gradient_type, GimpGradientType gradient_type,
gdouble opacity, gdouble opacity,
gdouble offset, gdouble offset,
GimpRepeatMode repeat, GimpRepeatMode repeat,
gboolean reverse, gboolean reverse,
gboolean supersample, gboolean supersample,
gint max_depth, gint max_depth,
gdouble threshold, gdouble threshold,
gboolean dither, gboolean dither,
gdouble startx, gdouble startx,
gdouble starty, gdouble starty,
gdouble endx, gdouble endx,
gdouble endy, gdouble endy,
GimpProgress *progress); GimpProgress *progress);
GeglBuffer * GeglBuffer *
gimp_drawable_blend_shapeburst_distmap (GimpDrawable *drawable, gimp_drawable_blend_shapeburst_distmap (GimpDrawable *drawable,

View File

@ -40,16 +40,16 @@
void void
gimp_drawable_real_apply_buffer (GimpDrawable *drawable, gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
GeglBuffer *buffer, GeglBuffer *buffer,
const GeglRectangle *buffer_region, const GeglRectangle *buffer_region,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
GeglBuffer *base_buffer, GeglBuffer *base_buffer,
gint base_x, gint base_x,
gint base_y) gint base_y)
{ {
GimpItem *item = GIMP_ITEM (drawable); GimpItem *item = GIMP_ITEM (drawable);
GimpImage *image = gimp_item_get_image (item); GimpImage *image = gimp_item_get_image (item);

View File

@ -21,26 +21,26 @@
/* virtual functions of GimpDrawable, don't call directly */ /* virtual functions of GimpDrawable, don't call directly */
void gimp_drawable_real_apply_buffer (GimpDrawable *drawable, void gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
GeglBuffer *buffer, GeglBuffer *buffer,
const GeglRectangle *buffer_region, const GeglRectangle *buffer_region,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
GeglBuffer *base_buffer, GeglBuffer *base_buffer,
gint base_x, gint base_x,
gint base_y); gint base_y);
void gimp_drawable_real_replace_buffer (GimpDrawable *drawable, void gimp_drawable_real_replace_buffer (GimpDrawable *drawable,
GeglBuffer *buffer, GeglBuffer *buffer,
const GeglRectangle *buffer_region, const GeglRectangle *buffer_region,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
gdouble opacity, gdouble opacity,
GeglBuffer *mask, GeglBuffer *mask,
const GeglRectangle *mask_region, const GeglRectangle *mask_region,
gint x, gint x,
gint y); gint y);
#endif /* __GIMP_DRAWABLE_COMBINE_H__ */ #endif /* __GIMP_DRAWABLE_COMBINE_H__ */

View File

@ -101,7 +101,8 @@ gimp_drawable_merge_shadow_buffer (GimpDrawable *drawable,
gimp_drawable_apply_buffer (drawable, buffer, gimp_drawable_apply_buffer (drawable, buffer,
GEGL_RECTANGLE (x, y, width, height), GEGL_RECTANGLE (x, y, width, height),
push_undo, undo_desc, push_undo, undo_desc,
GIMP_OPACITY_OPAQUE, GIMP_REPLACE_MODE, GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_REPLACE,
NULL, x, y); NULL, x, y);
g_object_unref (buffer); g_object_unref (buffer);

View File

@ -1002,7 +1002,8 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
gimp_layer_new_from_gegl_buffer (buffer, image, gimp_layer_new_from_gegl_buffer (buffer, image,
gimp_drawable_get_format_with_alpha (drawable), gimp_drawable_get_format_with_alpha (drawable),
_("Transformation"), _("Transformation"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE, GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL,
buffer_profile); buffer_profile);
gimp_item_set_offset (GIMP_ITEM (layer), offset_x, offset_y); gimp_item_set_offset (GIMP_ITEM (layer), offset_x, offset_y);

View File

@ -1091,16 +1091,16 @@ gimp_drawable_convert_type (GimpDrawable *drawable,
} }
void void
gimp_drawable_apply_buffer (GimpDrawable *drawable, gimp_drawable_apply_buffer (GimpDrawable *drawable,
GeglBuffer *buffer, GeglBuffer *buffer,
const GeglRectangle *buffer_region, const GeglRectangle *buffer_region,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
GeglBuffer *base_buffer, GeglBuffer *base_buffer,
gint base_x, gint base_x,
gint base_y) gint base_y)
{ {
g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));

View File

@ -75,7 +75,7 @@ struct _GimpDrawableClass
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
GeglBuffer *base_buffer, GeglBuffer *base_buffer,
gint base_x, gint base_x,
gint base_y); gint base_y);
@ -155,7 +155,7 @@ void gimp_drawable_apply_buffer (GimpDrawable *drawable,
gboolean push_undo, gboolean push_undo,
const gchar *undo_desc, const gchar *undo_desc,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
GeglBuffer *base_buffer, GeglBuffer *base_buffer,
gint base_x, gint base_x,
gint base_y); gint base_y);

View File

@ -57,29 +57,29 @@ enum
struct _GimpDrawableFilter struct _GimpDrawableFilter
{ {
GimpFilter parent_instance; GimpFilter parent_instance;
GimpDrawable *drawable; GimpDrawable *drawable;
GeglNode *operation; GeglNode *operation;
GimpFilterRegion region; GimpFilterRegion region;
gboolean preview_enabled; gboolean preview_enabled;
GimpAlignmentType preview_alignment; GimpAlignmentType preview_alignment;
gdouble preview_position; gdouble preview_position;
gdouble opacity; gdouble opacity;
GimpLayerModeEffects paint_mode; GimpLayerMode paint_mode;
gboolean color_managed; gboolean color_managed;
gboolean gamma_hack; gboolean gamma_hack;
GeglRectangle filter_area; GeglRectangle filter_area;
GeglNode *translate; GeglNode *translate;
GeglNode *crop; GeglNode *crop;
GeglNode *cast_before; GeglNode *cast_before;
GeglNode *transform_before; GeglNode *transform_before;
GeglNode *transform_after; GeglNode *transform_after;
GeglNode *cast_after; GeglNode *cast_after;
GimpApplicator *applicator; GimpApplicator *applicator;
}; };
@ -148,7 +148,7 @@ gimp_drawable_filter_init (GimpDrawableFilter *drawable_filter)
drawable_filter->preview_alignment = GIMP_ALIGN_LEFT; drawable_filter->preview_alignment = GIMP_ALIGN_LEFT;
drawable_filter->preview_position = 1.0; drawable_filter->preview_position = 1.0;
drawable_filter->opacity = GIMP_OPACITY_OPAQUE; drawable_filter->opacity = GIMP_OPACITY_OPAQUE;
drawable_filter->paint_mode = GIMP_REPLACE_MODE; drawable_filter->paint_mode = GIMP_LAYER_MODE_REPLACE;
} }
static void static void
@ -332,8 +332,8 @@ gimp_drawable_filter_set_opacity (GimpDrawableFilter *filter,
} }
void void
gimp_drawable_filter_set_mode (GimpDrawableFilter *filter, gimp_drawable_filter_set_mode (GimpDrawableFilter *filter,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
g_return_if_fail (GIMP_IS_DRAWABLE_FILTER (filter)); g_return_if_fail (GIMP_IS_DRAWABLE_FILTER (filter));

View File

@ -50,35 +50,35 @@ struct _GimpDrawableFilterClass
GType gimp_drawable_filter_get_type (void) G_GNUC_CONST; GType gimp_drawable_filter_get_type (void) G_GNUC_CONST;
GimpDrawableFilter * GimpDrawableFilter *
gimp_drawable_filter_new (GimpDrawable *drawable, gimp_drawable_filter_new (GimpDrawable *drawable,
const gchar *undo_desc, const gchar *undo_desc,
GeglNode *operation, GeglNode *operation,
const gchar *icon_name); const gchar *icon_name);
void gimp_drawable_filter_set_region (GimpDrawableFilter *filter, void gimp_drawable_filter_set_region (GimpDrawableFilter *filter,
GimpFilterRegion region); GimpFilterRegion region);
void gimp_drawable_filter_set_preview (GimpDrawableFilter *filter, void gimp_drawable_filter_set_preview (GimpDrawableFilter *filter,
gboolean enabled, gboolean enabled,
GimpAlignmentType alignment, GimpAlignmentType alignment,
gdouble split_position); gdouble split_position);
void gimp_drawable_filter_set_opacity (GimpDrawableFilter *filter, void gimp_drawable_filter_set_opacity (GimpDrawableFilter *filter,
gdouble opacity); gdouble opacity);
void gimp_drawable_filter_set_mode (GimpDrawableFilter *filter, void gimp_drawable_filter_set_mode (GimpDrawableFilter *filter,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
void gimp_drawable_filter_set_color_managed void gimp_drawable_filter_set_color_managed
(GimpDrawableFilter *filter, (GimpDrawableFilter *filter,
gboolean managed); gboolean managed);
void gimp_drawable_filter_set_gamma_hack (GimpDrawableFilter *filter, void gimp_drawable_filter_set_gamma_hack (GimpDrawableFilter *filter,
gboolean gamma_hack); gboolean gamma_hack);
void gimp_drawable_filter_apply (GimpDrawableFilter *filter, void gimp_drawable_filter_apply (GimpDrawableFilter *filter,
const GeglRectangle *area); const GeglRectangle *area);
gboolean gimp_drawable_filter_commit (GimpDrawableFilter *filter, gboolean gimp_drawable_filter_commit (GimpDrawableFilter *filter,
GimpProgress *progress, GimpProgress *progress,
gboolean cancellable); gboolean cancellable);
void gimp_drawable_filter_abort (GimpDrawableFilter *filter); void gimp_drawable_filter_abort (GimpDrawableFilter *filter);
#endif /* __GIMP_DRAWABLE_FILTER_H__ */ #endif /* __GIMP_DRAWABLE_FILTER_H__ */

View File

@ -35,16 +35,16 @@ typedef struct _GimpDrawableUndoClass GimpDrawableUndoClass;
struct _GimpDrawableUndo struct _GimpDrawableUndo
{ {
GimpItemUndo parent_instance; GimpItemUndo parent_instance;
GeglBuffer *buffer; GeglBuffer *buffer;
gint x; gint x;
gint y; gint y;
/* stuff for "Fade" */ /* stuff for "Fade" */
GeglBuffer *applied_buffer; GeglBuffer *applied_buffer;
GimpLayerModeEffects paint_mode; GimpLayerMode paint_mode;
gdouble opacity; gdouble opacity;
}; };
struct _GimpDrawableUndoClass struct _GimpDrawableUndoClass

View File

@ -315,7 +315,8 @@ gimp_fill_options_set_by_fill_type (GimpFillOptions *options,
case GIMP_FILL_TRANSPARENT: case GIMP_FILL_TRANSPARENT:
gimp_context_get_background (context, &color); gimp_context_get_background (context, &color);
gimp_context_set_paint_mode (GIMP_CONTEXT (options), GIMP_ERASE_MODE); gimp_context_set_paint_mode (GIMP_CONTEXT (options),
GIMP_LAYER_MODE_ERASE);
undo_desc = C_("undo-type", "Fill with Transparency"); undo_desc = C_("undo-type", "Fill with Transparency");
break; break;

View File

@ -528,7 +528,8 @@ gimp_image_merge_layers (GimpImage *image,
merge_layer = gimp_layer_new (image, (x2 - x1), (y2 - y1), merge_layer = gimp_layer_new (image, (x2 - x1), (y2 - y1),
gimp_image_get_layer_format (image, FALSE), gimp_image_get_layer_format (image, FALSE),
gimp_object_get_name (layer), gimp_object_get_name (layer),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
if (! merge_layer) if (! merge_layer)
{ {
g_warning ("%s: could not allocate merge layer.", G_STRFUNC); g_warning ("%s: could not allocate merge layer.", G_STRFUNC);
@ -560,7 +561,8 @@ gimp_image_merge_layers (GimpImage *image,
gimp_layer_new (image, (x2 - x1), (y2 - y1), gimp_layer_new (image, (x2 - x1), (y2 - y1),
gimp_drawable_get_format_with_alpha (GIMP_DRAWABLE (layer)), gimp_drawable_get_format_with_alpha (GIMP_DRAWABLE (layer)),
"merged layer", "merged layer",
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
if (!merge_layer) if (!merge_layer)
{ {
@ -596,22 +598,22 @@ gimp_image_merge_layers (GimpImage *image,
for (layers = reverse_list; layers; layers = g_slist_next (layers)) for (layers = reverse_list; layers; layers = g_slist_next (layers))
{ {
GeglBuffer *merge_buffer; GeglBuffer *merge_buffer;
GeglBuffer *layer_buffer; GeglBuffer *layer_buffer;
GimpApplicator *applicator; GimpApplicator *applicator;
GimpLayerModeEffects mode; GimpLayerMode mode;
layer = layers->data; layer = layers->data;
gimp_item_get_offset (GIMP_ITEM (layer), &off_x, &off_y); gimp_item_get_offset (GIMP_ITEM (layer), &off_x, &off_y);
/* DISSOLVE_MODE is special since it is the only mode that does not /* MODE_DISSOLVE is special since it is the only mode that does not
* work on the projection with the lower layer, but only locally on * work on the projection with the lower layer, but only locally on
* the layers alpha channel. * the layers alpha channel.
*/ */
mode = gimp_layer_get_mode (layer); mode = gimp_layer_get_mode (layer);
if (layer == bottom_layer && mode != GIMP_DISSOLVE_MODE) if (layer == bottom_layer && mode != GIMP_LAYER_MODE_DISSOLVE)
mode = GIMP_NORMAL_MODE; mode = GIMP_LAYER_MODE_NORMAL;
merge_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (merge_layer)); merge_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (merge_layer));
layer_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer)); layer_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));

View File

@ -148,7 +148,8 @@ gimp_image_new_from_template (Gimp *gimp,
layer = gimp_layer_new (image, width, height, layer = gimp_layer_new (image, width, height,
gimp_image_get_layer_format (image, has_alpha), gimp_image_get_layer_format (image, has_alpha),
_("Background"), _("Background"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
gimp_drawable_fill (GIMP_DRAWABLE (layer), gimp_drawable_fill (GIMP_DRAWABLE (layer),
context, gimp_template_get_fill_type (template)); context, gimp_template_get_fill_type (template));
@ -223,7 +224,7 @@ gimp_image_new_from_drawable (Gimp *gimp,
gimp_item_translate (GIMP_ITEM (new_layer), -off_x, -off_y, FALSE); gimp_item_translate (GIMP_ITEM (new_layer), -off_x, -off_y, FALSE);
gimp_item_set_visible (GIMP_ITEM (new_layer), TRUE, FALSE); gimp_item_set_visible (GIMP_ITEM (new_layer), TRUE, FALSE);
gimp_item_set_linked (GIMP_ITEM (new_layer), FALSE, FALSE); gimp_item_set_linked (GIMP_ITEM (new_layer), FALSE, FALSE);
gimp_layer_set_mode (new_layer, GIMP_NORMAL_MODE, FALSE); gimp_layer_set_mode (new_layer, GIMP_LAYER_MODE_NORMAL, FALSE);
gimp_layer_set_opacity (new_layer, GIMP_OPACITY_OPAQUE, FALSE); gimp_layer_set_opacity (new_layer, GIMP_OPACITY_OPAQUE, FALSE);
if (gimp_layer_can_lock_alpha (new_layer)) if (gimp_layer_can_lock_alpha (new_layer))
gimp_layer_set_lock_alpha (new_layer, FALSE, FALSE); gimp_layer_set_lock_alpha (new_layer, FALSE, FALSE);
@ -324,7 +325,8 @@ gimp_image_new_from_buffer (Gimp *gimp,
gimp_image_get_layer_format (image, gimp_image_get_layer_format (image,
has_alpha), has_alpha),
_("Pasted Layer"), _("Pasted Layer"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
gimp_image_add_layer (image, layer, NULL, 0, TRUE); gimp_image_add_layer (image, layer, NULL, 0, TRUE);
@ -382,7 +384,8 @@ gimp_image_new_from_pixbuf (Gimp *gimp,
gimp_image_get_layer_format (new_image, gimp_image_get_layer_format (new_image,
has_alpha), has_alpha),
layer_name, layer_name,
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
gimp_image_add_layer (new_image, layer, NULL, 0, TRUE); gimp_image_add_layer (new_image, layer, NULL, 0, TRUE);

View File

@ -2394,19 +2394,19 @@ gimp_image_get_xcf_version (GimpImage *image,
switch (gimp_layer_get_mode (layer)) switch (gimp_layer_get_mode (layer))
{ {
/* new layer modes not supported by gimp-1.2 */ /* new layer modes not supported by gimp-1.2 */
case GIMP_SOFTLIGHT_MODE: case GIMP_LAYER_MODE_SOFTLIGHT_BROKEN:
case GIMP_GRAIN_EXTRACT_MODE: case GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN:
case GIMP_GRAIN_MERGE_MODE: case GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN:
case GIMP_COLOR_ERASE_MODE: case GIMP_LAYER_MODE_COLOR_ERASE:
version = MAX (2, version); version = MAX (2, version);
break; break;
/* new layer modes not supported by gimp-2.8 */ /* new layer modes not supported by gimp-2.8 */
case GIMP_NEW_OVERLAY_MODE: case GIMP_LAYER_MODE_OVERLAY:
case GIMP_LCH_HUE_MODE: case GIMP_LAYER_MODE_LCH_HUE:
case GIMP_LCH_CHROMA_MODE: case GIMP_LAYER_MODE_LCH_CHROMA:
case GIMP_LCH_COLOR_MODE: case GIMP_LAYER_MODE_LCH_COLOR:
case GIMP_LCH_LIGHTNESS_MODE: case GIMP_LAYER_MODE_LCH_LIGHTNESS:
version = MAX (9, version); version = MAX (9, version);
break; break;

View File

@ -47,13 +47,13 @@ static void gimp_layer_new_convert_buffer (GimpLayer *layer,
/* public functions */ /* public functions */
GimpLayer * GimpLayer *
gimp_layer_new (GimpImage *image, gimp_layer_new (GimpImage *image,
gint width, gint width,
gint height, gint height,
const Babl *format, const Babl *format,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode) GimpLayerMode mode)
{ {
GimpLayer *layer; GimpLayer *layer;
@ -91,12 +91,12 @@ gimp_layer_new (GimpImage *image,
* Return value: The new layer. * Return value: The new layer.
**/ **/
GimpLayer * GimpLayer *
gimp_layer_new_from_buffer (GimpBuffer *buffer, gimp_layer_new_from_buffer (GimpBuffer *buffer,
GimpImage *dest_image, GimpImage *dest_image,
const Babl *format, const Babl *format,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode) GimpLayerMode mode)
{ {
g_return_val_if_fail (GIMP_IS_BUFFER (buffer), NULL); g_return_val_if_fail (GIMP_IS_BUFFER (buffer), NULL);
g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL);
@ -124,13 +124,13 @@ gimp_layer_new_from_buffer (GimpBuffer *buffer,
* Return value: The new layer. * Return value: The new layer.
**/ **/
GimpLayer * GimpLayer *
gimp_layer_new_from_gegl_buffer (GeglBuffer *buffer, gimp_layer_new_from_gegl_buffer (GeglBuffer *buffer,
GimpImage *dest_image, GimpImage *dest_image,
const Babl *format, const Babl *format,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
GimpColorProfile *buffer_profile) GimpColorProfile *buffer_profile)
{ {
GimpLayer *layer; GimpLayer *layer;
@ -170,12 +170,12 @@ gimp_layer_new_from_gegl_buffer (GeglBuffer *buffer,
* Return value: The new layer. * Return value: The new layer.
**/ **/
GimpLayer * GimpLayer *
gimp_layer_new_from_pixbuf (GdkPixbuf *pixbuf, gimp_layer_new_from_pixbuf (GdkPixbuf *pixbuf,
GimpImage *dest_image, GimpImage *dest_image,
const Babl *format, const Babl *format,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode) GimpLayerMode mode)
{ {
GimpLayer *layer; GimpLayer *layer;
GeglBuffer *buffer; GeglBuffer *buffer;

View File

@ -19,33 +19,33 @@
#define __GIMP_LAYER_NEW_H__ #define __GIMP_LAYER_NEW_H__
GimpLayer * gimp_layer_new (GimpImage *image, GimpLayer * gimp_layer_new (GimpImage *image,
gint width, gint width,
gint height, gint height,
const Babl *format, const Babl *format,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode); GimpLayerMode mode);
GimpLayer * gimp_layer_new_from_buffer (GimpBuffer *buffer, GimpLayer * gimp_layer_new_from_buffer (GimpBuffer *buffer,
GimpImage *dest_image, GimpImage *dest_image,
const Babl *format, const Babl *format,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode); GimpLayerMode mode);
GimpLayer * gimp_layer_new_from_gegl_buffer (GeglBuffer *buffer, GimpLayer * gimp_layer_new_from_gegl_buffer (GeglBuffer *buffer,
GimpImage *dest_image, GimpImage *dest_image,
const Babl *format, const Babl *format,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
GimpColorProfile *buffer_profile); GimpColorProfile *buffer_profile);
GimpLayer * gimp_layer_new_from_pixbuf (GdkPixbuf *pixbuf, GimpLayer * gimp_layer_new_from_pixbuf (GdkPixbuf *pixbuf,
GimpImage *dest_image, GimpImage *dest_image,
const Babl *format, const Babl *format,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode); GimpLayerMode mode);
#endif /* __GIMP_LAYER_NEW_H__ */ #endif /* __GIMP_LAYER_NEW_H__ */

View File

@ -363,8 +363,8 @@ gimp_layer_class_init (GimpLayerClass *klass)
g_object_class_install_property (object_class, PROP_MODE, g_object_class_install_property (object_class, PROP_MODE,
g_param_spec_enum ("mode", NULL, NULL, g_param_spec_enum ("mode", NULL, NULL,
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READABLE)); GIMP_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_LOCK_ALPHA, g_object_class_install_property (object_class, PROP_LOCK_ALPHA,
@ -390,7 +390,7 @@ static void
gimp_layer_init (GimpLayer *layer) gimp_layer_init (GimpLayer *layer)
{ {
layer->opacity = GIMP_OPACITY_OPAQUE; layer->opacity = GIMP_OPACITY_OPAQUE;
layer->mode = GIMP_NORMAL_MODE; layer->mode = GIMP_LAYER_MODE_NORMAL;
layer->lock_alpha = FALSE; layer->lock_alpha = FALSE;
layer->mask = NULL; layer->mask = NULL;
@ -508,23 +508,23 @@ gimp_layer_finalize (GObject *object)
static void static void
gimp_layer_update_mode_node (GimpLayer *layer) gimp_layer_update_mode_node (GimpLayer *layer)
{ {
GeglNode *mode_node; GeglNode *mode_node;
GimpLayerModeEffects visible_mode; GimpLayerMode visible_mode;
gboolean linear; gboolean linear;
mode_node = gimp_drawable_get_mode_node (GIMP_DRAWABLE (layer)); mode_node = gimp_drawable_get_mode_node (GIMP_DRAWABLE (layer));
if (layer->mask && layer->show_mask) if (layer->mask && layer->show_mask)
{ {
visible_mode = GIMP_NORMAL_MODE; visible_mode = GIMP_LAYER_MODE_NORMAL;
linear = TRUE; linear = TRUE;
} }
else else
{ {
if (layer->mode != GIMP_DISSOLVE_MODE && if (layer->mode != GIMP_LAYER_MODE_DISSOLVE &&
gimp_filter_get_is_last_node (GIMP_FILTER (layer))) gimp_filter_get_is_last_node (GIMP_FILTER (layer)))
{ {
visible_mode = GIMP_NORMAL_MODE; visible_mode = GIMP_LAYER_MODE_NORMAL;
} }
else else
{ {
@ -2064,9 +2064,9 @@ gimp_layer_get_opacity (GimpLayer *layer)
} }
void void
gimp_layer_set_mode (GimpLayer *layer, gimp_layer_set_mode (GimpLayer *layer,
GimpLayerModeEffects mode, GimpLayerMode mode,
gboolean push_undo) gboolean push_undo)
{ {
g_return_if_fail (GIMP_IS_LAYER (layer)); g_return_if_fail (GIMP_IS_LAYER (layer));
@ -2094,10 +2094,10 @@ gimp_layer_set_mode (GimpLayer *layer,
} }
} }
GimpLayerModeEffects GimpLayerMode
gimp_layer_get_mode (GimpLayer *layer) gimp_layer_get_mode (GimpLayer *layer)
{ {
g_return_val_if_fail (GIMP_IS_LAYER (layer), GIMP_NORMAL_MODE); g_return_val_if_fail (GIMP_IS_LAYER (layer), GIMP_LAYER_MODE_NORMAL);
return layer->mode; return layer->mode;
} }

View File

@ -34,19 +34,19 @@ typedef struct _GimpLayerClass GimpLayerClass;
struct _GimpLayer struct _GimpLayer
{ {
GimpDrawable parent_instance; GimpDrawable parent_instance;
gdouble opacity; /* layer opacity */ gdouble opacity; /* layer opacity */
GimpLayerModeEffects mode; /* layer combination mode */ GimpLayerMode mode; /* layer combination mode */
gboolean lock_alpha; /* lock the alpha channel */ gboolean lock_alpha; /* lock the alpha channel */
GimpLayerMask *mask; /* possible layer mask */ GimpLayerMask *mask; /* possible layer mask */
gboolean apply_mask; /* controls mask application */ gboolean apply_mask; /* controls mask application */
gboolean edit_mask; /* edit mask or layer? */ gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show mask or layer? */ gboolean show_mask; /* show mask or layer? */
GeglNode *layer_offset_node; GeglNode *layer_offset_node;
GeglNode *mask_offset_node; GeglNode *mask_offset_node;
/* Floating selections */ /* Floating selections */
struct struct
@ -123,9 +123,9 @@ void gimp_layer_set_opacity (GimpLayer *layer,
gdouble gimp_layer_get_opacity (GimpLayer *layer); gdouble gimp_layer_get_opacity (GimpLayer *layer);
void gimp_layer_set_mode (GimpLayer *layer, void gimp_layer_set_mode (GimpLayer *layer,
GimpLayerModeEffects mode, GimpLayerMode mode,
gboolean push_undo); gboolean push_undo);
GimpLayerModeEffects gimp_layer_get_mode (GimpLayer *layer); GimpLayerMode gimp_layer_get_mode (GimpLayer *layer);
void gimp_layer_set_lock_alpha (GimpLayer *layer, void gimp_layer_set_lock_alpha (GimpLayer *layer,
gboolean lock_alpha, gboolean lock_alpha,

View File

@ -102,7 +102,7 @@ gimp_layer_prop_undo_pop (GimpUndo *undo,
{ {
case GIMP_UNDO_LAYER_MODE: case GIMP_UNDO_LAYER_MODE:
{ {
GimpLayerModeEffects mode; GimpLayerMode mode;
mode = gimp_layer_get_mode (layer); mode = gimp_layer_get_mode (layer);
gimp_layer_set_mode (layer, layer_prop_undo->mode, FALSE); gimp_layer_set_mode (layer, layer_prop_undo->mode, FALSE);

View File

@ -35,11 +35,11 @@ typedef struct _GimpLayerPropUndoClass GimpLayerPropUndoClass;
struct _GimpLayerPropUndo struct _GimpLayerPropUndo
{ {
GimpItemUndo parent_instance; GimpItemUndo parent_instance;
GimpLayerModeEffects mode; GimpLayerMode mode;
gdouble opacity; gdouble opacity;
gboolean lock_alpha; gboolean lock_alpha;
}; };
struct _GimpLayerPropUndoClass struct _GimpLayerPropUndoClass

View File

@ -893,7 +893,7 @@ gimp_selection_float (GimpSelection *selection,
gimp_drawable_get_format_with_alpha (drawable), gimp_drawable_get_format_with_alpha (drawable),
_("Floated Layer"), _("Floated Layer"),
GIMP_OPACITY_OPAQUE, GIMP_OPACITY_OPAQUE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
profile); profile);
/* Set the offsets */ /* Set the offsets */

View File

@ -44,13 +44,13 @@
typedef struct typedef struct
{ {
GimpImage *image; GimpImage *image;
GimpDrawable *drawable; GimpDrawable *drawable;
GimpContext *context; GimpContext *context;
gboolean applied; gboolean applied;
GimpLayerModeEffects orig_paint_mode; GimpLayerMode orig_paint_mode;
gdouble orig_opacity; gdouble orig_opacity;
} FadeDialog; } FadeDialog;

View File

@ -50,7 +50,7 @@ typedef struct _LayerOptionsDialog LayerOptionsDialog;
struct _LayerOptionsDialog struct _LayerOptionsDialog
{ {
GimpLayer *layer; GimpLayer *layer;
GimpLayerModeEffects mode; GimpLayerMode mode;
gdouble opacity; gdouble opacity;
GimpFillType fill_type; GimpFillType fill_type;
gboolean lock_alpha; gboolean lock_alpha;
@ -94,7 +94,7 @@ layer_options_dialog_new (GimpImage *image,
const gchar *desc, const gchar *desc,
const gchar *help_id, const gchar *help_id,
const gchar *layer_name, const gchar *layer_name,
GimpLayerModeEffects layer_mode, GimpLayerMode layer_mode,
gdouble layer_opacity, gdouble layer_opacity,
GimpFillType layer_fill_type, GimpFillType layer_fill_type,
gboolean layer_visible, gboolean layer_visible,

View File

@ -19,26 +19,26 @@
#define __LAYER_OPTIONS_DIALOG_H__ #define __LAYER_OPTIONS_DIALOG_H__
typedef void (* GimpLayerOptionsCallback) (GtkWidget *dialog, typedef void (* GimpLayerOptionsCallback) (GtkWidget *dialog,
GimpImage *image, GimpImage *image,
GimpLayer *layer, GimpLayer *layer,
GimpContext *context, GimpContext *context,
const gchar *layer_name, const gchar *layer_name,
GimpLayerModeEffects layer_mode, GimpLayerMode layer_mode,
gdouble layer_opacity, gdouble layer_opacity,
GimpFillType layer_fill_type, GimpFillType layer_fill_type,
gint layer_width, gint layer_width,
gint layer_height, gint layer_height,
gint layer_offset_x, gint layer_offset_x,
gint layer_offset_y, gint layer_offset_y,
gboolean layer_visible, gboolean layer_visible,
gboolean layer_linked, gboolean layer_linked,
GimpColorTag layer_color_tag, GimpColorTag layer_color_tag,
gboolean layer_lock_content, gboolean layer_lock_content,
gboolean layer_lock_position, gboolean layer_lock_position,
gboolean layer_lock_alpha, gboolean layer_lock_alpha,
gboolean rename_text_layer, gboolean rename_text_layer,
gpointer user_data); gpointer user_data);
GtkWidget * layer_options_dialog_new (GimpImage *image, GtkWidget * layer_options_dialog_new (GimpImage *image,
@ -51,7 +51,7 @@ GtkWidget * layer_options_dialog_new (GimpImage *image,
const gchar *desc, const gchar *desc,
const gchar *help_id, const gchar *help_id,
const gchar *layer_name, const gchar *layer_name,
GimpLayerModeEffects layer_mode, GimpLayerMode layer_mode,
gdouble layer_opacity, gdouble layer_opacity,
GimpFillType layer_fill_type, GimpFillType layer_fill_type,
gboolean layer_visible, gboolean layer_visible,

View File

@ -724,7 +724,8 @@ gimp_display_shell_drop_pixbuf (GtkWidget *widget,
gimp_layer_new_from_pixbuf (pixbuf, image, gimp_layer_new_from_pixbuf (pixbuf, image,
gimp_image_get_layer_format (image, has_alpha), gimp_image_get_layer_format (image, has_alpha),
_("Dropped Buffer"), _("Dropped Buffer"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
if (new_layer) if (new_layer)
{ {

View File

@ -139,9 +139,9 @@ gimp_gegl_add_buffer_source (GeglNode *parent,
} }
void void
gimp_gegl_mode_node_set_mode (GeglNode *node, gimp_gegl_mode_node_set_mode (GeglNode *node,
GimpLayerModeEffects mode, GimpLayerMode mode,
gboolean linear) gboolean linear)
{ {
const gchar *operation = "gimp:normal-mode"; const gchar *operation = "gimp:normal-mode";
gdouble opacity; gdouble opacity;
@ -150,37 +150,128 @@ gimp_gegl_mode_node_set_mode (GeglNode *node,
switch (mode) switch (mode)
{ {
case GIMP_NORMAL_MODE: operation = "gimp:normal-mode"; break; case GIMP_LAYER_MODE_NORMAL:
case GIMP_DISSOLVE_MODE: operation = "gimp:dissolve-mode"; break; operation = "gimp:normal-mode";
case GIMP_BEHIND_MODE: operation = "gimp:behind-mode"; break; break;
case GIMP_MULTIPLY_MODE: operation = "gimp:multiply-mode"; break;
case GIMP_SCREEN_MODE: operation = "gimp:screen-mode"; break; case GIMP_LAYER_MODE_DISSOLVE:
case GIMP_OVERLAY_MODE: operation = "gimp:softlight-mode"; break; operation = "gimp:dissolve-mode";
case GIMP_DIFFERENCE_MODE: operation = "gimp:difference-mode"; break; break;
case GIMP_ADDITION_MODE: operation = "gimp:addition-mode"; break;
case GIMP_SUBTRACT_MODE: operation = "gimp:subtract-mode"; break; case GIMP_LAYER_MODE_BEHIND:
case GIMP_DARKEN_ONLY_MODE: operation = "gimp:darken-only-mode"; break; operation = "gimp:behind-mode";
case GIMP_LIGHTEN_ONLY_MODE: operation = "gimp:lighten-only-mode"; break; break;
case GIMP_HUE_MODE: operation = "gimp:hue-mode"; break;
case GIMP_SATURATION_MODE: operation = "gimp:saturation-mode"; break; case GIMP_LAYER_MODE_MULTIPLY_BROKEN:
case GIMP_COLOR_MODE: operation = "gimp:color-mode"; break; operation = "gimp:multiply-mode";
case GIMP_VALUE_MODE: operation = "gimp:value-mode"; break; break;
case GIMP_DIVIDE_MODE: operation = "gimp:divide-mode"; break;
case GIMP_DODGE_MODE: operation = "gimp:dodge-mode"; break; case GIMP_LAYER_MODE_SCREEN_BROKEN:
case GIMP_BURN_MODE: operation = "gimp:burn-mode"; break; operation = "gimp:screen-mode";
case GIMP_HARDLIGHT_MODE: operation = "gimp:hardlight-mode"; break; break;
case GIMP_SOFTLIGHT_MODE: operation = "gimp:softlight-mode"; break;
case GIMP_GRAIN_EXTRACT_MODE: operation = "gimp:grain-extract-mode"; break; case GIMP_LAYER_MODE_OVERLAY_BROKEN:
case GIMP_GRAIN_MERGE_MODE: operation = "gimp:grain-merge-mode"; break; operation = "gimp:softlight-mode";
case GIMP_COLOR_ERASE_MODE: operation = "gimp:color-erase-mode"; break; break;
case GIMP_NEW_OVERLAY_MODE: operation = "gimp:overlay-mode"; break;
case GIMP_ERASE_MODE: operation = "gimp:erase-mode"; break; case GIMP_LAYER_MODE_DIFFERENCE_BROKEN:
case GIMP_REPLACE_MODE: operation = "gimp:replace-mode"; break; operation = "gimp:difference-mode";
case GIMP_ANTI_ERASE_MODE: operation = "gimp:anti-erase-mode"; break; break;
case GIMP_LCH_HUE_MODE: operation = "gimp:lch-hue-mode"; break;
case GIMP_LCH_CHROMA_MODE: operation = "gimp:lch-chroma-mode"; break; case GIMP_LAYER_MODE_ADDITION_BROKEN:
case GIMP_LCH_COLOR_MODE: operation = "gimp:lch-color-mode"; break; operation = "gimp:addition-mode";
case GIMP_LCH_LIGHTNESS_MODE: operation = "gimp:lch-lightness-mode"; break; break;
case GIMP_LAYER_MODE_SUBTRACT_BROKEN:
operation = "gimp:subtract-mode";
break;
case GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN:
operation = "gimp:darken-only-mode";
break;
case GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN:
operation = "gimp:lighten-only-mode";
break;
case GIMP_LAYER_MODE_HSV_HUE_BROKEN:
operation = "gimp:hue-mode";
break;
case GIMP_LAYER_MODE_HSV_SATURATION_BROKEN:
operation = "gimp:saturation-mode";
break;
case GIMP_LAYER_MODE_HSV_COLOR_BROKEN:
operation = "gimp:color-mode";
break;
case GIMP_LAYER_MODE_HSV_VALUE_BROKEN:
operation = "gimp:value-mode";
break;
case GIMP_LAYER_MODE_DIVIDE_BROKEN:
operation = "gimp:divide-mode";
break;
case GIMP_LAYER_MODE_DODGE_BROKEN:
operation = "gimp:dodge-mode";
break;
case GIMP_LAYER_MODE_BURN_BROKEN:
operation = "gimp:burn-mode";
break;
case GIMP_LAYER_MODE_HARDLIGHT_BROKEN:
operation = "gimp:hardlight-mode";
break;
case GIMP_LAYER_MODE_SOFTLIGHT_BROKEN:
operation = "gimp:softlight-mode";
break;
case GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN:
operation = "gimp:grain-extract-mode";
break;
case GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN:
operation = "gimp:grain-merge-mode";
break;
case GIMP_LAYER_MODE_COLOR_ERASE:
operation = "gimp:color-erase-mode";
break;
case GIMP_LAYER_MODE_OVERLAY:
operation = "gimp:overlay-mode";
break;
case GIMP_LAYER_MODE_LCH_HUE:
operation = "gimp:lch-hue-mode";
break;
case GIMP_LAYER_MODE_LCH_CHROMA:
operation = "gimp:lch-chroma-mode";
break;
case GIMP_LAYER_MODE_LCH_COLOR:
operation = "gimp:lch-color-mode";
break;
case GIMP_LAYER_MODE_LCH_LIGHTNESS:
operation = "gimp:lch-lightness-mode";
break;
case GIMP_LAYER_MODE_ERASE:
operation = "gimp:erase-mode"; break;
case GIMP_LAYER_MODE_REPLACE:
operation = "gimp:replace-mode";
break;
case GIMP_LAYER_MODE_ANTI_ERASE:
operation = "gimp:anti-erase-mode";
break;
default: default:
break; break;
} }

View File

@ -22,25 +22,25 @@
#define __GIMP_GEGL_NODES_H__ #define __GIMP_GEGL_NODES_H__
GeglNode * gimp_gegl_create_flatten_node (const GimpRGB *background); GeglNode * gimp_gegl_create_flatten_node (const GimpRGB *background);
GeglNode * gimp_gegl_create_apply_opacity_node (GeglBuffer *mask, GeglNode * gimp_gegl_create_apply_opacity_node (GeglBuffer *mask,
gint mask_offset_x, gint mask_offset_x,
gint mask_offset_y, gint mask_offset_y,
gdouble opacity); gdouble opacity);
GeglNode * gimp_gegl_add_buffer_source (GeglNode *parent, GeglNode * gimp_gegl_add_buffer_source (GeglNode *parent,
GeglBuffer *buffer, GeglBuffer *buffer,
gint offset_x, gint offset_x,
gint offset_y); gint offset_y);
void gimp_gegl_mode_node_set_mode (GeglNode *node, void gimp_gegl_mode_node_set_mode (GeglNode *node,
GimpLayerModeEffects mode, GimpLayerMode mode,
gboolean linear); gboolean linear);
void gimp_gegl_mode_node_set_opacity (GeglNode *node, void gimp_gegl_mode_node_set_opacity (GeglNode *node,
gdouble opacity); gdouble opacity);
void gimp_gegl_node_set_matrix (GeglNode *node, void gimp_gegl_node_set_matrix (GeglNode *node,
const GimpMatrix3 *matrix); const GimpMatrix3 *matrix);
void gimp_gegl_node_set_color (GeglNode *node, void gimp_gegl_node_set_color (GeglNode *node,
const GimpRGB *color); const GimpRGB *color);
#endif /* __GIMP_GEGL_NODES_H__ */ #endif /* __GIMP_GEGL_NODES_H__ */

View File

@ -58,7 +58,7 @@ static void
gimp_applicator_init (GimpApplicator *applicator) gimp_applicator_init (GimpApplicator *applicator)
{ {
applicator->opacity = 1.0; applicator->opacity = 1.0;
applicator->paint_mode = GIMP_NORMAL_MODE; applicator->paint_mode = GIMP_LAYER_MODE_NORMAL;
applicator->affect = GIMP_COMPONENT_MASK_ALL; applicator->affect = GIMP_COMPONENT_MASK_ALL;
} }
@ -449,8 +449,8 @@ gimp_applicator_set_opacity (GimpApplicator *applicator,
} }
void void
gimp_applicator_set_mode (GimpApplicator *applicator, gimp_applicator_set_mode (GimpApplicator *applicator,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
g_return_if_fail (GIMP_IS_APPLICATOR (applicator)); g_return_if_fail (GIMP_IS_APPLICATOR (applicator));

View File

@ -34,49 +34,49 @@ typedef struct _GimpApplicatorClass GimpApplicatorClass;
struct _GimpApplicator struct _GimpApplicator
{ {
GObject parent_instance; GObject parent_instance;
GeglNode *node; GeglNode *node;
GeglNode *input_node; GeglNode *input_node;
GeglNode *aux_node; GeglNode *aux_node;
GeglNode *output_node; GeglNode *output_node;
GeglBuffer *apply_buffer; GeglBuffer *apply_buffer;
GeglNode *apply_src_node; GeglNode *apply_src_node;
gint apply_offset_x; gint apply_offset_x;
gint apply_offset_y; gint apply_offset_y;
GeglNode *apply_offset_node; GeglNode *apply_offset_node;
GeglNode *dup_apply_buffer_node; GeglNode *dup_apply_buffer_node;
gboolean preview_enabled; gboolean preview_enabled;
GeglRectangle preview_rect; GeglRectangle preview_rect;
GeglNode *preview_cache_node; GeglNode *preview_cache_node;
GeglNode *preview_crop_node; GeglNode *preview_crop_node;
gdouble opacity; gdouble opacity;
GimpLayerModeEffects paint_mode; GimpLayerMode paint_mode;
gboolean linear; gboolean linear;
GeglNode *mode_node; GeglNode *mode_node;
GimpComponentMask affect; GimpComponentMask affect;
GeglNode *affect_node; GeglNode *affect_node;
GeglNode *output_cache_node; GeglNode *output_cache_node;
GeglBuffer *src_buffer; GeglBuffer *src_buffer;
GeglNode *src_node; GeglNode *src_node;
GeglBuffer *dest_buffer; GeglBuffer *dest_buffer;
GeglNode *dest_node; GeglNode *dest_node;
GeglBuffer *mask_buffer; GeglBuffer *mask_buffer;
GeglNode *mask_node; GeglNode *mask_node;
gint mask_offset_x; gint mask_offset_x;
gint mask_offset_y; gint mask_offset_y;
GeglNode *mask_offset_node; GeglNode *mask_offset_node;
}; };
struct _GimpApplicatorClass struct _GimpApplicatorClass
@ -112,7 +112,7 @@ void gimp_applicator_set_apply_offset (GimpApplicator *applicator,
void gimp_applicator_set_opacity (GimpApplicator *applicator, void gimp_applicator_set_opacity (GimpApplicator *applicator,
gdouble opacity); gdouble opacity);
void gimp_applicator_set_mode (GimpApplicator *applicator, void gimp_applicator_set_mode (GimpApplicator *applicator,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
void gimp_applicator_set_affect (GimpApplicator *applicator, void gimp_applicator_set_affect (GimpApplicator *applicator,
GimpComponentMask affect); GimpComponentMask affect);

View File

@ -59,57 +59,149 @@
GimpLayerModeFunction GimpLayerModeFunction
get_layer_mode_function (GimpLayerModeEffects paint_mode, get_layer_mode_function (GimpLayerMode paint_mode,
gboolean linear_mode) gboolean linear_mode)
{ {
GimpLayerModeFunction func = gimp_operation_normal_mode_process_pixels; GimpLayerModeFunction func = gimp_operation_normal_mode_process_pixels;
switch (paint_mode) switch (paint_mode)
{ {
case GIMP_NORMAL_MODE: func = gimp_operation_normal_mode_process_pixels; break; case GIMP_LAYER_MODE_NORMAL:
case GIMP_DISSOLVE_MODE: func = gimp_operation_dissolve_mode_process_pixels; break; func = gimp_operation_normal_mode_process_pixels;
case GIMP_BEHIND_MODE: func = gimp_operation_behind_mode_process_pixels; break; break;
case GIMP_MULTIPLY_MODE: func = gimp_operation_multiply_mode_process_pixels; break;
case GIMP_SCREEN_MODE: func = gimp_operation_screen_mode_process_pixels; break;
case GIMP_OVERLAY_MODE: func = gimp_operation_softlight_mode_process_pixels; break;
case GIMP_DIFFERENCE_MODE: func = gimp_operation_difference_mode_process_pixels; break;
case GIMP_ADDITION_MODE: func = gimp_operation_addition_mode_process_pixels; break;
case GIMP_SUBTRACT_MODE: func = gimp_operation_subtract_mode_process_pixels; break;
case GIMP_DARKEN_ONLY_MODE: func = gimp_operation_darken_only_mode_process_pixels; break;
case GIMP_LIGHTEN_ONLY_MODE: func = gimp_operation_lighten_only_mode_process_pixels; break;
case GIMP_HUE_MODE: func = gimp_operation_hue_mode_process_pixels; break;
case GIMP_SATURATION_MODE: func = gimp_operation_saturation_mode_process_pixels; break;
case GIMP_COLOR_MODE: func = gimp_operation_color_mode_process_pixels; break;
case GIMP_VALUE_MODE: func = gimp_operation_value_mode_process_pixels; break;
case GIMP_DIVIDE_MODE: func = gimp_operation_divide_mode_process_pixels; break;
case GIMP_DODGE_MODE: func = gimp_operation_dodge_mode_process_pixels; break;
case GIMP_BURN_MODE: func = gimp_operation_burn_mode_process_pixels; break;
case GIMP_HARDLIGHT_MODE: func = gimp_operation_hardlight_mode_process_pixels; break;
case GIMP_SOFTLIGHT_MODE: func = gimp_operation_softlight_mode_process_pixels; break;
case GIMP_GRAIN_EXTRACT_MODE: func = gimp_operation_grain_extract_mode_process_pixels; break;
case GIMP_GRAIN_MERGE_MODE: func = gimp_operation_grain_merge_mode_process_pixels; break;
case GIMP_COLOR_ERASE_MODE: func = gimp_operation_color_erase_mode_process_pixels; break;
case GIMP_NEW_OVERLAY_MODE: func = gimp_operation_overlay_mode_process_pixels; break;
case GIMP_LCH_HUE_MODE: func = linear_mode ?
gimp_operation_lch_hue_mode_process_pixels_linear :
gimp_operation_lch_hue_mode_process_pixels; break;
case GIMP_LCH_CHROMA_MODE: func = linear_mode ?
gimp_operation_lch_chroma_mode_process_pixels_linear :
gimp_operation_lch_chroma_mode_process_pixels; break;
case GIMP_LCH_COLOR_MODE: func = linear_mode ?
gimp_operation_lch_color_mode_process_pixels_linear :
gimp_operation_lch_color_mode_process_pixels; break;
case GIMP_LCH_LIGHTNESS_MODE: func = linear_mode ?
gimp_operation_lch_lightness_mode_process_pixels_linear :
gimp_operation_lch_lightness_mode_process_pixels; break;
case GIMP_ERASE_MODE: func = gimp_operation_erase_mode_process_pixels; break;
case GIMP_REPLACE_MODE: func = gimp_operation_replace_mode_process_pixels; break;
case GIMP_ANTI_ERASE_MODE: func = gimp_operation_anti_erase_mode_process_pixels; break;
default: case GIMP_LAYER_MODE_DISSOLVE:
g_warning ("No direct function for layer mode (%d), using gimp:normal-mode", paint_mode); func = gimp_operation_dissolve_mode_process_pixels;
func = gimp_operation_normal_mode_process_pixels; break;
break;
case GIMP_LAYER_MODE_BEHIND:
func = gimp_operation_behind_mode_process_pixels;
break;
case GIMP_LAYER_MODE_MULTIPLY_BROKEN:
func = gimp_operation_multiply_mode_process_pixels;
break;
case GIMP_LAYER_MODE_SCREEN_BROKEN:
func = gimp_operation_screen_mode_process_pixels;
break;
case GIMP_LAYER_MODE_OVERLAY_BROKEN:
func = gimp_operation_softlight_mode_process_pixels;
break;
case GIMP_LAYER_MODE_DIFFERENCE_BROKEN:
func = gimp_operation_difference_mode_process_pixels;
break;
case GIMP_LAYER_MODE_ADDITION_BROKEN:
func = gimp_operation_addition_mode_process_pixels;
break;
case GIMP_LAYER_MODE_SUBTRACT_BROKEN:
func = gimp_operation_subtract_mode_process_pixels;
break;
case GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN:
func = gimp_operation_darken_only_mode_process_pixels;
break;
case GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN:
func = gimp_operation_lighten_only_mode_process_pixels;
break;
case GIMP_LAYER_MODE_HSV_HUE_BROKEN:
func = gimp_operation_hue_mode_process_pixels;
break;
case GIMP_LAYER_MODE_HSV_SATURATION_BROKEN:
func = gimp_operation_saturation_mode_process_pixels;
break;
case GIMP_LAYER_MODE_HSV_COLOR_BROKEN:
func = gimp_operation_color_mode_process_pixels;
break;
case GIMP_LAYER_MODE_HSV_VALUE_BROKEN:
func = gimp_operation_value_mode_process_pixels;
break;
case GIMP_LAYER_MODE_DIVIDE_BROKEN:
func = gimp_operation_divide_mode_process_pixels;
break;
case GIMP_LAYER_MODE_DODGE_BROKEN:
func = gimp_operation_dodge_mode_process_pixels;
break;
case GIMP_LAYER_MODE_BURN_BROKEN:
func = gimp_operation_burn_mode_process_pixels;
break;
case GIMP_LAYER_MODE_HARDLIGHT_BROKEN:
func = gimp_operation_hardlight_mode_process_pixels;
break;
case GIMP_LAYER_MODE_SOFTLIGHT_BROKEN:
func = gimp_operation_softlight_mode_process_pixels;
break;
case GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN:
func = gimp_operation_grain_extract_mode_process_pixels;
break;
case GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN:
func = gimp_operation_grain_merge_mode_process_pixels;
break;
case GIMP_LAYER_MODE_COLOR_ERASE:
func = gimp_operation_color_erase_mode_process_pixels;
break;
case GIMP_LAYER_MODE_OVERLAY:
func = gimp_operation_overlay_mode_process_pixels;
break;
case GIMP_LAYER_MODE_LCH_HUE:
func = linear_mode ?
gimp_operation_lch_hue_mode_process_pixels_linear :
gimp_operation_lch_hue_mode_process_pixels;
break;
case GIMP_LAYER_MODE_LCH_CHROMA:
func = linear_mode ?
gimp_operation_lch_chroma_mode_process_pixels_linear :
gimp_operation_lch_chroma_mode_process_pixels;
break;
case GIMP_LAYER_MODE_LCH_COLOR:
func = linear_mode ?
gimp_operation_lch_color_mode_process_pixels_linear :
gimp_operation_lch_color_mode_process_pixels;
break;
case GIMP_LAYER_MODE_LCH_LIGHTNESS:
func = linear_mode ?
gimp_operation_lch_lightness_mode_process_pixels_linear :
gimp_operation_lch_lightness_mode_process_pixels;
break;
case GIMP_LAYER_MODE_ERASE:
func = gimp_operation_erase_mode_process_pixels;
break;
case GIMP_LAYER_MODE_REPLACE:
func = gimp_operation_replace_mode_process_pixels;
break;
case GIMP_LAYER_MODE_ANTI_ERASE:
func = gimp_operation_anti_erase_mode_process_pixels;
break;
default:
g_warning ("No direct function for layer mode (%d), using gimp:normal-mode", paint_mode);
func = gimp_operation_normal_mode_process_pixels;
break;
} }
return func; return func;

View File

@ -21,7 +21,7 @@
#ifndef __GIMP_LAYER_MODE_FUNCTIONS_H__ #ifndef __GIMP_LAYER_MODE_FUNCTIONS_H__
#define __GIMP_LAYER_MODE_FUNCTIONS_H__ #define __GIMP_LAYER_MODE_FUNCTIONS_H__
GimpLayerModeFunction get_layer_mode_function (GimpLayerModeEffects paint_mode, GimpLayerModeFunction get_layer_mode_function (GimpLayerMode paint_mode,
gboolean linear_mode); gboolean linear_mode);
#endif /* __GIMP_LAYER_MODE_FUNCTIONS_H__ */ #endif /* __GIMP_LAYER_MODE_FUNCTIONS_H__ */

View File

@ -966,7 +966,7 @@ gimp_brush_core_paste_canvas (GimpBrushCore *core,
const GimpCoords *coords, const GimpCoords *coords,
gdouble brush_opacity, gdouble brush_opacity,
gdouble image_opacity, gdouble image_opacity,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpBrushApplicationMode brush_hardness, GimpBrushApplicationMode brush_hardness,
gdouble dynamic_force, gdouble dynamic_force,
GimpPaintApplicationMode mode, GimpPaintApplicationMode mode,
@ -996,7 +996,8 @@ gimp_brush_core_paste_canvas (GimpBrushCore *core,
off_x, off_y, off_x, off_y,
drawable, drawable,
brush_opacity, brush_opacity,
image_opacity, paint_mode, image_opacity,
paint_mode,
mode); mode);
} }
} }

View File

@ -104,7 +104,7 @@ void gimp_brush_core_paste_canvas (GimpBrushCore *core,
const GimpCoords *coords, const GimpCoords *coords,
gdouble brush_opacity, gdouble brush_opacity,
gdouble image_opacity, gdouble image_opacity,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpBrushApplicationMode brush_hardness, GimpBrushApplicationMode brush_hardness,
gdouble dynamic_hardness, gdouble dynamic_hardness,
GimpPaintApplicationMode mode, GimpPaintApplicationMode mode,

View File

@ -123,24 +123,24 @@ gimp_eraser_motion (GimpPaintCore *paint_core,
GimpPaintOptions *paint_options, GimpPaintOptions *paint_options,
GimpSymmetry *sym) GimpSymmetry *sym)
{ {
GimpEraserOptions *options = GIMP_ERASER_OPTIONS (paint_options); GimpEraserOptions *options = GIMP_ERASER_OPTIONS (paint_options);
GimpContext *context = GIMP_CONTEXT (paint_options); GimpContext *context = GIMP_CONTEXT (paint_options);
GimpDynamics *dynamics = GIMP_BRUSH_CORE (paint_core)->dynamics; GimpDynamics *dynamics = GIMP_BRUSH_CORE (paint_core)->dynamics;
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
gdouble fade_point; gdouble fade_point;
gdouble opacity; gdouble opacity;
GimpLayerModeEffects paint_mode; GimpLayerMode paint_mode;
GeglBuffer *paint_buffer; GeglBuffer *paint_buffer;
gint paint_buffer_x; gint paint_buffer_x;
gint paint_buffer_y; gint paint_buffer_y;
GimpRGB background; GimpRGB background;
GeglColor *color; GeglColor *color;
gdouble force; gdouble force;
const GimpCoords *coords; const GimpCoords *coords;
GeglNode *op; GeglNode *op;
gint n_strokes; gint n_strokes;
gint paint_width, paint_height; gint paint_width, paint_height;
gint i; gint i;
fade_point = gimp_paint_options_get_fade (paint_options, image, fade_point = gimp_paint_options_get_fade (paint_options, image,
paint_core->pixel_dist); paint_core->pixel_dist);
@ -160,11 +160,11 @@ gimp_eraser_motion (GimpPaintCore *paint_core,
color = gimp_gegl_color_new (&background); color = gimp_gegl_color_new (&background);
if (options->anti_erase) if (options->anti_erase)
paint_mode = GIMP_ANTI_ERASE_MODE; paint_mode = GIMP_LAYER_MODE_ANTI_ERASE;
else if (gimp_drawable_has_alpha (drawable)) else if (gimp_drawable_has_alpha (drawable))
paint_mode = GIMP_ERASE_MODE; paint_mode = GIMP_LAYER_MODE_ERASE;
else else
paint_mode = GIMP_NORMAL_MODE; paint_mode = GIMP_LAYER_MODE_NORMAL;
gimp_brush_core_eval_transform_dynamics (GIMP_BRUSH_CORE (paint_core), gimp_brush_core_eval_transform_dynamics (GIMP_BRUSH_CORE (paint_core),
drawable, drawable,

View File

@ -282,17 +282,17 @@ paint_mask_to_paint_buffer (const GimpTempBuf *paint_mask,
} }
void void
do_layer_blend (GeglBuffer *src_buffer, do_layer_blend (GeglBuffer *src_buffer,
GeglBuffer *dst_buffer, GeglBuffer *dst_buffer,
GimpTempBuf *paint_buf, GimpTempBuf *paint_buf,
GeglBuffer *mask_buffer, GeglBuffer *mask_buffer,
gfloat opacity, gfloat opacity,
gint x_offset, gint x_offset,
gint y_offset, gint y_offset,
gint mask_x_offset, gint mask_x_offset,
gint mask_y_offset, gint mask_y_offset,
gboolean linear_mode, gboolean linear_mode,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
GeglRectangle roi; GeglRectangle roi;
GeglRectangle mask_roi; GeglRectangle mask_roi;
@ -303,7 +303,8 @@ do_layer_blend (GeglBuffer *src_buffer,
const guint paint_stride = gimp_temp_buf_get_width (paint_buf); const guint paint_stride = gimp_temp_buf_get_width (paint_buf);
gfloat *paint_data = (gfloat *) gimp_temp_buf_get_data (paint_buf); gfloat *paint_data = (gfloat *) gimp_temp_buf_get_data (paint_buf);
GimpLayerModeFunction apply_func = get_layer_mode_function (paint_mode, linear_mode); GimpLayerModeFunction apply_func = get_layer_mode_function (paint_mode,
linear_mode);
if (linear_mode) if (linear_mode)
iterator_format = babl_format ("RGBA float"); iterator_format = babl_format ("RGBA float");

View File

@ -35,17 +35,17 @@ void paint_mask_to_paint_buffer (const GimpTempBuf *paint_mask,
GimpTempBuf *paint_buf, GimpTempBuf *paint_buf,
gfloat paint_opacity); gfloat paint_opacity);
void do_layer_blend (GeglBuffer *src_buffer, void do_layer_blend (GeglBuffer *src_buffer,
GeglBuffer *dst_buffer, GeglBuffer *dst_buffer,
GimpTempBuf *paint_buf, GimpTempBuf *paint_buf,
GeglBuffer *mask_buffer, GeglBuffer *mask_buffer,
gfloat opacity, gfloat opacity,
gint x_offset, gint x_offset,
gint y_offset, gint y_offset,
gint mask_x_offset, gint mask_x_offset,
gint mask_y_offset, gint mask_y_offset,
gboolean linear_mode, gboolean linear_mode,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
void mask_components_onto (GeglBuffer *src_buffer, void mask_components_onto (GeglBuffer *src_buffer,
GeglBuffer *aux_buffer, GeglBuffer *aux_buffer,

View File

@ -822,7 +822,7 @@ gimp_paint_core_paste (GimpPaintCore *core,
GimpDrawable *drawable, GimpDrawable *drawable,
gdouble paint_opacity, gdouble paint_opacity,
gdouble image_opacity, gdouble image_opacity,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpPaintApplicationMode mode) GimpPaintApplicationMode mode)
{ {
gint width = gegl_buffer_get_width (core->paint_buffer); gint width = gegl_buffer_get_width (core->paint_buffer);
@ -1031,7 +1031,8 @@ gimp_paint_core_replace (GimpPaintCore *core,
paint_mask_offset_y, paint_mask_offset_y,
drawable, drawable,
paint_opacity, paint_opacity,
image_opacity, GIMP_NORMAL_MODE, image_opacity,
GIMP_LAYER_MODE_NORMAL,
mode); mode);
return; return;
} }

View File

@ -184,7 +184,7 @@ void gimp_paint_core_paste (GimpPaintCore *core,
GimpDrawable *drawable, GimpDrawable *drawable,
gdouble paint_opacity, gdouble paint_opacity,
gdouble image_opacity, gdouble image_opacity,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpPaintApplicationMode mode); GimpPaintApplicationMode mode);
void gimp_paint_core_replace (GimpPaintCore *core, void gimp_paint_core_replace (GimpPaintCore *core,

View File

@ -61,8 +61,8 @@ brushes_popup_invoker (GimpProcedure *procedure,
if (success) if (success)
{ {
if (paint_mode == GIMP_OVERLAY_MODE) if (paint_mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
paint_mode = GIMP_SOFTLIGHT_MODE; paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
if (gimp->no_interface || if (gimp->no_interface ||
! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) || ! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) ||
@ -129,8 +129,8 @@ brushes_set_popup_invoker (GimpProcedure *procedure,
if (success) if (success)
{ {
if (paint_mode == GIMP_OVERLAY_MODE) if (paint_mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
paint_mode = GIMP_SOFTLIGHT_MODE; paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
if (gimp->no_interface || if (gimp->no_interface ||
! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) || ! gimp_pdb_lookup_procedure (gimp->pdb, brush_callback) ||
@ -203,8 +203,8 @@ register_brush_select_procs (GimpPDB *pdb)
g_param_spec_enum ("paint-mode", g_param_spec_enum ("paint-mode",
"paint mode", "paint mode",
"The initial paint mode", "The initial paint mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure); gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure); g_object_unref (procedure);
@ -277,8 +277,8 @@ register_brush_select_procs (GimpPDB *pdb)
g_param_spec_enum ("paint-mode", g_param_spec_enum ("paint-mode",
"paint mode", "paint mode",
"The initial paint mode", "The initial paint mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure); gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure); g_object_unref (procedure);

View File

@ -207,8 +207,8 @@ brushes_get_brush_data_invoker (GimpProcedure *procedure,
{ {
GimpBrush *brush; GimpBrush *brush;
if (paint_mode == GIMP_OVERLAY_MODE) if (paint_mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
paint_mode = GIMP_SOFTLIGHT_MODE; paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
if (name && strlen (name)) if (name && strlen (name))
brush = gimp_pdb_get_brush (gimp, name, FALSE, error); brush = gimp_pdb_get_brush (gimp, name, FALSE, error);
@ -439,8 +439,8 @@ register_brushes_procs (GimpPDB *pdb)
g_param_spec_enum ("paint-mode", g_param_spec_enum ("paint-mode",
"paint mode", "paint mode",
"The paint mode", "The paint mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
gimp_param_spec_int32 ("width", gimp_param_spec_int32 ("width",

View File

@ -419,8 +419,8 @@ context_set_paint_mode_invoker (GimpProcedure *procedure,
if (success) if (success)
{ {
if (paint_mode == GIMP_OVERLAY_MODE) if (paint_mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
paint_mode = GIMP_SOFTLIGHT_MODE; paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
gimp_context_set_paint_mode (context, paint_mode); gimp_context_set_paint_mode (context, paint_mode);
} }
@ -3138,8 +3138,8 @@ register_context_procs (GimpPDB *pdb)
g_param_spec_enum ("paint-mode", g_param_spec_enum ("paint-mode",
"paint mode", "paint mode",
"The paint mode", "The paint mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure); gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure); g_object_unref (procedure);
@ -3162,8 +3162,8 @@ register_context_procs (GimpPDB *pdb)
g_param_spec_enum ("paint-mode", g_param_spec_enum ("paint-mode",
"paint mode", "paint mode",
"The paint mode", "The paint mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure); gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure); g_object_unref (procedure);

View File

@ -621,8 +621,8 @@ edit_bucket_fill_invoker (GimpProcedure *procedure,
if (gimp_fill_options_set_by_fill_mode (options, context, if (gimp_fill_options_set_by_fill_mode (options, context,
fill_mode, error)) fill_mode, error))
{ {
if (paint_mode == GIMP_OVERLAY_MODE) if (paint_mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
paint_mode = GIMP_SOFTLIGHT_MODE; paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
gimp_context_set_opacity (GIMP_CONTEXT (options), opacity / 100.0); gimp_context_set_opacity (GIMP_CONTEXT (options), opacity / 100.0);
gimp_context_set_paint_mode (GIMP_CONTEXT (options), paint_mode); gimp_context_set_paint_mode (GIMP_CONTEXT (options), paint_mode);
@ -698,8 +698,8 @@ edit_bucket_fill_full_invoker (GimpProcedure *procedure,
if (gimp_fill_options_set_by_fill_mode (options, context, if (gimp_fill_options_set_by_fill_mode (options, context,
fill_mode, error)) fill_mode, error))
{ {
if (paint_mode == GIMP_OVERLAY_MODE) if (paint_mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
paint_mode = GIMP_SOFTLIGHT_MODE; paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
gimp_context_set_opacity (GIMP_CONTEXT (options), opacity / 100.0); gimp_context_set_opacity (GIMP_CONTEXT (options), opacity / 100.0);
gimp_context_set_paint_mode (GIMP_CONTEXT (options), paint_mode); gimp_context_set_paint_mode (GIMP_CONTEXT (options), paint_mode);
@ -794,8 +794,8 @@ edit_blend_invoker (GimpProcedure *procedure,
{ {
GimpGradient *gradient; GimpGradient *gradient;
if (paint_mode == GIMP_OVERLAY_MODE) if (paint_mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
paint_mode = GIMP_SOFTLIGHT_MODE; paint_mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
if (progress) if (progress)
gimp_progress_start (progress, FALSE, _("Blending")); gimp_progress_start (progress, FALSE, _("Blending"));
@ -1348,8 +1348,8 @@ register_edit_procs (GimpPDB *pdb)
g_param_spec_enum ("paint-mode", g_param_spec_enum ("paint-mode",
"paint mode", "paint mode",
"The paint application mode", "The paint application mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_double ("opacity", g_param_spec_double ("opacity",
@ -1415,8 +1415,8 @@ register_edit_procs (GimpPDB *pdb)
g_param_spec_enum ("paint-mode", g_param_spec_enum ("paint-mode",
"paint mode", "paint mode",
"The paint application mode", "The paint application mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_double ("opacity", g_param_spec_double ("opacity",
@ -1495,8 +1495,8 @@ register_edit_procs (GimpPDB *pdb)
g_param_spec_enum ("paint-mode", g_param_spec_enum ("paint-mode",
"paint mode", "paint mode",
"The paint application mode", "The paint application mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_enum ("gradient-type", g_param_spec_enum ("gradient-type",

View File

@ -88,8 +88,8 @@ layer_new_invoker (GimpProcedure *procedure,
gboolean has_alpha = FALSE; gboolean has_alpha = FALSE;
const Babl *format; const Babl *format;
if (mode == GIMP_OVERLAY_MODE) if (mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
mode = GIMP_SOFTLIGHT_MODE; mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
switch (type) switch (type)
{ {
@ -181,7 +181,7 @@ layer_new_from_visible_invoker (GimpProcedure *procedure,
TRUE), TRUE),
name, name,
GIMP_OPACITY_OPAQUE, GIMP_OPACITY_OPAQUE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
profile); profile);
} }
@ -1140,8 +1140,8 @@ layer_set_mode_invoker (GimpProcedure *procedure,
if (success) if (success)
{ {
if (mode == GIMP_OVERLAY_MODE) if (mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
mode = GIMP_SOFTLIGHT_MODE; mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
gimp_layer_set_mode (layer, mode, TRUE); gimp_layer_set_mode (layer, mode, TRUE);
} }
@ -1211,8 +1211,8 @@ register_layer_procs (GimpPDB *pdb)
g_param_spec_enum ("mode", g_param_spec_enum ("mode",
"mode", "mode",
"The layer combination mode", "The layer combination mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
gimp_param_spec_layer_id ("layer", gimp_param_spec_layer_id ("layer",
@ -2147,8 +2147,8 @@ register_layer_procs (GimpPDB *pdb)
g_param_spec_enum ("mode", g_param_spec_enum ("mode",
"mode", "mode",
"The layer combination mode", "The layer combination mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure); gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure); g_object_unref (procedure);
@ -2177,8 +2177,8 @@ register_layer_procs (GimpPDB *pdb)
g_param_spec_enum ("mode", g_param_spec_enum ("mode",
"mode", "mode",
"The new layer combination mode", "The new layer combination mode",
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure); gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure); g_object_unref (procedure);

View File

@ -138,7 +138,7 @@ gimp_test_utils_create_image (Gimp *gimp,
gimp_image_get_layer_format (image, TRUE), gimp_image_get_layer_format (image, TRUE),
"layer1", "layer1",
1.0, 1.0,
GIMP_NORMAL_MODE); GIMP_LAYER_MODE_NORMAL);
gimp_image_add_layer (image, gimp_image_add_layer (image,
layer, layer,

View File

@ -126,8 +126,8 @@ rotate_non_overlapping (GimpTestFixture *fixture,
GIMP_TEST_IMAGE_SIZE, GIMP_TEST_IMAGE_SIZE,
babl_format ("R'G'B'A u8"), babl_format ("R'G'B'A u8"),
"Test Layer", "Test Layer",
1.0, GIMP_OPACITY_OPAQUE,
GIMP_NORMAL_MODE); GIMP_LAYER_MODE_NORMAL);
g_assert_cmpint (GIMP_IS_LAYER (layer), ==, TRUE); g_assert_cmpint (GIMP_IS_LAYER (layer), ==, TRUE);
@ -166,8 +166,8 @@ add_layer (GimpTestFixture *fixture,
GIMP_TEST_IMAGE_SIZE, GIMP_TEST_IMAGE_SIZE,
babl_format ("R'G'B'A u8"), babl_format ("R'G'B'A u8"),
"Test Layer", "Test Layer",
1.0, GIMP_OPACITY_OPAQUE,
GIMP_NORMAL_MODE); GIMP_LAYER_MODE_NORMAL);
g_assert_cmpint (GIMP_IS_LAYER (layer), ==, TRUE); g_assert_cmpint (GIMP_IS_LAYER (layer), ==, TRUE);
@ -203,8 +203,8 @@ remove_layer (GimpTestFixture *fixture,
GIMP_TEST_IMAGE_SIZE, GIMP_TEST_IMAGE_SIZE,
babl_format ("R'G'B'A u8"), babl_format ("R'G'B'A u8"),
"Test Layer", "Test Layer",
1.0, GIMP_OPACITY_OPAQUE,
GIMP_NORMAL_MODE); GIMP_LAYER_MODE_NORMAL);
g_assert_cmpint (GIMP_IS_LAYER (layer), ==, TRUE); g_assert_cmpint (GIMP_IS_LAYER (layer), ==, TRUE);

View File

@ -235,7 +235,8 @@ create_new_image_via_dialog (gconstpointer data)
gimp_image_get_height (image), gimp_image_get_height (image),
gimp_image_get_layer_format (image, TRUE), gimp_image_get_layer_format (image, TRUE),
"Layer for testing", "Layer for testing",
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
gimp_image_add_layer (image, layer, gimp_image_add_layer (image, layer,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE); GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);

View File

@ -67,15 +67,15 @@
#define GIMP_MAINIMAGE_LAYER1_WIDTH 50 #define GIMP_MAINIMAGE_LAYER1_WIDTH 50
#define GIMP_MAINIMAGE_LAYER1_HEIGHT 51 #define GIMP_MAINIMAGE_LAYER1_HEIGHT 51
#define GIMP_MAINIMAGE_LAYER1_FORMAT babl_format ("R'G'B'A u8") #define GIMP_MAINIMAGE_LAYER1_FORMAT babl_format ("R'G'B'A u8")
#define GIMP_MAINIMAGE_LAYER1_OPACITY 1.0 #define GIMP_MAINIMAGE_LAYER1_OPACITY GIMP_OPACITY_OPAQUE
#define GIMP_MAINIMAGE_LAYER1_MODE GIMP_NORMAL_MODE #define GIMP_MAINIMAGE_LAYER1_MODE GIMP_LAYER_MODE_NORMAL
#define GIMP_MAINIMAGE_LAYER2_NAME "layer2" #define GIMP_MAINIMAGE_LAYER2_NAME "layer2"
#define GIMP_MAINIMAGE_LAYER2_WIDTH 25 #define GIMP_MAINIMAGE_LAYER2_WIDTH 25
#define GIMP_MAINIMAGE_LAYER2_HEIGHT 251 #define GIMP_MAINIMAGE_LAYER2_HEIGHT 251
#define GIMP_MAINIMAGE_LAYER2_FORMAT babl_format ("R'G'B' u8") #define GIMP_MAINIMAGE_LAYER2_FORMAT babl_format ("R'G'B' u8")
#define GIMP_MAINIMAGE_LAYER2_OPACITY 0.0 #define GIMP_MAINIMAGE_LAYER2_OPACITY GIMP_OPACITY_TRANSPARENT
#define GIMP_MAINIMAGE_LAYER2_MODE GIMP_MULTIPLY_MODE #define GIMP_MAINIMAGE_LAYER2_MODE GIMP_LAYER_MODE_MULTIPLY_BROKEN
#define GIMP_MAINIMAGE_GROUP1_NAME "group1" #define GIMP_MAINIMAGE_GROUP1_NAME "group1"

View File

@ -918,7 +918,7 @@ gimp_warp_tool_animate (GimpWarpTool *wt)
gimp_item_set_offset (GIMP_ITEM (layer), 0, 0); gimp_item_set_offset (GIMP_ITEM (layer), 0, 0);
gimp_item_set_visible (GIMP_ITEM (layer), TRUE, FALSE); gimp_item_set_visible (GIMP_ITEM (layer), TRUE, FALSE);
gimp_layer_set_mode (layer, GIMP_NORMAL_MODE, FALSE); gimp_layer_set_mode (layer, GIMP_LAYER_MODE_NORMAL, FALSE);
gimp_layer_set_opacity (layer, GIMP_OPACITY_OPAQUE, FALSE); gimp_layer_set_opacity (layer, GIMP_OPACITY_OPAQUE, FALSE);
gimp_image_add_layer (image, layer, NULL, 0, FALSE); gimp_image_add_layer (image, layer, NULL, 0, FALSE);

View File

@ -69,7 +69,7 @@ static void gimp_brush_select_opacity_changed (GimpContext *context
gdouble opacity, gdouble opacity,
GimpBrushSelect *select); GimpBrushSelect *select);
static void gimp_brush_select_mode_changed (GimpContext *context, static void gimp_brush_select_mode_changed (GimpContext *context,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpBrushSelect *select); GimpBrushSelect *select);
static void gimp_brush_select_opacity_update (GtkAdjustment *adj, static void gimp_brush_select_opacity_update (GtkAdjustment *adj,
@ -106,8 +106,8 @@ gimp_brush_select_class_init (GimpBrushSelectClass *klass)
g_object_class_install_property (object_class, PROP_PAINT_MODE, g_object_class_install_property (object_class, PROP_PAINT_MODE,
g_param_spec_enum ("paint-mode", NULL, NULL, g_param_spec_enum ("paint-mode", NULL, NULL,
GIMP_TYPE_LAYER_MODE_EFFECTS, GIMP_TYPE_LAYER_MODE,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_WRITABLE | GIMP_PARAM_WRITABLE |
G_PARAM_CONSTRUCT)); G_PARAM_CONSTRUCT));
@ -307,9 +307,9 @@ gimp_brush_select_opacity_changed (GimpContext *context,
} }
static void static void
gimp_brush_select_mode_changed (GimpContext *context, gimp_brush_select_mode_changed (GimpContext *context,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpBrushSelect *select) GimpBrushSelect *select)
{ {
g_signal_handlers_block_by_func (select->paint_mode_menu, g_signal_handlers_block_by_func (select->paint_mode_menu,
gimp_brush_select_mode_update, gimp_brush_select_mode_update,
@ -343,7 +343,7 @@ gimp_brush_select_mode_update (GtkWidget *widget,
&paint_mode)) &paint_mode))
{ {
gimp_context_set_paint_mode (GIMP_PDB_DIALOG (select)->context, gimp_context_set_paint_mode (GIMP_PDB_DIALOG (select)->context,
(GimpLayerModeEffects) paint_mode); (GimpLayerMode) paint_mode);
} }
} }

View File

@ -38,14 +38,14 @@ typedef struct _GimpBrushSelectClass GimpBrushSelectClass;
struct _GimpBrushSelect struct _GimpBrushSelect
{ {
GimpPdbDialog parent_instance; GimpPdbDialog parent_instance;
gdouble initial_opacity; gdouble initial_opacity;
GimpLayerModeEffects initial_mode; GimpLayerMode initial_mode;
gint spacing; gint spacing;
GtkAdjustment *opacity_data; GtkAdjustment *opacity_data;
GtkWidget *paint_mode_menu; GtkWidget *paint_mode_menu;
}; };
struct _GimpBrushSelectClass struct _GimpBrushSelectClass

View File

@ -271,7 +271,7 @@ gimp_layer_tree_view_init (GimpLayerTreeView *view)
NULL, view->priv->paint_mode_menu); NULL, view->priv->paint_mode_menu);
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (view->priv->paint_mode_menu), gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (view->priv->paint_mode_menu),
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
G_CALLBACK (gimp_layer_tree_view_paint_mode_menu_callback), G_CALLBACK (gimp_layer_tree_view_paint_mode_menu_callback),
view); view);
@ -808,7 +808,8 @@ gimp_layer_tree_view_drop_pixbuf (GimpContainerTreeView *tree_view,
gimp_layer_new_from_pixbuf (pixbuf, image, gimp_layer_new_from_pixbuf (pixbuf, image,
gimp_image_get_layer_format (image, TRUE), gimp_image_get_layer_format (image, TRUE),
_("Dropped Buffer"), _("Dropped Buffer"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
gimp_image_add_layer (image, new_layer, parent, index, TRUE); gimp_image_add_layer (image, new_layer, parent, index, TRUE);
@ -848,7 +849,9 @@ gimp_layer_tree_view_item_new (GimpImage *image)
gimp_image_get_width (image), gimp_image_get_width (image),
gimp_image_get_height (image), gimp_image_get_height (image),
gimp_image_get_layer_format (image, TRUE), gimp_image_get_layer_format (image, TRUE),
NULL, 1.0, GIMP_NORMAL_MODE); NULL,
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_NORMAL);
gimp_image_add_layer (image, new_layer, gimp_image_add_layer (image, new_layer,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE); GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
@ -938,7 +941,7 @@ gimp_layer_tree_view_paint_mode_menu_callback (GtkWidget *widget,
if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget),
&mode) && &mode) &&
gimp_layer_get_mode (layer) != (GimpLayerModeEffects) mode) gimp_layer_get_mode (layer) != (GimpLayerMode) mode)
{ {
GimpUndo *undo; GimpUndo *undo;
gboolean push_undo = TRUE; gboolean push_undo = TRUE;
@ -951,7 +954,7 @@ gimp_layer_tree_view_paint_mode_menu_callback (GtkWidget *widget,
push_undo = FALSE; push_undo = FALSE;
BLOCK(); BLOCK();
gimp_layer_set_mode (layer, (GimpLayerModeEffects) mode, push_undo); gimp_layer_set_mode (layer, (GimpLayerMode) mode, push_undo);
UNBLOCK(); UNBLOCK();
gimp_image_flush (image); gimp_image_flush (image);

View File

@ -103,79 +103,79 @@ gimp_paint_mode_menu_new (gboolean with_behind_mode,
GtkListStore *store; GtkListStore *store;
GtkWidget *combo; GtkWidget *combo;
store = gimp_enum_store_new_with_values (GIMP_TYPE_LAYER_MODE_EFFECTS, store = gimp_enum_store_new_with_values (GIMP_TYPE_LAYER_MODE,
25, 25,
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_DISSOLVE_MODE, GIMP_LAYER_MODE_DISSOLVE,
GIMP_LIGHTEN_ONLY_MODE, GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN,
GIMP_SCREEN_MODE, GIMP_LAYER_MODE_SCREEN_BROKEN,
GIMP_DODGE_MODE, GIMP_LAYER_MODE_DODGE_BROKEN,
GIMP_ADDITION_MODE, GIMP_LAYER_MODE_ADDITION_BROKEN,
GIMP_DARKEN_ONLY_MODE, GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN,
GIMP_MULTIPLY_MODE, GIMP_LAYER_MODE_MULTIPLY_BROKEN,
GIMP_BURN_MODE, GIMP_LAYER_MODE_BURN_BROKEN,
GIMP_NEW_OVERLAY_MODE, GIMP_LAYER_MODE_OVERLAY,
GIMP_SOFTLIGHT_MODE, GIMP_LAYER_MODE_SOFTLIGHT_BROKEN,
GIMP_HARDLIGHT_MODE, GIMP_LAYER_MODE_HARDLIGHT_BROKEN,
GIMP_DIFFERENCE_MODE, GIMP_LAYER_MODE_DIFFERENCE_BROKEN,
GIMP_SUBTRACT_MODE, GIMP_LAYER_MODE_SUBTRACT_BROKEN,
GIMP_GRAIN_EXTRACT_MODE, GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN,
GIMP_GRAIN_MERGE_MODE, GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN,
GIMP_DIVIDE_MODE, GIMP_LAYER_MODE_DIVIDE_BROKEN,
GIMP_HUE_MODE, GIMP_LAYER_MODE_HSV_HUE_BROKEN,
GIMP_SATURATION_MODE, GIMP_LAYER_MODE_HSV_SATURATION_BROKEN,
GIMP_COLOR_MODE, GIMP_LAYER_MODE_HSV_COLOR_BROKEN,
GIMP_VALUE_MODE, GIMP_LAYER_MODE_HSV_VALUE_BROKEN,
GIMP_LCH_HUE_MODE, GIMP_LAYER_MODE_LCH_HUE,
GIMP_LCH_CHROMA_MODE, GIMP_LAYER_MODE_LCH_CHROMA,
GIMP_LCH_COLOR_MODE, GIMP_LAYER_MODE_LCH_COLOR,
GIMP_LCH_LIGHTNESS_MODE); GIMP_LAYER_MODE_LCH_LIGHTNESS);
gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
GIMP_DISSOLVE_MODE, -1); GIMP_LAYER_MODE_DISSOLVE, -1);
gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
GIMP_ADDITION_MODE, -1); GIMP_LAYER_MODE_ADDITION_BROKEN, -1);
gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
GIMP_BURN_MODE, -1); GIMP_LAYER_MODE_BURN_BROKEN, -1);
gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
GIMP_HARDLIGHT_MODE, -1); GIMP_LAYER_MODE_HARDLIGHT_BROKEN, -1);
gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
GIMP_DIVIDE_MODE, -1); GIMP_LAYER_MODE_DIVIDE_BROKEN, -1);
gimp_int_store_insert_separator_after (GIMP_INT_STORE (store), gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
GIMP_VALUE_MODE, -1); GIMP_LAYER_MODE_HSV_VALUE_BROKEN, -1);
if (with_behind_mode) if (with_behind_mode)
{ {
gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store), gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store),
GIMP_DISSOLVE_MODE, GIMP_LAYER_MODE_DISSOLVE,
GIMP_BEHIND_MODE); GIMP_LAYER_MODE_BEHIND);
gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store), gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store),
GIMP_BEHIND_MODE, GIMP_LAYER_MODE_BEHIND,
GIMP_COLOR_ERASE_MODE); GIMP_LAYER_MODE_COLOR_ERASE);
} }
if (with_replace_modes) if (with_replace_modes)
{ {
gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store), gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store),
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_REPLACE_MODE); GIMP_LAYER_MODE_REPLACE);
gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store), gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store),
GIMP_COLOR_ERASE_MODE, GIMP_LAYER_MODE_COLOR_ERASE,
GIMP_ERASE_MODE); GIMP_LAYER_MODE_ERASE);
gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store), gimp_enum_store_insert_value_after (GIMP_ENUM_STORE (store),
GIMP_ERASE_MODE, GIMP_LAYER_MODE_ERASE,
GIMP_ANTI_ERASE_MODE); GIMP_LAYER_MODE_ANTI_ERASE);
} }
combo = gimp_enum_combo_box_new_with_model (GIMP_ENUM_STORE (store)); combo = gimp_enum_combo_box_new_with_model (GIMP_ENUM_STORE (store));

View File

@ -1093,10 +1093,10 @@ xcf_load_layer_props (XcfInfo *info,
info->cp += xcf_read_int32 (info->input, &mode, 1); info->cp += xcf_read_int32 (info->input, &mode, 1);
if (mode == GIMP_OVERLAY_MODE) if (mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
mode = GIMP_SOFTLIGHT_MODE; mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
gimp_layer_set_mode (*layer, (GimpLayerModeEffects) mode, FALSE); gimp_layer_set_mode (*layer, (GimpLayerMode) mode, FALSE);
} }
break; break;
@ -1525,7 +1525,7 @@ xcf_load_layer (XcfInfo *info,
/* create a new layer */ /* create a new layer */
layer = gimp_layer_new (image, width, height, layer = gimp_layer_new (image, width, height,
format, name, 255, GIMP_NORMAL_MODE); format, name, 255, GIMP_LAYER_MODE_NORMAL);
g_free (name); g_free (name);
if (! layer) if (! layer)
return NULL; return NULL;

View File

@ -726,8 +726,8 @@ xcf_save_prop (XcfInfo *info,
mode = va_arg (args, gint32); mode = va_arg (args, gint32);
size = 4; size = 4;
if (mode == GIMP_OVERLAY_MODE) if (mode == GIMP_LAYER_MODE_OVERLAY_BROKEN)
mode = GIMP_SOFTLIGHT_MODE; mode = GIMP_LAYER_MODE_SOFTLIGHT_BROKEN;
xcf_write_prop_type_check_error (info, prop_type); xcf_write_prop_type_check_error (info, prop_type);
xcf_write_int32_check_error (info, &size, 1); xcf_write_int32_check_error (info, &size, 1);

View File

@ -604,7 +604,7 @@ EXPORTS
gimp_layer_get_show_mask gimp_layer_get_show_mask
gimp_layer_group_new gimp_layer_group_new
gimp_layer_is_floating_sel gimp_layer_is_floating_sel
gimp_layer_mode_effects_get_type gimp_layer_mode_get_type
gimp_layer_new gimp_layer_new
gimp_layer_new_from_drawable gimp_layer_new_from_drawable
gimp_layer_new_from_pixbuf gimp_layer_new_from_pixbuf

View File

@ -59,7 +59,7 @@ gimp_brushes_set_opacity (gdouble opacity)
* *
* Returns: The paint mode. * Returns: The paint mode.
*/ */
GimpLayerModeEffects GimpLayerMode
gimp_brushes_get_paint_mode (void) gimp_brushes_get_paint_mode (void)
{ {
return gimp_context_get_paint_mode (); return gimp_context_get_paint_mode ();
@ -74,7 +74,7 @@ gimp_brushes_get_paint_mode (void)
* Returns: TRUE on success. * Returns: TRUE on success.
*/ */
gboolean gboolean
gimp_brushes_set_paint_mode (GimpLayerModeEffects paint_mode) gimp_brushes_set_paint_mode (GimpLayerMode paint_mode)
{ {
return gimp_context_set_paint_mode (paint_mode); return gimp_context_set_paint_mode (paint_mode);
} }

View File

@ -30,15 +30,15 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */ /* For information look into the C source or the html documentation */
GIMP_DEPRECATED_FOR(gimp_context_get_opacity) GIMP_DEPRECATED_FOR(gimp_context_get_opacity)
gdouble gimp_brushes_get_opacity (void); gdouble gimp_brushes_get_opacity (void);
GIMP_DEPRECATED_FOR(gimp_context_set_opacity) GIMP_DEPRECATED_FOR(gimp_context_set_opacity)
gboolean gimp_brushes_set_opacity (gdouble opacity); gboolean gimp_brushes_set_opacity (gdouble opacity);
GIMP_DEPRECATED_FOR(gimp_context_get_paint_mode) GIMP_DEPRECATED_FOR(gimp_context_get_paint_mode)
GimpLayerModeEffects gimp_brushes_get_paint_mode (void); GimpLayerMode gimp_brushes_get_paint_mode (void);
GIMP_DEPRECATED_FOR(gimp_context_set_paint_mode) GIMP_DEPRECATED_FOR(gimp_context_set_paint_mode)
gboolean gimp_brushes_set_paint_mode (GimpLayerModeEffects paint_mode); gboolean gimp_brushes_set_paint_mode (GimpLayerMode paint_mode);
GIMP_DEPRECATED_FOR(gimp_context_set_brush) GIMP_DEPRECATED_FOR(gimp_context_set_brush)
gboolean gimp_brushes_set_brush (const gchar *name); gboolean gimp_brushes_set_brush (const gchar *name);
G_END_DECLS G_END_DECLS

View File

@ -215,14 +215,14 @@ gimp_brushes_set_spacing (gint spacing)
* Returns: The brush name. * Returns: The brush name.
**/ **/
gchar * gchar *
gimp_brushes_get_brush_data (const gchar *name, gimp_brushes_get_brush_data (const gchar *name,
gdouble *opacity, gdouble *opacity,
gint *spacing, gint *spacing,
GimpLayerModeEffects *paint_mode, GimpLayerMode *paint_mode,
gint *width, gint *width,
gint *height, gint *height,
gint *length, gint *length,
guint8 **mask_data) guint8 **mask_data)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;

View File

@ -33,25 +33,25 @@ G_BEGIN_DECLS
gboolean gimp_brushes_refresh (void); gboolean gimp_brushes_refresh (void);
gchar** gimp_brushes_get_list (const gchar *filter, gchar** gimp_brushes_get_list (const gchar *filter,
gint *num_brushes); gint *num_brushes);
GIMP_DEPRECATED_FOR(gimp_context_get_brush) GIMP_DEPRECATED_FOR(gimp_context_get_brush)
gchar* gimp_brushes_get_brush (gint *width, gchar* gimp_brushes_get_brush (gint *width,
gint *height, gint *height,
gint *spacing); gint *spacing);
GIMP_DEPRECATED_FOR(gimp_brush_get_spacing) GIMP_DEPRECATED_FOR(gimp_brush_get_spacing)
gint gimp_brushes_get_spacing (void); gint gimp_brushes_get_spacing (void);
GIMP_DEPRECATED_FOR(gimp_brush_set_spacing) GIMP_DEPRECATED_FOR(gimp_brush_set_spacing)
gboolean gimp_brushes_set_spacing (gint spacing); gboolean gimp_brushes_set_spacing (gint spacing);
GIMP_DEPRECATED_FOR(gimp_brush_get_pixels) GIMP_DEPRECATED_FOR(gimp_brush_get_pixels)
gchar* gimp_brushes_get_brush_data (const gchar *name, gchar* gimp_brushes_get_brush_data (const gchar *name,
gdouble *opacity, gdouble *opacity,
gint *spacing, gint *spacing,
GimpLayerModeEffects *paint_mode, GimpLayerMode *paint_mode,
gint *width, gint *width,
gint *height, gint *height,
gint *length, gint *length,
guint8 **mask_data); guint8 **mask_data);
G_END_DECLS G_END_DECLS

View File

@ -50,7 +50,7 @@ static void compat_callback (GimpBrushSelectButton *brush_button,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gint width, gint width,
gint height, gint height,
const guchar *mask_data, const guchar *mask_data,
@ -80,7 +80,7 @@ gimp_brush_select_widget_new (const gchar *title,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpRunBrushCallback callback, GimpRunBrushCallback callback,
gpointer data) gpointer data)
{ {
@ -132,11 +132,11 @@ gimp_brush_select_widget_close (GtkWidget *widget)
* call to gimp_brush_select_widget_new(). * call to gimp_brush_select_widget_new().
*/ */
void void
gimp_brush_select_widget_set (GtkWidget *widget, gimp_brush_select_widget_set (GtkWidget *widget,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
g_return_if_fail (widget != NULL); g_return_if_fail (widget != NULL);
@ -150,7 +150,7 @@ compat_callback (GimpBrushSelectButton *brush_button,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gint width, gint width,
gint height, gint height,
const guchar *mask_data, const guchar *mask_data,

View File

@ -36,7 +36,7 @@ GtkWidget * gimp_brush_select_widget_new (const gchar *title,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpRunBrushCallback callback, GimpRunBrushCallback callback,
gpointer data); gpointer data);
@ -47,7 +47,7 @@ void gimp_brush_select_widget_set (GtkWidget *widget,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
G_END_DECLS G_END_DECLS

View File

@ -64,7 +64,7 @@ gimp_brush_select_new (const gchar *title,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpRunBrushCallback callback, GimpRunBrushCallback callback,
gpointer data) gpointer data)
{ {

View File

@ -31,7 +31,7 @@ G_BEGIN_DECLS
typedef void (* GimpRunBrushCallback) (const gchar *brush_name, typedef void (* GimpRunBrushCallback) (const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gint width, gint width,
gint height, gint height,
const guchar *mask_data, const guchar *mask_data,
@ -43,7 +43,7 @@ const gchar * gimp_brush_select_new (const gchar *title,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpRunBrushCallback callback, GimpRunBrushCallback callback,
gpointer data); gpointer data);
void gimp_brush_select_destroy (const gchar *brush_callback); void gimp_brush_select_destroy (const gchar *brush_callback);

View File

@ -50,12 +50,12 @@
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_brushes_popup (const gchar *brush_callback, gimp_brushes_popup (const gchar *brush_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_brush, const gchar *initial_brush,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
@ -122,11 +122,11 @@ gimp_brushes_close_popup (const gchar *brush_callback)
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_brushes_set_popup (const gchar *brush_callback, gimp_brushes_set_popup (const gchar *brush_callback,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;

View File

@ -32,18 +32,18 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */ /* For information look into the C source or the html documentation */
gboolean gimp_brushes_popup (const gchar *brush_callback, gboolean gimp_brushes_popup (const gchar *brush_callback,
const gchar *popup_title, const gchar *popup_title,
const gchar *initial_brush, const gchar *initial_brush,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
gboolean gimp_brushes_close_popup (const gchar *brush_callback); gboolean gimp_brushes_close_popup (const gchar *brush_callback);
gboolean gimp_brushes_set_popup (const gchar *brush_callback, gboolean gimp_brushes_set_popup (const gchar *brush_callback,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
G_END_DECLS G_END_DECLS

View File

@ -53,19 +53,19 @@ typedef struct _GimpBrushSelectButtonPrivate GimpBrushSelectButtonPrivate;
struct _GimpBrushSelectButtonPrivate struct _GimpBrushSelectButtonPrivate
{ {
gchar *title; gchar *title;
gchar *brush_name; /* Local copy */ gchar *brush_name; /* Local copy */
gdouble opacity; gdouble opacity;
gint spacing; gint spacing;
GimpLayerModeEffects paint_mode; GimpLayerMode paint_mode;
gint width; gint width;
gint height; gint height;
guchar *mask_data; /* local copy */ guchar *mask_data; /* local copy */
GtkWidget *inside; GtkWidget *inside;
GtkWidget *preview; GtkWidget *preview;
GtkWidget *popup; GtkWidget *popup;
}; };
enum enum
@ -103,7 +103,7 @@ static void gimp_brush_select_button_clicked (GimpBrushSelectButton *button);
static void gimp_brush_select_button_callback (const gchar *brush_name, static void gimp_brush_select_button_callback (const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gint width, gint width,
gint height, gint height,
const guchar *mask_data, const guchar *mask_data,
@ -225,7 +225,7 @@ gimp_brush_select_button_class_init (GimpBrushSelectButtonClass *klass)
/** /**
* GimpBrushSelectButton:paint-mode: * GimpBrushSelectButton:paint-mode:
* *
* The name of the currently selected brush. * The paint mode.
* *
* Since: 2.4 * Since: 2.4
*/ */
@ -233,7 +233,7 @@ gimp_brush_select_button_class_init (GimpBrushSelectButtonClass *klass)
g_param_spec_int ("brush-paint-mode", g_param_spec_int ("brush-paint-mode",
"Brush paint mode", "Brush paint mode",
"The paint mode of the currently selected brush", "The paint mode of the currently selected brush",
-1, GIMP_COLOR_ERASE_MODE, -1, GIMP_LAYER_MODE_LCH_LIGHTNESS,
-1, -1,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
@ -324,11 +324,11 @@ gimp_brush_select_button_init (GimpBrushSelectButton *button)
* Since: 2.4 * Since: 2.4
*/ */
GtkWidget * GtkWidget *
gimp_brush_select_button_new (const gchar *title, gimp_brush_select_button_new (const gchar *title,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
GtkWidget *button; GtkWidget *button;
@ -368,7 +368,7 @@ const gchar *
gimp_brush_select_button_get_brush (GimpBrushSelectButton *button, gimp_brush_select_button_get_brush (GimpBrushSelectButton *button,
gdouble *opacity, gdouble *opacity,
gint *spacing, gint *spacing,
GimpLayerModeEffects *paint_mode) GimpLayerMode *paint_mode)
{ {
GimpBrushSelectButtonPrivate *priv; GimpBrushSelectButtonPrivate *priv;
@ -406,7 +406,7 @@ gimp_brush_select_button_set_brush (GimpBrushSelectButton *button,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode) GimpLayerMode paint_mode)
{ {
GimpSelectButton *select_button; GimpSelectButton *select_button;
@ -572,15 +572,15 @@ gimp_brush_select_button_get_property (GObject *object,
} }
static void static void
gimp_brush_select_button_callback (const gchar *name, gimp_brush_select_button_callback (const gchar *name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gint width, gint width,
gint height, gint height,
const guchar *mask_data, const guchar *mask_data,
gboolean dialog_closing, gboolean dialog_closing,
gpointer data) gpointer data)
{ {
GimpBrushSelectButton *button; GimpBrushSelectButton *button;
GimpBrushSelectButtonPrivate *priv; GimpBrushSelectButtonPrivate *priv;

View File

@ -56,7 +56,7 @@ struct _GimpBrushSelectButtonClass
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gint width, gint width,
gint height, gint height,
const guchar *mask_data, const guchar *mask_data,
@ -76,17 +76,17 @@ GtkWidget * gimp_brush_select_button_new (const gchar *title,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
const gchar * gimp_brush_select_button_get_brush (GimpBrushSelectButton *button, const gchar * gimp_brush_select_button_get_brush (GimpBrushSelectButton *button,
gdouble *opacity, gdouble *opacity,
gint *spacing, gint *spacing,
GimpLayerModeEffects *paint_mode); GimpLayerMode *paint_mode);
void gimp_brush_select_button_set_brush (GimpBrushSelectButton *button, void gimp_brush_select_button_set_brush (GimpBrushSelectButton *button,
const gchar *brush_name, const gchar *brush_name,
gdouble opacity, gdouble opacity,
gint spacing, gint spacing,
GimpLayerModeEffects paint_mode); GimpLayerMode paint_mode);
G_END_DECLS G_END_DECLS

View File

@ -585,12 +585,12 @@ gimp_context_set_opacity (gdouble opacity)
* *
* Since: 2.2 * Since: 2.2
**/ **/
GimpLayerModeEffects GimpLayerMode
gimp_context_get_paint_mode (void) gimp_context_get_paint_mode (void)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
GimpLayerModeEffects paint_mode = 0; GimpLayerMode paint_mode = 0;
return_vals = gimp_run_procedure ("gimp-context-get-paint-mode", return_vals = gimp_run_procedure ("gimp-context-get-paint-mode",
&nreturn_vals, &nreturn_vals,
@ -617,7 +617,7 @@ gimp_context_get_paint_mode (void)
* Since: 2.2 * Since: 2.2
**/ **/
gboolean gboolean
gimp_context_set_paint_mode (GimpLayerModeEffects paint_mode) gimp_context_set_paint_mode (GimpLayerMode paint_mode)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;

View File

@ -49,8 +49,8 @@ gboolean gimp_context_set_default_colors (void);
gboolean gimp_context_swap_colors (void); gboolean gimp_context_swap_colors (void);
gdouble gimp_context_get_opacity (void); gdouble gimp_context_get_opacity (void);
gboolean gimp_context_set_opacity (gdouble opacity); gboolean gimp_context_set_opacity (gdouble opacity);
GimpLayerModeEffects gimp_context_get_paint_mode (void); GimpLayerMode gimp_context_get_paint_mode (void);
gboolean gimp_context_set_paint_mode (GimpLayerModeEffects paint_mode); gboolean gimp_context_set_paint_mode (GimpLayerMode paint_mode);
gdouble gimp_context_get_line_width (void); gdouble gimp_context_get_line_width (void);
gboolean gimp_context_set_line_width (gdouble line_width); gboolean gimp_context_set_line_width (gdouble line_width);
GimpUnit gimp_context_get_line_width_unit (void); GimpUnit gimp_context_get_line_width_unit (void);

View File

@ -517,14 +517,14 @@ gimp_edit_fill (gint32 drawable_ID,
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_edit_bucket_fill (gint32 drawable_ID, gimp_edit_bucket_fill (gint32 drawable_ID,
GimpBucketFillMode fill_mode, GimpBucketFillMode fill_mode,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gdouble opacity, gdouble opacity,
gdouble threshold, gdouble threshold,
gboolean sample_merged, gboolean sample_merged,
gdouble x, gdouble x,
gdouble y) gdouble y)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
@ -583,16 +583,16 @@ gimp_edit_bucket_fill (gint32 drawable_ID,
* Since: 2.4 * Since: 2.4
**/ **/
gboolean gboolean
gimp_edit_bucket_fill_full (gint32 drawable_ID, gimp_edit_bucket_fill_full (gint32 drawable_ID,
GimpBucketFillMode fill_mode, GimpBucketFillMode fill_mode,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gdouble opacity, gdouble opacity,
gdouble threshold, gdouble threshold,
gboolean sample_merged, gboolean sample_merged,
gboolean fill_transparent, gboolean fill_transparent,
GimpSelectCriterion select_criterion, GimpSelectCriterion select_criterion,
gdouble x, gdouble x,
gdouble y) gdouble y)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
@ -649,22 +649,22 @@ gimp_edit_bucket_fill_full (gint32 drawable_ID,
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_edit_blend (gint32 drawable_ID, gimp_edit_blend (gint32 drawable_ID,
GimpBlendMode blend_mode, GimpBlendMode blend_mode,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpGradientType gradient_type, GimpGradientType gradient_type,
gdouble opacity, gdouble opacity,
gdouble offset, gdouble offset,
GimpRepeatMode repeat, GimpRepeatMode repeat,
gboolean reverse, gboolean reverse,
gboolean supersample, gboolean supersample,
gint max_depth, gint max_depth,
gdouble threshold, gdouble threshold,
gboolean dither, gboolean dither,
gdouble x1, gdouble x1,
gdouble y1, gdouble y1,
gdouble x2, gdouble x2,
gdouble y2) gdouble y2)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;

View File

@ -32,62 +32,62 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */ /* For information look into the C source or the html documentation */
gboolean gimp_edit_cut (gint32 drawable_ID); gboolean gimp_edit_cut (gint32 drawable_ID);
gboolean gimp_edit_copy (gint32 drawable_ID); gboolean gimp_edit_copy (gint32 drawable_ID);
gboolean gimp_edit_copy_visible (gint32 image_ID); gboolean gimp_edit_copy_visible (gint32 image_ID);
gint32 gimp_edit_paste (gint32 drawable_ID, gint32 gimp_edit_paste (gint32 drawable_ID,
gboolean paste_into); gboolean paste_into);
gint32 gimp_edit_paste_as_new_image (void); gint32 gimp_edit_paste_as_new_image (void);
gchar* gimp_edit_named_cut (gint32 drawable_ID, gchar* gimp_edit_named_cut (gint32 drawable_ID,
const gchar *buffer_name); const gchar *buffer_name);
gchar* gimp_edit_named_copy (gint32 drawable_ID, gchar* gimp_edit_named_copy (gint32 drawable_ID,
const gchar *buffer_name); const gchar *buffer_name);
gchar* gimp_edit_named_copy_visible (gint32 image_ID, gchar* gimp_edit_named_copy_visible (gint32 image_ID,
const gchar *buffer_name); const gchar *buffer_name);
gint32 gimp_edit_named_paste (gint32 drawable_ID, gint32 gimp_edit_named_paste (gint32 drawable_ID,
const gchar *buffer_name, const gchar *buffer_name,
gboolean paste_into); gboolean paste_into);
gint32 gimp_edit_named_paste_as_new_image (const gchar *buffer_name); gint32 gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
gboolean gimp_edit_clear (gint32 drawable_ID); gboolean gimp_edit_clear (gint32 drawable_ID);
gboolean gimp_edit_fill (gint32 drawable_ID, gboolean gimp_edit_fill (gint32 drawable_ID,
GimpFillType fill_type); GimpFillType fill_type);
gboolean gimp_edit_bucket_fill (gint32 drawable_ID, gboolean gimp_edit_bucket_fill (gint32 drawable_ID,
GimpBucketFillMode fill_mode, GimpBucketFillMode fill_mode,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gdouble opacity, gdouble opacity,
gdouble threshold, gdouble threshold,
gboolean sample_merged, gboolean sample_merged,
gdouble x, gdouble x,
gdouble y); gdouble y);
gboolean gimp_edit_bucket_fill_full (gint32 drawable_ID, gboolean gimp_edit_bucket_fill_full (gint32 drawable_ID,
GimpBucketFillMode fill_mode, GimpBucketFillMode fill_mode,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
gdouble opacity, gdouble opacity,
gdouble threshold, gdouble threshold,
gboolean sample_merged, gboolean sample_merged,
gboolean fill_transparent, gboolean fill_transparent,
GimpSelectCriterion select_criterion, GimpSelectCriterion select_criterion,
gdouble x, gdouble x,
gdouble y); gdouble y);
gboolean gimp_edit_blend (gint32 drawable_ID, gboolean gimp_edit_blend (gint32 drawable_ID,
GimpBlendMode blend_mode, GimpBlendMode blend_mode,
GimpLayerModeEffects paint_mode, GimpLayerMode paint_mode,
GimpGradientType gradient_type, GimpGradientType gradient_type,
gdouble opacity, gdouble opacity,
gdouble offset, gdouble offset,
GimpRepeatMode repeat, GimpRepeatMode repeat,
gboolean reverse, gboolean reverse,
gboolean supersample, gboolean supersample,
gint max_depth, gint max_depth,
gdouble threshold, gdouble threshold,
gboolean dither, gboolean dither,
gdouble x1, gdouble x1,
gdouble y1, gdouble y1,
gdouble x2, gdouble x2,
gdouble y2); gdouble y2);
gboolean gimp_edit_stroke (gint32 drawable_ID); gboolean gimp_edit_stroke (gint32 drawable_ID);
gboolean gimp_edit_stroke_vectors (gint32 drawable_ID, gboolean gimp_edit_stroke_vectors (gint32 drawable_ID,
gint32 vectors_ID); gint32 vectors_ID);
G_END_DECLS G_END_DECLS

View File

@ -35,7 +35,7 @@ static const GimpGetTypeFunc get_type_funcs[] =
gimp_ink_blob_type_get_type, gimp_ink_blob_type_get_type,
gimp_interpolation_type_get_type, gimp_interpolation_type_get_type,
gimp_join_style_get_type, gimp_join_style_get_type,
gimp_layer_mode_effects_get_type, gimp_layer_mode_get_type,
gimp_mask_apply_mode_get_type, gimp_mask_apply_mode_get_type,
gimp_merge_type_get_type, gimp_merge_type_get_type,
gimp_message_handler_type_get_type, gimp_message_handler_type_get_type,
@ -99,7 +99,7 @@ static const gchar * const type_names[] =
"GimpInkBlobType", "GimpInkBlobType",
"GimpInterpolationType", "GimpInterpolationType",
"GimpJoinStyle", "GimpJoinStyle",
"GimpLayerModeEffects", "GimpLayerMode",
"GimpMaskApplyMode", "GimpMaskApplyMode",
"GimpMergeType", "GimpMergeType",
"GimpMessageHandlerType", "GimpMessageHandlerType",
@ -146,6 +146,7 @@ void
gimp_enums_init (void) gimp_enums_init (void)
{ {
const GimpGetTypeFunc *funcs = get_type_funcs; const GimpGetTypeFunc *funcs = get_type_funcs;
GQuark quark;
gint i; gint i;
if (enums_initialized) if (enums_initialized)
@ -158,6 +159,12 @@ gimp_enums_init (void)
g_type_class_ref (type); g_type_class_ref (type);
} }
/* keep compat enum code in sync with app/app.c (app_libs_init) */
quark = g_quark_from_static_string ("gimp-compat-enum");
g_type_set_qdata (GIMP_TYPE_LAYER_MODE, quark,
(gpointer) GIMP_TYPE_LAYER_MODE_EFFECTS);
enums_initialized = TRUE; enums_initialized = TRUE;
} }

View File

@ -63,41 +63,41 @@ typedef enum
} GimpHistogramChannel; } 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 typedef enum
{ {
GIMP_NORMAL_MODE, GIMP_LAYER_MODE_NORMAL,
GIMP_DISSOLVE_MODE, GIMP_LAYER_MODE_DISSOLVE,
GIMP_BEHIND_MODE, GIMP_LAYER_MODE_BEHIND,
GIMP_MULTIPLY_MODE, GIMP_LAYER_MODE_MULTIPLY_BROKEN,
GIMP_SCREEN_MODE, GIMP_LAYER_MODE_SCREEN_BROKEN,
GIMP_OVERLAY_MODE, GIMP_LAYER_MODE_OVERLAY_BROKEN,
GIMP_DIFFERENCE_MODE, GIMP_LAYER_MODE_DIFFERENCE_BROKEN,
GIMP_ADDITION_MODE, GIMP_LAYER_MODE_ADDITION_BROKEN,
GIMP_SUBTRACT_MODE, GIMP_LAYER_MODE_SUBTRACT_BROKEN,
GIMP_DARKEN_ONLY_MODE, GIMP_LAYER_MODE_DARKEN_ONLY_BROKEN,
GIMP_LIGHTEN_ONLY_MODE, GIMP_LAYER_MODE_LIGHTEN_ONLY_BROKEN,
GIMP_HUE_MODE, GIMP_LAYER_MODE_HSV_HUE_BROKEN,
GIMP_SATURATION_MODE, GIMP_LAYER_MODE_HSV_SATURATION_BROKEN,
GIMP_COLOR_MODE, GIMP_LAYER_MODE_HSV_COLOR_BROKEN,
GIMP_VALUE_MODE, GIMP_LAYER_MODE_HSV_VALUE_BROKEN,
GIMP_DIVIDE_MODE, GIMP_LAYER_MODE_DIVIDE_BROKEN,
GIMP_DODGE_MODE, GIMP_LAYER_MODE_DODGE_BROKEN,
GIMP_BURN_MODE, GIMP_LAYER_MODE_BURN_BROKEN,
GIMP_HARDLIGHT_MODE, GIMP_LAYER_MODE_HARDLIGHT_BROKEN,
GIMP_SOFTLIGHT_MODE, GIMP_LAYER_MODE_SOFTLIGHT_BROKEN,
GIMP_GRAIN_EXTRACT_MODE, GIMP_LAYER_MODE_GRAIN_EXTRACT_BROKEN,
GIMP_GRAIN_MERGE_MODE, GIMP_LAYER_MODE_GRAIN_MERGE_BROKEN,
GIMP_COLOR_ERASE_MODE, GIMP_LAYER_MODE_COLOR_ERASE,
GIMP_NEW_OVERLAY_MODE, GIMP_LAYER_MODE_OVERLAY,
GIMP_LCH_HUE_MODE, GIMP_LAYER_MODE_LCH_HUE,
GIMP_LCH_CHROMA_MODE, GIMP_LAYER_MODE_LCH_CHROMA,
GIMP_LCH_COLOR_MODE, GIMP_LAYER_MODE_LCH_COLOR,
GIMP_LCH_LIGHTNESS_MODE GIMP_LAYER_MODE_LCH_LIGHTNESS
} GimpLayerModeEffects; } GimpLayerMode;
void gimp_enums_init (void); void gimp_enums_init (void);

View File

@ -95,7 +95,7 @@ export_merge (gint32 image_ID,
gimp_image_width (image_ID), gimp_image_width (image_ID),
gimp_image_height (image_ID), gimp_image_height (image_ID),
gimp_drawable_type (*drawable_ID) | 1, gimp_drawable_type (*drawable_ID) | 1,
100.0, GIMP_NORMAL_MODE); 100.0, GIMP_LAYER_MODE_NORMAL);
gimp_image_insert_layer (image_ID, transp, -1, 1); gimp_image_insert_layer (image_ID, transp, -1, 1);
gimp_selection_none (image_ID); gimp_selection_none (image_ID);
gimp_edit_clear (transp); gimp_edit_clear (transp);

View File

@ -604,7 +604,7 @@ gimp_image_metadata_load_thumbnail (GFile *file,
layer_ID = gimp_layer_new_from_pixbuf (image_ID, _("Background"), layer_ID = gimp_layer_new_from_pixbuf (image_ID, _("Background"),
pixbuf, pixbuf,
100.0, GIMP_NORMAL_MODE, 100.0, GIMP_LAYER_MODE_NORMAL,
0.0, 0.0); 0.0, 0.0);
g_object_unref (pixbuf); g_object_unref (pixbuf);

View File

@ -49,13 +49,13 @@
* Returns: The newly created layer. * Returns: The newly created layer.
*/ */
gint32 gint32
gimp_layer_new (gint32 image_ID, gimp_layer_new (gint32 image_ID,
const gchar *name, const gchar *name,
gint width, gint width,
gint height, gint height,
GimpImageType type, GimpImageType type,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode) GimpLayerMode mode)
{ {
return _gimp_layer_new (image_ID, return _gimp_layer_new (image_ID,
width, width,
@ -109,13 +109,13 @@ gimp_layer_copy (gint32 layer_ID)
* Since: 2.4 * Since: 2.4
*/ */
gint32 gint32
gimp_layer_new_from_pixbuf (gint32 image_ID, gimp_layer_new_from_pixbuf (gint32 image_ID,
const gchar *name, const gchar *name,
GdkPixbuf *pixbuf, GdkPixbuf *pixbuf,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
gdouble progress_start, gdouble progress_start,
gdouble progress_end) gdouble progress_end)
{ {
gint32 layer; gint32 layer;
gint width; gint width;
@ -274,7 +274,7 @@ gimp_layer_new_from_surface (gint32 image_ID,
layer = gimp_layer_new (image_ID, name, width, height, layer = gimp_layer_new (image_ID, name, width, height,
format == CAIRO_FORMAT_RGB24 ? format == CAIRO_FORMAT_RGB24 ?
GIMP_RGB_IMAGE : GIMP_RGBA_IMAGE, GIMP_RGB_IMAGE : GIMP_RGBA_IMAGE,
100.0, GIMP_NORMAL_MODE); 100.0, GIMP_LAYER_MODE_NORMAL);
if (layer == -1) if (layer == -1)
return -1; return -1;

View File

@ -30,33 +30,33 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */ /* For information look into the C source or the html documentation */
gint32 gimp_layer_new (gint32 image_ID, gint32 gimp_layer_new (gint32 image_ID,
const gchar *name, const gchar *name,
gint width, gint width,
gint height, gint height,
GimpImageType type, GimpImageType type,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode); GimpLayerMode mode);
gint32 gimp_layer_copy (gint32 layer_ID); gint32 gimp_layer_copy (gint32 layer_ID);
gint32 gimp_layer_new_from_pixbuf (gint32 image_ID, gint32 gimp_layer_new_from_pixbuf (gint32 image_ID,
const gchar *name, const gchar *name,
GdkPixbuf *pixbuf, GdkPixbuf *pixbuf,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode, GimpLayerMode mode,
gdouble progress_start, gdouble progress_start,
gdouble progress_end); gdouble progress_end);
gint32 gimp_layer_new_from_surface (gint32 image_ID, gint32 gimp_layer_new_from_surface (gint32 image_ID,
const gchar *name, const gchar *name,
cairo_surface_t *surface, cairo_surface_t *surface,
gdouble progress_start, gdouble progress_start,
gdouble progress_end); gdouble progress_end);
GIMP_DEPRECATED_FOR(gimp_layer_get_lock_alpha) GIMP_DEPRECATED_FOR(gimp_layer_get_lock_alpha)
gboolean gimp_layer_get_preserve_trans (gint32 layer_ID); gboolean gimp_layer_get_preserve_trans (gint32 layer_ID);
GIMP_DEPRECATED_FOR(gimp_layer_set_lock_alpha) GIMP_DEPRECATED_FOR(gimp_layer_set_lock_alpha)
gboolean gimp_layer_set_preserve_trans (gint32 layer_ID, gboolean gimp_layer_set_preserve_trans (gint32 layer_ID,
gboolean preserve_trans); gboolean preserve_trans);
G_END_DECLS G_END_DECLS

View File

@ -56,13 +56,13 @@
* Returns: The newly created layer. * Returns: The newly created layer.
**/ **/
gint32 gint32
_gimp_layer_new (gint32 image_ID, _gimp_layer_new (gint32 image_ID,
gint width, gint width,
gint height, gint height,
GimpImageType type, GimpImageType type,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode) GimpLayerMode mode)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
@ -1101,12 +1101,12 @@ gimp_layer_set_opacity (gint32 layer_ID,
* *
* Returns: The layer combination mode. * Returns: The layer combination mode.
**/ **/
GimpLayerModeEffects GimpLayerMode
gimp_layer_get_mode (gint32 layer_ID) gimp_layer_get_mode (gint32 layer_ID)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
GimpLayerModeEffects mode = 0; GimpLayerMode mode = 0;
return_vals = gimp_run_procedure ("gimp-layer-get-mode", return_vals = gimp_run_procedure ("gimp-layer-get-mode",
&nreturn_vals, &nreturn_vals,
@ -1133,8 +1133,8 @@ gimp_layer_get_mode (gint32 layer_ID)
* Returns: TRUE on success. * Returns: TRUE on success.
**/ **/
gboolean gboolean
gimp_layer_set_mode (gint32 layer_ID, gimp_layer_set_mode (gint32 layer_ID,
GimpLayerModeEffects mode) GimpLayerMode mode)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;

View File

@ -38,7 +38,7 @@ G_GNUC_INTERNAL gint32 _gimp_layer_new (gint32 i
GimpImageType type, GimpImageType type,
const gchar *name, const gchar *name,
gdouble opacity, gdouble opacity,
GimpLayerModeEffects mode); GimpLayerMode mode);
gint32 gimp_layer_new_from_visible (gint32 image_ID, gint32 gimp_layer_new_from_visible (gint32 image_ID,
gint32 dest_image_ID, gint32 dest_image_ID,
const gchar *name); const gchar *name);
@ -95,9 +95,9 @@ gboolean gimp_layer_set_edit_mask (gint32 l
gdouble gimp_layer_get_opacity (gint32 layer_ID); gdouble gimp_layer_get_opacity (gint32 layer_ID);
gboolean gimp_layer_set_opacity (gint32 layer_ID, gboolean gimp_layer_set_opacity (gint32 layer_ID,
gdouble opacity); gdouble opacity);
GimpLayerModeEffects gimp_layer_get_mode (gint32 layer_ID); GimpLayerMode gimp_layer_get_mode (gint32 layer_ID);
gboolean gimp_layer_set_mode (gint32 layer_ID, gboolean gimp_layer_set_mode (gint32 layer_ID,
GimpLayerModeEffects mode); GimpLayerMode mode);
G_END_DECLS G_END_DECLS

View File

@ -60,6 +60,7 @@ EXPORTS
gimp_installation_directory gimp_installation_directory
gimp_interpolation_type_get_type gimp_interpolation_type_get_type
gimp_join_style_get_type gimp_join_style_get_type
gimp_layer_mode_effects_get_type
gimp_locale_directory gimp_locale_directory
gimp_locale_directory_file gimp_locale_directory_file
gimp_major_version gimp_major_version

View File

@ -1020,6 +1020,78 @@ gimp_join_style_get_type (void)
return type; return type;
} }
GType
gimp_layer_mode_effects_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" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_NORMAL_MODE, "GIMP_NORMAL_MODE", NULL },
{ GIMP_DISSOLVE_MODE, "GIMP_DISSOLVE_MODE", NULL },
{ GIMP_BEHIND_MODE, "GIMP_BEHIND_MODE", NULL },
{ GIMP_MULTIPLY_MODE, "GIMP_MULTIPLY_MODE", NULL },
{ GIMP_SCREEN_MODE, "GIMP_SCREEN_MODE", NULL },
{ GIMP_OVERLAY_MODE, "GIMP_OVERLAY_MODE", NULL },
{ GIMP_DIFFERENCE_MODE, "GIMP_DIFFERENCE_MODE", NULL },
{ GIMP_ADDITION_MODE, "GIMP_ADDITION_MODE", NULL },
{ GIMP_SUBTRACT_MODE, "GIMP_SUBTRACT_MODE", NULL },
{ GIMP_DARKEN_ONLY_MODE, "GIMP_DARKEN_ONLY_MODE", NULL },
{ GIMP_LIGHTEN_ONLY_MODE, "GIMP_LIGHTEN_ONLY_MODE", NULL },
{ GIMP_HUE_MODE, "GIMP_HUE_MODE", NULL },
{ GIMP_SATURATION_MODE, "GIMP_SATURATION_MODE", NULL },
{ GIMP_COLOR_MODE, "GIMP_COLOR_MODE", NULL },
{ GIMP_VALUE_MODE, "GIMP_VALUE_MODE", NULL },
{ GIMP_DIVIDE_MODE, "GIMP_DIVIDE_MODE", NULL },
{ GIMP_DODGE_MODE, "GIMP_DODGE_MODE", NULL },
{ GIMP_BURN_MODE, "GIMP_BURN_MODE", NULL },
{ GIMP_HARDLIGHT_MODE, "GIMP_HARDLIGHT_MODE", NULL },
{ GIMP_SOFTLIGHT_MODE, "GIMP_SOFTLIGHT_MODE", NULL },
{ GIMP_GRAIN_EXTRACT_MODE, "GIMP_GRAIN_EXTRACT_MODE", NULL },
{ GIMP_GRAIN_MERGE_MODE, "GIMP_GRAIN_MERGE_MODE", NULL },
{ GIMP_COLOR_ERASE_MODE, "GIMP_COLOR_ERASE_MODE", NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpLayerModeEffects", values);
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
gimp_type_set_translation_context (type, "layer-mode-effects");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
GType GType
gimp_mask_apply_mode_get_type (void) gimp_mask_apply_mode_get_type (void)
{ {

View File

@ -483,6 +483,40 @@ typedef enum
} GimpJoinStyle; } GimpJoinStyle;
#ifndef GIMP_DISABLE_DEPRECATED
#define GIMP_TYPE_LAYER_MODE_EFFECTS (gimp_layer_mode_effects_get_type ())
GType gimp_layer_mode_effects_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_NORMAL_MODE,
GIMP_DISSOLVE_MODE,
GIMP_BEHIND_MODE,
GIMP_MULTIPLY_MODE,
GIMP_SCREEN_MODE,
GIMP_OVERLAY_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_DIVIDE_MODE,
GIMP_DODGE_MODE,
GIMP_BURN_MODE,
GIMP_HARDLIGHT_MODE,
GIMP_SOFTLIGHT_MODE,
GIMP_GRAIN_EXTRACT_MODE,
GIMP_GRAIN_MERGE_MODE,
GIMP_COLOR_ERASE_MODE
} GimpLayerModeEffects;
#endif /* GIMP_DISABLE_DEPRECATED */
#define GIMP_TYPE_MASK_APPLY_MODE (gimp_mask_apply_mode_get_type ()) #define GIMP_TYPE_MASK_APPLY_MODE (gimp_mask_apply_mode_get_type ())
GType gimp_mask_apply_mode_get_type (void) G_GNUC_CONST; GType gimp_mask_apply_mode_get_type (void) G_GNUC_CONST;

View File

@ -642,7 +642,7 @@ do_optimizations (GimpRunMode run_mode,
width, height, width, height,
drawabletype_alpha, drawabletype_alpha,
100.0, 100.0,
GIMP_NORMAL_MODE); GIMP_LAYER_MODE_NORMAL);
gimp_image_insert_layer (new_image_id, new_layer_id, -1, 0); gimp_image_insert_layer (new_image_id, new_layer_id, -1, 0);
@ -1065,7 +1065,7 @@ do_optimizations (GimpRunMode run_mode,
bbox_bottom-bbox_top, bbox_bottom-bbox_top,
drawabletype_alpha, drawabletype_alpha,
100.0, 100.0,
GIMP_NORMAL_MODE); GIMP_LAYER_MODE_NORMAL);
g_free (newlayer_name); g_free (newlayer_name);
gimp_image_insert_layer (new_image_id, new_layer_id, -1, 0); gimp_image_insert_layer (new_image_id, new_layer_id, -1, 0);

View File

@ -1020,7 +1020,8 @@ create_new_image (const gchar *filename,
gimp_image_set_filename (image_ID, filename); gimp_image_set_filename (image_ID, filename);
*layer_ID = gimp_layer_new (image_ID, _("Background"), width, height, *layer_ID = gimp_layer_new (image_ID, _("Background"), width, height,
gdtype, 100, GIMP_NORMAL_MODE); gdtype,
100, GIMP_LAYER_MODE_NORMAL);
gimp_image_insert_layer (image_ID, *layer_ID, -1, 0); gimp_image_insert_layer (image_ID, *layer_ID, -1, 0);
*buffer = gimp_drawable_get_buffer (*layer_ID); *buffer = gimp_drawable_get_buffer (*layer_ID);

View File

@ -2753,7 +2753,7 @@ p_add_layer (gint width,
char *l_name; char *l_name;
char *l_name2; char *l_name2;
gdouble l_opacity; gdouble l_opacity;
GimpLayerModeEffects l_mode; GimpLayerMode l_mode;
gint l_visible; gint l_visible;
gint32 image_id; gint32 image_id;
gint stack_position; gint stack_position;

View File

@ -607,7 +607,8 @@ create_new_layer (gint32 image_ID,
layername = _("Background"); layername = _("Background");
layer_ID = gimp_layer_new (image_ID, layername, width, height, layer_ID = gimp_layer_new (image_ID, layername, width, height,
gdtype, 100, GIMP_NORMAL_MODE); gdtype,
100, GIMP_LAYER_MODE_NORMAL);
gimp_image_insert_layer (image_ID, layer_ID, -1, position); gimp_image_insert_layer (image_ID, layer_ID, -1, position);
return layer_ID; return layer_ID;

View File

@ -993,7 +993,7 @@ preview_update_preview (GimpPreview *preview,
preview_id = gimp_layer_new (image_id, "preview", width, height, preview_id = gimp_layer_new (image_id, "preview", width, height,
gimp_drawable_type (drawable->drawable_id), gimp_drawable_type (drawable->drawable_id),
100, 100,
GIMP_NORMAL_MODE); GIMP_LAYER_MODE_NORMAL);
preview_drawable = gimp_drawable_get (preview_id); preview_drawable = gimp_drawable_get (preview_id);
gimp_image_insert_layer (image_id, preview_id, -1, 0); gimp_image_insert_layer (image_id, preview_id, -1, 0);
gimp_layer_set_offsets (preview_id, 0, 0); gimp_layer_set_offsets (preview_id, 0, 0);

Some files were not shown because too many files have changed in this diff Show More