%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/orca/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/orca/__pycache__/brlmon.cpython-312.pyc

�

g
f�����dZdZdZdZdZdZddlZddlmZd	d
l	m
Z
d	dlmZdZ
d
ZdZGd�dej �ZGd�dej$�ZGd�dej(�Zy)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.�LGPL�N)�Gtk�)�script_manager)�BrailleEvent�@�€�Àc�<��eZdZdZdZdZdZd�fd�	Zd�Zd�Z	�xZ
S)	�BrlDotzA single braille dot.z<tt><small>%s</small></tt>u○u●c�z��t�|��|dvr)|jdddd�|jdddd�n(|jdddd�|jdddd�t	j
�|_|j|j�|r|j�y|j�y)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�?��?grrN)
�super�__init__�set�set_paddingr�Label�label�add�raiseDot�lowerDot)�self�	dotNumber�isRaised�	__class__s   ��-/usr/lib/python3/dist-packages/orca/brlmon.pyrzBrlDot.__init__2s����	������$��H�H�S�#�s�C�(����Q��1�a�(��H�H�S�#�s�C�(����Q��1�a�(��Y�Y�[��
����������M�M�O��M�M�O�c��|jdddd�|jj|j|jz�y�Nrr)rr�
set_markup�
MARKUP_NORMAL�
SYMBOL_RAISED�rs rrzBrlDot.raiseDotIs7������c�1�a� ��
�
���d�0�0�4�3E�3E�E�Fr c��|jdddd�|jj|j|jz�yr")rrr#r$�SYMBOL_LOWEREDr&s rrzBrlDot.lowerDotMs7������c�1�a� ��
�
���d�0�0�4�3F�3F�F�Gr )F)�__name__�
__module__�__qualname__�__doc__r$r(r%rrr�
__classcell__�rs@rrr+s&����1�M��N��M��.G�Hr rc�2�eZdZdZdZdZd�Zd�Zd�Zd	d�Z	y)
�BrlCellz?A single graphical braille cell with cursor routing capability.z<tt><big>%s</big></tt>z<b><u>%s</u></b>c�"�tjj|�|jdd�||_tj
�|_td�|_td�|_	tj�}|j|jdddd�|j|jdddd�|j|jdddd�|j|�|jd	|j�y
)z|Create a new BrlCell.

        Arguments:
        - position: The location of the cell with respect to the monitor.
        ��-r�rrrr�clickedN)r�Buttonr�set_size_request�	_positionr�_displayedCharr�_dot7�_dot8�Grid�attachr�connect�_onCellClicked)r�position�grids   rrzBrlCell.__init__Ws���	�
�
���D�!����b�"�%�!���!�i�i�k����A�Y��
��A�Y��
��x�x�z�����D�'�'��A�q�!�4����D�J�J��1�a��+����D�J�J��1�a��+���������Y�� 3� 3�4r c���tj�j�}|�yi}tj|d<|j
|d<t
|�}|j|�y)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.N�command�argument)r�
getManager�getActiveScript�brlapi�
KEY_CMD_ROUTEr8r�processRoutingKey)r�widget�script�fakeKeyPress�events     rr?zBrlCell._onCellClickedms^�� �*�*�,�<�<�>���>����"(�"6�"6��Y��#'�>�>��Z� ��\�*��� � ��'r c��|jjd�|jj�|jj�y)zClears the braille cell.�N)r9r#r:rr;r&s r�clearz
BrlCell.clear}s8��	
���&�&�r�*��
�
�����
�
���r Nc�J�|dk(rd}n|dk(rd}n|dk(rd}|j}|r||jz}|jj||z�|tt
fvr|jj�|tt
fvr|jj�yy)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_CELLr9r#�DOT_7�DOTS_78r:r�DOT_8r;)r�char�mask�isCursorCell�markups     r�displayzBrlCell.display�s����3�;��D�
�S�[��D�
�T�\��D��#�#����d�5�5�5�F����&�&�v��}�5��E�7�#�#��J�J���!��E�7�#�#��J�J���!�$r )NF)
r)r*r+r,r$rUrr?rPr]�r rr0r0Qs$��I�1�M�+��5�,(� �"r r0c�2��eZdZdZd�fd�	Zd�Zdd�Z�xZS)�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.c���t�|��|jd�tj�}|j|�g|_t|�D]=}t|�}|j||ddd�|jj|��?|jd�|jdd�|jd�|jd�y)zdCreate a new BrlMon.

        Arguments:
        - numCells: how many braille cells to make
        zBraille MonitorrrFzaccept-focusTN)rr�	set_titlerr<r�cells�ranger0r=�append�
set_resizable�set_property�set_skip_taskbar_hint�set_skip_pager_hint)r�numCellsrA�i�cellrs     �rrzBrlMon.__init__�s����	�������(�)��x�x�z���������
��x��	$�A��1�:�D��K�K��a��A�q�)��J�J���d�#�	$�
	
���5�!����.�%�0��"�"�4�(�� � ��&r c�F�|jD]}|j��y)z#Clears the braille monitor display.N)rcrP)rrls  rrPzBrlMon.clear�s ���J�J�	�D��J�J�L�	r c�$�|j�tt|�t|j��}t	|�D]3}||dz
k(}	||}|j|j||||��5y#t
tf$rd}Y�9wxYw)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)rP�min�lenrcrd�
IndexError�	TypeErrorr])r�
cursorCell�stringrZ�lengthrkr[�cellMasks        r�	writeTextzBrlMon.writeText�s���	
�
�
���S��[�#�d�j�j�/�2���v��	E�A��
�Q��.�L�
 ���7��
�J�J�q�M�!�!�&��)�X�|�D�
	E���	�*�
 ���
 �s�A;�;B�B)� )N)r)r*r+r,rrPrwr-r.s@rr`r`�s����'�0�Er r`)r,�__id__�__version__�__date__�
__copyright__�__license__rG�
gi.repositoryrrOr�input_eventrrVrXrW�	Alignmentrr6r0�Windowr`r^r r�<module>r�s{��,J�������4�
���
���%���
��
��$H�S�]�]�$H�LK"�c�j�j�K"�Z7E�S�Z�Z�7Er 

Zerion Mini Shell 1.0