From b8e3a26d0975cb43cb5a315bceaf581f6ea2a5a8 Mon Sep 17 00:00:00 2001 From: infirit Date: Sun, 2 Nov 2014 15:04:36 +0100 Subject: a11y-keybindings: Move to media-keys plugin --- data/50-accessibility.xml.in | 8 +-- data/Makefile.am | 5 +- ...ingsDaemon.plugins.media-keys.gschema.xml.in.in | 15 ++++++ data/org.mate.keybindings.gschema.xml.in.in | 58 ---------------------- plugins/media-keys/acme.h | 6 +++ plugins/media-keys/msd-media-keys-manager.c | 39 +++++++++++++++ po/POTFILES.in | 1 - 7 files changed, 66 insertions(+), 66 deletions(-) delete mode 100644 data/org.mate.keybindings.gschema.xml.in.in diff --git a/data/50-accessibility.xml.in b/data/50-accessibility.xml.in index 998ba17..89a9e6b 100644 --- a/data/50-accessibility.xml.in +++ b/data/50-accessibility.xml.in @@ -1,8 +1,8 @@ - + - - - + + + diff --git a/data/Makefile.am b/data/Makefile.am index 00bb02d..008061a 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -3,7 +3,6 @@ NULL = msd_gschemas_in_in = \ org.mate.applications-at.gschema.xml.in.in \ org.mate.font-rendering.gschema.xml.in.in \ - org.mate.keybindings.gschema.xml.in.in \ org.mate.peripherals-smartcard.gschema.xml.in.in \ org.mate.peripherals-touchpad.gschema.xml.in.in \ org.mate.SettingsDaemon.plugins.a11y-keyboard.gschema.xml.in.in \ @@ -57,9 +56,9 @@ man_MANS = mate-settings-daemon.1 @INTLTOOL_XML_NOMERGE_RULE@ #disabled until we support it -#xmldir = @MATE_KEYBINDINGS_KEYSDIR@ +xmldir = @MATE_KEYBINDINGS_KEYSDIR@ xml_in_files = 50-accessibility.xml.in -#xml_DATA = $(xml_in_files:.xml.in=.xml) +xml_DATA = $(xml_in_files:.xml.in=.xml) EXTRA_DIST = \ $(msd_gschemas_in_in) \ diff --git a/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in.in b/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in.in index f855cfd..3e0ee2c 100644 --- a/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in.in +++ b/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in.in @@ -110,5 +110,20 @@ <_summary>Next track <_description>Binding to skip to next track. + + '' + <_summary>Toggle magnifier + <_description>Binding to show the screen magnifier + + + '' + <_summary>Toggle screen reader + <_description>Binding to start the screen reader + + + '' + <_summary>Toggle on-screen keyboard + <_description>Binding to show the on-screen keyboard + diff --git a/data/org.mate.keybindings.gschema.xml.in.in b/data/org.mate.keybindings.gschema.xml.in.in deleted file mode 100644 index 9e3aca6..0000000 --- a/data/org.mate.keybindings.gschema.xml.in.in +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - '' - <_summary>Toggle magnifier - <_description>Binding to toggle the magnifier. - - - 'Toggle magnifier' - <_summary>The name of the keyboard shortcut to toggle the magnifier - <_description>This is the name of the keyboard shortcut to toggle the magnifier. This name will be shown in the keyboard shortcut preferences dialog. - - - 'mate-gsettings-toggle screen-keyboard-enabled' - <_summary>Toggle magnifier - <_description>Command used to turn the magnifier on or off. - - - - - '' - <_summary>Toggle screen reader - <_description>Binding to toggle the screen reader. - - - 'Toggle screen reader' - <_summary>The name of the keyboard shortcut to toggle the screen reader - <_description>This is the name of the keyboard shortcut to toggle the screen reader. This name will be shown in the keyboard shortcut preferences dialog. - - - 'mate-gsettings-toggle screen-reader-enabled' - <_summary>Toggle screen reader - <_description>Command used to turn the screen reader on or off. - - - - - 'Toggle on-screen keyboard' - <_summary>The name of the keyboard shortcut to toggle the on-screen keyboard - <_description>This is the name of the keyboard shortcut to toggle the on-screen keyboard. This name will be shown in the keyboard shortcut preferences dialog. - - - '' - <_summary>Toggle on-screen keyboard - <_description>Binding to toggle the on-screen keyboard. - - - 'mate-gsettings-toggle screen-keyboard-enabled' - <_summary>Toggle on-screen keyboard - <_description>Command used to turn the on-screen keyboard on or off. - - - diff --git a/plugins/media-keys/acme.h b/plugins/media-keys/acme.h index 0f87bc6..17ce1ed 100644 --- a/plugins/media-keys/acme.h +++ b/plugins/media-keys/acme.h @@ -45,6 +45,9 @@ enum { STOP_KEY, PREVIOUS_KEY, NEXT_KEY, + MAGNIFIER_KEY, + SCREENREADER_KEY, + ON_SCREEN_KEYBOARD_KEY, HANDLED_KEYS }; @@ -72,6 +75,9 @@ static struct { { STOP_KEY, "stop", NULL }, { PREVIOUS_KEY, "previous", NULL }, { NEXT_KEY, "next", NULL }, + { MAGNIFIER_KEY, "magnifier", NULL, NULL }, + { SCREENREADER_KEY, "screenreader", NULL, NULL }, + { ON_SCREEN_KEYBOARD_KEY, "on-screen-keyboard", NULL, NULL }, }; #endif /* __ACME_H__ */ diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c index 1ff0291..f0b0229 100644 --- a/plugins/media-keys/msd-media-keys-manager.c +++ b/plugins/media-keys/msd-media-keys-manager.c @@ -880,6 +880,36 @@ do_multimedia_player_action (MsdMediaKeysManager *manager, return msd_media_player_key_pressed (manager, key); } +static void +do_toggle_accessibility_key (const char *key) +{ + GSettings *settings; + gboolean state; + + settings = g_settings_new ("org.mate.applications-at"); + state = g_settings_get_boolean (settings, key); + g_settings_set_boolean (settings, key, !state); + g_object_unref (settings); +} + +static void +do_magnifier_action (MsdMediaKeysManager *manager) +{ + do_toggle_accessibility_key ("screen-magnifier-enabled"); +} + +static void +do_screenreader_action (MsdMediaKeysManager *manager) +{ + do_toggle_accessibility_key ("screen-reader-enabled"); +} + +static void +do_on_screen_keyboard_action (MsdMediaKeysManager *manager) +{ + do_toggle_accessibility_key ("screen-keyboard-enabled"); +} + static gboolean do_action (MsdMediaKeysManager *manager, int type) @@ -969,6 +999,15 @@ do_action (MsdMediaKeysManager *manager, case NEXT_KEY: return do_multimedia_player_action (manager, "Next"); break; + case MAGNIFIER_KEY: + do_magnifier_action (manager); + break; + case SCREENREADER_KEY: + do_screenreader_action (manager); + break; + case ON_SCREEN_KEYBOARD_KEY: + do_on_screen_keyboard_action (manager); + break; default: g_assert_not_reached (); } diff --git a/po/POTFILES.in b/po/POTFILES.in index e7dec6a..f17b5f3 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -3,7 +3,6 @@ data/50-accessibility.xml.in data/org.mate.applications-at.gschema.xml.in.in data/org.mate.font-rendering.gschema.xml.in.in -data/org.mate.keybindings.gschema.xml.in.in data/org.mate.peripherals-smartcard.gschema.xml.in.in data/org.mate.peripherals-touchpad.gschema.xml.in.in data/org.mate.SettingsDaemon.plugins.a11y-keyboard.gschema.xml.in.in -- cgit v1.2.1