o 3Gb@s ddlZddlZddlmZddlmZmZddlmZm Z ddl m Z m Z m Z mZddlmZddlmZed Zejd kZejd kZejd kZgZeZed e Z edercdZeeeGdddeZedester}ddZedddZGddde Z!Gdddej"Z"e e"Z"edeserGdddej#e"Z#e e#Z#edne Z#Gdddej$Z$e e$Z$edeserGdddej%Z%e e%Z%edGd d!d!ej&Z&e e&Z&ed!Gd"d#d#ej'Z'e e'Z'ed#Gd$d%d%ej(Z(e e(Z(ed%Gd&d'd'ej)e#Z)e e)Z)ed'es-er?Gd(d)d)ej*Z*e e*Z*ed)esEerWGd*d+d+ej+Z+e e+Z+ed+es]eroGd,d-d-ej,Z,e e,Z,ed-d.d/Z-Gd0d1d1ej.Z.e e.Z.ed1erej/j0Z1n e ej/j0d2ed3d4Z1Gd5d6d6ej/Z/e e/Z/ed6Gd7d8d8ej2e#Z2e e2Z2ed8eserGd9d:d:ej3e2Z3e e3Z3ed:eserGd;d<dd>ej5Z5e e5Z5ed>eserGd?d@d@ej6Z6e e6Z6ed@eser/GdAdBdBej7Z7e e7Z7edBGdCdDdDej8Z8e e8Z8edDesGerYGdEdFdFej9Z9e e9Z9edFGdGdHdHej:Z:e e:Z:edHGdIdJdJej;Z;e e;Z;edJGdKdLdLej<ZZ>e e>Z>edPGdQdRdRej?Z?e e?Z?edReserGdSdTdTej@Z@e e@Z@edTGdUdVdVejAe>e?ZAe eAZAedVGdWdXdXe ZBedXGdYdZdZe ZCedZGd[d\d\ejDZDe eDZDed\Gd]d^d^ejEe>e?ZEe eEZEed^Gd_d`d`ejFe#ZFe eFZFed`GdadbdbejGZGe eGZGedbGdcddddejHZHe eHZHeddesnerGdedfdfejIe#ZIe eIZIedfGdgdhdhejJZJe eJZJedhGdidjdjejKZKe eKZKedjGdkdldlejLZLe eLZLedleserGdmdndnejMe#ZMe eMZMednGdodpdpejNZNe eNZNedpeser GdqdrdrejOZOe eOZOedrGdsdtdtejPZPe ePZPedteser$GdudvdvejQZQe eQZQedves*er`GdwdxdxejRZRe eRZRedxGdydzdzejSZSe eSZSedzGd{d|d|ejTZTe eTZTed|Gd}d~d~ejUZUe eUZUed~erGdddejVZVe eVZVederGdddejWZWe eWZWedeserejXZYe ejXddZXejZZ[e ejZddZZesere ej\Z\edere]Z^dSe]ej_\Z^Z_e`e_e__dS)N)GObject)wakeup_on_signalregister_sigint_fallback)Template_extract_handler_and_args)overridestrip_boolean_resultdeprecated_initwrap_list_store_sort_func)get_introspection_module)PyGIDeprecationWarningGtkz2.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__rr2/usr/lib/python3/dist-packages/gi/overrides/Gtk.pyr<srcCs4g}|D]}t|tjstjj|}||q|S)zCreate 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 TargetEntrynewappend)targetstarget_entriesentryrrr_construct_target_listDs    rc Cst||\}}|tjj@} |dur-| r |j|||g|RdS|j|||g|RdS| r;|j||g|RdS|j||g|RdSN)rr ConnectFlagsAFTERconnect_object_afterconnect_object connect_afterconnect) buildergobj signal_name handler_name connect_objflags obj_or_maphandlerargsafterrrr_builder_connect_callbackTs r.c@s$eZdZddZddZddZdS)_FreezeNotifyManagercCs ||_dSr)obj)selfr0rrr__init__e z_FreezeNotifyManager.__init__cCsdSrrr1rrr __enter__hz_FreezeNotifyManager.__enter__cCs|jdSr)r0thaw_child_notify)r1exc_type exc_value tracebackrrr__exit__kz_FreezeNotifyManager.__exit__N)rrrr2r5r;rrrrr/ds r/cseZdZeejjZerddZddZ e se rfddZ e s"e r(fddZ e s,e r2fd d Ze s6e r?dd d ZZSZS)WidgetcCs |t|vSr)listr1childrrr __contains__t zWidget.__contains__ccs(|}|r|V|}|sdSdSr)get_first_childget_next_siblingr?rrr__iter__ws  zWidget.__iter__cstt|t|Sr)superr=freeze_child_notifyr/r4 __class__rrrG~szWidget.freeze_child_notifyc8|durt|tjstjt|}tt||dSr)rr TargetListrrrFr=drag_dest_set_target_listr1 target_listrHrrrLz Widget.drag_dest_set_target_listcrJr)rrrKrrrFr=drag_source_set_target_listrMrHrrrPrOz"Widget.drag_source_set_target_listNcCsN|dur||}|durtd||ft|j}tj||||S)Nz/Class "%s" does not contain style property "%s") find_style_property ValueErrorrValue value_typerr=style_get_property get_value)r1 property_namevalueproprrrrUs  zWidget.style_get_propertyr)rrrr rr=translate_coordinatesGTK4rArEGTK2GTK3rGrLrPrU __classcell__rrrHrr=os    r=c@sVeZdZddZddZddZddZeZdd d Zd d Z ddZ e e j jZd S) ContainercC t|Sr)len get_childrenr4rrr__len__rBzContainer.__len__cCs ||vSr)rbr?rrrrArBzContainer.__contains__cCr`r)iterrbr4rrrrErBzContainer.__iter__cCdSNTrr4rrr__bool__r6zContainer.__bool__NcCsP|dur||}|durtd||ft|j}tj|||||S)Nz/Class "%s" does not contain child property "%s") find_child_propertyrRrrSrTrr_child_get_propertyrV)r1r@rWrXrYrrrris  zContainer.child_get_propertycsfdd|DS)zsz'Container.child_get..r)r1r@ prop_namesrrlr child_getszContainer.child_getcKs0|D]\}}|dd}||||qdS)z=Set a child properties on the given child to key/value pairs._-N)itemsreplacechild_set_property)r1r@kwargsrkrXrrr child_sets zContainer.child_setr)rrrrcrArErg __nonzero__rirorvr rr_get_focus_chainrrrrr_s  r_cs,eZdZfddZeejjddZZS)Editablecstt||d|SN)rFry insert_text)r1textpositionrHrrr|zEditable.insert_textrfail_ret) rrrr|r rryget_selection_boundsr^rrrHrrys ryc@eZdZeejjdedZdS)Actionrklabeltooltipstock_id arg_namescategoryN)rrrr rrr2rrrrrr  rc@r) RadioActionrkrrrrXrN)rrrr rrr2rrrrrrrrc@s<eZdZeejjdedZd ddZd ddZ d dd Z dS) ActionGroup)rkrNcsJzt|Wn tytdwdfdd }|D]}||qdS)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 /group-name/action-name. entries must be iterableNcsLt||||d}|durdur|d|n|d|||dSNractivate)rr#add_action_with_accel)rkrr acceleratorrcallbackactionr1 user_datarr_process_actions z0ActionGroup.add_actions.._process_action)NNNNNrd TypeErrorr1entriesrrerrr add_actionss   zActionGroup.add_actionscsJzt|Wn tytdwdfdd }|D]}||qdS)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 /group-name/action-name. rNFcsXtj||||d}|||dur$dur|d|n|d|||dSr)r ToggleAction set_activer#r)rkrrrrr is_activerrrrr?s z7ActionGroup.add_toggle_actions.._process_action)NNNNNFrrrrradd_toggle_actionss   zActionGroup.add_toggle_actionsc szt|Wn tytdwd}dfdd }|D]}||g|R}|dur.|}q|durL|durN|durC|d|dS|d||dSdSdS)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 /group-name/action-name. rNrcsBt|||||d}tr|||kr|d|||S)NrT)rr] join_grouprr) group_sourcerkrrrr entry_valuerr1rXrrrqs   z6ActionGroup.add_radio_actions.._process_actionchanged)NNNNr)rdrr#) r1rrX on_changer first_actionrrrrrradd_radio_actionsNs"   zActionGroup.add_radio_actionsr)NNN) rrrr rrr2rrrrrrrrrs  -1rc@seZdZddZdddZdS) UIManagercC*t|ts tdt|}tj|||SNzbuffer must be a string)rstrr_get_utf8_lengthrradd_ui_from_stringr1bufferlengthrrrr zUIManager.add_ui_from_stringr{cCstj|||Sr)rrinsert_action_grouprrrrrszUIManager.insert_action_groupNr{)rrrrrrrrrrsrc@eZdZeejjZdS)ComboBoxN)rrrr rrget_active_iterrrrrrrc@r)Box) homogeneousspacingrN)rrrr rrr2rrrrrrrrc@s(eZdZeejjddejjie dZdS) SizeGroup)moder)rdeprecated_defaultsrN) rrrr rrr2 SizeGroupModeVERTICALrrrrrrs   rc@r)MenuItemrrN)rrrr rrr2rrrrrrrrcCs*t|tsJt|ts|d}t|S)Nzutf-8)rrbytesencodera)stringrrrrs  rcsNeZdZerddlmZeZd fdd ZnddZdd Z d d Z Z S) Builderr)define_builder_scopeNcs*tt||r|t|dSdSr)rFrr2 set_scope BuilderScope)r1scope_object_or_maprHrrr2szBuilder.__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)connect_signals_fullr.)r1r*rrrconnect_signalss zBuilder.connect_signalscCrr)rrrrrradd_from_stringrrrrrrzBuilder.add_from_stringcCs,t|ts tdt|}tj||||Sr)rrrrrradd_objects_from_string)r1r object_idsrrrrrs zBuilder.add_objects_from_stringr) rrrr[ _gtktemplaterrr2rrrr^rrrHrrs r)type)rr stacklevelc@eZdZddZdS)WindowcOs&tstdt|g|Ri|dS)NzRGtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case.) initialized RuntimeError _window_initr1r,rurrrr2s zWindow.__init__N)rrrr2rrrrr rc@sdeZdZeser,dZeejj ddddde dZ dd Z d d Z e d d Ze dd ZddZdS)Dialog)titleparentr)buttons_buttons_property)r transient_forr) add_buttonsr)r)rrr)rr)rignoredeprecated_aliasesrcOs|}tt|j|}||d}|jtkr#|jjtjkr#|d7}|dd}|durBt |t j sBt j dt|d|ddnd}|dd}|rht j dt|d|t jj@r^d |d <|t jj@rhd |d <|j|i||ry|j|dSdS) NrrzThe "buttons" argument must be a Gtk.ButtonsType enum value. Please use the "add_buttons" method for adding buttons. See: https://wiki.gnome.org/PyGObject/InitializerDeprecationsrr)rzThe "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/InitializerDeprecationsTmodaldestroy_with_parent)copydictzip_old_arg_namesupdaterIrr2getrr ButtonsTypewarningswarnrpop DialogFlagsMODALDESTROY_WITH_PARENT_initr)r1r,ru new_kwargs old_kwargsrrr)rrrr2s4     zDialog.__init__c Os~t|j0ttjj|g|Ri|WdWdS1s(wYWddS1s8wYdSr)rdestroyrrrrunrrrrrFs "z Dialog.runcC|Sr)get_action_areadialogrrrKzDialog.cCrr)get_content_arearrrrrLrcGs*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. cssT|r(z |dd\}}Wn tytdw|dd}||fV|sdSdS)Nrrz%Must pass an even number of arguments)rR)btrrrr_button\s    z#Dialog.add_buttons.._buttonN) add_button)r1r,rr}responserrrrNs zDialog.add_buttonsN)rrrr\r]rr rrr2rrrproperty action_areavboxrrrrrrs *   rc@s6eZdZeejjddddedZddZdd Z d S) MessageDialog)rr) message_typermessage_formatrr)r}rrrrcC|dd|d|dS)Nsecondary-use-markupFsecondary-text set_propertyr1rrrrformat_secondary_textv z#MessageDialog.format_secondary_textcCr)NrTrrrrrrformat_secondary_markupzrz%MessageDialog.format_secondary_markupN) rrrr rr r2rrrrrrrr ns r c@r)ColorSelectionDialogrrN)rrrr rrr2rrrrrrrrc@r)FileChooserDialog)rrrrrN)rrrr rrr2rrrrrrrrc@r)FontSelectionDialogrrN)rrrr rrr2rrrrrrrrc@s$eZdZeejjdddiedZdS)RecentChooserDialog)rrrecent_managerrrmanagerrN)rrrr rrr2rrrrrrs  rc@sJeZdZesereejjde dZe ejj Z e ejj Z e ejj Z dS)IconViewmodelrN)rrrr\r]r rr!r2rr get_item_at_posget_visible_rangeget_dest_item_at_posrrrrr!s  r!c@r) ToolButton)rrN)rrrr rr'r2rrrrrr'rr'c@r) IMContextN)rrrr rr(get_surroundingrrrrr(rr(c@r) RecentInfoN)rrrr rr*get_application_inforrrrr*rr*c@s^eZdZdddZdddZddd Zdd d Zd d ZddZdddZ e e j j ddZ dS) TextBufferNcKs&tjdd|i|}|||S)aCreates 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. rkNr)rTextTag get_tag_tableadd)r1tag_name propertiestagrrr create_tagszTextBuffer.create_tagFcCstj||||Sr)rr, create_mark)r1 mark_namewhere left_gravityrrrr4zTextBuffer.create_markr{cCstj|||dSr)rr,set_textr1r}rrrrr9rzTextBuffer.set_textcCs0t|ts tdt|tj||||dSNztext must be a string, not %s)rrrrrr,insert)r1rdr}rrrrr<s zTextBuffer.insertcGsB|}||||sdS||}|D] }||||qdSr) get_offsetr<get_iter_at_offset apply_tag)r1rdr}tags start_offsetstartr2rrrinsert_with_tagss  zTextBuffer.insert_with_tagscGsNg}|D]}||}|std|||q|j||g|RdS)Nzunknown text tag: %s)r.lookuprRrrC)r1rdr}r@tag_objsr2tag_objrrrinsert_with_tags_by_name s  z#TextBuffer.insert_with_tags_by_namecCs.t|ts tdt|tj|||dSr;)rrrrrr,insert_at_cursorr:rrrrHs zTextBuffer.insert_at_cursorrrr)Fr)rrrr3r4r9r<rCrGrHr rr,rrrrrr,s     r,c@s$eZdZeejjZeejjZdS)TextIterN)rrrr rrIforward_searchbackward_searchrrrrrI"s rIcs(eZdZddZddZesereZddZfddZ d d Z d d Z d dZ ddZ ddZeejjZeejjZeejjZeejjZeejjedZfddZfddZfddZddZddZddZd d!Zfd"d#Zfd$d%Z fd&d'Z!fd(d)Z"fd*d+Z#Z$S), TreeModelcCs |dSr)iter_n_childrenr4rrrrc,r3zTreeModel.__len__cCrerfrr4rrrrg/r6zTreeModel.__bool__cCsxt|tjr|St|tr&|dkr&t||}|dkr!td|||Sz||}W|Sty;td|w)Nrzrow index is out of bounds: %dzcould not find tree path '%s')rrTreeIterintra IndexErrorget_iterrR)r1keyindexaiterrrr_getiter6s      zTreeModel._getitercs&tt|}t|dr|St|S)Nsort_new_with_model)rFrLhasattrrV TreeModelSortnew_with_model)r1 super_objectrHrrrVEs   zTreeModel.sort_new_with_modelcCst|tjr|St|Sr)rrTreePathr1pathrrr _coerce_pathLs zTreeModel._coerce_pathcCs||}t||Sr)rU TreeModelRowr1rRrTrrr __getitem__Rs  zTreeModel.__getitem__cCs||}||j|dSr)set_rowrd)r1rRrXrowrrr __setitem__VszTreeModel.__setitem__cCs||}||dSr)rUremover`rrr __delitem__Zs zTreeModel.__delitem__cCst||Sr)TreeModelRowIterget_iter_firstr4rrrrE^r<zTreeModel.__iter__zinvalid tree pathcs2||}tt||\}}|std||S)Nzinvalid tree path '%s')r^rFrLrQrR)r1r]successrTrHrrrQhs  zTreeModel.get_iterc$|}tt||}|r|SdSr)rrFrL iter_next)r1rT next_iterrirHrrrko zTreeModel.iter_nextcrjr)rrFrL iter_previous)r1rT prev_iterrirHrrrnurmzTreeModel.iter_previouscCsvt|tr td|}t||krtdg}g}t|D]\}}|dur(q||||||q||fS)Nz%Expected a list or tuple, but got strz1row sequence has the incorrect number of elements) rrr get_n_columnsrarR enumerater_convert_value)r1rc n_columnsresultcolumnscur_colrXrrr _convert_row{s   zTreeModel._convert_rowcCs.||\}}|D] }|||||q dSr)rw set_value)r1treeiterrc converted_rowrucolumnrrrrbszTreeModel.set_rowcCs"t|tjr|St|||S)z5Convert value to a GObject.Value of the expected type)rrrSget_column_type)r1r{rXrrrrrs zTreeModel._convert_valuecGsZ|}g}|D] }t|tstd|dks||krtd||||qt|S)Nzcolumn numbers must be intsrzcolumn number is out of range)rprrOrrRrrVtuple)r1ryrursvaluescolrrrrs z TreeModel.getctt||||Sr)rFrL row_changedr^r1r]rdrHrrrzTreeModel.row_changedcrr)rFrL row_insertedr^rrHrrrrzTreeModel.row_insertedcrr)rFrLrow_has_child_toggledr^rrHrrrszTreeModel.row_has_child_toggledcstt|||Sr)rFrL row_deletedr^r\rHrrrzTreeModel.row_deletedcstt|||||Sr)rFrLrows_reorderedr^)r1r]rd new_orderrHrrrszTreeModel.rows_reordered)%rrrrcrgr\r]rwrUrVr^rardrfrEr rrLrh iter_childreniter_nth_child iter_parentget_iter_from_stringrRrQrkrnrwrbrrrrrrrrr^rrrHrrL+s>            rLcs<eZdZeejjddZdfdd Zdfdd ZZ S) TreeSortable)NNrNctt||||dSr)rFr set_sort_func)r1sort_column_id sort_funcrrHrrrrzTreeSortable.set_sort_funcctt|||dSr)rFrset_default_sort_func)r1rrrHrrrrz"TreeSortable.set_default_sort_funcr) rrrr rrget_sort_column_idrrr^rrrHrrsrc@s:eZdZeejjdedZeejdse ddZ dSdS)rXr"rrYcCs t|Sr)rLrV)r1 child_modelrrrrY zTreeModelSort.new_with_modelN) rrrr rrXr2rrW classmethodrYrrrrrXs rXc@seZdZddZeejdsejjZn eejdsejjZddZ ddd Z dd d Z dd d Z dddZ dddZddZddZdS) ListStorecGtj|||dSr)rrr2set_column_typesr1 column_typesrrrr2 zListStore.__init__insert_with_valuesvinsert_with_valuescCs:|dur||\}}||||}|Stj||}|Sr)rwrrrr<)r1r~rcruryrrr _do_inserts zListStore._do_insertNcCs|r|d|Stj|Srz)rrrrr1rcrrrrs  zListStore.appendcCs |d|SNrrrrrrprependrBzListStore.prependcCs |||Srr)r1r~rcrrrr<rBzListStore.insertcCsB|dur|dur d}n ||d}|||Stj||Srz)get_path get_indicesrrr insert_beforer1siblingrcr~rrrrs  zListStore.insert_beforecCsF|dur|dur d}n ||dd}|||Stj||SNrr{r)rrrrr insert_afterrrrrrs  zListStore.insert_aftercC"|||}tj||||dSr)rrrrrxr1ryr{rXrrrrx zListStore.set_valuecsfdd}|rYt|dtr!||ddd|ddddSt|dttfr?t|dkr4td||d|ddSt|dtrU|t|d|ddStddS)Ncxt|t|kr tdg}g}t||D]\}}t|ts"td|||||qtj ||dSNz7The number of columns do not match the number of valuesz0TypeError: Expected integer argument for column.) rarrrrOrrrrrsetcolsvalsrur~col_numrXr1ryrr _set_lists  z!ListStore.set.._set_listsrrrToo many argumentsArgument list must be in the form of (column, value, ...), ((columns,...), (values, ...)) or {column: value}. No -1 termination is needed.)rrOr}r>rarrr~r1ryr,rrrrr" z ListStore.setr)rrrr2rWrrrrrrrr<rrrxrrrrrrs        rc@s|eZdZddZeddZeddZeddZed d Zd d Z d dZ ddZ ddZ ddZ ddZddZdS)r_cCsht|tjstdt|j||_t|tjr |||_ dSt|tj r+||_ dStdt|j)Nz expected Gtk.TreeModel, %s foundz/expected Gtk.TreeIter or Gtk.TreePath, %s found) rrrLrrrr#r[rQrdrN)r1r# iter_or_pathrrrr2?s    zTreeModelRow.__init__cCs|j|jSr)r#rrdr4rrrr]KszTreeModelRow.pathcCrr)get_nextr4rrrnextOzTreeModelRow.nextcCrr) get_previousr4rrrpreviousSrzTreeModelRow.previouscCrr) get_parentr4rrrrWrzTreeModelRow.parentcC"|j|j}|rt|j|SdSr)r#rkrdr_)r1rlrrrr[ zTreeModelRow.get_nextcCrr)r#rnrdr_)r1rorrrr`rzTreeModelRow.get_previouscCrr)r#rrdr_)r1 parent_iterrrrrerzTreeModelRow.get_parentcst|tr#|jkrtd||dkr|}jj|St|trK| j\}}}g}t |||D] }| jj|q;|St|t rYfdd|DSt dt|j)N!column index is out of bounds: %drcsg|]}|qSrr)rjkr4rrrmxsz,TreeModelRow.__getitem__..z0indices must be integers, slice or tuple, not %s)rrOr#rprP_convert_negative_indexrVrdsliceindicesrangerr}rrr)r1rRrBstopstepalistirr4rrajs"     zTreeModelRow.__getitem__c Cs0t|tr&||jkrtd||dkr||}|j|j||dSt|trf| |j\}}}t |||}t |t |krPt dt |t |ft |D]\}}|j|j|||qTdSt|trt |t |krt dt |t |ft||D]\} }||| <qdStdt|j)Nrrz9attempt to assign sequence of size %d to slice of size %dz       zTreeModelRow.__setitem__cCs&|j|}|dkrtd||S)Nrr)r#rprP)r1rS new_indexrrrrs z$TreeModelRow._convert_negative_indexcCs|j|j}t|j|Sr)r#rrdrg)r1 child_iterrrr iterchildrens zTreeModelRow.iterchildrenN)rrrr2r r]rrrrrrrardrrrrrrr_=s"     r_c@s0eZdZddZddZesereZddZdS)rgcCs||_||_dSr)r#rd)r1r#rTrrrr2s zTreeModelRowIter.__init__cCs,|jstt|j|j}|j|j|_|Sr)rd StopIterationr_r#rkrrrr__next__s zTreeModelRowIter.__next__cCs|Srrr4rrrrEr6zTreeModelRowIter.__iter__N) rrrr2rr\r]rrErrrrrgs  rgcsveZdZdddZfddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZZS)r[rcCsrt|tr t|}nt|tsddd|D}t|dkr%td|zt|WSty8td|w)N:css|]}t|VqdSr)r)rjvalrrr sz#TreePath.__new__..rz-could not parse subscript '%s' as a tree path)rrOrjoinrarr[new_from_string)clsr]rrr__new__s        zTreePath.__new__cstt|dSr)rFr[r2rrHrrr2r8zTreePath.__init__cCs |pdS)N) to_stringr4rrr__str__rBzTreePath.__str__cCs|duo ||dkSrcomparer1otherrrr__lt__rzTreePath.__lt__cCs|duo ||dkSrrrrrr__le__rzTreePath.__le__cCs|duo ||dkSrrrrrr__eq__rzTreePath.__eq__cCs|dup ||dkSrrrrrr__ne__rzTreePath.__ne__cCs|dup ||dkSrrrrrr__gt__rzTreePath.__gt__cCs|dup ||dkSrrrrrr__ge__rzTreePath.__ge__cCr`r)rdrr4rrrrErBzTreePath.__iter__cCrr) get_depthr4rrrrcszTreePath.__len__cCs ||Sr)r)r1rSrrrrarBzTreePath.__getitem__)r)rrrrr2rrrrrrrrErcrar^rrrHrr[s  r[c@s^eZdZddZddZdddZddd Zdd d Zdd d ZdddZ ddZ ddZ dS) TreeStorecGrr)rrr2rrrrrr2rzTreeStore.__init__cCs>|dur||\}}|||||}|Stj|||}|Sr)rwrrrr<)r1rr~rcruryrrrrs zTreeStore._do_insertNcC||d|Srzrr1rrcrrrrr<zTreeStore.appendcCrrrrrrrrr<zTreeStore.prependcCs||||Srr)r1rr~rcrrrr<r<zTreeStore.insertcCsX|dur$|dur d}n|dur||}||d}||||Stj|||Srz)rrrrrrrr1rrrcr~rrrr s zTreeStore.insert_beforecCs\|dur&|dur d}n|dur||}||dd}||||Stj|||Sr)rrrrrrrrrrrrs zTreeStore.insert_aftercCrr)rrrrrxrrrrrx#rzTreeStore.set_valuecsfdd}|rYt|dtr!||ddd|ddddSt|dttfr?t|dkr4td||d|ddSt|dtrU||d|ddStddS)Ncrr) rarrrrOrrrrrrrrrrr(rz!TreeStore.set.._set_listsrrrrr) rrOr}r>rarrkeysr~rrrrr'rz TreeStore.setr) rrrr2rrrr<rrrxrrrrrrs     rcseZdZesereejjde dZe ejj Z e ejj Z e ejj Z es'er-fddZes1er7fddZdfd d Zdfd d Zdfdd ZddZZS)TreeViewr"rcs t|}tt||||dSr)rrFrenable_model_drag_source)r1start_button_maskractionsrrHrrrSs  z!TreeView.enable_model_drag_sourcecst|}tt|||dSr)rrFrenable_model_drag_dest)r1rrrrHrrrZs zTreeView.enable_model_drag_destNFcs0t|tjs t|}tt||||||dSr)rrr[rFrscroll_to_cell)r1r]r{ use_align row_align col_alignrHrrr_s zTreeView.scroll_to_cellcs,t|tjs t|}tt||||dSr)rrr[rFr set_cursor)r1r]r{ start_editingrHrrrds zTreeView.set_cursorcs&t|tjs t|}tt|||Sr)rrr[rFr get_cell_area)r1r]r{rHrrris zTreeView.get_cell_areacKs>t}||||d||||j|fi|dSNF)TreeViewColumn set_title pack_start insert_columnset_attributes)r1r~rcellrur{rrrinsert_column_with_attributesns    z&TreeView.insert_column_with_attributes)NFrrrr)rrrr\r]r rrr2rr get_path_at_posr%get_dest_row_at_posrrrrrrr^rrrHrrHs"     rcs@eZdZ  d ddZeejjZd fdd ZddZ Z S) rrNcKsDtjj||d|r||d|D] \}}||||qdS)NrT)rrr2rrr add_attribute)r1r cell_renderer attributesrkrXrrrr2{s  zTreeViewColumn.__init__crr)rFrset_cell_data_func)r1r func func_datarHrrr rz!TreeViewColumn.set_cell_data_funccKs6tj|||D] \}}tj||||q dSr)r CellLayoutclear_attributesrrr )r1r r rkrXrrrrszTreeViewColumn.set_attributes)rNr) rrrr2r rrcell_get_positionr rr^rrrHrrzs rcs4eZdZfddZfddZfddZZS) TreeSelectioncs(t|tjs t|}tt||dSr)rrr[rFr select_pathr\rHrrrs zTreeSelection.select_pathcs(tt|\}}}|r||fS|dfSr)rFr get_selected)r1rir#rTrHrrrszTreeSelection.get_selectedcstt|\}}||fSr)rFrget_selected_rows)r1rowsr#rHrrrszTreeSelection.get_selected_rows)rrrrrrr^rrrHrrs   rc@sVeZdZeejjddeddZddZe ej drdd Z e ej d r)d d Z d Sd S)Button)rstock use_stock use_underline)rr)rrrrcOsvd|vr1|dr1tjdtdd|}|d|d<d|d<d|d<|d=tjj|fi|dS|j|i|dS) NrzKStock items are deprecated. Please use: Gtk.Button.new_with_mnemonic(label)rrrTrr)rrrrrrr2r)r1r,rurrrrr2s zButton.__init__set_focus_on_clickcOtjj|g|Ri|Sr)rr=rrrrrrzButton.set_focus_on_clickget_focus_on_clickcOrr)rr=rrrrrrrzButton.get_focus_on_clickN) rrrr rrr2rrrWr=rrrrrrrs   rc@r) LinkButton)urirrN)rrrr rr r2rrrrrr rr c@r)LabelrrN)rrrr rr"r2rrrrrr"rr"c@s8eZdZesereejjdddde ddZ ddZd S) Adjustment)rXlowerupperstep_incrementpage_increment page_size page_incr step_incr)r'r&r)rrrrcOststr*|j|i|d|vr||ddSt|dkr(||ddSdStjj|g|Ri|d|vrD||ddSdS)NrXrr)r\r]rrxrarr#r2rrrrr2s zAdjustment.__init__N) rrrr\r]r rr#r2rrrrrrr#s r#c@sPeZdZeejjddddedZejj ejj Bejj ejj BddfddZ d S) Table)n_rowsrsrrru)r,rsrrc Cs"tj|||||||||| dSr)rr+attach) r1r@ left_attach right_attach top_attach bottom_attachxoptionsyoptionsxpaddingypaddingrrrr-s"z Table.attachN) rrrr rr+r2r AttachOptionsEXPANDFILLr-rrrrr+ s.r+c@r)ScrolledWindow hadjustment vadjustmentrN)rrrr rr9r2rrrrrr9rr9c@r) HScrollbar adjustmentrN)rrrr rr=r2rrrrrr=!rr=c@r) VScrollbarr>rN)rrrr rr@r2rrrrrr@)rr@cs,eZdZdfdd Zdfdd ZZS) PanedFTcrr)rFrApack1r1r@resizeshrinkrHrrrB4rz Paned.pack1crr)rFrApack2rCrHrrrF7rz Paned.pack2)FT)TT)rrrrBrFr^rrrHrrA3srAc@r)Arrow) arrow_type shadow_typerN)rrrr rrGr2rrrrrrG?rrGcs&eZdZdddZfddZZS)IconSetNcCs8|durtjdtddtj|}|Stj|}|S)NzXGtk.IconSet(pixbuf) has been deprecated. Please use: Gtk.IconSet.new_from_pixbuf(pixbuf)rr)rrrrrJnew_from_pixbufr)rpixbuficonsetrrrrHs  zIconSet.__new__cstt|Sr)rFrJr2rrHrrr2Rr<zIconSet.__init__r)rrrrr2r^rrrHrrJGs  rJc@r)Viewportr:rN)rrrr rrNr2rrrrrrNXrrNcs&eZdZdfdd ZddZZS)TreeModelFilterNcrr)rFrOset_visible_func)r1rdatarHrrrPbrz TreeModelFilter.set_visible_funccCs ||}||||dSr)convert_iter_to_child_iter get_modelrx)r1rdr{rXrrrrxes zTreeModelFilter.set_valuer)rrrrPrxr^rrrHrrOasrOcs,eZdZedddZdfdd ZZS) CustomSorterNcCs$|dur t|}nd}tj||Sr)r rrTr)rrr compare_funcrrrrqs zCustomSorter.newcs(|dur t|}nd}tt|||Sr)r rFrTr)r1rrrUrHrrrzs zCustomSorter.set_sort_funcr)rrrrrrr^rrrHrrTos rTc@r)Menuc Cs|d||||||dSr)popup_for_device)r1parent_menu_shellparent_menu_itemrrQbutton activate_timerrrpopupsz Menu.popupN)rrrr\rrrrrVrrVcGs tdSr)_Gtk_main_quit)r,rrr main_quitrr^c Osrttj*tt|i|WdWdS1s"wYWddS1s2wYdSr)rrr^r _Gtk_main)r,rurrrmains  "r` stock_lookup)asysr gi.repositoryr _ossighelperrrrrr overridesrr r r moduler gir r_versionr\r]r[__all__rwarn_msgrRuntimeWarningrrr.objectr/r=r_ryrrrrrrrrrrrr2rrr rrrrr!r'r(r*r,rIrLrrXrr_rgr[rrrrrr r"r#r+r9r=r@rArGrJrNrOrTrVr^r]r`r_ra init_checkrargvr>rrrrs            , (              *   X               J      X  g 1 P .    %