HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/gi/overrides/__pycache__/Gtk.cpython-38.pyc
U

��d^T��@s4	ddlZddlZejddkr(ddlZnddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
mZmZddlmZdd	lmZdd
lmZed�ZgZeZe�d�ejd
kr�dZe�ee�Gdd�de�Ze�d�dd�Ze�d�dd�Ze�d�dd�Z Gdd�de!�Z"Gdd�dej#�Z#e
e#�Z#e�d�Gdd�dej$e#�Z$e
e$�Z$e�d�Gdd�dej%�Z%e
e%�Z%e�d�ejdk�r(Gd d!�d!ej&�Z&e
e&�Z&e�d!�Gd"d#�d#ej'�Z'e
e'�Z'e�d#�Gd$d%�d%ej(�Z(e
e(�Z(e�d%�Gd&d'�d'ej)�Z)e
e)�Z)e�d'�Gd(d)�d)ej*e$�Z*e
e*�Z*e�d)�Gd*d+�d+ej+�Z+e
e+�Z+e�d+�Gd,d-�d-ej,�Z,e
e,�Z,e�d-�ejdk�r�Gd.d/�d/ej-�Z-e
e-�Z-e�d/�d0d1�Z.Gd2d3�d3ej/�Z/e
e/�Z/e�d3�eej0j1d4ed5d6�Z2Gd7d8�d8ej0�Z0e
e0�Z0e�d8�Gd9d:�d:ej3e$�Z3e
e3�Z3e�d:�Gd;d<�d<ej4e3�Z4e
e4�Z4e�d<�ejdk�r�Gd=d>�d>ej5�Z5e
e5�Z5e�d>�Gd?d@�d@ej6�Z6e
e6�Z6e�d@�ejdk�r�GdAdB�dBej7�Z7e
e7�Z7e�dB�ejdk�r*GdCdD�dDej8�Z8e
e8�Z8e�dD�GdEdF�dFej9�Z9e
e9�Z9e�dF�GdGdH�dHej:�Z:e
e:�Z:e�dH�GdIdJ�dJej;�Z;e
e;�Z;e�dJ�GdKdL�dLej<�Z<e
e<�Z<e�dL�GdMdN�dNej=�Z=e
e=�Z=e�dN�GdOdP�dPej>�Z>e
e>�Z>e�dP�GdQdR�dRej?�Z?e
e?�Z?e�dR�GdSdT�dTej@�Z@e
e@�Z@e�dT�GdUdV�dVejA�ZAe
eA�ZAe�dV�GdWdX�dXejBe?e@�ZBe
eB�ZBe�dX�GdYdZ�dZe!�ZCe�dZ�Gd[d\�d\e!�ZDe�d\�Gd]d^�d^ejE�ZEe
eE�ZEe�d^�Gd_d`�d`ejFe?e@�ZFe
eF�ZFe�d`�Gdadb�dbejGe$�ZGe
eG�ZGe�db�Gdcdd�ddejH�ZHe
eH�ZHe�dd�Gdedf�dfejI�ZIe
eI�ZIe�df�Gdgdh�dhejJe$�ZJe
eJ�ZJe�dh�Gdidj�djejK�ZKe
eK�ZKe�dj�Gdkdl�dlejL�ZLe
eL�ZLe�dl�Gdmdn�dnejM�ZMe
eM�ZMe�dn�ejdk�rHGdodp�dpejNe$�ZNe
eN�ZNe�dp�Gdqdr�drejO�ZOe
eO�ZOe�dr�ejdk�r�Gdsdt�dtejP�ZPe
eP�ZPe�dt�Gdudv�dvejQ�ZQe
eQ�ZQe�dv�Gdwdx�dxejR�ZRe
eR�ZRe�dx�ejdk�r8Gdydz�dzejS�ZSe
eS�ZSe�dz�Gd{d|�d|ejT�ZTe
eT�ZTe�d|�Gd}d~�d~ejU�ZUe
eU�ZUe�d~�Gdd��d�ejV�ZVe
eV�ZVe�d��ejd�k�r�Gd�d��d�ejW�ZWe
eW�ZWe�d��ejXZYe
ejX�d�d���ZXejZZ[e
ejZ�d�d���ZZejdk�	reej\�Z\e�d��ejd�k�	re�]�Z^ne�]ej_�\Z^Z_e`e_�e__dS)��N�)�abc)�GObject)�wakeup_on_signal�register_sigint_fallback)�Template)�override�strip_boolean_result�deprecated_init)�get_introspection_module)�string_types)�PyGIDeprecationWarning�Gtkr�2.0aBYou have imported the Gtk 2.0 module.  Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail.  As such this is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. PyGTK is the recomended python module to use with Gtk 2.0c@seZdZdS)�PyGTKDeprecationWarningN)�__name__�
__module__�__qualname__�rr�2/usr/lib/python3/dist-packages/gi/overrides/Gtk.pyr:srcCs4g}|D]&}t|tj�s$tjj|�}|�|�q|S)z�Create a list of TargetEntry items from a list of tuples in the form (target, flags, info)

    The list can also contain existing TargetEntry items in which case the existing entry
    is re-used in the return list.
    )�
