????

Your IP : 3.147.67.34


Current Path : /lib/python3.9/site-packages/gi/overrides/__pycache__/
Upload File :
Current File : //lib/python3.9/site-packages/gi/overrides/__pycache__/Gtk.cpython-39.pyc

a

��T`��c@s�	ddlZddlZddlmZddlmZmZddlmZm	Z	ddl
mZmZm
Z
mZddlmZddlmZed	�Zejd
kZejdkZejdkZgZeZe�d
�e	Z	e�d�er�dZe�ee�Gdd�de�Ze�d�dd�Ze�d�dd�ZGdd�de �Z!Gdd�dej"�Z"ee"�Z"e�d�e�s:e�rbGdd�dej#e"�Z#ee#�Z#e�d�ne Z#Gdd�dej$�Z$ee$�Z$e�d�e�s�e�r&Gdd�dej%�Z%ee%�Z%e�d�Gd d!�d!ej&�Z&ee&�Z&e�d!�Gd"d#�d#ej'�Z'ee'�Z'e�d#�Gd$d%�d%ej(�Z(ee(�Z(e�d%�Gd&d'�d'ej)e#�Z)ee)�Z)e�d'�e�sXe�r|Gd(d)�d)ej*�Z*ee*�Z*e�d)�e�s�e�r�Gd*d+�d+ej+�Z+ee+�Z+e�d+�e�s�e�r�Gd,d-�d-ej,�Z,ee,�Z,e�d-�d.d/�Z-Gd0d1�d1ej.�Z.ee.�Z.e�d1�e�rej/j0Z1ne
ej/j0d2ed3d4�Z1Gd5d6�d6ej/�Z/ee/�Z/e�d6�Gd7d8�d8ej2e#�Z2ee2�Z2e�d8�e�s�e�r�Gd9d:�d:ej3e2�Z3ee3�Z3e�d:�e�s�e�r�Gd;d<�d<ej4�Z4ee4�Z4e�d<�Gd=d>�d>ej5�Z5ee5�Z5e�d>�e�se�r,Gd?d@�d@ej6�Z6ee6�Z6e�d@�e�s8e�r\GdAdB�dBej7�Z7ee7�Z7e�dB�GdCdD�dDej8�Z8ee8�Z8e�dD�e�s�e�r�GdEdF�dFej9�Z9ee9�Z9e�dF�GdGdH�dHej:�Z:ee:�Z:e�dH�GdIdJ�dJej;�Z;ee;�Z;e�dJ�GdKdL�dLej<�Z<ee<�Z<e�dL�GdMdN�dNej=�Z=ee=�Z=e�dN�GdOdP�dPej>�Z>ee>�Z>e�dP�GdQdR�dRej?�Z?ee?�Z?e�dR�e�s�e�r�GdSdT�dTej@�Z@ee@�Z@e�dT�GdUdV�dVejAe>e?�ZAeeA�ZAe�dV�GdWdX�dXe �ZBe�dX�GdYdZ�dZe �ZCe�dZ�Gd[d\�d\ejD�ZDeeD�ZDe�d\�Gd]d^�d^ejEe>e?�ZEeeE�ZEe�d^�Gd_d`�d`ejFe#�ZFeeF�ZFe�d`�Gdadb�dbejG�ZGeeG�ZGe�db�Gdcdd�ddejH�ZHeeH�ZHe�dd�e�s�e�rHGdedf�dfejIe#�ZIeeI�ZIe�df�Gdgdh�dhejJ�ZJeeJ�ZJe�dh�Gdidj�djejK�ZKeeK�ZKe�dj�Gdkdl�dlejL�ZLeeL�ZLe�dl�e�sxe�r�Gdmdn�dnejMe#�ZMeeM�ZMe�dn�Gdodp�dpejN�ZNeeN�ZNe�dp�e�s�e�rGdqdr�drejO�ZOeeO�ZOe�dr�Gdsdt�dtejP�ZPeeP�ZPe�dt�e�s"e�rFGdudv�dvejQ�ZQeeQ�ZQe�dv�e�sRe�r�Gdwdx�dxejR�ZReeR�ZRe�dx�Gdydz�dzejS�ZSeeS�ZSe�dz�Gd{d|�d|ejT�ZTeeT�ZTe�d|�Gd}d~�d~ejU�ZUeeU�ZUe�d~�e�	rGdd��d�ejV�ZVeeV�ZVe�d��e�	r6Gd�d��d�ejW�ZWeeW�ZWe�d��e�	sBe�	rrejXZYeejX�d�d���ZXejZZ[eejZ�d�d���ZZe�	s~e�	r�eej\�Z\e�d��e�	r�e�]�Z^ne�]ej_�\Z^Z_e`e_�e__dS)��N)�GObject�)�wakeup_on_signal�register_sigint_fallback)�Template�_extract_handler_and_args)�override�strip_boolean_result�deprecated_init�wrap_list_store_sort_func)�get_introspection_module)�PyGIDeprecationWarning�Gtkz2.0z3.0z4.0rraBYou 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�4/usr/lib/python3.9/site-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.
    )�
isinstancer
ZTargetEntry�new�append)�targets�target_entriesZentryrrr�_construct_target_listCsrc
Cs�t||�\}}|tjj@}	|durV|	r>|j|||g|�R�q�|j|||g|�R�n.|	rp|j||g|�R�n|j||g|�R�dS�N)rrZConnectFlagsZAFTERZconnect_object_afterZconnect_objectZ
connect_after�connect)
ZbuilderZgobjZsignal_nameZhandler_nameZconnect_obj�flags�
obj_or_mapZhandler�argsZafterrrr�_builder_connect_callbackTsrc@s$eZdZdd�Zdd�Zdd�ZdS)�_FreezeNotifyManagercCs
||_dSr)�obj)�selfr!rrr�__init__esz_FreezeNotifyManager.__init__cCsdSrr�r"rrr�	__enter__hsz_FreezeNotifyManager.__enter__cCs|j��dSr)r!Zthaw_child_notify)r"Zexc_typeZ	exc_valueZ	tracebackrrr�__exit__ksz_FreezeNotifyManager.__exit__N)rrrr#r%r&rrrrr dsr cs~eZdZeejj�Zer(dd�Zdd�Z	e
s0er<�fdd�Ze
sDerP�fdd�Z
e
sXerd�fd	d
�Ze
slervddd
�Z�ZS)�WidgetcCs|t|�vSr)�list�r"�childrrr�__contains__tszWidget.__contains__ccs |��}|r|V|��}qdSr)Zget_first_childZget_next_siblingr)rrr�__iter__wszWidget.__iter__cstt|���t|�Sr)�superr'�freeze_child_notifyr r$��	__class__rrr.~szWidget.freeze_child_notifycs8|dur$t|tj�s$tj�t|��}tt|��|�dSr)rr
�
TargetListrrr-r'�drag_dest_set_target_list�r"Ztarget_listr/rrr2�sz Widget.drag_dest_set_target_listcs8|dur$t|tj�s$tj�t|��}tt|��|�dSr)rr
r1rrr-r'�drag_source_set_target_listr3r/rrr4�sz"Widget.drag_source_set_target_listNcCsN|dur6|�|�}|dur*td||f��t�|j�}tj�|||�|��S)Nz/Class "%s" does not contain style property "%s")	Zfind_style_property�
ValueErrorr�Value�
value_typer
r'�style_get_property�	get_value)r"�
property_name�value�proprrrr8�s
�zWidget.style_get_property)N)rrrrr
r'Ztranslate_coordinates�GTK4r+r,�GTK2�GTK3r.r2r4r8�
__classcell__rrr/rr'osr'c@sVeZdZdd�Zdd�Zdd�Zdd�ZeZdd
d�Zdd
�Z	dd�Z
eej
j�Zd	S)�	ContainercCst|���Sr)�len�get_childrenr$rrr�__len__�szContainer.__len__cCs||��vSr)rCr)rrrr+�szContainer.__contains__cCst|���Sr)�iterrCr$rrrr,�szContainer.__iter__cCsdS�NTrr$rrr�__bool__�szContainer.__bool__NcCsP|dur6|�|�}|dur*td||f��t�|j�}tj�||||�|��S)Nz/Class "%s" does not contain child property "%s")	Zfind_child_propertyr5rr6r7r
rA�child_get_propertyr9)r"r*r:r;r<rrrrH�s
�zContainer.child_get_propertycs��fdd�|D�S)z<Returns a list of child property values for the given names.csg|]}���|��qSr)rH)�.0�name�r*r"rr�
<listcomp>��z'Container.child_get.<locals>.<listcomp>r)r"r*Z
prop_namesrrKr�	child_get�szContainer.child_getcKs0|��D]"\}}|�dd�}|�|||�qdS)z=Set a child properties on the given child to key/value pairs.Z_z-N)�itemsZreplaceZchild_set_property)r"r*�kwargsrJr;rrr�	child_set�szContainer.child_set)N)rrrrDr+r,rG�__nonzero__rHrNrQrr
rAZget_focus_chainrrrrrA�s
rAcs,eZdZ�fdd�Zeejjdd�Z�ZS)�Editablecstt|��|d|�S�N���)r-rS�insert_text)r"�text�positionr/rrrV�szEditable.insert_textr�Zfail_ret)	rrrrVrr
rS�get_selection_boundsr@rrr/rrS�srSc@seZdZeejjded�ZdS)�Action�rJ�label�tooltip�stock_id��	arg_names�categoryN)rrrr	r
r[r#rrrrrr[�s�r[c@seZdZeejjded�ZdS)�RadioAction�rJr]r^r_r;r`N)rrrr	r
rcr#rrrrrrc�s�rcc@s<eZdZeejjded�Zd
dd�Zddd�Z	ddd	�Z
dS)
�ActionGroup)rJr`NcsNzt|�Wnty&td��Yn0d��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�}|dur<�dur.|�d|�n|�d|����||�dS�Nr\Zactivate)r[r�add_action_with_accel)rJr_r]�acceleratorr^�callback�action�r"�	user_datarr�_process_actionsz0ActionGroup.add_actions.<locals>._process_action)NNNNN�rE�	TypeError�r"�entriesrmrn�errlr�add_actions�s
zActionGroup.add_actionscsNzt|�Wnty&td��Yn0d��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.
            rfNFcsXtj||||d�}|�|�|durH�dur:|�d|�n|�d|����||�dSrg)r
ZToggleAction�
set_activerrh)rJr_r]rir^rjZ	is_activerkrlrrrn?s
z7ActionGroup.add_toggle_actions.<locals>._process_action)NNNNNFrorqrrlr�add_toggle_actionsszActionGroup.add_toggle_actionsc	s�zt|�Wnty&td��Yn0d}d��fdd�	}|D] }||g|�R�}|dur@|}q@|dur�|dur�|dur�|�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.
            rfNrcsBt|||||d�}tr |�|��|kr2|�d���||�|S)NrdT)rcr?Z
join_grouprurh)Zgroup_sourcerJr_r]rir^Zentry_valuerk�r"r;rrrnqs

z6ActionGroup.add_radio_actions.<locals>._process_actionZchanged)NNNNr)rErpr)	r"rrr;Z	on_changermZfirst_actionrnrsrkrrwr�add_radio_actionsNszActionGroup.add_radio_actions)N)N)NNN)rrrr	r
rer#rrtrvrxrrrrre�s�
-
1rec@seZdZdd�Zddd�ZdS)�	UIManagercCs*t|t�std��t|�}tj�|||�S�Nzbuffer must be a string)r�strrp�_get_utf8_lengthr
ry�add_ui_from_string�r"�buffer�lengthrrrr}�s
zUIManager.add_ui_from_stringrUcCstj�|||�Sr)r
ry�insert_action_groupr~rrrr��szUIManager.insert_action_groupN)rU)rrrr}r�rrrrry�sryc@seZdZeejj�ZdS)�ComboBoxN)rrrrr
r�Zget_active_iterrrrrr��sr�c@seZdZeejjded�ZdS)�Box)�homogeneousZspacingr`N)rrrr	r
r�r#rrrrrr��s�r�c@s(eZdZeejjddejjie	d�ZdS)�	SizeGroup)�moder�)raZdeprecated_defaultsrbN)
rrrr	r
r�r#Z
SizeGroupModeZVERTICALrrrrrr��s

