o
    ˆ3Gb¸õ  ã                   @   sÄ	  d dl Z d dlZd dlmZ ddlmZmZ ddlmZm	Z	 ddl
mZmZmZmZ ddlmZ d dlmZ ed	ƒZejd
kZejdkZejdkZg ZeZe d¡ e	Z	e d¡ ercdZe ee¡ G dd„ deƒZe d¡ ester}dd„ Ze d¡ dd„ ZG dd„ de ƒZ!G dd„ dej"ƒZ"ee"ƒZ"e d¡ esŸer³G dd„ dej#e"ƒZ#ee#ƒZ#e d¡ ne Z#G dd„ dej$ƒZ$ee$ƒZ$e d¡ esÌe�rG dd„ dej%ƒZ%ee%ƒZ%e d¡ G d d!„ d!ej&ƒZ&ee&ƒZ&e d!¡ G d"d#„ d#ej'ƒZ'ee'ƒZ'e d#¡ G d$d%„ d%ej(ƒZ(ee(ƒZ(e d%¡ G d&d'„ d'ej)e#ƒZ)ee)ƒZ)e d'¡ e�s-e�r?G d(d)„ d)ej*ƒZ*ee*ƒZ*e d)¡ e�sEe�rWG d*d+„ d+ej+ƒZ+ee+ƒZ+e d+¡ e�s]e�roG d,d-„ d-ej,ƒZ,ee,ƒZ,e d-¡ d.d/„ Z-G d0d1„ d1ej.ƒZ.ee.ƒZ.e d1¡ e�r�ej/j0Z1n
eej/j0d2ed3d4�Z1G d5d6„ d6ej/ƒZ/ee/ƒZ/e d6¡ G d7d8„ d8ej2e#ƒZ2ee2ƒZ2e d8¡ e�sÂe�rÕG d9d:„ d:ej3e2ƒZ3ee3ƒZ3e d:¡ e�sÛe�rÿG d;d<„ d<ej4ƒZ4ee4ƒZ4e d<¡ G d=d>„ d>ej5ƒZ5ee5ƒZ5e d>¡ e�se�rG d?d@„ d@ej6ƒZ6ee6ƒZ6e d@¡ e�se�r/G dAdB„ dBej7ƒZ7ee7ƒZ7e dB¡ G dCdD„ dDej8ƒZ8ee8ƒZ8e dD¡ e�sGe�rYG dEdF„ dFej9ƒZ9ee9ƒZ9e dF¡ G dGdH„ dHej:ƒZ:ee:ƒZ:e dH¡ G dIdJ„ dJej;ƒZ;ee;ƒZ;e dJ¡ G dKdL„ dLej<ƒZ<ee<ƒZ<e dL¡ G dMdN„ dNej=ƒZ=ee=ƒZ=e dN¡ G dOdP„ dPej>ƒZ>ee>ƒZ>e dP¡ G dQdR„ dRej?ƒZ?ee?ƒZ?e dR¡ e�sËe�rÝG dSdT„ dTej@ƒZ@ee@ƒZ@e dT¡ G dUdV„ dVejAe>e?ƒZAeeAƒZAe dV¡ G dWdX„ dXe ƒZBe dX¡ G dYdZ„ dZe ƒZCe dZ¡ G d[d\„ d\ejDƒZDeeDƒZDe d\¡ G d]d^„ d^ejEe>e?ƒZEeeEƒZEe d^¡ G d_d`„ d`ejFe#ƒZFeeFƒZFe d`¡ G dadb„ dbejGƒZGeeGƒZGe db¡ G dcdd„ ddejHƒZHeeHƒZHe dd¡ e�sne�r¥G dedf„ dfejIe#ƒZIeeIƒZIe df¡ G dgdh„ dhejJƒZJeeJƒZJe dh¡ G didj„ djejKƒZKeeKƒZKe dj¡ G dkdl„ dlejLƒZLeeLƒZLe dl¡ e�s½e�râG dmdn„ dnejMe#ƒZMeeMƒZMe dn¡ G dodp„ dpejNƒZNeeNƒZNe dp¡ e�sèe�rG dqdr„ drejOƒZOeeOƒZOe dr¡ G dsdt„ dtejPƒZPeePƒZPe dt¡ e�se�r$G dudv„ dvejQƒZQeeQƒZQe dv¡ e�s*e�r`G dwdx„ dxejRƒZReeRƒZRe dx¡ G dydz„ dzejSƒZSeeSƒZSe dz¡ G d{d|„ d|ejTƒZTeeTƒZTe d|¡ G d}d~„ d~ejUƒZUeeUƒZUe d~¡ e�r‡G dd€„ d€ejVƒZVeeVƒZVe d€¡ e�rœG d�d‚„ d‚ejWƒZWeeWƒZWe d‚¡ e�s¢e�rºejXZYeejXƒdƒd„„ ƒZXejZZ[eejZƒd…d†„ ƒZZe�sÀe�rÊeej\ƒZ\e d‡¡ e�rÓe ]¡ Z^dS e ]e j_¡\Z^Z_e`e_ƒe __dS )ˆé    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ÚGtkz2.0z3.0z4.0r   r   aB  You 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   e Zd ZdS )ÚPyGTKDeprecationWarningN)Ú__name__Ú
__module__Ú__qualname__© r   r   ú2/usr/lib/python3/dist-packages/gi/overrides/Gtk.pyr   <   s    r   c                 C   s4   g }| D ]}t |tjƒstjj|Ž }| |¡ 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   ÚTargetEntryÚnewÚappend)ÚtargetsÚtarget_entriesÚentryr   r   r   Ú_construct_target_listD   s   r   c           
      C   sŽ   t ||ƒ\}}|tjj@ }	|d ur-|	r |j|||g|¢R Ž  d S |j|||g|¢R Ž  d S |	r;|j||g|¢R Ž  d S |j||g|¢R Ž  d S ©N)r   r   ÚConnectFlagsÚAFTERÚconnect_object_afterÚconnect_objectÚconnect_afterÚconnect)
ÚbuilderÚgobjÚsignal_nameÚhandler_nameÚconnect_objÚflagsÚ
obj_or_mapÚhandlerÚargsÚafterr   r   r   Ú_builder_connect_callbackT   s   r.   c                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )Ú_FreezeNotifyManagerc                 C   s
   || _ d S r   )Úobj)Úselfr0   r   r   r   Ú__init__e   ó   