isinstancerZTargetEntry�new�append)�targets�target_entries�entryrrr�_construct_target_listAsrcCs�d}t|tj�r|�|d�}nt||d�}|dkr>td|��d}t|tj�r|t|�dkrftd|��|dd�}|d}nt	|�s�td|��||fS)NzHandler %s not foundrrz!Handler %s tuple can not be empty�z-Handler %s is not a method, function or tuple)
rr�Mapping�get�getattr�AttributeError�Sequence�len�	TypeError�callable)�
obj_or_map�handler_name�handler�argsrrr�_extract_handler_and_argsRs
r*c
Cs�t||�\}}|tjj@}	|dk	rR|	r<|j|||f|��q||j|||f|��n*|	rj|j||f|��n|j||f|��dS�N)r*rZConnectFlagsZAFTERZconnect_object_afterZconnect_objectZ
connect_after�connect)
ZbuilderZgobjZsignal_namer'Zconnect_obj�flagsr&r(r)Zafterrrr�_builder_connect_callbackmsr.c@s$eZdZdd�Zdd�Zdd�ZdS)�_FreezeNotifyManagercCs
||_dSr+)�obj)�selfr0rrr�__init__~sz_FreezeNotifyManager.__init__cCsdSr+r�r1rrr�	__enter__�sz_FreezeNotifyManager.__enter__cCs|j��dSr+)r0Zthaw_child_notify)r1�exc_type�	exc_value�	tracebackrrr�__exit__�sz_FreezeNotifyManager.__exit__N)rrrr2r4r8rrrrr/}sr/csheZdZeejj�Zejdkr*�fdd�Zejdkr@�fdd�Z	ejdkrV�fdd�Z
dd	d
�Z�ZS)�Widget�4.0cstt|���t|�Sr+)�superr9�freeze_child_notifyr/r3��	__class__rrr<�szWidget.freeze_child_notifycs8|dk	r$t|tj�s$tj�t|��}tt|��|�dSr+)rr�
TargetListrrr;r9�drag_dest_set_target_list�r1Ztarget_listr=rrr@�sz Widget.drag_dest_set_target_listcs8|dk	r$t|tj�s$tj�t|��}tt|��|�dSr+)rrr?rrr;r9�drag_source_set_target_listrAr=rrrB�sz"Widget.drag_source_set_target_listNcCsN|dkr6|�|�}|dkr*td||f��t�|j�}tj�|||�|��S)Nz/Class "%s" does not contain style property "%s")	Zfind_style_property�
ValueErrorr�Value�
value_typerr9�style_get_property�	get_value)r1�
property_name�value�proprrrrF�s
�zWidget.style_get_property)N)
rrrr	rr9Ztranslate_coordinates�_versionr<r@rBrF�
__classcell__rrr=rr9�s