�r�c@seZdZeejjded�ZdS)�MenuItem�r]r`N)rrrr	r
r�r#rrrrrr��s�r�cCs*t|t�sJ�t|t�s"|�d�}t|�S)Nzutf-8)rr{ZbytesZencoderB)Zstringrrrr|�s

r|csNeZdZer.ddlmZe�Zd�fdd�	Zndd�Zdd	�Z	d
d�Z
�ZS)
�Builderr)�define_builder_scopeNcs&tt|���|r"|�t�|��dSr)r-r�r#Z	set_scope�BuilderScope)r"Zscope_object_or_mapr/rrr#�szBuilder.__init__cCs|�t|�dS)aConnect 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)r"rrrr�connect_signals�szBuilder.connect_signalscCs*t|t�std��t|�}tj�|||�Srz)rr{rpr|r
r��add_from_stringr~rrrr��s
zBuilder.add_from_stringcCs,t|t�std��t|�}tj�||||�Srz)rr{rpr|r
r��add_objects_from_string)r"rZ
object_idsr�rrrr��s
zBuilder.add_objects_from_string)N)rrrr=�_gtktemplater�r�r#r�r�r�r@rrr/rr��sr�)�type�)rarb�
stacklevelc@seZdZdd�ZdS)�WindowcOs&tstd��t|g|�Ri|��dS)NzRGtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case.)�initializedZRuntimeError�_window_init�r"rrPrrrr#s
�zWindow.__init__N)rrrr#rrrrr�sr�c@sdeZdZeserXdZeejj	ddddd�e
d�Zdd	�Z	d
d�Ze
dd
��Ze
dd
��Zdd�ZdS)�Dialog)�title�parentr�buttons�_buttons_property)r��
transient_forr�add_buttonsr�)rr�r�r�)r�r�)ra�ignore�deprecated_aliasesrbcOs�|��}tt|j|��}|�|�d}|jtkrF|jjtjkrF|d7}|�dd�}|dur�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|i|��|r�|j|�dS)Nr�r�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�rrz�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_namesZupdater0r�r#�getrr
ZButtonsType�warnings�warnrZpopZDialogFlagsZMODALZDESTROY_WITH_PARENT�_initr�)r"rrP�
new_kwargsZ
old_kwargsr�r�rrrrr#s2
��zDialog.__init__c	Os|t|j��^t��8tjj|g|�Ri|��Wd�Wd�S1sP0YWd�n1sn0YdSr)rZdestroyrr
r��runr�rrrr�Fsz
Dialog.runcCs|��Sr)Zget_action_area�Zdialogrrr�<lambda>KrMzDialog.<lambda>cCs|��Sr)Zget_content_arear�rrrr�LrMcGs*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.
        cssP|rLz|dd�\}}Wnty2td��Yn0|dd�}||fVqdS)Nrrz%Must pass an even number of arguments)r5)ZbZtZrrrr�_button\sz#Dialog.add_buttons.<locals>._buttonN)Z
add_button)r"rr�rWZresponserrrr�Ns	zDialog.add_buttonsN)rrrr>r?r�r	r
r�r#rr�r��propertyZaction_areaZvboxr�rrrrr�s��*r�c@s6eZdZeejjdddd�ed�Zdd�Zdd	�Z	d
S)�
MessageDialog)r�r�message_typer��message_formatr�r�)rWr��rar�rbcCs|�dd�|�d|�dS)N�secondary-use-markupF�secondary-text�Zset_property�r"r�rrr�format_secondary_textvsz#MessageDialog.format_secondary_textcCs|�dd�|�d|�dS)Nr�Tr�r�r�rrr�format_secondary_markupzsz%MessageDialog.format_secondary_markupN)
rrrr	r
r�r#rr�r�rrrrr�ns��r�c@seZdZeejjded�ZdS)�ColorSelectionDialog�r�r`N)rrrr	r
r�r#rrrrrr��s�r�c@seZdZeejjded�ZdS)�FileChooserDialog)r�r�rkr�r`N)rrrr	r
r�r#rrrrrr��s�r�c@seZdZeejjded�ZdS)�FontSelectionDialogr�r`N)rrrr	r
r�r#rrrrrr��s�r�c@s$eZdZeejjdddied�ZdS)�RecentChooserDialog)r�r��recent_managerr�r�Zmanagerr�N)rrrr	r
r�r#rrrrrr��s
�r�c@sJeZdZeser"eejjde	d�Ze
ejj�Ze
ejj�Ze
ejj
�Z
dS)�IconView��modelr`N)rrrr>r?r	r
r�r#rrZget_item_at_pos�get_visible_rangeZget_dest_item_at_posrrrrr��s�r�c@seZdZeejjded�ZdS)�
ToolButton)r_r`N)rrrr	r
r�r#rrrrrr��s�r�c@seZdZeejj�ZdS)�	IMContextN)rrrrr
r�Zget_surroundingrrrrr��sr�c@seZdZeejj�ZdS)�
RecentInfoN)rrrrr
r�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.
        rJ)r
