31 #define SD_NAME "org.gnome.SettingsDaemon"
32 #define SD_OBJECT_PATH "/org/gnome/SettingsDaemon/MediaKeys"
33 #define SD_INTERFACE "org.gnome.SettingsDaemon.MediaKeys"
66 GObjectClass *object_class = G_OBJECT_CLASS (klass);
71 g_signal_new (
"key_pressed",
76 g_cclosure_marshal_VOID__STRING,
91 name_owner = g_dbus_proxy_get_name_owner (keys->
proxy);
107 g_dbus_proxy_call (keys->
proxy,
108 "GrabMediaPlayerKeys",
109 g_variant_new (
"(su)",
"Evince", 1),
110 G_DBUS_CALL_FLAGS_NO_AUTO_START,
121 g_dbus_proxy_call (keys->
proxy,
122 "ReleaseMediaPlayerKeys",
123 g_variant_new (
"(s)",
"Evince"),
124 G_DBUS_CALL_FLAGS_NO_AUTO_START,
133 GVariant *parameters,
136 const char *application, *key;
138 if (g_strcmp0 (sender_name,
SD_NAME) != 0)
141 if (g_strcmp0 (signal_name,
"MediaPlayerKeyPressed") != 0)
144 if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE (
"(ss)")))
147 g_variant_get (parameters,
"(&s&s)", &application, &key);
149 if (strcmp (
"Evince", application) == 0) {
172 proxy = g_dbus_proxy_new_for_bus_finish (res, NULL);
178 g_signal_connect (proxy,
"g-signal",
181 g_signal_connect (proxy,
"notify::g-name-owner",
193 g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
194 G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
207 if (keys->
proxy == NULL)
218 if (keys->
proxy != NULL) {
220 g_object_unref (keys->
proxy);
225 G_OBJECT_CLASS (ev_media_player_keys_parent_class)->finalize (
object);