r9c@s`eZdZdd�Zdd�Zdd�Zdd�ZeZej	d	kr\ddd�Z
d
d�Zdd�Ze
ejj�Zd
S)�	ContainercCst|���Sr+)r#�get_childrenr3rrr�__len__�szContainer.__len__cCs||��kSr+)rN)r1�childrrr�__contains__�szContainer.__contains__cCst|���Sr+)�iterrNr3rrr�__iter__�szContainer.__iter__cCsdS�NTrr3rrr�__bool__�szContainer.__bool__�r�3.0NcCsP|dkr6|�|�}|dkr*td||f��t�|j�}tj�||||�|��S)Nz/Class "%s" does not contain child property "%s")	Zfind_child_propertyrCrrDrErrM�child_get_propertyrG)r1rPrHrIrJrrrrX�s
�zContainer.child_get_propertycs��fdd�|D�S)z<Returns a list of child property values for the given names.csg|]}���|��qSr)rX)�.0�name�rPr1rr�
<listcomp>�sz'Container.child_get.<locals>.<listcomp>r)r1rPZ
prop_namesrr[r�	child_get�szContainer.child_getcKs0|��D]"\}}|�dd�}|�|||�qdS)z=Set a child properties on the given child to key/value pairs.�_�-N)�items�replaceZchild_set_property)r1rP�kwargsrZrIrrr�	child_set�szContainer.child_set)N)rrrrOrQrSrU�__nonzero__rrKrXr]rcr	rMZget_focus_chainrrrrrM�s

rMcs,eZdZ�fdd�Zeejjdd�Z�ZS)�Editablecstt|��|d|�S�N���)r;re�insert_text)r1�text�positionr=rrrh�szEditable.insert_textr�Zfail_ret)	rrrrhr	rre�get_selection_boundsrLrrr=rre�srerVc@seZdZeejjded�ZdS)�Action�rZ�label�tooltip�stock_id��	arg_names�categoryN)rrrr
rrmr2rrrrrrm�s�rmc@seZdZeejjded�ZdS)�RadioAction�rZrorprqrIrrN)rrrr
rrur2rrrrrru�s�ruc@s<eZdZeejjded�Zd
dd�Zddd�Z	ddd	�Z
dS)
�ActionGroup)rZrrNcsPzt|�Wntk
r(td��YnXd��fdd�	}|D]}||�q>dS)a�
            The add_actions() method is a convenience method that creates a number
            of gtk.Action  objects based on the information in the list of action
            entry tuples contained in entries and adds them to the action group.
            The entry tuples can vary in size from one to six items with the
            following information:

                * The name of the action. Must be specified.
                * The stock id for the action. Optional with a default value of None
                  if a label is specified.
                * The label for the action. This field should typically be marked
                  for translation, see the set_translation_domain() method. Optional
                  with a default value of None if a stock id is specified.
                * The accelerator for the action, in the format understood by the
                  gtk.accelerator_parse() function. Optional with a default value of
                  None.
                * The tooltip for the action. This field should typically be marked
                  for translation, see the set_translation_domain() method. Optional
                  with a default value of None.
                * The callback function invoked when the action is activated.
                  Optional with a default value of None.

            The "activate" signals of the actions are connected to the callbacks and
            their accel paths are set to <Actions>/group-name/action-name.
            �entries must be iterableNcsLt||||d�}|dk	r<�dkr.|�d|�n|�d|����||�dS�NrnZactivate)rmr,�add_action_with_accel)rZrqro�acceleratorrp�callback�action�r1�	user_datarr�_process_actionsz0ActionGroup.add_actions.<locals>._process_action)NNNNN�rRr$�r1�entriesrr��err~r�add_actions�s
zActionGroup.add_actionscsPzt|�Wntk
r(td��YnXd��fdd�	}|D]}||�q>dS)a�
            The add_toggle_actions() method is a convenience method that creates a
            number of gtk.ToggleAction objects based on the information in the list
            of action entry tuples contained in entries and adds them to the action
            group. The toggle action entry tuples can vary in size from one to seven
            items with the following information:

                * The name of the action. Must be specified.
                * The stock id for the action. Optional with a default value of None
                  if a label is specified.
                * The label for the action. This field should typically be marked
                  for translation, see the set_translation_domain() method. Optional
                  with a default value of None if a stock id is specified.
                * The accelerator for the action, in the format understood by the
                  gtk.accelerator_parse() function. Optional with a default value of
                  None.
                * The tooltip for the action. This field should typically be marked
                  for translation, see the set_translation_domain() method. Optional
                  with a default value of None.
                * The callback function invoked when the action is activated.
                  Optional with a default value of None.
                * A flag indicating whether the toggle action is active. Optional
                  with a default value of False.

            The "activate" signals of the actions are connected to the callbacks and
            their accel paths are set to <Actions>/group-name/action-name.
            rxNFcsXtj||||d�}|�|�|dk	rH�dkr:|�d|�n|�d|����||�dSry)rZToggleAction�
set_activer,rz)rZrqror{rpr|Z	is_activer}r~rrr�Ms
z7ActionGroup.add_toggle_actions.<locals>._process_action)NNNNNFr�r�rr~r�add_toggle_actions+szActionGroup.add_toggle_actionsc	s�zt|�Wntk
r(td��YnXd}d��fdd�	}|D]}||f|��}|dkrB|}qB|dk	r�|dk	r�|dkr�|�d|�n|�d||�dS)a�
            The add_radio_actions() method is a convenience method that creates a
            number of gtk.RadioAction objects based on the information in the list
            of action entry tuples contained in entries and adds them to the action
            group. The entry tuples can vary in size from one to six items with the
            following information:

                * The name of the action. Must be specified.
                * The stock id for the action. Optional with a default value of None
                  if a label is specified.
                * The label for the action. This field should typically be marked
                  for translation, see the set_translation_domain() method. Optional
                  with a default value of None if a stock id is specified.
                * The accelerator for the action, in the format understood by the
                  gtk.accelerator_parse() function. Optional with a default value of
                  None.
                * The tooltip for the action. This field should typically be marked
                  for translation, see the set_translation_domain() method. Optional
                  with a default value of None.
                * The value to set on the radio action. Optional with a default
                  value of 0. Should be specified in applications.

            The value parameter specifies the radio action that should be set
            active. The "changed" signal of the first radio action is connected to
            the on_change callback (if specified and not None) and the accel paths
            of the actions are set to <Actions>/group-name/action-name.
            rxNrcsHt|||||d�}tjdkr&|�|��|kr8|�d���||�|S)NrvrWT)rurrKZ
join_groupr�rz)Zgroup_sourcerZrqror{rpZentry_valuer}�r1rIrrr�s


z6ActionGroup.add_radio_actions.<locals>._process_actionZchanged)NNNNr)rRr$r,)	r1r�rIZ	on_changerZfirst_actionr�r�r}rr�r�add_radio_actions\szActionGroup.add_radio_actions)N)N)NNN)rrrr
rrwr2rr�r�r�rrrrrw�s�
-
1rwc@seZdZdd�Zddd�ZdS)�	UIManagercCs*t|t�std��t|�}tj�|||�S�Nzbuffer must be a string)rrr$�_get_utf8_lengthrr��add_ui_from_string�r1�buffer�lengthrrrr��s
zUIManager.add_ui_from_stringrgcCstj�|||�Sr+)rr��insert_action_groupr�rrrr��szUIManager.insert_action_groupN)rg)rrrr�r�rrrrr��sr�c@seZdZeejj�ZdS)�ComboBoxN)rrrr	rr�Zget_active_iterrrrrr��sr�c@seZdZeejjded�ZdS)�Box)�homogeneousZspacingrrN)rrrr
rr�r2rrrrrr��s�r�c@s(eZdZeejjddejjie	d�ZdS)�	SizeGroup)�moder�)rsZdeprecated_defaultsrtN)
rrrr
rr�r2Z
SizeGroupModeZVERTICALrrrrrr��s

�r�c@seZdZeejjded�ZdS)�MenuItem�rorrN)rrrr
rr�r2rrrrrr��s�r�cCs*t|t�st�t|t�s"|�d�}t|�S)Nzutf-8)rr�AssertionError�bytes�encoder#)�stringrrrr��s

r�c@s$eZdZdd�Zdd�Zdd�ZdS)�BuildercCs|�t|�dS)a�Connect signals specified by this builder to a name, handler mapping.

        Connect signal, name, and handler sets specified in the builder with
        the given mapping "obj_or_map". The handler/value aspect of the mapping
        can also contain a tuple in the form of (handler [,arg1 [,argN]])
        allowing for extra arguments to be passed to the handler. For example:

        .. code-block:: python

            builder.connect_signals({'on_clicked': (on_clicked, arg1, arg2)})
        N)Zconnect_signals_fullr.)r1r&rrr�connect_signals�szBuilder.connect_signalscCs*t|t�std��t|�}tj�|||�Sr�)rrr$r�rr��add_from_stringr�rrrr��s
zBuilder.add_from_stringcCs,t|t�std��t|�}tj�||||�Sr�)rrr$r�rr��add_objects_from_string)r1r�Z
object_idsr�rrrr��s
zBuilder.add_objects_from_stringN)rrrr�r�r�rrrrr��sr�)�type�)rsrt�
stacklevelc@seZdZdd�ZdS)�WindowcOs tstd��t|f|�|�dS)NzRGtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case.)�initialized�RuntimeError�_window_init�r1r)rbrrrr2s
�zWindow.__init__N)rrrr2rrrrr�sr�c@s\eZdZdZeejjddddd�ed�Z	dd	�Zd
d�Z
edd
��Zedd
��Z
dd�ZdS)�Dialog)�title�parentr-�buttons�_buttons_property)r��
transient_forr-�add_buttonsr�)r-r�r�r�)r�r�)rs�ignore�deprecated_aliasesrtcOs�|��}tt|j|��}|�|�d}|jtkrF|jjtjkrF|d7}|�dd�}|dk	r�t	|t
j�s�tj
dt|d�|�dd�nd}|�dd�}|r�tj
dt|d�|t
jj@r�d	|d
<|t
jj@r�d	|d<|j||�|r�|j|�dS)Nrrr�z�The "buttons" argument must be a Gtk.ButtonsType enum value. Please use the "add_buttons" method for adding buttons. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations�r�r-rz�The "flags" argument for dialog construction is deprecated. Please use initializer keywords: modal=True and/or destroy_with_parent=True. See: https://wiki.gnome.org/PyGObject/InitializerDeprecationsTZmodalZdestroy_with_parent)�copy�dict�zip�_old_arg_names�updater>r�r2rrrZButtonsType�warnings�warnr�popZDialogFlagsZMODALZDESTROY_WITH_PARENT�_initr�)r1r)rb�
new_kwargsZ
old_kwargsr�r�r-rrrr2s6
��zDialog.__init__cOsTt|j��@t��.tjj|f|�|�W5QR�W5QR�SQRXW5QRXdSr+)rZdestroyrrr��runr�rrrr�Fsz
Dialog.runcCs|��Sr+)Zget_action_area�Zdialogrrr�<lambda>K�zDialog.<lambda>cCs|��Sr+)Zget_content_arear�rrrr�Lr�cGs*dd�}||�D]\}}|�||�qdS)a
        The add_buttons() method adds several buttons to the Gtk.Dialog using
        the button data passed as arguments to the method. This method is the
        same as calling the Gtk.Dialog.add_button() repeatedly. The button data
        pairs - button text (or stock ID) and a response ID integer are passed
        individually. For example:

        .. code-block:: python

            dialog.add_buttons(Gtk.STOCK_OPEN, 42, "Close", Gtk.ResponseType.CLOSE)

        will add "Open" and "Close" buttons to dialog.
        cssR|rNz|dd�\}}Wntk
r4td��YnX|dd�}||fVqdS)Nrrz%Must pass an even number of arguments)rC)�b�t�rrrr�_button\sz#Dialog.add_buttons.<locals>._buttonN)Z
add_button)r1r)r�riZresponserrrr�Ns	zDialog.add_buttonsN)rrrr�r
rr�r2rr�r��propertyZaction_areaZvboxr�rrrrr�s��*r�c@s6eZdZeejjdddd�ed�Zdd�Zdd	�Z	d
S)�
MessageDialog)r�r-�message_typer��message_formatr�r�)rir��rsr�rtcCs|�dd�|�d|�dS)N�secondary-use-markupF�secondary-text�Zset_property�r1r�rrr�format_secondary_textusz#MessageDialog.format_secondary_textcCs|�dd�|�d|�dS)Nr�Tr�r�r�rrr�format_secondary_markupysz%MessageDialog.format_secondary_markupN)
rrrr
rr�r2rr�r�rrrrr�ms��r�c@seZdZeejjded�ZdS)�ColorSelectionDialog�r�rrN)rrrr
rr�r2rrrrrr��s�r�c@seZdZeejjded�ZdS)�FileChooserDialog)r�r�r}r�rrN)rrrr
rr�r2rrrrrr��s�r�c@seZdZeejjded�ZdS)�FontSelectionDialogr�rrN)rrrr
rr�r2rrrrrr��s�r�c@s$eZdZeejjdddied�ZdS)�RecentChooserDialog)r�r��recent_managerr�r�Zmanagerr�N)rrrr
rr�r2rrrrrr��s
�r�c@sBeZdZeejjded�Zeejj	�Z	eejj
�Z
eejj�ZdS)�IconView��modelrrN)rrrr
rr�r2rr	Zget_item_at_pos�get_visible_rangeZget_dest_item_at_posrrrrr��s�r�c@seZdZeejjded�ZdS)�
ToolButton)rqrrN)rrrr
rr�r2rrrrrr��s�r�c@seZdZeejj�ZdS)�	IMContextN)rrrr	rr�Zget_surroundingrrrrr��sr�c@seZdZeejj�ZdS)�
RecentInfoN)rrrr	rr�Zget_application_inforrrrr��sr�c@s^eZdZddd�Zddd�Zddd	�Zdd
d�Zdd
�Zdd�Zddd�Z	e
ejj
dd�Z
dS)�
TextBufferNcKs&tjfd|i|��}|���|�|S)a�Creates a tag and adds it to the tag table of the TextBuffer.

        :param str tag_name:
            Name of the new tag, or None
        :param **properties:
            Keyword list of properties and their values

        This is equivalent to creating a Gtk.TextTag and then adding the
        tag to the buffer's tag table. The returned tag is owned by
        the buffer's tag table.

        If ``tag_name`` is None, the tag is anonymous.

        If ``tag_name`` is not None, a tag called ``tag_name`` must not already
        exist in the tag table for this buffer.

        Properties are passed as a keyword list of names and values (e.g.
        foreground='DodgerBlue', weight=Pango.Weight.BOLD)

        :returns:
            A new tag.
        rZ)rZTextTag�
get_tag_table�add)r1Ztag_nameZ
properties�tagrrr�
create_tag�szTextBuffer.create_tagFcCstj�||||�Sr+)rr��create_mark)r1Z	mark_name�whereZleft_gravityrrrr��szTextBuffer.create_markrgcCstj�|||�dSr+)rr��set_text�r1rir�rrrr��szTextBuffer.set_textcCs0t|t�stdt|���tj�||||�dS�Nztext must be a string, not %s)rrr$r�rr��insert)r1rRrir�rrrr��s
zTextBuffer.insertcGsB|��}|�||�|sdS|�|�}|D]}|�|||�q*dSr+)Z
get_offsetr�Zget_iter_at_offsetZ	apply_tag)r1rRri�tagsZstart_offset�startr�rrr�insert_with_tags�s
zTextBuffer.insert_with_tagscGsLg}|D],}|���|�}|s*td|��|�|�q|j||f|��dS)Nzunknown text tag: %s)r��lookuprCrr�)r1rRrir�Ztag_objsr�Ztag_objrrr�insert_with_tags_by_namesz#TextBuffer.insert_with_tags_by_namecCs.t|t�stdt|���tj�|||�dSr�)rrr$r�rr��insert_at_cursorr�rrrr�s
zTextBuffer.insert_at_cursorrrk)N)F)rg)rg)rg)rrrr�r�r�r�r�r�r�r	rr�rlrrrrr��s




r�c@s$eZdZeejj�Zeejj�ZdS)�TextIterN)rrrr	rr�Zforward_searchZbackward_searchrrrrr�#sr�cseZdZdd�Zdd�ZeZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zee
jj�Zee
jj�Zee
jj�Zee
jj�Zee
jjed�Z�fdd�Z�fdd�Z�fdd�Zdd�Zdd�Zdd�Zdd�Z�fd d!�Z�fd"d#�Z�fd$d%�Z�fd&d'�Z�fd(d)�Z �Z!S)*�	TreeModelcCs
|�d�Sr+)Ziter_n_childrenr3rrrrO-szTreeModel.__len__cCsdSrTrr3rrrrU0szTreeModel.__bool__cCs�t|tj�r|St|t�rL|dkrLt|�|}|dkrBtd|��|�|�Sz|�|�}Wn tk
rztd|��YnX|SdS)Nrzrow index is out of bounds: %dzcould not find tree path '%s')rr�TreeIter�intr#�
IndexError�get_iterrC)r1�key�index�aiterrrr�_getiter6s
zTreeModel._getitercCst|tj�r|St|�SdSr+)rr�TreePath�r1�pathrrr�_coerce_pathEszTreeModel._coerce_pathcCs|�|�}t||�Sr+)r��TreeModelRow�r1r�r�rrr�__getitem__Ks
zTreeModel.__getitem__cCs||}|�|j|�dSr+)�set_rowrR)r1r�rI�rowrrr�__setitem__OszTreeModel.__setitem__cCs|�|�}|�|�dSr+)r��remover�rrr�__delitem__Ss
zTreeModel.__delitem__cCst||���Sr+)�TreeModelRowIter�get_iter_firstr3rrrrSWszTreeModel.__iter__zinvalid tree pathcs2|�|�}tt|��|�\}}|s.td|��|S)Nzinvalid tree path '%s')r�r;r�r�rC)r1r��successr�r=rrr�as

zTreeModel.get_itercs$|��}tt|��|�}|r |SdSr+)r�r;r��	iter_next)r1r��	next_iterrr=rrrhszTreeModel.iter_nextcs$|��}tt|��|�}|r |SdSr+)r�r;r��
iter_previous)r1r��	prev_iterrr=rrr	nszTreeModel.iter_previouscCsvt|t�rtd��|��}t|�|kr.td��g}g}t|�D].\}}|dkrPq>|�|�||��|�|�q>||fS)Nz%Expected a list or tuple, but got strz1row sequence has the incorrect number of elements)	r�strr$�
get_n_columnsr#rC�	enumerater�_convert_value)r1r�	n_columns�result�columnsZcur_colrIrrr�_convert_rowts
zTreeModel._convert_rowcCs.|�|�\}}|D]}|�||||�qdSr+)r�	set_value)r1�treeiterrZ
converted_rowr�columnrrrr��szTreeModel.set_rowcCs"t|tj�r|St�|�|�|�S)z5Convert value to a GObject.Value of the expected type)rrrDZget_column_type)r1rrIrrrr�szTreeModel._convert_valuecGsZ|��}g}|D]@}t|t�s&td��|dks6||kr>td��|�|�||��qt|�S)Nzcolumn numbers must be intsrzcolumn number is out of range)rrr�r$rCrrG�tuple)r1rrr�values�colrrrr�s
z
TreeModel.getcstt|��|�|�|�Sr+)r;r��row_changedr��r1r�rRr=rrr�szTreeModel.row_changedcstt|��|�|�|�Sr+)r;r��row_insertedr�rr=rrr�szTreeModel.row_insertedcstt|��|�|�|�Sr+)r;r��row_has_child_toggledr�rr=rrr�s�zTreeModel.row_has_child_toggledcstt|��|�|��Sr+)r;r��row_deletedr�r�r=rrr�szTreeModel.row_deletedcstt|��|�|�||�Sr+)r;r��rows_reorderedr�)r1r�rRZ	new_orderr=rrr�s�zTreeModel.rows_reordered)"rrrrOrUrdr�r�r�rrrSr	rr�r�
iter_childrenZiter_nth_child�iter_parentZget_iter_from_stringrCr�rr	rr�rrrrrrrrLrrr=rr�,s:�r�cs<eZdZeejjdd�Zd�fdd�	Zd	�fdd�	Z�Z	S)
�TreeSortable)NNrkNcstt|��|||�dSr+)r;r!�
set_sort_func)r1Zsort_column_id�	sort_funcrr=rrr"�szTreeSortable.set_sort_funccstt|��||�dSr+)r;r!�set_default_sort_func)r1r#rr=rrr$�sz"TreeSortable.set_default_sort_func)N)N)
rrrr	rr!Zget_sort_column_idr"r$rLrrr=rr!�sr!c@seZdZeejjded�ZdS)�
TreeModelSortr�rrN)rrrr
rr%r2rrrrrr%�s�r%c@s^eZdZdd�Zdd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	dd�Z
dd�ZdS)�	ListStorecGstj�|�|�|�dSr+)rr&r2�set_column_types�r1Zcolumn_typesrrrr2�szListStore.__init__cCs8|dk	r&|�|�\}}|�|||�}ntj�||�}|Sr+)rZinsert_with_valuesvrr&r�)r1rjrrrrrr�
_do_insert�s
zListStore._do_insertNcCs |r|�d|�Stj�|�SdSrf)r)rr&r�r1rrrrr�szListStore.appendcCs|�d|�S�Nr�r)r*rrr�prepend�szListStore.prependcCs|�||�Sr+r,)r1rjrrrrr��szListStore.insertcCsB|dk	r4|dkrd}n|�|���d}|�||�Stj�||�Srf)�get_path�get_indicesr)rr&�
insert_before�r1�siblingrrjrrrr0�szListStore.insert_beforecCsF|dk	r8|dkrd}n|�|���dd}|�||�Stj�||�S�Nrrgr)r.r/r)rr&�insert_afterr1rrrr4�szListStore.insert_aftercCs"|�||�}tj�||||�dSr+)rrr&r�r1rrrIrrrrszListStore.set_valuecs���fdd�}|r�t|dt�r@||ddd�|ddd��nlt|dttf�rzt|�dkrftd��||d|d�n2t|dt�r�|t|d�|d���ntd��dS)Ncsxt|�t|�krtd��g}g}t||�D]6\}}t|t�sDtd��|�|�|���||��q*tj�	��||�dS�Nz7The number of columns do not match the number of valuesz0TypeError: Expected integer argument for column.)
r#r$r�rr�rrrr&�set�ZcolsZvalsrrZcol_numrI�r1rrr�
_set_lists
s

z!ListStore.set.<locals>._set_listsrrr�Too many arguments��Argument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}.  No -1 termination is needed.)rr�r�listr#r$r�r�r1rr)r:rr9rr7	s z
ListStore.set)N)N)N)N)N�rrrr2r)rr-r�r0r4rr7rrrrr&�s	






r&c@s|eZdZdd�Zedd��Zedd��Zedd��Zed	d
��Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)r�cCsht|tj�stdt|�j��||_t|tj�r>|�|�|_	n&t|tj
�rR||_	ntdt|�j��dS)Nz expected Gtk.TreeModel, %s foundz/expected Gtk.TreeIter or Gtk.TreePath, %s found)rrr�r$r�rr�r�r�rRr�)r1r�Ziter_or_pathrrrr2,s�zTreeModelRow.__init__cCs|j�|j�Sr+)r�r.rRr3rrrr�8szTreeModelRow.pathcCs|��Sr+)�get_nextr3rrr�next<szTreeModelRow.nextcCs|��Sr+)�get_previousr3rrr�previous@szTreeModelRow.previouscCs|��Sr+)�
get_parentr3rrrr�DszTreeModelRow.parentcCs"|j�|j�}|rt|j|�SdSr+)r�rrRr�)r1rrrrr@HszTreeModelRow.get_nextcCs"|j�|j�}|rt|j|�SdSr+)r�r	rRr�)r1r
rrrrBMszTreeModelRow.get_previouscCs"|j�|j�}|rt|j|�SdSr+)r�r rRr�)r1Zparent_iterrrrrDRszTreeModelRow.get_parentcs�t|t�rH|�j��kr&td|��n|dkr8��|�}�j��j|�St|t�r�|�	�j���\}}}g}t
|||�D]}|��j��j|��qx|St|t�r��fdd�|D�St
dt|�j��dS)N�!column index is out of bounds: %drcsg|]}�|�qSrr)rY�kr3rrr\esz,TreeModelRow.__getitem__.<locals>.<listcomp>z0indices must be integers, slice or tuple, not %s)rr�r�rr��_convert_negative_indexrGrR�slice�indices�rangerrr$r�r)r1r�r��stop�stepZalist�irr3rr�Ws"



�zTreeModelRow.__getitem__c
Cs4t|t�rL||j��kr&td|��n|dkr8|�|�}|j�|j||�n�t|t�r�|�	|j���\}}}t
|||�}t|�t|�kr�tdt|�t|�f��t
|�D]\}}|j�|j|||�q�nft|t��rt|�t|�kr�tdt|�t|�f��t||�D]\}	}|||	<�qntdt|�j��dS)NrErz9attempt to assign sequence of size %d to slice of size %dz<attempt to assign sequence of size %d to sequence of size %dz2indices must be an integer, slice or tuple, not %s)rr�r�rr�rGrrRrHrIrJr#rCr
rr�r$r�r)
r1r�rIr�rKrLZ	indexListrM�vrFrrrrjs:


�����zTreeModelRow.__setitem__cCs&|j��|}|dkr"td|��|S)NrrE)r�rr�)r1r�Z	new_indexrrrrG�sz$TreeModelRow._convert_negative_indexcCs|j�|j�}t|j|�Sr+)r�rrRr)r1Z
child_iterrrr�iterchildren�szTreeModelRow.iterchildrenN)rrrr2r�r�rArCr�r@rBrDr�rrGrOrrrrr�*s 



r�c@s(eZdZdd�Zdd�ZeZdd�ZdS)rcCs||_||_dSr+)r�rR)r1r�r�rrrr2�szTreeModelRowIter.__init__cCs,|js
t�t|j|j�}|j�|j�|_|Sr+)rR�
StopIterationr�r�rr*rrr�__next__�s
zTreeModelRowIter.__next__cCs|Sr+rr3rrrrS�szTreeModelRowIter.__iter__N)rrrr2rQrArSrrrrr�srcsveZdZddd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Z�ZS)r�rcCs|t|t�rt|�}nt|t�s2d�dd�|D��}t|�dkrJtd|��zt�|�WStk
rvtd|��YnXdS)N�:css|]}t|�VqdSr+)r)rY�valrrr�	<genexpr>�sz#TreePath.__new__.<locals>.<genexpr>rz-could not parse subscript '%s' as a tree path)	rr�rr�joinr#r$r�Znew_from_string)�clsr�rrr�__new__�s


zTreePath.__new__cstt|���dSr+)r;r�r2r�r=rrr2�szTreePath.__init__cCs|��p
dS)N�)Z	to_stringr3rrr�__str__�szTreePath.__str__cCs|dk	o|�|�dkSr+�Zcompare�r1�otherrrr�__lt__�szTreePath.__lt__cCs|dk	o|�|�dkSr+rZr[rrr�__le__�szTreePath.__le__cCs|dk	o|�|�dkSr+rZr[rrr�__eq__�szTreePath.__eq__cCs|dkp|�|�dkSr+rZr[rrr�__ne__�szTreePath.__ne__cCs|dkp|�|�dkSr+rZr[rrr�__gt__�szTreePath.__gt__cCs|dkp|�|�dkSr+rZr[rrr�__ge__�szTreePath.__ge__cCst|���Sr+)rRr/r3rrrrS�szTreePath.__iter__cCs|��Sr+)Z	get_depthr3rrrrO�szTreePath.__len__cCs|��|Sr+)r/)r1r�rrrr��szTreePath.__getitem__)r)rrrrWr2rYr]r^r_r`rarbrSrOr�rLrrr=rr��s

