[gnome-settings-daemon] media-keys: Rename ShellKeyBindingMode to ShellActionMode
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] media-keys: Rename ShellKeyBindingMode to ShellActionMode
- Date: Fri, 19 Dec 2014 13:15:33 +0000 (UTC)
commit b2820f0092bfa32360f221732ce9b0179671c69a
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Dec 11 18:06:28 2014 +0100
media-keys: Rename ShellKeyBindingMode to ShellActionMode
The type was renamed in gnome-shell to account for usage besides
keybindings (namely gestures), so do the same here to keep the
headers in sync.
plugins/media-keys/Makefile.am | 2 +-
plugins/media-keys/gsd-media-keys-manager.c | 4 +-
plugins/media-keys/shell-action-modes.h | 39 +++++++++
plugins/media-keys/shell-keybinding-modes.h | 38 --------
plugins/media-keys/shortcuts-list.h | 124 +++++++++++++-------------
5 files changed, 104 insertions(+), 103 deletions(-)
---
diff --git a/plugins/media-keys/Makefile.am b/plugins/media-keys/Makefile.am
index d6022b0..d8f2e6a 100644
--- a/plugins/media-keys/Makefile.am
+++ b/plugins/media-keys/Makefile.am
@@ -36,7 +36,7 @@ libmedia_keys_la_SOURCES = \
gsd-screenshot-utils.c \
shortcuts-list.h \
media-keys.h \
- shell-keybinding-modes.h \
+ shell-action-modes.h \
bus-watch-namespace.c \
bus-watch-namespace.h \
mpris-controller.c \
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 971ccc8..abd3984 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -122,7 +122,7 @@ typedef struct {
typedef struct {
MediaKeyType key_type;
- ShellKeyBindingMode modes;
+ ShellActionMode modes;
const char *settings_key;
const char *hard_coded;
char *custom_path;
@@ -564,7 +564,7 @@ media_key_new_for_path (GsdMediaKeysManager *manager,
key = g_new0 (MediaKey, 1);
key->key_type = CUSTOM_KEY;
- key->modes = GSD_KEYBINDING_MODE_LAUNCHER;
+ key->modes = GSD_ACTION_MODE_LAUNCHER;
key->custom_path = g_strdup (path);
key->custom_command = command;
diff --git a/plugins/media-keys/shell-action-modes.h b/plugins/media-keys/shell-action-modes.h
new file mode 100644
index 0000000..cff1d12
--- /dev/null
+++ b/plugins/media-keys/shell-action-modes.h
@@ -0,0 +1,39 @@
+/**
+ * ShellActionMode:
+ * @SHELL_ACTION_MODE_NONE: block action
+ * @SHELL_ACTION_MODE_NORMAL: allow action when in window mode,
+ * e.g. when the focus is in an application window
+ * @SHELL_ACTION_MODE_OVERVIEW: allow action while the overview
+ * is active
+ * @SHELL_ACTION_MODE_LOCK_SCREEN: allow action when the screen
+ * is locked, e.g. when the screen shield is shown
+ * @SHELL_ACTION_MODE_UNLOCK_SCREEN: allow action in the unlock
+ * dialog
+ * @SHELL_ACTION_MODE_LOGIN_SCREEN: allow action in the login screen
+ * @SHELL_ACTION_MODE_MESSAGE_TRAY: allow action while the message
+ * tray is popped up
+ * @SHELL_ACTION_MODE_SYSTEM_MODAL: allow action when a system modal
+ * dialog (e.g. authentification or session dialogs) is open
+ * @SHELL_ACTION_MODE_LOOKING_GLASS: allow action in looking glass
+ * @SHELL_ACTION_MODE_TOPBAR_POPUP: allow action while a top bar menu
+ * is open
+ * @SHELL_ACTION_MODE_ALL: always allow action
+ *
+ * Controls in which GNOME Shell states an action (like keybindings and gestures)
+ * should be handled.
+*/
+typedef enum {
+ SHELL_ACTION_MODE_NONE = 0,
+ SHELL_ACTION_MODE_NORMAL = 1 << 0,
+ SHELL_ACTION_MODE_OVERVIEW = 1 << 1,
+ SHELL_ACTION_MODE_LOCK_SCREEN = 1 << 2,
+ SHELL_ACTION_MODE_UNLOCK_SCREEN = 1 << 3,
+ SHELL_ACTION_MODE_LOGIN_SCREEN = 1 << 4,
+ SHELL_ACTION_MODE_MESSAGE_TRAY = 1 << 5,
+ SHELL_ACTION_MODE_SYSTEM_MODAL = 1 << 6,
+ SHELL_ACTION_MODE_LOOKING_GLASS = 1 << 7,
+ SHELL_ACTION_MODE_TOPBAR_POPUP = 1 << 8,
+
+ SHELL_ACTION_MODE_ALL = ~0,
+} ShellActionMode;
+
diff --git a/plugins/media-keys/shortcuts-list.h b/plugins/media-keys/shortcuts-list.h
index de9fde2..4b1eacd 100644
--- a/plugins/media-keys/shortcuts-list.h
+++ b/plugins/media-keys/shortcuts-list.h
@@ -19,81 +19,81 @@
#ifndef __SHORTCUTS_LIST_H__
#define __SHORTCUTS_LIST_H__
-#include "shell-keybinding-modes.h"
+#include "shell-action-modes.h"
#include "media-keys.h"
#define SETTINGS_BINDING_DIR "org.gnome.settings-daemon.plugins.media-keys"
-#define GSD_KEYBINDING_MODE_LAUNCHER (SHELL_KEYBINDING_MODE_NORMAL | \
- SHELL_KEYBINDING_MODE_OVERVIEW)
-#define SCREENSAVER_MODE SHELL_KEYBINDING_MODE_ALL & ~SHELL_KEYBINDING_MODE_UNLOCK_SCREEN
-#define NO_LOCK_MODE SCREENSAVER_MODE & ~SHELL_KEYBINDING_MODE_LOCK_SCREEN
-#define POWER_KEYS_MODE (SHELL_KEYBINDING_MODE_NORMAL | \
- SHELL_KEYBINDING_MODE_OVERVIEW | \
- SHELL_KEYBINDING_MODE_LOGIN_SCREEN)
-#define POWER_KEYS_MODE_NO_DIALOG (SHELL_KEYBINDING_MODE_LOCK_SCREEN | \
- SHELL_KEYBINDING_MODE_UNLOCK_SCREEN)
+#define GSD_ACTION_MODE_LAUNCHER (SHELL_ACTION_MODE_NORMAL | \
+ SHELL_ACTION_MODE_OVERVIEW)
+#define SCREENSAVER_MODE SHELL_ACTION_MODE_ALL & ~SHELL_ACTION_MODE_UNLOCK_SCREEN
+#define NO_LOCK_MODE SCREENSAVER_MODE & ~SHELL_ACTION_MODE_LOCK_SCREEN
+#define POWER_KEYS_MODE (SHELL_ACTION_MODE_NORMAL | \
+ SHELL_ACTION_MODE_OVERVIEW | \
+ SHELL_ACTION_MODE_LOGIN_SCREEN)
+#define POWER_KEYS_MODE_NO_DIALOG (SHELL_ACTION_MODE_LOCK_SCREEN | \
+ SHELL_ACTION_MODE_UNLOCK_SCREEN)
static struct {
MediaKeyType key_type;
const char *settings_key;
const char *key_name;
const char *hard_coded;
- ShellKeyBindingMode modes;
+ ShellActionMode modes;
} media_keys[] = {
- { TOUCHPAD_KEY, NULL, N_("Touchpad toggle") ,"XF86TouchpadToggle", SHELL_KEYBINDING_MODE_ALL },
- { TOUCHPAD_ON_KEY, NULL, N_("Touchpad On"), "XF86TouchpadOn", SHELL_KEYBINDING_MODE_ALL },
- { TOUCHPAD_OFF_KEY, NULL, N_("Touchpad Off"), "XF86TouchpadOff", SHELL_KEYBINDING_MODE_ALL },
- { MUTE_KEY, "volume-mute", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { VOLUME_DOWN_KEY, "volume-down", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { VOLUME_UP_KEY, "volume-up", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { MIC_MUTE_KEY, NULL, N_("Microphone Mute"), "F20", SHELL_KEYBINDING_MODE_ALL },
- { MIC_MUTE_KEY, NULL, N_("Microphone Mute"), "XF86AudioMicMute", SHELL_KEYBINDING_MODE_ALL },
- { MUTE_QUIET_KEY, NULL, N_("Quiet Volume Mute"), "<Alt>XF86AudioMute", SHELL_KEYBINDING_MODE_ALL },
- { VOLUME_DOWN_QUIET_KEY, NULL, N_("Quiet Volume Down"), "<Alt>XF86AudioLowerVolume",
SHELL_KEYBINDING_MODE_ALL },
- { VOLUME_UP_QUIET_KEY, NULL, N_("Quiet Volume Up"), "<Alt>XF86AudioRaiseVolume",
SHELL_KEYBINDING_MODE_ALL },
- { LOGOUT_KEY, "logout", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
- { EJECT_KEY, "eject", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { HOME_KEY, "home", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
- { MEDIA_KEY, "media", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
- { CALCULATOR_KEY, "calculator", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
- { SEARCH_KEY, "search", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
- { EMAIL_KEY, "email", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
- { CONTROL_CENTER_KEY, "control-center", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
+ { TOUCHPAD_KEY, NULL, N_("Touchpad toggle") ,"XF86TouchpadToggle", SHELL_ACTION_MODE_ALL },
+ { TOUCHPAD_ON_KEY, NULL, N_("Touchpad On"), "XF86TouchpadOn", SHELL_ACTION_MODE_ALL },
+ { TOUCHPAD_OFF_KEY, NULL, N_("Touchpad Off"), "XF86TouchpadOff", SHELL_ACTION_MODE_ALL },
+ { MUTE_KEY, "volume-mute", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { VOLUME_DOWN_KEY, "volume-down", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { VOLUME_UP_KEY, "volume-up", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { MIC_MUTE_KEY, NULL, N_("Microphone Mute"), "F20", SHELL_ACTION_MODE_ALL },
+ { MIC_MUTE_KEY, NULL, N_("Microphone Mute"), "XF86AudioMicMute", SHELL_ACTION_MODE_ALL },
+ { MUTE_QUIET_KEY, NULL, N_("Quiet Volume Mute"), "<Alt>XF86AudioMute", SHELL_ACTION_MODE_ALL },
+ { VOLUME_DOWN_QUIET_KEY, NULL, N_("Quiet Volume Down"), "<Alt>XF86AudioLowerVolume",
SHELL_ACTION_MODE_ALL },
+ { VOLUME_UP_QUIET_KEY, NULL, N_("Quiet Volume Up"), "<Alt>XF86AudioRaiseVolume",
SHELL_ACTION_MODE_ALL },
+ { LOGOUT_KEY, "logout", NULL, NULL, GSD_ACTION_MODE_LAUNCHER },
+ { EJECT_KEY, "eject", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { HOME_KEY, "home", NULL, NULL, GSD_ACTION_MODE_LAUNCHER },
+ { MEDIA_KEY, "media", NULL, NULL, GSD_ACTION_MODE_LAUNCHER },
+ { CALCULATOR_KEY, "calculator", NULL, NULL, GSD_ACTION_MODE_LAUNCHER },
+ { SEARCH_KEY, "search", NULL, NULL, GSD_ACTION_MODE_LAUNCHER },
+ { EMAIL_KEY, "email", NULL, NULL, GSD_ACTION_MODE_LAUNCHER },
+ { CONTROL_CENTER_KEY, "control-center", NULL, NULL, GSD_ACTION_MODE_LAUNCHER },
{ SCREENSAVER_KEY, "screensaver", NULL, NULL, SCREENSAVER_MODE },
{ SCREENSAVER_KEY, NULL, N_("Lock Screen"), "XF86ScreenSaver", SCREENSAVER_MODE },
- { HELP_KEY, "help", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
+ { HELP_KEY, "help", NULL, NULL, GSD_ACTION_MODE_LAUNCHER },
{ SCREENSHOT_KEY, "screenshot", NULL, NULL, NO_LOCK_MODE },
{ WINDOW_SCREENSHOT_KEY, "window-screenshot", NULL, NULL, NO_LOCK_MODE },
{ AREA_SCREENSHOT_KEY, "area-screenshot", NULL, NULL, NO_LOCK_MODE },
- { SCREENSHOT_CLIP_KEY, "screenshot-clip", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { WINDOW_SCREENSHOT_CLIP_KEY, "window-screenshot-clip", NULL, NULL, SHELL_KEYBINDING_MODE_NORMAL },
- { AREA_SCREENSHOT_CLIP_KEY, "area-screenshot-clip", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
+ { SCREENSHOT_CLIP_KEY, "screenshot-clip", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { WINDOW_SCREENSHOT_CLIP_KEY, "window-screenshot-clip", NULL, NULL, SHELL_ACTION_MODE_NORMAL },
+ { AREA_SCREENSHOT_CLIP_KEY, "area-screenshot-clip", NULL, NULL, SHELL_ACTION_MODE_ALL },
{ SCREENCAST_KEY, "screencast", NULL, NULL, NO_LOCK_MODE },
- { WWW_KEY, "www", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
- { PLAY_KEY, "play", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { PAUSE_KEY, "pause", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { STOP_KEY, "stop", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { PREVIOUS_KEY, "previous", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { NEXT_KEY, "next", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { REWIND_KEY, NULL, N_("Rewind"), "XF86AudioRewind", SHELL_KEYBINDING_MODE_ALL },
- { FORWARD_KEY, NULL, N_("Forward"), "XF86AudioForward", SHELL_KEYBINDING_MODE_ALL },
- { REPEAT_KEY, NULL, N_("Repeat"), "XF86AudioRepeat", SHELL_KEYBINDING_MODE_ALL },
- { RANDOM_KEY, NULL, N_("Random Play"), "XF86AudioRandomPlay", SHELL_KEYBINDING_MODE_ALL },
- { VIDEO_OUT_KEY, NULL, N_("Video Out"), "<Super>p", SHELL_KEYBINDING_MODE_ALL },
+ { WWW_KEY, "www", NULL, NULL, GSD_ACTION_MODE_LAUNCHER },
+ { PLAY_KEY, "play", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { PAUSE_KEY, "pause", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { STOP_KEY, "stop", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { PREVIOUS_KEY, "previous", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { NEXT_KEY, "next", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { REWIND_KEY, NULL, N_("Rewind"), "XF86AudioRewind", SHELL_ACTION_MODE_ALL },
+ { FORWARD_KEY, NULL, N_("Forward"), "XF86AudioForward", SHELL_ACTION_MODE_ALL },
+ { REPEAT_KEY, NULL, N_("Repeat"), "XF86AudioRepeat", SHELL_ACTION_MODE_ALL },
+ { RANDOM_KEY, NULL, N_("Random Play"), "XF86AudioRandomPlay", SHELL_ACTION_MODE_ALL },
+ { VIDEO_OUT_KEY, NULL, N_("Video Out"), "<Super>p", SHELL_ACTION_MODE_ALL },
/* Key code of the XF86Display key (Fn-F7 on Thinkpads, Fn-F4 on HP machines, etc.) */
- { VIDEO_OUT_KEY, NULL, N_("Video Out"), "XF86Display", SHELL_KEYBINDING_MODE_ALL },
+ { VIDEO_OUT_KEY, NULL, N_("Video Out"), "XF86Display", SHELL_ACTION_MODE_ALL },
/* Key code of the XF86RotateWindows key (present on some tablets) */
- { ROTATE_VIDEO_KEY, NULL, N_("Rotate Screen"), "XF86RotateWindows", SHELL_KEYBINDING_MODE_NORMAL },
- { ROTATE_VIDEO_LOCK_KEY, NULL, N_("Orientation Lock"), "<Super>o", SHELL_KEYBINDING_MODE_ALL },
- { MAGNIFIER_KEY, "magnifier", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { SCREENREADER_KEY, "screenreader", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { ON_SCREEN_KEYBOARD_KEY, "on-screen-keyboard", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { INCREASE_TEXT_KEY, "increase-text-size", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { DECREASE_TEXT_KEY, "decrease-text-size", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { TOGGLE_CONTRAST_KEY, "toggle-contrast", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { MAGNIFIER_ZOOM_IN_KEY, "magnifier-zoom-in", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
- { MAGNIFIER_ZOOM_OUT_KEY, "magnifier-zoom-out", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
+ { ROTATE_VIDEO_KEY, NULL, N_("Rotate Screen"), "XF86RotateWindows", SHELL_ACTION_MODE_NORMAL },
+ { ROTATE_VIDEO_LOCK_KEY, NULL, N_("Orientation Lock"), "<Super>o", SHELL_ACTION_MODE_ALL },
+ { MAGNIFIER_KEY, "magnifier", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { SCREENREADER_KEY, "screenreader", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { ON_SCREEN_KEYBOARD_KEY, "on-screen-keyboard", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { INCREASE_TEXT_KEY, "increase-text-size", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { DECREASE_TEXT_KEY, "decrease-text-size", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { TOGGLE_CONTRAST_KEY, "toggle-contrast", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { MAGNIFIER_ZOOM_IN_KEY, "magnifier-zoom-in", NULL, NULL, SHELL_ACTION_MODE_ALL },
+ { MAGNIFIER_ZOOM_OUT_KEY, "magnifier-zoom-out", NULL, NULL, SHELL_ACTION_MODE_ALL },
{ POWER_KEY, NULL, N_("Power Off"), "XF86PowerOff", POWER_KEYS_MODE },
/* the kernel / Xorg names really are like this... */
/* translators: "Sleep" means putting the machine to sleep, either through hibernate or suspend */
@@ -106,12 +106,12 @@ static struct {
{ SLEEP_KEY_NO_DIALOG, NULL, N_("Sleep"), "XF86Suspend", POWER_KEYS_MODE_NO_DIALOG },
{ SUSPEND_KEY_NO_DIALOG, NULL, N_("Suspend"), "XF86Sleep", POWER_KEYS_MODE_NO_DIALOG },
{ HIBERNATE_KEY_NO_DIALOG, NULL, N_("Hibernate"), "XF86Hibernate", POWER_KEYS_MODE_NO_DIALOG },
- { SCREEN_BRIGHTNESS_UP_KEY, NULL, N_("Brightness Up"), "XF86MonBrightnessUp",
SHELL_KEYBINDING_MODE_ALL },
- { SCREEN_BRIGHTNESS_DOWN_KEY, NULL, N_("Brightness Down"), "XF86MonBrightnessDown",
SHELL_KEYBINDING_MODE_ALL },
- { KEYBOARD_BRIGHTNESS_UP_KEY, NULL, N_("Keyboard Brightness Up"), "XF86KbdBrightnessUp",
SHELL_KEYBINDING_MODE_ALL },
- { KEYBOARD_BRIGHTNESS_DOWN_KEY, NULL, N_("Keyboard Brightness Down"), "XF86KbdBrightnessDown",
SHELL_KEYBINDING_MODE_ALL },
- { KEYBOARD_BRIGHTNESS_TOGGLE_KEY, NULL, N_("Keyboard Brightness Toggle"), "XF86KbdLightOnOff",
SHELL_KEYBINDING_MODE_ALL },
- { BATTERY_KEY, NULL, N_("Battery Status"), "XF86Battery", GSD_KEYBINDING_MODE_LAUNCHER },
+ { SCREEN_BRIGHTNESS_UP_KEY, NULL, N_("Brightness Up"), "XF86MonBrightnessUp", SHELL_ACTION_MODE_ALL
},
+ { SCREEN_BRIGHTNESS_DOWN_KEY, NULL, N_("Brightness Down"), "XF86MonBrightnessDown",
SHELL_ACTION_MODE_ALL },
+ { KEYBOARD_BRIGHTNESS_UP_KEY, NULL, N_("Keyboard Brightness Up"), "XF86KbdBrightnessUp",
SHELL_ACTION_MODE_ALL },
+ { KEYBOARD_BRIGHTNESS_DOWN_KEY, NULL, N_("Keyboard Brightness Down"), "XF86KbdBrightnessDown",
SHELL_ACTION_MODE_ALL },
+ { KEYBOARD_BRIGHTNESS_TOGGLE_KEY, NULL, N_("Keyboard Brightness Toggle"), "XF86KbdLightOnOff",
SHELL_ACTION_MODE_ALL },
+ { BATTERY_KEY, NULL, N_("Battery Status"), "XF86Battery", GSD_ACTION_MODE_LAUNCHER },
};
#undef SCREENSAVER_MODE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]