ZTextTag�
get_tag_tableZadd)r"Ztag_nameZ
properties�tagrrr�
create_tag�szTextBuffer.create_tagFcCstj�||||�Sr)r
r��create_mark)r"Z	mark_nameZwhereZleft_gravityrrrr��szTextBuffer.create_markrUcCstj�|||�dSr)r
r��set_text�r"rWr�rrrr��szTextBuffer.set_textcCs0t|t�stdt|���tj�||||�dS�Nztext must be a string, not %s)rr{rpr�r
r��insert)r"rErWr�rrrr��s
zTextBuffer.insertcGsB|��}|�||�|sdS|�|�}|D]}|�|||�q*dSr)Z
get_offsetr�Zget_iter_at_offsetZ	apply_tag)r"rErW�tagsZstart_offset�startr�rrr�insert_with_tags�s
zTextBuffer.insert_with_tagscGsNg}|D],}|���|�}|s*td|��|�|�q|j||g|�R�dS)Nzunknown text tag: %s)r�Zlookupr5rr�)r"rErWr�Ztag_objsr�Ztag_objrrr�insert_with_tags_by_name
sz#TextBuffer.insert_with_tags_by_namecCs.t|t�stdt|���tj�|||�dSr�)rr{rpr�r
r��insert_at_cursorr�rrrr�s
zTextBuffer.insert_at_cursorrrY)N)F)rU)rU)rU)rrrr�r�r�r�r�r�r�rr
r�rZrrrrr��s




r�c@s$eZdZeejj�Zeejj�ZdS)�TextIterN)rrrrr
r�Zforward_searchZbackward_searchrrrrr�"sr�cs(eZdZdd�Zdd�Zes er$eZdd�Z�fdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zeejj�Zeejj�Zeejj�Zeejj�Zeejjed�Z�fdd�Z�fdd�Z�fdd�Zdd�Zdd�Zdd�Zd d!�Z�fd"d#�Z�fd$d%�Z �fd&d'�Z!�fd(d)�Z"�fd*d+�Z#�Z$S),�	TreeModelcCs
|�d�Sr)Ziter_n_childrenr$rrrrD,szTreeModel.__len__cCsdSrFrr$rrrrG/szTreeModel.__bool__cCs�t|tj�r|St|t�rL|dkrLt|�|}|dkrBtd|��|�|�Sz|�|�}Wntyxtd|��Yn0|SdS)Nrzrow index is out of bounds: %dzcould not find tree path '%s')rr
�TreeIter�intrB�
IndexError�get_iterr5)r"�key�index�aiterrrr�_getiter6s
zTreeModel._getitercs*tt|�}t|d�r|��St�|�SdS)N�sort_new_with_model)r-r��hasattrr��
TreeModelSort�new_with_model)r"Zsuper_objectr/rrr�Es