r�c@s^eZdZdd�Zdd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	dd�Z
dd�ZdS)�	TreeStorecGstj�|�|�|�dSr+)rrcr2r'r(rrrr2�szTreeStore.__init__cCs<|dk	r(|�|�\}}|�||||�}ntj�|||�}|Sr+)rZinsert_with_valuesrrcr�)r1r�rjrrrrrrr)�s
zTreeStore._do_insertNcCs|�|d|�Srfr,�r1r�rrrrr�szTreeStore.appendcCs|�|d|�Sr+r,rdrrrr-�szTreeStore.prependcCs|�|||�Sr+r,)r1r�rjrrrrr��szTreeStore.insertcCsX|dk	rH|dkrd}n$|dkr(|�|�}|�|���d}|�|||�Stj�|||�Srf)r r.r/r)rrcr0�r1r�r2rrjrrrr0�s
zTreeStore.insert_beforecCs\|dk	rL|dkrd}n(|dkr(|�|�}|�|���dd}|�|||�Stj�|||�Sr3)r r.r/r)rrcr4rerrrr4s
zTreeStore.insert_aftercCs"|�||�}tj�||||�dSr+)rrrcrr5rrrrszTreeStore.set_valuecs���fdd�}|r�t|dt�r@||ddd�|ddd��nlt|dttf�rzt|�dkrftd��||d|d�n2t|dt�r�||d��|d���ntd��dS)Ncsxt|�t|�krtd��g}g}t||�D]6\}}t|t�sDtd��|�|�|���||��q*tj�	��||�dSr6)
r#r$r�rr�rrrrcr7r8r9rrr:s

