widget: Add parameter type back to install_action

Adapt all callers.
This commit is contained in:
Matthias Clasen 2019-06-22 14:24:46 -04:00
parent 3c6045e300
commit 7e73da5f73
8 changed files with 37 additions and 35 deletions

View File

@ -713,12 +713,10 @@ gtk_color_chooser_widget_class_init (GtkColorChooserWidgetClass *class)
gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (class), I_("colorchooser")); gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (class), I_("colorchooser"));
gtk_widget_class_install_stateful_action (GTK_WIDGET_CLASS (class), "color.select", gtk_widget_class_install_action (GTK_WIDGET_CLASS (class), "color.select", "(dddd)",
gtk_color_chooser_widget_activate_color_select, gtk_color_chooser_widget_activate_color_select);
"(dddd)", NULL, NULL, NULL); gtk_widget_class_install_action (GTK_WIDGET_CLASS (class), "color.customize", "(dddd)",
gtk_widget_class_install_stateful_action (GTK_WIDGET_CLASS (class), "color.customize", gtk_color_chooser_widget_activate_color_customize);
gtk_color_chooser_widget_activate_color_customize,
"(dddd)", NULL, NULL, NULL);
} }
/* GtkColorChooser implementation {{{1 */ /* GtkColorChooser implementation {{{1 */

View File

@ -1160,19 +1160,19 @@ gtk_label_class_init (GtkLabelClass *class)
quark_gtk_signal = g_quark_from_static_string ("gtk-signal"); quark_gtk_signal = g_quark_from_static_string ("gtk-signal");
quark_link = g_quark_from_static_string ("link"); quark_link = g_quark_from_static_string ("link");
gtk_widget_class_install_action (widget_class, "clipboard.cut", gtk_widget_class_install_action (widget_class, "clipboard.cut", NULL,
gtk_label_nop); gtk_label_nop);
gtk_widget_class_install_action (widget_class, "clipboard.copy", gtk_widget_class_install_action (widget_class, "clipboard.copy", NULL,
gtk_label_activate_clipboard_copy); gtk_label_activate_clipboard_copy);
gtk_widget_class_install_action (widget_class, "clipboard.paste", gtk_widget_class_install_action (widget_class, "clipboard.paste", NULL,
gtk_label_nop); gtk_label_nop);
gtk_widget_class_install_action (widget_class, "selection.delete", gtk_widget_class_install_action (widget_class, "selection.delete", NULL,
gtk_label_nop); gtk_label_nop);
gtk_widget_class_install_action (widget_class, "selection.select-all", gtk_widget_class_install_action (widget_class, "selection.select-all", NULL,
gtk_label_activate_selection_select_all); gtk_label_activate_selection_select_all);
gtk_widget_class_install_action (widget_class, "link.open", gtk_widget_class_install_action (widget_class, "link.open", NULL,
gtk_label_activate_link_open); gtk_label_activate_link_open);
gtk_widget_class_install_action (widget_class, "link.copy", gtk_widget_class_install_action (widget_class, "link.copy", NULL,
gtk_label_activate_link_copy); gtk_label_activate_link_copy);
} }

View File

@ -232,7 +232,7 @@ gtk_link_button_class_init (GtkLinkButtonClass *klass)
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_LINK_BUTTON_ACCESSIBLE); gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_LINK_BUTTON_ACCESSIBLE);
gtk_widget_class_set_css_name (widget_class, I_("button")); gtk_widget_class_set_css_name (widget_class, I_("button"));
gtk_widget_class_install_action (widget_class, "clipboard.copy", gtk_widget_class_install_action (widget_class, "clipboard.copy", NULL,
gtk_link_button_activate_clipboard_copy); gtk_link_button_activate_clipboard_copy);
} }

View File

