[gnome-flashback/wip/flashback] libkey-grabber: adjust to ShellKeyGrabber changes
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback/wip/flashback] libkey-grabber: adjust to ShellKeyGrabber changes
- Date: Mon, 29 Dec 2014 13:46:31 +0000 (UTC)
commit 2c0574ff5be3c7fe9528b73a8a53f0ba0b434fee
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Dec 29 15:40:51 2014 +0200
libkey-grabber: adjust to ShellKeyGrabber changes
.../libkey-grabber/flashback-key-bindings.c | 31 +++++++++++++++++--
.../libkey-grabber/flashback-key-bindings.h | 3 +-
.../libkey-grabber/flashback-key-grabber.c | 6 +--
.../libkey-grabber/org.gnome.Shell.KeyGrabber.xml | 3 +-
4 files changed, 31 insertions(+), 12 deletions(-)
---
diff --git a/gnome-flashback/libkey-grabber/flashback-key-bindings.c
b/gnome-flashback/libkey-grabber/flashback-key-bindings.c
index 41f59d7..d06c95b 100644
--- a/gnome-flashback/libkey-grabber/flashback-key-bindings.c
+++ b/gnome-flashback/libkey-grabber/flashback-key-bindings.c
@@ -84,6 +84,25 @@ get_real_modifiers (GdkModifierType modifiers)
return mods;
}
+static GVariant *
+build_parameters (guint device_id,
+ guint timestamp,
+ guint action_mode)
+{
+ GVariantBuilder *builder;
+ GVariant *parameters;
+
+ builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
+ g_variant_builder_add (builder, "{sv}", "device-id", g_variant_new_uint32 (device_id));
+ g_variant_builder_add (builder, "{sv}", "timestamp", g_variant_new_uint32 (timestamp));
+ g_variant_builder_add (builder, "{sv}", "action-mode", g_variant_new_uint32 (action_mode));
+
+ parameters = g_variant_new ("a{sv}", builder);
+ g_variant_builder_unref (builder);
+
+ return parameters;
+}
+
static GdkFilterReturn
filter_func (GdkXEvent *xevent,
GdkEvent *event,
@@ -107,8 +126,13 @@ filter_func (GdkXEvent *xevent,
if (binding->keycode == ev->xkey.keycode &&
binding->modifiers == (ev->xkey.state & 0xff &
~(bindings->priv->ignored_modifier_mask))) {
+ GVariant *parameters;
+
+ parameters = build_parameters (0, 0, 0);
+
g_signal_emit (bindings, signals[BINDING_ACTIVATED], 0,
- binding->action, 0, 0);
+ binding->action,
+ parameters);
break;
}
}
@@ -217,10 +241,9 @@ flashback_key_bindings_class_init (FlashbackKeyBindingsClass *class)
G_STRUCT_OFFSET (FlashbackKeyBindingsClass, binding_activated),
NULL, NULL, NULL,
G_TYPE_NONE,
- 3,
- G_TYPE_UINT,
+ 2,
G_TYPE_UINT,
- G_TYPE_UINT);
+ G_TYPE_VARIANT);
}
FlashbackKeyBindings *
diff --git a/gnome-flashback/libkey-grabber/flashback-key-bindings.h
b/gnome-flashback/libkey-grabber/flashback-key-bindings.h
index e53fabc..9a46dad 100644
--- a/gnome-flashback/libkey-grabber/flashback-key-bindings.h
+++ b/gnome-flashback/libkey-grabber/flashback-key-bindings.h
@@ -43,8 +43,7 @@ struct _FlashbackKeyBindingsClass {
void (*binding_activated) (FlashbackKeyBindings *bindings,
guint action,
- guint device,
- guint timestamp);
+ GVariant *parameters);
};
GType flashback_key_bindings_get_type (void);
diff --git a/gnome-flashback/libkey-grabber/flashback-key-grabber.c
b/gnome-flashback/libkey-grabber/flashback-key-grabber.c
index 28e5f0d..460e845 100644
--- a/gnome-flashback/libkey-grabber/flashback-key-grabber.c
+++ b/gnome-flashback/libkey-grabber/flashback-key-grabber.c
@@ -40,8 +40,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (FlashbackKeyGrabber, flashback_key_grabber, G_TYPE_O
static void
binding_activated (FlashbackKeyBindings *bindings,
guint action,
- guint device,
- guint timestamp,
+ GVariant *parameters,
gpointer user_data)
{
FlashbackKeyGrabber *grabber;
@@ -50,8 +49,7 @@ binding_activated (FlashbackKeyBindings *bindings,
shell_key_grabber_emit_accelerator_activated (SHELL_KEY_GRABBER (grabber->priv->iface),
action,
- device,
- timestamp);
+ parameters);
}
static gint
diff --git a/gnome-flashback/libkey-grabber/org.gnome.Shell.KeyGrabber.xml
b/gnome-flashback/libkey-grabber/org.gnome.Shell.KeyGrabber.xml
index 337dd47..ddd6d82 100644
--- a/gnome-flashback/libkey-grabber/org.gnome.Shell.KeyGrabber.xml
+++ b/gnome-flashback/libkey-grabber/org.gnome.Shell.KeyGrabber.xml
@@ -16,8 +16,7 @@
</method>
<signal name="AcceleratorActivated">
<arg type="u" name="action"/>
- <arg type="u" name="device"/>
- <arg type="u" name="timestamp"/>
+ <arg type="a{sv}" name="parameters"/>
</signal>
</interface>
</node>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]