z_FreezeNotifyManager.__init__c                 C   s   d S r   r   ©r1   r   r   r   Ú	__enter__h   ó   z_FreezeNotifyManager.__enter__c                 C   s   | j  ¡  d S r   )r0   Úthaw_child_notify)r1   Úexc_typeÚ	exc_valueÚ	tracebackr   r   r   Ú__exit__k   ó   z_FreezeNotifyManager.__exit__N)r   r   r   r2   r5   r;   r   r   r   r   r/   d   s    r/   c                       s†   e Zd ZeejjƒZerdd„ Zdd„ Z	e
ser‡ fdd„Ze
s"er(‡ fdd„Ze
s,er2‡ fd	d
„Ze
s6er?ddd„Z‡  ZS ‡  ZS )ÚWidgetc                 C   s   |t | ƒv S r   )Úlist©r1   Úchildr   r   r   Ú__contains__t   ó   zWidget.__contains__c                 c   s(   � |   ¡ }|r|V  | ¡ }|sd S d S r   )Úget_first_childÚget_next_siblingr?   r   r   r   Ú__iter__w   s   €þzWidget.__iter__c                    s   t t| ƒ ¡  t| ƒS r   )Úsuperr=   Úfreeze_child_notifyr/   r4   ©Ú	__class__r   r   rG   ~   s   zWidget.freeze_child_notifyc                    ó8   |d urt |tjƒstj t|ƒ¡}tt| ƒ |¡ d S r   )r   r   Ú
TargetListr   r   rF   r=   Údrag_dest_set_target_list©r1   Útarget_listrH   r   r   rL   ƒ   ó   z Widget.drag_dest_set_target_listc                    rJ   r   )r   r   rK   r   r   rF   r=   Údrag_source_set_target_listrM   rH   r   r   rP   ‰   rO   z"Widget.drag_source_set_target_listNc                 C   sN   |d u r|   |¡}|d u rtd| |f ƒ‚t |j¡}tj | ||¡ | ¡ S )Nz/Class "%s" does not contain style property "%s")	Úfind_style_propertyÚ
ValueErrorr   ÚValueÚ
value_typer   r=   Ústyle_get_propertyÚ	get_value)r1   Úproperty_nameÚvalueÚpropr   r   r   rU   �   s   
ÿzWidget.style_get_propertyr   )r   r   r   r	   r   r=   Útranslate_coordinatesÚGTK4rA   rE   ÚGTK2ÚGTK3rG   rL   rP   rU   Ú__classcell__r   r   rH   r   r=   o   s    ÿr=   c                   @   sV   e Zd Zdd„ Zdd„ Zdd„ Zdd„ ZeZdd
d„Zdd„ Z	dd„ Z
eejjƒZd	S )Ú	Containerc                 C   ó   t |  ¡ ƒS r   )ÚlenÚget_childrenr4   r   r   r   Ú__len__¢   rB   zContainer.__len__c                 C   s   ||   ¡ v S r   )rb   r?   r   r   r   rA   ¥   rB   zContainer.__contains__c                 C   r`   r   )Úiterrb   r4   r   r   r   rE   ¨   rB   zContainer.__iter__c                 C   ó   dS ©NTr   r4   r   r   r   Ú__bool__«   r6   zContainer.__bool__Nc                 C   sP   |d u r|   |¡}|d u rtd| |f ƒ‚t |j¡}tj | |||¡ | ¡ S )Nz/Class "%s" does not contain child property "%s")	Úfind_child_propertyrR   r   rS   rT   r   r_   Úchild_get_propertyrV   )r1   r@   rW   rX   rY   r   r   r   ri   ±   s   
ÿzContainer.child_get_propertyc                    s   ‡ ‡fdd„|D ƒS )z<Returns a list of child property values for the given names.c                    s   g | ]}ˆ  ˆ |¡‘qS r   )ri   )Ú.0Úname©r@   r1   r   r   Ú
<listcomp>¾   s    z'Container.child_get.<locals>.<listcomp>r   )r1   r@   Ú
prop_namesr   rl   r   Ú	child_get¼   s   zContainer.child_getc                 K   s0   |  ¡ D ]\}}| dd¡}|  |||¡ qdS )z=Set a child properties on the given child to key/value pairs.Ú_ú-N)ÚitemsÚreplaceÚchild_set_property)r1   r@   Úkwargsrk   rX   r   r   r   Ú	child_setÀ   s   þzContainer.child_setr   )r   r   r   rc   rA   rE   rg   Ú__nonzero__ri   ro   rv   r	   r   r_   Úget_focus_chainr   r   r   r   r_       s    
r_   c                       s,   e Zd Z‡ fdd„Zeejjdd�Z‡  ZS )ÚEditablec                    s   t t| ƒ |d|¡S ©Néÿÿÿÿ)rF   ry   Úinsert_text)r1   ÚtextÚpositionrH   r   r   r|   Ð   ó   zEditable.insert_textr   ©Úfail_ret)	r   r   r   r|   r	   r   ry   Úget_selection_boundsr^   r   r   rH   r   ry   Î   s    ry   c                   @   ó   e Zd Zeejjded�ZdS )ÚAction©rk   ÚlabelÚtooltipÚstock_id©Ú	arg_namesÚcategoryN)r   r   r   r
   r   r„   r2   r   r   r   r   r   r„   Û   ó
    
þr„   c                   @   rƒ   )ÚRadioAction©rk   r†   r‡   rˆ   rX   r‰   N)r   r   r   r
   r   r�   r2   r   r   r   r   r   r�   ã   rŒ   r�   c                   @   s<   e Zd Zeejjded�Zd
dd„Zd
dd„Z	ddd	„Z
dS )ÚActionGroup)rk   r‰   Nc                    sJ   zt |ƒ W n ty   tdƒ‚w d‡ ‡fdd„	}|D ]}||Ž  qdS )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 iterableNc                    sL   t | |||d�}|d urˆd u r| d|¡ n| d|ˆ¡ ˆ  ||¡ d S ©Nr…   Úactivate)r„   r#   Úadd_action_with_accel)rk   rˆ   r†   Úacceleratorr‡   ÚcallbackÚaction©r1   Ú	user_datar   r   Ú_process_action  s   z0ActionGroup.add_actions.<locals>._process_action)NNNNN©rd   Ú	TypeError©r1   Úentriesr˜   r™   Úer   r—   r   Úadd_actionsð   s   ÿ

þzActionGroup.add_actionsc                    sJ   zt |ƒ W n ty   tdƒ‚w d‡ ‡fdd„	}|D ]}||Ž  qdS )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.
            r�   NFc                    sX   t j| |||d�}| |¡ |d ur$ˆd u r| d|¡ n| d|ˆ¡ ˆ  ||¡ d S r‘   )r   ÚToggleActionÚ
set_activer#   r“   )rk   rˆ   r†   r”   r‡   r•   Ú	is_activer–   r—   r   r   r™   ?  s   
z7ActionGroup.add_toggle_actions.<locals>._process_action)NNNNNFrš   rœ   r   r—   r   Úadd_toggle_actions  s   ÿ
þzActionGroup.add_toggle_actionsc           	         s    zt |ƒ W n ty   tdƒ‚w d}d‡ ‡fdd„	}|D ]}||g|¢R Ž }|du r.|}q|durL|durN|du rC| d|¡ dS | d||¡ dS dS dS )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.
            r�   Nr   c                    sB   t |||||d�}tr| | ¡ ˆ|kr| d¡ ˆ  ||¡ |S )NrŽ   T)r�   r]   Ú
join_groupr¡   r“   )Úgroup_sourcerk   rˆ   r†   r”   r‡   Úentry_valuer–   ©r1   rX   r   r   r™   q  s   

z6ActionGroup.add_radio_actions.<locals>._process_actionÚchanged)NNNNr   )rd   r›   r#   )	r1   r�   rX   Ú	on_changer˜   Úfirst_actionr™   rž   r–   r   r§   r   Úadd_radio_actionsN  s"   ÿ€üzActionGroup.add_radio_actionsr   )NNN)r   r   r   r
   r   r�   r2   r   rŸ   r£   r«   r   r   r   r   r�   ë   s    þ

-1r�   c                   @   s   e Zd Zdd„ Zddd„ZdS )Ú	UIManagerc                 C   ó*   t |tƒs	tdƒ‚t|ƒ}tj | ||¡S ©Nzbuffer must be a string)r   Ústrr›   Ú_get_utf8_lengthr   r¬   Úadd_ui_from_string©r1   ÚbufferÚlengthr   r   r   r±   �  ó   
zUIManager.add_ui_from_stringr{   c                 C   s   t j | ||¡S r   )r   r¬   Úinsert_action_groupr²   r   r   r   r¶   •  s   zUIManager.insert_action_groupN©r{   )r   r   r   r±   r¶   r   r   r   r   r¬   Œ  s    r¬   c                   @   ó   e Zd ZeejjƒZdS )ÚComboBoxN)r   r   r   r	   r   r¹   Úget_active_iterr   r   r   r   r¹   œ  ó    r¹   c                   @   rƒ   )ÚBox)ÚhomogeneousÚspacingr‰   N)r   r   r   r
   r   r¼   r2   r   r   r   r   r   r¼   ¥  rŒ   r¼   c                   @   s(   e Zd Zeejjddejjie	d�ZdS )Ú	SizeGroup)ÚmoderÀ   )rŠ   Údeprecated_defaultsr‹   N)
r   r   r   r
   r   r¿   r2   ÚSizeGroupModeÚVERTICALr   r   r   r   r   r¿   ¯  s    

ýr¿   c                   @   rƒ   )ÚMenuItem©r†   r‰   N)r   r   r   r
   r   rÄ   r2   r   r   r   r   r   rÄ   º  rŒ   rÄ   c                 C   s*   t | tƒsJ ‚t | tƒs|  d¡} t| ƒS )Nzutf-8)r   r¯   ÚbytesÚencodera   )Ústringr   r   r   r°   Ã  s   

r°   c                       sN   e Zd ZerddlmZ eƒ Zd‡ fdd„	Zndd„ Zdd	„ Z	d
d„ Z
‡  ZS )ÚBuilderr   )Údefine_builder_scopeNc                    s*   t t| ƒ ¡  |r|  t |¡¡ d S d S r   )rF   rÉ   r2   Ú	set_scopeÚBuilderScope)r1   Úscope_object_or_maprH   r   r   r2   Ï  s   ÿzBuilder.__init__c                 C   s   |   t|¡ dS )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)Úconnect_signals_fullr.   )r1   r*   r   r   r   Úconnect_signalsÕ  s   zBuilder.connect_signalsc                 C   r­   r®   )r   r¯   r›   r°   r   rÉ   Úadd_from_stringr²   r   r   r   rÐ   ã  rµ   zBuilder.add_from_stringc                 C   s,   t |tƒs	tdƒ‚t|ƒ}tj | |||¡S r®   )r   r¯   r›   r°   r   rÉ   Úadd_objects_from_string)r1   r³   Ú
object_idsr´   r   r   r   rÑ   ë  s   
zBuilder.add_objects_from_stringr   )r   r   r   r[   Ú_gtktemplaterÊ   rÌ   r2   rÏ   rÐ   rÑ   r^   r   r   rH   r   rÉ   Ê  s    rÉ   )Útypeé   )rŠ   r‹   Ú
stacklevelc                   @   ó   e Zd Zdd„ ZdS )ÚWindowc                 O   s&   t stdƒ‚t| g|¢R i |¤Ž d S )NzRGtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case.)ÚinitializedÚRuntimeErrorÚ_window_init©r1   r,   ru   r   r   r   r2     s
   ÿzWindow.__init__N)r   r   r   r2   r   r   r   r   rØ     ó    rØ   c                   @   sd   e Zd Zeser,dZeejj	dddddœe
d�Zdd	„ Z	d
d„ Zedd„ ƒZedd„ ƒZdd„ ZdS )ÚDialog)ÚtitleÚparentr)   ÚbuttonsÚ_buttons_property)rß   Útransient_forr)   Úadd_buttonsrá   )r)   rä   rà   râ   )rã   rá   )rŠ   ÚignoreÚdeprecated_aliasesr‹   c                 O   sö   |  ¡ }tt| j|ƒƒ}| |¡ d}| jtkr#| jjtjkr#|d7 }| dd ¡}|d urBt	|t
jƒsBtjdt|d� | dd ¡ nd }| dd¡}|rhtjdt|d� |t
jj@ r^d	|d
< |t
jj@ rhd	|d< | j|i |¤Ž |ry| j|Ž  d S d S )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Ö   r)   r   zÆ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/InitializerDeprecationsTÚmodalÚdestroy_with_parent)ÚcopyÚdictÚzipÚ_old_arg_namesÚupdaterI   rÞ   r2   Úgetr   r   ÚButtonsTypeÚwarningsÚwarnr   ÚpopÚDialogFlagsÚMODALÚDESTROY_WITH_PARENTÚ_initrä   )r1   r,   ru   Ú
new_kwargsÚ
old_kwargsrÖ   rä   r)   r   r   r   r2     s4   
ýýÿzDialog.__init__c              	   O   s~   t | jƒ�0 tƒ � tjj| g|¢R i |¤ŽW  d   ƒ W  d   ƒ S 1 s(w   Y  W d   ƒ d S 1 s8w   Y  d S r   )r   Údestroyr   r   rÞ   ÚrunrÜ   r   r   r   rü   F  s   ÿÿ"ÿz
Dialog.runc                 C   ó   |   ¡ S r   )Úget_action_area©Údialogr   r   r   Ú<lambda>K  ó    zDialog.<lambda>c                 C   rý   r   )Úget_content_arearÿ   r   r   r   r  L  r  c                 G   s*   dd„ }||ƒD ]
\}}|   ||¡ qdS )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.
        c                 s   sT   � | r(z
| dd… \}}W n t y   t dƒ‚w | dd … } ||fV  | sd S d S )Nr   r   z%Must pass an even number of arguments)rR   )ÚbÚtÚrr   r   r   Ú_button\  s   €ÿ
úz#Dialog.add_buttons.<locals>._buttonN)Ú
add_button)r1   r,   r  r}   Úresponser   r   r   rä   N  s   	ÿzDialog.add_buttonsN)r   r   r   r\   r]   rî   r
   r   rÞ   r2   r   rø   rü   ÚpropertyÚaction_areaÚvboxrä   r   r   r   r   rÞ     s     ÿú*rÞ   c                   @   s6   e Zd Zeejjddddœed�Zdd„ Zdd	„ Z	d
S )ÚMessageDialog)rà   r)   Úmessage_typerá   Úmessage_formatr  rÔ   )r}   r  ©rŠ   ræ   r‹   c                 C   ó   |   dd¡ |   d|¡ d S )Núsecondary-use-markupFúsecondary-text©Úset_property©r1   r  r   r   r   Úformat_secondary_textv  ó   z#MessageDialog.format_secondary_textc                 C   r  )Nr  Tr  r  r  r   r   r   Úformat_secondary_markupz  r  z%MessageDialog.format_secondary_markupN)
r   r   r   r
   r   r  r2   r   r  r  r   r   r   r   r  n  s    ÿûr  c                   @   rƒ   )ÚColorSelectionDialog©rß   r‰   N)r   r   r   r
   r   r  r2   r   r   r   r   r   r  ƒ  rŒ   r  c                   @   rƒ   )ÚFileChooserDialog)rß   rà   r–   rá   r‰   N)r   r   r   r
   r   r  r2   r   r   r   r   r   r  ‹  rŒ   r  c                   @   rƒ   )ÚFontSelectionDialogr  r‰   N)r   r   r   r
   r   r  r2   r   r   r   r   r   r  •  rŒ   r  c                   @   s$   e Zd Zeejjdddied�ZdS )ÚRecentChooserDialog)rß   rà   Úrecent_managerrá   r  Úmanagerr  N)r   r   r   r
   r   r  r2   r   r   r   r   r   r  Ÿ  s    
ýr  c                   @   sJ   e Zd Zesereejjde	d�Ze
ejjƒZe
ejjƒZe
ejjƒZdS )ÚIconView©Úmodelr‰   N)r   r   r   r\   r]   r
   r   r!  r2   r   r	   Úget_item_at_posÚget_visible_rangeÚget_dest_item_at_posr   r   r   r   r!  «  s    þr!  c                   @   rƒ   )Ú
ToolButton)rˆ   r‰   N)r   r   r   r
   r   r'  r2   r   r   r   r   r   r'  »  rŒ   r'  c                   @   r¸   )Ú	IMContextN)r   r   r   r	   r   r(  Úget_surroundingr   r   r   r   r(  Ä  r»   r(  c                   @   r¸   )Ú
RecentInfoN)r   r   r   r	   r   r*  Úget_application_infor   r   r   r   r*  Ì  r»   r*  c                   @   s^   e Zd Zddd„Zddd„Zddd	„Zdd
d„Zdd„ Zdd„ Zddd„Z	e
ejjdd�ZdS )Ú
TextBufferNc                 K   s&   t jdd|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.
        rk   Nr   )r   ÚTextTagÚget_tag_tableÚadd)r1   Útag_nameÚ
propertiesÚtagr   r   r   Ú
create_tagÖ  s   zTextBuffer.create_tagFc                 C   s   t j | |||¡S r   )r   r,  Úcreate_mark)r1   Ú	mark_nameÚwhereÚleft_gravityr   r   r   r4  ò  ó   zTextBuffer.create_markr{   c                 C   s   t j | ||¡ d S r   )r   r,  Úset_text©r1   r}   r´   r   r   r   r9  õ  r   zTextBuffer.set_textc                 C   s0   t |tƒstdt|ƒ ƒ‚tj | |||¡ d S ©Nztext must be a string, not %s)r   r¯   r›   rÔ   r   r,  Úinsert)r1   rd   r}   r´   r   r   r   r<  ø  s   
zTextBuffer.insertc                 G   sB   |  ¡ }|  ||¡ |sd S |  |¡}|D ]	}|  |||¡ qd S r   )Ú
get_offsetr<  Úget_iter_at_offsetÚ	apply_tag)r1   rd   r}   ÚtagsÚstart_offsetÚstartr2  r   r   r   Úinsert_with_tagsþ  s   
ÿzTextBuffer.insert_with_tagsc                 G   sN   g }|D ]}|   ¡  |¡}|std| ƒ‚| |¡ q| j||g|¢R Ž  d S )Nzunknown text tag: %s)r.  ÚlookuprR   r   rC  )r1   rd   r}   r@  Útag_objsr2  Útag_objr   r   r   Úinsert_with_tags_by_name
  s   z#TextBuffer.insert_with_tags_by_namec                 C   s.   t |tƒstdt|ƒ ƒ‚tj | ||¡ d S r;  )r   r¯   r›   rÔ   r   r,  Úinsert_at_cursorr:  r   r   r   rH    s   
zTextBuffer.insert_at_cursorr   r€   r   )Fr·   )r   r   r   r3  r4  r9  r<  rC  rG  rH  r	   r   r,  r‚   r   r   r   r   r,  Ô  s    




r,  c                   @   s$   e Zd ZeejjƒZeejjƒZdS )ÚTextIterN)r   r   r   r	   r   rI  Úforward_searchÚbackward_searchr   r   r   r   rI  "  s    rI  c                       s(  e Zd Zdd„ Zdd„ ZesereZdd„ Z‡ fdd„Z	d	d
„ Z
dd„ Zdd„ Zdd„ Zdd„ ZeejjƒZeejjƒZeejjƒZeejjƒZeejjedƒZ‡ fdd„Z‡ fdd„Z‡ fdd„Zdd„ Zdd„ Zdd„ Zd d!„ Z‡ fd"d#„Z‡ fd$d%„Z ‡ fd&d'„Z!‡ fd(d)„Z"‡ fd*d+„Z#‡  Z$S ),Ú	TreeModelc                 C   s
   |   d ¡S r   )Úiter_n_childrenr4   r   r   r   rc   ,  r3   zTreeModel.__len__c                 C   re   rf   r   r4   r   r   r   rg   /  r6   zTreeModel.__bool__c                 C   sx   t |tjƒr|S t |tƒr&|dk r&t| ƒ| }|dk r!td| ƒ‚|  |¡S z|  |¡}W |S  ty;   td| ƒ‚w )Nr   zrow index is out of bounds: %dzcould not find tree path '%s')r   r   ÚTreeIterÚintra   Ú
IndexErrorÚget_iterrR   )r1   ÚkeyÚindexÚaiterr   r   r   Ú_getiter6  s   
þÿzTreeModel._getiterc                    s&   t t| ƒ}t|dƒr| ¡ S t | ¡S )NÚsort_new_with_model)rF   rL  ÚhasattrrV  ÚTreeModelSortÚnew_with_model)r1   Úsuper_objectrH   r   r   rV  E  s   


zTreeModel.sort_new_with_modelc                 C   s   t |tjƒr|S t|ƒS r   )r   r   ÚTreePath©r1   Úpathr   r   r   Ú_coerce_pathL  s   zTreeModel._coerce_pathc                 C   s   |   |¡}t| |ƒS r   )rU  ÚTreeModelRow©r1   rR  rT  r   r   r   Ú__getitem__R  s   

zTreeModel.__getitem__c                 C   s   | | }|   |j|¡ d S r   )Úset_rowrd   )r1   rR  rX   Úrowr   r   r   Ú__setitem__V  s   zTreeModel.__setitem__c                 C   s   |   |¡}|  |¡ d S r   )rU  Úremover`  r   r   r   Ú__delitem__Z  s   
zTreeModel.__delitem__c                 C   s   t | |  ¡ ƒS r   )ÚTreeModelRowIterÚget_iter_firstr4   r   r   r   rE   ^  r<   zTreeModel.__iter__zinvalid tree pathc                    s2   |   |¡}tt| ƒ |¡\}}|std| ƒ‚|S )Nzinvalid tree path '%s')r^  rF   rL  rQ  rR   )r1   r]  ÚsuccessrT  rH   r   r   rQ  h  s
   