z!TreeStore.set.<locals>._set_listsrrrr;r<)	rr�rr=r#r$r��keysrr>rr9rr7s z
TreeStore.set)N)N)N)N)Nr?rrrrrc�s	




rccs�eZdZeejjded�Zeejj	�Z	eejj
�Z
eejj�Z�fdd�Z�fdd�Z
d�fd
d�	Zd�fdd
�	Zd�fdd�	Zdd�Z�ZS)�TreeViewr�rrcs t|�}tt|��|||�dSr+)rr;rg�enable_model_drag_source)r1Zstart_button_maskr�actionsrr=rrrh=s
�z!TreeView.enable_model_drag_sourcecst|�}tt|��||�dSr+)rr;rg�enable_model_drag_dest)r1rrirr=rrrjCs�zTreeView.enable_model_drag_destNF�cs0t|tj�st|�}tt|��|||||�dSr+)rrr�r;rg�scroll_to_cell)r1r�rZ	use_alignZ	row_alignZ	col_alignr=rrrlHszTreeView.scroll_to_cellcs,t|tj�st|�}tt|��|||�dSr+)rrr�r;rg�
set_cursor)r1r�rZ
start_editingr=rrrmMszTreeView.set_cursorcs&t|tj�st|�}tt|��||�Sr+)rrr�r;rg�
get_cell_area)r1r�rr=rrrnRszTreeView.get_cell_areacKs:t�}|�|�|�|d�|�||�|j|f|�dS)NF)�TreeViewColumnZ	set_title�
pack_startZ
insert_column�set_attributes)r1rjr�Zcellrbrrrr�insert_column_with_attributesWs

