%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__/highlighter.cpython-312.pyc

�

g
f����dZdZdZdZdZdZddlmZ	dd	lZdd	l	Z	e	jd
d�ddlmZd
Z
Gd�d�ZGd�de�Zy	#e$r.ZdegZej"ej$ed
�dZ
Yd	Z[�Dd	Z[wwxYw)z7Module for drawing highlights over an area of interest.z$Id$z
$Revision$z$Date$zCopyright (c) 2023 Igalia, S.L.�LGPL�)�debug�N�Gtkz3.0)rTz(HIGHLIGHTER: GtkHighlighter unavailable:Fc�~�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�Highlighterz1Base class of all highlighters supported by Orca.�	highlight�	rectangle�	underline)rrr)rrr)rrr)rrr)��?rr)rrr)rg�?g�������?)rrr)rrr)rrr)rrr)rrr)rrr)rrrc��||_||_||_||_||_||_||_|j�|_y)N)	�_highlight_type�_color�_alpha�
_thickness�_padding�_fill_color�_fill_alpha�_create_gui�_gui)�self�highlight_type�color�alpha�	thickness�padding�
fill_color�
fill_alphas        �2/usr/lib/python3/dist-packages/orca/highlighter.py�__init__zHighlighter.__init__@sF��-���������#�����
�%���%����$�$�&��	�c��y)� Creates the gui for the overlay.N��rs rrzHighlighter._create_guiJs��r!c��y)�6Called by highlight to draw a highlight over the item.Nr$�r�painters  r�_draw_highlightzHighlighter._draw_highlightN���r!c��y)�8Called by highlight to draw a rectangle around the item.Nr$r(s  r�_draw_rectanglezHighlighter._draw_rectangleRr+r!c��y)�8Called by highlight to draw an underline under the item.Nr$r(s  r�_draw_underlinezHighlighter._draw_underlineVr+r!c��y)�3Draws the desired indicator over the specified box.Nr$)r�x�y�width�heights     rr	zHighlighter.highlightZr+r!c��y)�Quits the highlighter.Nr$r%s r�quitzHighlighter.quit^r+r!N)�__name__�
__module__�__qualname__�__doc__�	HIGHLIGHT�	RECTANGLE�	UNDERLINE�RED�BLUE�GREEN�YELLOW�PURPLE�ORANGE�PINK�CYAN�MAGENTA�LIME�NAVY�TEAL�BLACK�WHITEr rr*r.r1r	r:r$r!rrr*s}��;��I��I��I�
�C��D��E�
�F�
�F�
�F��D��D��G��D��D��D��E��E�'��
�
�
�
�
r!rc���eZdZdZej
ejdddddf�fd�	Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Z�xZS)
�GtkHighlighterz5Highlighter that uses a GtkWindow to highlight items.g�?�Nc	���ts(d}tjtj|d�yt�	|�|||||||�d|_y)Nz1GTK HIGHLIGHTER: Unavailable. Is Cairo installed?T)�CAIRO_AVAILABLEr�printMessage�
LEVEL_INFO�superr �
_drawing_area)
rrrrrrrr�msg�	__class__s
         �rr zGtkHighlighter.__init__fsJ����E�C����u�/�/��d�;��
