A lot of changes to switch to the new name, might be horribly broken.
This commit is contained in:
+24
-24
@@ -71,10 +71,10 @@ am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
am__rm_f = rm -f $(am__rm_f_notfound)
|
||||
am__rm_rf = rm -rf $(am__rm_f_notfound)
|
||||
pkgdatadir = $(datadir)/orca
|
||||
pkgincludedir = $(includedir)/orca
|
||||
pkglibdir = $(libdir)/orca
|
||||
pkglibexecdir = $(libexecdir)/orca
|
||||
pkgdatadir = $(datadir)/cthulhu
|
||||
pkgincludedir = $(includedir)/cthulhu
|
||||
pkglibdir = $(libdir)/cthulhu
|
||||
pkglibexecdir = $(libexecdir)/cthulhu
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
@@ -185,16 +185,16 @@ am__relativize = \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
ACLOCAL = ${SHELL} '/home/storm/orcatmp/orca/missing' aclocal-1.17
|
||||
ACLOCAL = ${SHELL} '/home/storm/cthulhutmp/cthulhu/missing' aclocal-1.17
|
||||
AMTAR = $${TAR-tar}
|
||||
AM_DEFAULT_VERBOSITY = 1
|
||||
ATKBRIDGE_CFLAGS = -I/usr/include/at-spi2-atk/2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/at-spi-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -pthread -I/usr/include/atk-1.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
|
||||
ATKBRIDGE_LIBS = -latk-bridge-2.0
|
||||
ATSPI2_CFLAGS = -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -pthread
|
||||
ATSPI2_LIBS = -latspi -ldbus-1 -lglib-2.0
|
||||
AUTOCONF = ${SHELL} '/home/storm/orcatmp/orca/missing' autoconf
|
||||
AUTOHEADER = ${SHELL} '/home/storm/orcatmp/orca/missing' autoheader
|
||||
AUTOMAKE = ${SHELL} '/home/storm/orcatmp/orca/missing' automake-1.17
|
||||
AUTOCONF = ${SHELL} '/home/storm/cthulhutmp/cthulhu/missing' autoconf
|
||||
AUTOHEADER = ${SHELL} '/home/storm/cthulhutmp/cthulhu/missing' autoheader
|
||||
AUTOMAKE = ${SHELL} '/home/storm/cthulhutmp/cthulhu/missing' automake-1.17
|
||||
AWK = gawk
|
||||
CC = gcc
|
||||
CCDEPMODE = depmode=none
|
||||
@@ -204,7 +204,7 @@ CPPFLAGS =
|
||||
CSCOPE = cscope
|
||||
CTAGS = ctags
|
||||
CYGPATH_W = echo
|
||||
DEFS = -DPACKAGE_NAME=\"orca\" -DPACKAGE_TARNAME=\"orca\" -DPACKAGE_VERSION=\"45.3\" -DPACKAGE_STRING=\"orca\ 45.3\" -DPACKAGE_BUGREPORT=\"https://gitlab.gnome.org/GNOME/orca/-/issues/\" -DPACKAGE_URL=\"\" -DPACKAGE=\"orca\" -DVERSION=\"45.3\" -DENABLE_NLS=1 -DHAVE_GETTEXT=1 -DHAVE_DCGETTEXT=1 -DGETTEXT_PACKAGE=\"orca\"
|
||||
DEFS = -DPACKAGE_NAME=\"cthulhu\" -DPACKAGE_TARNAME=\"cthulhu\" -DPACKAGE_VERSION=\"45.3\" -DPACKAGE_STRING=\"cthulhu\ 45.3\" -DPACKAGE_BUGREPORT=\"https://gitlab.gnome.org/GNOME/cthulhu/-/issues/\" -DPACKAGE_URL=\"\" -DPACKAGE=\"cthulhu\" -DVERSION=\"45.3\" -DENABLE_NLS=1 -DHAVE_GETTEXT=1 -DHAVE_DCGETTEXT=1 -DGETTEXT_PACKAGE=\"cthulhu\"
|
||||
DEPDIR = .deps
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
@@ -212,7 +212,7 @@ ECHO_T =
|
||||
ETAGS = etags
|
||||
EXEEXT =
|
||||
GETTEXT_MACRO_VERSION = 0.20
|
||||
GETTEXT_PACKAGE = orca
|
||||
GETTEXT_PACKAGE = cthulhu
|
||||
GMSGFMT = /usr/bin/msgfmt
|
||||
GMSGFMT_015 = /usr/bin/msgfmt
|
||||
GSTREAMER_CFLAGS = -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread
|
||||
@@ -237,17 +237,17 @@ LTLIBICONV = -liconv
|
||||
LTLIBINTL =
|
||||
LTLIBOBJS =
|
||||
MAINT =
|
||||
MAKEINFO = ${SHELL} '/home/storm/orcatmp/orca/missing' makeinfo
|
||||
MAKEINFO = ${SHELL} '/home/storm/cthulhutmp/cthulhu/missing' makeinfo
|
||||
MKDIR_P = /usr/bin/mkdir -p
|
||||
MSGFMT = /usr/bin/msgfmt
|
||||
MSGMERGE = /usr/bin/msgmerge
|
||||
MSGMERGE_FOR_MSGFMT_OPTION = --for-msgfmt
|
||||
OBJEXT = o
|
||||
PACKAGE = orca
|
||||
PACKAGE_BUGREPORT = https://gitlab.gnome.org/GNOME/orca/-/issues/
|
||||
PACKAGE_NAME = orca
|
||||
PACKAGE_STRING = orca 45.3
|
||||
PACKAGE_TARNAME = orca
|
||||
PACKAGE = cthulhu
|
||||
PACKAGE_BUGREPORT = https://gitlab.gnome.org/GNOME/cthulhu/-/issues/
|
||||
PACKAGE_NAME = cthulhu
|
||||
PACKAGE_STRING = cthulhu 45.3
|
||||
PACKAGE_TARNAME = cthulhu
|
||||
PACKAGE_URL =
|
||||
PACKAGE_VERSION = 45.3
|
||||
PATH_SEPARATOR = :
|
||||
@@ -276,10 +276,10 @@ XGETTEXT_EXTRA_OPTIONS =
|
||||
XMLLINT = xmllint
|
||||
YELP_LC_DIST = true
|
||||
YELP_LC_MEDIA_LINKS = true
|
||||
abs_builddir = /home/storm/orcatmp/orca/src
|
||||
abs_srcdir = /home/storm/orcatmp/orca/src
|
||||
abs_top_builddir = /home/storm/orcatmp/orca
|
||||
abs_top_srcdir = /home/storm/orcatmp/orca
|
||||
abs_builddir = /home/storm/cthulhutmp/cthulhu/src
|
||||
abs_srcdir = /home/storm/cthulhutmp/cthulhu/src
|
||||
abs_top_builddir = /home/storm/cthulhutmp/cthulhu
|
||||
abs_top_srcdir = /home/storm/cthulhutmp/cthulhu
|
||||
ac_ct_CC = gcc
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
@@ -308,7 +308,7 @@ host_vendor = pc
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = ${SHELL} /home/storm/orcatmp/orca/install-sh
|
||||
install_sh = ${SHELL} /home/storm/cthulhutmp/cthulhu/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
@@ -319,8 +319,8 @@ mandir = ${datarootdir}/man
|
||||
mkdir_p = $(MKDIR_P)
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
pkgpyexecdir = ${pyexecdir}/orca
|
||||
pkgpythondir = ${pythondir}/orca
|
||||
pkgpyexecdir = ${pyexecdir}/cthulhu
|
||||
pkgpythondir = ${pythondir}/cthulhu
|
||||
prefix = /usr/local
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
@@ -335,7 +335,7 @@ target_alias =
|
||||
top_build_prefix = ../
|
||||
top_builddir = ..
|
||||
top_srcdir = ..
|
||||
SUBDIRS = orca
|
||||
SUBDIRS = cthulhu
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
SUBDIRS = orca
|
||||
SUBDIRS = cthulhu
|
||||
|
||||
+1
-1
@@ -335,7 +335,7 @@ target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
SUBDIRS = orca
|
||||
SUBDIRS = cthulhu
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
cthulhu
|
||||
cthulhu-setup
|
||||
cthulhu_bin.py
|
||||
cthulhu_i18n.py
|
||||
cthulhu_platform.py
|
||||
*.pyc
|
||||
*~
|
||||
@@ -1,11 +1,11 @@
|
||||
orca_SCRIPTS = \
|
||||
orca
|
||||
cthulhu_SCRIPTS = \
|
||||
cthulhu
|
||||
|
||||
orcadir=$(bindir)
|
||||
uidir=$(datadir)/orca/ui
|
||||
gfxdir=$(datadir)/orca/gfx
|
||||
cthulhudir=$(bindir)
|
||||
uidir=$(datadir)/cthulhu/ui
|
||||
gfxdir=$(datadir)/cthulhu/gfx
|
||||
|
||||
orca_python_PYTHON = \
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
acss.py \
|
||||
action_presenter.py \
|
||||
@@ -54,16 +54,16 @@ orca_python_PYTHON = \
|
||||
notification_presenter.py \
|
||||
object_navigator.py \
|
||||
object_properties.py \
|
||||
orca.py \
|
||||
orca_gtkbuilder.py \
|
||||
orca_gui_find.py \
|
||||
orca_gui_navlist.py \
|
||||
orca_gui_prefs.py \
|
||||
orca_gui_profile.py \
|
||||
orca_i18n.py \
|
||||
orca_state.py \
|
||||
cthulhu.py \
|
||||
cthulhu_gtkbuilder.py \
|
||||
cthulhu_gui_find.py \
|
||||
cthulhu_gui_navlist.py \
|
||||
cthulhu_gui_prefs.py \
|
||||
cthulhu_gui_profile.py \
|
||||
cthulhu_i18n.py \
|
||||
cthulhu_state.py \
|
||||
phonnames.py \
|
||||
orca_platform.py \
|
||||
cthulhu_platform.py \
|
||||
pronunciation_dict.py \
|
||||
punctuation_settings.py \
|
||||
script.py \
|
||||
@@ -84,28 +84,28 @@ orca_python_PYTHON = \
|
||||
tutorialgenerator.py \
|
||||
where_am_i_presenter.py
|
||||
|
||||
orca_pythondir=$(pkgpythondir)
|
||||
cthulhu_pythondir=$(pkgpythondir)
|
||||
|
||||
SUBDIRS = \
|
||||
scripts \
|
||||
backends
|
||||
|
||||
ui_DATA = \
|
||||
orca-find.ui \
|
||||
orca-setup.ui
|
||||
cthulhu-find.ui \
|
||||
cthulhu-setup.ui
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(ui_DATA) \
|
||||
$(gfx_DATA)
|
||||
|
||||
CLEANFILES = \
|
||||
orca \
|
||||
orca_bin.py \
|
||||
orca_i18n.py \
|
||||
orca_platform.py
|
||||
cthulhu \
|
||||
cthulhu_bin.py \
|
||||
cthulhu_i18n.py \
|
||||
cthulhu_platform.py
|
||||
|
||||
DISTCLEANFILES = \
|
||||
orca \
|
||||
orca_bin.py \
|
||||
orca_i18n.py \
|
||||
orca_platform.py
|
||||
cthulhu \
|
||||
cthulhu_bin.py \
|
||||
cthulhu_i18n.py \
|
||||
cthulhu_platform.py
|
||||
@@ -37,8 +37,8 @@ from . import debug
|
||||
from . import input_event
|
||||
from . import keybindings
|
||||
from . import messages
|
||||
from . import orca
|
||||
from . import orca_state
|
||||
from . import cthulhu
|
||||
from . import cthulhu_state
|
||||
from .ax_object import AXObject
|
||||
|
||||
class ActionPresenter:
|
||||
@@ -97,7 +97,7 @@ class ActionPresenter:
|
||||
def show_actions_menu(self, script, event=None):
|
||||
"""Shows a menu with all the available accessible actions."""
|
||||
|
||||
obj = orca.getActiveModeAndObjectOfInterest()[1] or orca_state.locusOfFocus
|
||||
obj = cthulhu.getActiveModeAndObjectOfInterest()[1] or cthulhu_state.locusOfFocus
|
||||
if obj is None:
|
||||
full = messages.LOCATION_NOT_FOUND_FULL
|
||||
brief = messages.LOCATION_NOT_FOUND_BRIEF
|
||||
@@ -0,0 +1,6 @@
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
json_backend.py
|
||||
|
||||
cthulhu_pythondir=$(pkgpythondir)/backends
|
||||
|
||||
@@ -29,7 +29,7 @@ __license__ = "LGPL"
|
||||
|
||||
from json import load, dump
|
||||
import os
|
||||
from orca import settings, acss
|
||||
from cthulhu import settings, acss
|
||||
|
||||
class Backend:
|
||||
|
||||
@@ -51,7 +51,7 @@ class Backend:
|
||||
|
||||
def saveDefaultSettings(self, general, pronunciations, keybindings):
|
||||
""" Save default settings for all the properties from
|
||||
orca.settings. """
|
||||
cthulhu.settings. """
|
||||
prefs = {'general': general,
|
||||
'profiles': self._defaultProfiles,
|
||||
'pronunciations': pronunciations,
|
||||
@@ -230,13 +230,13 @@ class Bookmarks:
|
||||
""" Read saved bookmarks from disk. Currently an unpickled object
|
||||
that represents a bookmark """
|
||||
filename = filename or self._script.name.split(' ')[0]
|
||||
orcaDir = _settingsManager.getPrefsDir()
|
||||
if not orcaDir:
|
||||
cthulhuDir = _settingsManager.getPrefsDir()
|
||||
if not cthulhuDir:
|
||||
return
|
||||
|
||||
orcaBookmarksDir = os.path.join(orcaDir, "bookmarks")
|
||||
cthulhuBookmarksDir = os.path.join(cthulhuDir, "bookmarks")
|
||||
try:
|
||||
inputFile = open( os.path.join( orcaBookmarksDir, \
|
||||
inputFile = open( os.path.join( cthulhuBookmarksDir, \
|
||||
f'{filename}.pkl'), "r")
|
||||
bookmarks = pickle.load(inputFile.buffer)
|
||||
inputFile.close()
|
||||
@@ -248,14 +248,14 @@ class Bookmarks:
|
||||
""" Write bookmarks to disk. bookmarksObj must be a pickleable
|
||||
object. """
|
||||
filename = filename or self._script.name.split(' ')[0]
|
||||
orcaDir = _settingsManager.getPrefsDir()
|
||||
orcaBookmarksDir = os.path.join(orcaDir, "bookmarks")
|
||||
cthulhuDir = _settingsManager.getPrefsDir()
|
||||
cthulhuBookmarksDir = os.path.join(cthulhuDir, "bookmarks")
|
||||
# create directory if it does not exist. correct place??
|
||||
try:
|
||||
os.stat(orcaBookmarksDir)
|
||||
os.stat(cthulhuBookmarksDir)
|
||||
except OSError:
|
||||
os.mkdir(orcaBookmarksDir)
|
||||
output = open( os.path.join( orcaBookmarksDir, \
|
||||
os.mkdir(cthulhuBookmarksDir)
|
||||
output = open( os.path.join( cthulhuBookmarksDir, \
|
||||
f'{filename}.pkl'), "w", os.O_CREAT)
|
||||
pickle.dump(bookmarksObj, output.buffer)
|
||||
output.close()
|
||||
@@ -42,13 +42,13 @@ from . import brltablenames
|
||||
from . import cmdnames
|
||||
from . import debug
|
||||
from . import logger
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from . import settings
|
||||
from . import settings_manager
|
||||
|
||||
from .ax_event_synthesizer import AXEventSynthesizer
|
||||
from .ax_object import AXObject
|
||||
from .orca_platform import tablesdir
|
||||
from .cthulhu_platform import tablesdir
|
||||
|
||||
_logger = logger.getLogger()
|
||||
log = _logger.newLog("braille")
|
||||
@@ -91,7 +91,7 @@ else:
|
||||
# TODO: Can we get the tablesdir info at runtime?
|
||||
if not tablesdir:
|
||||
msg = "BRAILLE: Disabling liblouis due to unknown table location." \
|
||||
"This usually means orca was built before liblouis was installed."
|
||||
"This usually means cthulhu was built before liblouis was installed."
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
louis = None
|
||||
|
||||
@@ -524,7 +524,7 @@ class Component(Region):
|
||||
associated with this region. Note that the zeroeth character may have
|
||||
been scrolled off the display."""
|
||||
|
||||
if orca_state.activeScript and orca_state.activeScript.utilities.\
|
||||
if cthulhu_state.activeScript and cthulhu_state.activeScript.utilities.\
|
||||
grabFocusBeforeRouting(self.accessible, offset):
|
||||
try:
|
||||
self.accessible.queryComponent().grabFocus()
|
||||
@@ -594,9 +594,9 @@ class Text(Region):
|
||||
"""
|
||||
|
||||
self.accessible = accessible
|
||||
if orca_state.activeScript and self.accessible:
|
||||
if cthulhu_state.activeScript and self.accessible:
|
||||
[string, self.caretOffset, self.lineOffset] = \
|
||||
orca_state.activeScript.getTextLineAtCaret(
|
||||
cthulhu_state.activeScript.getTextLineAtCaret(
|
||||
self.accessible, startOffset=startOffset, endOffset=endOffset)
|
||||
else:
|
||||
string = ""
|
||||
@@ -656,7 +656,7 @@ class Text(Region):
|
||||
return False
|
||||
|
||||
[string, caretOffset, lineOffset] = \
|
||||
orca_state.activeScript.getTextLineAtCaret(self.accessible)
|
||||
cthulhu_state.activeScript.getTextLineAtCaret(self.accessible)
|
||||
|
||||
cursorOffset = min(caretOffset - lineOffset, len(string))
|
||||
|
||||
@@ -702,7 +702,7 @@ class Text(Region):
|
||||
if caretOffset < 0:
|
||||
return
|
||||
|
||||
orca_state.activeScript.utilities.setCaretOffset(
|
||||
cthulhu_state.activeScript.utilities.setCaretOffset(
|
||||
self.accessible, caretOffset)
|
||||
|
||||
def getAttributeMask(self, getLinkMask=True):
|
||||
@@ -731,7 +731,7 @@ class Text(Region):
|
||||
attrIndicator = settings.textAttributesBrailleIndicator
|
||||
selIndicator = settings.brailleSelectorIndicator
|
||||
linkIndicator = settings.brailleLinkIndicator
|
||||
script = orca_state.activeScript
|
||||
script = cthulhu_state.activeScript
|
||||
if script is None:
|
||||
msg = "BRAILLE: Cannot get attribute mask without active script."
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
@@ -893,7 +893,7 @@ class ReviewText(Region):
|
||||
been scrolled off the display."""
|
||||
|
||||
caretOffset = self.getCaretOffset(offset)
|
||||
orca_state.activeScript.utilities.setCaretOffset(
|
||||
cthulhu_state.activeScript.utilities.setCaretOffset(
|
||||
self.accessible, caretOffset)
|
||||
|
||||
class Line:
|
||||
@@ -1273,7 +1273,7 @@ def refresh(panToCursor=True, targetCursorCell=0, getLinkMask=True, stopFlash=Tr
|
||||
if stopFlash:
|
||||
killFlash(restoreSaved=False)
|
||||
|
||||
# TODO - JD: This should be taken care of in orca.py.
|
||||
# TODO - JD: This should be taken care of in cthulhu.py.
|
||||
if not _settingsManager.getSetting('enableBraille') \
|
||||
and not _settingsManager.getSetting('enableBrailleMonitor'):
|
||||
if _brlAPIRunning:
|
||||
@@ -34,7 +34,7 @@ from . import debug
|
||||
from . import generator
|
||||
from . import messages
|
||||
from . import object_properties
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from . import settings
|
||||
from . import settings_manager
|
||||
from .ax_object import AXObject
|
||||
@@ -93,7 +93,7 @@ class BrailleGenerator(generator.Generator):
|
||||
debug.printMessage(debug.LEVEL_INFO, "BRAILLE GENERATOR: generation disabled", True)
|
||||
return [[], None]
|
||||
|
||||
if obj == orca_state.locusOfFocus \
|
||||
if obj == cthulhu_state.locusOfFocus \
|
||||
and not args.get('formatType', None):
|
||||
args['formatType'] = 'focused'
|
||||
result = self.generate(obj, **args)
|
||||
@@ -396,7 +396,7 @@ class BrailleGenerator(generator.Generator):
|
||||
return []
|
||||
|
||||
result = self._generatePercentage(obj, **args)
|
||||
if obj == orca_state.locusOfFocus and not result:
|
||||
if obj == cthulhu_state.locusOfFocus and not result:
|
||||
return ['']
|
||||
|
||||
return result
|
||||
@@ -29,8 +29,8 @@ import gi
|
||||
gi.require_version("Atspi", "2.0")
|
||||
from gi.repository import Atspi
|
||||
|
||||
from .orca_i18n import _
|
||||
from .orca_i18n import C_
|
||||
from .cthulhu_i18n import _
|
||||
from .cthulhu_i18n import C_
|
||||
|
||||
shortRoleNames = {
|
||||
# Translators: short braille for the rolename of an invalid GUI object.
|
||||
@@ -31,7 +31,7 @@ __license__ = "LGPL"
|
||||
import brlapi
|
||||
from gi.repository import Gtk
|
||||
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from .input_event import BrailleEvent
|
||||
|
||||
# Attribute/Selection mask strings:
|
||||
@@ -112,14 +112,14 @@ class BrlCell(Gtk.Button):
|
||||
to what occurs when a user presses the cursor routing key on his/her
|
||||
hardware braille display."""
|
||||
|
||||
if not orca_state.activeScript:
|
||||
if not cthulhu_state.activeScript:
|
||||
return
|
||||
|
||||
fakeKeyPress = {}
|
||||
fakeKeyPress['command'] = brlapi.KEY_CMD_ROUTE
|
||||
fakeKeyPress['argument'] = self._position
|
||||
event = BrailleEvent(fakeKeyPress)
|
||||
orca_state.activeScript.processRoutingKey(event)
|
||||
cthulhu_state.activeScript.processRoutingKey(event)
|
||||
|
||||
def clear(self):
|
||||
"""Clears the braille cell."""
|
||||
@@ -29,7 +29,7 @@ __copyright__ = "Copyright (c) 2004-2009 Sun Microsystems Inc." \
|
||||
"Copyright (c) 2010-2013 The Orca Team"
|
||||
__license__ = "LGPL"
|
||||
|
||||
from .orca_i18n import _
|
||||
from .cthulhu_i18n import _
|
||||
|
||||
# Translators: This is the name of a braille translation table. To learn more
|
||||
# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
|
||||
@@ -31,7 +31,7 @@ from . import guilabels
|
||||
from . import input_event
|
||||
from . import keybindings
|
||||
from . import messages
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from . import settings
|
||||
from . import settings_manager
|
||||
from .ax_object import AXObject
|
||||
@@ -556,7 +556,7 @@ class Chat:
|
||||
message, chatRoomName = None, None
|
||||
|
||||
if _settingsManager.getSetting('chatRoomHistories'):
|
||||
conversation = self.getConversation(orca_state.locusOfFocus)
|
||||
conversation = self.getConversation(cthulhu_state.locusOfFocus)
|
||||
if conversation:
|
||||
message = conversation.getNthMessage(messageNumber)
|
||||
chatRoomName = conversation.name
|
||||
@@ -582,7 +582,7 @@ class Chat:
|
||||
# wants chat messages spoken.
|
||||
#
|
||||
verbosity = _settingsManager.getAppSetting(self._script.app, 'chatMessageVerbosity')
|
||||
if orca_state.activeScript.name != self._script.name \
|
||||
if cthulhu_state.activeScript.name != self._script.name \
|
||||
and verbosity == settings.CHAT_SPEAK_ALL_IF_FOCUSED:
|
||||
return
|
||||
elif not focused and verbosity == settings.CHAT_SPEAK_FOCUSED_CHANNEL:
|
||||
@@ -28,8 +28,8 @@ __copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
|
||||
__license__ = "LGPL"
|
||||
|
||||
from . import mathsymbols
|
||||
from . import orca_state
|
||||
from .orca_i18n import _
|
||||
from . import cthulhu_state
|
||||
from .cthulhu_i18n import _
|
||||
|
||||
# chnames is a dictionary where the keys represent a unicode character
|
||||
# and the values represent the common term used for the character.
|
||||
@@ -810,8 +810,8 @@ def getCharacterName(character, preferMath=False):
|
||||
Returns a string representing the name for the character
|
||||
"""
|
||||
|
||||
if not preferMath and orca_state.activeScript:
|
||||
preferMath = orca_state.activeScript.utilities.isInMath()
|
||||
if not preferMath and cthulhu_state.activeScript:
|
||||
preferMath = cthulhu_state.activeScript.utilities.isInMath()
|
||||
if not preferMath:
|
||||
return character
|
||||
return mathsymbols.getCharacterName(character) or character
|
||||
@@ -30,7 +30,7 @@ __copyright__ = "Copyright (c) 2004-2009 Sun Microsystems Inc." \
|
||||
"Copyright (c) 2010-2013 The Orca Team"
|
||||
__license__ = "LGPL"
|
||||
|
||||
from .orca_i18n import _
|
||||
from .cthulhu_i18n import _
|
||||
|
||||
# Translators: this command will move the mouse pointer to the current item
|
||||
# without clicking on it.
|
||||
@@ -25,7 +25,7 @@ __date__ = "$Date$"
|
||||
__copyright__ = "Copyright (c) 2014 Igalia, S.L."
|
||||
__license__ = "LGPL"
|
||||
|
||||
from .orca_i18n import C_
|
||||
from .cthulhu_i18n import C_
|
||||
|
||||
cssNames = {}
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
<property name="step_increment">0.10000000149</property>
|
||||
<property name="page_increment">1</property>
|
||||
</object>
|
||||
<object class="GtkDialog" id="orcaSetupWindow">
|
||||
<object class="GtkDialog" id="cthulhuSetupWindow">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Screen Reader Preferences</property>
|
||||
<property name="type_hint">normal</property>
|
||||
@@ -2873,20 +2873,20 @@
|
||||
<property name="row_spacing">10</property>
|
||||
<property name="column_spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="orcaModiferKeysGrid">
|
||||
<object class="GtkGrid" id="cthulhuModiferKeysGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">10</property>
|
||||
<property name="column_spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="orcaModifierKeyLabel">
|
||||
<object class="GtkLabel" id="cthulhuModifierKeyLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Screen Reader _Modifier Key(s):</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">orcaModifierComboBox</property>
|
||||
<property name="mnemonic_widget">cthulhuModifierComboBox</property>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="orcaModifierComboBox"/>
|
||||
<relation type="label-for" target="cthulhuModifierComboBox"/>
|
||||
</accessibility>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -2895,13 +2895,13 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="orcaModifierComboBox">
|
||||
<object class="GtkComboBox" id="cthulhuModifierComboBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="model">model8</property>
|
||||
<signal name="changed" handler="orcaModifierChanged" swapped="no"/>
|
||||
<signal name="changed" handler="cthulhuModifierChanged" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="orcaModifierRenderer"/>
|
||||
<object class="GtkCellRendererText" id="cthulhuModifierRenderer"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
@@ -56,8 +56,8 @@ from . import learn_mode_presenter
|
||||
from . import logger
|
||||
from . import messages
|
||||
from . import mouse_review
|
||||
from . import orca_state
|
||||
from . import orca_platform
|
||||
from . import cthulhu_state
|
||||
from . import cthulhu_platform
|
||||
from . import script_manager
|
||||
from . import settings
|
||||
from . import settings_manager
|
||||
@@ -97,7 +97,7 @@ _userSettings = None
|
||||
# Right now, this is just for the user's chosen Orca modifier(s).
|
||||
#
|
||||
_originalXmodmap = ""
|
||||
_orcaModifiers = settings.DESKTOP_MODIFIER_KEYS + settings.LAPTOP_MODIFIER_KEYS
|
||||
_cthulhuModifiers = settings.DESKTOP_MODIFIER_KEYS + settings.LAPTOP_MODIFIER_KEYS
|
||||
_capsLockCleared = False
|
||||
_restoreOrcaKeys = False
|
||||
|
||||
@@ -115,10 +115,10 @@ OBJECT_NAVIGATOR = "object-navigator"
|
||||
SAY_ALL = "say-all"
|
||||
|
||||
def getActiveModeAndObjectOfInterest():
|
||||
tokens = ["ORCA: Active mode:", orca_state.activeMode,
|
||||
"Object of interest:", orca_state.objOfInterest]
|
||||
tokens = ["ORCA: Active mode:", cthulhu_state.activeMode,
|
||||
"Object of interest:", cthulhu_state.objOfInterest]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
return orca_state.activeMode, orca_state.objOfInterest
|
||||
return cthulhu_state.activeMode, cthulhu_state.objOfInterest
|
||||
|
||||
def emitRegionChanged(obj, startOffset=None, endOffset=None, mode=None):
|
||||
"""Notifies interested clients that the current region of interest has changed."""
|
||||
@@ -136,10 +136,10 @@ def emitRegionChanged(obj, startOffset=None, endOffset=None, mode=None):
|
||||
msg = "ORCA: Exception emitting mode-changed notification"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
|
||||
if mode != orca_state.activeMode:
|
||||
tokens = ["ORCA: Switching active mode from", orca_state.activeMode, "to", mode]
|
||||
if mode != cthulhu_state.activeMode:
|
||||
tokens = ["ORCA: Switching active mode from", cthulhu_state.activeMode, "to", mode]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
orca_state.activeMode = mode
|
||||
cthulhu_state.activeMode = mode
|
||||
|
||||
try:
|
||||
tokens = ["ORCA: Region of interest:", obj, "(", startOffset, ")", endOffset]
|
||||
@@ -149,10 +149,10 @@ def emitRegionChanged(obj, startOffset=None, endOffset=None, mode=None):
|
||||
msg = "ORCA: Exception emitting region-changed notification"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
|
||||
if obj != orca_state.objOfInterest:
|
||||
tokens = ["ORCA: Switching object of interest from", orca_state.objOfInterest, "to", obj]
|
||||
if obj != cthulhu_state.objOfInterest:
|
||||
tokens = ["ORCA: Switching object of interest from", cthulhu_state.objOfInterest, "to", obj]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
orca_state.objOfInterest = obj
|
||||
cthulhu_state.objOfInterest = obj
|
||||
|
||||
def setActiveWindow(frame, app=None, alsoSetLocusOfFocus=False, notifyScript=False):
|
||||
tokens = ["ORCA: Request to set active window to", frame]
|
||||
@@ -160,22 +160,22 @@ def setActiveWindow(frame, app=None, alsoSetLocusOfFocus=False, notifyScript=Fal
|
||||
tokens.extend(["in", app])
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
|
||||
if frame == orca_state.activeWindow:
|
||||
if frame == cthulhu_state.activeWindow:
|
||||
msg = "ORCA: Setting activeWindow to existing activeWindow"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
elif frame is None:
|
||||
orca_state.activeWindow = None
|
||||
cthulhu_state.activeWindow = None
|
||||
else:
|
||||
real_app, real_frame = AXObject.find_real_app_and_window_for(frame, app)
|
||||
if real_frame != frame:
|
||||
tokens = ["ORCA: Correcting active window to", real_frame, "in", real_app]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
orca_state.activeWindow = real_frame
|
||||
cthulhu_state.activeWindow = real_frame
|
||||
else:
|
||||
orca_state.activeWindow = frame
|
||||
cthulhu_state.activeWindow = frame
|
||||
|
||||
if alsoSetLocusOfFocus:
|
||||
setLocusOfFocus(None, orca_state.activeWindow, notifyScript=notifyScript)
|
||||
setLocusOfFocus(None, cthulhu_state.activeWindow, notifyScript=notifyScript)
|
||||
|
||||
def setLocusOfFocus(event, obj, notifyScript=True, force=False):
|
||||
"""Sets the locus of focus (i.e., the object with visual focus) and
|
||||
@@ -190,30 +190,30 @@ def setLocusOfFocus(event, obj, notifyScript=True, force=False):
|
||||
current locusOfFocus
|
||||
"""
|
||||
|
||||
if not force and obj == orca_state.locusOfFocus:
|
||||
if not force and obj == cthulhu_state.locusOfFocus:
|
||||
msg = "ORCA: Setting locusOfFocus to existing locusOfFocus"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
return
|
||||
|
||||
if event and (orca_state.activeScript and not orca_state.activeScript.app):
|
||||
if event and (cthulhu_state.activeScript and not cthulhu_state.activeScript.app):
|
||||
app = AXObject.get_application(event.source)
|
||||
script = _scriptManager.getScript(app, event.source)
|
||||
_scriptManager.setActiveScript(script, "Setting locusOfFocus")
|
||||
|
||||
oldFocus = orca_state.locusOfFocus
|
||||
oldFocus = cthulhu_state.locusOfFocus
|
||||
if AXObject.is_dead(oldFocus):
|
||||
oldFocus = None
|
||||
|
||||
if obj is None:
|
||||
msg = "ORCA: New locusOfFocus is null (being cleared)"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
orca_state.locusOfFocus = None
|
||||
cthulhu_state.locusOfFocus = None
|
||||
return
|
||||
|
||||
if orca_state.activeScript:
|
||||
tokens = ["ORCA: Active script is:", orca_state.activeScript]
|
||||
if cthulhu_state.activeScript:
|
||||
tokens = ["ORCA: Active script is:", cthulhu_state.activeScript]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
if orca_state.activeScript.utilities.isZombie(obj):
|
||||
if cthulhu_state.activeScript.utilities.isZombie(obj):
|
||||
tokens = ["ERROR: New locusOfFocus (", obj, ") is zombie. Not updating."]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
return
|
||||
@@ -224,17 +224,17 @@ def setLocusOfFocus(event, obj, notifyScript=True, force=False):
|
||||
|
||||
tokens = ["ORCA: Changing locusOfFocus from", oldFocus, "to", obj, ". Notify:", notifyScript]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
orca_state.locusOfFocus = obj
|
||||
cthulhu_state.locusOfFocus = obj
|
||||
|
||||
if not notifyScript:
|
||||
return
|
||||
|
||||
if not orca_state.activeScript:
|
||||
if not cthulhu_state.activeScript:
|
||||
msg = "ORCA: Cannot notify active script because there isn't one"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
return
|
||||
|
||||
orca_state.activeScript.locusOfFocusChanged(event, oldFocus, orca_state.locusOfFocus)
|
||||
cthulhu_state.activeScript.locusOfFocusChanged(event, oldFocus, cthulhu_state.locusOfFocus)
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
@@ -258,7 +258,7 @@ def _processBrailleEvent(event):
|
||||
event = BrailleEvent(event)
|
||||
if event.event['command'] not in braille.dontInteruptSpeechKeys:
|
||||
speech.stop()
|
||||
orca_state.lastInputEvent = event
|
||||
cthulhu_state.lastInputEvent = event
|
||||
|
||||
try:
|
||||
consumed = _eventManager.processBrailleEvent(event)
|
||||
@@ -293,13 +293,13 @@ def updateKeyMap(keyboardEvent):
|
||||
if keyboardEvent.isPressedKey():
|
||||
return
|
||||
|
||||
if keyboardEvent.event_string in settings.orcaModifierKeys \
|
||||
and orca_state.bypassNextCommand:
|
||||
if keyboardEvent.event_string in settings.cthulhuModifierKeys \
|
||||
and cthulhu_state.bypassNextCommand:
|
||||
_restoreXmodmap()
|
||||
_restoreOrcaKeys = True
|
||||
return
|
||||
|
||||
if _restoreOrcaKeys and not orca_state.bypassNextCommand:
|
||||
if _restoreOrcaKeys and not cthulhu_state.bypassNextCommand:
|
||||
_createOrcaXmodmap()
|
||||
_restoreOrcaKeys = False
|
||||
|
||||
@@ -366,8 +366,8 @@ def _createOrcaXmodmap():
|
||||
|
||||
global _capsLockCleared
|
||||
|
||||
if "Caps_Lock" in settings.orcaModifierKeys \
|
||||
or "Shift_Lock" in settings.orcaModifierKeys:
|
||||
if "Caps_Lock" in settings.cthulhuModifierKeys \
|
||||
or "Shift_Lock" in settings.cthulhuModifierKeys:
|
||||
_setCapsLockAsOrcaModifier(True)
|
||||
_capsLockCleared = True
|
||||
elif _capsLockCleared:
|
||||
@@ -489,15 +489,15 @@ def loadUserSettings(script=None, inputEvent=None, skipReloadMessage=False):
|
||||
if _settingsManager.getSetting('enableSound'):
|
||||
player.init()
|
||||
|
||||
global _orcaModifiers
|
||||
custom = [k for k in settings.orcaModifierKeys if k not in _orcaModifiers]
|
||||
_orcaModifiers += custom
|
||||
global _cthulhuModifiers
|
||||
custom = [k for k in settings.cthulhuModifierKeys if k not in _cthulhuModifiers]
|
||||
_cthulhuModifiers += custom
|
||||
# Handle the case where a change was made in the Orca Preferences dialog.
|
||||
#
|
||||
if _originalXmodmap:
|
||||
_restoreXmodmap(_orcaModifiers)
|
||||
_restoreXmodmap(_cthulhuModifiers)
|
||||
|
||||
_storeXmodmap(_orcaModifiers)
|
||||
_storeXmodmap(_cthulhuModifiers)
|
||||
_createOrcaXmodmap()
|
||||
|
||||
_scriptManager.activate()
|
||||
@@ -508,24 +508,24 @@ def loadUserSettings(script=None, inputEvent=None, skipReloadMessage=False):
|
||||
return True
|
||||
|
||||
def _showPreferencesUI(script, prefs):
|
||||
if orca_state.orcaOS:
|
||||
orca_state.orcaOS.showGUI()
|
||||
if cthulhu_state.cthulhuOS:
|
||||
cthulhu_state.cthulhuOS.showGUI()
|
||||
return
|
||||
|
||||
try:
|
||||
module = importlib.import_module('.orca_gui_prefs', 'orca')
|
||||
module = importlib.import_module('.cthulhu_gui_prefs', 'cthulhu')
|
||||
except Exception:
|
||||
debug.printException(debug.LEVEL_SEVERE)
|
||||
return
|
||||
|
||||
uiFile = os.path.join(orca_platform.datadir,
|
||||
orca_platform.package,
|
||||
uiFile = os.path.join(cthulhu_platform.datadir,
|
||||
cthulhu_platform.package,
|
||||
"ui",
|
||||
"orca-setup.ui")
|
||||
"cthulhu-setup.ui")
|
||||
|
||||
orca_state.orcaOS = module.OrcaSetupGUI(uiFile, "orcaSetupWindow", prefs)
|
||||
orca_state.orcaOS.init(script)
|
||||
orca_state.orcaOS.showGUI()
|
||||
cthulhu_state.cthulhuOS = module.OrcaSetupGUI(uiFile, "cthulhuSetupWindow", prefs)
|
||||
cthulhu_state.cthulhuOS.init(script)
|
||||
cthulhu_state.cthulhuOS.showGUI()
|
||||
|
||||
def showAppPreferencesGUI(script=None, inputEvent=None):
|
||||
"""Displays the user interface to configure the settings for a
|
||||
@@ -539,7 +539,7 @@ def showAppPreferencesGUI(script=None, inputEvent=None):
|
||||
for key in settings.userCustomizableSettings:
|
||||
prefs[key] = _settingsManager.getSetting(key)
|
||||
|
||||
script = script or orca_state.activeScript
|
||||
script = script or cthulhu_state.activeScript
|
||||
_showPreferencesUI(script, prefs)
|
||||
|
||||
return True
|
||||
@@ -560,27 +560,27 @@ def showPreferencesGUI(script=None, inputEvent=None):
|
||||
def addKeyGrab(binding):
|
||||
""" Add a key grab for the given key binding."""
|
||||
|
||||
if orca_state.device is None:
|
||||
if cthulhu_state.device is None:
|
||||
return []
|
||||
|
||||
ret = []
|
||||
for kd in binding.keyDefs():
|
||||
ret.append(orca_state.device.add_key_grab(kd, None))
|
||||
ret.append(cthulhu_state.device.add_key_grab(kd, None))
|
||||
return ret
|
||||
|
||||
def removeKeyGrab(id):
|
||||
""" Remove the key grab for the given key binding."""
|
||||
|
||||
if orca_state.device is None:
|
||||
if cthulhu_state.device is None:
|
||||
return
|
||||
|
||||
orca_state.device.remove_key_grab(id)
|
||||
cthulhu_state.device.remove_key_grab(id)
|
||||
|
||||
def mapModifier(keycode):
|
||||
if orca_state.device is None:
|
||||
if cthulhu_state.device is None:
|
||||
return
|
||||
|
||||
return orca_state.device.map_modifier(keycode)
|
||||
return cthulhu_state.device.map_modifier(keycode)
|
||||
|
||||
def quitOrca(script=None, inputEvent=None):
|
||||
"""Quit Orca. Check if the user wants to confirm this action.
|
||||
@@ -600,7 +600,7 @@ def showFindGUI(script=None, inputEvent=None):
|
||||
"""
|
||||
|
||||
try:
|
||||
module = importlib.import_module('.orca_gui_find', 'orca')
|
||||
module = importlib.import_module('.cthulhu_gui_find', 'cthulhu')
|
||||
module.showFindUI()
|
||||
except Exception:
|
||||
debug.printException(debug.LEVEL_SEVERE)
|
||||
@@ -610,7 +610,7 @@ def showFindGUI(script=None, inputEvent=None):
|
||||
_initialized = False
|
||||
|
||||
def init():
|
||||
"""Initialize the orca module, which initializes the speech and braille
|
||||
"""Initialize the cthulhu module, which initializes the speech and braille
|
||||
modules. Also builds up the application list, registers for AT-SPI events,
|
||||
and creates scripts for all known applications.
|
||||
|
||||
@@ -720,8 +720,8 @@ def shutdown(script=None, inputEvent=None):
|
||||
signal.signal(signal.SIGALRM, settings.timeoutCallback)
|
||||
signal.alarm(settings.timeoutTime)
|
||||
|
||||
orca_state.activeScript.presentationInterrupt()
|
||||
orca_state.activeScript.presentMessage(messages.STOP_ORCA, resetStyles=False)
|
||||
cthulhu_state.activeScript.presentationInterrupt()
|
||||
cthulhu_state.activeScript.presentMessage(messages.STOP_ORCA, resetStyles=False)
|
||||
|
||||
# Deactivate the event manager first so that it clears its queue and will not
|
||||
# accept new events. Then let the script manager unregister script event listeners.
|
||||
@@ -742,7 +742,7 @@ def shutdown(script=None, inputEvent=None):
|
||||
signal.alarm(0)
|
||||
|
||||
_initialized = False
|
||||
_restoreXmodmap(_orcaModifiers)
|
||||
_restoreXmodmap(_cthulhuModifiers)
|
||||
|
||||
debug.printMessage(debug.LEVEL_INFO, 'ORCA: Quitting Atspi main event loop', True)
|
||||
Atspi.event_quit()
|
||||
@@ -796,10 +796,10 @@ def crashOnSignal(signum, frame):
|
||||
msg = f"ORCA: Shutting down and exiting due to signal={signum} {signalString}"
|
||||
debug.printMessage(debug.LEVEL_SEVERE, msg, True)
|
||||
debug.printStack(debug.LEVEL_SEVERE)
|
||||
_restoreXmodmap(_orcaModifiers)
|
||||
_restoreXmodmap(_cthulhuModifiers)
|
||||
try:
|
||||
orca_state.activeScript.presentationInterrupt()
|
||||
orca_state.activeScript.presentMessage(messages.STOP_ORCA, resetStyles=False)
|
||||
cthulhu_state.activeScript.presentationInterrupt()
|
||||
cthulhu_state.activeScript.presentMessage(messages.STOP_ORCA, resetStyles=False)
|
||||
except Exception:
|
||||
pass
|
||||
sys.exit(1)
|
||||
@@ -811,9 +811,9 @@ def main():
|
||||
an exit code of 0 means normal completion and an exit code of 50
|
||||
means Orca exited because of a hang."""
|
||||
|
||||
msg = f"ORCA: Launching version {orca_platform.version}"
|
||||
if orca_platform.revision:
|
||||
msg += f" (rev {orca_platform.revision})"
|
||||
msg = f"ORCA: Launching version {cthulhu_platform.version}"
|
||||
if cthulhu_platform.revision:
|
||||
msg += f" (rev {cthulhu_platform.revision})"
|
||||
|
||||
sessionType = os.environ.get('XDG_SESSION_TYPE') or ""
|
||||
sessionDesktop = os.environ.get('XDG_SESSION_DESKTOP') or ""
|
||||
@@ -854,17 +854,17 @@ def main():
|
||||
except Exception:
|
||||
debug.printException(debug.LEVEL_SEVERE)
|
||||
|
||||
script = orca_state.activeScript
|
||||
script = cthulhu_state.activeScript
|
||||
if script:
|
||||
window = script.utilities.activeWindow()
|
||||
|
||||
if window and not orca_state.locusOfFocus:
|
||||
if window and not cthulhu_state.locusOfFocus:
|
||||
app = AXObject.get_application(window)
|
||||
setActiveWindow(window, app, alsoSetLocusOfFocus=True, notifyScript=True)
|
||||
|
||||
# setActiveWindow does some corrective work needed thanks to
|
||||
# mutter-x11-frames. So retrieve the window just in case.
|
||||
window = orca_state.activeWindow
|
||||
window = cthulhu_state.activeWindow
|
||||
script = _scriptManager.getScript(app, window)
|
||||
_scriptManager.setActiveScript(script, "Launching.")
|
||||
|
||||
@@ -44,15 +44,15 @@ pythondir = pythondir.replace('${prefix}', '@prefix@')
|
||||
sys.path.insert(1, pythondir)
|
||||
|
||||
# Do not import Orca here. It is imported in main(). The reason why is that
|
||||
# start-up failures due to imports in orca.py are not getting output, making
|
||||
# start-up failures due to imports in cthulhu.py are not getting output, making
|
||||
# them challenging to debug when they cannot be reproduced locally.
|
||||
|
||||
from orca import debug
|
||||
from orca import messages
|
||||
from orca import settings
|
||||
from orca.ax_object import AXObject
|
||||
from orca.ax_utilities import AXUtilities
|
||||
from orca.orca_platform import version
|
||||
from cthulhu import debug
|
||||
from cthulhu import messages
|
||||
from cthulhu import settings
|
||||
from cthulhu.ax_object import AXObject
|
||||
from cthulhu.ax_utilities import AXUtilities
|
||||
from cthulhu.cthulhu_platform import version
|
||||
|
||||
class ListApps(argparse.Action):
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
@@ -198,29 +198,29 @@ def inGraphicalDesktop():
|
||||
def otherOrcas():
|
||||
"""Returns the pid of any other instances of Orca owned by this user."""
|
||||
|
||||
openFile = subprocess.Popen('pgrep -u %s -x orca' % os.getuid(),
|
||||
openFile = subprocess.Popen('pgrep -u %s -x cthulhu' % os.getuid(),
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE).stdout
|
||||
pids = openFile.read()
|
||||
openFile.close()
|
||||
orcas = [int(p) for p in pids.split()]
|
||||
cthulhus = [int(p) for p in pids.split()]
|
||||
|
||||
pid = os.getpid()
|
||||
return [p for p in orcas if p != pid]
|
||||
return [p for p in cthulhus if p != pid]
|
||||
|
||||
def cleanup(sigval):
|
||||
"""Tries to clean up any other running Orca instances owned by this user."""
|
||||
|
||||
orcasToKill = otherOrcas()
|
||||
debug.printMessage(debug.LEVEL_INFO, "INFO: Cleaning up these PIDs: %s" % orcasToKill)
|
||||
cthulhusToKill = otherOrcas()
|
||||
debug.printMessage(debug.LEVEL_INFO, "INFO: Cleaning up these PIDs: %s" % cthulhusToKill)
|
||||
|
||||
def onTimeout(signum, frame):
|
||||
orcasToKill = otherOrcas()
|
||||
debug.printMessage(debug.LEVEL_INFO, "INFO: Timeout cleaning up: %s" % orcasToKill)
|
||||
for pid in orcasToKill:
|
||||
cthulhusToKill = otherOrcas()
|
||||
debug.printMessage(debug.LEVEL_INFO, "INFO: Timeout cleaning up: %s" % cthulhusToKill)
|
||||
for pid in cthulhusToKill:
|
||||
os.kill(pid, signal.SIGKILL)
|
||||
|
||||
for pid in orcasToKill:
|
||||
for pid in cthulhusToKill:
|
||||
os.kill(pid, sigval)
|
||||
signal.signal(signal.SIGALRM, onTimeout)
|
||||
signal.alarm(2)
|
||||
@@ -228,7 +228,7 @@ def cleanup(sigval):
|
||||
time.sleep(0.5)
|
||||
|
||||
def main():
|
||||
setProcessName('orca')
|
||||
setProcessName('cthulhu')
|
||||
|
||||
parser = Parser()
|
||||
args, invalid = parser.parse_known_args()
|
||||
@@ -249,8 +249,8 @@ def main():
|
||||
|
||||
debug.printMessage(debug.LEVEL_INFO, "INFO: Preparing to launch.", True)
|
||||
|
||||
from orca import orca
|
||||
manager = orca.getSettingsManager()
|
||||
from cthulhu import cthulhu
|
||||
manager = cthulhu.getSettingsManager()
|
||||
|
||||
if not manager:
|
||||
print(messages.CLI_SETTINGS_MANAGER_ERROR)
|
||||
@@ -269,14 +269,14 @@ def main():
|
||||
|
||||
if args.setup:
|
||||
cleanup(signal.SIGKILL)
|
||||
orca.showPreferencesGUI()
|
||||
cthulhu.showPreferencesGUI()
|
||||
|
||||
if otherOrcas():
|
||||
print(messages.CLI_OTHER_ORCAS_ERROR)
|
||||
return 1
|
||||
|
||||
debug.printMessage(debug.LEVEL_INFO, "INFO: About to launch Orca.", True)
|
||||
return orca.main()
|
||||
return cthulhu.main()
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -28,7 +28,7 @@ __license__ = "LGPL"
|
||||
import gettext
|
||||
from gi.repository import Gtk
|
||||
|
||||
from .orca_i18n import _
|
||||
from .cthulhu_i18n import _
|
||||
|
||||
class GtkBuilderWrapper:
|
||||
"""
|
||||
@@ -56,25 +56,25 @@ class GtkBuilderWrapper:
|
||||
self.localize_widget(obj)
|
||||
|
||||
# Set default application icon.
|
||||
self.set_orca_icon()
|
||||
self.set_cthulhu_icon()
|
||||
|
||||
instance_attributes = {}
|
||||
for attribute in dir(self.__class__):
|
||||
instance_attributes[attribute] = getattr(self, attribute)
|
||||
self.builder.connect_signals(instance_attributes)
|
||||
|
||||
def set_orca_icon(self):
|
||||
def set_cthulhu_icon(self):
|
||||
"""Get the icon in all sizes from the current theme and set them as
|
||||
default for all application windows.
|
||||
"""
|
||||
|
||||
icon_theme = Gtk.IconTheme.get_default()
|
||||
try:
|
||||
icon16 = icon_theme.load_icon("orca", 16, 0)
|
||||
icon22 = icon_theme.load_icon("orca", 22, 0)
|
||||
icon24 = icon_theme.load_icon("orca", 24, 0)
|
||||
icon32 = icon_theme.load_icon("orca", 32, 0)
|
||||
icon48 = icon_theme.load_icon("orca", 48, 0)
|
||||
icon16 = icon_theme.load_icon("cthulhu", 16, 0)
|
||||
icon22 = icon_theme.load_icon("cthulhu", 22, 0)
|
||||
icon24 = icon_theme.load_icon("cthulhu", 24, 0)
|
||||
icon32 = icon_theme.load_icon("cthulhu", 32, 0)
|
||||
icon48 = icon_theme.load_icon("cthulhu", 48, 0)
|
||||
except Exception:
|
||||
return
|
||||
else:
|
||||
@@ -32,13 +32,13 @@ import locale
|
||||
|
||||
from . import find
|
||||
from . import guilabels
|
||||
from . import orca_gtkbuilder
|
||||
from . import orca_state
|
||||
from . import orca_platform
|
||||
from . import cthulhu_gtkbuilder
|
||||
from . import cthulhu_state
|
||||
from . import cthulhu_platform
|
||||
|
||||
OS = None
|
||||
|
||||
class OrcaFindGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
class OrcaFindGUI(cthulhu_gtkbuilder.GtkBuilderWrapper):
|
||||
|
||||
def __init__(self, fileName, windowName):
|
||||
"""Initialize the Orca configuration GUI.
|
||||
@@ -48,7 +48,7 @@ class OrcaFindGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
- windowName: name of the component to get from the GtkBuilder file.
|
||||
"""
|
||||
|
||||
orca_gtkbuilder.GtkBuilderWrapper.__init__(self, fileName, windowName)
|
||||
cthulhu_gtkbuilder.GtkBuilderWrapper.__init__(self, fileName, windowName)
|
||||
self.activeScript = None
|
||||
self.caseSensitive = None
|
||||
self.matchEntireWord = None
|
||||
@@ -66,7 +66,7 @@ class OrcaFindGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
self.windowWrap = True
|
||||
self.startAtTop = False
|
||||
|
||||
self.activeScript = orca_state.activeScript
|
||||
self.activeScript = cthulhu_state.activeScript
|
||||
|
||||
def showGUI(self):
|
||||
"""Show the Orca Find dialog. This assumes that the GUI has
|
||||
@@ -74,7 +74,7 @@ class OrcaFindGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
"""
|
||||
|
||||
findDialog = self.get_widget("findDialog")
|
||||
ts = orca_state.lastInputEvent.timestamp
|
||||
ts = cthulhu_state.lastInputEvent.timestamp
|
||||
if ts == 0:
|
||||
ts = Gtk.get_current_event_time()
|
||||
findDialog.present_with_time(ts)
|
||||
@@ -86,18 +86,18 @@ class OrcaFindGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
|
||||
try:
|
||||
searchForEntry = self.get_widget("searchForEntry")
|
||||
searchForEntry.set_text(orca_state.searchQuery.searchString)
|
||||
searchForEntry.set_text(cthulhu_state.searchQuery.searchString)
|
||||
searchForEntry.select_region(0, len(searchForEntry.get_text()))
|
||||
if orca_state.searchQuery.startAtTop:
|
||||
if cthulhu_state.searchQuery.startAtTop:
|
||||
self.get_widget("topRadioButton").set_active(True)
|
||||
self.get_widget("matchCaseCheckbox").set_active(\
|
||||
orca_state.searchQuery.caseSensitive)
|
||||
cthulhu_state.searchQuery.caseSensitive)
|
||||
self.get_widget("matchEntireWordCheckbox").set_active(\
|
||||
orca_state.searchQuery.matchEntireWord)
|
||||
cthulhu_state.searchQuery.matchEntireWord)
|
||||
self.get_widget("wrapAroundCheckbox").set_active(\
|
||||
orca_state.searchQuery.windowWrap)
|
||||
cthulhu_state.searchQuery.windowWrap)
|
||||
self.get_widget("searchBackwardsCheckbox").set_active(\
|
||||
orca_state.searchQuery.searchBackwards)
|
||||
cthulhu_state.searchQuery.searchBackwards)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@@ -198,13 +198,13 @@ class OrcaFindGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
- widget: the component that generated the signal.
|
||||
"""
|
||||
|
||||
orca_state.searchQuery = find.SearchQuery()
|
||||
orca_state.searchQuery.searchString = self.searchString
|
||||
orca_state.searchQuery.searchBackwards = self.searchBackwards
|
||||
orca_state.searchQuery.caseSensitive = self.caseSensitive
|
||||
orca_state.searchQuery.matchEntireWord = self.matchEntireWord
|
||||
orca_state.searchQuery.startAtTop = self.startAtTop
|
||||
orca_state.searchQuery.windowWrap = self.windowWrap
|
||||
cthulhu_state.searchQuery = find.SearchQuery()
|
||||
cthulhu_state.searchQuery.searchString = self.searchString
|
||||
cthulhu_state.searchQuery.searchBackwards = self.searchBackwards
|
||||
cthulhu_state.searchQuery.caseSensitive = self.caseSensitive
|
||||
cthulhu_state.searchQuery.matchEntireWord = self.matchEntireWord
|
||||
cthulhu_state.searchQuery.startAtTop = self.startAtTop
|
||||
cthulhu_state.searchQuery.windowWrap = self.windowWrap
|
||||
|
||||
self.activeScript.findCommandRun = True
|
||||
|
||||
@@ -229,10 +229,10 @@ def showFindUI():
|
||||
global OS
|
||||
|
||||
if not OS:
|
||||
uiFile = os.path.join(orca_platform.datadir,
|
||||
orca_platform.package,
|
||||
uiFile = os.path.join(cthulhu_platform.datadir,
|
||||
cthulhu_platform.package,
|
||||
"ui",
|
||||
"orca-find.ui")
|
||||
"cthulhu-find.ui")
|
||||
OS = OrcaFindGUI(uiFile, "findDialog")
|
||||
OS.init()
|
||||
|
||||
@@ -31,7 +31,7 @@ from gi.repository import GObject, Gdk, Gtk
|
||||
|
||||
from . import debug
|
||||
from . import guilabels
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from .ax_event_synthesizer import AXEventSynthesizer
|
||||
from .ax_object import AXObject
|
||||
|
||||
@@ -47,7 +47,7 @@ class OrcaNavListGUI:
|
||||
self._gui.set_keep_above(True)
|
||||
self._gui.set_focus_on_map(True)
|
||||
self._gui.set_accept_focus(True)
|
||||
self._script = orca_state.activeScript
|
||||
self._script = cthulhu_state.activeScript
|
||||
self._document = None
|
||||
|
||||
def _createNavListDialog(self, columnHeaders, rows, selectedRow):
|
||||
@@ -119,7 +119,7 @@ class OrcaNavListGUI:
|
||||
self._gui.move(x + 100, y + 100)
|
||||
|
||||
self._gui.show_all()
|
||||
ts = orca_state.lastInputEvent.timestamp
|
||||
ts = cthulhu_state.lastInputEvent.timestamp
|
||||
if ts == 0:
|
||||
ts = Gtk.get_current_event_time()
|
||||
self._gui.present_with_time(ts)
|
||||
@@ -42,10 +42,10 @@ from . import debug
|
||||
from . import event_manager
|
||||
from . import guilabels
|
||||
from . import messages
|
||||
from . import orca
|
||||
from . import orca_gtkbuilder
|
||||
from . import orca_gui_profile
|
||||
from . import orca_state
|
||||
from . import cthulhu
|
||||
from . import cthulhu_gtkbuilder
|
||||
from . import cthulhu_gui_profile
|
||||
from . import cthulhu_state
|
||||
from . import settings
|
||||
from . import settings_manager
|
||||
from . import input_event
|
||||
@@ -63,7 +63,7 @@ try:
|
||||
import louis
|
||||
except ImportError:
|
||||
louis = None
|
||||
from .orca_platform import tablesdir
|
||||
from .cthulhu_platform import tablesdir
|
||||
if louis and not tablesdir:
|
||||
louis = None
|
||||
|
||||
@@ -93,7 +93,7 @@ if louis and not tablesdir:
|
||||
DATE_FORMAT_ABBREVIATED_MD, DATE_FORMAT_ABBREVIATED_DMY,
|
||||
DATE_FORMAT_ABBREVIATED_MDY, DATE_FORMAT_ABBREVIATED_YMD) = list(range(16))
|
||||
|
||||
class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
class OrcaSetupGUI(cthulhu_gtkbuilder.GtkBuilderWrapper):
|
||||
|
||||
def __init__(self, fileName, windowName, prefsDict):
|
||||
"""Initialize the Orca configuration GUI.
|
||||
@@ -104,7 +104,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
- prefsDict: dictionary of preferences to use during initialization
|
||||
"""
|
||||
|
||||
orca_gtkbuilder.GtkBuilderWrapper.__init__(self, fileName, windowName)
|
||||
cthulhu_gtkbuilder.GtkBuilderWrapper.__init__(self, fileName, windowName)
|
||||
self.prefsDict = prefsDict
|
||||
|
||||
self._defaultProfile = ['Default', 'default']
|
||||
@@ -336,7 +336,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
#
|
||||
self._populateKeyBindings()
|
||||
|
||||
self.window = self.get_widget("orcaSetupWindow")
|
||||
self.window = self.get_widget("cthulhuSetupWindow")
|
||||
|
||||
self._setKeyEchoItems()
|
||||
|
||||
@@ -1837,8 +1837,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
return _settingsManager.availableProfiles()
|
||||
|
||||
def _updateOrcaModifier(self):
|
||||
combobox = self.get_widget("orcaModifierComboBox")
|
||||
keystring = ", ".join(self.prefsDict["orcaModifierKeys"])
|
||||
combobox = self.get_widget("cthulhuModifierComboBox")
|
||||
keystring = ", ".join(self.prefsDict["cthulhuModifierKeys"])
|
||||
combobox.set_active(self.getComboBoxIndex(combobox, keystring))
|
||||
|
||||
def populateComboBox(self, combobox, items):
|
||||
@@ -1921,10 +1921,10 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
the GUI has already been created.
|
||||
"""
|
||||
|
||||
orcaSetupWindow = self.get_widget("orcaSetupWindow")
|
||||
cthulhuSetupWindow = self.get_widget("cthulhuSetupWindow")
|
||||
|
||||
accelGroup = Gtk.AccelGroup()
|
||||
orcaSetupWindow.add_accel_group(accelGroup)
|
||||
cthulhuSetupWindow.add_accel_group(accelGroup)
|
||||
helpButton = self.get_widget("helpButton")
|
||||
(keyVal, modifierMask) = Gtk.accelerator_parse("F1")
|
||||
helpButton.add_accelerator("clicked",
|
||||
@@ -1934,12 +1934,12 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
0)
|
||||
|
||||
try:
|
||||
ts = orca_state.lastInputEvent.timestamp
|
||||
ts = cthulhu_state.lastInputEvent.timestamp
|
||||
except Exception:
|
||||
ts = 0
|
||||
if ts == 0:
|
||||
ts = Gtk.get_current_event_time()
|
||||
orcaSetupWindow.present_with_time(ts)
|
||||
cthulhuSetupWindow.present_with_time(ts)
|
||||
|
||||
# We always want to re-order the text attributes page so that enabled
|
||||
# items are consistently at the top.
|
||||
@@ -1951,9 +1951,9 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
|
||||
if self.script.app:
|
||||
title = guilabels.PREFERENCES_APPLICATION_TITLE % AXObject.get_name(self.script.app)
|
||||
orcaSetupWindow.set_title(title)
|
||||
cthulhuSetupWindow.set_title(title)
|
||||
|
||||
orcaSetupWindow.show()
|
||||
cthulhuSetupWindow.show()
|
||||
|
||||
def _initComboBox(self, combobox):
|
||||
"""Initialize the given combo box to take a list of int/str pairs.
|
||||
@@ -2635,9 +2635,9 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
self.prefsDict["verbalizePunctuationStyle"] = \
|
||||
settings.PUNCTUATION_STYLE_ALL
|
||||
|
||||
def orcaModifierChanged(self, widget):
|
||||
"""Signal handler for the changed signal for the orcaModifierComboBox
|
||||
Set the 'orcaModifierKeys' preference to the new value.
|
||||
def cthulhuModifierChanged(self, widget):
|
||||
"""Signal handler for the changed signal for the cthulhuModifierComboBox
|
||||
Set the 'cthulhuModifierKeys' preference to the new value.
|
||||
|
||||
Arguments:
|
||||
- widget: the component that generated the signal.
|
||||
@@ -2645,8 +2645,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
|
||||
model = widget.get_model()
|
||||
myIter = widget.get_active_iter()
|
||||
orcaModifier = model[myIter][0]
|
||||
self.prefsDict["orcaModifierKeys"] = orcaModifier.split(', ')
|
||||
cthulhuModifier = model[myIter][0]
|
||||
self.prefsDict["cthulhuModifierKeys"] = cthulhuModifier.split(', ')
|
||||
|
||||
def progressBarVerbosityChanged(self, widget):
|
||||
"""Signal handler for the changed signal for the progressBarVerbosity
|
||||
@@ -2849,14 +2849,14 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
"""Starts user input of a Key for a selected key binding"""
|
||||
|
||||
self._presentMessage(messages.KB_ENTER_NEW_KEY)
|
||||
orca_state.capturingKeys = True
|
||||
cthulhu_state.capturingKeys = True
|
||||
editable.connect('key-press-event', self.kbKeyPressed)
|
||||
return
|
||||
|
||||
def editingCanceledKey(self, editable):
|
||||
"""Stops user input of a Key for a selected key binding"""
|
||||
|
||||
orca_state.capturingKeys = False
|
||||
cthulhu_state.capturingKeys = False
|
||||
self._capturedKey = []
|
||||
return
|
||||
|
||||
@@ -2876,8 +2876,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
eventString = Gdk.keyval_name(entries[0])
|
||||
eventState = keyPressedEvent.state
|
||||
|
||||
orcaMods = settings.orcaModifierKeys
|
||||
if eventString in orcaMods:
|
||||
cthulhuMods = settings.cthulhuModifierKeys
|
||||
if eventString in cthulhuMods:
|
||||
self._capturedKey = ['', keybindings.ORCA_MODIFIER_MASK, 0]
|
||||
return False
|
||||
|
||||
@@ -2963,7 +2963,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
the treeview.
|
||||
"""
|
||||
|
||||
orca_state.capturingKeys = False
|
||||
cthulhu_state.capturingKeys = False
|
||||
self._capturedKey = []
|
||||
myiter = treeModel.get_iter_from_string(path)
|
||||
try:
|
||||
@@ -3037,12 +3037,12 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
if widget.get_label() == guilabels.KEYBOARD_LAYOUT_DESKTOP:
|
||||
self.prefsDict["keyboardLayout"] = \
|
||||
settings.GENERAL_KEYBOARD_LAYOUT_DESKTOP
|
||||
self.prefsDict["orcaModifierKeys"] = \
|
||||
self.prefsDict["cthulhuModifierKeys"] = \
|
||||
settings.DESKTOP_MODIFIER_KEYS
|
||||
else:
|
||||
self.prefsDict["keyboardLayout"] = \
|
||||
settings.GENERAL_KEYBOARD_LAYOUT_LAPTOP
|
||||
self.prefsDict["orcaModifierKeys"] = \
|
||||
self.prefsDict["cthulhuModifierKeys"] = \
|
||||
settings.LAPTOP_MODIFIER_KEYS
|
||||
|
||||
def pronunciationAddButtonClicked(self, widget):
|
||||
@@ -3298,7 +3298,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
_settingsManager.setStartingProfile(startingProfile)
|
||||
|
||||
self.writeUserPreferences()
|
||||
orca.loadUserSettings(self.script)
|
||||
cthulhu.loadUserSettings(self.script)
|
||||
braille.checkBrailleSetting()
|
||||
self._initSpeechState()
|
||||
self._populateKeyBindings()
|
||||
@@ -3320,7 +3320,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
debug.printMessage(debug.LEVEL_ALL, msg, True)
|
||||
|
||||
self.windowClosed(widget)
|
||||
self.get_widget("orcaSetupWindow").destroy()
|
||||
self.get_widget("cthulhuSetupWindow").destroy()
|
||||
|
||||
msg = "PREFERENCES DIALOG: Handling Cancel button click complete"
|
||||
debug.printMessage(debug.LEVEL_ALL, msg, True)
|
||||
@@ -3343,13 +3343,13 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
|
||||
self.applyButtonClicked(widget)
|
||||
self._cleanupSpeechServers()
|
||||
self.get_widget("orcaSetupWindow").destroy()
|
||||
self.get_widget("cthulhuSetupWindow").destroy()
|
||||
|
||||
msg = "PREFERENCES DIALOG: Handling OK button click complete"
|
||||
debug.printMessage(debug.LEVEL_ALL, msg, True)
|
||||
|
||||
def windowClosed(self, widget):
|
||||
"""Signal handler for the "closed" signal for the orcaSetupWindow
|
||||
"""Signal handler for the "closed" signal for the cthulhuSetupWindow
|
||||
GtkWindow widget. This is effectively the same as pressing the
|
||||
cancel button, except the window is destroyed for us.
|
||||
|
||||
@@ -3379,8 +3379,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
debug.printMessage(debug.LEVEL_ALL, msg, True)
|
||||
|
||||
def windowDestroyed(self, widget):
|
||||
"""Signal handler for the "destroyed" signal for the orcaSetupWindow
|
||||
GtkWindow widget. Reset orca_state.orcaOS to None, so that the
|
||||
"""Signal handler for the "destroyed" signal for the cthulhuSetupWindow
|
||||
GtkWindow widget. Reset cthulhu_state.cthulhuOS to None, so that the
|
||||
GUI can be rebuilt from the GtkBuilder file the next time the user
|
||||
wants to display the configuration GUI.
|
||||
|
||||
@@ -3400,7 +3400,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
self.keyBindView.hide()
|
||||
self.getTextAttributesView.hide()
|
||||
self.pronunciationView.hide()
|
||||
orca_state.orcaOS = None
|
||||
cthulhu_state.cthulhuOS = None
|
||||
|
||||
msg = "PREFERENCES DIALOG: Window destruction complete"
|
||||
debug.printMessage(debug.LEVEL_ALL, msg, True)
|
||||
@@ -3428,7 +3428,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
def showProfileGUI(self, widget):
|
||||
"""Show profile Dialog to add a new one"""
|
||||
|
||||
orca_gui_profile.showProfileUI(self)
|
||||
cthulhu_gui_profile.showProfileUI(self)
|
||||
|
||||
def saveProfile(self, profileToSaveLabel):
|
||||
"""Creates a new profile based on the name profileToSaveLabel and
|
||||
@@ -3556,7 +3556,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
|
||||
_settingsManager.setProfile(profile[1])
|
||||
self.prefsDict = _settingsManager.getGeneralSettings(profile[1])
|
||||
|
||||
orca.loadUserSettings(skipReloadMessage=True)
|
||||
cthulhu.loadUserSettings(skipReloadMessage=True)
|
||||
|
||||
self._initGUIState()
|
||||
|
||||
@@ -32,7 +32,7 @@ import sys
|
||||
from gi.repository import Gtk
|
||||
|
||||
from . import guilabels
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
|
||||
OS = None
|
||||
newProfile = None
|
||||
@@ -90,7 +90,7 @@ class OrcaProfileGUI(Gtk.Dialog):
|
||||
self.prefsDialog = prefsDialog
|
||||
self.profileEntry.set_text(self.profileString)
|
||||
|
||||
ts = orca_state.lastInputEvent.timestamp
|
||||
ts = cthulhu_state.lastInputEvent.timestamp
|
||||
if ts == 0:
|
||||
ts = Gtk.get_current_event_time()
|
||||
self.present_with_time(ts)
|
||||
@@ -17,7 +17,7 @@
|
||||
# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
|
||||
# Boston MA 02110-1301 USA.
|
||||
|
||||
"""Provides i18n support for orca using the gettext module. Tells
|
||||
"""Provides i18n support for cthulhu using the gettext module. Tells
|
||||
gettext where to find localized strings and creates an alias, _, that
|
||||
maps to the gettext.gettext function. This function will accept a
|
||||
string and return a localized string for that string.
|
||||
@@ -38,7 +38,7 @@ cgettext = gettext.gettext
|
||||
#
|
||||
localedir = "@localedir@".replace('${prefix}', '@prefix@')
|
||||
gettext.bindtextdomain ("@GETTEXT_PACKAGE@", localedir)
|
||||
gettext.textdomain("orca")
|
||||
gettext.textdomain("cthulhu")
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
@@ -58,7 +58,7 @@ def setModuleLocale(moduleName, newLocale=None):
|
||||
global _, ngettext, cgettext
|
||||
|
||||
try:
|
||||
translation = gettext.translation('orca', localedir, languages=[newLocale])
|
||||
translation = gettext.translation('cthulhu', localedir, languages=[newLocale])
|
||||
_ = translation.gettext
|
||||
ngettext = translation.ngettext
|
||||
cgettext = translation.gettext
|
||||
@@ -71,21 +71,21 @@ def setModuleLocale(moduleName, newLocale=None):
|
||||
importlib.reload(module)
|
||||
|
||||
def setLocaleForMessages(newLocale=None):
|
||||
modules = ['orca.tutorialgenerator', 'orca.messages']
|
||||
modules = ['cthulhu.tutorialgenerator', 'cthulhu.messages']
|
||||
for module in modules:
|
||||
setModuleLocale(module, newLocale)
|
||||
|
||||
def setLocaleForNames(newLocale=None):
|
||||
modules = ['orca.chnames', 'orca.keynames', 'orca.phonnames',
|
||||
'orca.text_attribute_names', 'orca.object_properties',
|
||||
'orca.cmdnames', 'orca.keybindings', 'orca.colornames',
|
||||
'orca.mathsymbols']
|
||||
modules = ['cthulhu.chnames', 'cthulhu.keynames', 'cthulhu.phonnames',
|
||||
'cthulhu.text_attribute_names', 'cthulhu.object_properties',
|
||||
'cthulhu.cmdnames', 'cthulhu.keybindings', 'cthulhu.colornames',
|
||||
'cthulhu.mathsymbols']
|
||||
for module in modules:
|
||||
setModuleLocale(module, newLocale)
|
||||
|
||||
def setLocaleForGUI(newLocale=None):
|
||||
modules = ['orca.orca_gtkbuilder',
|
||||
'orca.guilabels',
|
||||
'orca.brltablenames']
|
||||
modules = ['cthulhu.cthulhu_gtkbuilder',
|
||||
'cthulhu.guilabels',
|
||||
'cthulhu.brltablenames']
|
||||
for module in modules:
|
||||
setModuleLocale(module, newLocale)
|
||||
@@ -38,7 +38,7 @@ revision = "@REVISION@"
|
||||
#
|
||||
prefix = "@prefix@"
|
||||
|
||||
# The package name (should be "orca").
|
||||
# The package name (should be "cthulhu").
|
||||
#
|
||||
package = "@PACKAGE@"
|
||||
|
||||
@@ -72,7 +72,7 @@ searchQuery = None
|
||||
|
||||
# Handle to the Orca Preferences Glade GUI object.
|
||||
#
|
||||
orcaOS = None
|
||||
cthulhuOS = None
|
||||
|
||||
# Set to True if the last key opened the preferences dialog
|
||||
#
|
||||
@@ -140,7 +140,7 @@ debugEventQueue = False
|
||||
# specific, immediate issue. Trust me. :-) Disabling braille monitor in
|
||||
# this case is also strongly advised.
|
||||
#
|
||||
TRACE_MODULES = ['orca']
|
||||
TRACE_MODULES = ['cthulhu']
|
||||
|
||||
# Specific modules to ignore with traceit.
|
||||
#
|
||||
@@ -35,7 +35,7 @@ import time
|
||||
|
||||
from . import debug
|
||||
from . import input_event
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from . import script_manager
|
||||
from . import settings
|
||||
from .ax_object import AXObject
|
||||
@@ -80,7 +80,7 @@ class EventManager:
|
||||
'object:property-change:accessible-parent']
|
||||
self._parentsOfDefunctDescendants = []
|
||||
|
||||
orca_state.device = None
|
||||
cthulhu_state.device = None
|
||||
self.newKeyHandlingActive = False
|
||||
self.legacyKeyHandlingActive = False
|
||||
self.forceLegacyKeyHandling = False
|
||||
@@ -99,12 +99,12 @@ class EventManager:
|
||||
def activateNewKeyHandling(self):
|
||||
if not self.newKeyHandlingActive:
|
||||
try:
|
||||
orca_state.device = Atspi.Device.new()
|
||||
cthulhu_state.device = Atspi.Device.new()
|
||||
except Exception:
|
||||
self.forceLegacyKeyHandling = True
|
||||
self.activateLegacyKeyHandling()
|
||||
return
|
||||
orca_state.device.key_watcher = orca_state.device.add_key_watcher(
|
||||
cthulhu_state.device.key_watcher = cthulhu_state.device.add_key_watcher(
|
||||
self._processNewKeyboardEvent)
|
||||
self.newKeyHandlingActive = True
|
||||
|
||||
@@ -133,7 +133,7 @@ class EventManager:
|
||||
|
||||
def deactivateNewKeyHandling(self):
|
||||
if self.newKeyHandlingActive:
|
||||
orca_state.device = None
|
||||
cthulhu_state.device = None
|
||||
self.newKeyHandlingActive = False
|
||||
|
||||
def deactivateLegacyKeyHandling(self):
|
||||
@@ -228,7 +228,7 @@ class EventManager:
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
return True
|
||||
|
||||
script = orca_state.activeScript
|
||||
script = cthulhu_state.activeScript
|
||||
if event.type.startswith('object:children-changed') \
|
||||
or event.type.startswith('object:state-changed:sensitive'):
|
||||
if not script:
|
||||
@@ -360,17 +360,17 @@ class EventManager:
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
return True
|
||||
if event.type.endswith('remove'):
|
||||
if event.any_data == orca_state.locusOfFocus:
|
||||
if event.any_data == cthulhu_state.locusOfFocus:
|
||||
msg = 'EVENT MANAGER: Locus of focus is being destroyed'
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
return False
|
||||
|
||||
if AXObject.is_dead(orca_state.locusOfFocus):
|
||||
if AXObject.is_dead(cthulhu_state.locusOfFocus):
|
||||
msg = 'EVENT MANAGER: Locus of focus is dead.'
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
return False
|
||||
|
||||
tokens = ["EVENT MANAGER: Locus of focus:", orca_state.locusOfFocus]
|
||||
tokens = ["EVENT MANAGER: Locus of focus:", cthulhu_state.locusOfFocus]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
|
||||
defunct = AXObject.is_dead(event.any_data) or AXUtilities.is_defunct(event.any_data)
|
||||
@@ -599,7 +599,7 @@ class EventManager:
|
||||
self._enqueueCount -= 1
|
||||
|
||||
def _isNoFocus(self):
|
||||
if orca_state.locusOfFocus or orca_state.activeWindow or orca_state.activeScript:
|
||||
if cthulhu_state.locusOfFocus or cthulhu_state.activeWindow or cthulhu_state.activeScript:
|
||||
return False
|
||||
|
||||
msg = 'EVENT MANAGER: No focus'
|
||||
@@ -777,7 +777,7 @@ class EventManager:
|
||||
- event: an instance of BrailleEvent or a KeyboardEvent
|
||||
"""
|
||||
|
||||
if not orca_state.activeScript:
|
||||
if not cthulhu_state.activeScript:
|
||||
return
|
||||
|
||||
if not isinstance(event, input_event.BrailleEvent):
|
||||
@@ -791,7 +791,7 @@ class EventManager:
|
||||
debug.printMessage(debug.eventDebugLevel, msg, False)
|
||||
|
||||
try:
|
||||
orca_state.activeScript.processBrailleEvent(event)
|
||||
cthulhu_state.activeScript.processBrailleEvent(event)
|
||||
except Exception as error:
|
||||
tokens = ["EVENT MANAGER: Exception processing event:", error]
|
||||
debug.printTokens(debug.LEVEL_WARNING, tokens, True)
|
||||
@@ -858,7 +858,7 @@ class EventManager:
|
||||
if not script:
|
||||
return False, "There is no script for this event."
|
||||
|
||||
if script == orca_state.activeScript:
|
||||
if script == cthulhu_state.activeScript:
|
||||
return False, "The script for this event is already active."
|
||||
|
||||
if not script.isActivatableEvent(event):
|
||||
@@ -876,7 +876,7 @@ class EventManager:
|
||||
and event.detail1 and AXUtilities.is_frame(event.source)
|
||||
|
||||
if windowActivation:
|
||||
if event.source != orca_state.activeWindow:
|
||||
if event.source != cthulhu_state.activeWindow:
|
||||
return True, "Window activation"
|
||||
else:
|
||||
return False, "Window activation for already-active window"
|
||||
@@ -931,7 +931,7 @@ class EventManager:
|
||||
if event.type not in ignore:
|
||||
return False
|
||||
|
||||
return event.source != orca_state.locusOfFocus
|
||||
return event.source != cthulhu_state.locusOfFocus
|
||||
|
||||
def _inDeluge(self):
|
||||
size = self._eventQueue.qsize()
|
||||
@@ -967,7 +967,7 @@ class EventManager:
|
||||
if event.type not in ignore:
|
||||
return True
|
||||
|
||||
return event.source == orca_state.locusOfFocus
|
||||
return event.source == cthulhu_state.locusOfFocus
|
||||
|
||||
def _prioritizeDuringFlood(self, event):
|
||||
"""Returns true if this event should be prioritized during a flood."""
|
||||
@@ -1056,11 +1056,11 @@ class EventManager:
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
|
||||
if eType.startswith("window:deactivate") or eType.startswith("window:destroy") \
|
||||
and orca_state.activeWindow == event.source:
|
||||
and cthulhu_state.activeWindow == event.source:
|
||||
msg = 'EVENT MANAGER: Clearing active window, script, and locus of focus'
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
orca_state.locusOfFocus = None
|
||||
orca_state.activeWindow = None
|
||||
cthulhu_state.locusOfFocus = None
|
||||
cthulhu_state.activeWindow = None
|
||||
_scriptManager.setActiveScript(None, "Active window is dead or defunct")
|
||||
return
|
||||
|
||||
@@ -1119,12 +1119,12 @@ class EventManager:
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
debug.printException(debug.LEVEL_INFO)
|
||||
|
||||
tokens = ["EVENT MANAGER: locusOfFocus:", orca_state.locusOfFocus,
|
||||
"activeScript:", orca_state.activeScript]
|
||||
tokens = ["EVENT MANAGER: locusOfFocus:", cthulhu_state.locusOfFocus,
|
||||
"activeScript:", cthulhu_state.activeScript]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
|
||||
if debug.LEVEL_INFO >= debug.debugLevel and orca_state.activeScript:
|
||||
attributes = orca_state.activeScript.getTransferableAttributes()
|
||||
if debug.LEVEL_INFO >= debug.debugLevel and cthulhu_state.activeScript:
|
||||
attributes = cthulhu_state.activeScript.getTransferableAttributes()
|
||||
for key, value in attributes.items():
|
||||
msg = f"EVENT MANAGER: {key}: {value}"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
@@ -1143,12 +1143,12 @@ class EventManager:
|
||||
event.event_string = ""
|
||||
event.timestamp = time.time()
|
||||
|
||||
if not pressed and text == "Num_Lock" and "KP_Insert" in settings.orcaModifierKeys \
|
||||
and orca_state.activeScript is not None:
|
||||
orca_state.activeScript.refreshKeyGrabs()
|
||||
if not pressed and text == "Num_Lock" and "KP_Insert" in settings.cthulhuModifierKeys \
|
||||
and cthulhu_state.activeScript is not None:
|
||||
cthulhu_state.activeScript.refreshKeyGrabs()
|
||||
|
||||
if pressed:
|
||||
orca_state.openingDialog = (text == "space" \
|
||||
cthulhu_state.openingDialog = (text == "space" \
|
||||
and (state & ~(1 << Atspi.ModifierType.NUMLOCK)))
|
||||
|
||||
self._processKeyboardEvent(event)
|
||||
@@ -1161,8 +1161,8 @@ class EventManager:
|
||||
rv = keyboardEvent.process()
|
||||
|
||||
# Do any needed xmodmap crap. Hopefully this can die soon.
|
||||
from orca import orca
|
||||
orca.updateKeyMap(keyboardEvent)
|
||||
from cthulhu import cthulhu
|
||||
cthulhu.updateKeyMap(keyboardEvent)
|
||||
|
||||
return rv
|
||||
|
||||
@@ -1175,8 +1175,8 @@ class EventManager:
|
||||
Returns True if the command was consumed; otherwise False
|
||||
"""
|
||||
|
||||
if orca_state.activeScript \
|
||||
and orca_state.activeScript.consumesBrailleEvent(brailleEvent):
|
||||
if cthulhu_state.activeScript \
|
||||
and cthulhu_state.activeScript.consumesBrailleEvent(brailleEvent):
|
||||
self._enqueue(brailleEvent)
|
||||
return True
|
||||
else:
|
||||
@@ -33,7 +33,7 @@ import re
|
||||
|
||||
from . import debug
|
||||
from . import messages
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
|
||||
from .flat_review import Context
|
||||
|
||||
@@ -113,9 +113,9 @@ class SearchQuery:
|
||||
return string
|
||||
|
||||
def previousMatch(self):
|
||||
if not orca_state.searchQuery:
|
||||
if not cthulhu_state.searchQuery:
|
||||
return None
|
||||
return orca_state.searchQuery._match
|
||||
return cthulhu_state.searchQuery._match
|
||||
|
||||
def _saveContextLocation(self, context):
|
||||
self._contextLocation = [context.lineIndex,
|
||||
@@ -168,10 +168,10 @@ class SearchQuery:
|
||||
return False
|
||||
self._wrapped = True
|
||||
if self.searchBackwards:
|
||||
orca_state.activeScript.presentMessage(messages.WRAPPING_TO_BOTTOM)
|
||||
cthulhu_state.activeScript.presentMessage(messages.WRAPPING_TO_BOTTOM)
|
||||
moved = context.goPrevious(Context.LINE, Context.WRAP_ALL)
|
||||
else:
|
||||
orca_state.activeScript.presentMessage(messages.WRAPPING_TO_TOP)
|
||||
cthulhu_state.activeScript.presentMessage(messages.WRAPPING_TO_TOP)
|
||||
moved = context.goNext(Context.LINE, Context.WRAP_ALL)
|
||||
return moved
|
||||
|
||||
@@ -248,15 +248,15 @@ class SearchQuery:
|
||||
location = copy.copy(context)
|
||||
else:
|
||||
self._restoreContextLocation(context)
|
||||
orca_state.searchQuery = copy.copy(self)
|
||||
cthulhu_state.searchQuery = copy.copy(self)
|
||||
return location
|
||||
|
||||
def getLastQuery():
|
||||
"""Grabs the last search query performed from orca_state.
|
||||
"""Grabs the last search query performed from cthulhu_state.
|
||||
|
||||
Returns:
|
||||
- A copy of the last search query, if it exists
|
||||
"""
|
||||
|
||||
lastQuery = copy.copy(orca_state.searchQuery)
|
||||
lastQuery = copy.copy(cthulhu_state.searchQuery)
|
||||
return lastQuery
|
||||
@@ -34,8 +34,8 @@ import re
|
||||
|
||||
from . import braille
|
||||
from . import debug
|
||||
from . import orca
|
||||
from . import orca_state
|
||||
from . import cthulhu
|
||||
from . import cthulhu_state
|
||||
from . import settings
|
||||
from .ax_event_synthesizer import AXEventSynthesizer
|
||||
from .ax_object import AXObject
|
||||
@@ -326,9 +326,9 @@ class StateZone(Zone):
|
||||
return super().__getattribute__(attr)
|
||||
|
||||
if attr == "string":
|
||||
generator = orca_state.activeScript.speechGenerator
|
||||
generator = cthulhu_state.activeScript.speechGenerator
|
||||
else:
|
||||
generator = orca_state.activeScript.brailleGenerator
|
||||
generator = cthulhu_state.activeScript.brailleGenerator
|
||||
|
||||
result = generator.getStateIndicator(self.accessible, role=self.role)
|
||||
if result:
|
||||
@@ -350,9 +350,9 @@ class ValueZone(Zone):
|
||||
return super().__getattribute__(attr)
|
||||
|
||||
if attr == "string":
|
||||
generator = orca_state.activeScript.speechGenerator
|
||||
generator = cthulhu_state.activeScript.speechGenerator
|
||||
else:
|
||||
generator = orca_state.activeScript.brailleGenerator
|
||||
generator = cthulhu_state.activeScript.brailleGenerator
|
||||
|
||||
result = ""
|
||||
|
||||
@@ -490,7 +490,7 @@ class Context:
|
||||
self.targetCharInfo = None
|
||||
self.focusZone = None
|
||||
self.container = None
|
||||
self.focusObj = orca.getActiveModeAndObjectOfInterest()[1] or orca_state.locusOfFocus
|
||||
self.focusObj = cthulhu.getActiveModeAndObjectOfInterest()[1] or cthulhu_state.locusOfFocus
|
||||
self.topLevel = None
|
||||
self.bounds = 0, 0, 0, 0
|
||||
|
||||
@@ -40,8 +40,8 @@ from . import guilabels
|
||||
from . import input_event
|
||||
from . import keybindings
|
||||
from . import messages
|
||||
from . import orca
|
||||
from . import orca_state
|
||||
from . import cthulhu
|
||||
from . import cthulhu_state
|
||||
from . import settings_manager
|
||||
from . import settings
|
||||
|
||||
@@ -76,12 +76,12 @@ class FlatReviewPresenter:
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
|
||||
if self._restrict:
|
||||
mode, obj = orca.getActiveModeAndObjectOfInterest()
|
||||
mode, obj = cthulhu.getActiveModeAndObjectOfInterest()
|
||||
self._context = flat_review.Context(script, root=obj)
|
||||
else:
|
||||
self._context = flat_review.Context(script)
|
||||
|
||||
orca.emitRegionChanged(self._context.getCurrentAccessible(), mode=orca.FLAT_REVIEW)
|
||||
cthulhu.emitRegionChanged(self._context.getCurrentAccessible(), mode=cthulhu.FLAT_REVIEW)
|
||||
if script is not None:
|
||||
script.justEnteredFlatReviewMode = True
|
||||
script.targetCursorCell = script.getBrailleCursorCell()
|
||||
@@ -99,9 +99,9 @@ class FlatReviewPresenter:
|
||||
# for this condition and if it can find a zone whose ancestor is the object of
|
||||
# interest, it will set the current zone to the descendant, causing Orca to
|
||||
# present the text at the location of the object of interest.
|
||||
mode, obj = orca.getActiveModeAndObjectOfInterest()
|
||||
obj = obj or orca_state.locusOfFocus
|
||||
if mode != orca.FLAT_REVIEW and obj != self._context.getCurrentAccessible() \
|
||||
mode, obj = cthulhu.getActiveModeAndObjectOfInterest()
|
||||
obj = obj or cthulhu_state.locusOfFocus
|
||||
if mode != cthulhu.FLAT_REVIEW and obj != self._context.getCurrentAccessible() \
|
||||
and not self._restrict:
|
||||
tokens = ["FLAT REVIEW PRESENTER: Attempting to update location from",
|
||||
self._context.getCurrentAccessible(), "to", obj]
|
||||
@@ -109,7 +109,7 @@ class FlatReviewPresenter:
|
||||
self._context.setCurrentToZoneWithObject(obj)
|
||||
|
||||
# If we are restricting, and the current mode is not flat review, calculate a new context
|
||||
if self._restrict and mode != orca.FLAT_REVIEW:
|
||||
if self._restrict and mode != cthulhu.FLAT_REVIEW:
|
||||
msg = "FLAT REVIEW PRESENTER: Creating new restricted context."
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
self._context = flat_review.Context(script, obj)
|
||||
@@ -720,7 +720,7 @@ class FlatReviewPresenter:
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
|
||||
if script is None:
|
||||
script = orca_state.activeScript
|
||||
script = cthulhu_state.activeScript
|
||||
|
||||
self.get_or_create_context(script)
|
||||
if event is None:
|
||||
@@ -742,14 +742,14 @@ class FlatReviewPresenter:
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
|
||||
self._context = None
|
||||
orca.emitRegionChanged(orca_state.locusOfFocus, mode=orca.FOCUS_TRACKING)
|
||||
cthulhu.emitRegionChanged(cthulhu_state.locusOfFocus, mode=cthulhu.FOCUS_TRACKING)
|
||||
|
||||
if event is None or script is None:
|
||||
return
|
||||
|
||||
if _settingsManager.getSetting('speechVerbosityLevel') != settings.VERBOSITY_LEVEL_BRIEF:
|
||||
script.presentMessage(messages.FLAT_REVIEW_STOP)
|
||||
script.updateBraille(orca_state.locusOfFocus)
|
||||
script.updateBraille(cthulhu_state.locusOfFocus)
|
||||
|
||||
def toggle_flat_review_mode(self, script, event=None):
|
||||
"""Toggles between flat review mode and focus tracking mode."""
|
||||
@@ -945,7 +945,7 @@ class FlatReviewPresenter:
|
||||
if not isinstance(event, input_event.BrailleEvent):
|
||||
script.presentObject(self._context.getCurrentAccessible(), speechonly=True)
|
||||
|
||||
orca.emitRegionChanged(self._context.getCurrentAccessible(), mode=orca.FLAT_REVIEW)
|
||||
cthulhu.emitRegionChanged(self._context.getCurrentAccessible(), mode=cthulhu.FLAT_REVIEW)
|
||||
return True
|
||||
|
||||
def left_click_on_object(self, script, event=None):
|
||||
@@ -1069,7 +1069,7 @@ class FlatReviewPresenter:
|
||||
line_string = script.utilities.adjustForRepeats(line_string)
|
||||
script.speakMessage(line_string, voice)
|
||||
|
||||
orca.emitRegionChanged(self._context.getCurrentAccessible(), mode=orca.FLAT_REVIEW)
|
||||
cthulhu.emitRegionChanged(self._context.getCurrentAccessible(), mode=cthulhu.FLAT_REVIEW)
|
||||
script.updateBrailleReview()
|
||||
self._current_contents = line_string
|
||||
return True
|
||||
@@ -1099,7 +1099,7 @@ class FlatReviewPresenter:
|
||||
word_string = script.utilities.adjustForRepeats(word_string)
|
||||
script.speakMessage(word_string, voice)
|
||||
|
||||
orca.emitRegionChanged(self._context.getCurrentAccessible(), mode=orca.FLAT_REVIEW)
|
||||
cthulhu.emitRegionChanged(self._context.getCurrentAccessible(), mode=cthulhu.FLAT_REVIEW)
|
||||
script.updateBrailleReview(target_cursor_cell)
|
||||
self._current_contents = word_string
|
||||
return True
|
||||
@@ -1123,7 +1123,7 @@ class FlatReviewPresenter:
|
||||
else:
|
||||
script.speakCharacter(char_string)
|
||||
|
||||
orca.emitRegionChanged(self._context.getCurrentAccessible(), mode=orca.FLAT_REVIEW)
|
||||
cthulhu.emitRegionChanged(self._context.getCurrentAccessible(), mode=cthulhu.FLAT_REVIEW)
|
||||
script.updateBrailleReview()
|
||||
self._current_contents = char_string
|
||||
return True
|
||||
@@ -1172,7 +1172,7 @@ class FlatReviewContextGUI:
|
||||
"""Shows the dialog."""
|
||||
|
||||
self._gui.show_all()
|
||||
time_stamp = orca_state.lastInputEvent.timestamp
|
||||
time_stamp = cthulhu_state.lastInputEvent.timestamp
|
||||
if time_stamp == 0:
|
||||
time_stamp = Gtk.get_current_event_time()
|
||||
self._gui.present_with_time(time_stamp)
|
||||
@@ -29,7 +29,7 @@ __copyright__ = "Copyright (c) 2004-2009 Sun Microsystems Inc." \
|
||||
"Copyright (c) 2010-2013 The Orca Team"
|
||||
__license__ = "LGPL"
|
||||
|
||||
from .orca_i18n import _, C_, ngettext
|
||||
from .cthulhu_i18n import _, C_, ngettext
|
||||
|
||||
# Translators: This string appears on a button in a dialog. "Activating" the
|
||||
# selected item will perform the action that one would expect to occur if the
|
||||
@@ -40,8 +40,8 @@ from . import debug
|
||||
from . import keybindings
|
||||
from . import keynames
|
||||
from . import messages
|
||||
from . import orca
|
||||
from . import orca_state
|
||||
from . import cthulhu
|
||||
from . import cthulhu_state
|
||||
from . import script_manager
|
||||
from . import settings
|
||||
from .ax_object import AXObject
|
||||
@@ -87,7 +87,7 @@ class KeyboardEvent(InputEvent):
|
||||
stickyKeys = _getXkbStickyKeysState()
|
||||
|
||||
duplicateCount = 0
|
||||
orcaModifierPressed = False
|
||||
cthulhuModifierPressed = False
|
||||
|
||||
# Whether last press of the Orca modifier was alone
|
||||
lastOrcaModifierAlone = False
|
||||
@@ -95,10 +95,10 @@ class KeyboardEvent(InputEvent):
|
||||
# Whether the current press of the Orca modifier is alone
|
||||
currentOrcaModifierAlone = False
|
||||
currentOrcaModifierAloneTime = None
|
||||
# When the second orca press happened
|
||||
# When the second cthulhu press happened
|
||||
secondOrcaModifierTime = None
|
||||
# Sticky modifiers state, to be applied to the next keyboard event
|
||||
orcaStickyModifiers = 0
|
||||
cthulhuStickyModifiers = 0
|
||||
|
||||
TYPE_UNKNOWN = "unknown"
|
||||
TYPE_PRINTABLE = "printable"
|
||||
@@ -245,12 +245,12 @@ class KeyboardEvent(InputEvent):
|
||||
if self.event_string == "":
|
||||
self.event_string = self.keyval_name
|
||||
self.timestamp = event.timestamp
|
||||
self.is_duplicate = self in [orca_state.lastInputEvent,
|
||||
orca_state.lastNonModifierKeyEvent]
|
||||
self._script = orca_state.activeScript
|
||||
self.is_duplicate = self in [cthulhu_state.lastInputEvent,
|
||||
cthulhu_state.lastNonModifierKeyEvent]
|
||||
self._script = cthulhu_state.activeScript
|
||||
self._app = None
|
||||
self._window = orca_state.activeWindow
|
||||
self._obj = orca_state.locusOfFocus
|
||||
self._window = cthulhu_state.activeWindow
|
||||
self._obj = cthulhu_state.locusOfFocus
|
||||
self._handler = None
|
||||
self._consumer = None
|
||||
self._should_consume = None
|
||||
@@ -282,8 +282,8 @@ class KeyboardEvent(InputEvent):
|
||||
if self._script:
|
||||
self._app = self._script.app
|
||||
if not self._window:
|
||||
orca.setActiveWindow(self._script.utilities.activeWindow())
|
||||
self._window = orca_state.activeWindow
|
||||
cthulhu.setActiveWindow(self._script.utilities.activeWindow())
|
||||
self._window = cthulhu_state.activeWindow
|
||||
tokens = ["INPUT EVENT: Updated window and active window to", self._window]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
|
||||
@@ -312,10 +312,10 @@ class KeyboardEvent(InputEvent):
|
||||
doubleEvent.modifiers & keybindings.ORCA_MODIFIER_MASK:
|
||||
# this is the second event of a double-click, and sticky Orca
|
||||
# affected the first, so copy over the modifiers to the second
|
||||
KeyboardEvent.orcaStickyModifiers = doubleEvent.modifiers
|
||||
KeyboardEvent.cthulhuStickyModifiers = doubleEvent.modifiers
|
||||
|
||||
if not self.isOrcaModifier():
|
||||
if KeyboardEvent.orcaModifierPressed:
|
||||
if KeyboardEvent.cthulhuModifierPressed:
|
||||
KeyboardEvent.currentOrcaModifierAlone = False
|
||||
KeyboardEvent.currentOrcaModifierAloneTime = None
|
||||
else:
|
||||
@@ -338,13 +338,13 @@ class KeyboardEvent(InputEvent):
|
||||
KeyboardEvent.secondOrcaModifierTime = now
|
||||
if (KeyboardEvent.secondOrcaModifierTime <
|
||||
KeyboardEvent.lastOrcaModifierAloneTime + 0.5):
|
||||
# double-orca, let the real action happen
|
||||
# double-cthulhu, let the real action happen
|
||||
self._bypassOrca = True
|
||||
if not _isPressed:
|
||||
KeyboardEvent.lastOrcaModifierAlone = False
|
||||
KeyboardEvent.lastOrcaModifierAloneTime = False
|
||||
else:
|
||||
KeyboardEvent.orcaModifierPressed = _isPressed
|
||||
KeyboardEvent.cthulhuModifierPressed = _isPressed
|
||||
if _isPressed:
|
||||
KeyboardEvent.currentOrcaModifierAlone = True
|
||||
KeyboardEvent.currentOrcaModifierAloneTime = now
|
||||
@@ -391,29 +391,29 @@ class KeyboardEvent(InputEvent):
|
||||
if not self.isModifierKey():
|
||||
self.setClickCount()
|
||||
|
||||
if orca_state.bypassNextCommand and _isPressed:
|
||||
KeyboardEvent.orcaModifierPressed = False
|
||||
if cthulhu_state.bypassNextCommand and _isPressed:
|
||||
KeyboardEvent.cthulhuModifierPressed = False
|
||||
|
||||
if KeyboardEvent.orcaModifierPressed:
|
||||
if KeyboardEvent.cthulhuModifierPressed:
|
||||
self.modifiers |= keybindings.ORCA_MODIFIER_MASK
|
||||
|
||||
if KeyboardEvent.stickyKeys:
|
||||
# apply all recorded sticky modifiers
|
||||
self.modifiers |= KeyboardEvent.orcaStickyModifiers
|
||||
self.modifiers |= KeyboardEvent.cthulhuStickyModifiers
|
||||
if self.isModifierKey():
|
||||
# add this modifier to the sticky ones
|
||||
KeyboardEvent.orcaStickyModifiers |= self.modifiers
|
||||
KeyboardEvent.cthulhuStickyModifiers |= self.modifiers
|
||||
else:
|
||||
# Non-modifier key, so clear the sticky modifiers. If the user
|
||||
# actually double-presses that key, the modifiers of this event
|
||||
# will be copied over to the second event, see earlier in this
|
||||
# function.
|
||||
KeyboardEvent.orcaStickyModifiers = 0
|
||||
KeyboardEvent.cthulhuStickyModifiers = 0
|
||||
|
||||
self._should_consume, self._consume_reason = self.shouldConsume()
|
||||
|
||||
def _getDoubleClickCandidate(self):
|
||||
lastEvent = orca_state.lastNonModifierKeyEvent
|
||||
lastEvent = cthulhu_state.lastNonModifierKeyEvent
|
||||
if isinstance(lastEvent, KeyboardEvent) \
|
||||
and lastEvent.event_string == self.event_string \
|
||||
and self.time - lastEvent.time <= settings.doubleClickTimeout:
|
||||
@@ -488,7 +488,7 @@ class KeyboardEvent(InputEvent):
|
||||
return True
|
||||
|
||||
def _isReleaseForLastNonModifierKeyEvent(self):
|
||||
last = orca_state.lastNonModifierKeyEvent
|
||||
last = cthulhu_state.lastNonModifierKeyEvent
|
||||
if not last:
|
||||
return False
|
||||
|
||||
@@ -575,8 +575,8 @@ class KeyboardEvent(InputEvent):
|
||||
if self.event_string not in lockingKeys:
|
||||
return False
|
||||
|
||||
if not orca_state.bypassNextCommand and not self._bypassOrca:
|
||||
return self.event_string not in settings.orcaModifierKeys
|
||||
if not cthulhu_state.bypassNextCommand and not self._bypassOrca:
|
||||
return self.event_string not in settings.cthulhuModifierKeys
|
||||
|
||||
return True
|
||||
|
||||
@@ -608,14 +608,14 @@ class KeyboardEvent(InputEvent):
|
||||
def isOrcaModifier(self, checkBypassMode=True):
|
||||
"""Return True if this is the Orca modifier key."""
|
||||
|
||||
if checkBypassMode and orca_state.bypassNextCommand:
|
||||
if checkBypassMode and cthulhu_state.bypassNextCommand:
|
||||
return False
|
||||
|
||||
if self.event_string in settings.orcaModifierKeys:
|
||||
if self.event_string in settings.cthulhuModifierKeys:
|
||||
return True
|
||||
|
||||
if self.keyval_name == "KP_0" \
|
||||
and "KP_Insert" in settings.orcaModifierKeys \
|
||||
and "KP_Insert" in settings.cthulhuModifierKeys \
|
||||
and self.modifiers & keybindings.SHIFT_MODIFIER_MASK:
|
||||
return True
|
||||
|
||||
@@ -624,7 +624,7 @@ class KeyboardEvent(InputEvent):
|
||||
def isOrcaModified(self):
|
||||
"""Return True if this key is Orca modified."""
|
||||
|
||||
if orca_state.bypassNextCommand:
|
||||
if cthulhu_state.bypassNextCommand:
|
||||
return False
|
||||
|
||||
return self.modifiers & keybindings.ORCA_MODIFIER_MASK
|
||||
@@ -685,7 +685,7 @@ class KeyboardEvent(InputEvent):
|
||||
if not self.isPrintableKey():
|
||||
return False
|
||||
|
||||
script = orca_state.activeScript
|
||||
script = cthulhu_state.activeScript
|
||||
return script and script.utilities.willEchoCharacter(self)
|
||||
|
||||
def getLockingState(self):
|
||||
@@ -766,10 +766,10 @@ class KeyboardEvent(InputEvent):
|
||||
if self.is_duplicate:
|
||||
return False, 'Is duplicate'
|
||||
|
||||
if orca_state.capturingKeys:
|
||||
if cthulhu_state.capturingKeys:
|
||||
return False, 'Capturing keys'
|
||||
|
||||
if orca_state.bypassNextCommand:
|
||||
if cthulhu_state.bypassNextCommand:
|
||||
return False, 'Bypass next command'
|
||||
|
||||
self._handler = self._getUserHandler() \
|
||||
@@ -853,8 +853,8 @@ class KeyboardEvent(InputEvent):
|
||||
tokens = ["CONSUMED:", self._did_consume, self._result_reason]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
|
||||
if debug.LEVEL_INFO >= debug.debugLevel and orca_state.activeScript:
|
||||
attributes = orca_state.activeScript.getTransferableAttributes()
|
||||
if debug.LEVEL_INFO >= debug.debugLevel and cthulhu_state.activeScript:
|
||||
attributes = cthulhu_state.activeScript.getTransferableAttributes()
|
||||
for key, value in attributes.items():
|
||||
msg = f"INPUT EVENT: {key}: {value}"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
@@ -877,11 +877,11 @@ class KeyboardEvent(InputEvent):
|
||||
self._lock_mod()
|
||||
self.keyType = KeyboardEvent.TYPE_LOCKING
|
||||
self._present()
|
||||
return False, 'Bypassed orca modifier'
|
||||
return False, 'Bypassed cthulhu modifier'
|
||||
|
||||
orca_state.lastInputEvent = self
|
||||
cthulhu_state.lastInputEvent = self
|
||||
if not self.isModifierKey():
|
||||
orca_state.lastNonModifierKeyEvent = self
|
||||
cthulhu_state.lastNonModifierKeyEvent = self
|
||||
|
||||
if not self._script:
|
||||
return False, 'No active script'
|
||||
@@ -894,15 +894,15 @@ class KeyboardEvent(InputEvent):
|
||||
if not self.isPressedKey():
|
||||
return self._should_consume, 'Consumed based on handler'
|
||||
|
||||
if orca_state.capturingKeys:
|
||||
if cthulhu_state.capturingKeys:
|
||||
return False, 'Capturing keys'
|
||||
|
||||
if self.isOrcaModifier():
|
||||
return True, 'Orca modifier'
|
||||
|
||||
if orca_state.bypassNextCommand:
|
||||
if cthulhu_state.bypassNextCommand:
|
||||
if not self.isModifierKey():
|
||||
orca_state.bypassNextCommand = False
|
||||
cthulhu_state.bypassNextCommand = False
|
||||
self._script.addKeyGrabs()
|
||||
return False, 'Bypass next command'
|
||||
|
||||
@@ -1000,8 +1000,8 @@ class MouseButtonEvent(InputEvent):
|
||||
self.y = event.detail2
|
||||
self.pressed = event.type.endswith('p')
|
||||
self.button = event.type[len("mouse:button:"):-1]
|
||||
self._script = orca_state.activeScript
|
||||
self.window = orca_state.activeWindow
|
||||
self._script = cthulhu_state.activeScript
|
||||
self.window = cthulhu_state.activeWindow
|
||||
self.obj = None
|
||||
|
||||
if self.pressed:
|
||||
@@ -1040,7 +1040,7 @@ class MouseButtonEvent(InputEvent):
|
||||
if not self.pressed:
|
||||
return
|
||||
|
||||
lastInputEvent = orca_state.lastInputEvent
|
||||
lastInputEvent = cthulhu_state.lastInputEvent
|
||||
if not isinstance(lastInputEvent, MouseButtonEvent):
|
||||
self._clickCount = 1
|
||||
return
|
||||
@@ -36,9 +36,9 @@ import functools
|
||||
|
||||
from . import debug
|
||||
from . import settings
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
|
||||
from .orca_i18n import _
|
||||
from .cthulhu_i18n import _
|
||||
|
||||
_keysymsCache = {}
|
||||
_keycodeCache = {}
|
||||
@@ -281,7 +281,7 @@ class KeyBinding:
|
||||
self.keycode = getKeycode(self.keysymstring)
|
||||
|
||||
if self.modifiers & ORCA_MODIFIER_MASK:
|
||||
device = orca_state.device
|
||||
device = cthulhu_state.device
|
||||
if device is None:
|
||||
return ret
|
||||
modList = []
|
||||
@@ -289,7 +289,7 @@ class KeyBinding:
|
||||
numLockMod = device.get_modifier(getKeycode("Num_Lock"))
|
||||
lockedMods = device.get_locked_modifiers()
|
||||
numLockOn = lockedMods & numLockMod
|
||||
for key in settings.orcaModifierKeys:
|
||||
for key in settings.cthulhuModifierKeys:
|
||||
keycode = getKeycode(key)
|
||||
if keycode == 0 and key == "Shift_Lock":
|
||||
keycode = getKeycode("Caps_Lock")
|
||||
@@ -28,8 +28,8 @@ __license__ = "LGPL"
|
||||
|
||||
from . import chnames
|
||||
|
||||
from .orca_i18n import _
|
||||
from .orca_i18n import C_
|
||||
from .cthulhu_i18n import _
|
||||
from .cthulhu_i18n import C_
|
||||
|
||||
# __keynames is a dictionary where the keys represent a UTF-8
|
||||
# string for a keyboard key and the values represent the common
|
||||
@@ -43,7 +43,7 @@ from . import guilabels
|
||||
from . import input_event
|
||||
from . import keybindings
|
||||
from . import messages
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from . import settings
|
||||
from . import settings_manager
|
||||
from .ax_object import AXObject
|
||||
@@ -108,17 +108,17 @@ class LearnModePresenter:
|
||||
return True
|
||||
|
||||
if script is None:
|
||||
script = orca_state.activeScript
|
||||
script = cthulhu_state.activeScript
|
||||
|
||||
if script is not None:
|
||||
script.presentMessage(messages.VERSION)
|
||||
script.speakMessage(messages.LEARN_MODE_START_SPEECH)
|
||||
script.displayBrailleMessage(messages.LEARN_MODE_START_BRAILLE)
|
||||
|
||||
if orca_state.device is not None:
|
||||
if cthulhu_state.device is not None:
|
||||
msg = "LEARN MODE PRESENTER: Grabbing keyboard"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
Atspi.Device.grab_keyboard(orca_state.device)
|
||||
Atspi.Device.grab_keyboard(cthulhu_state.device)
|
||||
|
||||
msg = "LEARN MODE PRESENTER: Is now active"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
@@ -134,15 +134,15 @@ class LearnModePresenter:
|
||||
return True
|
||||
|
||||
if script is None:
|
||||
script = orca_state.activeScript
|
||||
script = cthulhu_state.activeScript
|
||||
|
||||
if script is not None:
|
||||
script.presentMessage(messages.LEARN_MODE_STOP)
|
||||
|
||||
if orca_state.device is not None:
|
||||
if cthulhu_state.device is not None:
|
||||
msg = "LEARN MODE PRESENTER: Ungrabbing keyboard"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
Atspi.Device.ungrab_keyboard(orca_state.device)
|
||||
Atspi.Device.ungrab_keyboard(cthulhu_state.device)
|
||||
|
||||
msg = "LEARN MODE PRESENTER: Is now inactive"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
@@ -158,21 +158,21 @@ class LearnModePresenter:
|
||||
if not isinstance(event, input_event.KeyboardEvent):
|
||||
return False
|
||||
|
||||
orca_state.activeScript.speakKeyEvent(event)
|
||||
cthulhu_state.activeScript.speakKeyEvent(event)
|
||||
if event.isPrintableKey() and event.getClickCount() == 2 \
|
||||
and event.getHandler() is None:
|
||||
orca_state.activeScript.phoneticSpellCurrentItem(event.event_string)
|
||||
cthulhu_state.activeScript.phoneticSpellCurrentItem(event.event_string)
|
||||
|
||||
if event.event_string == "Escape":
|
||||
self.quit(script=None, event=event)
|
||||
return True
|
||||
|
||||
if event.event_string == "F1" and not event.modifiers:
|
||||
self.show_help(orca_state.activeScript, event)
|
||||
self.show_help(cthulhu_state.activeScript, event)
|
||||
return True
|
||||
|
||||
if event.event_string in ["F2", "F3"] and not event.modifiers:
|
||||
self.list_orca_shortcuts(orca_state.activeScript, event)
|
||||
self.list_cthulhu_shortcuts(cthulhu_state.activeScript, event)
|
||||
return True
|
||||
|
||||
self.present_command(event)
|
||||
@@ -189,15 +189,15 @@ class LearnModePresenter:
|
||||
return True
|
||||
|
||||
if handler.learnModeEnabled and handler.description:
|
||||
orca_state.activeScript.presentMessage(handler.description)
|
||||
cthulhu_state.activeScript.presentMessage(handler.description)
|
||||
|
||||
return True
|
||||
|
||||
def list_orca_shortcuts(self, script, event=None):
|
||||
def list_cthulhu_shortcuts(self, script, event=None):
|
||||
"""Shows a simple gui listing Orca's bound commands."""
|
||||
|
||||
if event is None:
|
||||
event = orca_state.lastNonModifierKeyEvent
|
||||
event = cthulhu_state.lastNonModifierKeyEvent
|
||||
|
||||
layout = settings_manager.getManager().getSetting("keyboardLayout")
|
||||
is_desktop = layout == settings.GENERAL_KEYBOARD_LAYOUT_DESKTOP
|
||||
@@ -272,7 +272,7 @@ class LearnModePresenter:
|
||||
"""Displays Orca's documentation."""
|
||||
|
||||
self.quit(script, event)
|
||||
uri = "help:orca"
|
||||
uri = "help:cthulhu"
|
||||
if page:
|
||||
uri += f"/{page}"
|
||||
Gtk.show_uri(Gdk.Screen.get_default(), uri, Gtk.get_current_event_time())
|
||||
@@ -340,7 +340,7 @@ class CommandListGUI:
|
||||
"""Shows the dialog."""
|
||||
|
||||
self._gui.show_all()
|
||||
time_stamp = orca_state.lastInputEvent.timestamp
|
||||
time_stamp = cthulhu_state.lastInputEvent.timestamp
|
||||
if time_stamp == 0:
|
||||
time_stamp = Gtk.get_current_event_time()
|
||||
self._gui.present_with_time(time_stamp)
|
||||
@@ -13,7 +13,7 @@ from . import debug
|
||||
from . import keybindings
|
||||
from . import messages
|
||||
from . import input_event
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from . import settings_manager
|
||||
from .ax_collection import AXCollection
|
||||
from .ax_object import AXObject
|
||||
@@ -287,7 +287,7 @@ class LiveRegionManager:
|
||||
self._script.presentMessage(messages.LIVE_REGIONS_OFF)
|
||||
return
|
||||
|
||||
obj = orca_state.locusOfFocus
|
||||
obj = cthulhu_state.locusOfFocus
|
||||
objectid = self._getObjectId(obj)
|
||||
uri = self._script.bookmarks.getURIKey()
|
||||
|
||||
@@ -28,7 +28,7 @@ __license__ = "LGPL"
|
||||
import re
|
||||
import unicodedata
|
||||
|
||||
from .orca_i18n import C_
|
||||
from .cthulhu_i18n import C_
|
||||
|
||||
fallbackOnUnicodeData = False
|
||||
|
||||
@@ -30,8 +30,8 @@ __copyright__ = "Copyright (c) 2004-2009 Sun Microsystems Inc." \
|
||||
"Copyright (c) 2010-2013 The Orca Team"
|
||||
__license__ = "LGPL"
|
||||
|
||||
from .orca_i18n import _, C_, ngettext
|
||||
from .orca_platform import version
|
||||
from .cthulhu_i18n import _, C_, ngettext
|
||||
from .cthulhu_platform import version
|
||||
|
||||
# Translators: Sometimes when we attempt to get the name of an accessible
|
||||
# software application, we fail because the app or one of its elements is
|
||||
@@ -252,7 +252,7 @@ CLI_SETTINGS_MANAGER_ERROR = \
|
||||
# Orca, but Orca is already running.
|
||||
CLI_OTHER_ORCAS_ERROR = \
|
||||
_('Another screen reader process is already running for this ' \
|
||||
'session.\nRun “orca --replace” to replace that ' \
|
||||
'session.\nRun “cthulhu --replace” to replace that ' \
|
||||
'process with a new one.')
|
||||
|
||||
# Translators: This string indicates to the user what should be provided when
|
||||
@@ -309,7 +309,7 @@ CLI_GUI_SETUP = _("Set up user preferences (GUI version)")
|
||||
|
||||
# Translators: This text is the description displayed when Orca is launched
|
||||
# from the command line and the help text is displayed.
|
||||
CLI_EPILOG = _("Report bugs to orca-list@gnome.org.")
|
||||
CLI_EPILOG = _("Report bugs to cthulhu-list@gnome.org.")
|
||||
|
||||
# Translators: Orca normal speaks the text which was just deleted from a
|
||||
# document via command. Depending on the circumstances, that might be a
|
||||
@@ -47,8 +47,8 @@ from . import debug
|
||||
from . import keybindings
|
||||
from . import input_event
|
||||
from . import messages
|
||||
from . import orca
|
||||
from . import orca_state
|
||||
from . import cthulhu
|
||||
from . import cthulhu_state
|
||||
from . import script_manager
|
||||
from . import settings_manager
|
||||
from .ax_object import AXObject
|
||||
@@ -148,7 +148,7 @@ class _StringContext:
|
||||
voice = self._script.speechGenerator.voice(obj=self._obj, string=self._string)
|
||||
string = self._script.utilities.adjustForRepeats(self._string)
|
||||
|
||||
orca.emitRegionChanged(self._obj, self._start, self._end, orca.MOUSE_REVIEW)
|
||||
cthulhu.emitRegionChanged(self._obj, self._start, self._end, cthulhu.MOUSE_REVIEW)
|
||||
self._script.speakMessage(string, voice=voice, interrupt=False)
|
||||
self._script.displayBrailleMessage(self._string, -1)
|
||||
return True
|
||||
@@ -316,7 +316,7 @@ class _ItemContext:
|
||||
|
||||
if self._obj and self._obj != prior._obj and not self._isInlineChild(prior):
|
||||
priorObj = prior._obj or self._getContainer()
|
||||
orca.emitRegionChanged(self._obj, mode=orca.MOUSE_REVIEW)
|
||||
cthulhu.emitRegionChanged(self._obj, mode=cthulhu.MOUSE_REVIEW)
|
||||
self._script.presentObject(self._obj, priorObj=priorObj, inMouseReview=True)
|
||||
if self._string.getString() == AXObject.get_name(self._obj):
|
||||
return True
|
||||
@@ -422,7 +422,7 @@ class MouseReviewer:
|
||||
|
||||
# Set up the initial object as the one with the focus to avoid
|
||||
# presenting irrelevant info the first time.
|
||||
obj = orca_state.locusOfFocus
|
||||
obj = cthulhu_state.locusOfFocus
|
||||
script = None
|
||||
frame = None
|
||||
if obj:
|
||||
@@ -500,8 +500,8 @@ class MouseReviewer:
|
||||
self.activate()
|
||||
msg = messages.MOUSE_REVIEW_ENABLED
|
||||
|
||||
if orca_state.activeScript:
|
||||
orca_state.activeScript.presentMessage(msg)
|
||||
if cthulhu_state.activeScript:
|
||||
cthulhu_state.activeScript.presentMessage(msg)
|
||||
|
||||
def _update_workspace_windows(self):
|
||||
self._windows = [w for w in self._all_windows
|
||||
@@ -599,12 +599,12 @@ class MouseReviewer:
|
||||
if not script:
|
||||
return
|
||||
|
||||
if AXObject.is_dead(orca_state.locusOfFocus):
|
||||
if AXObject.is_dead(cthulhu_state.locusOfFocus):
|
||||
menu = None
|
||||
elif AXUtilities.is_menu(orca_state.locusOfFocus):
|
||||
menu = orca_state.locusOfFocus
|
||||
elif AXUtilities.is_menu(cthulhu_state.locusOfFocus):
|
||||
menu = cthulhu_state.locusOfFocus
|
||||
else:
|
||||
menu = AXObject.find_ancestor(orca_state.locusOfFocus, AXUtilities.is_menu)
|
||||
menu = AXObject.find_ancestor(cthulhu_state.locusOfFocus, AXUtilities.is_menu)
|
||||
|
||||
screen, nowX, nowY = self._pointer.get_position()
|
||||
if (pX, pY) != (nowX, nowY):
|
||||
@@ -43,7 +43,7 @@ from . import guilabels
|
||||
from . import input_event
|
||||
from . import keybindings
|
||||
from . import messages
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
|
||||
class NotificationPresenter:
|
||||
"""Provides access to the notification history."""
|
||||
@@ -334,7 +334,7 @@ class NotificationListGUI:
|
||||
"""Shows the notifications list dialog."""
|
||||
|
||||
self._gui.show_all()
|
||||
time_stamp = orca_state.lastInputEvent.timestamp
|
||||
time_stamp = cthulhu_state.lastInputEvent.timestamp
|
||||
if time_stamp == 0:
|
||||
time_stamp = Gtk.get_current_event_time()
|
||||
self._gui.present_with_time(time_stamp)
|
||||
@@ -31,8 +31,8 @@ from . import debug
|
||||
from . import input_event
|
||||
from . import keybindings
|
||||
from . import messages
|
||||
from . import orca
|
||||
from . import orca_state
|
||||
from . import cthulhu
|
||||
from . import cthulhu_state
|
||||
from .ax_event_synthesizer import AXEventSynthesizer
|
||||
from .ax_object import AXObject
|
||||
from .ax_utilities import AXUtilities
|
||||
@@ -216,9 +216,9 @@ class ObjectNavigator:
|
||||
def update(self):
|
||||
"""Updates the navigator focus to Orca's object of interest."""
|
||||
|
||||
mode, region = orca.getActiveModeAndObjectOfInterest()
|
||||
obj = region or orca_state.locusOfFocus
|
||||
if self._last_locus_of_focus == obj or (region is None and mode == orca.FLAT_REVIEW):
|
||||
mode, region = cthulhu.getActiveModeAndObjectOfInterest()
|
||||
obj = region or cthulhu_state.locusOfFocus
|
||||
if self._last_locus_of_focus == obj or (region is None and mode == cthulhu.FLAT_REVIEW):
|
||||
return
|
||||
|
||||
self._navigator_focus = obj
|
||||
@@ -229,7 +229,7 @@ class ObjectNavigator:
|
||||
|
||||
tokens = ["OBJECT NAVIGATOR: Presenting", self._navigator_focus]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
orca.emitRegionChanged(self._navigator_focus, mode=orca.OBJECT_NAVIGATOR)
|
||||
cthulhu.emitRegionChanged(self._navigator_focus, mode=cthulhu.OBJECT_NAVIGATOR)
|
||||
script.presentObject(self._navigator_focus, priorObj=self._last_navigator_focus)
|
||||
|
||||
def up(self, script, event=None):
|
||||
@@ -29,7 +29,7 @@ __copyright__ = "Copyright (c) 2004-2009 Sun Microsystems Inc." \
|
||||
"Copyright (c) 2010-2013 The Orca Team"
|
||||
__license__ = "LGPL"
|
||||
|
||||
from .orca_i18n import _, C_
|
||||
from .cthulhu_i18n import _, C_
|
||||
|
||||
# Translators: this is the action name for the 'toggle' action. It must be the
|
||||
# same string used in the *.po file for gail.
|
||||
@@ -26,7 +26,7 @@ __date__ = "$Date$"
|
||||
__copyright__ = "Copyright (c) 2006-2008 Sun Microsystems Inc."
|
||||
__license__ = "LGPL"
|
||||
|
||||
from .orca_i18n import _
|
||||
from .cthulhu_i18n import _
|
||||
|
||||
# Translators: this is a structure to assist in the generation of
|
||||
# spoken military-style spelling. For example, 'abc' becomes 'alpha
|
||||
@@ -57,7 +57,7 @@ from . import learn_mode_presenter
|
||||
from . import mouse_review
|
||||
from . import notification_presenter
|
||||
from . import object_navigator
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from . import script_manager
|
||||
from . import script_utilities
|
||||
from . import settings
|
||||
@@ -342,7 +342,7 @@ class Script:
|
||||
|
||||
# Check to see if we really want to process this event.
|
||||
#
|
||||
processEvent = (orca_state.activeScript == self \
|
||||
processEvent = (cthulhu_state.activeScript == self \
|
||||
or self.presentIfInactive)
|
||||
if role == Atspi.Role.PROGRESS_BAR \
|
||||
and not processEvent \
|
||||
@@ -564,7 +564,7 @@ class Script:
|
||||
information to the user.
|
||||
|
||||
NOTE: scripts should not call this method directly. Instead,
|
||||
a script should call orca.setLocusOfFocus, which will eventually
|
||||
a script should call cthulhu.setLocusOfFocus, which will eventually
|
||||
result in this method being called.
|
||||
|
||||
Arguments:
|
||||
@@ -27,7 +27,7 @@ __license__ = "LGPL"
|
||||
import importlib
|
||||
|
||||
from . import debug
|
||||
from . import orca_state
|
||||
from . import cthulhu_state
|
||||
from .ax_object import AXObject
|
||||
from .ax_utilities import AXUtilities
|
||||
from .scripts import apps, toolkits
|
||||
@@ -43,10 +43,10 @@ class ScriptManager:
|
||||
self._toolkitModules = toolkits.__all__
|
||||
self._defaultScript = None
|
||||
self._scriptPackages = \
|
||||
["orca-scripts",
|
||||
"orca.scripts",
|
||||
"orca.scripts.apps",
|
||||
"orca.scripts.toolkits"]
|
||||
["cthulhu-scripts",
|
||||
"cthulhu.scripts",
|
||||
"cthulhu.scripts.apps",
|
||||
"cthulhu.scripts.toolkits"]
|
||||
self._appNames = \
|
||||
{'Icedove': 'Thunderbird',
|
||||
'Nereid': 'Banshee',
|
||||
@@ -218,12 +218,12 @@ class ScriptManager:
|
||||
return script
|
||||
|
||||
def getScriptForMouseButtonEvent(self, event):
|
||||
isActive = AXUtilities.is_active(orca_state.activeWindow)
|
||||
tokens = ["SCRIPT MANAGER:", orca_state.activeWindow, "is active:", isActive]
|
||||
isActive = AXUtilities.is_active(cthulhu_state.activeWindow)
|
||||
tokens = ["SCRIPT MANAGER:", cthulhu_state.activeWindow, "is active:", isActive]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
|
||||
if isActive and orca_state.activeScript:
|
||||
return orca_state.activeScript
|
||||
if isActive and cthulhu_state.activeScript:
|
||||
return cthulhu_state.activeScript
|
||||
|
||||
script = self.getDefaultScript()
|
||||
activeWindow = script.utilities.activeWindow()
|
||||
@@ -302,13 +302,13 @@ class ScriptManager:
|
||||
- newScript: the new script to be made active.
|
||||
"""
|
||||
|
||||
if orca_state.activeScript == newScript:
|
||||
if cthulhu_state.activeScript == newScript:
|
||||
return
|
||||
|
||||
if orca_state.activeScript:
|
||||
orca_state.activeScript.deactivate()
|
||||
if cthulhu_state.activeScript:
|
||||
cthulhu_state.activeScript.deactivate()
|
||||
|
||||
orca_state.activeScript = newScript
|
||||
cthulhu_state.activeScript = newScript
|
||||
if not newScript:
|
||||
return
|
||||
|
||||
@@ -50,8 +50,8 @@ from . import keybindings
|
||||
from . import input_event
|
||||
from . import mathsymbols
|
||||
from . import messages
|
||||
from . import orca
|
||||
from . import orca_state
|
||||
from . import cthulhu
|
||||
from . import cthulhu_state
|
||||
from . import object_properties
|
||||
from . import pronunciation_dict
|
||||
from . import settings
|
||||
@@ -493,8 +493,8 @@ class Utilities:
|
||||
obj, offset = self.getCaretContext()
|
||||
|
||||
document = AXObject.find_ancestor(obj, AXUtilities.is_document)
|
||||
if not document and AXUtilities.is_document(orca_state.locusOfFocus):
|
||||
return orca_state.locusOfFocus
|
||||
if not document and AXUtilities.is_document(cthulhu_state.locusOfFocus):
|
||||
return cthulhu_state.locusOfFocus
|
||||
|
||||
return document
|
||||
|
||||
@@ -508,7 +508,7 @@ class Utilities:
|
||||
|
||||
results = [None, None]
|
||||
|
||||
obj = obj or orca_state.locusOfFocus
|
||||
obj = obj or cthulhu_state.locusOfFocus
|
||||
if not obj:
|
||||
msg = "SCRIPT UTILITIES: frameAndDialog() called without valid object"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
@@ -544,7 +544,7 @@ class Utilities:
|
||||
return results
|
||||
|
||||
def presentEventFromNonShowingObject(self, event):
|
||||
if event.source == orca_state.locusOfFocus:
|
||||
if event.source == cthulhu_state.locusOfFocus:
|
||||
return True
|
||||
|
||||
return False
|
||||
@@ -562,7 +562,7 @@ class Utilities:
|
||||
"""
|
||||
|
||||
return AXUtilities.is_combo_box(obj) \
|
||||
and not self.isSameObject(obj, orca_state.locusOfFocus)
|
||||
and not self.isSameObject(obj, cthulhu_state.locusOfFocus)
|
||||
|
||||
def hasMatchingHierarchy(self, obj, rolesList):
|
||||
"""Called to determine if the given object and it's hierarchy of
|
||||
@@ -604,7 +604,7 @@ class Utilities:
|
||||
|
||||
def inFindContainer(self, obj=None):
|
||||
if obj is None:
|
||||
obj = orca_state.locusOfFocus
|
||||
obj = cthulhu_state.locusOfFocus
|
||||
|
||||
if not AXUtilities.is_entry(obj):
|
||||
return False
|
||||
@@ -1029,15 +1029,15 @@ class Utilities:
|
||||
|
||||
if verbosity == settings.PROGRESS_BAR_WINDOW:
|
||||
topLevel = self.topLevelObject(obj)
|
||||
if topLevel == orca_state.activeWindow:
|
||||
if topLevel == cthulhu_state.activeWindow:
|
||||
return True, "Verbosity is window"
|
||||
return False, f"Window {topLevel} is not {orca_state.activeWindow}"
|
||||
return False, f"Window {topLevel} is not {cthulhu_state.activeWindow}"
|
||||
|
||||
if verbosity == settings.PROGRESS_BAR_APPLICATION:
|
||||
app = AXObject.get_application(obj)
|
||||
if app == orca_state.activeScript.app:
|
||||
if app == cthulhu_state.activeScript.app:
|
||||
return True, "Verbosity is app"
|
||||
return False, f"App {app} is not {orca_state.activeScript.app}"
|
||||
return False, f"App {app} is not {cthulhu_state.activeScript.app}"
|
||||
|
||||
return True, "Not handled by any other case"
|
||||
|
||||
@@ -1101,11 +1101,11 @@ class Utilities:
|
||||
return AXUtilities.is_document(obj)
|
||||
|
||||
def inDocumentContent(self, obj=None):
|
||||
obj = obj or orca_state.locusOfFocus
|
||||
obj = obj or cthulhu_state.locusOfFocus
|
||||
return self.getDocumentForObject(obj) is not None
|
||||
|
||||
def activeDocument(self, window=None):
|
||||
return self.getTopLevelDocumentForObject(orca_state.locusOfFocus)
|
||||
return self.getTopLevelDocumentForObject(cthulhu_state.locusOfFocus)
|
||||
|
||||
def isTopLevelDocument(self, obj):
|
||||
return self.isDocument(obj) and not AXObject.find_ancestor(obj, self.isDocument)
|
||||
@@ -1399,10 +1399,10 @@ class Utilities:
|
||||
- obj: an Accessible object
|
||||
"""
|
||||
|
||||
if not obj or not orca_state.locusOfFocus:
|
||||
if not obj or not cthulhu_state.locusOfFocus:
|
||||
return False
|
||||
|
||||
return AXObject.get_application(orca_state.locusOfFocus) == AXObject.get_application(obj)
|
||||
return AXObject.get_application(cthulhu_state.locusOfFocus) == AXObject.get_application(obj)
|
||||
|
||||
def isLink(self, obj):
|
||||
"""Returns True if obj is a link."""
|
||||
@@ -2021,11 +2021,11 @@ class Utilities:
|
||||
return roles
|
||||
|
||||
def _locusOfFocusIsTopLevelObject(self):
|
||||
if not orca_state.locusOfFocus:
|
||||
if not cthulhu_state.locusOfFocus:
|
||||
return False
|
||||
|
||||
rv = orca_state.locusOfFocus == self.topLevelObject(orca_state.locusOfFocus)
|
||||
tokens = ["SCRIPT UTILITIES:", orca_state.locusOfFocus, "is top-level object:", rv]
|
||||
rv = cthulhu_state.locusOfFocus == self.topLevelObject(cthulhu_state.locusOfFocus)
|
||||
tokens = ["SCRIPT UTILITIES:", cthulhu_state.locusOfFocus, "is top-level object:", rv]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
return rv
|
||||
|
||||
@@ -2079,7 +2079,7 @@ class Utilities:
|
||||
return rv
|
||||
|
||||
def topLevelObjectIsActiveAndCurrent(self, obj=None):
|
||||
obj = obj or orca_state.locusOfFocus
|
||||
obj = obj or cthulhu_state.locusOfFocus
|
||||
topLevel = self.topLevelObject(obj)
|
||||
if not topLevel:
|
||||
return False
|
||||
@@ -2088,7 +2088,7 @@ class Utilities:
|
||||
if not AXUtilities.is_active(topLevel) or AXUtilities.is_defunct(topLevel):
|
||||
return False
|
||||
|
||||
if not self.isSameObject(topLevel, orca_state.activeWindow):
|
||||
if not self.isSameObject(topLevel, cthulhu_state.activeWindow):
|
||||
return False
|
||||
|
||||
return True
|
||||
@@ -2702,7 +2702,7 @@ class Utilities:
|
||||
return [textContents, startOffset, endOffset]
|
||||
|
||||
def getCaretContext(self):
|
||||
obj = orca_state.locusOfFocus
|
||||
obj = cthulhu_state.locusOfFocus
|
||||
try:
|
||||
offset = obj.queryText().caretOffset
|
||||
except NotImplementedError:
|
||||
@@ -2716,7 +2716,7 @@ class Utilities:
|
||||
return obj, 0
|
||||
|
||||
def setCaretPosition(self, obj, offset, documentFrame=None):
|
||||
orca.setLocusOfFocus(None, obj, False)
|
||||
cthulhu.setLocusOfFocus(None, obj, False)
|
||||
self.setCaretOffset(obj, offset)
|
||||
|
||||
def setCaretOffset(self, obj, offset):
|
||||
@@ -2938,17 +2938,17 @@ class Utilities:
|
||||
determine if the script is likely to echo it as a character.
|
||||
"""
|
||||
|
||||
if not orca_state.locusOfFocus or not settings.enableEchoByCharacter:
|
||||
if not cthulhu_state.locusOfFocus or not settings.enableEchoByCharacter:
|
||||
return False
|
||||
|
||||
if len(event.event_string) != 1 \
|
||||
or event.modifiers & keybindings.ORCA_CTRL_MODIFIER_MASK:
|
||||
return False
|
||||
|
||||
if AXUtilities.is_password_text(orca_state.locusOfFocus):
|
||||
if AXUtilities.is_password_text(cthulhu_state.locusOfFocus):
|
||||
return False
|
||||
|
||||
if AXUtilities.is_editable(orca_state.locusOfFocus):
|
||||
if AXUtilities.is_editable(cthulhu_state.locusOfFocus):
|
||||
return True
|
||||
|
||||
return False
|
||||
@@ -3361,10 +3361,10 @@ class Utilities:
|
||||
|
||||
@staticmethod
|
||||
def _lastKeyCodeAndModifiers():
|
||||
if not isinstance(orca_state.lastInputEvent, input_event.KeyboardEvent):
|
||||
if not isinstance(cthulhu_state.lastInputEvent, input_event.KeyboardEvent):
|
||||
return 0, 0
|
||||
|
||||
event = orca_state.lastNonModifierKeyEvent
|
||||
event = cthulhu_state.lastNonModifierKeyEvent
|
||||
if event:
|
||||
return event.hw_code, event.modifiers
|
||||
|
||||
@@ -3376,14 +3376,14 @@ class Utilities:
|
||||
string and modifiers of the last non-modifier key event or ("", 0)
|
||||
if there is no such event."""
|
||||
|
||||
if isinstance(orca_state.lastInputEvent, input_event.KeyboardEvent) \
|
||||
and orca_state.lastNonModifierKeyEvent:
|
||||
event = orca_state.lastNonModifierKeyEvent
|
||||
if isinstance(cthulhu_state.lastInputEvent, input_event.KeyboardEvent) \
|
||||
and cthulhu_state.lastNonModifierKeyEvent:
|
||||
event = cthulhu_state.lastNonModifierKeyEvent
|
||||
if event.keyval_name in ["BackSpace", "Delete"]:
|
||||
eventStr = event.keyval_name
|
||||
else:
|
||||
eventStr = event.event_string
|
||||
mods = orca_state.lastInputEvent.modifiers
|
||||
mods = cthulhu_state.lastInputEvent.modifiers
|
||||
else:
|
||||
eventStr = ""
|
||||
mods = 0
|
||||
@@ -3704,7 +3704,7 @@ class Utilities:
|
||||
return AXUtilities.is_button(obj) and AXUtilities.has_popup(obj)
|
||||
|
||||
def isPopupMenuForCurrentItem(self, obj):
|
||||
if obj == orca_state.locusOfFocus:
|
||||
if obj == cthulhu_state.locusOfFocus:
|
||||
return False
|
||||
|
||||
if not AXUtilities.is_menu(obj):
|
||||
@@ -3714,7 +3714,7 @@ class Utilities:
|
||||
if not name:
|
||||
return False
|
||||
|
||||
return name == AXObject.get_name(orca_state.locusOfFocus)
|
||||
return name == AXObject.get_name(cthulhu_state.locusOfFocus)
|
||||
|
||||
def isMenuWithNoSelectedChild(self, obj):
|
||||
return AXUtilities.is_menu(obj) and not self.selectedChildCount(obj)
|
||||
@@ -3723,7 +3723,7 @@ class Utilities:
|
||||
return AXUtilities.is_button(obj) and self.popupMenuFor(obj) is not None
|
||||
|
||||
def inMenu(self, obj=None):
|
||||
obj = obj or orca_state.locusOfFocus
|
||||
obj = obj or cthulhu_state.locusOfFocus
|
||||
if obj is None:
|
||||
return False
|
||||
|
||||
@@ -3736,7 +3736,7 @@ class Utilities:
|
||||
return False
|
||||
|
||||
def inContextMenu(self, obj=None):
|
||||
obj = obj or orca_state.locusOfFocus
|
||||
obj = obj or cthulhu_state.locusOfFocus
|
||||
if not self.inMenu(obj):
|
||||
return False
|
||||
|
||||
@@ -4748,7 +4748,7 @@ class Utilities:
|
||||
|
||||
@staticmethod
|
||||
def onClipboardContentsChanged(*args):
|
||||
script = orca_state.activeScript
|
||||
script = cthulhu_state.activeScript
|
||||
if not script:
|
||||
return
|
||||
|
||||
@@ -4793,14 +4793,14 @@ class Utilities:
|
||||
clipboard.set_text(text, -1)
|
||||
|
||||
def lastInputEventCameFromThisApp(self):
|
||||
if not isinstance(orca_state.lastInputEvent, input_event.KeyboardEvent):
|
||||
if not isinstance(cthulhu_state.lastInputEvent, input_event.KeyboardEvent):
|
||||
return False
|
||||
|
||||
event = orca_state.lastNonModifierKeyEvent
|
||||
event = cthulhu_state.lastNonModifierKeyEvent
|
||||
return event and event.isFromApplication(self._script.app)
|
||||
|
||||
def lastInputEventWasPrintableKey(self):
|
||||
event = orca_state.lastInputEvent
|
||||
event = cthulhu_state.lastInputEvent
|
||||
if not isinstance(event, input_event.KeyboardEvent):
|
||||
return False
|
||||
|
||||
@@ -4876,7 +4876,7 @@ class Utilities:
|
||||
if keyString not in ["Up", "Down"]:
|
||||
return False
|
||||
|
||||
if self.isEditableDescendantOfComboBox(orca_state.locusOfFocus):
|
||||
if self.isEditableDescendantOfComboBox(cthulhu_state.locusOfFocus):
|
||||
return False
|
||||
|
||||
return not (mods & keybindings.CTRL_MODIFIER_MASK)
|
||||
@@ -4893,7 +4893,7 @@ class Utilities:
|
||||
if keyString not in ["Page_Up", "Page_Down"]:
|
||||
return False
|
||||
|
||||
if self.isEditableDescendantOfComboBox(orca_state.locusOfFocus):
|
||||
if self.isEditableDescendantOfComboBox(cthulhu_state.locusOfFocus):
|
||||
return False
|
||||
|
||||
return not (mods & keybindings.CTRL_MODIFIER_MASK)
|
||||
@@ -5003,52 +5003,52 @@ class Utilities:
|
||||
return True
|
||||
|
||||
def lastInputEventWasMouseButton(self):
|
||||
return isinstance(orca_state.lastInputEvent, input_event.MouseButtonEvent)
|
||||
return isinstance(cthulhu_state.lastInputEvent, input_event.MouseButtonEvent)
|
||||
|
||||
def lastInputEventWasPrimaryMouseClick(self):
|
||||
event = orca_state.lastInputEvent
|
||||
event = cthulhu_state.lastInputEvent
|
||||
if isinstance(event, input_event.MouseButtonEvent):
|
||||
return event.button == "1" and event.pressed
|
||||
|
||||
return False
|
||||
|
||||
def lastInputEventWasMiddleMouseClick(self):
|
||||
event = orca_state.lastInputEvent
|
||||
event = cthulhu_state.lastInputEvent
|
||||
if isinstance(event, input_event.MouseButtonEvent):
|
||||
return event.button == "2" and event.pressed
|
||||
|
||||
return False
|
||||
|
||||
def lastInputEventWasSecondaryMouseClick(self):
|
||||
event = orca_state.lastInputEvent
|
||||
event = cthulhu_state.lastInputEvent
|
||||
if isinstance(event, input_event.MouseButtonEvent):
|
||||
return event.button == "3" and event.pressed
|
||||
|
||||
return False
|
||||
|
||||
def lastInputEventWasPrimaryMouseRelease(self):
|
||||
event = orca_state.lastInputEvent
|
||||
event = cthulhu_state.lastInputEvent
|
||||
if isinstance(event, input_event.MouseButtonEvent):
|
||||
return event.button == "1" and not event.pressed
|
||||
|
||||
return False
|
||||
|
||||
def lastInputEventWasMiddleMouseRelease(self):
|
||||
event = orca_state.lastInputEvent
|
||||
event = cthulhu_state.lastInputEvent
|
||||
if isinstance(event, input_event.MouseButtonEvent):
|
||||
return event.button == "2" and not event.pressed
|
||||
|
||||
return False
|
||||
|
||||
def lastInputEventWasSecondaryMouseRelease(self):
|
||||
event = orca_state.lastInputEvent
|
||||
event = cthulhu_state.lastInputEvent
|
||||
if isinstance(event, input_event.MouseButtonEvent):
|
||||
return event.button == "3" and not event.pressed
|
||||
|
||||
return False
|
||||
|
||||
def lastInputEventWasTableSort(self, delta=0.5):
|
||||
event = orca_state.lastInputEvent
|
||||
event = cthulhu_state.lastInputEvent
|
||||
if not event:
|
||||
return False
|
||||
|
||||
@@ -5069,10 +5069,10 @@ class Utilities:
|
||||
if keyString not in ["Return", "space", " "]:
|
||||
return False
|
||||
|
||||
return AXUtilities.is_table_header(orca_state.locusOfFocus)
|
||||
return AXUtilities.is_table_header(cthulhu_state.locusOfFocus)
|
||||
|
||||
def isPresentableExpandedChangedEvent(self, event):
|
||||
if self.isSameObject(event.source, orca_state.locusOfFocus):
|
||||
if self.isSameObject(event.source, cthulhu_state.locusOfFocus):
|
||||
return True
|
||||
|
||||
if AXUtilities.is_table_row(event.source) or AXUtilities.is_list_box(event.source):
|
||||
@@ -5101,14 +5101,14 @@ class Utilities:
|
||||
return True
|
||||
if AXUtilities.is_password_text(event.source):
|
||||
return True
|
||||
if AXObject.is_dead(orca_state.locusOfFocus):
|
||||
if AXObject.is_dead(cthulhu_state.locusOfFocus):
|
||||
return True
|
||||
elif AXUtilities.is_table_cell(event.source) and not AXUtilities.is_selected(event.source):
|
||||
msg = "SCRIPT UTILITIES: Event is not being presented due to role and states"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
return False
|
||||
|
||||
if orca_state.locusOfFocus in [event.source, AXObject.get_parent(event.source)]:
|
||||
if cthulhu_state.locusOfFocus in [event.source, AXObject.get_parent(event.source)]:
|
||||
return True
|
||||
|
||||
msg = "SCRIPT UTILITIES: Event is not being presented due to lack of cause"
|
||||
@@ -5183,7 +5183,7 @@ class Utilities:
|
||||
|
||||
if AXUtilities.is_focusable(event.source) \
|
||||
and not AXUtilities.is_focused(event.source) \
|
||||
and event.source != orca_state.locusOfFocus:
|
||||
and event.source != cthulhu_state.locusOfFocus:
|
||||
msg = "SCRIPT UTILITIES: Not echoable text insertion event: " \
|
||||
"focusable source is not focused"
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
@@ -5235,7 +5235,7 @@ class Utilities:
|
||||
return False
|
||||
|
||||
def objectContentsAreInClipboard(self, obj=None):
|
||||
obj = obj or orca_state.locusOfFocus
|
||||
obj = obj or cthulhu_state.locusOfFocus
|
||||
if not obj or AXObject.is_dead(obj):
|
||||
return False
|
||||
|
||||
@@ -5308,12 +5308,12 @@ class Utilities:
|
||||
return False
|
||||
|
||||
def eventIsUserTriggered(self, event):
|
||||
if not orca_state.lastInputEvent:
|
||||
if not cthulhu_state.lastInputEvent:
|
||||
msg = "SCRIPT UTILITIES: Not user triggered: No last input event."
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
return False
|
||||
|
||||
delta = time.time() - orca_state.lastInputEvent.time
|
||||
delta = time.time() - cthulhu_state.lastInputEvent.time
|
||||
if delta > 1:
|
||||
msg = f"SCRIPT UTILITIES: Not user triggered: Last input event {delta:.2f}s ago."
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
@@ -5329,9 +5329,9 @@ class Utilities:
|
||||
def isKeyGrabEvent(self, event):
|
||||
""" Returns True if this event appears to be a side-effect of an
|
||||
X11 key grab. """
|
||||
if not isinstance(orca_state.lastInputEvent, input_event.KeyboardEvent):
|
||||
if not isinstance(cthulhu_state.lastInputEvent, input_event.KeyboardEvent):
|
||||
return False
|
||||
return orca_state.lastInputEvent.didConsume() and not orca_state.openingDialog
|
||||
return cthulhu_state.lastInputEvent.didConsume() and not cthulhu_state.openingDialog
|
||||
|
||||
def presentFocusChangeReason(self):
|
||||
if self.handleUndoLocusOfFocusChange():
|
||||
@@ -5387,7 +5387,7 @@ class Utilities:
|
||||
self._script.pointOfReference['allItemsSelected'] = allCurrentlySelected
|
||||
if self.lastInputEventWasSelectAll() and allCurrentlySelected:
|
||||
self._script.presentMessage(messages.CONTAINER_SELECTED_ALL)
|
||||
orca.setLocusOfFocus(None, obj, False)
|
||||
cthulhu.setLocusOfFocus(None, obj, False)
|
||||
return True
|
||||
|
||||
return False
|
||||
@@ -1,9 +1,9 @@
|
||||
SUBDIRS = apps toolkits switcher terminal web
|
||||
|
||||
orca_python_PYTHON = \
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
default.py \
|
||||
self_voicing.py
|
||||
|
||||
orca_pythondir=$(pkgpythondir)/scripts
|
||||
cthulhu_pythondir=$(pkgpythondir)/scripts
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
script.py \
|
||||
script_utilities.py
|
||||
|
||||
cthulhu_pythondir=$(pkgpythondir)/scripts/apps/Banshee
|
||||
@@ -0,0 +1,3 @@
|
||||
# https://gitlab.gnome.org/GNOME/cthulhu/-/issues/358
|
||||
# ruff: noqa: F401
|
||||
from .script import Script
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
import orca.scripts.default as default
|
||||
import orca.orca_state as orca_state
|
||||
import cthulhu.scripts.default as default
|
||||
import cthulhu.cthulhu_state as cthulhu_state
|
||||
|
||||
from .script_utilities import Utilities
|
||||
|
||||
@@ -25,7 +25,7 @@ class Script(default.Script):
|
||||
value = obj.queryValue()
|
||||
current_value = int(value.currentValue)/1000
|
||||
if current_value in range(self._last_seek_value, self._last_seek_value + 4):
|
||||
if self.utilities.isSameObject(obj, orca_state.locusOfFocus):
|
||||
if self.utilities.isSameObject(obj, cthulhu_state.locusOfFocus):
|
||||
self.updateBraille(obj)
|
||||
return
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import orca.script_utilities as script_utilities
|
||||
from orca.ax_object import AXObject
|
||||
from orca.ax_utilities import AXUtilities
|
||||
import cthulhu.script_utilities as script_utilities
|
||||
from cthulhu.ax_object import AXObject
|
||||
from cthulhu.ax_utilities import AXUtilities
|
||||
|
||||
|
||||
class Utilities(script_utilities.Utilities):
|
||||
@@ -0,0 +1,6 @@
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
script.py
|
||||
|
||||
cthulhu_pythondir=$(pkgpythondir)/scripts/apps/Eclipse
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# https://gitlab.gnome.org/GNOME/cthulhu/-/issues/358
|
||||
# ruff: noqa: F401
|
||||
from .script import Script
|
||||
+6
-6
@@ -26,10 +26,10 @@ __copyright__ = "Copyright (c) 2010 Informal Informatica LTDA."
|
||||
__license__ = "LGPL"
|
||||
|
||||
|
||||
import orca.debug as debug
|
||||
import orca.orca as orca
|
||||
import orca.scripts.toolkits.GAIL as GAIL
|
||||
from orca.ax_utilities import AXUtilities
|
||||
import cthulhu.debug as debug
|
||||
import cthulhu.cthulhu as cthulhu
|
||||
import cthulhu.scripts.toolkits.GAIL as GAIL
|
||||
from cthulhu.ax_utilities import AXUtilities
|
||||
|
||||
########################################################################
|
||||
# #
|
||||
@@ -84,7 +84,7 @@ class Script(GAIL.Script):
|
||||
# NOTE: This event type is deprecated and Orca should no longer use it.
|
||||
# This callback remains just to handle bugs in applications and toolkits.
|
||||
if AXUtilities.is_panel(event.source):
|
||||
orca.setLocusOfFocus(event, event.source)
|
||||
cthulhu.setLocusOfFocus(event, event.source)
|
||||
return
|
||||
|
||||
if AXUtilities.is_text(event.source) \
|
||||
@@ -110,7 +110,7 @@ class Script(GAIL.Script):
|
||||
if event.detail1 == 0 and event.detail2 == length:
|
||||
# seems to be generated by a reformat (ctrl+shift+f)
|
||||
# or by commenting some block (ctrl+/).
|
||||
# if not discarded, orca will speak all the text of the file.
|
||||
# if not discarded, cthulhu will speak all the text of the file.
|
||||
return
|
||||
# Let the default script's normal behavior do its thing
|
||||
GAIL.Script.onTextInserted(self, event)
|
||||
@@ -19,8 +19,8 @@ SUBDIRS = \
|
||||
Thunderbird \
|
||||
xfwm4
|
||||
|
||||
orca_python_PYTHON = \
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py
|
||||
|
||||
orca_pythondir=$(pkgpythondir)/scripts/apps
|
||||
cthulhu_pythondir=$(pkgpythondir)/scripts/apps
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
script.py
|
||||
|
||||
cthulhu_pythondir=$(pkgpythondir)/scripts/apps/SeaMonkey
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
"""Custom script for SeaMonkey."""
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/orca/-/issues/358
|
||||
# https://gitlab.gnome.org/GNOME/cthulhu/-/issues/358
|
||||
# ruff: noqa: F401
|
||||
from .script import Script
|
||||
|
||||
+13
-13
@@ -31,12 +31,12 @@ import gi
|
||||
gi.require_version("Atspi", "2.0")
|
||||
from gi.repository import Atspi
|
||||
|
||||
from orca import cmdnames
|
||||
from orca import debug
|
||||
from orca import input_event
|
||||
from orca import orca_state
|
||||
from orca.ax_object import AXObject
|
||||
from orca.scripts.toolkits import Gecko
|
||||
from cthulhu import cmdnames
|
||||
from cthulhu import debug
|
||||
from cthulhu import input_event
|
||||
from cthulhu import cthulhu_state
|
||||
from cthulhu.ax_object import AXObject
|
||||
from cthulhu.scripts.toolkits import Gecko
|
||||
|
||||
|
||||
class Script(Gecko.Script):
|
||||
@@ -70,9 +70,9 @@ class Script(Gecko.Script):
|
||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||
return
|
||||
|
||||
table = self.utilities.getTable(orca_state.locusOfFocus)
|
||||
table = self.utilities.getTable(cthulhu_state.locusOfFocus)
|
||||
if table and not self.utilities.isTextDocumentTable(table):
|
||||
tokens = ["SEAMONKEY: Ignoring, locusOfFocus is", orca_state.locusOfFocus]
|
||||
tokens = ["SEAMONKEY: Ignoring, locusOfFocus is", cthulhu_state.locusOfFocus]
|
||||
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||
return
|
||||
|
||||
@@ -85,7 +85,7 @@ class Script(Gecko.Script):
|
||||
if self.utilities.inDocumentContent(event.source):
|
||||
return
|
||||
|
||||
focusRole = AXObject.get_role(orca_state.locusOfFocus)
|
||||
focusRole = AXObject.get_role(cthulhu_state.locusOfFocus)
|
||||
if focusRole != Atspi.Role.ENTRY or not self.utilities.inDocumentContent():
|
||||
super().onFocus(event)
|
||||
return
|
||||
@@ -112,26 +112,26 @@ class Script(Gecko.Script):
|
||||
return super().useFocusMode(obj, prevObj)
|
||||
|
||||
def enableStickyBrowseMode(self, inputEvent, forceMessage=False):
|
||||
if self.utilities.isEditableMessage(orca_state.locusOfFocus):
|
||||
if self.utilities.isEditableMessage(cthulhu_state.locusOfFocus):
|
||||
return
|
||||
|
||||
super().enableStickyBrowseMode(inputEvent, forceMessage)
|
||||
|
||||
def enableStickyFocusMode(self, inputEvent, forceMessage=False):
|
||||
if self.utilities.isEditableMessage(orca_state.locusOfFocus):
|
||||
if self.utilities.isEditableMessage(cthulhu_state.locusOfFocus):
|
||||
return
|
||||
|
||||
super().enableStickyFocusMode(inputEvent, forceMessage)
|
||||
|
||||
def togglePresentationMode(self, inputEvent, documentFrame=None):
|
||||
if self._inFocusMode \
|
||||
and self.utilities.isEditableMessage(orca_state.locusOfFocus):
|
||||
and self.utilities.isEditableMessage(cthulhu_state.locusOfFocus):
|
||||
return
|
||||
|
||||
super().togglePresentationMode(inputEvent, documentFrame)
|
||||
|
||||
def useStructuralNavigationModel(self, debugOutput=True):
|
||||
if self.utilities.isEditableMessage(orca_state.locusOfFocus):
|
||||
if self.utilities.isEditableMessage(cthulhu_state.locusOfFocus):
|
||||
return False
|
||||
|
||||
return super().useStructuralNavigationModel(debugOutput)
|
||||
@@ -0,0 +1,7 @@
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
script.py \
|
||||
spellcheck.py
|
||||
|
||||
cthulhu_pythondir=$(pkgpythondir)/scripts/apps/Thunderbird
|
||||
|
||||
+1
-1
@@ -26,6 +26,6 @@ __date__ = "$Date$"
|
||||
__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
|
||||
__license__ = "LGPL"
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/orca/-/issues/358
|
||||
# https://gitlab.gnome.org/GNOME/cthulhu/-/issues/358
|
||||
# ruff: noqa: F401
|
||||
from .script import Script
|
||||
+25
-25
@@ -25,16 +25,16 @@ __date__ = "$Date$"
|
||||
__copyright__ = "Copyright (c) 2004-2008 Sun Microsystems Inc."
|
||||
__license__ = "LGPL"
|
||||
|
||||
import orca.orca as orca
|
||||
import orca.cmdnames as cmdnames
|
||||
import orca.debug as debug
|
||||
import orca.input_event as input_event
|
||||
import orca.scripts.default as default
|
||||
import orca.settings_manager as settings_manager
|
||||
import orca.orca_state as orca_state
|
||||
import orca.scripts.toolkits.Gecko as Gecko
|
||||
from orca.ax_object import AXObject
|
||||
from orca.ax_utilities import AXUtilities
|
||||
import cthulhu.cthulhu as cthulhu
|
||||
import cthulhu.cmdnames as cmdnames
|
||||
import cthulhu.debug as debug
|
||||
import cthulhu.input_event as input_event
|
||||
import cthulhu.scripts.default as default
|
||||
import cthulhu.settings_manager as settings_manager
|
||||
import cthulhu.cthulhu_state as cthulhu_state
|
||||
import cthulhu.scripts.toolkits.Gecko as Gecko
|
||||
from cthulhu.ax_object import AXObject
|
||||
from cthulhu.ax_utilities import AXUtilities
|
||||
|
||||
from .spellcheck import SpellCheck
|
||||
|
||||
@@ -123,7 +123,7 @@ class Script(Gecko.Script):
|
||||
|
||||
if self.spellcheck.isSuggestionsItem(newFocus):
|
||||
includeLabel = not self.spellcheck.isSuggestionsItem(oldFocus)
|
||||
orca.emitRegionChanged(newFocus)
|
||||
cthulhu.emitRegionChanged(newFocus)
|
||||
self.updateBraille(newFocus)
|
||||
self.spellcheck.presentSuggestionListItem(includeLabel=includeLabel)
|
||||
return
|
||||
@@ -141,19 +141,19 @@ class Script(Gecko.Script):
|
||||
return super().useFocusMode(obj, prevObj)
|
||||
|
||||
def enableStickyBrowseMode(self, inputEvent, forceMessage=False):
|
||||
if self.utilities.isEditableMessage(orca_state.locusOfFocus):
|
||||
if self.utilities.isEditableMessage(cthulhu_state.locusOfFocus):
|
||||
return
|
||||
|
||||
super().enableStickyBrowseMode(inputEvent, forceMessage)
|
||||
|
||||
def enableStickyFocusMode(self, inputEvent, forceMessage=False):
|
||||
if self.utilities.isEditableMessage(orca_state.locusOfFocus):
|
||||
if self.utilities.isEditableMessage(cthulhu_state.locusOfFocus):
|
||||
return
|
||||
|
||||
super().enableStickyFocusMode(inputEvent, forceMessage)
|
||||
|
||||
def togglePresentationMode(self, inputEvent, documentFrame=None):
|
||||
if self._inFocusMode and self.utilities.isEditableMessage(orca_state.locusOfFocus):
|
||||
if self._inFocusMode and self.utilities.isEditableMessage(cthulhu_state.locusOfFocus):
|
||||
return
|
||||
|
||||
super().togglePresentationMode(inputEvent, documentFrame)
|
||||
@@ -161,7 +161,7 @@ class Script(Gecko.Script):
|
||||
def useStructuralNavigationModel(self, debugOutput=True):
|
||||
"""Returns True if structural navigation should be enabled here."""
|
||||
|
||||
if self.utilities.isEditableMessage(orca_state.locusOfFocus):
|
||||
if self.utilities.isEditableMessage(cthulhu_state.locusOfFocus):
|
||||
return False
|
||||
|
||||
return super().useStructuralNavigationModel(debugOutput)
|
||||
@@ -175,8 +175,8 @@ class Script(Gecko.Script):
|
||||
self._lastAutoComplete = ""
|
||||
obj = event.source
|
||||
if self.spellcheck.isAutoFocusEvent(event):
|
||||
orca.setLocusOfFocus(event, event.source, False)
|
||||
self.updateBraille(orca_state.locusOfFocus)
|
||||
cthulhu.setLocusOfFocus(event, event.source, False)
|
||||
self.updateBraille(cthulhu_state.locusOfFocus)
|
||||
|
||||
if not self.utilities.inDocumentContent(obj):
|
||||
super().onFocusedChanged(event)
|
||||
@@ -199,10 +199,10 @@ class Script(Gecko.Script):
|
||||
|
||||
obj = event.source
|
||||
if self.utilities.isDocument(obj) and not event.detail1:
|
||||
if AXObject.get_name(orca_state.locusOfFocus) \
|
||||
and (AXUtilities.is_frame(orca_state.locusOfFocus) \
|
||||
or AXUtilities.is_page_tab(orca_state.locusOfFocus)):
|
||||
orca.setLocusOfFocus(event, event.source, False)
|
||||
if AXObject.get_name(cthulhu_state.locusOfFocus) \
|
||||
and (AXUtilities.is_frame(cthulhu_state.locusOfFocus) \
|
||||
or AXUtilities.is_page_tab(cthulhu_state.locusOfFocus)):
|
||||
cthulhu.setLocusOfFocus(event, event.source, False)
|
||||
|
||||
if self.utilities.inDocumentContent():
|
||||
self.speakMessage(AXObject.get_name(obj))
|
||||
@@ -251,9 +251,9 @@ class Script(Gecko.Script):
|
||||
# existent browsery autocompletes for Thunderbird.
|
||||
|
||||
if event.detail1 and self.utilities.isMenuWithNoSelectedChild(event.source) \
|
||||
and orca_state.activeWindow == self.utilities.topLevelObject(event.source):
|
||||
and cthulhu_state.activeWindow == self.utilities.topLevelObject(event.source):
|
||||
self.presentObject(event.source)
|
||||
orca.setLocusOfFocus(event, event.source, False)
|
||||
cthulhu.setLocusOfFocus(event, event.source, False)
|
||||
return
|
||||
|
||||
default.Script.onShowingChanged(self, event)
|
||||
@@ -379,8 +379,8 @@ class Script(Gecko.Script):
|
||||
return
|
||||
|
||||
self.spellcheck.presentErrorDetails()
|
||||
orca.setLocusOfFocus(None, self.spellcheck.getChangeToEntry(), False)
|
||||
self.updateBraille(orca_state.locusOfFocus)
|
||||
cthulhu.setLocusOfFocus(None, self.spellcheck.getChangeToEntry(), False)
|
||||
self.updateBraille(cthulhu_state.locusOfFocus)
|
||||
|
||||
def onWindowDeactivated(self, event):
|
||||
"""Callback for window:deactivate accessibility events."""
|
||||
+6
-6
@@ -27,10 +27,10 @@ __date__ = "$Date$"
|
||||
__copyright__ = "Copyright (c) 2014 Igalia, S.L."
|
||||
__license__ = "LGPL"
|
||||
|
||||
import orca.orca_state as orca_state
|
||||
import orca.spellcheck as spellcheck
|
||||
from orca.ax_object import AXObject
|
||||
from orca.ax_utilities import AXUtilities
|
||||
import cthulhu.cthulhu_state as cthulhu_state
|
||||
import cthulhu.spellcheck as spellcheck
|
||||
from cthulhu.ax_object import AXObject
|
||||
from cthulhu.ax_utilities import AXUtilities
|
||||
|
||||
|
||||
class SpellCheck(spellcheck.SpellCheck):
|
||||
@@ -42,11 +42,11 @@ class SpellCheck(spellcheck.SpellCheck):
|
||||
if event.source != self._changeToEntry:
|
||||
return False
|
||||
|
||||
if not AXUtilities.is_push_button(orca_state.locusOfFocus):
|
||||
if not AXUtilities.is_push_button(cthulhu_state.locusOfFocus):
|
||||
return False
|
||||
|
||||
lastKey, mods = self._script.utilities.lastKeyAndModifiers()
|
||||
keys = self._script.utilities.mnemonicShortcutAccelerator(orca_state.locusOfFocus)
|
||||
keys = self._script.utilities.mnemonicShortcutAccelerator(cthulhu_state.locusOfFocus)
|
||||
for key in keys:
|
||||
if key.endswith(lastKey.upper()):
|
||||
return True
|
||||
@@ -0,0 +1,5 @@
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
script.py
|
||||
|
||||
cthulhu_pythondir=$(pkgpythondir)/scripts/apps/epiphany
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
"""Custom script for epiphany."""
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/orca/-/issues/358
|
||||
# https://gitlab.gnome.org/GNOME/cthulhu/-/issues/358
|
||||
# ruff: noqa: F401
|
||||
|
||||
from .script import Script
|
||||
+4
-4
@@ -27,9 +27,9 @@ __date__ = "$Date$"
|
||||
__copyright__ = "Copyright (c) 2014 Igalia, S.L."
|
||||
__license__ = "LGPL"
|
||||
|
||||
import orca.orca as orca
|
||||
import orca.scripts.toolkits.gtk as gtk
|
||||
import orca.scripts.toolkits.WebKitGtk as WebKitGtk
|
||||
import cthulhu.cthulhu as cthulhu
|
||||
import cthulhu.scripts.toolkits.gtk as gtk
|
||||
import cthulhu.scripts.toolkits.WebKitGtk as WebKitGtk
|
||||
|
||||
class Script(WebKitGtk.Script):
|
||||
|
||||
@@ -43,7 +43,7 @@ class Script(WebKitGtk.Script):
|
||||
|
||||
obj, offset = self.utilities.getCaretContext()
|
||||
if obj:
|
||||
orca.setLocusOfFocus(None, obj)
|
||||
cthulhu.setLocusOfFocus(None, obj)
|
||||
|
||||
def onWindowDeactivated(self, event):
|
||||
"""Callback for window:deactivate accessibility events."""
|
||||
@@ -0,0 +1,5 @@
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
script.py
|
||||
|
||||
cthulhu_pythondir=$(pkgpythondir)/scripts/apps/evince
|
||||
+1
-1
@@ -19,6 +19,6 @@
|
||||
|
||||
"""Custom script for evince."""
|
||||
|
||||
# https://gitlab.gnome.org/GNOME/orca/-/issues/358
|
||||
# https://gitlab.gnome.org/GNOME/cthulhu/-/issues/358
|
||||
# ruff: noqa: F401
|
||||
from .script import Script
|
||||
@@ -27,12 +27,12 @@ __date__ = "$Date$"
|
||||
__copyright__ = "Copyright (c) 2013 The Orca Team."
|
||||
__license__ = "LGPL"
|
||||
|
||||
import orca.keybindings as keybindings
|
||||
import orca.orca as orca
|
||||
import orca.orca_state as orca_state
|
||||
import orca.scripts.toolkits.gtk as gtk
|
||||
from orca.ax_utilities import AXUtilities
|
||||
from orca.structural_navigation import StructuralNavigation
|
||||
import cthulhu.keybindings as keybindings
|
||||
import cthulhu.cthulhu as cthulhu
|
||||
import cthulhu.cthulhu_state as cthulhu_state
|
||||
import cthulhu.scripts.toolkits.gtk as gtk
|
||||
from cthulhu.ax_utilities import AXUtilities
|
||||
from cthulhu.structural_navigation import StructuralNavigation
|
||||
|
||||
|
||||
########################################################################
|
||||
@@ -104,7 +104,7 @@ class Script(gtk.Script):
|
||||
if not self.structuralNavigation.enabled:
|
||||
return False
|
||||
|
||||
if AXUtilities.is_editable(orca_state.locusOfFocus):
|
||||
if AXUtilities.is_editable(cthulhu_state.locusOfFocus):
|
||||
return False
|
||||
|
||||
return True
|
||||
@@ -114,6 +114,6 @@ class Script(gtk.Script):
|
||||
|
||||
obj = event.source
|
||||
if AXUtilities.is_focused(obj):
|
||||
orca.setLocusOfFocus(event, event.source, False)
|
||||
cthulhu.setLocusOfFocus(event, event.source, False)
|
||||
|
||||
gtk.Script.onCaretMoved(self, event)
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
orca_python_PYTHON = \
|
||||
cthulhu_python_PYTHON = \
|
||||
__init__.py \
|
||||
braille_generator.py \
|
||||
script.py \
|
||||
script_utilities.py \
|
||||
speech_generator.py
|
||||
|
||||
orca_pythondir=$(pkgpythondir)/scripts/apps/evolution
|
||||
cthulhu_pythondir=$(pkgpythondir)/scripts/apps/evolution
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user