| Server IP : 93.86.61.54 / Your IP : 216.73.216.156 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/orca/__pycache__/ |
Upload File : |
o
S�bGV � @ s d Z dZdZdZdZdZddlZddlZddlZddl Z ddl
mZ ze�d d
� ddl
m
Z
dZW n d
ZY ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ e�� Ze�� Ze�� ZG dd� d�ZG dd� d�ZG dd� d�Ze� ZdS )zMouse review mode.z$Id$z
$Revision$z$Date$z@Copyright (c) 2008 Eitan IsaacsonCopyright (c) 2016 Igalia, S.L.�LGPL� N)�Gdk�Wnckz3.0)r TF� )�debug)�
event_manager)�messages)�orca)�
orca_state)�script_manager)�settings_managerc @ sB e Zd ZdZddd�Zdd� Zd d
� Zdd� Zd
d� Zdd� Z dS )�_StringContextz8The textual information associated with an _ItemContext.N� r c C sB || _ || _|| _|| _|| _d| _|r|j�|||�| _dS dS )a� Initialize the _StringContext.
Arguments:
- string: The human-consumable string
- obj: The accessible object associated with this string
- start: The start offset with respect to entire text, if one exists
- end: The end offset with respect to the entire text, if one exists
- script: The script associated with the accessible object
�r r r r N)�_obj�_script�_string�_start�_end�_boundingBox� utilities�getTextBoundingBox)�self�obj�script�string�start�end� r �3/usr/lib/python3/dist-packages/orca/mouse_review.py�__init__: s �z_StringContext.__init__c C s8 |d uo| j |j ko| j|jko| j|jko| j|jkS �N)r r r r �r �otherr r r �__eq__N s
�
�
�
�z_StringContext.__eq__c C s� |du rdS | j r|j sdS | �� }|dkrdS |�� }|dkr"dS |d |d krO| j |j krO| j�d�}|rO|d | |d krOg |dd� �|d �R }| jj�||�|kr[dS | jrf| j�� |jv shdS d| j|jf }t� tj
|d� dS ) �-Returns True if this is a substring of other.NFr � �
r z'MOUSE REVIEW: '%s' is substring of '%s'T)r �getBoundingBoxr �countr r �intersection�stripr �println�
LEVEL_INFO)r r# �thisBox�otherBox�thisNewLineCount�msgr r r �
isSubstringOfU s* z_StringContext.isSubstringOfc C � | j S )z>Returns the bounding box associated with this context's range.)r �r r r r r( x � z_StringContext.getBoundingBoxc C r3 �z0Returns the string associated with this context.)r r4 r r r � getString} r5 z_StringContext.getStringc C s� | j sd}t�tj|d� dS | jsd}t�tj|d� dS | j jj| j| jd�}| j j� | j�}t
�| j| j| j
t
j� | j j||dd� | j �| jd� dS )�"Presents this context to the user.z2MOUSE REVIEW: Not presenting due to lack of scriptTFz2MOUSE REVIEW: Not presenting due to lack of string)r r )�voice� interrupt���)r r r, r- r �speechGeneratorr9 r r �adjustForRepeatsr �emitRegionChangedr r �MOUSE_REVIEW�speakMessage�displayBrailleMessage)r r1 r9 r r r r �present� s z_StringContext.present)Nr r r )
�__name__�
__module__�__qualname__�__doc__r r$ r2 r( r7 rB r r r r r
7 s
#r
c @ sr e Zd ZdZddd�Zdd� Zdd � Zd
d� Zdd
� Zdd� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� ZdS )�_ItemContextz;Holds all the information of the item at a specified point.r Nc C sX || _ || _|| _|| _|| _|| _| �� | _t�� | _ d| _
|r*|j�|�| _
dS dS )a Initialize the _ItemContext.
Arguments:
- x: The X coordinate
- y: The Y coordinate
- obj: The accessible object of interest at that coordinate
- boundary: The accessible-text boundary type
- frame: The containing accessible object (often a top-level window)
- script: The script associated with the accessible object
r N)
�_x�_yr � _boundary�_framer �_getStringContextr �time�_timer r r( )r �x�yr �boundary�framer r r r r � s
�z_ItemContext.__init__c C s, |d uo| j |j ko| j|jko| j|jkS r! )rK r r r"