diff options
author | Bastien Nocera <hadess@hadess.net> | 2008-06-24 18:15:12 (GMT) |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2008-06-24 18:15:12 (GMT) |
commit | 7042909ab901b54e952410572b3d724e49094158 (patch) | |
tree | 0e0ec62510a1d2bef370d2b0d2f8e0ec1beebb04 /shell/ev-application.c | |
parent | 160bb033c06d78193c51d6cd1a671835c037c869 (diff) |
When building with D-Bus support, listen for multimedia key events from
2008-06-24 Bastien Nocera <hadess@hadess.net>
* shell/Makefile.am:
* shell/ev-application.c (ev_application_init),
(ev_application_get_media_keys):
* shell/ev-application.h:
* shell/ev-marshal.list:
* shell/ev-media-player-keys.c (ev_media_player_keys_class_init),
(proxy_destroy), (on_media_player_key_pressed),
(ev_media_player_keys_init), (ev_media_player_keys_focused),
(ev_media_player_keys_finalize), (ev_media_player_keys_new):
* shell/ev-media-player-keys.h:
* shell/ev-window.c (ev_window_go_previous_page),
(ev_window_go_next_page), (ev_window_go_first_page),
(ev_window_go_last_page), (ev_window_start_presentation),
(ev_window_dispose), (view_actions_focus_in_cb):
* shell/ev-window.h: When building with D-Bus support, listen
for multimedia key events from gnome-settings-daemon. This allows
to go to the next/previous/first/last pages using, respectively,
Next/Previous/Rewing/Fast Forward. The Play button is used to start
a presentation. Fixes bug #539971.
svn path=/trunk/; revision=3059
Diffstat (limited to 'shell/ev-application.c')
-rw-r--r-- | shell/ev-application.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/shell/ev-application.c b/shell/ev-application.c index 6e7a6e6..7ad1382 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -25,6 +25,9 @@ #include "ev-utils.h" #include "ev-file-helpers.h" #include "ev-document-factory.h" +#ifdef ENABLE_DBUS +#include "ev-media-player-keys.h" +#endif /* ENABLE_DBUS */ #include "totem-scrsaver.h" #include <glib.h> @@ -59,6 +62,10 @@ struct _EvApplication { gchar *last_chooser_uri; +#ifdef ENABLE_DBUS + EvMediaPlayerKeys *keys; +#endif /* ENABLE_DBUS */ + GtkPrintSettings *print_settings; #if GTK_CHECK_VERSION (2, 11, 0) gchar *print_settings_file; @@ -715,6 +722,10 @@ ev_application_init (EvApplication *ev_application) egg_toolbars_model_set_flags (ev_application->toolbars_model, 0, EGG_TB_MODEL_NOT_REMOVABLE); + +#ifdef ENABLE_DBUS + ev_application->keys = ev_media_player_keys_new (); +#endif /* ENABLE_DBUS */ } /** @@ -744,6 +755,26 @@ ev_application_get_windows (EvApplication *application) return windows; } +/** + * ev_application_get_media_keys: + * @application: The instance of the application. + * + * It gives you access to the media player keys handler object. + * + * Returns: A #EvMediaPlayerKeys. + */ +GObject +*ev_application_get_media_keys (EvApplication *application) +{ +#ifdef ENABLE_DBUS + if (!application->keys) + return NULL; + return g_object_ref (G_OBJECT (application->keys)); +#else + return NULL; +#endif /* ENABLE_DBUS */ +} + EggToolbarsModel * ev_application_get_toolbars_model (EvApplication *application) { |