/* PIKA - Photo and Image Kooker Application
 * a rebranding of The GNU Image Manipulation Program (created with heckimp)
 * A derived work which may be trivial. However, any changes may be (C)2023 by Aldercone Studio
 *
 * Original copyright, applying to most contents (license remains unchanged): 
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#include "config.h"

#include <gegl.h>
#include <gtk/gtk.h>

#include "libpikawidgets/pikawidgets.h"

#include "actions-types.h"

#include "core/pika.h"
#include "core/pikabrushgenerated.h"
#include "core/pikacontext.h"
#include "core/pikalist.h"

#include "widgets/pikaactiongroup.h"
#include "widgets/pikahelp-ids.h"

#include "actions.h"
#include "context-actions.h"
#include "context-commands.h"

#include "pika-intl.h"


/*  local function prototypes  */

static const PikaActionEntry context_actions[] =
{
  { "context-colors-default", PIKA_ICON_COLORS_DEFAULT,
    NC_("context-action", "_Default Colors"), NULL, { "D", NULL },
    NC_("context-action",
        "Set foreground color to black, background color to white"),
    context_colors_default_cmd_callback,
    PIKA_HELP_TOOLBOX_DEFAULT_COLORS },

  { "context-colors-swap", PIKA_ICON_COLORS_SWAP,
    NC_("context-action", "S_wap Colors"), NULL, { "X", NULL },
    NC_("context-action", "Exchange foreground and background colors"),
    context_colors_swap_cmd_callback,
    PIKA_HELP_TOOLBOX_SWAP_COLORS }
};