zTreeModel.get_iterc                    ó$   |  ¡ }tt| ƒ |¡}|r|S d S r   )rë   rF   rL  Ú	iter_next)r1   rT  Ú	next_iterri  rH   r   r   rk  o  ó
   ÿzTreeModel.iter_nextc                    rj  r   )rë   rF   rL  Úiter_previous)r1   rT  Ú	prev_iterri  rH   r   r   rn  u  rm  zTreeModel.iter_previousc                 C   sv   t |tƒr	tdƒ‚|  ¡ }t|ƒ|krtdƒ‚g }g }t|ƒD ]\}}|d u r(q| |  ||¡¡ | |¡ q||fS )Nz%Expected a list or tuple, but got strz1row sequence has the incorrect number of elements)	r   r¯   r›   Úget_n_columnsra   rR   Ú	enumerater   Ú_convert_value)r1   rc  Ú	n_columnsÚresultÚcolumnsÚcur_colrX   r   r   r   Ú_convert_row{  s   
zTreeModel._convert_rowc                 C   s.   |   |¡\}}|D ]}|  |||| ¡ q	d S r   )rw  Ú	set_value)r1   Útreeiterrc  Úconverted_rowru  Úcolumnr   r   r   rb  �  s   ÿzTreeModel.set_rowc                 C   s"   t |tjƒr|S t |  |¡|¡S )z5Convert value to a GObject.Value of the expected type)r   r   rS   Úget_column_type)r1   r{  rX   r   r   r   rr  ”  s   zTreeModel._convert_valuec                 G   sZ   |   ¡ }g }|D ] }t|tƒstdƒ‚|dk s||krtdƒ‚| |  ||¡¡ qt|ƒS )Nzcolumn numbers must be intsr   zcolumn number is out of range)rp  r   rO  r›   rR   r   rV   Útuple)r1   ry  ru  rs  ÚvaluesÚcolr   r   r   rð   ›  s   
zTreeModel.getc                    ó   t t| ƒ |  |¡|¡S r   )rF   rL  Úrow_changedr^  ©r1   r]  rd   rH   r   r   r�  ­  ó   zTreeModel.row_changedc                    r€  r   )rF   rL  Úrow_insertedr^  r‚  rH   r   r   r„  °  rƒ  zTreeModel.row_insertedc                    r€  r   )rF   rL  Úrow_has_child_toggledr^  r‚  rH   r   r   r…  ³  s   ÿzTreeModel.row_has_child_toggledc                    s   t t| ƒ |  |¡¡S r   )rF   rL  Úrow_deletedr^  r\  rH   r   r   r†  ·  ó   zTreeModel.row_deletedc                    s   t t| ƒ |  |¡||¡S r   )rF   rL  Úrows_reorderedr^  )r1   r]  rd   Ú	new_orderrH   r   r   rˆ  º  s   ÿzTreeModel.rows_reordered)%r   r   r   rc   rg   r\   r]   rw   rU  rV  r^  ra  rd  rf  rE   r	   r   rL  rh  Úiter_childrenÚiter_nth_childÚiter_parentÚget_iter_from_stringrR   rQ  rk  rn  rw  rb  rr  rð   r�  r„  r…  r†  rˆ  r^   r   r   rH   r   rL  +  s>    ÿrL  c                       s<   e Zd Zeejjdd�Zd‡ fdd„	Zd‡ fdd„	Z‡  Z	S )	ÚTreeSortable)NNr€   Nc                    ó   t t| ƒ |||¡ d S r   )rF   rŽ  Úset_sort_func)r1   Úsort_column_idÚ	sort_funcr˜   rH   r   r   r�  Ç  rƒ  zTreeSortable.set_sort_funcc                    ó   t t| ƒ ||¡ d S r   )rF   rŽ  Úset_default_sort_func)r1   r’  r˜   rH   r   r   r”  Ê  r‡  z"TreeSortable.set_default_sort_funcr   )
r   r   r   r	   r   rŽ  Úget_sort_column_idr�  r”  r^   r   r   rH   r   rŽ  Ã  s    rŽ  c                   @   s:   e Zd Zeejjded�Zeejdƒse	dd„ ƒZ
dS dS )rX  r"  r‰   rY  c                 C   s
   t  |¡S r   )rL  rV  )r1   Úchild_modelr   r   r   rY  Ù  ó   