zTreeModel.sort_new_with_modelcCst|tj�r|St|�SdSr)rr
�TreePath�r"�pathrrr�_coerce_pathLszTreeModel._coerce_pathcCs|�|�}t||�Sr)r��TreeModelRow�r"r�r�rrr�__getitem__Rs
zTreeModel.__getitem__cCs||}|�|j|�dSr)�set_rowrE)r"r�r;�rowrrr�__setitem__VszTreeModel.__setitem__cCs|�|�}|�|�dSr)r�Zremover�rrr�__delitem__Zs
zTreeModel.__delitem__cCst||���Sr)�TreeModelRowIter�get_iter_firstr$rrrr,^szTreeModel.__iter__zinvalid tree pathcs2|�|�}tt|��|�\}}|s.td|��|S)Nzinvalid tree path '%s')r�r-r�r�r5)r"r��successr�r/rrr�hs

zTreeModel.get_itercs$|��}tt|��|�}|r |SdSr)r�r-r��	iter_next)r"r��	next_iterr�r/rrr�oszTreeModel.iter_nextcs$|��}tt|��|�}|r |SdSr)r�r-r��
iter_previous)r"r��	prev_iterr�r/rrr�uszTreeModel.iter_previouscCsvt|t�rtd��|��}t|�|kr.td��g}g}t|�D].\}}|durPq>|�|�||��|�|�q>||fS)Nz%Expected a list or tuple, but got strz1row sequence has the incorrect number of elements)	rr{rp�
get_n_columnsrBr5�	enumerater�_convert_value)r"r��	n_columnsZresult�columnsZcur_colr;rrr�_convert_row{s
zTreeModel._convert_rowcCs.|�|�\}}|D]}|�||||�qdSr)r��	set_value)r"�treeiterr�Z
converted_rowr��columnrrrr��szTreeModel.set_rowcCs"t|tj�r|St�|�|�|�S)z5Convert value to a GObject.Value of the expected type)rrr6Zget_column_type)r"r�r;rrrr��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�rpr5rr9�tuple)r"r�r�r��valuesZcolrrrr��s
z
TreeModel.getcstt|��|�|�|�Sr)r-r��row_changedr��r"r�rEr/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�)r"r�rEZ	new_orderr/rrr�s�zTreeModel.rows_reordered)%rrrrDrGr>r?rRr�r�r�r�r�r�r,rr
r�r��
iter_childrenZiter_nth_child�iter_parentZget_iter_from_stringr5r�r�r�r�r�r�r�rrrrrr@rrr/rr�+s<�r�cs<eZdZeejjdd�Zd�fdd�	Zd	�fdd�	Z�Z	S)
�TreeSortable)NNrYNcstt|��|||�dSr)r-r�
set_sort_func)r"Zsort_column_id�	sort_funcrmr/rrr	�szTreeSortable.set_sort_funccstt|��||�dSr)r-r�set_default_sort_func)r"r
rmr/rrr�sz"TreeSortable.set_default_sort_func)N)N)
rrrrr
rZget_sort_column_idr	rr@rrr/rr�src@s6eZdZeejjded�Zeejd�s2e	dd��Z
dS)r�r�r`r�cCs
t�|�Sr)r�r�)r"Zchild_modelrrrr��szTreeModelSort.new_with_modelN)rrrr	r
r�r#rr��classmethodr�rrrrr��s�r�c@s^eZdZdd�Zdd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	dd�Z
dd�ZdS)�	ListStorecGstj�|�|�|�dSr)r
r
r#�set_column_types�r"Zcolumn_typesrrrr#�szListStore.__init__cCs8|dur&|�|�\}}|�|||�}ntj�||�}|Sr)r�Zinsert_with_valuesvr
r
r�)r"rXr�r�r�rrr�
_do_insert�s
zListStore._do_insertNcCs |r|�d|�Stj�|�SdSrT)rr
r
r�r"r�rrrr�szListStore.appendcCs|�d|�S�Nr�rrrrr�prepend�szListStore.prependcCs|�||�Srr)r"rXr�rrrr��szListStore.insertcCsB|dur4|durd}n|�|���d}|�||�Stj�||�SrT)�get_path�get_indicesrr
r
�
insert_before�r"�siblingr�rXrrrr�szListStore.insert_beforecCsF|dur8|durd}n|�|���dd}|�||�Stj�||�S�NrrUr�)rrrr
r
�insert_afterrrrrrszListStore.insert_aftercCs"|�||�}tj�||||�dSr)r�r
r
r��r"r�r�r;rrrr�s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.)
rBrpr�rr�rr�r
r
�set�ZcolsZvalsr�r�Zcol_numr;�r"r�rr�
_set_listss

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�r(rBrpr�r��r"r�rr!rr rrs z
ListStore.set)N)N)N)N)N�rrrr#rrrr�rrr�rrrrrr
�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)rr
r�rpr�rr�r�r�rEr�)r"r�Ziter_or_pathrrrr#8s�zTreeModelRow.__init__cCs|j�|j�Sr)r�rrEr$rrrr�DszTreeModelRow.pathcCs|��Sr)�get_nextr$rrr�nextHszTreeModelRow.nextcCs|��Sr)�get_previousr$rrr�previousLszTreeModelRow.previouscCs|��Sr)�
get_parentr$rrrr�PszTreeModelRow.parentcCs"|j�|j�}|rt|j|�SdSr)r�r�rEr�)r"r�rrrr&TszTreeModelRow.get_nextcCs"|j�|j�}|rt|j|�SdSr)r�r�rEr�)r"r�rrrr(YszTreeModelRow.get_previouscCs"|j�|j�}|rt|j|�SdSr)r�rrEr�)r"Zparent_iterrrrr*^szTreeModelRow.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)rI�kr$rrrLqrMz,TreeModelRow.__getitem__.<locals>.<listcomp>z0indices must be integers, slice or tuple, not %s)rr�r�r�r��_convert_negative_indexr9rE�slice�indices�rangerr�rpr�r)r"r�r��stop�stepZalist�irr$rr�cs"



�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)Nr+rz9attempt 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�r-r�rEr.r/r0rBr5r�r�r�rpr�r)
r"r�r;r�r1r2Z	indexListr3Zvr,rrrr�vs:


�����zTreeModelRow.__setitem__cCs&|j��|}|dkr"td|��|S)Nrr+)r�r�r�)r"r�Z	new_indexrrrr-�sz$TreeModelRow._convert_negative_indexcCs|j�|j�}t|j|�Sr)r�rrEr�)r"Z
child_iterrrr�iterchildren�szTreeModelRow.iterchildrenN)rrrr#r�r�r'r)r�r&r(r*r�r�r-r4rrrrr�6s 



r�c@s0eZdZdd�Zdd�Zes er$eZdd�ZdS)r�cCs||_||_dSr)r�rE)r"r�r�rrrr#�szTreeModelRowIter.__init__cCs,|js
t�t|j|j�}|j�|j�|_|Sr)rEZ
StopIterationr�r�r�rrrr�__next__�s
zTreeModelRowIter.__next__cCs|Srrr$rrrr,�szTreeModelRowIter.__iter__N)	rrrr#r5r>r?r'r,rrrrr��s
r�csveZdZddd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Z�ZS)r�rcCszt|t�rt|�}nt|t�s2d�dd�|D��}t|�dkrJtd|��zt�|�WStyttd|��Yn0dS)Nz:css|]}t|�VqdSr)r{)rIZvalrrrZ	<genexpr>�rMz#TreePath.__new__.<locals>.<genexpr>rz-could not parse subscript '%s' as a tree path)rr�r{ZjoinrBrpr�Znew_from_string)�clsr�rrr�__new__�s


zTreePath.__new__cstt|���dSr)r-r�r#r�r/rrr#�szTreePath.__init__cCs|��p
dS)N�)Z	to_stringr$rrr�__str__�szTreePath.__str__cCs|duo|�|�dkSr�Zcompare�r"Zotherrrr�__lt__�szTreePath.__lt__cCs|duo|�|�dkSrr:r;rrr�__le__�szTreePath.__le__cCs|duo|�|�dkSrr:r;rrr�__eq__�szTreePath.__eq__cCs|dup|�|�dkSrr:r;rrr�__ne__�szTreePath.__ne__cCs|dup|�|�dkSrr:r;rrr�__gt__�szTreePath.__gt__cCs|dup|�|�dkSrr:r;rrr�__ge__�szTreePath.__ge__cCst|���Sr)rErr$rrrr,�szTreePath.__iter__cCs|��Sr)Z	get_depthr$rrrrD�szTreePath.__len__cCs|��|Sr)r)r"r�rrrr��szTreePath.__getitem__)r)rrrr7r#r9r<r=r>r?r@rAr,rDr�r@rrr/rr��s

r�c@s^eZdZdd�Zdd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	dd�Z
dd�ZdS)�	TreeStorecGstj�|�|�|�dSr)r
rBr#rrrrrr#�szTreeStore.__init__cCs<|dur(|�|�\}}|�||||�}ntj�|||�}|Sr)r�Zinsert_with_valuesr
rBr�)r"r�rXr�r�r�rrrr�s
zTreeStore._do_insertNcCs|�|d|�SrTr�r"r�r�rrrr�szTreeStore.appendcCs|�|d|�SrrrCrrrr�szTreeStore.prependcCs|�|||�Srr)r"r�rXr�rrrr�szTreeStore.insertcCsX|durH|durd}n$|dur(|�|�}|�|���d}|�|||�Stj�|||�SrT)rrrrr
rBr�r"r�rr�rXrrrrs
zTreeStore.insert_beforecCs\|durL|durd}n(|dur(|�|�}|�|���dd}|�|||�Stj�|||�Sr)rrrrr
rBrrDrrrrs
zTreeStore.insert_aftercCs"|�||�}tj�||||�dSr)r�r
rBr�rrrrr�s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�	��||�dSr)
rBrpr�rr�rr�r
rBrrr rrr!!s

z!TreeStore.set.<locals>._set_listsrrr�r"r#)	rr�r�r(rBrpr�Zkeysr�r$rr rr s z
TreeStore.set)N)N)N)N)Nr%rrrrrB�s	




rBcs�eZdZeser"eejjde	d�Ze
ejj�Ze
ejj�Ze
ejj
�Z
�fdd�Z�fdd�Zd�fd
d�	Zd�fdd
�	Zd�fdd�	Zdd�Z�ZS)�TreeViewr�r`cs t|�}tt|��|||�dSr)rr-rE�enable_model_drag_source)r"Zstart_button_maskr�actionsrr/rrrFKs
�z!TreeView.enable_model_drag_sourcecst|�}tt|��||�dSr)rr-rE�enable_model_drag_dest)r"rrGrr/rrrHQs�zTreeView.enable_model_drag_destNF�cs0t|tj�st|�}tt|��|||||�dSr)rr
r�r-rE�scroll_to_cell)r"r�r�Z	use_alignZ	row_alignZ	col_alignr/rrrJVszTreeView.scroll_to_cellcs,t|tj�st|�}tt|��|||�dSr)rr
r�r-rE�
set_cursor)r"r�r�Z
start_editingr/rrrK[szTreeView.set_cursorcs&t|tj�st|�}tt|��||�Sr)rr
r�r-rE�
get_cell_area)r"r�r�r/rrrL`szTreeView.get_cell_areacKs>t�}|�|�|�|d�|�||�|j|fi|��dS)NF)�TreeViewColumnZ	set_title�
pack_startZ
insert_column�set_attributes)r"rXr�ZcellrPr�rrr�insert_column_with_attributeses

