Merge lp:~ballogy/gloobus-preview/gdbus-port into lp:gloobus-preview
- gdbus-port
- Merge into last_working_branch
Proposed by
Balló György
Status: | Merged |
---|---|
Merged at revision: | 308 |
Proposed branch: | lp:~ballogy/gloobus-preview/gdbus-port |
Merge into: | lp:gloobus-preview |
Diff against target: |
420 lines (+196/-146) 4 files modified
configure.ac (+0/-1) src/Makefile.am (+0/-2) src/gloobus-preview-interface-media.cpp (+189/-139) src/gloobus-preview-interface-media.h (+7/-4) |
To merge this branch: | bzr merge lp:~ballogy/gloobus-preview/gdbus-port |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gloobus Developers | Pending | ||
Review via email: mp+245386@code.launchpad.net |
Commit message
Description of the change
Port media keys handling to GDBus
This removes the dbus-glib dependency.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'configure.ac' | |||
2 | --- configure.ac 2014-12-25 16:27:26 +0000 | |||
3 | +++ configure.ac 2014-12-26 19:18:18 +0000 | |||
4 | @@ -54,7 +54,6 @@ | |||
5 | 54 | PKG_CHECK_MODULES(GXPS, libgxps) | 54 | PKG_CHECK_MODULES(GXPS, libgxps) |
6 | 55 | PKG_CHECK_MODULES(FREETYPE,freetype2) | 55 | PKG_CHECK_MODULES(FREETYPE,freetype2) |
7 | 56 | PKG_CHECK_MODULES(GLIB, glib-2.0) | 56 | PKG_CHECK_MODULES(GLIB, glib-2.0) |
8 | 57 | PKG_CHECK_MODULES(DBUS, dbus-glib-1) | ||
9 | 58 | PKG_CHECK_MODULES(X11, x11) | 57 | PKG_CHECK_MODULES(X11, x11) |
10 | 59 | 58 | ||
11 | 60 | PKG_CHECK_MODULES(GMODULE, gmodule-2.0) # To compile XCF loader | 59 | PKG_CHECK_MODULES(GMODULE, gmodule-2.0) # To compile XCF loader |
12 | 61 | 60 | ||
13 | === modified file 'src/Makefile.am' | |||
14 | --- src/Makefile.am 2014-12-25 16:27:26 +0000 | |||
15 | +++ src/Makefile.am 2014-12-26 19:18:18 +0000 | |||
16 | @@ -26,7 +26,6 @@ | |||
17 | 26 | $(PTHREAD_CFLAGS) \ | 26 | $(PTHREAD_CFLAGS) \ |
18 | 27 | $(GTKSOURCEVIEW_CFLAGS) \ | 27 | $(GTKSOURCEVIEW_CFLAGS) \ |
19 | 28 | $(GLIB_CFLAGS) \ | 28 | $(GLIB_CFLAGS) \ |
20 | 29 | $(DBUS_CFLAGS) \ | ||
21 | 30 | $(X11_CFLAGS) \ | 29 | $(X11_CFLAGS) \ |
22 | 31 | $(BOOST_CPPFLAGS) | 30 | $(BOOST_CPPFLAGS) |
23 | 32 | 31 | ||
24 | @@ -36,7 +35,6 @@ | |||
25 | 36 | $(GTK_LIBS) \ | 35 | $(GTK_LIBS) \ |
26 | 37 | $(GTKSOURCEVIEW_LIBS) \ | 36 | $(GTKSOURCEVIEW_LIBS) \ |
27 | 38 | $(GLIB_LIBS) \ | 37 | $(GLIB_LIBS) \ |
28 | 39 | $(DBUS_LIBS) \ | ||
29 | 40 | $(X11_LIBS) \ | 38 | $(X11_LIBS) \ |
30 | 41 | -ldl | 39 | -ldl |
31 | 42 | 40 | ||
32 | 43 | 41 | ||
33 | === modified file 'src/gloobus-preview-interface-media.cpp' | |||
34 | --- src/gloobus-preview-interface-media.cpp 2012-04-06 10:59:53 +0000 | |||
35 | +++ src/gloobus-preview-interface-media.cpp 2014-12-26 19:18:18 +0000 | |||
36 | @@ -27,17 +27,6 @@ | |||
37 | 27 | 27 | ||
38 | 28 | #include "gloobus-preview-interface-media.h" | 28 | #include "gloobus-preview-interface-media.h" |
39 | 29 | 29 | ||
40 | 30 | // GNOME MEDIA KEYS HANDLING ================================================ // | ||
41 | 31 | #include <dbus/dbus-glib.h> | ||
42 | 32 | |||
43 | 33 | static void dbus_proxy_destroy_cb (DBusGProxy *proxy, gpointer data); | ||
44 | 34 | static void media_key_pressed_cb (DBusGProxy *proxy, const gchar *application, const gchar *key, gpointer data); | ||
45 | 35 | static void media_marshal_VOID__STRING_STRING (GClosure *closure, | ||
46 | 36 | GValue *return_value G_GNUC_UNUSED, | ||
47 | 37 | guint n_param_values, | ||
48 | 38 | const GValue *param_values, | ||
49 | 39 | gpointer invocation_hint G_GNUC_UNUSED, | ||
50 | 40 | gpointer marshal_data); | ||
51 | 41 | // ========================================================================== // | 30 | // ========================================================================== // |
52 | 42 | 31 | ||
53 | 43 | iMedia::iMedia( void ) | 32 | iMedia::iMedia( void ) |
54 | @@ -47,8 +36,11 @@ | |||
55 | 47 | ,timeout_id(0) | 36 | ,timeout_id(0) |
56 | 48 | ,f_visible(false) | 37 | ,f_visible(false) |
57 | 49 | ,duration(0) | 38 | ,duration(0) |
60 | 50 | ,dbus_proxy(0) | 39 | ,proxy(0) |
61 | 51 | ,focus_in_id(0) | 40 | ,handler_id(0) |
62 | 41 | ,watch_id(0) | ||
63 | 42 | ,cancellable_init(0) | ||
64 | 43 | ,cancellable(0) | ||
65 | 52 | { | 44 | { |
66 | 53 | g_debug("Creating iMedia"); | 45 | g_debug("Creating iMedia"); |
67 | 54 | activate_media_keys(); //TODO: is it the best place to do it? | 46 | activate_media_keys(); //TODO: is it the best place to do it? |
68 | @@ -306,139 +298,197 @@ | |||
69 | 306 | ((iMedia*)data)->f_visible = false; | 298 | ((iMedia*)data)->f_visible = false; |
70 | 307 | } | 299 | } |
71 | 308 | 300 | ||
72 | 301 | static void on_media_player_key_pressed (gpointer data, | ||
73 | 302 | const gchar *key) | ||
74 | 303 | { | ||
75 | 304 | iMedia *media = (iMedia*)data; | ||
76 | 305 | |||
77 | 306 | if (g_strcmp0 ("Play", key) == 0) | ||
78 | 307 | media->play_pause(); | ||
79 | 308 | else if (g_strcmp0 ("Previous", key) == 0) | ||
80 | 309 | media->previous(); | ||
81 | 310 | else if (g_strcmp0 ("Next", key) == 0) | ||
82 | 311 | media->next(); | ||
83 | 312 | else if (g_strcmp0 ("Stop", key) == 0) | ||
84 | 313 | media->stop(); | ||
85 | 314 | } | ||
86 | 315 | |||
87 | 316 | static void grab_media_player_keys_cb (GDBusProxy *proxy, | ||
88 | 317 | GAsyncResult *res, | ||
89 | 318 | gpointer data) | ||
90 | 319 | { | ||
91 | 320 | iMedia *media = (iMedia*)data; | ||
92 | 321 | GVariant *variant; | ||
93 | 322 | GError *error = NULL; | ||
94 | 323 | |||
95 | 324 | variant = g_dbus_proxy_call_finish (proxy, res, &error); | ||
96 | 325 | media->cancellable = NULL; | ||
97 | 326 | |||
98 | 327 | if (variant == NULL) { | ||
99 | 328 | if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) | ||
100 | 329 | g_warning ("Failed to call \"GrabMediaPlayerKeys\": %s", error->message); | ||
101 | 330 | g_error_free (error); | ||
102 | 331 | return; | ||
103 | 332 | } | ||
104 | 333 | g_variant_unref (variant); | ||
105 | 334 | } | ||
106 | 335 | |||
107 | 336 | static void grab_media_player_keys (gpointer data) | ||
108 | 337 | { | ||
109 | 338 | iMedia *media = (iMedia*)data; | ||
110 | 339 | GCancellable *cancellable; | ||
111 | 340 | |||
112 | 341 | if (media->proxy == NULL) | ||
113 | 342 | return; | ||
114 | 343 | |||
115 | 344 | /* Only allow one key grab operation to happen concurrently */ | ||
116 | 345 | if (media->cancellable) { | ||
117 | 346 | g_cancellable_cancel (media->cancellable); | ||
118 | 347 | } | ||
119 | 348 | |||
120 | 349 | cancellable = g_cancellable_new (); | ||
121 | 350 | media->cancellable = cancellable; | ||
122 | 351 | |||
123 | 352 | g_dbus_proxy_call (media->proxy, | ||
124 | 353 | "GrabMediaPlayerKeys", | ||
125 | 354 | g_variant_new ("(su)", "Gloobus-Preview", 0), | ||
126 | 355 | G_DBUS_CALL_FLAGS_NONE, | ||
127 | 356 | -1, cancellable, | ||
128 | 357 | (GAsyncReadyCallback) grab_media_player_keys_cb, | ||
129 | 358 | data); | ||
130 | 359 | |||
131 | 360 | /* GDBus keeps a reference throughout the async call */ | ||
132 | 361 | g_object_unref (cancellable); | ||
133 | 362 | } | ||
134 | 363 | |||
135 | 364 | static gboolean on_window_focus_in_event (GtkWidget *window, | ||
136 | 365 | GdkEventFocus *event, | ||
137 | 366 | gpointer data) | ||
138 | 367 | { | ||
139 | 368 | grab_media_player_keys (data); | ||
140 | 369 | |||
141 | 370 | return FALSE; | ||
142 | 371 | } | ||
143 | 372 | |||
144 | 373 | static void key_pressed (GDBusProxy *proxy, | ||
145 | 374 | gchar *sender_name, | ||
146 | 375 | gchar *signal_name, | ||
147 | 376 | GVariant *parameters, | ||
148 | 377 | gpointer data) | ||
149 | 378 | { | ||
150 | 379 | char *app, *cmd; | ||
151 | 380 | |||
152 | 381 | if (g_strcmp0 (signal_name, "MediaPlayerKeyPressed") != 0) | ||
153 | 382 | return; | ||
154 | 383 | g_variant_get (parameters, "(ss)", &app, &cmd); | ||
155 | 384 | if (g_strcmp0 (app, "Gloobus-Preview") == 0) { | ||
156 | 385 | on_media_player_key_pressed (data, cmd); | ||
157 | 386 | } | ||
158 | 387 | g_free (app); | ||
159 | 388 | g_free (cmd); | ||
160 | 389 | } | ||
161 | 390 | |||
162 | 391 | static void got_proxy_cb (GObject *source_object, | ||
163 | 392 | GAsyncResult *res, | ||
164 | 393 | gpointer data) | ||
165 | 394 | { | ||
166 | 395 | iMedia *media = (iMedia*)data; | ||
167 | 396 | GError *error = NULL; | ||
168 | 397 | |||
169 | 398 | media->proxy = g_dbus_proxy_new_for_bus_finish (res, &error); | ||
170 | 399 | media->cancellable_init = NULL; | ||
171 | 400 | |||
172 | 401 | if (media->proxy == NULL) { | ||
173 | 402 | if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) | ||
174 | 403 | g_warning ("Failed to contact settings daemon: %s", error->message); | ||
175 | 404 | g_error_free (error); | ||
176 | 405 | return; | ||
177 | 406 | } | ||
178 | 407 | |||
179 | 408 | grab_media_player_keys (data); | ||
180 | 409 | |||
181 | 410 | g_signal_connect (G_OBJECT (media->proxy), "g-signal", | ||
182 | 411 | G_CALLBACK (key_pressed), data); | ||
183 | 412 | } | ||
184 | 413 | |||
185 | 414 | static void name_appeared_cb (GDBusConnection *connection, | ||
186 | 415 | const gchar *name, | ||
187 | 416 | const gchar *name_owner, | ||
188 | 417 | gpointer data) | ||
189 | 418 | { | ||
190 | 419 | iMedia *media = (iMedia*)data; | ||
191 | 420 | GCancellable *cancellable; | ||
192 | 421 | |||
193 | 422 | cancellable = g_cancellable_new (); | ||
194 | 423 | media->cancellable_init = cancellable; | ||
195 | 424 | |||
196 | 425 | g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, | ||
197 | 426 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, | ||
198 | 427 | NULL, | ||
199 | 428 | "org.gnome.SettingsDaemon", | ||
200 | 429 | "/org/gnome/SettingsDaemon/MediaKeys", | ||
201 | 430 | "org.gnome.SettingsDaemon.MediaKeys", | ||
202 | 431 | cancellable, | ||
203 | 432 | (GAsyncReadyCallback) got_proxy_cb, | ||
204 | 433 | data); | ||
205 | 434 | |||
206 | 435 | /* GDBus keeps a reference throughout the async call */ | ||
207 | 436 | g_object_unref (cancellable); | ||
208 | 437 | } | ||
209 | 438 | |||
210 | 439 | static void name_vanished_cb (GDBusConnection *connection, | ||
211 | 440 | const gchar *name, | ||
212 | 441 | gpointer data) | ||
213 | 442 | { | ||
214 | 443 | iMedia *media = (iMedia*)data; | ||
215 | 444 | |||
216 | 445 | if (media->proxy != NULL) { | ||
217 | 446 | g_object_unref (media->proxy); | ||
218 | 447 | media->proxy = NULL; | ||
219 | 448 | } | ||
220 | 449 | |||
221 | 450 | if (media->cancellable) { | ||
222 | 451 | g_cancellable_cancel (media->cancellable); | ||
223 | 452 | } | ||
224 | 453 | } | ||
225 | 454 | |||
226 | 309 | void iMedia::activate_media_keys( void ) | 455 | void iMedia::activate_media_keys( void ) |
227 | 310 | { | 456 | { |
276 | 311 | DBusGConnection *connection; | 457 | watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION, |
277 | 312 | GError *err = NULL; | 458 | "org.gnome.SettingsDaemon", |
278 | 313 | DBusGProxy *proxy; | 459 | G_BUS_NAME_WATCHER_FLAGS_NONE, |
279 | 314 | 460 | (GBusNameAppearedCallback) name_appeared_cb, | |
280 | 315 | connection = dbus_g_bus_get (DBUS_BUS_SESSION, &err); | 461 | (GBusNameVanishedCallback) name_vanished_cb, |
281 | 316 | if (connection == NULL) { | 462 | this, NULL); |
282 | 317 | g_warning ("Error connecting to D-Bus: %s", err->message); | 463 | |
283 | 318 | return; | 464 | handler_id = g_signal_connect (G_OBJECT (ui->get_window()), "focus-in-event", |
284 | 319 | } | 465 | G_CALLBACK (on_window_focus_in_event), this); |
237 | 320 | |||
238 | 321 | /* Try the gnome-settings-daemon version, | ||
239 | 322 | * then the gnome-control-center version of things */ | ||
240 | 323 | proxy = dbus_g_proxy_new_for_name_owner (connection, | ||
241 | 324 | "org.gnome.SettingsDaemon", | ||
242 | 325 | "/org/gnome/SettingsDaemon/MediaKeys", | ||
243 | 326 | "org.gnome.SettingsDaemon.MediaKeys", NULL); | ||
244 | 327 | if (proxy == NULL) { | ||
245 | 328 | proxy = dbus_g_proxy_new_for_name_owner (connection, | ||
246 | 329 | "org.gnome.SettingsDaemon", | ||
247 | 330 | "/org/gnome/SettingsDaemon", | ||
248 | 331 | "org.gnome.SettingsDaemon", &err); | ||
249 | 332 | } | ||
250 | 333 | |||
251 | 334 | dbus_g_connection_unref (connection); | ||
252 | 335 | |||
253 | 336 | if (err != NULL) { | ||
254 | 337 | g_warning ("Failed to create dbus proxy for org.gnome.SettingsDaemon: %s", err->message); | ||
255 | 338 | g_error_free (err); | ||
256 | 339 | } else { | ||
257 | 340 | dbus_proxy = proxy; | ||
258 | 341 | //g_signal_connect_object (proxy, "destroy", G_CALLBACK (dbus_proxy_destroy_cb), &dbus_proxy, GConnectFlags(0)); | ||
259 | 342 | g_signal_connect(G_OBJECT(proxy), "destroy", G_CALLBACK (dbus_proxy_destroy_cb), &dbus_proxy); | ||
260 | 343 | } | ||
261 | 344 | |||
262 | 345 | dbus_g_proxy_call (proxy, "GrabMediaPlayerKeys", NULL, | ||
263 | 346 | G_TYPE_STRING, "Gloobus-Preview", G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_INVALID); | ||
264 | 347 | |||
265 | 348 | dbus_g_object_register_marshaller (media_marshal_VOID__STRING_STRING, | ||
266 | 349 | G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); | ||
267 | 350 | dbus_g_proxy_add_signal (proxy, "MediaPlayerKeyPressed", | ||
268 | 351 | G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); | ||
269 | 352 | dbus_g_proxy_connect_signal (proxy, "MediaPlayerKeyPressed", | ||
270 | 353 | G_CALLBACK (media_key_pressed_cb), this, NULL); | ||
271 | 354 | |||
272 | 355 | focus_in_id = g_signal_connect (G_OBJECT ( ui->get_window() ), | ||
273 | 356 | "focus-in-event", G_CALLBACK (focus_in_cb), this); | ||
274 | 357 | |||
275 | 358 | dbus_proxy = proxy; | ||
285 | 359 | } | 466 | } |
286 | 360 | 467 | ||
287 | 361 | void iMedia::deactivate_media_keys( void ) | 468 | void iMedia::deactivate_media_keys( void ) |
288 | 362 | { | 469 | { |
293 | 363 | if (dbus_proxy != NULL) { | 470 | if (cancellable_init) { |
294 | 364 | DBusGProxy *proxy = (DBusGProxy*)dbus_proxy; | 471 | g_cancellable_cancel (cancellable_init); |
295 | 365 | dbus_g_proxy_call (proxy, "ReleaseMediaPlayerKeys", NULL, | 472 | } |
296 | 366 | G_TYPE_STRING, "Gloobus-Preview", G_TYPE_INVALID, G_TYPE_INVALID); | 473 | |
297 | 474 | if (cancellable) { | ||
298 | 475 | g_cancellable_cancel (cancellable); | ||
299 | 476 | } | ||
300 | 477 | |||
301 | 478 | if (proxy != NULL) { | ||
302 | 367 | g_object_unref (proxy); | 479 | g_object_unref (proxy); |
377 | 368 | dbus_proxy = NULL; | 480 | proxy = NULL; |
378 | 369 | } | 481 | } |
379 | 370 | 482 | ||
380 | 371 | if (focus_in_id) { | 483 | if (handler_id != 0) { |
381 | 372 | g_signal_handler_disconnect (G_OBJECT (ui->get_window()), focus_in_id); | 484 | g_signal_handler_disconnect (G_OBJECT (ui->get_window()), handler_id); |
382 | 373 | } | 485 | handler_id = 0; |
383 | 374 | } | 486 | } |
384 | 375 | 487 | ||
385 | 376 | static void | 488 | if (watch_id != 0) { |
386 | 377 | dbus_proxy_destroy_cb (DBusGProxy *proxy, gpointer data) | 489 | g_bus_unwatch_name (watch_id); |
387 | 378 | { | 490 | watch_id = 0; |
388 | 379 | DBusGProxy **dbus_proxy = (DBusGProxy**)data; | 491 | } |
315 | 380 | *dbus_proxy = 0; | ||
316 | 381 | } | ||
317 | 382 | |||
318 | 383 | gboolean iMedia:: | ||
319 | 384 | focus_in_cb( GtkWidget *window, GdkEventFocus *event, gpointer data ) | ||
320 | 385 | { | ||
321 | 386 | iMedia *media = (iMedia*)data; | ||
322 | 387 | if (media->dbus_proxy) { | ||
323 | 388 | DBusGProxy *proxy = (DBusGProxy*)media->dbus_proxy; | ||
324 | 389 | dbus_g_proxy_call (proxy, "GrabMediaPlayerKeys", NULL, | ||
325 | 390 | G_TYPE_STRING, "Gloobus-Preview", G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_INVALID); | ||
326 | 391 | } | ||
327 | 392 | return false; | ||
328 | 393 | } | ||
329 | 394 | |||
330 | 395 | static void | ||
331 | 396 | media_key_pressed_cb (DBusGProxy *proxy, | ||
332 | 397 | const gchar *application, | ||
333 | 398 | const gchar *key, | ||
334 | 399 | gpointer data) | ||
335 | 400 | { | ||
336 | 401 | iMedia *media = (iMedia*)data; | ||
337 | 402 | if (g_strcmp0 ("Gloobus-Preview", application) == 0) { | ||
338 | 403 | if (g_strcmp0 ("Play", key) == 0) | ||
339 | 404 | media->play_pause(); | ||
340 | 405 | else if (g_strcmp0 ("Previous", key) == 0) | ||
341 | 406 | media->previous(); | ||
342 | 407 | else if (g_strcmp0 ("Next", key) == 0) | ||
343 | 408 | media->next(); | ||
344 | 409 | else if (g_strcmp0 ("Stop", key) == 0) | ||
345 | 410 | media->stop(); | ||
346 | 411 | } | ||
347 | 412 | } | ||
348 | 413 | |||
349 | 414 | static void | ||
350 | 415 | media_marshal_VOID__STRING_STRING (GClosure *closure, | ||
351 | 416 | GValue *return_value G_GNUC_UNUSED, | ||
352 | 417 | guint n_param_values, | ||
353 | 418 | const GValue *param_values, | ||
354 | 419 | gpointer invocation_hint G_GNUC_UNUSED, | ||
355 | 420 | gpointer marshal_data) | ||
356 | 421 | { | ||
357 | 422 | typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer data1, | ||
358 | 423 | gpointer arg_1, gpointer arg_2, gpointer data2); | ||
359 | 424 | |||
360 | 425 | register GMarshalFunc_VOID__STRING_STRING callback; | ||
361 | 426 | register GCClosure *cc = (GCClosure*) closure; | ||
362 | 427 | register gpointer data1, data2; | ||
363 | 428 | |||
364 | 429 | g_return_if_fail (n_param_values == 3); | ||
365 | 430 | |||
366 | 431 | if (G_CCLOSURE_SWAP_DATA (closure)) { | ||
367 | 432 | data1 = closure->data; | ||
368 | 433 | data2 = param_values->data[0].v_pointer; | ||
369 | 434 | } else { | ||
370 | 435 | data1 = param_values->data[0].v_pointer; | ||
371 | 436 | data2 = closure->data; | ||
372 | 437 | } | ||
373 | 438 | callback = (GMarshalFunc_VOID__STRING_STRING) (marshal_data ? marshal_data : cc->callback); | ||
374 | 439 | |||
375 | 440 | callback (data1, (param_values+1)->data[0].v_pointer, | ||
376 | 441 | (param_values+2)->data[0].v_pointer, data2); | ||
389 | 442 | } | 492 | } |
390 | 443 | 493 | ||
391 | 444 | void iMedia::next( void ) | 494 | void iMedia::next( void ) |
392 | 445 | 495 | ||
393 | === modified file 'src/gloobus-preview-interface-media.h' | |||
394 | --- src/gloobus-preview-interface-media.h 2010-08-25 15:08:27 +0000 | |||
395 | +++ src/gloobus-preview-interface-media.h 2014-12-26 19:18:18 +0000 | |||
396 | @@ -48,9 +48,13 @@ | |||
397 | 48 | bool f_visible; | 48 | bool f_visible; |
398 | 49 | gint duration; | 49 | gint duration; |
399 | 50 | 50 | ||
403 | 51 | gpointer dbus_proxy; | 51 | public: |
404 | 52 | guint focus_in_id; | 52 | GDBusProxy * proxy; |
405 | 53 | 53 | guint handler_id; | |
406 | 54 | guint watch_id; | ||
407 | 55 | GCancellable * cancellable_init; | ||
408 | 56 | GCancellable * cancellable; | ||
409 | 57 | |||
410 | 54 | public: | 58 | public: |
411 | 55 | iMedia ( void ); | 59 | iMedia ( void ); |
412 | 56 | virtual ~iMedia ( void ); | 60 | virtual ~iMedia ( void ); |
413 | @@ -79,7 +83,6 @@ | |||
414 | 79 | virtual void update_duration ( gint sec ); | 83 | virtual void update_duration ( gint sec ); |
415 | 80 | void activate_media_keys ( void ); | 84 | void activate_media_keys ( void ); |
416 | 81 | void deactivate_media_keys ( void ); | 85 | void deactivate_media_keys ( void ); |
417 | 82 | static gboolean focus_in_cb ( GtkWidget *window, GdkEventFocus *event, gpointer data ); | ||
418 | 83 | static gboolean next_file_cb ( gpointer ); | 86 | static gboolean next_file_cb ( gpointer ); |
419 | 84 | static gboolean previous_file_cb ( gpointer ); | 87 | static gboolean previous_file_cb ( gpointer ); |
420 | 85 | }; | 88 | }; |