zTreeModelSort.new_with_modelN)r   r   r   r
   r   rX  r2   r   rW  ÚclassmethodrY  r   r   r   r   rX  Ó  s    þþrX  c                   @   sˆ   e Zd Zdd„ ZeejdƒsejjZn
eejdƒsejjZdd„ Z	ddd	„Z
dd
d„Zddd„Zddd„Zddd„Zdd„ Zdd„ ZdS )Ú	ListStorec                 G   ó   t j | ¡ |  |¡ d S r   )r   r™  r2   Úset_column_types©r1   Úcolumn_typesr   r   r   r2   â  ó   zListStore.__init__Úinsert_with_valuesvÚinsert_with_valuesc                 C   s:   |d ur|   |¡\}}|  |||¡}|S tj | |¡}|S r   )rw  r   r   r™  r<  )r1   r~   rc  ru  ry  r   r   r   Ú
_do_insertí  s   þzListStore._do_insertNc                 C   s   |r|   d|¡S tj | ¡S rz   )r¡  r   r™  r   ©r1   rc  r   r   r   r   ö  s   zListStore.appendc                 C   s   |   d|¡S ©Nr   ©r¡  r¢  r   r   r   Úprependþ  rB   zListStore.prependc                 C   s   |   ||¡S r   r¤  )r1   r~   rc  r   r   r   r<    rB   zListStore.insertc                 C   sB   |d ur|d u rd}n	|   |¡ ¡ d }|  ||¡S tj | |¡S rz   )Úget_pathÚget_indicesr¡  r   r™  Úinsert_before©r1   Úsiblingrc  r~   r   r   r   r¨    s   zListStore.insert_beforec                 C   sF   |d ur|d u rd}n|   |¡ ¡ d d }|  ||¡S tj | |¡S ©Nr   r{   rç   )r¦  r§  r¡  r   r™  Úinsert_afterr©  r   r   r   r¬    s   zListStore.insert_afterc                 C   ó"   |   ||¡}tj | |||¡ d S r   )rr  r   r™  rx  ©r1   ry  r{  rX   r   r   r   rx    ó   zListStore.set_valuec                    s¶   ‡ ‡fdd„}|rYt |d tƒr!||d d d… |dd d… ƒ d S t |d ttfƒr?t|ƒdkr4tdƒ‚||d |d ƒ d S t |d tƒrU|t|d ƒ|d  ¡ ƒ d S tdƒ‚d S )Nc                    óx   t | ƒt |ƒkrtdƒ‚g }g }t| |ƒD ]\}}t|tƒs"tdƒ‚| |¡ | ˆ  ||¡¡ qtj 	ˆ ˆ||¡ d S ©Nz7The number of columns do not match the number of valuesz0TypeError: Expected integer argument for column.)
ra   r›   rí   r   rO  r   rr  r   r™  Úset©ÚcolsÚvalsru  r~  Úcol_numrX   ©r1   ry  r   r   Ú
_set_lists  ó   