z&TreeView.insert_column_with_attributes)NFrIrI)NF)N)rrrr>r?r	r
rEr#rrZget_path_at_posr�Zget_dest_row_at_posrFrHrJrKrLrPr@rrr/rrEAs�rEcs<eZdZd	dd�Zeejj�Zd
�fdd�	Zdd�Z	�Z
S)rMr8NcKsDtjj||d�|r |�|d�|��D]\}}|�|||�q(dS)Nr�T)r
rMr#rNrO�
add_attribute)r"r��
cell_renderer�
attributesrJr;rrrr#rs
zTreeViewColumn.__init__cstt|��|||�dSr)r-rM�set_cell_data_func)r"rR�funcZ	func_datar/rrrT~sz!TreeViewColumn.set_cell_data_funccKs6tj�||�|��D]\}}tj�||||�qdSr)r
Z
CellLayoutZclear_attributesrOrQ)r"rRrSrJr;rrrrO�szTreeViewColumn.set_attributes)r8N)N)rrrr#rr
rMZcell_get_positionrTrOr@rrr/rrMqs�

rMcs4eZdZ�fdd�Z�fdd�Z�fdd�Z�ZS)�
TreeSelectioncs(t|tj�st|�}tt|��|�dSr)rr
r�r-rV�select_pathr�r/rrrW�szTreeSelection.select_pathcs,tt|���\}}}|r ||fS|dfSdSr)r-rV�get_selected)r"r�r�r�r/rrrX�szTreeSelection.get_selectedcstt|���\}}||fSr)r-rV�get_selected_rows)r"�rowsr�r/rrrY�szTreeSelection.get_selected_rows)rrrrWrXrYr@rrr/rrV�s	rVc@sReZdZeejjddedd�Zdd�Ze	ej
d�r:dd	�Ze	ej
d
�rNdd�Zd
S)�Button)r]�stock�	use_stock�
use_underline)r\r�)rar�rbr�cOstd|vr`|dr`tjdtdd�|��}|d|d<d|d<d|d<|d=tjj|fi|��n|j|i|��dS)	Nr\zKStock items are deprecated. Please use: Gtk.Button.new_with_mnemonic(label)rr�r]Tr]r^)r�r�rr�r
r[r#r�)r"rrPr�rrrr#�s�zButton.__init__�set_focus_on_clickcOstjj|g|�Ri|��Sr)r
r'r_r�rrrr_�szButton.set_focus_on_click�get_focus_on_clickcOstjj|g|�Ri|��Sr)r
r'r`r�rrrr`�szButton.get_focus_on_clickN)
rrrr	r
r[r#rr�r�r'r_r`rrrrr[�s�r[c@seZdZeejjded�ZdS)�
LinkButton)Zurir]r`N)rrrr	r
rar#rrrrrra�s�rac@seZdZeejjded�ZdS)�Labelr�r`N)rrrr	r
rbr#rrrrrrb�s�rbc@s8eZdZeser,eejjdddd�e	dd�Z
dd�Zd	S)
�
Adjustment)r;ZlowerZupper�step_increment�page_incrementZ	page_sizeZ	page_incrZ	step_incr)rerdr�)rar�rbr�cOs�tstrL|j|i|��d|vr0|�|d�q|t|�dkr||�|d�n0tjj|g|�Ri|��d|vr||�|d�dS)Nr;r�r)r>r?r�r�rBr
rcr#r�rrrr#�szAdjustment.__init__N)rrrr>r?r	r
rcr#rr�rrrrrc�s��rcc@sPeZdZeejjdddd�ed�Zejj	ejj
Bejj	ejj
Bddfdd�Zd	S)
�Table)�n_rowsr�r�rZr�)rgr�r�rc

