Mini Shell

Direktori : /lib/python3.6/site-packages/orca/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/orca/__pycache__/brlmon.cpython-36.opt-1.pyc

3

�2[��@s�dZdZdZdZdZdZddlZddlmZd	d
l	m
Z
d	dlmZdZ
d
ZdZGdd�dej�ZGdd�dej�ZGdd�dej�ZdS)zCProvides a graphical braille display, mainly for development tasks.z$Id$z
$Revision$z$Date$zNCopyright (c) 2005-2008 Sun Microsystems Inc.Copyright (c) 2011 The Orca Team.ZLGPL�N)�Gtk�)�
orca_state)�BrailleEvent�@�€�Àcs>eZdZdZdZdZdZd�fdd�	Zdd	�Zd
d�Z	�Z
S)
�BrlDotzA single braille dot.z<tt><small>%s</small></tt>u○u●Fcs�t�j�|d
kr4|jdddd�|jdddd�n |jdddd�|jdddd�tj�|_|j|j�|rx|j�n|j	�d	S)z�Create a new BrlDot.

        Arguments:
        - dotNumber: an integer reflecting the location of the dot within
          an 8-dot braille cell, using traditional braille dot values.
        r���g�?g�?grN)rr
rr)
�super�__init__�setZset_paddingr�Label�label�add�raiseDot�lowerDot)�selfZ	dotNumberZisRaised)�	__class__��/usr/lib/python3.6/brlmon.pyr2s


zBrlDot.__init__cCs(|jdddd�|jj|j|j�dS)Ng�?r)rr�
set_markup�
MARKUP_NORMAL�
SYMBOL_RAISED)rrrrrIszBrlDot.raiseDotcCs(|jdddd�|jj|j|j�dS)Ng�?r)rrrr�SYMBOL_LOWERED)rrrrrMszBrlDot.lowerDot)F)�__name__�
__module__�__qualname__�__doc__rrrrrr�
__classcell__rr)rrr	+sr	c@s:eZdZdZdZdZdd�Zdd�Zdd	�Zddd
�Z	d
S)�BrlCellz?A single graphical braille cell with cursor routing capability.z<tt><big>%s</big></tt>z<b><u>%s</u></b>cCs�tjj|�|jdd�||_tj�|_td�|_td�|_	tj
�}|j|jdddd�|j|jdddd�|j|j	dddd�|j|�|j
d	|j�d
S)z|Create a new BrlCell.

        Arguments:
        - position: The location of the cell with respect to the monitor.
        ��-r�rr
rrZclickedN)r�ButtonrZset_size_request�	_positionr�_displayedCharr	�_dot7�_dot8�Grid�attachrZconnect�_onCellClicked)rZposition�gridrrrrWs



zBrlCell.__init__cCs:tjs
dSi}tj|d<|j|d<t|�}tjj|�dS)z�Callback for the 'clicked' signal on the push button. Synthesizes
        a fake brlapi command to route the cursor to the current cell, similar
        to what occurs when a user presses the cursor routing key on his/her
        hardware braille display.NZcommandZargument)rZactiveScript�brlapiZ
KEY_CMD_ROUTEr'rZprocessRoutingKey)rZwidgetZfakeKeyPressZeventrrrr-ms

zBrlCell._onCellClickedcCs$|jjd�|jj�|jj�dS)zClears the braille cell.�N)r(rr)rr*)rrrr�clear|s
z
BrlCell.clearNFcCs||dkrd}n|dkrd}n|dkr(d}|j}|r<||j}|jj||�|ttgkrb|jj�|ttgkrx|j	j�dS)z�Displays the specified character in the cell.

        Arguments:
        - char: The character to display in the cell.
        - isCursorCell: If True, the cursor/caret is at this cell and this
          should be indicated visually.
        �&z&amp;�<z&lt;�	z$tN)
r�MARKUP_CURSOR_CELLr(r�DOT_7�DOTS_78r)r�DOT_8r*)r�char�mask�isCursorCellZmarkuprrr�display�s	

zBrlCell.display)NF)
rrrr rr5rr-r1r<rrrrr"Qsr"cs4eZdZdZd
�fdd�	Zdd�Zddd	�Z�ZS)�BrlMona1Displays a GUI braille monitor that mirrors what would be displayed
    by Orca on a connected, configured, and enabled braille display. Cursor
    routing functionality is emulated by each cell being a push button.
    Panning and other functionality found on hardware braille displays will
    be added.� cs�t�j�|jd�tj�}|j|�g|_x6t|�D]*}t|�}|j	||ddd�|jj
|�q6W|jd�|jdd�|j
d�|jd�dS)zdCreate a new BrlMon.

        Arguments:
        - numCells: how many braille cells to make
        zBraille MonitorrrFzaccept-focusTN)r
rZ	set_titlerr+r�cells�ranger"r,�appendZ
set_resizableZset_propertyZset_skip_taskbar_hintZset_skip_pager_hint)rZnumCellsr.�i�cell)rrrr�s




zBrlMon.__init__cCsx|jD]}|j�qWdS)z#Clears the braille monitor display.N)r?r1)rrCrrrr1�szBrlMon.clearNc
Cs�|j�tt|�t|j��}x^t|�D]R}||dk}y||}Wnttfk
r^d}YnX|j|j||||�q&WdS)z�Display the given text and highlight the given
        cursor cell.  A cursorCell of 0 means no cell has
        the cursor.

        Arguments:
        - cursorCell: 1-based index of cell with cursor
        - string: len must be <= num cells.
        rN)r1�min�lenr?r@�
IndexError�	TypeErrorr<)rZ
cursorCell�stringr:ZlengthrBr;ZcellMaskrrr�	writeText�s

zBrlMon.writeText)r>)N)rrrr rr1rIr!rr)rrr=�sr=)r Z__id__�__version__Z__date__Z
__copyright__Z__license__r/Z
gi.repositoryrr0rZinput_eventrr6r8r7Z	Alignmentr	r&r"ZWindowr=rrrr�<module>s&L