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:
@ -73,93 +73,93 @@ static const GimpActionEntry edit_actions[] =
|
||||
{ "edit-undo", GIMP_ICON_EDIT_UNDO,
|
||||
NC_("edit-action", "_Undo"), "<primary>Z",
|
||||
NC_("edit-action", "Undo the last operation"),
|
||||
G_CALLBACK (edit_undo_cmd_callback),
|
||||
edit_undo_cmd_callback,
|
||||
GIMP_HELP_EDIT_UNDO },
|
||||
|
||||
{ "edit-redo", GIMP_ICON_EDIT_REDO,
|
||||
NC_("edit-action", "_Redo"), "<primary>Y",
|
||||
NC_("edit-action", "Redo the last operation that was undone"),
|
||||
G_CALLBACK (edit_redo_cmd_callback),
|
||||
edit_redo_cmd_callback,
|
||||
GIMP_HELP_EDIT_REDO },
|
||||
|
||||
{ "edit-strong-undo", GIMP_ICON_EDIT_UNDO,
|
||||
NC_("edit-action", "Strong Undo"), "<primary><shift>Z",
|
||||
NC_("edit-action", "Undo the last operation, skipping visibility changes"),
|
||||
G_CALLBACK (edit_strong_undo_cmd_callback),
|
||||
edit_strong_undo_cmd_callback,
|
||||
GIMP_HELP_EDIT_STRONG_UNDO },
|
||||
|
||||
{ "edit-strong-redo", GIMP_ICON_EDIT_REDO,
|
||||
NC_("edit-action", "Strong Redo"), "<primary><shift>Y",
|
||||
NC_("edit-action",
|
||||
"Redo the last operation that was undone, skipping visibility changes"),
|
||||
G_CALLBACK (edit_strong_redo_cmd_callback),
|
||||
edit_strong_redo_cmd_callback,
|
||||
GIMP_HELP_EDIT_STRONG_REDO },
|
||||
|
||||
{ "edit-undo-clear", GIMP_ICON_SHRED,
|
||||
NC_("edit-action", "_Clear Undo History"), NULL,
|
||||
NC_("edit-action", "Remove all operations from the undo history"),
|
||||
G_CALLBACK (edit_undo_clear_cmd_callback),
|
||||
edit_undo_clear_cmd_callback,
|
||||
GIMP_HELP_EDIT_UNDO_CLEAR },
|
||||
|
||||
{ "edit-cut", GIMP_ICON_EDIT_CUT,
|
||||
NC_("edit-action", "Cu_t"), "<primary>X",
|
||||
NC_("edit-action", "Move the selected pixels to the clipboard"),
|
||||
G_CALLBACK (edit_cut_cmd_callback),
|
||||
edit_cut_cmd_callback,
|
||||
GIMP_HELP_EDIT_CUT },
|
||||
|
||||
{ "edit-copy", GIMP_ICON_EDIT_COPY,
|
||||
NC_("edit-action", "_Copy"), "<primary>C",
|
||||
NC_("edit-action", "Copy the selected pixels to the clipboard"),
|
||||
G_CALLBACK (edit_copy_cmd_callback),
|
||||
edit_copy_cmd_callback,
|
||||
GIMP_HELP_EDIT_COPY },
|
||||
|
||||
{ "edit-copy-visible", NULL, /* GIMP_ICON_COPY_VISIBLE, */
|
||||
NC_("edit-action", "Copy _Visible"), "<primary><shift>C",
|
||||
NC_("edit-action", "Copy what is visible in the selected region"),
|
||||
G_CALLBACK (edit_copy_visible_cmd_callback),
|
||||
edit_copy_visible_cmd_callback,
|
||||
GIMP_HELP_EDIT_COPY_VISIBLE },
|
||||
|
||||
{ "edit-paste-as-new-image", GIMP_ICON_EDIT_PASTE_AS_NEW,
|
||||
NC_("edit-action", "From _Clipboard"), "<primary><shift>V",
|
||||
NC_("edit-action", "Create a new image from the content of the clipboard"),
|
||||
G_CALLBACK (edit_paste_as_new_image_cmd_callback),
|
||||
edit_paste_as_new_image_cmd_callback,
|
||||
GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
|
||||
|
||||
{ "edit-paste-as-new-image-short", GIMP_ICON_EDIT_PASTE_AS_NEW,
|
||||
NC_("edit-action", "_New Image"), NULL,
|
||||
NC_("edit-action", "Create a new image from the content of the clipboard"),
|
||||
G_CALLBACK (edit_paste_as_new_image_cmd_callback),
|
||||
edit_paste_as_new_image_cmd_callback,
|
||||
GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
|
||||
|
||||
{ "edit-named-cut", GIMP_ICON_EDIT_CUT,
|
||||
NC_("edit-action", "Cu_t Named..."), NULL,
|
||||
NC_("edit-action", "Move the selected pixels to a named buffer"),
|
||||
G_CALLBACK (edit_named_cut_cmd_callback),
|
||||
edit_named_cut_cmd_callback,
|
||||
GIMP_HELP_BUFFER_CUT },
|
||||
|
||||
{ "edit-named-copy", GIMP_ICON_EDIT_COPY,
|
||||
NC_("edit-action", "_Copy Named..."), NULL,
|
||||
NC_("edit-action", "Copy the selected pixels to a named buffer"),
|
||||
G_CALLBACK (edit_named_copy_cmd_callback),
|
||||
edit_named_copy_cmd_callback,
|
||||
GIMP_HELP_BUFFER_COPY },
|
||||
|
||||
{ "edit-named-copy-visible", NULL, /* GIMP_ICON_COPY_VISIBLE, */
|
||||
NC_("edit-action", "Copy _Visible Named..."), "",
|
||||
NC_("edit-action",
|
||||
"Copy what is visible in the selected region to a named buffer"),
|
||||
G_CALLBACK (edit_named_copy_visible_cmd_callback),
|
||||
edit_named_copy_visible_cmd_callback,
|
||||
GIMP_HELP_BUFFER_COPY },
|
||||
|
||||
{ "edit-named-paste", GIMP_ICON_EDIT_PASTE,
|
||||
NC_("edit-action", "_Paste Named..."), NULL,
|
||||
NC_("edit-action", "Paste the content of a named buffer"),
|
||||
G_CALLBACK (edit_named_paste_cmd_callback),
|
||||
edit_named_paste_cmd_callback,
|
||||
GIMP_HELP_BUFFER_PASTE },
|
||||
|
||||
{ "edit-clear", GIMP_ICON_EDIT_CLEAR,
|
||||
NC_("edit-action", "Cl_ear"), "Delete",
|
||||
NC_("edit-action", "Clear the selected pixels"),
|
||||
G_CALLBACK (edit_clear_cmd_callback),
|
||||
edit_clear_cmd_callback,
|
||||
GIMP_HELP_EDIT_CLEAR }
|
||||
};
|
||||
|
||||
@ -245,12 +245,12 @@ edit_actions_setup (GimpActionGroup *group)
|
||||
gimp_action_group_add_enum_actions (group, "edit-action",
|
||||
edit_paste_actions,
|
||||
G_N_ELEMENTS (edit_paste_actions),
|
||||
G_CALLBACK (edit_paste_cmd_callback));
|
||||
edit_paste_cmd_callback);
|
||||
|
||||
gimp_action_group_add_enum_actions (group, "edit-action",
|
||||
edit_fill_actions,
|
||||
G_N_ELEMENTS (edit_fill_actions),
|
||||
G_CALLBACK (edit_fill_cmd_callback));
|
||||
edit_fill_cmd_callback);
|
||||
|
||||
action = gimp_action_group_get_action (group,
|
||||
"edit-paste-as-new-image-short");
|
||||
|
Reference in New Issue
Block a user