z&TreeView.insert_column_with_attributes)NFrkrk)NF)N)rrrr
rrgr2rr	Zget_path_at_posr�Zget_dest_row_at_posrhrjrlrmrnrrrLrrr=rrg4s�rgcs<eZdZd	dd�Zeejj�Zd
�fdd�	Zdd�Z	�Z
S)rorXNcKsDtjj||d�|r |�|d�|��D]\}}|�|||�q(dS)Nr�T)rror2rpr`�
add_attribute)r1r��
cell_renderer�
attributesrZrIrrrr2ds
zTreeViewColumn.__init__cstt|��|||�dSr+)r;ro�set_cell_data_func)r1rt�funcZ	func_datar=rrrvpsz!TreeViewColumn.set_cell_data_funccKs6tj�||�|��D]\}}tj�||||�qdSr+)rZ
CellLayoutZclear_attributesr`rs)r1rtrurZrIrrrrqsszTreeViewColumn.set_attributes)rXN)N)rrrr2r	rroZcell_get_positionrvrqrLrrr=rrocs�

rocs4eZdZ�fdd�Z�fdd�Z�fdd�Z�ZS)�
TreeSelectioncs(t|tj�st|�}tt|��|�dSr+)rrr�r;rx�select_pathr�r=rrry�szTreeSelection.select_pathcs,tt|���\}}}|r ||fS|dfSdSr+)r;rx�get_selected)r1rr�r�r=rrrz�szTreeSelection.get_selectedcstt|���\}}||fSr+)r;rx�get_selected_rows)r1�rowsr�r=rrr{�szTreeSelection.get_selected_rows)rrrryrzr{rLrrr=rrx~s	rxc@s*eZdZeejjddedd�Zdd�ZdS)�Button)ro�stock�	use_stock�
use_underline)r~r�)rsr�rtr�cOsld|kr\|dr\tjdtdd�|��}|d|d<d|d<d|d<|d=tjj|f|�n|j||�dS)	Nr~zKStock items are deprecated. Please use: Gtk.Button.new_with_mnemonic(label)rr�roTrr�)r�r�rr�rr}r2r�)r1r)rbr�rrrr2�s�zButton.__init__N)	rrrr
rr}r2rr�rrrrr}�s�r}c@seZdZeejjded�ZdS)�
LinkButton)ZurirorrN)rrrr
rr�r2rrrrrr��s�r�c@seZdZeejjded�ZdS)�Labelr�rrN)rrrr
rr�r2rrrrrr��s�r�c@s0eZdZeejjdddd�edd�Zdd�Zd	S)
�
Adjustment)rI�lower�upper�step_increment�page_incrementZ	page_sizeZ	page_incrZ	step_incr)r�r�r�)rsr�rtr�cOsB|j||�d|kr$|�|d�nt|�dkr>|�|d�dS)NrIrr)r�rr#r�rrrr2�s
zAdjustment.__init__N)	rrrr
rr�r2rr�rrrrr��s��r�c@sPeZdZeejjdddd�ed�Zejj	ejj
Bejj	ejj
Bddfdd�Zd	S)
�Table)�n_rowsrr�r|r)r�rr�rc