@ -1363,21 +1363,21 @@ gtk_text_class_init (GtkTextClass *class)
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_TEXT_ACCESSIBLE); gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_TEXT_ACCESSIBLE);
gtk_widget_class_set_css_name (widget_class, I_("text")); gtk_widget_class_set_css_name (widget_class, I_("text"));
gtk_widget_class_install_action (widget_class, "clipboard.cut", gtk_widget_class_install_action (widget_class, "clipboard.cut", NULL,
gtk_text_activate_clipboard_cut); gtk_text_activate_clipboard_cut);
gtk_widget_class_install_action (widget_class, "clipboard.copy", gtk_widget_class_install_action (widget_class, "clipboard.copy", NULL,
gtk_text_activate_clipboard_copy); gtk_text_activate_clipboard_copy);
gtk_widget_class_install_action (widget_class, "clipboard.paste", gtk_widget_class_install_action (widget_class, "clipboard.paste", NULL,
gtk_text_activate_clipboard_paste); gtk_text_activate_clipboard_paste);
gtk_widget_class_install_action (widget_class, "selection.delete", gtk_widget_class_install_action (widget_class, "selection.delete", NULL,
gtk_text_activate_selection_delete); gtk_text_activate_selection_delete);
gtk_widget_class_install_action (widget_class, "selection.select-all", gtk_widget_class_install_action (widget_class, "selection.select-all", NULL,
gtk_text_activate_selection_select_all); gtk_text_activate_selection_select_all);
gtk_widget_class_install_action (widget_class, "misc.insert-emoji", gtk_widget_class_install_action (widget_class, "misc.insert-emoji", NULL,
gtk_text_activate_misc_insert_emoji); gtk_text_activate_misc_insert_emoji);
gtk_widget_class_install_stateful_action (widget_class, "misc.toggle-visibility", gtk_widget_class_install_stateful_action (widget_class, "misc.toggle-visibility", NULL,
gtk_text_activate_misc_toggle_visibility, gtk_text_activate_misc_toggle_visibility,
NULL, "b", "b",
gtk_text_set_misc_toggle_visibility, gtk_text_set_misc_toggle_visibility,
gtk_text_get_misc_toggle_visibility); gtk_text_get_misc_toggle_visibility);
} }

View File

@ -1602,17 +1602,17 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
quark_gtk_signal = g_quark_from_static_string ("gtk-signal"); quark_gtk_signal = g_quark_from_static_string ("gtk-signal");
quark_text_view_child = g_quark_from_static_string ("gtk-text-view-child"); quark_text_view_child = g_quark_from_static_string ("gtk-text-view-child");
gtk_widget_class_install_action (widget_class, "clipboard.cut", gtk_widget_class_install_action (widget_class, "clipboard.cut", NULL,
gtk_text_view_activate_clipboard_cut); gtk_text_view_activate_clipboard_cut);
gtk_widget_class_install_action (widget_class, "clipboard.copy", gtk_widget_class_install_action (widget_class, "clipboard.copy", NULL,
gtk_text_view_activate_clipboard_copy); gtk_text_view_activate_clipboard_copy);
gtk_widget_class_install_action (widget_class, "clipboard.paste", gtk_widget_class_install_action (widget_class, "clipboard.paste", NULL,
gtk_text_view_activate_clipboard_paste); gtk_text_view_activate_clipboard_paste);
gtk_widget_class_install_action (widget_class, "selection.delete", gtk_widget_class_install_action (widget_class, "selection.delete", NULL,
gtk_text_view_activate_selection_delete); gtk_text_view_activate_selection_delete);
gtk_widget_class_install_action (widget_class, "selection.select-all", gtk_widget_class_install_action (widget_class, "selection.select-all", NULL,
gtk_text_view_activate_selection_select_all); gtk_text_view_activate_selection_select_all);
gtk_widget_class_install_action (widget_class, "misc.insert-emoji", gtk_widget_class_install_action (widget_class, "misc.insert-emoji", NULL,
gtk_text_view_activate_misc_insert_emoji); gtk_text_view_activate_misc_insert_emoji);
} }

View File

