aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src/gtk/gtkactionobserver.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-08-24 19:53:29 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-08-24 19:53:29 +0200
commitc8b25f704b84636d657ad001414223f407822aee (patch)
tree78c35852d865f3d5229ef9ef0a10e17b87d5335b /libqmenumodel/src/gtk/gtkactionobserver.c
parent017363f11010aa1ec859a5a3f5fc76a7341539a3 (diff)
parentceaa2df6e9f96245a0e99edeb29a8b28c39c79b1 (diff)
downloadqmenumodel-c8b25f704b84636d657ad001414223f407822aee.tar.gz
qmenumodel-c8b25f704b84636d657ad001414223f407822aee.tar.bz2
qmenumodel-c8b25f704b84636d657ad001414223f407822aee.zip
Merge branch 'neochapay-update_gtk'HEADmain
Attributes GH PR #23: https://github.com/AyatanaIndicators/qmenumodel/pull/23
Diffstat (limited to 'libqmenumodel/src/gtk/gtkactionobserver.c')
-rw-r--r--libqmenumodel/src/gtk/gtkactionobserver.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/libqmenumodel/src/gtk/gtkactionobserver.c b/libqmenumodel/src/gtk/gtkactionobserver.c
index cf70b20..fda0ae7 100644
--- a/libqmenumodel/src/gtk/gtkactionobserver.c
+++ b/libqmenumodel/src/gtk/gtkactionobserver.c
@@ -23,7 +23,7 @@
G_DEFINE_INTERFACE (GtkActionObserver, gtk_action_observer, G_TYPE_OBJECT)
-/**
+/*< private >
* SECTION:gtkactionobserver
* @short_description: an interface implemented by objects that are
* interested in monitoring actions for changes
@@ -54,7 +54,7 @@ gtk_action_observer_default_init (GtkActionObserverInterface *class)
{
}
-/**
+/*< private >
* gtk_action_observer_action_added:
* @observer: a #GtkActionObserver
* @observable: the source of the event
@@ -85,7 +85,7 @@ gtk_action_observer_action_added (GtkActionObserver *observer,
->action_added (observer, observable, action_name, parameter_type, enabled, state);
}
-/**
+/*< private >
* gtk_action_observer_action_enabled_changed:
* @observer: a #GtkActionObserver
* @observable: the source of the event
@@ -110,7 +110,7 @@ gtk_action_observer_action_enabled_changed (GtkActionObserver *observer,
->action_enabled_changed (observer, observable, action_name, enabled);
}
-/**
+/*< private >
* gtk_action_observer_action_state_changed:
* @observer: a #GtkActionObserver
* @observable: the source of the event
@@ -135,7 +135,7 @@ gtk_action_observer_action_state_changed (GtkActionObserver *observer,
->action_state_changed (observer, observable, action_name, state);
}
-/**
+/*< private >
* gtk_action_observer_action_removed:
* @observer: a #GtkActionObserver
* @observable: the source of the event
@@ -157,3 +157,33 @@ gtk_action_observer_action_removed (GtkActionObserver *observer,
GTK_ACTION_OBSERVER_GET_IFACE (observer)
->action_removed (observer, observable, action_name);
}
+
+/*< private >
+ * gtk_action_observer_primary_accel_changed:
+ * @observer: a #GtkActionObserver
+ * @observable: the source of the event
+ * @action_name: the name of the action
+ * @action_and_target: detailed action of the changed accel, in “action and target” format
+ *
+ * This function is called when an action that the observer is
+ * registered to receive events for has one of its accelerators changed.
+ *
+ * Accelerator changes are reported for all targets associated with the
+ * action. The @action_and_target string should be used to check if the
+ * reported target is the one that the observer is interested in.
+ */
+void
+gtk_action_observer_primary_accel_changed (GtkActionObserver *observer,
+ GtkActionObservable *observable,
+ const gchar *action_name,
+ const gchar *action_and_target)
+{
+ GtkActionObserverInterface *iface;
+
+ g_return_if_fail (GTK_IS_ACTION_OBSERVER (observer));
+
+ iface = GTK_ACTION_OBSERVER_GET_IFACE (observer);
+
+ if (iface->primary_accel_changed)
+ iface->primary_accel_changed (observer, observable, action_name, action_and_target);
+}