Cs"tj�||||||||||	�
dSr+)rr��attach)
r1rPZleft_attachZright_attachZ
top_attachZ
bottom_attachZxoptionsZyoptionsZxpaddingZypaddingrrrr��szTable.attachN)rrrr
rr�r2rZ
AttachOptionsZEXPANDZFILLr�rrrrr��s�r�c@seZdZeejjded�ZdS)�ScrolledWindow�ZhadjustmentZvadjustmentrrN)rrrr
rr�r2rrrrrr��s�r�c@seZdZeejjded�ZdS)�
HScrollbar�Z
adjustmentrrN)rrrr
rr�r2rrrrrr��s�r�c@seZdZeejjded�ZdS)�
VScrollbarr�rrN)rrrr
rr�r2rrrrrr�s�r�cs,eZdZd�fdd�	Zd�fdd�	Z�ZS)	�PanedFTcstt|��|||�dSr+)r;r��pack1�r1rPZresizeZshrinkr=rrr�
szPaned.pack1cstt|��|||�dSr+)r;r��pack2r�r=rrr�szPaned.pack2)FT)TT)rrrr�r�rLrrr=rr�sr�c@seZdZeejjded�ZdS)�Arrow)Z
arrow_typeZshadow_typerrN)rrrr
rr�r2rrrrrr�s�r�cs&eZdZddd�Z�fdd�Z�ZS)�IconSetNcCs6|dk	r&tjdtdd�tj�|�}ntj�|�}|S)NzXGtk.IconSet(pixbuf) has been deprecated. Please use: Gtk.IconSet.new_from_pixbuf(pixbuf)rr�)r�r�rrr�Znew_from_pixbufrW)rVZpixbufZiconsetrrrrW"s�zIconSet.__new__cstt|���Sr+)r;r�r2r�r=rrr2,szIconSet.__init__)N)rrrrWr2rLrrr=rr�!s

