[orca] Implement initial support for "layout" mode and "object" mode for Gecko content
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Implement initial support for "layout" mode and "object" mode for Gecko content
- Date: Fri, 12 Sep 2014 01:03:33 +0000 (UTC)
commit 05c2968db3acc19ade4657ef8ef2903e59a96faf
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Sep 11 20:45:31 2014 -0400
Implement initial support for "layout" mode and "object" mode for Gecko content
Note that this commit merely gets it working. Configuration and toggling of
this feature will be done in subsequent commits. In the meantime, to enable
the Windows-screen-reader-style object navigation you can put the following
lines into your orca-customizations.py:
import orca.settings
orca.settings.layoutMode = False
src/orca/scripts/toolkits/Gecko/script.py | 3 ++-
.../scripts/toolkits/Gecko/script_utilities.py | 4 +++-
src/orca/settings.py | 3 +++
3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 204576f..cd9ff6b 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -2463,7 +2463,8 @@ class Script(default.Script):
return []
if self.utilities.findObjectInContents(obj, offset, self.currentLineContents) == -1:
- self.currentLineContents = self.utilities.getLineContentsAtOffset(obj, offset)
+ self.currentLineContents = self.utilities.getLineContentsAtOffset(
+ obj, offset, _settingsManager.getSetting('layoutMode'))
return self.currentLineContents
diff --git a/src/orca/scripts/toolkits/Gecko/script_utilities.py
b/src/orca/scripts/toolkits/Gecko/script_utilities.py
index f2a3ac9..2ef1f20 100644
--- a/src/orca/scripts/toolkits/Gecko/script_utilities.py
+++ b/src/orca/scripts/toolkits/Gecko/script_utilities.py
@@ -712,7 +712,7 @@ class Utilities(script_utilities.Utilities):
return False
- def getLineContentsAtOffset(self, obj, offset):
+ def getLineContentsAtOffset(self, obj, offset, layoutMode=True):
if not obj:
return []
@@ -732,6 +732,8 @@ class Utilities(script_utilities.Utilities):
boundary = pyatspi.TEXT_BOUNDARY_LINE_START
objects = self._getContentsForObj(obj, offset, boundary)
+ if not layoutMode:
+ return objects
# Check for things on the same line to the left of this object.
firstObj, firstStart = objects[0][0], objects[0][1]
diff --git a/src/orca/settings.py b/src/orca/settings.py
index d07e422..ddee58b 100644
--- a/src/orca/settings.py
+++ b/src/orca/settings.py
@@ -113,6 +113,7 @@ userCustomizableSettings = [
"findResultsMinimumLength",
"structNavTriggersFocusMode",
"caretNavTriggersFocusMode",
+ "layoutMode",
]
GENERAL_KEYBOARD_LAYOUT_DESKTOP = 1
@@ -361,3 +362,5 @@ timeoutCallback = None # Set by orca.py:init to orca.timeout
structNavTriggersFocusMode = False
caretNavTriggersFocusMode = False
+
+layoutMode = True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]