orca r4226 - in branches/phase2: . src/orca src/orca/plugins src/orca/plugins/bookmarks src/orca/plugins/debug_actions src/orca/plugins/flat_review src/orca/plugins/speech_parameters src/orca/plugins/where_am_i
- From: wwalker svn gnome org
- To: svn-commits-list gnome org
- Subject: orca r4226 - in branches/phase2: . src/orca src/orca/plugins src/orca/plugins/bookmarks src/orca/plugins/debug_actions src/orca/plugins/flat_review src/orca/plugins/speech_parameters src/orca/plugins/where_am_i
- Date: Mon, 15 Sep 2008 16:37:16 +0000 (UTC)
Author: wwalker
Date: Mon Sep 15 16:37:16 2008
New Revision: 4226
URL: http://svn.gnome.org/viewvc/orca?rev=4226&view=rev
Log:
Turn each plugin into its own package.
Added:
branches/phase2/src/orca/plugins/bookmarks/ (props changed)
branches/phase2/src/orca/plugins/bookmarks/Makefile.am
branches/phase2/src/orca/plugins/bookmarks/__init__.py (contents, props changed)
branches/phase2/src/orca/plugins/bookmarks/braille_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/bookmarks/keyboard_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/bookmarks/plugin.py (contents, props changed)
branches/phase2/src/orca/plugins/debug_actions/ (props changed)
branches/phase2/src/orca/plugins/debug_actions/Makefile.am
branches/phase2/src/orca/plugins/debug_actions/__init__.py (contents, props changed)
branches/phase2/src/orca/plugins/debug_actions/braille_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/debug_actions/keyboard_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/debug_actions/plugin.py (contents, props changed)
branches/phase2/src/orca/plugins/flat_review/ (props changed)
branches/phase2/src/orca/plugins/flat_review/Makefile.am
branches/phase2/src/orca/plugins/flat_review/__init__.py (contents, props changed)
branches/phase2/src/orca/plugins/flat_review/braille_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/flat_review/keyboard_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/flat_review/plugin.py (contents, props changed)
branches/phase2/src/orca/plugins/speech_parameters/ (props changed)
branches/phase2/src/orca/plugins/speech_parameters/Makefile.am (contents, props changed)
branches/phase2/src/orca/plugins/speech_parameters/__init__.py (contents, props changed)
branches/phase2/src/orca/plugins/speech_parameters/braille_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/speech_parameters/keyboard_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/speech_parameters/plugin.py (contents, props changed)
branches/phase2/src/orca/plugins/where_am_i/ (props changed)
branches/phase2/src/orca/plugins/where_am_i/Makefile.am
branches/phase2/src/orca/plugins/where_am_i/__init__.py (contents, props changed)
branches/phase2/src/orca/plugins/where_am_i/braille_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/where_am_i/keyboard_bindings.py (contents, props changed)
branches/phase2/src/orca/plugins/where_am_i/plugin.py (contents, props changed)
Removed:
branches/phase2/src/orca/plugins/bookmarks.py
branches/phase2/src/orca/plugins/debug_actions.py
branches/phase2/src/orca/plugins/flat_review.py
branches/phase2/src/orca/plugins/speech_parameters.py
branches/phase2/src/orca/plugins/where_am_i.py
Modified:
branches/phase2/configure.in
branches/phase2/logging.conf
branches/phase2/src/orca/default.py
branches/phase2/src/orca/plugins/Makefile.am
Modified: branches/phase2/configure.in
==============================================================================
--- branches/phase2/configure.in (original)
+++ branches/phase2/configure.in Mon Sep 15 16:37:16 2008
@@ -160,6 +160,11 @@
src/louis/constants.py
src/orca/Makefile
src/orca/plugins/Makefile
+src/orca/plugins/bookmarks/Makefile
+src/orca/plugins/debug_actions/Makefile
+src/orca/plugins/flat_review/Makefile
+src/orca/plugins/speech_parameters/Makefile
+src/orca/plugins/where_am_i/Makefile
src/orca/scripts/Makefile
src/orca/scripts/apps/Makefile
src/orca/scripts/toolkits/Makefile
Modified: branches/phase2/logging.conf
==============================================================================
--- branches/phase2/logging.conf (original)
+++ branches/phase2/logging.conf Mon Sep 15 16:37:16 2008
@@ -62,5 +62,5 @@
format: %(levelname)s:%(name)s: %(message)s
[formatter_detailed]
-format: %(levelname)s %(module)s:%(lineno)d: %(message)s
+format: %(levelname)s %(name)s:%(lineno)d: %(message)s
Modified: branches/phase2/src/orca/default.py
==============================================================================
--- branches/phase2/src/orca/default.py (original)
+++ branches/phase2/src/orca/default.py Mon Sep 15 16:37:16 2008
@@ -53,18 +53,34 @@
"""
# TODO: make the discovery of plugin classes somewhat dynamic
#
- import plugins.debug_actions
- import plugins.speech_parameters
- import plugins.bookmarks
- import plugins.where_am_i
- import plugins.flat_review
-
- return script.Script._getPluginClasses(self) \
- + [plugins.debug_actions.Plugin,
- plugins.speech_parameters.Plugin,
- plugins.bookmarks.Plugin,
- plugins.where_am_i.Plugin,
- plugins.flat_review.Plugin]
+ pluginClasses = []
+ try:
+ import plugins.debug_actions
+ pluginClasses.append(plugins.debug_actions.Plugin)
+ except:
+ log.exception("handled exception while importing module:")
+ try:
+ import plugins.speech_parameters
+ pluginClasses.append(plugins.speech_parameters.Plugin)
+ except:
+ log.exception("handled exception while importing module:")
+ try:
+ import plugins.bookmarks
+ pluginClasses.append(plugins.bookmarks.Plugin)
+ except:
+ log.exception("handled exception while importing module:")
+ try:
+ import plugins.where_am_i
+ pluginClasses.append(plugins.where_am_i.Plugin)
+ except:
+ log.exception("handled exception while importing module:")
+ try:
+ import plugins.flat_review
+ pluginClasses.append(plugins.flat_review.Plugin)
+ except:
+ log.exception("handled exception while importing module:")
+
+ return script.Script._getPluginClasses(self) + pluginClasses
def _createObjectEventListeners(self):
"""Sets up the AT-SPI event listeners for this script.
Modified: branches/phase2/src/orca/plugins/Makefile.am
==============================================================================
--- branches/phase2/src/orca/plugins/Makefile.am (original)
+++ branches/phase2/src/orca/plugins/Makefile.am Mon Sep 15 16:37:16 2008
@@ -1,12 +1,12 @@
orca_pathdir=$(pyexecdir)
-orca_python_PYTHON = \
- __init__.py \
- bookmarks.py \
- debug_actions.py \
- flat_review.py \
- speech_parameters.py \
- where_am_i.py
+orca_python_PYTHON = __init__.py
orca_pythondir=$(pyexecdir)/orca/plugins
+SUBDIRS = \
+ bookmarks \
+ debug_actions \
+ flat_review \
+ speech_parameters \
+ where_am_i
Added: branches/phase2/src/orca/plugins/bookmarks/Makefile.am
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/bookmarks/Makefile.am Mon Sep 15 16:37:16 2008
@@ -0,0 +1,9 @@
+orca_pathdir=$(pyexecdir)
+
+orca_python_PYTHON = \
+ __init__.py \
+ braille_bindings.py \
+ keyboard_bindings.py \
+ plugin.py
+
+orca_pythondir=$(pyexecdir)/orca/plugins/bookmarks
Added: branches/phase2/src/orca/plugins/bookmarks/__init__.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/bookmarks/__init__.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,25 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for providing bookmark operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+from plugin import Plugin
Added: branches/phase2/src/orca/plugins/bookmarks/braille_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/bookmarks/braille_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,29 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Braille bindings for bookmarks.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+bindings = []
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/bookmarks/keyboard_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/bookmarks/keyboard_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,69 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Keyboard bindings for bookmarks.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+
+bindings = [
+ input_bindings.KeyBinding(
+ "b",
+ input_event.defaultModifierMask,
+ input_event.ORCA_ALT_MODIFIER_MASK,
+ "saveBookmarks"),
+
+ input_bindings.KeyBinding(
+ "b",
+ input_event.defaultModifierMask,
+ input_event.ORCA_SHIFT_MODIFIER_MASK,
+ "goToPrevBookmark"),
+
+ input_bindings.KeyBinding(
+ "b",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "goToNextBookmark"),
+]
+for key in xrange(1, 7):
+ bindings.append(
+ input_bindings.KeyBinding(
+ str(key),
+ input_event.defaultModifierMask,
+ input_event.ORCA_ALT_MODIFIER_MASK,
+ "addBookmark"))
+ bindings.append(
+ input_bindings.KeyBinding(
+ str(key),
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "goToBookmark"))
+ bindings.append(
+ input_bindings.KeyBinding(
+ str(key),
+ input_event.defaultModifierMask,
+ input_event.SHIFT_ALT_MODIFIER_MASK,
+ "bookmarkCurrentWhereAmI"))
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/bookmarks/plugin.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/bookmarks/plugin.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,173 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for handling bookmarks.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import logging
+log = logging.getLogger('orca.plugins.bookmarks.plugin')
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+import orca.plugin as plugin
+
+from orca.orca_i18n import _ # for gettext support
+
+from keyboard_bindings import bindings as keyboardBindings
+
+try:
+ from braille_bindings import bindings as brailleBindings
+except:
+ log.exception("Not using braille bindings because of this exception:")
+ brailleBindings = []
+
+class Plugin(plugin.Plugin):
+ """A plugin for handling bookmarks.
+ """
+ def __init__(self, owner):
+ """Creates a Plugin for the given script.
+ This method should not be called by anyone except the
+ owner.
+
+ Arguments:
+ - owner: the Script owning this Plugin
+ """
+ plugin.Plugin.__init__(self, owner)
+
+ def _createInputEventHandlers(self):
+ """Defines InputEventHandler fields for this script that can be
+ called by the key and braille bindings.
+ """
+ handlers = plugin.Plugin._createInputEventHandlers(self)
+ handlers.update({
+ "bookmarkCurrentWhereAmI" : input_bindings.Handler(
+ Plugin._bookmarkCurrentWhereAmI,
+ # Translators: this command announces information regarding
+ # the relationship of the given bookmark to the current
+ # position
+ #
+ _("Bookmark where am I with respect to current position.")),
+
+ "goToBookmark" : input_bindings.Handler(
+ Plugin._goToBookmark,
+ # Translators: this command moves the current position to the
+ # location stored at the bookmark.
+ #
+ _("Go to bookmark.")),
+
+ "addBookmark" : input_bindings.Handler(
+ Plugin._addBookmark,
+ # Translators: this event handler binds an in-page accessible
+ # object location to the given input key command.
+ #
+ _("Add bookmark.")),
+
+ "saveBookmarks" : input_bindings.Handler(
+ Plugin._saveBookmarks,
+ # Translators: this event handler saves all bookmarks for the
+ # current application to disk.
+ #
+ _("Save bookmarks.")),
+
+ "goToNextBookmark" : input_bindings.Handler(
+ Plugin._goToNextBookmark,
+ # Translators: this event handler cycles through the registered
+ # bookmarks and takes the user to the next bookmark location.
+ #
+ _("Go to next bookmark location.")),
+
+ "goToPrevBookmark" : input_bindings.Handler(
+ Plugin._goToPrevBookmark,
+ # Translators: this event handler cycles through the
+ # registered bookmarks and takes the user to the previous
+ # bookmark location.
+ #
+ _("Go to previous bookmark location.")),
+ })
+ return handlers
+
+ def _createKeyBindings(self, handlers):
+ """Defines the key bindings for this script.
+
+ Returns an instance of input_bindings.KeyBindings.
+ """
+ bindings = plugin.Plugin._createKeyBindings(self, handlers)
+ bindings.extend(keyboardBindings)
+ return bindings
+
+ def _createBrailleBindings(self, handlers):
+ """Defines the braille bindings for this script.
+
+ Returns an instance of input_bindings.BrailleBindings.
+ """
+ bindings = plugin.Plugin._createBrailleBindings(self, handlers)
+ bindings.extend(brailleBindings)
+ return bindings
+
+ def _bookmarkCurrentWhereAmI(self, inputEvent=None, modifiers=None):
+ """The bookmarkCurrentWhereAmI handler.
+ """
+ log.debug("_bookmarkCurrentWhereAmI: %s" % inputEvent)
+
+ def _goToBookmark(self, inputEvent=None, modifiers=None):
+ """The goToBookmark handler.
+ """
+ log.debug("_goToBookmark: %s" % inputEvent)
+
+ def _addBookmark(self, inputEvent=None, modifiers=None):
+ """The addBookmark handler.
+ """
+ log.debug("_addBookmark: %s" % inputEvent)
+
+ def _saveBookmarks(self, inputEvent=None, modifiers=None):
+ """The saveBookmarks handler.
+ """
+ log.debug("_saveBookmarks: %s" % inputEvent)
+
+ def _goToNextBookmark(self, inputEvent=None, modifiers=None):
+ """The goToNextBookmark handler.
+ """
+ log.debug("_goToNextBookmark: %s" % inputEvent)
+
+ def _goToPrevBookmark(self, inputEvent=None, modifiers=None):
+ """The goToPrevBookmark handler.
+ """
+ log.debug("_goToPrevBookmark: %s" % inputEvent)
+
+if __name__ == "__main__":
+ logging.basicConfig(format="%(name)s %(message)s")
+ log.setLevel(logging.DEBUG)
+
+ import orca.script
+ scrypt = orca.script.Script(None)
+ plugin = Plugin(scrypt)
+ print scrypt
+ print plugin
+
+ plugin.processObjectEvent(None)
+
+ plugin.activate()
+ try:
+ plugin.processObjectEvent(None)
+ except:
+ # Expected since no event was passed in
+ #
+ pass
Added: branches/phase2/src/orca/plugins/debug_actions/Makefile.am
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/debug_actions/Makefile.am Mon Sep 15 16:37:16 2008
@@ -0,0 +1,9 @@
+orca_pathdir=$(pyexecdir)
+
+orca_python_PYTHON = \
+ __init__.py \
+ braille_bindings.py \
+ keyboard_bindings.py \
+ plugin.py
+
+orca_pythondir=$(pyexecdir)/orca/plugins/debug_actions
Added: branches/phase2/src/orca/plugins/debug_actions/__init__.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/debug_actions/__init__.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,25 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for providing debugging operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+from plugin import Plugin
Added: branches/phase2/src/orca/plugins/debug_actions/braille_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/debug_actions/braille_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,29 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Braille bindings for debug operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+bindings = []
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/debug_actions/keyboard_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/debug_actions/keyboard_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,57 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Keyboard bindings for debug operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+import orca.plugin as plugin
+
+bindings = [
+ input_bindings.KeyBinding(
+ "End",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_ALT_MODIFIER_MASK,
+ "printAppsHandler"),
+
+ input_bindings.KeyBinding(
+ "Page_Up",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_ALT_MODIFIER_MASK,
+ "printAncestryHandler"),
+
+ input_bindings.KeyBinding(
+ "Page_Down",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_ALT_MODIFIER_MASK,
+ "printHierarchyHandler"),
+
+ input_bindings.KeyBinding(
+ "Home",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_ALT_MODIFIER_MASK,
+ "reportScriptInfoHandler"),
+]
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/debug_actions/plugin.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/debug_actions/plugin.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,164 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for providing debug operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import logging
+log = logging.getLogger('orca.plugins.debug_actions.plugin')
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+import orca.plugin as plugin
+
+from orca.orca_i18n import _ # for gettext support
+
+from keyboard_bindings import bindings as keyboardBindings
+
+try:
+ from braille_bindings import bindings as brailleBindings
+except:
+ log.exception("Not using braille bindings because of this exception:")
+ brailleBindings = []
+
+class Plugin(plugin.Plugin):
+ """A plugin for getting debug information.
+ """
+ def __init__(self, owner):
+ """Creates a Plugin for the given script.
+ This method should not be called by anyone except the
+ owner.
+
+ Arguments:
+ - owner: the Script owning this Plugin
+ """
+ plugin.Plugin.__init__(self, owner)
+
+ def _createInputEventHandlers(self):
+ """Defines InputEventHandler fields for this script that can be
+ called by the key and braille bindings.
+ """
+ handlers = plugin.Plugin._createInputEventHandlers(self)
+ handlers.update({
+ "printAppsHandler" : input_bindings.Handler(
+ Plugin._printAppsHandler,
+ # Translators: this is a debug message that Orca users
+ # will not normally see. It describes a debug routine
+ # that prints a list of all known applications currently
+ # running on the desktop, to stdout.
+ #
+ _("Prints a debug listing of all known applications to the " \
+ "console where Orca is running.")),
+
+ "printAncestryHandler" : input_bindings.Handler(
+ Plugin._printAncestryHandler,
+ # Translators: this is a debug message that Orca users
+ # will not normally see. It describes a debug routine
+ # that will take the component in the currently running
+ # application that has focus, and print debug information
+ # to the console giving its component ancestry (i.e. all
+ # the components that are its descendants in the component
+ # tree).
+ #
+ _("Prints debug information about the ancestry of the " \
+ "object with focus.")),
+
+ "printHierarchyHandler" : input_bindings.Handler(
+ Plugin._printHierarchyHandler,
+ # Translators: this is a debug message that Orca users
+ # will not normally see. It describes a debug routine
+ # that will take the currently running application, and
+ # print debug information to the console giving its
+ # component hierarchy (i.e. all the components and all
+ # their descendants in the component tree).
+ #
+ _("Prints debug information about the application with " \
+ "focus.")),
+
+ "reportScriptInfoHandler" : input_bindings.Handler(
+ Plugin._reportScriptInfo,
+ # Translators: this is a debug message that Orca users
+ # will not normally see. It describes a debug routine
+ # that outputs useful information on the current script
+ # via speech and braille. This information will be
+ # helpful to script writers.
+ #
+ _("Reports information on current script.")),
+ })
+ return handlers
+
+ def _createKeyBindings(self, handlers):
+ """Defines the key bindings for this script.
+
+ Returns an instance of input_bindings.KeyBindings.
+ """
+ bindings = plugin.Plugin._createKeyBindings(self, handlers)
+ bindings.extend(keyboardBindings)
+ return bindings
+
+ def _createBrailleBindings(self, handlers):
+ """Defines the braille bindings for this script.
+
+ Returns an instance of input_bindings.BrailleBindings.
+ """
+ bindings = plugin.Plugin._createBrailleBindings(self, handlers)
+ bindings.extend(brailleBindings)
+ return bindings
+
+ def _printAppsHandler(self, inputEvent=None, modifiers=None):
+ """The printAppsHandler handler.
+ """
+ log.debug("_printAppsHandler: %s" % inputEvent)
+
+ def _printAncestryHandler(self, inputEvent=None, modifiers=None):
+ """The printAncestryHandler handler.
+ """
+ log.debug("_printAncestryHandler: %s" % inputEvent)
+
+ def _printHierarchyHandler(self, inputEvent=None, modifiers=None):
+ """The printHierarchyHandler handler.
+ """
+ log.debug("_printHierarchyHandler: %s" % inputEvent)
+
+ def _reportScriptInfo(self, inputEvent=None, modifiers=None):
+ """The reportScriptInfo handler.
+ """
+ log.debug("_reportScriptInfo: %s" % inputEvent)
+
+if __name__ == "__main__":
+ logging.basicConfig(format="%(name)s %(message)s")
+ log.setLevel(logging.DEBUG)
+
+ import orca.script
+ scrypt = orca.script.Script(None)
+ plugin = Plugin(scrypt)
+ print scrypt
+ print plugin
+
+ plugin.processObjectEvent(None)
+
+ plugin.activate()
+ try:
+ plugin.processObjectEvent(None)
+ except:
+ # Expected since no event was passed in
+ #
+ pass
Added: branches/phase2/src/orca/plugins/flat_review/Makefile.am
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/flat_review/Makefile.am Mon Sep 15 16:37:16 2008
@@ -0,0 +1,9 @@
+orca_pathdir=$(pyexecdir)
+
+orca_python_PYTHON = \
+ __init__.py \
+ braille_bindings.py \
+ keyboard_bindings.py \
+ plugin.py
+
+orca_pythondir=$(pyexecdir)/orca/plugins/flat_review
Added: branches/phase2/src/orca/plugins/flat_review/__init__.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/flat_review/__init__.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,25 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for providing flat review operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+from plugin import Plugin
Added: branches/phase2/src/orca/plugins/flat_review/braille_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/flat_review/braille_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,63 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Braille bindings for flat review operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+
+import brlapi
+bindings = [
+ input_bindings.BrailleBinding(
+ brlapi.KEY_CMD_LNUP,
+ input_event.NO_MODIFIER_MASK,
+ input_event.NO_MODIFIER_MASK,
+ "reviewAboveHandler"),
+
+ input_bindings.BrailleBinding(
+ brlapi.KEY_CMD_LNDN,
+ input_event.NO_MODIFIER_MASK,
+ input_event.NO_MODIFIER_MASK,
+ "reviewBelowHandler"),
+
+ input_bindings.BrailleBinding(
+ brlapi.KEY_CMD_TOP_LEFT,
+ input_event.NO_MODIFIER_MASK,
+ input_event.NO_MODIFIER_MASK,
+ "reviewHomeHandler"),
+
+ input_bindings.BrailleBinding(
+ brlapi.KEY_CMD_BOT_LEFT,
+ input_event.NO_MODIFIER_MASK,
+ input_event.NO_MODIFIER_MASK,
+ "reviewBottomLeftHandler"),
+
+ input_bindings.BrailleBinding(
+ brlapi.KEY_CMD_HOME,
+ input_event.NO_MODIFIER_MASK,
+ input_event.NO_MODIFIER_MASK,
+ "goBrailleHomeHandler"),
+]
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/flat_review/keyboard_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/flat_review/keyboard_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,472 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Keyboard bindings for flat review operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+
+# Desktop flat review keys
+#
+desktopBindings = [
+ input_bindings.KeyBinding(
+ "KP_Divide",
+ input_event.NO_MODIFIER_MASK,
+ input_event.NO_MODIFIER_MASK,
+ "leftClickReviewItemHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Multiply",
+ input_event.NO_MODIFIER_MASK,
+ input_event.NO_MODIFIER_MASK,
+ "rightClickReviewItemHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Subtract",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "toggleFlatReviewModeHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_7",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPreviousLineHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Home",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPreviousLineHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_7",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewHomeHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Home",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewHomeHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_8",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewCurrentLineHandler", 1),
+
+ input_bindings.KeyBinding(
+ "KP_8",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewSpellCurrentLineHandler", 2),
+
+ input_bindings.KeyBinding(
+ "KP_8",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPhoneticCurrentLineHandler", 3),
+
+ input_bindings.KeyBinding(
+ "KP_Up",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewCurrentLineHandler", 1),
+
+ input_bindings.KeyBinding(
+ "KP_Up",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewSpellCurrentLineHandler", 2),
+
+ input_bindings.KeyBinding(
+ "KP_Up",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPhoneticCurrentLineHandler", 3),
+
+ input_bindings.KeyBinding(
+ "KP_9",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewNextLineHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Page_Up",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewNextLineHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_9",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewEndHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Page_Up",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewEndHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_4",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPreviousItemHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Left",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPreviousItemHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_4",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewAboveHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Left",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewAboveHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_5",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewCurrentItemHandler", 1),
+
+ input_bindings.KeyBinding(
+ "KP_5",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewSpellCurrentItemHandler", 2),
+
+ input_bindings.KeyBinding(
+ "KP_5",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPhoneticCurrentItemHandler", 3),
+
+ input_bindings.KeyBinding(
+ "KP_Begin",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewCurrentItemHandler", 1),
+
+ input_bindings.KeyBinding(
+ "KP_Begin",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewSpellCurrentItemHandler", 2),
+
+ input_bindings.KeyBinding(
+ "KP_Begin",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPhoneticCurrentItemHandler", 3),
+
+ input_bindings.KeyBinding(
+ "KP_5",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewCurrentAccessibleHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Begin",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewCurrentAccessibleHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_6",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewNextItemHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Right",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewNextItemHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_6",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewBelowHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Right",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewBelowHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_1",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPreviousCharacterHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_End",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewPreviousCharacterHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_1",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewEndOfLineHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_End",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewEndOfLineHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_2",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewCurrentCharacterHandler", 1),
+
+ input_bindings.KeyBinding(
+ "KP_2",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewSpellCurrentCharacterHandler", 2),
+
+ input_bindings.KeyBinding(
+ "KP_Down",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewCurrentCharacterHandler", 1),
+
+ input_bindings.KeyBinding(
+ "KP_Down",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewSpellCurrentCharacterHandler", 2),
+
+ input_bindings.KeyBinding(
+ "KP_3",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewNextCharacterHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Page_Down",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "reviewNextCharacterHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Delete",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "findHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Delete",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "findNextHandler"),
+
+ input_bindings.KeyBinding(
+ "KP_Delete",
+ input_event.defaultModifierMask,
+ input_event.ORCA_SHIFT_MODIFIER_MASK,
+ "findPreviousHandler"),
+]
+
+# Laptop flat review keys
+#
+laptopBindings = [
+ input_bindings.KeyBinding(
+ "7",
+ input_event.ORCA_MODIFIER_MASK,
+ input_event.ORCA_MODIFIER_MASK,
+ "leftClickReviewItemHandler"),
+
+ input_bindings.KeyBinding(
+ "8",
+ input_event.ORCA_MODIFIER_MASK,
+ input_event.ORCA_MODIFIER_MASK,
+ "rightClickReviewItemHandler"),
+
+ input_bindings.KeyBinding(
+ "p",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "toggleFlatReviewModeHandler"),
+
+ input_bindings.KeyBinding(
+ "u",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewPreviousLineHandler"),
+
+ input_bindings.KeyBinding(
+ "u",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_MODIFIER_MASK,
+ "reviewHomeHandler"),
+
+ input_bindings.KeyBinding(
+ "i",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewCurrentLineHandler", 1),
+
+ input_bindings.KeyBinding(
+ "i",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewSpellCurrentLineHandler", 2),
+
+ input_bindings.KeyBinding(
+ "i",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewPhoneticCurrentLineHandler", 3),
+
+ input_bindings.KeyBinding(
+ "o",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewNextLineHandler"),
+
+ input_bindings.KeyBinding(
+ "o",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_MODIFIER_MASK,
+ "reviewEndHandler"),
+
+ input_bindings.KeyBinding(
+ "j",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewPreviousItemHandler"),
+
+ input_bindings.KeyBinding(
+ "j",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_MODIFIER_MASK,
+ "reviewAboveHandler"),
+
+ input_bindings.KeyBinding(
+ "k",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewCurrentItemHandler", 1),
+
+ input_bindings.KeyBinding(
+ "k",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewSpellCurrentItemHandler", 2),
+
+ input_bindings.KeyBinding(
+ "k",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewPhoneticCurrentItemHandler", 3),
+
+ input_bindings.KeyBinding(
+ "k",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_MODIFIER_MASK,
+ "reviewCurrentAccessibleHandler"),
+
+ input_bindings.KeyBinding(
+ "l",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewNextItemHandler"),
+
+ input_bindings.KeyBinding(
+ "l",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_MODIFIER_MASK,
+ "reviewBelowHandler"),
+
+ input_bindings.KeyBinding(
+ "m",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewPreviousCharacterHandler"),
+
+ input_bindings.KeyBinding(
+ "m",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_MODIFIER_MASK,
+ "reviewEndOfLineHandler"),
+
+ input_bindings.KeyBinding(
+ "comma",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewCurrentCharacterHandler", 1),
+
+ input_bindings.KeyBinding(
+ "comma",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewSpellCurrentCharacterHandler", 2),
+
+ input_bindings.KeyBinding(
+ "period",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "reviewNextCharacterHandler"),
+
+ input_bindings.KeyBinding(
+ "bracketleft",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "findHandler"),
+
+ input_bindings.KeyBinding(
+ "bracketright",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "findNextHandler"),
+
+ input_bindings.KeyBinding(
+ "bracketright",
+ input_event.defaultModifierMask,
+ input_event.ORCA_CTRL_MODIFIER_MASK,
+ "findPreviousHandler"),
+]
+
+bindings = desktopBindings
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/flat_review/plugin.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/flat_review/plugin.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,634 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for providing flat review operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import logging
+log = logging.getLogger('orca.plugins.flat_review.plugin')
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+import orca.plugin as plugin
+
+from orca.orca_i18n import _ # for gettext support
+
+from keyboard_bindings import bindings as keyboardBindings
+
+try:
+ from braille_bindings import bindings as brailleBindings
+except:
+ log.exception("Not using braille bindings because of this exception:")
+ brailleBindings = []
+
+class Plugin(plugin.Plugin):
+ """A plugin for handling flat review analysis of a window.
+ """
+ def __init__(self, owner):
+ """Creates a Plugin for the given script.
+ This method should not be called by anyone except the
+ owner.
+
+ Arguments:
+ - owner: the Script owning this Plugin
+ """
+ plugin.Plugin.__init__(self, owner)
+
+ def _createInputEventHandlers(self):
+ """Defines InputEventHandler fields for this script that can be
+ called by the key and braille bindings.
+ """
+ handlers = plugin.Plugin._createInputEventHandlers(self)
+ handlers.update({
+ "leftClickReviewItemHandler" : input_bindings.Handler(
+ Plugin._leftClickReviewItem,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. A left click means to generate
+ # a left mouse button click on the current item.
+ #
+ _("Performs left click on current flat review item.")),
+
+ "rightClickReviewItemHandler" : input_bindings.Handler(
+ Plugin._rightClickReviewItem,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. A right click means to generate
+ # a right mouse button click on the current item.
+ #
+ _("Performs right click on current flat review item.")),
+
+ "toggleFlatReviewModeHandler" : input_bindings.Handler(
+ Plugin._toggleFlatReviewMode,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}.
+ #
+ _("Enters and exits flat review mode.")),
+
+ "reviewPreviousLineHandler" : input_bindings.Handler(
+ Plugin._reviewPreviousLine,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}.
+ #
+ _("Moves flat review to the beginning of the previous line.")),
+
+ "reviewHomeHandler" : input_bindings.Handler(
+ Plugin._reviewHome,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. The home position is the
+ # beginning of the content in the window.
+ #
+ _("Moves flat review to the home position.")),
+
+ "reviewCurrentLineHandler" : input_bindings.Handler(
+ Plugin._reviewCurrentLine,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. This particular command will
+ # cause Orca to speak the current line.
+ #
+ _("Speaks the current flat review line.")),
+
+ "reviewSpellCurrentLineHandler" : input_bindings.Handler(
+ Plugin._reviewSpellCurrentLine,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. This particular command will
+ # cause Orca to spell the current line.
+ #
+ _("Spells the current flat review line.")),
+
+ "reviewPhoneticCurrentLineHandler" : input_bindings.Handler(
+ Plugin._reviewPhoneticCurrentLine,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. This particular command will
+ # cause Orca to "phonetically spell" the current line,
+ # saying "Alpha" for "a", "Bravo" for "b" and so on.
+ #
+ _("Phonetically spells the current flat review line.")),
+
+ "reviewNextLineHandler" : input_bindings.Handler(
+ Plugin._reviewNextLine,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}.
+ #
+ _("Moves flat review to the beginning of the next line.")),
+
+ "reviewEndHandler" : input_bindings.Handler(
+ Plugin._reviewEnd,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. The end position is the last
+ # bit of information in the window.
+ #
+ _("Moves flat review to the end position.")),
+
+ "reviewPreviousItemHandler" : input_bindings.Handler(
+ Plugin._reviewPreviousItem,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. Previous will go backwards
+ # in the window until you reach the top (i.e., it will
+ # wrap across lines if necessary).
+ #
+ _("Moves flat review to the previous item or word.")),
+
+ "reviewAboveHandler" : input_bindings.Handler(
+ Plugin._reviewAbove,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. Above in this case means
+ # geographically above, as if you drew a vertical line
+ # in the window.
+ #
+ _("Moves flat review to the word above the current word.")),
+
+ "reviewCurrentItemHandler" : input_bindings.Handler(
+ Plugin._reviewCurrentItem,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. This command will speak the
+ # current word or item.
+ #
+ _("Speaks the current flat review item or word.")),
+
+ "reviewSpellCurrentItemHandler" : input_bindings.Handler(
+ Plugin._reviewSpellCurrentItem,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. This command will spell out
+ # the current word or item letter by letter.
+ #
+ _("Spells the current flat review item or word.")),
+
+ "reviewPhoneticCurrentItemHandler" : input_bindings.Handler(
+ Plugin._reviewPhoneticCurrentItem,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. This command will spell out
+ # the current word or item phonetically, saying "Alpha"
+ # for "a", "Bravo" for "b" and so on.
+ #
+ _("Phonetically spells the current flat review item or " \
+ "word.")),
+
+ "reviewCurrentAccessibleHandler" : input_bindings.Handler(
+ Plugin._reviewCurrentAccessible,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. The flat review object is
+ # typically something like a pushbutton, a label, or
+ # some other GUI widget. The 'speaks' means it will
+ # speak the text associated with the object.
+ #
+ _("Speaks the current flat review object.")),
+
+ "reviewNextItemHandler" : input_bindings.Handler(
+ Plugin._reviewNextItem,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. Next will go forwards
+ # in the window until you reach the end (i.e., it will
+ # wrap across lines if necessary).
+ #
+ _("Moves flat review to the next item or word.")),
+
+ "reviewBelowHandler" : input_bindings.Handler(
+ Plugin._reviewBelow,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. Below in this case means
+ # geographically below, as if you drew a vertical line
+ # downward on the screen.
+ #
+ _("Moves flat review to the word below the current word.")),
+
+ "reviewPreviousCharacterHandler" : input_bindings.Handler(
+ Plugin._reviewPreviousCharacter,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. Previous will go backwards
+ # in the window until you reach the top (i.e., it will
+ # wrap across lines if necessary).
+ #
+ _("Moves flat review to the previous character.")),
+
+ "reviewEndOfLineHandler" : input_bindings.Handler(
+ Plugin._reviewEndOfLine,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}.
+ #
+ _("Moves flat review to the end of the line.")),
+
+ "reviewCurrentCharacterHandler" : input_bindings.Handler(
+ Plugin._reviewCurrentCharacter,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. Previous will go backwards
+ # in the window until you reach the top (i.e., it will
+ # wrap across lines if necessary). The 'speaks' in
+ # this case will be the spoken language form of the
+ # character currently being reviewed.
+ #
+ _("Speaks the current flat review character.")),
+
+ "reviewSpellCurrentCharacterHandler" : input_bindings.Handler(
+ Plugin._reviewSpellCurrentCharacter,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. Previous will go backwards
+ # in the window until you reach the top (i.e., it will
+ # wrap across lines if necessary). This command will
+ # cause Orca to speak a phonetic representation of the
+ # character currently being reviewed, saying "Alpha"
+ # for "a", "Bravo" for "b" and so on.
+ #
+ _("Phonetically speaks the current flat review character.")),
+
+ "reviewNextCharacterHandler" : input_bindings.Handler(
+ Plugin._reviewNextCharacter,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. Next will go forwards
+ # in the window until you reach the end (i.e., it will
+ # wrap across lines if necessary).
+ #
+ _("Moves flat review to the next character.")),
+ "reviewBottomLeftHandler" : input_bindings.Handler(
+ Plugin._reviewBottomLeft,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. The bottom left is the bottom
+ # left of the window currently being reviewed.
+ #
+ _("Moves flat review to the bottom left.")),
+
+ "findHandler" : input_bindings.Handler(
+ Plugin._showFindGUI,
+ # Translators: the Orca "Find" dialog allows a user to
+ # search for text in a window and then move focus to
+ # that text. For example, they may want to find the
+ # "OK" button.
+ #
+ _("Opens the Orca Find dialog.")),
+
+ "findNextHandler" : input_bindings.Handler(
+ Plugin._findNext,
+ # Translators: the Orca "Find" dialog allows a user to
+ # search for text in a window and then move focus to
+ # that text. For example, they may want to find the
+ # "OK" button. This string is used for finding the
+ # next occurence of a string.
+ #
+ _("Searches for the next instance of a string.")),
+
+ "findPreviousHandler" : input_bindings.Handler(
+ Plugin._findPrevious,
+ # Translators: the Orca "Find" dialog allows a user to
+ # search for text in a window and then move focus to
+ # that text. For example, they may want to find the
+ # "OK" button. This string is used for finding the
+ # previous occurence of a string.
+ #
+ _("Searches for the previous instance of a string.")),
+
+ "goBrailleHomeHandler" : input_bindings.Handler(
+ Plugin._goBrailleHome,
+ # Translators: the 'flat review' feature of Orca
+ # allows the blind user to explore the text in a
+ # window in a 2D fashion. That is, Orca treats all
+ # the text from all objects in a window (e.g.,
+ # buttons, labels, etc.) as a sequence of words in a
+ # sequence of lines. The flat review feature allows
+ # the user to explore this text by the {previous,next}
+ # {line,word,character}. Flat review is modal, and
+ # the user can be exploring the window without changing
+ # which object in the window which has focus. The
+ # feature used here will return the flat review to the
+ # object with focus.
+ #
+ _("Returns to object with keyboard focus.")),
+ })
+ return handlers
+
+ def _createKeyBindings(self, handlers):
+ """Defines the key bindings for this script.
+
+ Returns an instance of input_bindings.KeyBindings.
+ """
+ bindings = plugin.Plugin._createKeyBindings(self, handlers)
+ bindings.extend(keyboardBindings)
+ return bindings
+
+ def _createBrailleBindings(self, handlers):
+ """Defines the braille bindings for this script.
+
+ Returns an instance of input_bindings.BrailleBindings.
+ """
+ bindings = plugin.Plugin._createBrailleBindings(self, handlers)
+ bindings.extend(brailleBindings)
+ return bindings
+
+ def _leftClickReviewItem(self, inputEvent=None, modifiers=None):
+ """The leftClickReviewItem handler.
+ """
+ log.debug("_leftClickReviewItem: %s" % inputEvent)
+
+ def _rightClickReviewItem(self, inputEvent=None, modifiers=None):
+ """The rightClickReviewItem handler.
+ """
+ log.debug("_rightClickReviewItem: %s" % inputEvent)
+
+ def _toggleFlatReviewMode(self, inputEvent=None, modifiers=None):
+ """The toggleFlatReviewMode handler.
+ """
+ log.debug("_toggleFlatReviewMode: %s" % inputEvent)
+
+ def _reviewPreviousLine(self, inputEvent=None, modifiers=None):
+ """The reviewPreviousLine handler.
+ """
+ log.debug("_reviewPreviousLine: %s" % inputEvent)
+
+ def _reviewHome(self, inputEvent=None, modifiers=None):
+ """The reviewHome handler.
+ """
+ log.debug("_reviewHome: %s" % inputEvent)
+
+ def _reviewCurrentLine(self, inputEvent=None, modifiers=None):
+ """The reviewCurrentLine handler.
+ """
+ log.debug("_reviewCurrentLine: %s" % inputEvent)
+
+ def _reviewSpellCurrentLine(self, inputEvent=None, modifiers=None):
+ """The reviewSpellCurrentLine handler.
+ """
+ log.debug("_reviewSpellCurrentLine: %s" % inputEvent)
+
+ def _reviewPhoneticCurrentLine(self, inputEvent=None, modifiers=None):
+ """The reviewPhoneticCurrentLine handler.
+ """
+ log.debug("_reviewPhoneticCurrentLine: %s" % inputEvent)
+
+ def _reviewNextLine(self, inputEvent=None, modifiers=None):
+ """The reviewNextLine handler.
+ """
+ log.debug("_reviewNextLine: %s" % inputEvent)
+
+ def _reviewEnd(self, inputEvent=None, modifiers=None):
+ """The reviewEnd handler.
+ """
+ log.debug("_reviewEnd: %s" % inputEvent)
+
+ def _reviewPreviousItem(self, inputEvent=None, modifiers=None):
+ """The reviewPreviousItem handler.
+ """
+ log.debug("_reviewPreviousItem: %s" % inputEvent)
+
+ def _reviewAbove(self, inputEvent=None, modifiers=None):
+ """The reviewAbove handler.
+ """
+ log.debug("_reviewAbove: %s" % inputEvent)
+
+ def _reviewCurrentItem(self, inputEvent=None, modifiers=None):
+ """The reviewCurrentItem handler.
+ """
+ log.debug("_reviewCurrentItem: %s" % inputEvent)
+
+ def _reviewSpellCurrentItem(self, inputEvent=None, modifiers=None):
+ """The reviewSpellCurrentItem handler.
+ """
+ log.debug("_reviewSpellCurrentItem: %s" % inputEvent)
+
+ def _reviewPhoneticCurrentItem(self, inputEvent=None, modifiers=None):
+ """The reviewPhoneticCurrentItem handler.
+ """
+ log.debug("_reviewPhoneticCurrentItem: %s" % inputEvent)
+
+ def _reviewCurrentAccessible(self, inputEvent=None, modifiers=None):
+ """The reviewCurrentAccessible handler.
+ """
+ log.debug("_reviewCurrentAccessible: %s" % inputEvent)
+
+ def _reviewNextItem(self, inputEvent=None, modifiers=None):
+ """The reviewNextItem handler.
+ """
+ log.debug("_reviewNextItem: %s" % inputEvent)
+
+ def _reviewBelow(self, inputEvent=None, modifiers=None):
+ """The reviewBelow handler.
+ """
+ log.debug("_reviewBelow: %s" % inputEvent)
+
+ def _reviewPreviousCharacter(self, inputEvent=None, modifiers=None):
+ """The reviewPreviousCharacter handler.
+ """
+ log.debug("_reviewPreviousCharacter: %s" % inputEvent)
+
+ def _reviewEndOfLine(self, inputEvent=None, modifiers=None):
+ """The reviewEndOfLine handler.
+ """
+ log.debug("_reviewEndOfLine: %s" % inputEvent)
+
+ def _reviewCurrentCharacter(self, inputEvent=None, modifiers=None):
+ """The reviewCurrentCharacter handler.
+ """
+ log.debug("_reviewCurrentCharacter: %s" % inputEvent)
+
+ def _reviewSpellCurrentCharacter(self, inputEvent=None, modifiers=None):
+ """The reviewSpellCurrentCharacter handler.
+ """
+ log.debug("_reviewSpellCurrentCharacter: %s" % inputEvent)
+
+ def _reviewNextCharacter(self, inputEvent=None, modifiers=None):
+ """The reviewNextCharacter handler.
+ """
+ log.debug("_reviewNextCharacter: %s" % inputEvent)
+
+ def _reviewBottomLeft(self, inputEvent=None, modifiers=None):
+ """The reviewBottomLeft handler.
+ """
+ log.debug("_reviewBottomLeft: %s" % inputEvent)
+
+ def _showFindGUI(self, inputEvent=None, modifiers=None):
+ """The showFindGUI handler.
+ """
+ log.debug("_showFindGUI: %s" % inputEvent)
+
+ def _findNext(self, inputEvent=None, modifiers=None):
+ """The findNext handler.
+ """
+ log.debug("_findNext: %s" % inputEvent)
+
+ def _findPrevious(self, inputEvent=None, modifiers=None):
+ """The findPrevious handler.
+ """
+ log.debug("_findPrevious: %s" % inputEvent)
+
+ def _goBrailleHome(self, inputEvent=None, modifiers=None):
+ """The goBrailleHome handler.
+ """
+ log.debug("_goBrailleHome: %s" % inputEvent)
+
+if __name__ == "__main__":
+ logging.basicConfig(format="%(name)s %(message)s")
+ log.setLevel(logging.DEBUG)
+
+ import orca.script
+ scrypt = orca.script.Script(None)
+ plugin = Plugin(scrypt)
+ print scrypt
+ print plugin
+
+ plugin.processObjectEvent(None)
+
+ plugin.activate()
+ try:
+ plugin.processObjectEvent(None)
+ except:
+ # Expected since no event was passed in
+ #
+ pass
Added: branches/phase2/src/orca/plugins/speech_parameters/Makefile.am
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/speech_parameters/Makefile.am Mon Sep 15 16:37:16 2008
@@ -0,0 +1,9 @@
+orca_pathdir=$(pyexecdir)
+
+orca_python_PYTHON = \
+ __init__.py \
+ braille_bindings.py \
+ keyboard_bindings.py \
+ plugin.py
+
+orca_pythondir=$(pyexecdir)/orca/plugins/speech_parameters
Added: branches/phase2/src/orca/plugins/speech_parameters/__init__.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/speech_parameters/__init__.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,25 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for adjusting speech parameters.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+from plugin import Plugin
Added: branches/phase2/src/orca/plugins/speech_parameters/braille_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/speech_parameters/braille_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,45 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Braille bindings for adjusting speech parameters.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+
+import brlapi
+bindings = [
+ input_bindings.BrailleBinding(
+ brlapi.KEY_CMD_SAY_FASTER,
+ input_event.NO_MODIFIER_MASK,
+ input_event.NO_MODIFIER_MASK,
+ "increaseSpeechRaterHandler"),
+
+ input_bindings.BrailleBinding(
+ brlapi.KEY_CMD_SAY_SLOWER,
+ input_event.NO_MODIFIER_MASK,
+ input_event.NO_MODIFIER_MASK,
+ "decreaseSpeechRaterHandler"),
+]
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/speech_parameters/keyboard_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/speech_parameters/keyboard_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,56 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Keyboard bindings for adjusting speech parameters.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+
+bindings = [
+ input_bindings.KeyBinding(
+ "",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "decreaseSpeechRateHandler"),
+
+ input_bindings.KeyBinding(
+ "",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "increaseSpeechRateHandler"),
+
+ input_bindings.KeyBinding(
+ "",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "decreaseSpeechPitchHandler"),
+
+ input_bindings.KeyBinding(
+ "",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "increaseSpeechPitchHandler"),
+]
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/speech_parameters/plugin.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/speech_parameters/plugin.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,149 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for adjusting speech parameters.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import logging
+log = logging.getLogger('orca.plugins.speech_parameters.plugin')
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+import orca.plugin as plugin
+
+from orca.orca_i18n import _ # for gettext support
+
+from keyboard_bindings import bindings as keyboardBindings
+
+try:
+ from braille_bindings import bindings as brailleBindings
+except:
+ log.exception("Not using braille bindings because of this exception:")
+ brailleBindings = []
+
+class Plugin(plugin.Plugin):
+ """A plugin for adjusting speech parameters.
+ """
+ def __init__(self, owner):
+ """Creates a Plugin for the given script.
+ This method should not be called by anyone except the
+ owner.
+
+ Arguments:
+ - owner: the Script owning this Plugin
+ """
+ plugin.Plugin.__init__(self, owner)
+
+ def _createInputEventHandlers(self):
+ """Defines InputEventHandler fields for this script that can be
+ called by the key and braille bindings.
+ """
+ handlers = plugin.Plugin._createInputEventHandlers(self)
+ handlers.update({
+ "decreaseSpeechRateHandler" : input_bindings.Handler(
+ Plugin._decreaseSpeechRate,
+ # Translators: the speech rate is how fast the speech
+ # synthesis engine will generate speech.
+ #
+ _("Decreases the speech rate.")),
+
+ "increaseSpeechRateHandler" : input_bindings.Handler(
+ Plugin._increaseSpeechRate,
+ # Translators: the speech rate is how fast the speech
+ # synthesis engine will generate speech.
+ #
+ _("Increases the speech rate.")),
+
+ "decreaseSpeechPitchHandler" : input_bindings.Handler(
+ Plugin._decreaseSpeechPitch,
+ # Translators: the speech pitch is how high or low in
+ # pitch/frequency the speech synthesis engine will
+ # generate speech.
+ #
+ _("Decreases the speech pitch.")),
+
+ "increaseSpeechPitchHandler" : input_bindings.Handler(
+ Plugin._increaseSpeechPitch,
+ # Translators: the speech pitch is how high or low in
+ # pitch/frequency the speech synthesis engine will
+ # generate speech.
+ #
+ _("Increases the speech pitch.")),
+ })
+ return handlers
+
+ def _createKeyBindings(self, handlers):
+ """Defines the key bindings for this script.
+
+ Returns an instance of input_bindings.KeyBindings.
+ """
+ bindings = plugin.Plugin._createKeyBindings(self, handlers)
+ bindings.extend(keyboardBindings)
+ return bindings
+
+ def _createBrailleBindings(self, handlers):
+ """Defines the braille bindings for this script.
+
+ Returns an instance of input_bindings.BrailleBindings.
+ """
+ bindings = plugin.Plugin._createBrailleBindings(self, handlers)
+ bindings.extend(brailleBindings)
+ return bindings
+
+ def _decreaseSpeechRate(self, inputEvent=None, modifiers=None):
+ """The decreaseSpeechRate handler.
+ """
+ log.debug("_decreaseSpeechRate: %s" % inputEvent)
+
+ def _increaseSpeechRate(self, inputEvent=None, modifiers=None):
+ """The increaseSpeechRate handler.
+ """
+ log.debug("_increaseSpeechRate: %s" % inputEvent)
+
+ def _decreaseSpeechPitch(self, inputEvent=None, modifiers=None):
+ """The decreaseSpeechPitch handler.
+ """
+ log.debug("_decreaseSpeechPitch: %s" % inputEvent)
+
+ def _increaseSpeechPitch(self, inputEvent=None, modifiers=None):
+ """The increaseSpeechPitch handler.
+ """
+ log.debug("_increaseSpeechPitch: %s" % inputEvent)
+
+if __name__ == "__main__":
+ logging.basicConfig(format="%(name)s %(message)s")
+ log.setLevel(logging.DEBUG)
+
+ import orca.script
+ scrypt = orca.script.Script(None)
+ plugin = Plugin(scrypt)
+ print scrypt
+ print plugin
+
+ plugin.processObjectEvent(None)
+
+ plugin.activate()
+ try:
+ plugin.processObjectEvent(None)
+ except:
+ # Expected since no event was passed in
+ #
+ pass
Added: branches/phase2/src/orca/plugins/where_am_i/Makefile.am
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/where_am_i/Makefile.am Mon Sep 15 16:37:16 2008
@@ -0,0 +1,9 @@
+orca_pathdir=$(pyexecdir)
+
+orca_python_PYTHON = \
+ __init__.py \
+ braille_bindings.py \
+ keyboard_bindings.py \
+ plugin.py
+
+orca_pythondir=$(pyexecdir)/orca/plugins/where_am_i
Added: branches/phase2/src/orca/plugins/where_am_i/__init__.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/where_am_i/__init__.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,25 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for providing Where Am I operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+from plugin import Plugin
Added: branches/phase2/src/orca/plugins/where_am_i/braille_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/where_am_i/braille_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,29 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Braille bindings for Where Am I operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+bindings = []
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/where_am_i/keyboard_bindings.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/where_am_i/keyboard_bindings.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,88 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Keyboard bindings for Where Am I operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+
+# Desktop where am I keys
+#
+desktopBindings = [
+ input_bindings.KeyBinding(
+ "KP_Enter",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "whereAmIBasicHandler", 1),
+
+ input_bindings.KeyBinding(
+ "KP_Enter",
+ input_event.defaultModifierMask,
+ input_event.NO_MODIFIER_MASK,
+ "whereAmIDetailedHandler", 2),
+
+ input_bindings.KeyBinding(
+ "KP_Enter",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "getTitleHandler", 1),
+
+ input_bindings.KeyBinding(
+ "KP_Enter",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "getStatusBarHandler", 2),
+]
+
+# Laptop bindings
+#
+laptopKeys = [
+ input_bindings.KeyBinding(
+ "Return",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "whereAmIBasicHandler", 1),
+
+ input_bindings.KeyBinding(
+ "Return",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "whereAmIDetailedHandler", 2),
+
+ input_bindings.KeyBinding(
+ "slash",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "getTitleHandler", 1),
+
+ input_bindings.KeyBinding(
+ "slash",
+ input_event.defaultModifierMask,
+ input_event.ORCA_MODIFIER_MASK,
+ "getStatusBarHandler", 2),
+]
+
+bindings = desktopBindings
+
+if __name__ == "__main__":
+ for binding in bindings:
+ print binding
Added: branches/phase2/src/orca/plugins/where_am_i/plugin.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/plugins/where_am_i/plugin.py Mon Sep 15 16:37:16 2008
@@ -0,0 +1,155 @@
+# Copyright 2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""A Plugin for providing Where Am I operations.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import logging
+log = logging.getLogger('orca.plugins.where_am_i.plugin')
+
+import orca.input_bindings as input_bindings
+import orca.input_event as input_event
+import orca.plugin as plugin
+
+from orca.orca_i18n import _ # for gettext support
+
+from keyboard_bindings import bindings as keyboardBindings
+
+try:
+ from braille_bindings import bindings as brailleBindings
+except:
+ log.exception("Not using braille bindings because of this exception:")
+ brailleBindings = []
+
+class Plugin(plugin.Plugin):
+ """A plugin for getting Where Am I information.
+ """
+ def __init__(self, owner):
+ """Creates a Plugin for the given script.
+ This method should not be called by anyone except the
+ owner.
+
+ Arguments:
+ - owner: the Script owning this Plugin
+ """
+ plugin.Plugin.__init__(self, owner)
+
+ def _createInputEventHandlers(self):
+ """Defines InputEventHandler fields for this script that can be
+ called by the key and braille bindings.
+ """
+ handlers = plugin.Plugin._createInputEventHandlers(self)
+ handlers.update({
+ "whereAmIBasicHandler" : input_bindings.Handler(
+ Plugin._whereAmIBasic,
+ # Translators: the "Where am I" feature of Orca allows
+ # a user to press a key and then have information
+ # about their current context spoken and brailled to
+ # them. For example, the information may include the
+ # name of the current pushbutton with focus as well as
+ # its mnemonic.
+ #
+ _("Performs the basic where am I operation.")),
+
+ "whereAmIDetailedHandler" : input_bindings.Handler(
+ Plugin._whereAmIDetailed,
+ # Translators: the "Where am I" feature of Orca allows
+ # a user to press a key and then have information
+ # about their current context spoken and brailled to
+ # them. For example, the information may include the
+ # name of the current pushbutton with focus as well as
+ # its mnemonic.
+ #
+ _("Performs the detailed where am I operation.")),
+
+ "getTitleHandler" : input_bindings.Handler(
+ Plugin._getTitle,
+ # Translators: This command will cause the window's
+ # title to be spoken.
+ #
+ _("Speaks the title bar.")),
+
+ "getStatusBarHandler" : input_bindings.Handler(
+ Plugin._getStatusBar,
+ # Translators: This command will cause the window's
+ # status bar contents to be spoken.
+ #
+ _("Speaks the status bar.")),
+ })
+ return handlers
+
+ def _createKeyBindings(self, handlers):
+ """Defines the key bindings for this script.
+
+ Returns an instance of input_bindings.KeyBindings.
+ """
+ bindings = plugin.Plugin._createKeyBindings(self, handlers)
+ bindings.extend(keyboardBindings)
+ return bindings
+
+ def _createBrailleBindings(self, handlers):
+ """Defines the braille bindings for this script.
+
+ Returns an instance of input_bindings.BrailleBindings.
+ """
+ bindings = plugin.Plugin._createBrailleBindings(self, handlers)
+ bindings.extend(brailleBindings)
+ return bindings
+
+ def _whereAmIBasic(self, inputEvent=None, modifiers=None):
+ """The whereAmIBasic handler.
+ """
+ log.debug("_whereAmIBasic: %s" % inputEvent)
+
+ def _whereAmIDetailed(self, inputEvent=None, modifiers=None):
+ """The whereAmIDetailed handler.
+ """
+ log.debug("_whereAmIDetailed: %s" % inputEvent)
+
+ def _getTitle(self, inputEvent=None, modifiers=None):
+ """The getTitle handler.
+ """
+ log.debug("_getTitle: %s" % inputEvent)
+
+ def _getStatusBar(self, inputEvent=None, modifiers=None):
+ """The getStatusBar handler.
+ """
+ log.debug("_getStatusBar: %s" % inputEvent)
+
+if __name__ == "__main__":
+ logging.basicConfig(format="%(name)s %(message)s")
+ log.setLevel(logging.DEBUG)
+
+ import orca.script
+ scrypt = orca.script.Script(None)
+ plugin = Plugin(scrypt)
+ print scrypt
+ print plugin
+
+ plugin.processObjectEvent(None)
+
+ plugin.activate()
+ try:
+ plugin.processObjectEvent(None)
+ except:
+ # Expected since no event was passed in
+ #
+ pass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]