diff options
Diffstat (limited to 'rpms/sugar/0024-accessibility_0001_cp_accessibility_keyboard.patch.patch')
-rw-r--r-- | rpms/sugar/0024-accessibility_0001_cp_accessibility_keyboard.patch.patch | 523 |
1 files changed, 523 insertions, 0 deletions
diff --git a/rpms/sugar/0024-accessibility_0001_cp_accessibility_keyboard.patch.patch b/rpms/sugar/0024-accessibility_0001_cp_accessibility_keyboard.patch.patch new file mode 100644 index 0000000..67b1f2e --- /dev/null +++ b/rpms/sugar/0024-accessibility_0001_cp_accessibility_keyboard.patch.patch @@ -0,0 +1,523 @@ +From 0ebe85157993bc1793488edbe479ed9149e5bf43 Mon Sep 17 00:00:00 2001 +From: Unknown <unknown@unknown.org> +Date: Mon, 1 Nov 2010 17:56:53 +0100 +Subject: [PATCH sugar 24/74] accessibility_0001_cp_accessibility_keyboard.patch + +--- + bin/sugar-session | 7 ++ + configure.ac | 1 + + data/icons/Makefile.am | 1 + + data/icons/module-accessibility.svg | 92 +++++++++++++++++++ + extensions/cpsection/Makefile.am | 15 +++- + extensions/cpsection/accessibility/Makefile.am | 6 ++ + extensions/cpsection/accessibility/__init__.py | 25 +++++ + extensions/cpsection/accessibility/model.py | 55 +++++++++++ + extensions/cpsection/accessibility/view.py | 114 ++++++++++++++++++++++++ + src/jarabe/model/Makefile.am | 1 + + src/jarabe/model/accessibility.py | 76 ++++++++++++++++ + 11 files changed, 391 insertions(+), 2 deletions(-) + create mode 100644 data/icons/module-accessibility.svg + create mode 100644 extensions/cpsection/accessibility/Makefile.am + create mode 100644 extensions/cpsection/accessibility/__init__.py + create mode 100644 extensions/cpsection/accessibility/model.py + create mode 100644 extensions/cpsection/accessibility/view.py + create mode 100644 src/jarabe/model/accessibility.py + +diff --git a/bin/sugar-session b/bin/sugar-session +index 40c9db7..a1d7cac 100755 +--- a/bin/sugar-session ++++ b/bin/sugar-session +@@ -1,6 +1,7 @@ + #!/usr/bin/env python + # Copyright (C) 2006, Red Hat, Inc. + # Copyright (C) 2009, One Laptop Per Child Association Inc ++# Copyright (C) 2010, Plan Ceibal <comunidad@plan.ceibal.edu.uy> + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -193,6 +194,7 @@ def bootstrap(): + gobject.idle_add(setup_notification_service_cb) + gobject.idle_add(setup_file_transfer_cb) + gobject.idle_add(show_software_updates_cb) ++ gobject.idle_add(setup_accessibility_cb) + + if sys.modules.has_key('xklavier'): + gobject.idle_add(setup_keyboard_cb) +@@ -204,6 +206,11 @@ def set_fonts(): + settings = gtk.settings_get_default() + settings.set_property("gtk-font-name", "%s %f" % (face, size)) + ++def setup_accessibility_cb(): ++ from jarabe.model import accessibility ++ accessibility_manager = accessibility.AccessibilityManager() ++ accessibility_manager.setup_accessibility() ++ + def main(): + try: + from sugar import env +diff --git a/configure.ac b/configure.ac +index 237b2ad..df9614f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -50,6 +50,7 @@ data/icons/Makefile + data/Makefile + data/sugar-emulator.desktop + extensions/cpsection/aboutcomputer/Makefile ++extensions/cpsection/accessibility/Makefile + extensions/cpsection/aboutme/Makefile + extensions/cpsection/datetime/Makefile + extensions/cpsection/frame/Makefile +diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am +index a35643a..2497c4a 100644 +--- a/data/icons/Makefile.am ++++ b/data/icons/Makefile.am +@@ -3,6 +3,7 @@ sugardir = $(pkgdatadir)/data/icons + sugar_DATA = \ + module-about_me.svg \ + module-about_my_computer.svg \ ++ module-accessibility.svg \ + module-date_and_time.svg \ + module-frame.svg \ + module-keyboard.svg \ +diff --git a/data/icons/module-accessibility.svg b/data/icons/module-accessibility.svg +new file mode 100644 +index 0000000..245a47e +--- /dev/null ++++ b/data/icons/module-accessibility.svg +@@ -0,0 +1,92 @@ ++<?xml version="1.0" encoding="UTF-8" standalone="no"?> ++<!-- Created with Inkscape (http://www.inkscape.org/) --> ++ ++<svg ++ xmlns:svg="http://www.w3.org/2000/svg" ++ xmlns="http://www.w3.org/2000/svg" ++ version="1.0" ++ width="55" ++ height="55" ++ id="svg795"> ++ <defs ++ id="defs797" /> ++ <g ++ id="layer1"> ++ <path ++ d="m -23.738584,30.440666 a 8.901969,11.301082 0 1 1 -17.803937,0 8.901969,11.301082 0 1 1 17.803937,0 z" ++ transform="matrix(1.2765958,0,0,1.0558659,19.192898,-13.127946)" ++ id="path12" ++ style="fill:none;stroke:#ffffff" /> ++ <path ++ d="m 30.145644,37.823484 c -0.583589,6.659344 -6.7511,11.52268 -13.775517,10.862567 C 9.3457054,48.02594 4.1243814,42.092348 4.7079694,35.433004 5.2915594,28.773661 20.67887,20.597949 14.885997,24.011638 -12.777062,40.313232 24.43362,62.068174 30.145644,37.823484 z" ++ id="path1405-0" ++ style="fill:none;stroke:#ffffff;stroke-width:1.44962609;stroke-opacity:1" /> ++ <rect ++ width="2.916333" ++ height="21.188446" ++ ry="1.3939767" ++ x="18.332197" ++ y="13.76814" ++ id="rect1438-8" ++ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.50547338;stroke-opacity:1" /> ++ <rect ++ width="2.8716421" ++ height="19.140917" ++ ry="1.259271" ++ x="-35.091366" ++ y="-38.207035" ++ transform="matrix(0,-1,-1,0,0,0)" ++ id="rect1438-1-87" ++ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.41987956;stroke-opacity:1" /> ++ <rect ++ width="2.5733202" ++ height="15.766372" ++ ry="1.0372615" ++ x="-5.4068875" ++ y="-65.997124" ++ transform="matrix(-0.55477829,0.83199823,-0.68762037,-0.72607041,0,0)" ++ id="rect1438-0-4" ++ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1.21988189;stroke-opacity:1" /> ++ <rect ++ width="2.0588" ++ height="12.916228" ++ ry="0.84975183" ++ x="6.7647386" ++ y="-38.278324" ++ transform="matrix(-0.21998034,0.97550431,-0.88967727,-0.45658992,0,0)" ++ id="rect1438-0-1-8" ++ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.98759735;stroke-opacity:1" /> ++ <rect ++ width="0.98179615" ++ height="13.275604" ++ ry="0.87339497" ++ x="-30.243309" ++ y="-41.495876" ++ transform="matrix(0,-1,-1,0,0,0)" ++ id="rect1438-1-8-5" ++ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.69142139;stroke-opacity:1" /> ++ <rect ++ width="0.97070193" ++ height="11.568416" ++ ry="0.76108003" ++ x="50.822704" ++ y="-8.6089849" ++ transform="matrix(0.89791652,0.44016579,0.56230073,-0.82693282,0,0)" ++ id="rect1438-1-8-0-0" ++ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.64177793;stroke-opacity:1" /> ++ <rect ++ width="1.6299056" ++ height="7.7739253" ++ ry="0.51144254" ++ x="72.759727" ++ y="35.364716" ++ transform="matrix(0.9888174,0.14913131,-0.60877492,0.79334299,0,0)" ++ id="rect1438-0-1-7-7" ++ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.68172067;stroke-opacity:1" /> ++ <path ++ d="m 79.67578,18.634508 a 3.2829957,3.0304577 0 1 1 -6.565992,0 3.2829957,3.0304577 0 1 1 6.565992,0 z" ++ transform="matrix(1.5397454,0,0,1.4719643,-97.932275,-17.750188)" ++ id="path1603-2" ++ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-opacity:1" /> ++ </g> ++</svg> +diff --git a/extensions/cpsection/Makefile.am b/extensions/cpsection/Makefile.am +index a92b5dd..d623380 100644 +--- a/extensions/cpsection/Makefile.am ++++ b/extensions/cpsection/Makefile.am +@@ -1,5 +1,16 @@ +-SUBDIRS = aboutme aboutcomputer datetime frame keyboard language \ +- modemconfiguration network power updater ++SUBDIRS = \ ++ aboutme \ ++ aboutcomputer \ ++ accessibility \ ++ datetime \ ++ frame \ ++ keyboard \ ++ language \ ++ modemconfiguration \ ++ network \ ++ power \ ++ updater \ ++ # + + sugardir = $(pkgdatadir)/extensions/cpsection + sugar_PYTHON = __init__.py +diff --git a/extensions/cpsection/accessibility/Makefile.am b/extensions/cpsection/accessibility/Makefile.am +new file mode 100644 +index 0000000..70d26f4 +--- /dev/null ++++ b/extensions/cpsection/accessibility/Makefile.am +@@ -0,0 +1,6 @@ ++sugardir = $(pkgdatadir)/extensions/cpsection/accessibility ++ ++sugar_PYTHON = \ ++ __init__.py \ ++ model.py \ ++ view.py +diff --git a/extensions/cpsection/accessibility/__init__.py b/extensions/cpsection/accessibility/__init__.py +new file mode 100644 +index 0000000..3467372 +--- /dev/null ++++ b/extensions/cpsection/accessibility/__init__.py +@@ -0,0 +1,25 @@ ++# Copyright (C) 2010 Plan Ceibal ++# ++# Author: Esteban Arias <earias@plan.ceibal.edu.uy> ++# Contact information: comunidad@plan.ceibal.edu.uy ++# Plan Ceibal http://www.ceibal.edu.uy ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see <http://www.gnu.org/licenses/>. ++ ++from gettext import gettext as _ ++ ++CLASS = 'accessibility' ++ICON = 'module-accessibility' ++TITLE = _('Accessibility') ++ +diff --git a/extensions/cpsection/accessibility/model.py b/extensions/cpsection/accessibility/model.py +new file mode 100644 +index 0000000..5136460 +--- /dev/null ++++ b/extensions/cpsection/accessibility/model.py +@@ -0,0 +1,55 @@ ++# Copyright (C) 2010 Plan Ceibal ++# ++# Author: Esteban Arias <earias@plan.ceibal.edu.uy> ++# Contact information: comunidad@plan.ceibal.edu.uy ++# Plan Ceibal http://www.ceibal.edu.uy ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see <http://www.gnu.org/licenses/>. ++ ++import subprocess ++import gconf ++ ++from gettext import gettext as _ ++from jarabe.model import accessibility ++ ++keyboard = accessibility.Keyboard() ++ ++KEYWORDS = ['mouse_keys', 'sticky_keys', 'bounce_keys'] ++ ++def get_mouse_keys(): ++ return keyboard.get_mouse_keys() ++ ++def set_mouse_keys(activar): ++ keyboard.set_mouse_keys(activar) ++ ++def print_mouse_keys(): ++ print str(get_mouse_keys()) ++ ++def get_sticky_keys(): ++ return keyboard.get_sticky_keys() ++ ++def set_sticky_keys(activar): ++ keyboard.set_sticky_keys(activar) ++ ++def print_sticky_keys(): ++ print str(get_sticky_keys()) ++ ++def get_bounce_keys(): ++ return keyboard.get_bounce_keys() ++ ++def set_bounce_keys(activar): ++ keyboard.set_bounce_keys(activar) ++ ++def print_bounce_keys(): ++ print str(get_bounce_keys()) +diff --git a/extensions/cpsection/accessibility/view.py b/extensions/cpsection/accessibility/view.py +new file mode 100644 +index 0000000..9f291ac +--- /dev/null ++++ b/extensions/cpsection/accessibility/view.py +@@ -0,0 +1,114 @@ ++# Copyright (C) 2010 Plan Ceibal ++# ++# Author: Esteban Arias <earias@plan.ceibal.edu.uy> ++# Contact information: comunidad@plan.ceibal.edu.uy ++# Plan Ceibal http://www.ceibal.edu.uy ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see <http://www.gnu.org/licenses/>. ++ ++ ++import gtk ++from gettext import gettext as _ ++ ++from sugar.graphics import style ++ ++from jarabe import config ++from jarabe.controlpanel.sectionview import SectionView ++from jarabe.controlpanel.inlinealert import InlineAlert ++ ++class accessibility(SectionView): ++ def __init__(self, model, alerts=None): ++ SectionView.__init__(self) ++ ++ self._model = model ++ self.set_border_width(style.DEFAULT_SPACING * 2) ++ self.set_spacing(style.DEFAULT_SPACING) ++ group = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) ++ ++ separator_pm = gtk.HSeparator() ++ self.pack_start(separator_pm, expand=False) ++ separator_pm.show() ++ ++ label_pm_teclado = gtk.Label(_('Keyboard')) ++ label_pm_teclado.set_alignment(0, 0) ++ self.pack_start(label_pm_teclado, expand=False) ++ label_pm_teclado.show() ++ ++ self.box_pm = gtk.VBox() ++ self.box_pm.set_border_width(style.DEFAULT_SPACING * 2) ++ self.box_pm.set_spacing(style.DEFAULT_SPACING) ++ ++ self._view_mouse_keys() ++ self._view_sticky_keys() ++ self._view_bounce_keys() ++ ++ self.pack_start(self.box_pm, expand=False) ++ self.box_pm.show() ++ ++ def _set_mouse_keys(self, widget): ++ state = widget.get_active() ++ self._model.set_mouse_keys(state) ++ ++ def _set_sticky_keys(self, widget): ++ state = widget.get_active() ++ self._model.set_sticky_keys(state) ++ ++ def _set_bounce_keys(self, widget): ++ state = widget.get_active() ++ self._model.set_bounce_keys(state) ++ ++ def undo(self): ++ self._model.set_mouse_keys(self.init_state_mouse_keys) ++ self._model.set_sticky_keys(self.init_state_sticky_keys) ++ self._model.set_bounce_keys(self.init_state_bounce_keys) ++ ++ def _view_mouse_keys(self): ++ self.btn_mouse_keys = gtk.CheckButton(_('Mouse Keys')) ++ self._mouse_pm_change_handler = self.btn_mouse_keys.connect("toggled", self._set_mouse_keys) ++ self.init_state_mouse_keys = self._model.get_mouse_keys() ++ self.btn_mouse_keys.set_active(self.init_state_mouse_keys) ++ self.box_pm.pack_start(self.btn_mouse_keys, True, True, 2) ++ self.btn_mouse_keys.show() ++ ++ lbl_mouse = gtk.Label(_('Move the mouse pointer with keyboard number.')) ++ lbl_mouse.set_alignment(0, 0) ++ self.box_pm.pack_start(lbl_mouse, True, True, 2) ++ lbl_mouse.show() ++ ++ def _view_sticky_keys(self): ++ self.btn_sticky_keys = gtk.CheckButton(_('Sticky Keys')) ++ self._sticky_pm_change_handler = self.btn_sticky_keys.connect("toggled", self._set_sticky_keys) ++ self.init_state_sticky_keys = self._model.get_sticky_keys() ++ self.btn_sticky_keys.set_active(self.init_state_sticky_keys) ++ self.box_pm.pack_start(self.btn_sticky_keys, True, True, 2) ++ self.btn_sticky_keys.show() ++ ++ lbl_sticky = gtk.Label(_('Instead of having to press two keys at once (such as CTRL + Q), you can press one key at a time.')) ++ lbl_sticky.set_line_wrap(True) ++ lbl_sticky.set_alignment(0, 0) ++ self.box_pm.pack_start(lbl_sticky, True, True, 2) ++ lbl_sticky.show() ++ ++ def _view_bounce_keys(self): ++ self.btn_bounce_keys = gtk.CheckButton(_('Bounce Keys')) ++ self._bounce_pm_change_handler = self.btn_bounce_keys.connect("toggled", self._set_bounce_keys) ++ self.init_state_bounce_keys = self._model.get_bounce_keys() ++ self.btn_bounce_keys.set_active(self.init_state_bounce_keys) ++ self.box_pm.pack_start(self.btn_bounce_keys, True, True, 2) ++ self.btn_bounce_keys.show() ++ ++ lbl_bounce = gtk.Label(_('Ignore rapid, repeated keypresses of the same key.')) ++ lbl_bounce.set_alignment(0, 0) ++ self.box_pm.pack_start(lbl_bounce, True, True, 2) ++ lbl_bounce.show() +diff --git a/src/jarabe/model/Makefile.am b/src/jarabe/model/Makefile.am +index bd9bef2..ee8b865 100644 +--- a/src/jarabe/model/Makefile.am ++++ b/src/jarabe/model/Makefile.am +@@ -2,6 +2,7 @@ sugardir = $(pythondir)/jarabe/model + sugar_PYTHON = \ + adhoc.py \ + __init__.py \ ++ accessibility.py \ + buddy.py \ + bundleregistry.py \ + filetransfer.py \ +diff --git a/src/jarabe/model/accessibility.py b/src/jarabe/model/accessibility.py +new file mode 100644 +index 0000000..b851b3c +--- /dev/null ++++ b/src/jarabe/model/accessibility.py +@@ -0,0 +1,76 @@ ++# Copyright (C) 2010 Plan Ceibal ++# ++# Author: Esteban Arias <earias@plan.ceibal.edu.uy> ++# Contact information: comunidad@plan.ceibal.edu.uy ++# Plan Ceibal http://www.ceibal.edu.uy ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see <http://www.gnu.org/licenses/>. ++ ++import subprocess ++import gconf ++ ++from gettext import gettext as _ ++ ++class Keyboard: ++ ++ def get_mouse_keys(self): ++ client = gconf.client_get_default() ++ return client.get_bool("/desktop/sugar/accessibility/keyboard/mousekeys_enable") ++ ++ def set_mouse_keys(self, activar): ++ client = gconf.client_get_default() ++ client.set_bool("/desktop/sugar/accessibility/keyboard/mousekeys_enable", activar) ++ self.run_config_keyboard() ++ ++ def get_sticky_keys(self): ++ client = gconf.client_get_default() ++ return client.get_bool("/desktop/sugar/accessibility/keyboard/stickykeys_enable") ++ ++ def set_sticky_keys(self, activar): ++ client = gconf.client_get_default() ++ client.set_bool("/desktop/sugar/accessibility/keyboard/stickykeys_enable", activar) ++ self.run_config_keyboard() ++ ++ def get_bounce_keys(self): ++ client = gconf.client_get_default() ++ return client.get_bool("/desktop/sugar/accessibility/keyboard/bouncekeys_enable") ++ ++ def set_bounce_keys(self, activar): ++ client = gconf.client_get_default() ++ client.set_bool("/desktop/sugar/accessibility/keyboard/bouncekeys_enable", activar) ++ self.run_config_keyboard() ++ ++ def run_config_keyboard(self): ++ cmd = ['ax'] ++ if self.get_sticky_keys(): ++ cmd.append('+stickykeys') ++ else: ++ cmd.append('-stickykeys') ++ if self.get_bounce_keys(): ++ cmd.append('+bouncekeys') ++ else: ++ cmd.append('-bouncekeys') ++ if self.get_mouse_keys(): ++ cmd += ['+mousekeys', 'mousemaxspeed', '3000', 'mousetimetomax', '1000', '-timeout', '-repeatkeys'] ++ else: ++ cmd += ['-mousekeys', 'mousemaxspeed', '3000', 'mousetimetomax', '1000', '+timeout', '+repeatkeys'] ++ subprocess.call(cmd) ++ ++class AccessibilityManager: ++ def setup_accessibility(self): ++ client = gconf.client_get_default() ++ is_accessibility = client.dir_exists("/desktop/sugar/accessibility") ++ if is_accessibility: ++ keyboard = Keyboard() ++ keyboard.run_config_keyboard() +-- +1.7.6 + |