z!ListStore.set.<locals>._set_listsr   r   rç   úToo many argumentsú‹Argument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}.  No -1 termination is needed.)r   rO  r}  r>   ra   r›   rì   r~  ©r1   ry  r,   r¸  r   r·  r   r²    ó   "özListStore.setr   )r   r   r   r2   rW  r   r™  r   rŸ  r¡  r   r¥  r<  r¨  r¬  rx  r²  r   r   r   r   r™  á  s    

	





r™  c                   @   s|   e Zd Zdd„ Zedd„ ƒZedd„ ƒZedd„ ƒZed	d
„ ƒZdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )r_  c                 C   sh   t |tjƒstdt|ƒj ƒ‚|| _t |tjƒr | |¡| _	d S t |tj
ƒr+|| _	d S tdt|ƒj ƒ‚)Nz expected Gtk.TreeModel, %s foundz/expected Gtk.TreeIter or Gtk.TreePath, %s found)r   r   rL  r›   rÔ   r   r#  r[  rQ  rd   rN  )r1   r#  Úiter_or_pathr   r   r   r2   ?  s   
ÿzTreeModelRow.__init__c                 C   s   | j  | j¡S r   )r#  r¦  rd   r4   r   r   r   r]  K  s   zTreeModelRow.pathc                 C   rý   r   )Úget_nextr4   r   r   r   ÚnextO  ó   zTreeModelRow.nextc                 C   rý   r   )Úget_previousr4   r   r   r   ÚpreviousS  rÁ  zTreeModelRow.previousc                 C   rý   r   )Ú
get_parentr4   r   r   r   rà   W  rÁ  zTreeModelRow.parentc                 C   ó"   | j  | j¡}|rt| j |ƒS d S r   )r#  rk  rd   r_  )r1   rl  r   r   r   r¿  [  ó   ÿzTreeModelRow.get_nextc                 C   rÅ  r   )r#  rn  rd   r_  )r1   ro  r   r   r   rÂ  `  rÆ  zTreeModelRow.get_previousc                 C   rÅ  r   )r#  rŒ  rd   r_  )r1   Úparent_iterr   r   r   rÄ  e  rÆ  zTreeModelRow.get_parentc                    sÄ   t |tƒr#|ˆ j ¡ krtd| ƒ‚|dk rˆ  |¡}ˆ j ˆ j|¡S t |tƒrK| 	ˆ j ¡ ¡\}}}g }t
|||ƒD ]}| ˆ j ˆ j|¡¡ q;|S t |tƒrY‡ fdd„|D ƒS tdt|ƒj ƒ‚)Nú!column index is out of bounds: %dr   c                    s   g | ]}ˆ | ‘qS r   r   )rj   Úkr4   r   r   rm   x  s    z,TreeModelRow.__getitem__.<locals>.<listcomp>z0indices must be integers, slice or tuple, not %s)r   rO  r#  rp  rP  Ú_convert_negative_indexrV   rd   ÚsliceÚindicesÚranger   r}  r›   rÔ   r   )r1   rR  rB  ÚstopÚstepÚalistÚir   r4   r   ra  j  s"   