static PikaEnumActionEntry context_palette_foreground_actions[] =
{
  { "context-palette-foreground-set", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Set Color From Palette"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, FALSE,
    NULL },
  { "context-palette-foreground-first", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Use First Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-palette-foreground-last", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Use Last Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-palette-foreground-previous", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Use Previous Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-palette-foreground-next", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Use Next Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-palette-foreground-previous-skip", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Skip Back Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-palette-foreground-next-skip", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Skip Forward Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static PikaEnumActionEntry context_palette_background_actions[] =
{
  { "context-palette-background-set", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Set Color From Palette"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, FALSE,
    NULL },
  { "context-palette-background-first", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Use First Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-palette-background-last", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Use Last Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-palette-background-previous", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Use Previous Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-palette-background-next", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Use Next Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-palette-background-previous-skip", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Skip Back Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-palette-background-next-skip", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Skip Forward Palette Color"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static PikaEnumActionEntry context_colormap_foreground_actions[] =
{
  { "context-colormap-foreground-set", PIKA_ICON_COLORMAP,
    NC_("context-action", "Foreground: Set Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, FALSE,
    NULL },
  { "context-colormap-foreground-first", PIKA_ICON_COLORMAP,
    NC_("context-action", "Foreground: Use First Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-colormap-foreground-last", PIKA_ICON_COLORMAP,
    NC_("context-action", "Foreground: Use Last Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-colormap-foreground-previous", PIKA_ICON_COLORMAP,
    NC_("context-action", "Foreground: Use Previous Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-colormap-foreground-next", PIKA_ICON_COLORMAP,
    NC_("context-action", "Foreground: Use Next Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-colormap-foreground-previous-skip", PIKA_ICON_COLORMAP,
    NC_("context-action", "Foreground: Skip Back Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-colormap-foreground-next-skip", PIKA_ICON_COLORMAP,
    NC_("context-action", "Foreground: Skip Forward Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static PikaEnumActionEntry context_colormap_background_actions[] =
{
  { "context-colormap-background-set", PIKA_ICON_COLORMAP,
    NC_("context-action", "Background: Set Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, FALSE,
    NULL },
  { "context-colormap-background-first", PIKA_ICON_COLORMAP,
    NC_("context-action", "Background: Use First Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-colormap-background-last", PIKA_ICON_COLORMAP,
    NC_("context-action", "Background: Use Last Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-colormap-background-previous", PIKA_ICON_COLORMAP,
    NC_("context-action", "Background: Use Previous Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-colormap-background-next", PIKA_ICON_COLORMAP,
    NC_("context-action", "Background: Use Next Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-colormap-background-previous-skip", PIKA_ICON_COLORMAP,
    NC_("context-action", "Background: Skip Back Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-colormap-background-next-skip", PIKA_ICON_COLORMAP,
    NC_("context-action", "Background: Skip Forward Color From Colormap"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static PikaEnumActionEntry context_swatch_foreground_actions[] =
{
  { "context-swatch-foreground-set", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Set Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, FALSE,
    NULL },
  { "context-swatch-foreground-first", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Use First Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-swatch-foreground-last", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Use Last Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-swatch-foreground-previous", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Use Previous Color From Swatch"), NULL, { "9", NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-swatch-foreground-next", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Use Next Color From Swatch"), NULL, { "0", NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-swatch-foreground-previous-skip", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Skip Back Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-swatch-foreground-next-skip", PIKA_ICON_PALETTE,
    NC_("context-action", "Foreground: Skip Forward Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static PikaEnumActionEntry context_swatch_background_actions[] =
{
  { "context-swatch-background-set", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Set Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, FALSE,
    NULL },
  { "context-swatch-background-first", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Use First Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-swatch-background-last", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Use Last Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-swatch-background-previous", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Use Previous Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-swatch-background-next", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Use Next Color From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-swatch-background-previous-skip", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Skip Color Back From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-swatch-background-next-skip", PIKA_ICON_PALETTE,
    NC_("context-action", "Background: Skip Color Forward From Swatch"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_foreground_red_actions[] =
{
  { "context-foreground-red-set", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Foreground Red: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-foreground-red-minimum", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Foreground Red: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-foreground-red-maximum", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Foreground Red: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-foreground-red-decrease", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Foreground Red: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-red-increase", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Foreground Red: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-foreground-red-decrease-skip", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Foreground Red: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-red-increase-skip", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Foreground Red: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_foreground_green_actions[] =
{
  { "context-foreground-green-set", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Foreground Green: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-foreground-green-minimum", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Foreground Green: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-foreground-green-maximum", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Foreground Green: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-foreground-green-decrease", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Foreground Green: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-green-increase", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Foreground Green: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-foreground-green-decrease-skip", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Foreground Green: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-green-increase-skip", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Foreground Green: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_foreground_blue_actions[] =
{
  { "context-foreground-blue-set", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Foreground Blue: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-foreground-blue-minimum", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Foreground Blue: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-foreground-blue-maximum", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Foreground Blue: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-foreground-blue-decrease", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Foreground Blue: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-blue-increase", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Foreground Blue: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-foreground-blue-decrease-skip", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Foreground Blue: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-blue-increase-skip", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Foreground Blue: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_background_red_actions[] =
{
  { "context-background-red-set", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Background Red: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-background-red-minimum", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Background Red: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-background-red-maximum", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Background Red: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-background-red-decrease", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Background Red: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-background-red-increase", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Background Red: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-background-red-decrease-skip", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Background Red: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-background-red-increase-skip", PIKA_ICON_CHANNEL_RED,
    NC_("context-action", "Background Red: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_background_green_actions[] =
{
  { "context-background-green-set", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Background Green: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-background-green-minimum", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Background Green: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-background-green-maximum", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Background Green: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-background-green-decrease", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Background Green: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-background-green-increase", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Background Green: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-background-green-decrease-skip", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Background Green: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-background-green-increase-skip", PIKA_ICON_CHANNEL_GREEN,
    NC_("context-action", "Background Green: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_background_blue_actions[] =
{
  { "context-background-blue-set", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Background Blue: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-background-blue-minimum", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Background Blue: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-background-blue-maximum", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Background Blue: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-background-blue-decrease", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Background Blue: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-background-blue-increase", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Background Blue: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-background-blue-decrease-skip", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Background Blue: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-background-blue-increase-skip", PIKA_ICON_CHANNEL_BLUE,
    NC_("context-action", "Background Blue: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_foreground_hue_actions[] =
{
  { "context-foreground-hue-set", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Hue: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-foreground-hue-minimum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Hue: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-foreground-hue-maximum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Hue: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-foreground-hue-decrease", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Hue: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-hue-increase", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Hue: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-foreground-hue-decrease-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Hue: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-hue-increase-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Hue: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_foreground_saturation_actions[] =
{
  { "context-foreground-saturation-set", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Saturation: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-foreground-saturation-minimum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Saturation: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-foreground-saturation-maximum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Saturation: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-foreground-saturation-decrease", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Saturation: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-saturation-increase", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Saturation: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-foreground-saturation-decrease-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Saturation: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-saturation-increase-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Saturation: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_foreground_value_actions[] =
{
  { "context-foreground-value-set", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Value: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-foreground-value-minimum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Value: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-foreground-value-maximum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Value: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-foreground-value-decrease", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Value: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-value-increase", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Value: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-foreground-value-decrease-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Value: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-foreground-value-increase-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Foreground Value: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_background_hue_actions[] =
{
  { "context-background-hue-set", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Hue: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-background-hue-minimum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Hue: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-background-hue-maximum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Hue: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-background-hue-decrease", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Hue: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-background-hue-increase", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Hue: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-background-hue-decrease-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Hue: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-background-hue-increase-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Hue: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_background_saturation_actions[] =
{
  { "context-background-saturation-set", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Saturation: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-background-saturation-minimum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Saturation: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-background-saturation-maximum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Saturation: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-background-saturation-decrease", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Saturation: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-background-saturation-increase", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Saturation: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-background-saturation-decrease-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Saturation: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-background-saturation-increase-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Saturation: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_background_value_actions[] =
{
  { "context-background-value-set", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Value: Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-background-value-minimum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Value: Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-background-value-maximum", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Value: Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-background-value-decrease", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Value: Decrease by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-background-value-increase", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Value: Increase by 1%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-background-value-decrease-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Value: Decrease by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-background-value-increase-skip", PIKA_ICON_TOOL_HUE_SATURATION,
    NC_("context-action", "Background Value: Increase by 10%"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_opacity_actions[] =
{
  { "context-opacity-set", PIKA_ICON_TRANSPARENCY,
    NC_("context-action", "Tool Opacity: Set Transparency"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-opacity-transparent", PIKA_ICON_TRANSPARENCY,
    NC_("context-action", "Tool Opacity: Make Completely Transparent"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-opacity-opaque", PIKA_ICON_TRANSPARENCY,
    NC_("context-action", "Tool Opacity: Make Completely Opaque"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-opacity-decrease", PIKA_ICON_TRANSPARENCY,
    NC_("context-action", "Tool Opacity: Make 1% More Transparent"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-opacity-increase", PIKA_ICON_TRANSPARENCY,
    NC_("context-action", "Tool Opacity: Make 1% More Opaque"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-opacity-decrease-skip", PIKA_ICON_TRANSPARENCY,
    NC_("context-action", "Tool Opacity: Make 10% More Transparent"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-opacity-increase-skip", PIKA_ICON_TRANSPARENCY,
    NC_("context-action", "Tool Opacity: Make 10% More Opaque"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_paint_mode_actions[] =
{
  { "context-paint-mode-first", PIKA_ICON_TOOL_PENCIL,
    NC_("context-action", "Tool Paint Mode: Select First"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-paint-mode-last", PIKA_ICON_TOOL_PENCIL,
    NC_("context-action", "Tool Paint Mode: Select Last"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-paint-mode-previous", PIKA_ICON_TOOL_PENCIL,
    NC_("context-action", "Tool Paint Mode: Select Previous"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-paint-mode-next", PIKA_ICON_TOOL_PENCIL,
    NC_("context-action", "Tool Paint Mode: Select Next"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_tool_select_actions[] =
{
  { "context-tool-select-set", PIKA_ICON_DIALOG_TOOLS,
    NC_("context-action", "Tool Selection: Choose by Index"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-tool-select-first", PIKA_ICON_DIALOG_TOOLS,
    NC_("context-action", "Tool Selection: Switch to First"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-tool-select-last", PIKA_ICON_DIALOG_TOOLS,
    NC_("context-action", "Tool Selection: Switch to Last"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-tool-select-previous", PIKA_ICON_DIALOG_TOOLS,
    NC_("context-action", "Tool Selection: Switch to Previous"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-tool-select-next", PIKA_ICON_DIALOG_TOOLS,
    NC_("context-action", "Tool Selection: Switch to Next"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_brush_select_actions[] =
{
  { "context-brush-select-set", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Selection: Select by Index"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-brush-select-first", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Selection: Switch to First"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-brush-select-last", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Selection: Switch to Last"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-brush-select-previous", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Selection: Switch to Previous"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-brush-select-next", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Selection: Switch to Next"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_pattern_select_actions[] =
{
  { "context-pattern-select-set", PIKA_ICON_PATTERN,
    NC_("context-action", "Pattern Selection: Select by Index"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-pattern-select-first", PIKA_ICON_PATTERN,
    NC_("context-action", "Pattern Selection: Switch to First"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-pattern-select-last", PIKA_ICON_PATTERN,
    NC_("context-action", "Pattern Selection: Switch to Last"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-pattern-select-previous", PIKA_ICON_PATTERN,
    NC_("context-action", "Pattern Selection: Switch to Previous"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-pattern-select-next", PIKA_ICON_PATTERN,
    NC_("context-action", "Pattern Selection: Switch to Next"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_palette_select_actions[] =
{
  { "context-palette-select-set", PIKA_ICON_PALETTE,
    NC_("context-action", "Palette Selection: Select by Index"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-palette-select-first", PIKA_ICON_PALETTE,
    NC_("context-action", "Palette Selection: Switch to First"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-palette-select-last", PIKA_ICON_PALETTE,
    NC_("context-action", "Palette Selection: Switch to Last"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-palette-select-previous", PIKA_ICON_PALETTE,
    NC_("context-action", "Palette Selection: Switch to Previous"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-palette-select-next", PIKA_ICON_PALETTE,
    NC_("context-action", "Palette Selection: Switch to Next"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_gradient_select_actions[] =
{
  { "context-gradient-select-set", PIKA_ICON_GRADIENT,
    NC_("context-action", "Gradient Selection: Select by Index"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-gradient-select-first", PIKA_ICON_GRADIENT,
    NC_("context-action", "Gradient Selection: Switch to First"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-gradient-select-last", PIKA_ICON_GRADIENT,
    NC_("context-action", "Gradient Selection: Switch to Last"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-gradient-select-previous", PIKA_ICON_GRADIENT,
    NC_("context-action", "Gradient Selection: Switch to Previous"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-gradient-select-next", PIKA_ICON_GRADIENT,
    NC_("context-action", "Gradient Selection: Switch to Next"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_font_select_actions[] =
{
  { "context-font-select-set", PIKA_ICON_FONT,
    NC_("context-action", "Font Selection: Select by Index"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-font-select-first", PIKA_ICON_FONT,
    NC_("context-action", "Font Selection: Switch to First"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-font-select-last", PIKA_ICON_FONT,
    NC_("context-action", "Font Selection: Switch to Last"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-font-select-previous", PIKA_ICON_FONT,
    NC_("context-action", "Font Selection: Switch to Previous"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-font-select-next", PIKA_ICON_FONT,
    NC_("context-action", "Font Selection: Switch to Next"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_brush_spacing_actions[] =
{
  { "context-brush-spacing-set", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spacing (Editor): Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-brush-spacing-minimum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spacing (Editor): Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-brush-spacing-maximum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spacing (Editor): Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-brush-spacing-decrease", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spacing (Editor): Decrease by 1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-brush-spacing-increase", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spacing (Editor): Increase by 1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-brush-spacing-decrease-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spacing (Editor): Decrease by 10"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-brush-spacing-increase-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spacing (Editor): Increase by 10"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_brush_shape_actions[] =
{
  { "context-brush-shape-circle", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Shape (Editor): Use Circular"), NULL, { NULL }, NULL,
    PIKA_BRUSH_GENERATED_CIRCLE, FALSE,
    NULL },
  { "context-brush-shape-square", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Shape (Editor): Use Square"), NULL, { NULL }, NULL,
    PIKA_BRUSH_GENERATED_SQUARE, FALSE,
    NULL },
  { "context-brush-shape-diamond", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Shape (Editor): Use Diamond"), NULL, { NULL }, NULL,
    PIKA_BRUSH_GENERATED_DIAMOND, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_brush_radius_actions[] =
{
  { "context-brush-radius-set", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-brush-radius-minimum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-brush-radius-maximum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-brush-radius-decrease-less", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Decrease by 0.1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SMALL_PREVIOUS, FALSE,
    NULL },
  { "context-brush-radius-increase-less", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Increase by 0.1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SMALL_NEXT, FALSE,
    NULL },
  { "context-brush-radius-decrease", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Decrease by 1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-brush-radius-increase", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Increase by 1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-brush-radius-decrease-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Decrease by 10"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-brush-radius-increase-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Increase by 10"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL },
  { "context-brush-radius-decrease-percent", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Decrease Relative"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
    NULL },
  { "context-brush-radius-increase-percent", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Radius (Editor): Increase Relative"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PERCENT_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_brush_spikes_actions[] =
{
  { "context-brush-spikes-set", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spikes (Editor): Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-brush-spikes-minimum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spikes (Editor): Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-brush-spikes-maximum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spikes (Editor): Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-brush-spikes-decrease", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spikes (Editor): Decrease by 1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-brush-spikes-increase", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spikes (Editor): Increase by 1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-brush-spikes-decrease-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spikes (Editor): Decrease by 4"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-brush-spikes-increase-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Spikes (Editor): Increase by 4"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_brush_hardness_actions[] =
{
  { "context-brush-hardness-set", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Hardness (Editor): Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-brush-hardness-minimum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Hardness (Editor): Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-brush-hardness-maximum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Hardness (Editor): Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-brush-hardness-decrease", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Hardness (Editor): Decrease by 0.01"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-brush-hardness-increase", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Hardness (Editor): Increase by 0.01"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-brush-hardness-decrease-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Hardness (Editor): Decrease by 0.1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-brush-hardness-increase-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Hardness (Editor): Increase by 0.1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_brush_aspect_actions[] =
{
  { "context-brush-aspect-set", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Aspect Ratio (Editor): Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-brush-aspect-minimum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Aspect Ratio (Editor): Set to Minimum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-brush-aspect-maximum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Aspect Ratio (Editor): Set to Maximum"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-brush-aspect-decrease", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Aspect Ratio (Editor): Decrease by 0.1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-brush-aspect-increase", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Aspect Ratio (Editor): Increase by 0.1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-brush-aspect-decrease-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Aspect Ratio (Editor): Decrease by 1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-brush-aspect-increase-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Aspect Ratio (Editor): Increase by 1"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaEnumActionEntry context_brush_angle_actions[] =
{
  { "context-brush-angle-set", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Angle (Editor): Set"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SET, TRUE,
    NULL },
  { "context-brush-angle-minimum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Angle (Editor): Make Horizontal"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_FIRST, FALSE,
    NULL },
  { "context-brush-angle-maximum", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Angle (Editor): Make Vertical"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_LAST, FALSE,
    NULL },
  { "context-brush-angle-decrease", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Angle (Editor): Rotate Right by 1°"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_PREVIOUS, FALSE,
    NULL },
  { "context-brush-angle-increase", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Angle (Editor): Rotate Left by 1°"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_NEXT, FALSE,
    NULL },
  { "context-brush-angle-decrease-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Angle (Editor): Rotate Right by 15°"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
    NULL },
  { "context-brush-angle-increase-skip", PIKA_ICON_BRUSH,
    NC_("context-action", "Brush Angle (Editor): Rotate Left by 15°"), NULL, { NULL }, NULL,
    PIKA_ACTION_SELECT_SKIP_NEXT, FALSE,
    NULL }
};

static const PikaToggleActionEntry context_toggle_actions[] =
{
  { "context-dynamics-toggle", NULL,
    NC_("context-action", "_Enable/Disable Dynamics"), NULL, { NULL },
    NC_("context-action", "Apply or ignore the dynamics when painting"),
    context_toggle_dynamics_cmd_callback,
    FALSE,
    NULL },
};


void
context_actions_setup (PikaActionGroup *group)
{
  pika_action_group_add_actions (group, "context-action",
                                 context_actions,
                                 G_N_ELEMENTS (context_actions));

  pika_action_group_add_enum_actions (group, "context-action",
                                      context_palette_foreground_actions,
                                      G_N_ELEMENTS (context_palette_foreground_actions),
                                      context_palette_foreground_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_palette_background_actions,
                                      G_N_ELEMENTS (context_palette_background_actions),
                                      context_palette_background_cmd_callback);

  pika_action_group_add_enum_actions (group, "context-action",
                                      context_colormap_foreground_actions,
                                      G_N_ELEMENTS (context_colormap_foreground_actions),
                                      context_colormap_foreground_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_colormap_background_actions,
                                      G_N_ELEMENTS (context_colormap_background_actions),
                                      context_colormap_background_cmd_callback);

  pika_action_group_add_enum_actions (group, "context-action",
                                      context_swatch_foreground_actions,
                                      G_N_ELEMENTS (context_swatch_foreground_actions),
                                      context_swatch_foreground_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_swatch_background_actions,
                                      G_N_ELEMENTS (context_swatch_background_actions),
                                      context_swatch_background_cmd_callback);


  pika_action_group_add_enum_actions (group, "context-action",
                                      context_foreground_red_actions,
                                      G_N_ELEMENTS (context_foreground_red_actions),
                                      context_foreground_red_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_foreground_green_actions,
                                      G_N_ELEMENTS (context_foreground_green_actions),
                                      context_foreground_green_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_foreground_blue_actions,
                                      G_N_ELEMENTS (context_foreground_blue_actions),
                                      context_foreground_blue_cmd_callback);

  pika_action_group_add_enum_actions (group, "context-action",
                                      context_foreground_hue_actions,
                                      G_N_ELEMENTS (context_foreground_hue_actions),
                                      context_foreground_hue_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_foreground_saturation_actions,
                                      G_N_ELEMENTS (context_foreground_saturation_actions),
                                      context_foreground_saturation_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_foreground_value_actions,
                                      G_N_ELEMENTS (context_foreground_value_actions),
                                      context_foreground_value_cmd_callback);

  pika_action_group_add_enum_actions (group, "context-action",
                                      context_background_red_actions,
                                      G_N_ELEMENTS (context_background_red_actions),
                                      context_background_red_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_background_green_actions,
                                      G_N_ELEMENTS (context_background_green_actions),
                                      context_background_green_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_background_blue_actions,
                                      G_N_ELEMENTS (context_background_blue_actions),
                                      context_background_blue_cmd_callback);

  pika_action_group_add_enum_actions (group, "context-action",
                                      context_background_hue_actions,
                                      G_N_ELEMENTS (context_background_hue_actions),
                                      context_background_hue_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_background_saturation_actions,
                                      G_N_ELEMENTS (context_background_saturation_actions),
                                      context_background_saturation_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_background_value_actions,
                                      G_N_ELEMENTS (context_background_value_actions),
                                      context_background_value_cmd_callback);

  pika_action_group_add_enum_actions (group, "context-action",
                                      context_opacity_actions,
                                      G_N_ELEMENTS (context_opacity_actions),
                                      context_opacity_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_paint_mode_actions,
                                      G_N_ELEMENTS (context_paint_mode_actions),
                                      context_paint_mode_cmd_callback);

  pika_action_group_add_enum_actions (group, "context-action",
                                      context_tool_select_actions,
                                      G_N_ELEMENTS (context_tool_select_actions),
                                      context_tool_select_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_brush_select_actions,
                                      G_N_ELEMENTS (context_brush_select_actions),
                                      context_brush_select_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_pattern_select_actions,
                                      G_N_ELEMENTS (context_pattern_select_actions),
                                      context_pattern_select_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_palette_select_actions,
                                      G_N_ELEMENTS (context_palette_select_actions),
                                      context_palette_select_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_gradient_select_actions,
                                      G_N_ELEMENTS (context_gradient_select_actions),
                                      context_gradient_select_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_font_select_actions,
                                      G_N_ELEMENTS (context_font_select_actions),
                                      context_font_select_cmd_callback);

  pika_action_group_add_enum_actions (group, "context-action",
                                      context_brush_spacing_actions,
                                      G_N_ELEMENTS (context_brush_spacing_actions),
                                      context_brush_spacing_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_brush_shape_actions,
                                      G_N_ELEMENTS (context_brush_shape_actions),
                                      context_brush_shape_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_brush_radius_actions,
                                      G_N_ELEMENTS (context_brush_radius_actions),
                                      context_brush_radius_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_brush_spikes_actions,
                                      G_N_ELEMENTS (context_brush_spikes_actions),
                                      context_brush_spikes_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_brush_hardness_actions,
                                      G_N_ELEMENTS (context_brush_hardness_actions),
                                      context_brush_hardness_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_brush_aspect_actions,
                                      G_N_ELEMENTS (context_brush_aspect_actions),
                                      context_brush_aspect_cmd_callback);
  pika_action_group_add_enum_actions (group, "context-action",
                                      context_brush_angle_actions,
                                      G_N_ELEMENTS (context_brush_angle_actions),
                                      context_brush_angle_cmd_callback);

  pika_action_group_add_toggle_actions (group, "context-action",
                                        context_toggle_actions,
                                        G_N_ELEMENTS (context_toggle_actions));
}

void
context_actions_update (PikaActionGroup *group,
                        gpointer         data)
{
#if 0
  PikaContext *context   = action_data_get_context (data);
  gboolean     generated = FALSE;
  gdouble      radius    = 0.0;
  gint         spikes    = 0;
  gdouble      hardness  = 0.0;
  gdouble      aspect    = 0.0;
  gdouble      angle     = 0.0;

  if (context)
    {
      PikaBrush *brush = pika_context_get_brush (context);

      if (PIKA_IS_BRUSH_GENERATED (brush))
        {
          PikaBrushGenerated *gen = PIKA_BRUSH_GENERATED (brush);

          generated = TRUE;

          radius   = pika_brush_generated_get_radius       (gen);
          spikes   = pika_brush_generated_get_spikes       (gen);
          hardness = pika_brush_generated_get_hardness     (gen);
          aspect   = pika_brush_generated_get_aspect_ratio (gen);
          angle    = pika_brush_generated_get_angle        (gen);
        }
    }

#define SET_SENSITIVE(action,condition) \
        pika_action_group_set_action_sensitive (group, "context-" action, (condition) != 0)

  SET_SENSITIVE ("brush-radius-minimum",       generated && radius > 1.0);
  SET_SENSITIVE ("brush-radius-decrease",      generated && radius > 1.0);
  SET_SENSITIVE ("brush-radius-decrease-skip", generated && radius > 1.0);

  SET_SENSITIVE ("brush-radius-maximum",       generated && radius < 4000.0);
  SET_SENSITIVE ("brush-radius-increase",      generated && radius < 4000.0);
  SET_SENSITIVE ("brush-radius-increase-skip", generated && radius < 4000.0);

  SET_SENSITIVE ("brush-angle-minimum",       generated);
  SET_SENSITIVE ("brush-angle-decrease",      generated);
  SET_SENSITIVE ("brush-angle-decrease-skip", generated);

  SET_SENSITIVE ("brush-angle-maximum",       generated);
  SET_SENSITIVE ("brush-angle-increase",      generated);
  SET_SENSITIVE ("brush-angle-increase-skip", generated);
#undef SET_SENSITIVE

#endif
}