Cs"tj�||||||||||	�
dSr)r
rf�attach)
r"r*Zleft_attachZright_attachZ
top_attachZ
bottom_attachZxoptionsZyoptionsZxpaddingZypaddingrrrrhszTable.attachN)rrrr	r
rfr#rZ
AttachOptionsZEXPANDZFILLrhrrrrrfs�rfc@seZdZeejjded�ZdS)�ScrolledWindow�ZhadjustmentZvadjustmentr`N)rrrr	r
rir#rrrrrris�ric@seZdZeejjded�ZdS)�
HScrollbar�Z
adjustmentr`N)rrrr	r
rkr#rrrrrrks�rkc@seZdZeejjded�ZdS)�
VScrollbarrlr`N)rrrr	r
rmr#rrrrrrm s�rmcs,eZdZd�fdd�	Zd�fdd�	Z�ZS)	�PanedFTcstt|��|||�dSr)r-rn�pack1�r"r*ZresizeZshrinkr/rrro+szPaned.pack1cstt|��|||�dSr)r-rn�pack2rpr/rrrq.szPaned.pack2)FT)TT)rrrrorqr@rrr/rrn*srnc@seZdZeejjded�ZdS)�Arrow)Z
arrow_typeZshadow_typer`N)rrrr	r
rrr#rrrrrrr6s�rrcs&eZdZddd�Z�fdd�Z�ZS)�IconSetNcCs6|dur&tjdtdd�tj�|�}ntj�|�}|S)NzXGtk.IconSet(pixbuf) has been deprecated. Please use: Gtk.IconSet.new_from_pixbuf(pixbuf)rr�)r�r�rr
rsZnew_from_pixbufr7)r6ZpixbufZiconsetrrrr7?s�zIconSet.__new__cstt|���Sr)r-rsr#r�r/rrr#IszIconSet.__init__)N)rrrr7r#r@rrr/rrs>s