r�c@seZdZeejjded�ZdS)�Viewportr�rrN)rrrr
rr�r2rrrrrr�3s�r�cs&eZdZd�fdd�	Zdd�Z�ZS)�TreeModelFilterNcstt|��||�dSr+)r;r��set_visible_func)r1rw�datar=rrr�>sz TreeModelFilter.set_visible_funccCs |�|�}|���|||�dSr+)Zconvert_iter_to_child_iterZ	get_modelr)r1rRrrIrrrrAs
zTreeModelFilter.set_value)N)rrrr�rrLrrr=rr�=sr�rWc@seZdZdd�ZdS)�Menuc	Cs|�d||||||�dSr+)Zpopup_for_device)r1Zparent_menu_shellZparent_menu_itemrwr�ZbuttonZ
activate_timerrr�popupLsz
Menu.popupN)rrrr�rrrrr�Ksr�cGs
t�dSr+)�_Gtk_main_quit)r)rrr�	main_quitTsr�cOsJttj��6t��$t||�W5QR�W5QR�SQRXW5QRXdSr+)rrr�r�	_Gtk_main)r)rbrrr�main\sr��stock_lookupr:)a�sysr��version_info�collectionsrZ
gi.repositoryrZ_ossighelperrrZ_gtktemplaterZ	overridesrr	r
�modulerZ_compatrZgir
r�__all__rrKZwarn_msgr��RuntimeWarningrrr*r.�objectr/r9rMrermrurwr�r�r�r�r�r�r�r�r2r�r�r�r�r�r�r�r�r�r�r�r�r�r�r!r%r&r�rr�rcrgrorxr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Z
init_checkr��argvr=rrrr�<module>s�





!
+









 
�	
W










J





Q
g

1
P
+