app: GtkAction -> GAction madness part two

Change all action callbacks so they can be invoked by a GAction:

- add GimpActionCallback typedef:
  void (* cb) (GimpAction*, GVariant*, gpointer)
- change all action callbacks to the GimpActionCallback signature
- add "gimp-activate" and "gimp-change-state" signals to GimpAction,
  with the same signature as the resp. GAction signals
- remove all other custom action signals and only use the new
  GimpAction signals
- pass around appropriate GVariants containing booleans, int32,
  strings
- badly hack around to force a GimpProcedure pointer into a
  uint64 variant
- remove all G_CALLBACK() casts from all action callbacks,
  they all have the same signature now

(cherry picked from commit 3b6b3fc189)
This commit is contained in:
Michael Natterer
2019-07-04 01:11:48 +02:00
parent 0146ce354b
commit ff7ca87c09
146 changed files with 2452 additions and 1695 deletions

View File

@ -40,13 +40,13 @@
/* local function prototypes */
static void tool_options_actions_update_presets (GimpActionGroup *group,
const gchar *action_prefix,
GCallback callback,
const gchar *help_id,
GimpContainer *presets,
gboolean need_writable,
gboolean need_deletable);
static void tool_options_actions_update_presets (GimpActionGroup *group,
const gchar *action_prefix,
GimpActionCallback callback,
const gchar *help_id,
GimpContainer *presets,
gboolean need_writable,
gboolean need_deletable);
/* global variables */
@ -75,19 +75,19 @@ static const GimpActionEntry tool_options_actions[] =
{ "tool-options-save-new-preset", GIMP_ICON_DOCUMENT_NEW,
NC_("tool-options-action", "_New Tool Preset..."), "", NULL,
G_CALLBACK (tool_options_save_new_preset_cmd_callback),
tool_options_save_new_preset_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_SAVE },
{ "tool-options-reset", GIMP_ICON_RESET,
NC_("tool-options-action", "R_eset Tool Options"), NULL,
NC_("tool-options-action", "Reset to default values"),
G_CALLBACK (tool_options_reset_cmd_callback),
tool_options_reset_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_RESET },
{ "tool-options-reset-all", GIMP_ICON_RESET,
NC_("tool-options-action", "Reset _all Tool Options"), NULL,
NC_("tool-options-action", "Reset all tool options"),
G_CALLBACK (tool_options_reset_all_cmd_callback),
tool_options_reset_all_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_RESET }
};
@ -126,28 +126,28 @@ tool_options_actions_update (GimpActionGroup *group,
SET_VISIBLE ("tool-options-delete-preset-menu", tool_info->presets);
tool_options_actions_update_presets (group, "tool-options-save-preset",
G_CALLBACK (tool_options_save_preset_cmd_callback),
tool_options_save_preset_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_SAVE,
tool_info->presets,
TRUE /* writable */,
FALSE /* deletable */);
tool_options_actions_update_presets (group, "tool-options-restore-preset",
G_CALLBACK (tool_options_restore_preset_cmd_callback),
tool_options_restore_preset_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_RESTORE,
tool_info->presets,
FALSE /* writable */,
FALSE /* deletable */);
tool_options_actions_update_presets (group, "tool-options-edit-preset",
G_CALLBACK (tool_options_edit_preset_cmd_callback),
tool_options_edit_preset_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_EDIT,
tool_info->presets,
FALSE /* writable */,
FALSE /* deletable */);
tool_options_actions_update_presets (group, "tool-options-delete-preset",
G_CALLBACK (tool_options_delete_preset_cmd_callback),
tool_options_delete_preset_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_DELETE,
tool_info->presets,
FALSE /* writable */,
@ -158,13 +158,13 @@ tool_options_actions_update (GimpActionGroup *group,
/* private function */
static void
tool_options_actions_update_presets (GimpActionGroup *group,
const gchar *action_prefix,
GCallback callback,
const gchar *help_id,
GimpContainer *presets,
gboolean need_writable,
gboolean need_deletable)
tool_options_actions_update_presets (GimpActionGroup *group,
const gchar *action_prefix,
GimpActionCallback callback,
const gchar *help_id,
GimpContainer *presets,
gboolean need_writable,
gboolean need_deletable)
{
GList *list;
gint n_children = 0;