Zc@sdZddlZddlZyHddlmZeej"ejdddlmZWdQXWn%e k rddlmZenXddl Z ddl m Z e ddZd ZeZd d Zd Zd ZddZdZdZdZdS(s PyGTK compatibility layer. This modules goes a little bit longer to maintain PyGTK compatibility than the normal overrides system. It is recommended to not depend on this layer, but only use it as an intermediate step when porting your application to PyGI. Compatibility might never be 100%, but the aim is to make it possible to run a well behaved PyGTK application mostly unmodified on top of PyGI. iN(tUserListtignore(treload(tGObjecttc Cs|dkr|}n|jjdddj}xvt|D]h}yt||d}Wn qAnXyt|tjrxw|j j D]c\}}|j }|j |dd}|r|j |r|t|}nt|||qWnWntk rqAnXyt|tjrxh|jj D]T\}} y!| jdj |dd}Wntk ryq6nXt||| q6WnWqAtk rqAqAXqAWdS(Nt.it_Ri(tNonet__name__trsplittuppertdirtgetattrt issubclassRtGEnumt__enum_values__titemst value_nametreplacet startswithtlentsetattrt TypeErrortGFlagst__flags_values__t value_namest IndexError( tmoduletdesttstriptmodnametattrtobjtvaluetenumtnametflag((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyt_install_enums6s8    !  cCsxddlm}|tjdj?t@t@dfd$} | j>_?j>jAt@t@dfd%} | j>_AjBj?t@fd&} | jB_?jBjAt@fd'}|jB_AjCj?t@fd(}|jC_?jCjAt@fd)}|jC_AjCjDtEfd*}|jC_Dd+jFfd,Y}|_GjHjI tE fd-}|jH_Id.jHffd/Y}|_Jfd0}|_Kfd1}|_Ld2}t:|jM_Nfd3}|_Od4}|jH_PjQjR_SjTj_UjVjW_XjVjY_ZjVj[_\jVj]_^jVj__j`j_aj+jb_cyjdje_fWntk r8nXjgjhjg_ijjjk_ljjjmjj_njojpd5ffd6Y}|_od7ffd8Y}|_pd9_qtrd:jsjtjs_ujsjv_wjsjxfd;}|js_xjsjyjs_zd<t{ffd=Yd>t{ffd?Yd@t{ffdAY}|js_|j}j~tdBdBfdC}|j}_~j+jddddddddddDdDfdE }|j+_j+j_j+j_dFt{fdGY} | }!|!tjdHj}nX||Wntk rl|}nX|S(Ni(t RectangleR(twindowtrect(R7torig_get_frame_extents(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytget_frame_extentss  cs|dS(Ni((tself(torig_get_origin(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyt get_originscs||jjfS(N(t get_visualtget_best_depth(RH(torig_gdk_window_get_geometry(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytgdk_window_get_geometrystGtk(RStgtkiiccSstjdtjdddS(Ns%set_tool_item_type() is not supportedt stackleveli(twarningstwarnR/tPyGIDeprecationWarning(t menuactiontgtype((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytset_tool_item_types t Alignmentcs#eZddddfdZRS(gcsAj|||j_||j_||j_||j_dS(N(t__init__tpropstxaligntyaligntxscaletyscale(RLR_R`RaRb(torig_Alignment(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR]s     (Rt __module__R]((Rc(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR\scs|||||dS(N((RLtchildtexpandtfilltpadding(t orig_pack_end(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytpack_endscs|||||dS(N((RLReRfRgRh(torig_pack_start(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyt pack_startscs|||dS(N((RLtcellRf(torig_tree_view_column_pack_end(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyttree_view_column_pack_endscs|||dS(N((RLRmRf(t orig_tree_view_column_pack_start(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyttree_view_column_pack_startscs|||dS(N((RLRmRf(torig_cell_pack_end(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyt cell_pack_endscs|||dS(N((RLRmRf(torig_cell_pack_start(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytcell_pack_startscs&fd}||||dS(Ncs'|dtkr|d }n|S(Ni(t_unset(targs(tfunc(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytcallbacks ((RLRmRxt user_dataRy(torig_set_cell_data_func(Rxs=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytset_cell_data_funcstGenericCellRenderercBseZRS((RRd(((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR}$scs#fd}|||dS(Ncs'|dtkr|d }n|S(Ni(Rv(Rw(Rx(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyRy-s ((RLRxRzRy(torig_combo_row_separator_func(Rxs=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytcombo_row_separator_func,st ComboBoxEntrycs)eZfdZdZdZRS(csjj|dt|dS(Nt has_entry(tComboBoxR]tTrue(RLtkwds(RS(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR]7scSs|j|dS(N(tset_entry_text_column(RLt text_column((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytset_text_column:scSs |jS(N(tget_entry_text_column(RL((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytget_text_column=s(RRdR]RR((RS(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR6s cs jS(N(R((RS(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytcombo_box_entry_newAscsjd|S(Ntmodel(R(R(RS(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytcombo_box_entry_new_with_modelEscSstjdtjdddS(Ns)install_child_property() is not supportedRUi(RVRWR/RX(t containerR$tpspec((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytinstall_child_propertyKs cs9j}jt}|j||jd|S(Ni(Rt ListStoretstrt set_modelR(tcomboR(RS(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytnew_textPs    cSs |j}|j|gdS(N(t get_modelRC(RLttextR((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyt append_textXs tHScalecseZdfdZRS(csj|d|dS(Nt adjustment(R](RLR(t orig_HScale(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR]wsN(RRdRR]((R(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyRvstVScalecseZdfdZRS(csj|d|dS(NR(R](RLR(t orig_VScale(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR]|sN(RRdRR]((R(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR{scSsdS(N(R(R((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytstfgetcs&dtfdY}||S(Nt SizeRequestcBseZdZRS(cSs8|j|_|j|_tj||j|jgdS(N(theighttwidthRR](RLtreq((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR]s  (RRdR](((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyRs(R(twidgetR(torig_size_request(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyt size_requestst BaseGettercs eZdZfdZRS(cSs ||_dS(N(tcontext(RLR((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR]sc sU|jj|}jdt|jddt|jddt|jdS(Ntreditgreentblue(Rtget_background_colortColortintRRR(RLtstatetcolor(R7(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyt __getitem__s(RRdR]R((R7(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyRs tStylescseZfdZRS(cs@|j}||_jdddddd|_dS(NRiRR(tget_style_contexttbaseRtblack(RLRR(RR7(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyR]s (RRdR]((RR7(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyRstStyleDescriptorcseZfdZRS(cs |S(N((RLtinstancetclass_(R(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyt__get__s(RRdR((R(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyRsg?cs||||||S(N((RLtmarkt within_margint use_alignR_R`(torig_text_view_scroll_to_mark(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyttext_view_scroll_to_marks gc  sj} jd} |dks3|dkrjt|d| _t|d| _| jjO} n|dks|dkrt|d| _t|d| _| jjO} n|dks|dkrt|d| _ t|d| _ | jj O} n|dks | dkrWt|d| _ t| d| _ | jjO} n| dkso| dkr| dks| dkrtdn| | _| | _| jjO} n||| | S(Nigsaspect ratios must be positive(tGeometryt WindowHintstmaxt min_widtht min_heighttMIN_SIZEt max_widtht max_heighttMAX_SIZEt base_widtht base_heightt BASE_SIZEt width_inct height_inct RESIZE_INCRt min_aspectt max_aspecttASPECT(RLtgeometry_widgetRRRRRRRRRRtgeometryt geom_mask(R7torig_set_geometry_hints(s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pytset_geometry_hintss2   t UnixPrintcBseZRS((RRd(((s=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyRst gtkunixprintRtcategory(tkeysymss gtk.keysymsi(tgenerictreemodel(ii(iici(RR-t version_infotsetdefaultencodingR/trequire_versionR,R1R.R%R3R5R7R8t_2BUTTON_PRESSt BUTTON_PRESStScreent get_defaulttscreen_get_defaulttPixbuft PixbufLoadert new_with_typet new_from_datatpixbuf_new_from_datat new_from_filetpixbuf_new_from_filetnew_from_file_at_scaletpixbuf_new_from_file_at_scaletAttributeErrortnew_from_file_at_sizetpixbuf_new_from_file_at_sizetnew_from_inlinetpixbuf_new_from_inlinetnew_from_streamtpixbuf_new_from_streamtnew_from_stream_at_scaletpixbuf_new_from_stream_at_scaletnew_from_xpm_datatpixbuf_new_from_xpm_datat get_file_infotpixbuf_get_file_infoRFtpixbuf_get_formatstWindowRKRNRt screen_widthRt screen_heightt get_geometryRStgdkt pygtk_versiont MAJOR_VERSIONt MINOR_VERSIONt MICRO_VERSIONt gtk_versiont classmethodtActionR[R\tBoxRjRRltTreeViewColumnt CellLayoutR|Rvt CellRendererR}Rtset_row_separator_funcRRRt ContainerRtcombo_box_new_textRtExpandertnew_with_mnemonictexpander_new_with_mnemonict IconThemeticon_theme_get_defaulttImagetnew_from_pixbuftimage_new_from_pixbuftnew_from_stocktimage_new_from_stocktnew_from_animationtimage_new_from_animationtnew_from_icon_settimage_new_from_icon_settimage_new_from_filetSettingstsettings_get_defaulttset_default_icontwindow_set_default_icont Clipboardtgett clipboard_gett AccelGrouptconnectt connect_groupt StatusIcont position_menutstatus_icon_position_menutset_tooltip_textt set_tooltipRRt stock_addtpropertytWidgett get_windowRHtget_default_directiontwidget_get_default_directionRthidethide_alltobjecttstyletTextViewtscroll_to_marktFalseRRtlist_toplevelstwindow_list_toplevelstset_default_icon_nametwindow_set_default_icon_nameRVtcatch_warningst simplefiltertRuntimeWarningt gi.overridesRRRtGenericTreeModel($tversionR1R3R5R8RFRKRNRRR[R\RjRlRoRqRsRuR|R}RRRRRRRRRRRRRRt unixprintRR((RR7RSRRcRRRrRtR~RQRERJRMRiRkR{RRRRnRps=/usr/lib64/python2.7/site-packages/pygtkcompat/pygtkcompat.pyt enable_gtkis<                                                                 #      cCs1tjddddlm}|tjd!s0      !       (