rsc@seZdZeejjded�ZdS)�Viewportrjr`N)rrrr	r
rtr#rrrrrrtOs�rtcs&eZdZd�fdd�	Zdd�Z�ZS)�TreeModelFilterNcstt|��||�dSr)r-ru�set_visible_func)r"rU�datar/rrrvYsz TreeModelFilter.set_visible_funccCs |�|�}|���|||�dSr)Zconvert_iter_to_child_iterZ	get_modelr�)r"rEr�r;rrrr�\s
zTreeModelFilter.set_value)N)rrrrvr�r@rrr/rruXsrucs,eZdZeddd��Zd�fdd�	Z�ZS)�CustomSorterNcCs$|durt|�}nd}tj�||�Sr)r
r
rxr)r6r
rm�compare_funcrrrrhs
zCustomSorter.newcs(|durt|�}nd}tt|��||�Sr)r
r-rxr	)r"r
rmryr/rrr	qs
zCustomSorter.set_sort_func)N)N)rrrrrr	r@rrr/rrxfsrxc@seZdZdd�ZdS)�Menuc	Cs|�d||||||�dSr)Zpopup_for_device)r"Zparent_menu_shellZparent_menu_itemrUrwZbuttonZ
activate_timerrr�popup~sz
Menu.popupN)rrrr{rrrrrz}srzcGs
t�dSr)�_Gtk_main_quit)rrrr�	main_quit�sr}c	Ospttj��Rt��,t|i|��Wd�Wd�S1sD0YWd�n1sb0YdSr)rr
r}r�	_Gtk_main)rrPrrr�main�sr�stock_lookup)aZsysr�Z
gi.repositoryrZ_ossighelperrrr�rrZ	overridesrrr	r
ZmodulerZgirr
Z_versionr>r?r=Z__all__rZwarn_msgr�ZRuntimeWarningrrrZobjectr r'rArSr[rcreryr�r�r�r�r|r�r�r#r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r
r�r�r�rBrErMrVr[rarbrcrfrirkrmrnrrrsrtrurxrzr}r|rr~r�Z
init_checkr�Zargvr(rrrrZ<module>s�






,
(








*

�	
X









J





Q
g

1
P
,


%