app: add GimpLayerModeContext enum

A bitmask, specifying in which contexts a layer mode is applicable.
Can be a combination of:

  - LAYER: usable as a layer mode for actual layers.
  - GROUP: usable as a layer mode for layer groups.  Currently, all
    modes that specify LAYER also specify GROUP, and vice versa,
    but the planned pass-through mode will be GROUP only.
  - PAINT: can be used as a paint mode.
  - FADE: can be used for fading.

Add a 'context' field to _GimpLayerModeInfo, and provide context
masks to all the modes.

Use the context mask for validation when setting a layer's mode.
The next commit will use the mask when populating the layer mode
menus.
This commit is contained in:
Ell
2017-02-17 03:49:29 -05:00
parent 33f470fb0f
commit c3d2f57e28
7 changed files with 184 additions and 2 deletions

View File

@ -157,6 +157,21 @@ typedef enum /*< pdb-skip >*/
} GimpLayerModeGroup;
#define GIMP_TYPE_LAYER_MODE_CONTEXT (gimp_layer_mode_context_get_type ())
GType gimp_layer_mode_context_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_LAYER_MODE_CONTEXT_LAYER = 1 << 0,
GIMP_LAYER_MODE_CONTEXT_GROUP = 1 << 1,
GIMP_LAYER_MODE_CONTEXT_PAINT = 1 << 2,
GIMP_LAYER_MODE_CONTEXT_FADE = 1 << 3,
GIMP_LAYER_MODE_CONTEXT_ALL = (GIMP_LAYER_MODE_CONTEXT_LAYER | GIMP_LAYER_MODE_CONTEXT_GROUP | GIMP_LAYER_MODE_CONTEXT_PAINT | GIMP_LAYER_MODE_CONTEXT_FADE)
} GimpLayerModeContext;
/*
* non-registered enums; register them if needed
*/