@ -13434,6 +13434,7 @@ gtk_widget_should_layout (GtkWidget *widget)
* gtk_widget_class_install_action: * gtk_widget_class_install_action:
* @widget_class: a #GtkWidgetClass * @widget_class: a #GtkWidgetClass
* @action_name: a prefixed action name, such as "clipboard.paste" * @action_name: a prefixed action name, such as "clipboard.paste"
* @parameter_type: (allow-none): the parameter type, or %NULL
* @activate: callback to use when the action is activated * @activate: callback to use when the action is activated
* *
* This should be called at class initialization time to specify * This should be called at class initialization time to specify
@ -13446,18 +13447,20 @@ gtk_widget_should_layout (GtkWidget *widget)
void void
gtk_widget_class_install_action (GtkWidgetClass *widget_class, gtk_widget_class_install_action (GtkWidgetClass *widget_class,
const char *action_name, const char *action_name,
const char *parameter_type,
GtkWidgetActionActivateFunc activate) GtkWidgetActionActivateFunc activate)
{ {
gtk_widget_class_install_stateful_action (widget_class, action_name, activate, gtk_widget_class_install_stateful_action (widget_class, action_name,
NULL, NULL, NULL, NULL); parameter_type, activate,
NULL, NULL, NULL);
} }
/* /*
* gtk_widget_class_install_stateful_action: * gtk_widget_class_install_stateful_action:
* @widget_class: a #GtkWidgetClass * @widget_class: a #GtkWidgetClass
* @action_name: a prefixed action name, such as "clipboard.paste" * @action_name: a prefixed action name, such as "clipboard.paste"
* @activate: callback to use when the action is activated
* @parameter_type: (allow-none): the parameter type, or %NULL * @parameter_type: (allow-none): the parameter type, or %NULL
* @activate: callback to use when the action is activated
* @state_type: (allow-none): the state type, or %NULL * @state_type: (allow-none): the state type, or %NULL
* @set_state: (allow-none): callback to use when the action state * @set_state: (allow-none): callback to use when the action state
is set, or %NULL for stateless actions is set, or %NULL for stateless actions
@ -13473,8 +13476,8 @@ gtk_widget_class_install_action (GtkWidgetClass *widget_class,
void void
gtk_widget_class_install_stateful_action (GtkWidgetClass *widget_class, gtk_widget_class_install_stateful_action (GtkWidgetClass *widget_class,
const char *action_name, const char *action_name,
GtkWidgetActionActivateFunc activate,
const char *parameter_type, const char *parameter_type,
GtkWidgetActionActivateFunc activate,
const char *state_type, const char *state_type,
GtkWidgetActionSetStateFunc set_state, GtkWidgetActionSetStateFunc set_state,
GtkWidgetActionGetStateFunc get_state) GtkWidgetActionGetStateFunc get_state)
@ -13505,8 +13508,8 @@ gtk_widget_class_install_stateful_action (GtkWidgetClass *widget_cl
action = g_new0 (GtkWidgetAction, 1); action = g_new0 (GtkWidgetAction, 1);
action->owner = G_TYPE_FROM_CLASS (widget_class); action->owner = G_TYPE_FROM_CLASS (widget_class);
action->name = g_strdup (action_name); action->name = g_strdup (action_name);
action->activate = activate;
action->parameter_type = parameter_type ? g_variant_type_new (parameter_type) : NULL; action->parameter_type = parameter_type ? g_variant_type_new (parameter_type) : NULL;
action->activate = activate;
action->state_type = state_type ? g_variant_type_new (state_type) : NULL; action->state_type = state_type ? g_variant_type_new (state_type) : NULL;
action->set_state = set_state; action->set_state = set_state;
action->get_state = get_state; action->get_state = get_state;

View File

@ -1073,13 +1073,14 @@ typedef void (*GtkWidgetActionSetStateFunc) (GtkWidget *widget,
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_widget_class_install_action (GtkWidgetClass *widget_class, void gtk_widget_class_install_action (GtkWidgetClass *widget_class,
const char *action_name, const char *action_name,
const char *parameter_type,
GtkWidgetActionActivateFunc activate); GtkWidgetActionActivateFunc activate);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_widget_class_install_stateful_action (GtkWidgetClass *widget_class, void gtk_widget_class_install_stateful_action (GtkWidgetClass *widget_class,
const char *action_name, const char *action_name,
GtkWidgetActionActivateFunc activate,
const char *parameter_type, const char *parameter_type,
GtkWidgetActionActivateFunc activate,
const char *state_type, const char *state_type,
GtkWidgetActionSetStateFunc set_state, GtkWidgetActionSetStateFunc set_state,
GtkWidgetActionGetStateFunc get_state); GtkWidgetActionGetStateFunc get_state);

View File

@ -1176,7 +1176,7 @@ gtk_window_class_init (GtkWindowClass *klass)
* Key bindings * Key bindings
*/ */
gtk_widget_class_install_action (widget_class, "default.activate", gtk_widget_class_install_action (widget_class, "default.activate", NULL,
gtk_window_activate_default_activate); gtk_window_activate_default_activate);
binding_set = gtk_binding_set_by_class (klass); binding_set = gtk_binding_set_by_class (klass);