[gnome-flashback/wip/flashback: 7/9] libkey-grabber: update dbus name
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback/wip/flashback: 7/9] libkey-grabber: update dbus name
- Date: Fri, 9 Jan 2015 21:36:21 +0000 (UTC)
commit 49f86b48146dc8078e7d5d7e5d5b246bdfb23583
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Dec 14 01:07:55 2014 +0200
libkey-grabber: update dbus name
Own org.gnome.Shell.KeyGrabber.
gnome-flashback/libkey-grabber/Makefile.am | 23 ++++++-------
.../libkey-grabber/flashback-key-grabber.c | 34 ++++++++++----------
...yGrabber.xml => org.gnome.Shell.KeyGrabber.xml} | 2 +-
3 files changed, 28 insertions(+), 31 deletions(-)
---
diff --git a/gnome-flashback/libkey-grabber/Makefile.am b/gnome-flashback/libkey-grabber/Makefile.am
index 5f59776..59ef4be 100644
--- a/gnome-flashback/libkey-grabber/Makefile.am
+++ b/gnome-flashback/libkey-grabber/Makefile.am
@@ -6,8 +6,7 @@ AM_CPPFLAGS = \
-I$(top_builddir)/gnome-flashback/libkey-grabber
libkey_grabber_la_SOURCES = \
- dbus-key-grabber.c \
- dbus-key-grabber.h \
+ $(BUILT_SOURCES) \
flashback-key-grabber.c \
flashback-key-grabber.h \
flashback-key-bindings.c \
@@ -16,21 +15,19 @@ libkey_grabber_la_SOURCES = \
libkey_grabber_la_LIBADD = \
$(KEY_GRABBER_LIBS)
-dbus-key-grabber.h:
-dbus-key-grabber.c: org.gnome.KeyGrabber.xml
- $(AM_V_GEN) gdbus-codegen \
- --interface-prefix org.gnome. \
- --c-namespace DBus \
- --generate-c-code dbus-key-grabber \
- --c-generate-object-manager \
- $(srcdir)/org.gnome.KeyGrabber.xml
+shell-key-grabber.c: shell-key-grabber.h
+shell-key-grabber.h: Makefile.am org.gnome.Shell.KeyGrabber.xml
+ gdbus-codegen --interface-prefix org.gnome.Shell \
+ --generate-c-code shell-key-grabber \
+ --c-namespace Shell \
+ $(srcdir)/org.gnome.Shell.KeyGrabber.xml
BUILT_SOURCES = \
- dbus-key-grabber.c \
- dbus-key-grabber.h
+ shell-key-grabber.c \
+ shell-key-grabber.h
EXTRA_DIST = \
- org.gnome.KeyGrabber.xml
+ org.gnome.Shell.KeyGrabber.xml
CLEANFILES = \
$(BUILT_SOURCES)
diff --git a/gnome-flashback/libkey-grabber/flashback-key-grabber.c
b/gnome-flashback/libkey-grabber/flashback-key-grabber.c
index e83d40e..28e5f0d 100644
--- a/gnome-flashback/libkey-grabber/flashback-key-grabber.c
+++ b/gnome-flashback/libkey-grabber/flashback-key-grabber.c
@@ -20,10 +20,10 @@
#include "flashback-key-grabber.h"
#include "flashback-key-bindings.h"
-#include "dbus-key-grabber.h"
+#include "shell-key-grabber.h"
-#define KEY_GRABBER_DBUS_NAME "org.gnome.Shell"
-#define KEY_GRABBER_DBUS_PATH "/org/gnome/Shell"
+#define SHELL_KEY_GRABBER_DBUS_NAME "org.gnome.Shell.KeyGrabber"
+#define SHELL_KEY_GRABBER_DBUS_PATH "/org/gnome/Shell/KeyGrabber"
struct _FlashbackKeyGrabberPrivate {
gint bus_name;
@@ -48,10 +48,10 @@ binding_activated (FlashbackKeyBindings *bindings,
grabber = FLASHBACK_KEY_GRABBER (user_data);
- dbus_key_grabber_emit_accelerator_activated (DBUS_KEY_GRABBER (grabber->priv->iface),
- action,
- device,
- timestamp);
+ shell_key_grabber_emit_accelerator_activated (SHELL_KEY_GRABBER (grabber->priv->iface),
+ action,
+ device,
+ timestamp);
}
static gint
@@ -145,7 +145,7 @@ grab_accelerator (FlashbackKeyGrabber *grabber,
}
static gboolean
-handle_grab_accelerator (DBusKeyGrabber *object,
+handle_grab_accelerator (ShellKeyGrabber *object,
GDBusMethodInvocation *invocation,
const gchar *accelerator,
guint flags,
@@ -157,13 +157,13 @@ handle_grab_accelerator (DBusKeyGrabber *object,
sender = g_dbus_method_invocation_get_sender (invocation);
action = grab_accelerator (grabber, accelerator, flags, sender);
- dbus_key_grabber_complete_grab_accelerator (object, invocation, action);
+ shell_key_grabber_complete_grab_accelerator (object, invocation, action);
return TRUE;
}
static gboolean
-handle_grab_accelerators (DBusKeyGrabber *object,
+handle_grab_accelerators (ShellKeyGrabber *object,
GDBusMethodInvocation *invocation,
GVariant *accelerators,
FlashbackKeyGrabber *grabber)
@@ -192,13 +192,13 @@ handle_grab_accelerators (DBusKeyGrabber *object,
g_variant_unref (child);
}
- dbus_key_grabber_complete_grab_accelerators (object, invocation, g_variant_builder_end (&builder));
+ shell_key_grabber_complete_grab_accelerators (object, invocation, g_variant_builder_end (&builder));
return TRUE;
}
static gboolean
-handle_ungrab_accelerator (DBusKeyGrabber *object,
+handle_ungrab_accelerator (ShellKeyGrabber *object,
GDBusMethodInvocation *invocation,
guint action,
FlashbackKeyGrabber *grabber)
@@ -217,7 +217,7 @@ handle_ungrab_accelerator (DBusKeyGrabber *object,
g_hash_table_remove (grabber->priv->grabbed_accelerators, GUINT_TO_POINTER (action));
}
- dbus_key_grabber_complete_ungrab_accelerator (object, invocation, ret);
+ shell_key_grabber_complete_ungrab_accelerator (object, invocation, ret);
return TRUE;
}
@@ -228,11 +228,11 @@ on_bus_acquired (GDBusConnection *connection,
gpointer user_data)
{
FlashbackKeyGrabber *grabber;
- DBusKeyGrabber *skeleton;
+ ShellKeyGrabber *skeleton;
GError *error;
grabber = FLASHBACK_KEY_GRABBER (user_data);
- skeleton = dbus_key_grabber_skeleton_new ();
+ skeleton = shell_key_grabber_skeleton_new ();
grabber->priv->iface = G_DBUS_INTERFACE_SKELETON (skeleton);
@@ -246,7 +246,7 @@ on_bus_acquired (GDBusConnection *connection,
error = NULL;
if (!g_dbus_interface_skeleton_export (grabber->priv->iface,
connection,
- KEY_GRABBER_DBUS_PATH,
+ SHELL_KEY_GRABBER_DBUS_PATH,
&error)) {
g_warning ("Failed to export interface: %s", error->message);
g_error_free (error);
@@ -294,7 +294,7 @@ flashback_key_grabber_init (FlashbackKeyGrabber *grabber)
G_CALLBACK (binding_activated), grabber);
grabber->priv->bus_name = g_bus_own_name (G_BUS_TYPE_SESSION,
- KEY_GRABBER_DBUS_NAME,
+ SHELL_KEY_GRABBER_DBUS_NAME,
G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
G_BUS_NAME_OWNER_FLAGS_REPLACE,
on_bus_acquired,
diff --git a/gnome-flashback/libkey-grabber/org.gnome.KeyGrabber.xml
b/gnome-flashback/libkey-grabber/org.gnome.Shell.KeyGrabber.xml
similarity index 94%
rename from gnome-flashback/libkey-grabber/org.gnome.KeyGrabber.xml
rename to gnome-flashback/libkey-grabber/org.gnome.Shell.KeyGrabber.xml
index b47e9c8..337dd47 100644
--- a/gnome-flashback/libkey-grabber/org.gnome.KeyGrabber.xml
+++ b/gnome-flashback/libkey-grabber/org.gnome.Shell.KeyGrabber.xml
@@ -1,5 +1,5 @@
<node>
- <interface name="org.gnome.Shell">
+ <interface name="org.gnome.Shell.KeyGrabber">
<annotation name="org.gtk.GDBus.C.Name" value="KeyGrabber"/>
<method name="GrabAccelerator">
<arg type="s" direction="in" name="accelerator"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]