������y�'�:�Wa�b�!��r!c��tj�}|jd�|jd�|j	d�|jd�|j
d�|j�}|j�}|r!|j�r|j|�tj�|_|jjd|j�|j|j�|S)r#FT�draw)r�Window�
set_decorated�set_accept_focus�set_app_paintable�set_skip_taskbar_hint�set_skip_pager_hint�
get_screen�get_rgba_visual�
is_composited�
set_visual�DrawingArearX�connect�_on_draw�add)r�gui�screen�visuals    rrzGtkHighlighter._create_guivs����j�j�l�����%� ����U�#����d�#��!�!�$�'�����%����!���'�'�)���f�*�*�,��N�N�6�"� �_�_�.������"�"�6�4�=�=�9�����"�"�#��
r!c��|j|jk(r|j|�y|j|jk(r|j	|�y|j|j
k(r|j
|�yy)z$Signal handler for the 'draw' event.N)rr?r*r@r.rAr1)r�widgetr)s   rrizGtkHighlighter._on_draw�si�����4�>�>�1�� � ��)�
�
!�
!�T�^�^�
3�� � ��)�
�
!�
!�T�^�^�
3�� � ��)�4r!c�T�|j�|j|_|j�d|_g|j�|j��}|j|�|j	t
j�|j�|j	t
j�y)r'Ng333333�?)	rrEr�set_source_rgba�set_operator�cairo�OPERATOR_SOURCE�paint�
OPERATOR_OVER)rr)�fills   rr*zGtkHighlighter._draw_highlight�s������#�#�{�{�D�����#�"�D��4��!�!�4�4�#3�#3�4�������&����U�2�2�3��
�
�����U�0�0�1r!c��|j}|j}|jj�d|jzz
}|jj�d|jzz
}|j�]|j
�Qg|j�|j
dz��}|j|�|j||||�|j�g|j�|j��}|j|�|j|j�|j||||�|j�y)r-�N�)rr�get_allocated_width�get_allocated_heightrrrqr
rwrr�set_line_widthr�stroke)rr)r4r5r6r7rw�lines        rr.zGtkHighlighter._draw_rectangle�s��
�M�M���M�M���	�	�-�-�/�!�d�m�m�2C�C�����/�/�1�A��
�
�4E�E�����'�D�,<�,<�,H�>�T�%�%�>�t�'7�'7�#�'=�>�D�#�G�#�#�T�*����a��E�6�2��L�L�N�*����*�d�k�k�*�������&����t���/����!�Q��v�.����r!c��g|j�|j��}|j|�|j|j�|jd|jj�dz
�|j|jj�|jj�dz
�|j�y)r0rrRN)rrrqr}r�move_torr|�line_tor{r~)rr)rs   rr1zGtkHighlighter._draw_underline�s���+����*�d�k�k�*�������&����t���/�����4�9�9�9�9�;�a�?�@�����	�	�5�5�7����9W�9W�9Y�\]�9]�^����r!c��d|�d|�d|�d|��}tjtj|d�	|jj	||j
z
||j
z
�|jj
|d|j
zz|d|j
zz�|jj�y#t$r3}d|g}tjtj|d�Yd}~yd}~wwxYw)	r3zGTK HIGHLIGHTER: x:z, y:z, width:z	, height:TryzGTK HIGHLIGHTER: Exception:N)
rrUrVr�mover�resize�show_all�	Exception�printTokens)rr4r5r6r7rY�exc�error_tokenss        rr	zGtkHighlighter.highlight�s���$�A�3�d�1�#�X�e�W�I�f�X�N��
���5�+�+�S�$�7�	!��I�I�N�N�1�t�}�}�,�a�$�-�-�.?�@��I�I���U�Q����%6�6���T�]�]�AR�8R�S�

�I�I��� ��	�	D�9�3�?�L����e�.�.��d�C�C��	D�s�A2C�	C>�)C9�9C>c��d}tjtj|d�|jj	�d|_d|_y)r9zGTK HIGHLIGHTER: Quitting.TN)rrUrVr�destroyrX)rrYs  rr:zGtkHighlighter.quit�s@��+��
���5�+�+�S�$�7��	�	����!�����	r!)r;r<r=r>rrArDr rrir*r.r1r	r:�
__classcell__)rZs@rrQrQcsQ���?�!,� 5� 5�"�(�(���� � �"� �(*�2��(�
!�r!rQ)r>�__id__�__version__�__date__�
__copyright__�__license__�rrs�gi�require_version�
gi.repositoryrrTr��error�tokensr�rVrrQr$r!r�<module>r�s���*>�������1�
����	��
��B���u�e�$�!��O�6
�6
�rs�[�s��}��8�%�
@�F��E���e�&�&���5��O���s�#A
�
B�$A;�;B

Zerion Mini Shell 1.0