ÿzTreeModelRow.__getitem__c           
      C   s0  t |tƒr&|| j ¡ krtd| ƒ‚|dk r|  |¡}| j | j||¡ d S t |tƒrf| 	| j ¡ ¡\}}}t
|||ƒ}t|ƒt|ƒkrPtdt|ƒt|ƒf ƒ‚t|ƒD ]\}}| j | j||| ¡ qTd S t |tƒr�t|ƒt|ƒkrtdt|ƒt|ƒf ƒ‚t||ƒD ]\}	}|| |	< q„d S tdt|ƒj ƒ‚)NrÈ  r   z9attempt 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)r   rO  r#  rp  rP  rÊ  rx  rd   rË  rÌ  rÍ  ra   rR   rq  r}  rí   r›   rÔ   r   )
r1   rR  rX   rB  rÎ  rÏ  Ú	indexListrÑ  ÚvrÉ  r   r   r   rd  }  s>   


ÿÿÿ
ÿÿ
ÿÿzTreeModelRow.__setitem__c                 C   s&   | j  ¡ | }|dk rtd| ƒ‚|S )Nr   rÈ  )r#  rp  rP  )r1   rS  Ú	new_indexr   r   r   rÊ  ™  s   z$TreeModelRow._convert_negative_indexc                 C   s   | j  | j¡}t| j |ƒS r   )r#  rŠ  rd   rg  )r1   Ú
child_iterr   r   r   ÚiterchildrenŸ  s   zTreeModelRow.iterchildrenN)r   r   r   r2   r
  r]  rÀ  rÃ  rà   r¿  rÂ  rÄ  ra  rd  rÊ  rÖ  r   r   r   r   r_  =  s"    



r_  c                   @   s0   e Zd Zdd„ Zdd„ ZesereZdd„ ZdS )rg  c                 C   s   || _ || _d S r   )r#  rd   )r1   r#  rT  r   r   r   r2   ©  s   
zTreeModelRowIter.__init__c                 C   s,   | j st‚t| j| j ƒ}| j | j ¡| _ |S r   )rd   ÚStopIterationr_  r#  rk  r¢  r   r   r   Ú__next__­  s
   zTreeModelRowIter.__next__c                 C   s   | S r   r   r4   r   r   r   rE   ¸  r6   zTreeModelRowIter.__iter__N)	r   r   r   r2   rØ  r\   r]   rÀ  rE   r   r   r   r   rg  §  s    rg  c                       sv   e Zd Zddd„Z‡ fdd„Zdd„ Zdd	„ Zd
d„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Z‡  ZS )r[  r   c                 C   sr   t |tƒr
t|ƒ}nt |tƒsd dd„ |D ƒ¡}t|ƒdkr%td| ƒ‚zt |¡W S  ty8   td| ƒ‚w )Nú:c                 s   s   � | ]}t |ƒV  qd S r   )r¯   )rj   Úvalr   r   r   Ú	<genexpr>Å  s   € z#TreePath.__new__.<locals>.<genexpr>r   z-could not parse subscript '%s' as a tree path)r   rO  r¯   Újoinra   r›   r[  Únew_from_string)Úclsr]  r   r   r   Ú__new__Á  s   


