Mini Shell
3
�2[� � @ s� d Z dZdZdZdZdZddlZddljZddl j
jjZddl
j
jjZddljZddljZdd lmZ dd
lmZ ddlmZ ej� ZG dd
� d
ejej�ZdS )zCustom script for Evolution.z$Id$z
$Revision$z$Date$zLCopyright (c) 2005-2008 Sun Microsystems Inc.Copyright (c) 2013 Igalia, S.L.ZLGPL� N� )�BrailleGenerator)�SpeechGenerator)� Utilitiesc sp e Zd Z� fdd�Zdd� Zdd� Zdd� Zd d
� Zdd� Z� fd
d�Z dd� Z
dd� Zdd� Zdd� Z
� ZS )�Scriptc s0 t jd�dkrt jdd� t� j|� d| _dS )z�Creates a new script for the given application.
Arguments:
- app: the application to create a script for.
ZsayAllOnLoadNF)�_settingsManagerZ
getSettingZ
setSetting�super�__init__ZpresentIfInactive)�selfZapp)� __class__� �/usr/lib/python3.6/script.pyr 4 s zScript.__init__c C s t | �S )N)r )r
r r r
�getBrailleGeneratorA s zScript.getBrailleGeneratorc C s t | �S )N)r )r
r r r
�getSpeechGeneratorD s zScript.getSpeechGeneratorc C s t | �S )N)r )r
r r r
�getUtilitiesG s zScript.getUtilitiesc C s, | j j|j�}|r(|j� jtj� r(dS dS )a� Returns True if the given event is one that should cause this
script to become the active script. This is only a hint to
the focus tracking manager and it is not guaranteed this
request will be honored. Note that by the time the focus
tracking manager calls this method, it thinks the script
should become active. This is an opportunity for the script
to say it shouldn't.
FT)� utilitiesZtopLevelObject�source�getState�contains�pyatspiZSTATE_ACTIVE)r
�eventZwindowr r r
�isActivatableEventJ s
zScript.isActivatableEventc C s dS )z�Whether or not speech should be stopped prior to setting the
locusOfFocus in onActiveDescendantChanged.
Arguments:
- event: the Event
Returns True if speech should be stopped; False otherwise.
Fr )r
r r r r
�#stopSpeechOnActiveDescendantChangedZ s
z*Script.stopSpeechOnActiveDescendantChangedc s\ |j s
dS | jj|j�rL|j j� jtj�r:tj ||j � ntj ||j� dS t
� j|� dS )zCCallback for object:active-descendant-changed accessibility events.N)Zany_datar ZisComposeAutocompleter r r r ZSTATE_SELECTED�orca�setLocusOfFocusr �onActiveDescendantChanged)r
r )r r r
r l s z Script.onActiveDescendantChangedc C s dS )z<Callback for object:state-changed:busy accessibility events.Nr )r
r r r r
�
onBusyChanged{ s zScript.onBusyChangedc C sR | j j|j�rdS |jj� tjkr@| j j|j�}tj||� dS t j
j| |� dS )z)Callback for focus: accessibility events.N)r �isWebKitGtkr �getRoler ZROLE_LAYERED_PANEZrealActiveDescendantr r �gtkr �onFocus)r
r �objr r r
r s zScript.onFocusc C s$ | j j|j�rdS tjj| |� dS )z;Callback for object:property-change:accessible-name events.N)r r r r r �
onNameChanged)r
r r r r
r"