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

@ -65,57 +65,57 @@ static const GimpActionEntry gradient_editor_actions[] =
{ "gradient-editor-left-color", NULL,
NC_("gradient-editor-action", "L_eft Endpoint's Color..."), NULL, NULL,
G_CALLBACK (gradient_editor_left_color_cmd_callback),
gradient_editor_left_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-right-color", NULL,
NC_("gradient-editor-action", "R_ight Endpoint's Color..."), NULL, NULL,
G_CALLBACK (gradient_editor_right_color_cmd_callback),
gradient_editor_right_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-flip", GIMP_ICON_OBJECT_FLIP_HORIZONTAL,
"flip", NULL, NULL,
G_CALLBACK (gradient_editor_flip_cmd_callback),
gradient_editor_flip_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-replicate", GIMP_ICON_OBJECT_DUPLICATE,
"replicate", NULL, NULL,
G_CALLBACK (gradient_editor_replicate_cmd_callback),
gradient_editor_replicate_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-split-midpoint", NULL,
"splitmidpoint", NULL, NULL,
G_CALLBACK (gradient_editor_split_midpoint_cmd_callback),
gradient_editor_split_midpoint_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_SPLIT_MIDPOINT },
{ "gradient-editor-split-uniform", NULL,
"splituniform", NULL, NULL,
G_CALLBACK (gradient_editor_split_uniformly_cmd_callback),
gradient_editor_split_uniformly_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_SPLIT_UNIFORM },
{ "gradient-editor-delete", GIMP_ICON_EDIT_DELETE,
"delete", "", NULL,
G_CALLBACK (gradient_editor_delete_cmd_callback),
gradient_editor_delete_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_DELETE },
{ "gradient-editor-recenter", NULL,
"recenter", NULL, NULL,
G_CALLBACK (gradient_editor_recenter_cmd_callback),
gradient_editor_recenter_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_RECENTER },
{ "gradient-editor-redistribute", NULL,
"redistribute", NULL, NULL,
G_CALLBACK (gradient_editor_redistribute_cmd_callback),
gradient_editor_redistribute_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_REDISTRIBUTE },
{ "gradient-editor-blend-color", NULL,
NC_("gradient-editor-action", "Ble_nd Endpoints' Colors"), NULL, NULL,
G_CALLBACK (gradient_editor_blend_color_cmd_callback),
gradient_editor_blend_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_BLEND_COLOR },
{ "gradient-editor-blend-opacity", NULL,
NC_("gradient-editor-action", "Blend Endpoints' Opacit_y"), NULL, NULL,
G_CALLBACK (gradient_editor_blend_opacity_cmd_callback),
gradient_editor_blend_opacity_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_BLEND_OPACITY }
};
@ -123,7 +123,7 @@ static const GimpToggleActionEntry gradient_editor_toggle_actions[] =
{
{ "gradient-editor-edit-active", GIMP_ICON_LINKED,
NC_("gradient-editor-action", "Edit Active Gradient"), NULL, NULL,
G_CALLBACK (data_editor_edit_active_cmd_callback),
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_GRADIENT_EDITOR_EDIT_ACTIVE }
};
@ -409,56 +409,56 @@ gradient_editor_actions_setup (GimpActionGroup *group)
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gradient_editor_load_left_actions,
G_N_ELEMENTS (gradient_editor_load_left_actions),
G_CALLBACK (gradient_editor_load_left_cmd_callback));
gradient_editor_load_left_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gradient_editor_save_left_actions,
G_N_ELEMENTS (gradient_editor_save_left_actions),
G_CALLBACK (gradient_editor_save_left_cmd_callback));
gradient_editor_save_left_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gradient_editor_load_right_actions,
G_N_ELEMENTS (gradient_editor_load_right_actions),
G_CALLBACK (gradient_editor_load_right_cmd_callback));
gradient_editor_load_right_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gradient_editor_save_right_actions,
G_N_ELEMENTS (gradient_editor_save_right_actions),
G_CALLBACK (gradient_editor_save_right_cmd_callback));
gradient_editor_save_right_cmd_callback);
gimp_action_group_add_radio_actions (group, "gradient-editor-color-type",
gradient_editor_left_color_type_actions,
G_N_ELEMENTS (gradient_editor_left_color_type_actions),
NULL,
0,
G_CALLBACK (gradient_editor_left_color_type_cmd_callback));
gradient_editor_left_color_type_cmd_callback);
gimp_action_group_add_radio_actions (group, "gradient-editor-color-type",
gradient_editor_right_color_type_actions,
G_N_ELEMENTS (gradient_editor_right_color_type_actions),
NULL,
0,
G_CALLBACK (gradient_editor_right_color_type_cmd_callback));
gradient_editor_right_color_type_cmd_callback);
gimp_action_group_add_radio_actions (group, "gradient-editor-blending",
gradient_editor_blending_actions,
G_N_ELEMENTS (gradient_editor_blending_actions),
NULL,
0,
G_CALLBACK (gradient_editor_blending_func_cmd_callback));
gradient_editor_blending_func_cmd_callback);
gimp_action_group_add_radio_actions (group, "gradient-editor-coloring",
gradient_editor_coloring_actions,
G_N_ELEMENTS (gradient_editor_coloring_actions),
NULL,
0,
G_CALLBACK (gradient_editor_coloring_type_cmd_callback));
gradient_editor_coloring_type_cmd_callback);
gimp_action_group_add_enum_actions (group, NULL,
gradient_editor_zoom_actions,
G_N_ELEMENTS (gradient_editor_zoom_actions),
G_CALLBACK (gradient_editor_zoom_cmd_callback));
gradient_editor_zoom_cmd_callback);
}
void