ÿzTreePath.__new__c                    s   t t| ƒ ¡  d S r   )rF   r[  r2   rÜ   rH   r   r   r2   Î  r8  zTreePath.__init__c                 C   s   |   ¡ pdS )NÚ )Ú	to_stringr4   r   r   r   Ú__str__Ñ  rB   zTreePath.__str__c                 C   s   |d uo
|   |¡dk S r£  ©Úcompare©r1   Úotherr   r   r   Ú__lt__Ô  r‡  zTreePath.__lt__c                 C   s   |d uo
|   |¡dkS r£  rã  rå  r   r   r   Ú__le__×  r‡  zTreePath.__le__c                 C   s   |d uo
|   |¡dkS r£  rã  rå  r   r   r   Ú__eq__Ú  r‡  zTreePath.__eq__c                 C   s   |d u p
|   |¡dkS r£  rã  rå  r   r   r   Ú__ne__Ý  r‡  zTreePath.__ne__c                 C   s   |d u p
|   |¡dkS r£  rã  rå  r   r   r   Ú__gt__à  r‡  zTreePath.__gt__c                 C   s   |d u p
|   |¡dkS r£  rã  rå  r   r   r   Ú__ge__ã  r‡  zTreePath.__ge__c                 C   r`   r   )rd   r§  r4   r   r   r   rE   æ  rB   zTreePath.__iter__c                 C   rý   r   )Ú	get_depthr4   r   r   r   rc   é  s   zTreePath.__len__c                 C   s   |   ¡ | S r   )r§  )r1   rS  r   r   r   ra  ì  rB   zTreePath.__getitem__)r   )r   r   r   rß  r2   râ  rç  rè  ré  rê  rë  rì  rE   rc   ra  r^   r   r   rH   r   r[  ¿  s    
r[  c                   @   s^   e Zd Zdd„ Zdd„ Zddd„Zddd	„Zdd
d„Zddd„Zddd„Z	dd„ Z
dd„ ZdS )Ú	TreeStorec                 G   rš  r   )r   rî  r2   r›  rœ  r   r   r   r2   õ  rž  zTreeStore.__init__c                 C   s>   |d ur|   |¡\}}|  ||||¡}|S tj | ||¡}|S r   )rw  r   r   rî  r<  )r1   rà   r~   rc  ru  ry  r   r   r   r¡  ù  s   þzTreeStore._do_insertNc                 C   ó   |   |d|¡S rz   r¤  ©r1   rà   rc  r   r   r   r     r<   zTreeStore.appendc                 C   rï  r£  r¤  rð  r   r   r   r¥    r<   zTreeStore.prependc                 C   s   |   |||¡S r   r¤  )r1   rà   r~   rc  r   r   r   r<    r<   zTreeStore.insertc                 C   sX   |d ur$|d u rd}n|d u r|   |¡}|  |¡ ¡ d }|  |||¡S tj | ||¡S rz   )rŒ  r¦  r§  r¡  r   rî  r¨  ©r1   rà   rª  rc  r~   r   r   r   r¨    s   
zTreeStore.insert_beforec                 C   s\   |d ur&|d u rd}n|d u r|   |¡}|  |¡ ¡ d d }|  |||¡S tj | ||¡S r«  )rŒ  r¦  r§  r¡  r   rî  r¬  rñ  r   r   r   r¬    s   
zTreeStore.insert_afterc                 C   r­  r   )rr  r   rî  rx  r®  r   r   r   rx  #  r¯  zTreeStore.set_valuec                    s¶   ‡ ‡fdd„}|rYt |d tƒr!||d d d… |dd d… ƒ d S t |d ttfƒr?t|ƒdkr4tdƒ‚||d |d ƒ d S t |d tƒrU||d  ¡ |d  ¡ ƒ d S tdƒ‚d S )Nc                    r°  r±  )
ra   r›   rí   r   rO  r   rr  r   rî  r²  r³  r·  r   r   r¸  (  r¹  z!TreeStore.set.<locals>._set_listsr   r   rç   rº  r»  )	r   rO  r}  r>   ra   r›   rì   Úkeysr~  r¼  r   r·  r   r²  '  r½  zTreeStore.setr   )r   r   r   r2   r¡  r   r¥  r<  r¨  r¬  rx  r²  r   r   r   r   rî  ô  s    
	



rî  c                       s¨   e Zd Zesereejjde	d�Ze
ejjƒZe
ejjƒZe
ejjƒZes'er-‡ fdd„Zes1er7‡ fdd„Zd‡ fd
d„	Zd‡ fdd„	Zd‡ fdd„	Zdd„ Z‡  ZS )ÚTreeViewr"  r‰   c                    s    t |ƒ}tt| ƒ |||¡ d S r   )r   rF   ró  Úenable_model_drag_source)r1   Ústart_button_maskr   Úactionsr   rH   r   r   rô  S  s
   þz!TreeView.enable_model_drag_sourcec                    s   t |ƒ}tt| ƒ ||¡ d S r   )r   rF   ró  Úenable_model_drag_dest)r1   r   rö  r   rH   r   r   r÷  Z  s   ÿzTreeView.enable_model_drag_destNFç        c                    s0   t |tjƒs
t|ƒ}tt| ƒ |||||¡ d S r   )r   r   r[  rF   ró  Úscroll_to_cell)r1   r]  r{  Ú	use_alignÚ	row_alignÚ	col_alignrH   r   r   rù  _  s   zTreeView.scroll_to_cellc                    s,   t |tjƒs
t|ƒ}tt| ƒ |||¡ d S r   )r   r   r[  rF   ró  Ú
set_cursor)r1   r]  r{  Ústart_editingrH   r   r   rý  d  s   zTreeView.set_cursorc                    s&   t |tjƒs
t|ƒ}tt| ƒ ||¡S r   )r   r   r[  rF   ró  Úget_cell_area)r1   r]  r{  rH   r   r   rÿ  i  s   zTreeView.get_cell_areac                 K   s>   t ƒ }| |¡ | |d¡ |  ||¡ |j|fi |¤Ž d S ©NF)ÚTreeViewColumnÚ	set_titleÚ
pack_startÚinsert_columnÚset_attributes)r1   r~   rß   Úcellru   r{  r   r   r   Úinsert_column_with_attributesn  s
   
z&TreeView.insert_column_with_attributes)NFrø  rø  r   r   )r   r   r   r\   r]   r
   r   ró  r2   r   r	   Úget_path_at_posr%  Úget_dest_row_at_posrô  r÷  rù  rý  rÿ  r  r^   r   r   rH   r   ró  H  s"    þró  c                       s@   e Zd Z		d	dd„ZeejjƒZd
‡ fdd„	Zdd„ Z	‡  Z
S )r  rà  Nc                 K   sD   t jj| |d� |r|  |d¡ | ¡ D ]\}}|  |||¡ qd S )Nr  T)r   r  r2   r  rr   Úadd_attribute)r1   rß   Úcell_rendererÚ
attributesrk   rX   r   r   r   r2   {  s   ÿzTreeViewColumn.__init__c                    r�  r   )rF   r  Úset_cell_data_func)r1   r  ÚfuncÚ	func_datarH   r   r   r  ‡  rƒ  z!TreeViewColumn.set_cell_data_funcc                 K   s6   t j | |¡ | ¡ D ]\}}t j | |||¡ qd S r   )r   Ú
CellLayoutÚclear_attributesrr   r
  )r1   r  r  rk   rX   r   r   r   r  Š  s   ÿzTreeViewColumn.set_attributes)rà  Nr   )r   r   r   r2   r	   r   r  Úcell_get_positionr  r  r^   r   r   rH   r   r  z  s    
ÿ
r  c                       s4   e Zd Z‡ fdd„Z‡ fdd„Z‡ fdd„Z‡  ZS )ÚTreeSelectionc                    s(   t |tjƒs
t|ƒ}tt| ƒ |¡ d S r   )r   r   r[  rF   r  Úselect_pathr\  rH   r   r   r  —  s   zTreeSelection.select_pathc                    s(   t t| ƒ ¡ \}}}|r||fS |d fS r   )rF   r  Úget_selected)r1   ri  r#  rT  rH   r   r   r  œ  s   zTreeSelection.get_selectedc                    s   t t| ƒ ¡ \}}||fS r   )rF   r  Úget_selected_rows)r1   Úrowsr#  rH   r   r   r  ¥  s   zTreeSelection.get_selected_rows)r   r   r   r  r  r  r^   r   r   rH   r   r  •  s    	r  c                   @   sV   e Zd Zeejjddedd�Zdd„ Ze	ej
dƒrdd	„ Ze	ej
d
ƒr)dd„ ZdS dS )ÚButton)r†   ÚstockÚ	use_stockÚuse_underline)r  rÕ   )rŠ   rå   r‹   rÖ   c                 O   sv   d|v r1|d r1t jdtdd� | ¡ }|d |d< d|d< d|d< |d= tjj| fi |¤Ž d S | j|i |¤Ž d S )	Nr  zKStock items are deprecated. Please use: Gtk.Button.new_with_mnemonic(label)r   rè   r†   Tr  r  )rò   ró   r   rë   r   r  r2   rø   )r1   r,   ru   rù   r   r   r   r2   ¶  s   þzButton.__init__Úset_focus_on_clickc                 O   ó   t jj| g|¢R i |¤ŽS r   )r   r=   r  rÜ   r   r   r   r  É  ó   zButton.set_focus_on_clickÚget_focus_on_clickc                 O   r  r   )r   r=   r  rÜ   r   r   r   r  Ï  r  zButton.get_focus_on_clickN)r   r   r   r
   r   r  r2   r   rø   rW  r=   r  r  r   r   r   r   r  ¯  s    üÿr  c                   @   rƒ   )Ú
LinkButton)Úurir†   r‰   N)r   r   r   r
   r   r   r2   r   r   r   r   r   r   ×  rŒ   r   c                   @   rƒ   )ÚLabelrÅ   r‰   N)r   r   r   r
   r   r"  r2   r   r   r   r   r   r"  ß  rŒ   r"  c                   @   s8   e Zd Zesereejjddddœe	dd�Z
dd„ Zd	S )
Ú
Adjustment)rX   ÚlowerÚupperÚstep_incrementÚpage_incrementÚ	page_sizeÚ	page_incrÚ	step_incr)r'  r&  rÕ   )rŠ   ræ   r‹   rÖ   c                 O   sŒ   t str*| j|i |¤Ž d|v r|  |d ¡ d S t|ƒdkr(|  |d ¡ d S d S tjj| g|¢R i |¤Ž d|v rD|  |d ¡ d S d S )NrX   rç   r   )r\   r]   rø   rx  ra   r   r#  r2   rÜ   r   r   r   r2   ò  s   ÿÿzAdjustment.__init__N)r   r   r   r\   r]   r
   r   r#  r2   r   rø   r   r   r   r   r#  è  s    ÿúr#  c                   @   sP   e Zd Zeejjddddœed�Zejj	ejj
B ejj	ejj
B ddfdd„Zd	S )
ÚTable)Ún_rowsrs  r½   r  ru  )r,  rs  r  r   c
           
      C   s"   t j | |||||||||	¡
 d S r   )r   r+  Úattach)
r1   r@   Úleft_attachÚright_attachÚ
top_attachÚbottom_attachÚxoptionsÚyoptionsÚxpaddingÚypaddingr   r   r   r-    s   "zTable.attachN)r   r   r   r
   r   r+  r2   r   ÚAttachOptionsÚEXPANDÚFILLr-  r   r   r   r   r+    s    ý.r+  c                   @   rƒ   )ÚScrolledWindow©ÚhadjustmentÚvadjustmentr‰   N)r   r   r   r
   r   r9  r2   r   r   r   r   r   r9    rŒ   r9  c                   @   rƒ   )Ú
HScrollbar©Ú
adjustmentr‰   N)r   r   r   r
   r   r=  r2   r   r   r   r   r   r=  !  rŒ   r=  c                   @   rƒ   )Ú
VScrollbarr>  r‰   N)r   r   r   r
   r   r@  r2   r   r   r   r   r   r@  )  rŒ   r@  c                       s,   e Zd Zd‡ fdd„	Zd‡ fdd„	Z‡  ZS )	ÚPanedFTc                    r�  r   )rF   rA  Úpack1©r1   r@   ÚresizeÚshrinkrH   r   r   rB  4  rƒ  zPaned.pack1c                    r�  r   )rF   rA  Úpack2rC  rH   r   r   rF  7  rƒ  zPaned.pack2)FT)TT)r   r   r   rB  rF  r^   r   r   rH   r   rA  3  s    rA  c                   @   rƒ   )ÚArrow)Ú
arrow_typeÚshadow_typer‰   N)r   r   r   r
   r   rG  r2   r   r   r   r   r   rG  ?  rŒ   rG  c                       s&   e Zd Zddd„Z‡ fdd„Z‡  ZS )ÚIconSetNc                 C   s8   |d urt jdtdd� tj |¡}|S tj | ¡}|S )NzXGtk.IconSet(pixbuf) has been deprecated. Please use: Gtk.IconSet.new_from_pixbuf(pixbuf)r   rè   )rò   ró   r   r   rJ  Únew_from_pixbufrß  )rÞ  ÚpixbufÚiconsetr   r   r   rß  H  s   þÿzIconSet.__new__c                    s   t t| ƒ ¡ S r   )rF   rJ  r2   rÜ   rH   r   r   r2   R  r<   zIconSet.__init__r   )r   r   r   rß  r2   r^   r   r   rH   r   rJ  G  s    

rJ  c                   @   rƒ   )ÚViewportr:  r‰   N)r   r   r   r
   r   rN  r2   r   r   r   r   r   rN  X  rŒ   rN  c                       s&   e Zd Zd‡ fdd„	Zdd„ Z‡  ZS )ÚTreeModelFilterNc                    r“  r   )rF   rO  Úset_visible_func)r1   r  ÚdatarH   r   r   rP  b  r‡  z TreeModelFilter.set_visible_funcc                 C   s    |   |¡}|  ¡  |||¡ d S r   )Úconvert_iter_to_child_iterÚ	get_modelrx  )r1   rd   r{  rX   r   r   r   rx  e  s   
zTreeModelFilter.set_valuer   )r   r   r   rP  rx  r^   r   r   rH   r   rO  a  s    rO  c                       s,   e Zd Zeddd„ƒZd‡ fdd„	Z‡  ZS )ÚCustomSorterNc                 C   s$   |d ur	t |ƒ}nd }tj ||¡S r   )r   r   rT  r   )rÞ  r’  r˜   Úcompare_funcr   r   r   r   q  s   
zCustomSorter.newc                    s(   |d ur	t |ƒ}nd }tt| ƒ ||¡S r   )r   rF   rT  r�  )r1   r’  r˜   rU  rH   r   r   r�  z  s   
zCustomSorter.set_sort_funcr   )r   r   r   r˜  r   r�  r^   r   r   rH   r   rT  o  s    rT  c                   @   r×   )ÚMenuc              	   C   s   |   d ||||||¡ d S r   )Úpopup_for_device)r1   Úparent_menu_shellÚparent_menu_itemr  rQ  ÚbuttonÚactivate_timer   r   r   Úpopup‡  s   z
Menu.popupN)r   r   r   r\  r   r   r   r   rV  †  rÝ   rV  c                  G   s
   t ƒ  d S r   )Ú_Gtk_main_quit)r,   r   r   r   Ú	main_quit�  r—  r^  c               	   O   sr   t tjƒ�* tƒ � t| i |¤ŽW  d   ƒ W  d   ƒ S 1 s"w   Y  W d   ƒ d S 1 s2w   Y  d S r   )r   r   r^  r   Ú	_Gtk_main)r,   ru   r   r   r   Úmain•  s   ÿÿ"ÿr`  Ústock_lookup)aÚsysrò   Úgi.repositoryr   Ú_ossighelperr   r   rÓ   r   r   Ú	overridesr   r	   r
   r   Úmoduler   Úgir   r   Ú_versionr\   r]   r[   Ú__all__r   Úwarn_msgró   ÚRuntimeWarningr   r   r.   Úobjectr/   r=   r_   ry   r„   r�   r�   r¬   r¹   r¼   r¿   rÄ   r°   rÉ   rØ   r2   rÛ   rÞ   r  r  r  r  r  r!  r'  r(  r*  r,  rI  rL  rŽ  rX  r™  r_  rg  r[  rî  ró  r  r  r  r   r"  r#  r+  r9  r=  r@  rA  rG  rJ  rN  rO  rT  rV  r^  r]  r`  r_  ra  Ú
init_checkrÙ   Úargvr>   r   r   r   r   Ú<module>   sº  






,
(



 





*

ý	
X









J

 



X

g
1
P
.


%



	















