]Sc@svddlZddlZddlmZddlmZddlmZddlmZddl m Z m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZde fd YZ!gej"j#d d j$ej%D] Z&e&^qZ'e'j(e)ej*d kr\e'j(d nde+fdYZ,dS(iNi(tast(tmessage(t CacheStore(t GIRParser(t SourceSymbolt ctype_namet CTYPE_POINTERtCTYPE_BASIC_TYPEt CTYPE_UNIONt CTYPE_ARRAYt CTYPE_TYPEDEFt CTYPE_VOIDt CTYPE_ENUMtCTYPE_FUNCTIONt CTYPE_STRUCTtCSYMBOL_TYPE_FUNCTIONtCSYMBOL_TYPE_TYPEDEFtCSYMBOL_TYPE_STRUCTtCSYMBOL_TYPE_ENUMtCSYMBOL_TYPE_UNIONtCSYMBOL_TYPE_OBJECTtCSYMBOL_TYPE_MEMBERtCSYMBOL_TYPE_ELLIPSIStCSYMBOL_TYPE_CONSTtTYPE_QUALIFIER_CONSTtTYPE_QUALIFIER_VOLATILEtTransformerExceptioncBseZRS((t__name__t __module__(((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyR&st XDG_DATA_DIRSttnts /usr/sharet TransformercBsfeZedZedZdZdZdZdZ dZ dZ dZ d Z d Zd Zd Zed;d ZedZdZdZedZdZdZdZdZdZd;d;dZdZdZdZ dZ!dZ"dZ#dZ$d;dZ%d Z&d!Z'ed"Z(eed#Z)d;ed;d$Z*eeed;d%Z+d&Z,d'Z-d(Z.ed)Z/d*Z0d+Z1d,Z2d-Z3ed.Z4ed/Z5ed0Z6d1Z7d2Z8d3Z9d4Z:d5Z;d6Z<d7Z=d8Z>d9Z?d:Z@RS(<cCs|jS(N(t _namespace(tself((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt2scCsRt|_||_||_t|_i|_i|_g|_t |_ dS(N( Rt _cachestoret_accept_unprefixedR!tsett_pkg_config_packagest _typedefs_nst_parsed_includest _includepathstFalset_passthrough_mode(R"t namespacetaccept_unprefixed((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt__init__4s       cCs|jS(N(R'(R"((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytget_pkgconfig_packages>scCs d|_dS(N(tNoneR$(R"((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt disable_cacheAscCs t|_dS(N(tTrueR,(R"((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytset_passthrough_modeDscCs|jj|j}t|tjr<t|tjr<n\|rt}|j|j|j|jt j d|jf|n|jj |dS(NsNamespace conflict for '%s'( R!tgettnamet isinstanceRtConstantR&tupdatetfile_positionsRtfataltappend(R"tnodetoriginalt positions((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt_append_new_nodeGs$  cCslxH|D]@}|jdkr"qn|j|}|r|j|qqWx|jjD]\}}|jj|j}|s|jjd|j}n| rt|t j t j frt |j dkrt j |j|dt}|jj|q[|s|jj|q[t|t j t j fr[t |j dkr[|j |_ q[q[Wd|_dS(Ntgst_g_error_get_typet_it disguised(RA(tidentt _traverse_oneR@R(t iteritemsR!R5R6R7RtRecordtUniontlentfieldsR3R<R1(R"tsymbolstsymbolR=ttypedeftcompoundt ns_compoundRC((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytparseXs& "0cCst||_dS(N(tlistR*(R"tpaths((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytset_include_pathsuscCsI||jjkrdS|jjj||j|}|j|dS(N(R!tincludestaddt _find_includet_parse_include(R"tincludetfilename((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytregister_includexs cCstjj|}|jds7td|fn|d }tjj|}||jj kridS|jj j ||j |dt dS(Ns.girs6Include path %r must be a filename path ending in .girit uninstalled( tostpathtbasenametendswitht SystemExitRtIncludet from_stringR!RTRURWR3(R"t include_pathR^tgirnameRX((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytregister_include_uninstalleds cCsd|kr|jj|S|jdd\}}||jjkrV|jj|S||jjkr||jkrtjdd||f|jj|S|j|}|j|SdS(sGiven a name of the form Foo or Bar.Foo, return the corresponding ast.Node, or None if none available. Will throw KeyError however for unknown namespaces.t.is#Deprecated reference to identifier sprefix %s in GIName %sN(R!R5tsplitR6tidentifier_prefixesR)Rtwarn(R"R6tnstginameRX((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt lookup_ginames !  cCs|jr|j|jSdS(siGiven a Type object, if it points to a giname, calls lookup_giname() on the name. Otherwise return None.N(t target_ginameRlR1(R"ttypeobj((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytlookup_typenodes cCs|j}x*tD]"}|jtjj|dqW|jtjjtdd|j|jf}x9|D]1}tjj||}tjj |rp|SqpWt j j d||ft j ddS(Nsgir-1.0s %s-%s.girs+Couldn't find include %r (search path: %r) i(R*t_xdg_data_dirsR<R\R]tjointDATADIRR6tversiontexiststsyststderrtwritetexit(R"RXt searchdirsR]Rdtd((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRVs    cCst|d}|dk r(|j|n|j|j||jj|}|j|_|j|jj =|S(N( R1RSR4RWR$tloadt get_namespaceR!R)R6(tclsRYtextra_include_dirsR"tparser((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytparse_from_girs    cCsd}|jdk r*|jj|}n|dkr~td|j }|j||jdk r~|jj||q~nxH|jjD]7}|j |j kr|j |}|j |qqW|sx*|jj D]}|jj|qWn|j}||j |j |||j}|dkr>dSq>W|S(NcSsog}xYt|jd|jdD]6\}}||krQdj|dS|j|q(Wt||S(NRB(tzipRgRqR<tmin(tatbt commonpartstawordtbword((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt common_prefixWs . iR(RIRQt base_typet child_listR1RD(R"RLRRtchild((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt_enum_common_prefixVs    c Cs^|j|}|r$t|}nd}g}x|jjD]}|jrRq=n|dkrn|j|}n:y|j|}Wn$tk r}tj ||dSX|j t j |j|j|jdq=Wy|j|j}Wn$tk r}tj ||dSX|jjr,t j} n t j} | ||jd|} | j|| S(Nitmembers(RRIRRtprivateRDRRRt warn_symbolR1R<RtMembertlowert const_intRt is_bitfieldtBitfieldtEnumtadd_symbol_reference( R"RLRt prefixlenRRR6Rt enum_nametklassR=((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRls<      cCs|jjdrdSt|j||j}|j|jj}y|j|}Wn$tk r}t j ||dSXt j |||t |j}|j||S(NRB(RDRR1RQt_create_parametersRt_create_returnRRRRRtFunctionR+R(R"RLt parameterstreturn_R6Rtfunc((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRs cCs|jtkrd}n|jtkr3|j}nh|jtkrN|j}nM|jtkrm|j|jS|jtkr|j|jd}nd}|S(Ntvoidt*tgpointer( RR RR6R R t_create_source_typeRR(R"t source_typetvalue((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRs   cCs)|jt@}|jt@}|jtkr-dS|jttttt gkr|j }|scd}n|rvd|}n|r%d|}q%n|jt kr|j |j S|jtkr|j |j d}|r|d7}n|r%|d7}q%n,|rd}nd}|r!d|}n|S|S( NRRsconst s volatile Rs consts volatilet gconstpointer(ttype_qualifierRRRR RR RRR R6R t_create_complete_source_typeRR(R"RtconsttvolatileR((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRs>          ccsQtd|jD}x1t|jD] \}}|j|||Vq)WdS(Ncss|]}|jVqdS(N(RD(t.0R((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pys s(R&Rt enumeratet_create_parameter(R"RLRt param_namestiR((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRsc Cs|j}|jd}|r+|d}n|j|}|d\}}|r]d|}ntjd||jf}|j|j||j|tjdd|j |j f} | S(NRBiis %s__%s__unionRms%s.%s( RDRRRRHt _parse_fieldsRR@tTypeR6( R"RLRt parent_identRRR-t parent_namet fake_uniont fake_type((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt_synthesize_union_types     c CsU|j}|jtkrE|jjjtkrE|j|dt}n |jtkr{|jdkr{|j |dt}n|jt kr|jdkr|j |dt}n|jt kr|j |}|jjt kr |jjdkr |j||}tjd|d|}n|j|}|j|} | ddkr[| d } n| } |ddkr~|d } n|} |j|d|} tjd| d| d| }t|jj} t|_| r| dj|_qn|j|j}tj|j|dtd td |j}|jrQt|_t|_t|_n|S( Ntmembert anonymoustcomplete_ctypeiRtctypeitreadabletwritabletbits( RRRR t_create_callbackR3RR6R1RRRR RRRtArrayRt_canonicalize_ctypetcreate_type_from_ctype_stringRQRR+tzeroterminatedRtsizet_create_type_from_basetFieldRDRRR(R"RLRRR=Rtsynthesized_typetftypeRtcanonical_ctypet derefed_nametderefed_complete_ctypet from_ctypeR((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRsP             cCs|jj}|tkr?|jjjtkr?|j|}np|tkrx|jjjtkrx|j|dt}n7|tkr|j|}n|tkr|j |}n|t kr|j |S|t tt tfkry|j|j}Wn!tk r}tj|dSX|jjr[|j|j}|j|jjd|}n tj}|tjkrwdStj||d|jStd|jt|f|S(NRCRRssymbol %r of type %s(RRRR t_create_typedef_callbackRt_create_typedef_structR3Rt_create_typedef_unionR RR RR RRDRRRiR1R6RRRtTYPE_ANYt type_namestAliastNotImplementedErrorR(R"RLRR=R6RRttarget((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyR/s> !!         cCsYtjj|}|r|jS|jds2|S|d }|j|}|d}|S(NRi(RRR5ttarget_fundamentalR_R(R"Rt firstpasstbasetcanonical_baset canonical((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRRs  cCsQ|j|}|jdd}|rI|jdrI|tjkrIdS|SdS(NRRR(RtreplaceR_Rtbasic_type_names(R"Rt is_memberRtderefed_typename((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt parse_ctypeks $c Csb|j|}|j|}|jtko:|jjt@}|j|d|d|d|d|S(Ntis_constt is_parametert is_returnR(RRRRRRRR(R"RR R RRR((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRys c Cs|dkrT|dkr)d|d}n|}tj|tjd|d|d |S|dkrd|krd|jddd}nd|d}tj|tjd|d|d |S|dkrtjtjtjd|d|d |SdS(NtGListtGSLists GLib.Lists GLib.SListsGLib.iRR RtGArrayt GPtrArrayt GByteArrays GLib.Arrays GLib.PtrArraysGLib.ByteArrays GObject.ArraysGObject.PtrArraysGObject.ByteArrayRft GHashTablesGLib.HashTablesGObject.HashTable(R R s GLib.Lists GLib.SList(R R ( RRRs GLib.Arrays GLib.PtrArraysGLib.ByteArrays GObject.ArraysGObject.PtrArraysGObject.ByteArray(RsGLib.HashTablesGObject.HashTable(RtListRRgRtMapR1(R"RRR RR6((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt_create_bare_container_types$       !c Cs|j|}|jdd}|r3|dks?|dkrytjj}d|_tjd|d|d|d|Stjj |} | dk rtj d| j d|d|d|S|j |d|d|d|} | r| Stj d|d|d|S( NRRsutf8*tGStrvRR RR( RRRt TYPE_STRINGtcloneR1RRRR5RRR( R"RR R R RRRt bare_utf8t fundamentalt container((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRs"     cCs|jtkrtj}n|j|jdt}|jdkr|jrs|jjt krst j |dnd|f}n |j}tj ||S(NR s&missing parameter name; undocumentablesarg%d( RRRtVarargsRRR3RDR1R RRt Parameter(R"RtindexRLtptypeRD((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRs cCs"|j|dt}tj|S(NR (RR3RtReturn(R"Rttypeval((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRsc CsI|jjdrdS|jdks8|jjd r<dSy|j|}Wn$tk ru}tj||dSX|j dk rt j }t |j d}nz|j dk r|jdk r|j|j}n t j}|}|j||jrC|jrC|j|j}|j|}t|t jrC|}qCn|t jkrht|j d }q|t jkrt|j d }q|t jkrt|j d }q|t jkrt|j d }qt|j }n4|jdk rt j}d|jf}n tt j ||||j}|j!||S( NRBs.hsutf-8ii@i is%flIii("RDRR1tsource_filenameR_RRRRt const_stringRRtunicodeRRRtTYPE_INTt_resolve_type_from_ctypeRmRRltresolve_aliasesR7Rt TYPE_UINT64Rt TYPE_UINT32t TYPE_UINT16t TYPE_UINT8t const_doublet TYPE_DOUBLEtAssertionErrorR8R( R"RLR6RR Rt unaliasedRR((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyRsP"        cCsy|j|j}Wn$tk r<}tj||dSXtj||jd|}|j|||j |||j |jt element_typeRtkey_typet value_typeR?R3RR%RERF(R"R t key_resolvedtvalue_resolved((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt_resolve_type_internals     cCsx|j|stS|js%|jr)tSy|j|j}Wntk rXd}nX|dkrqd|_n|j S(N( RLR+Rttarget_foreignR3RlRmtKeyErrorR1R?(R"R ttype_((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyR>s    cCs0|\}}|dkr|jSd||jfS(Ns%s.%s(R1R6(R"titemtnsname((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyt_typepair_to_strs  cCsd|jj|}|r%|j|S|jjj|}|rM|j|Std|fdS(Ns Failed to resolve GType name: %r(RR5RRt_namesRN(R"tgtnametnamesR?((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytgtypename_to_ginames  cCs4t|dr|jSt|dr,|jSdSdS(NRRL(thasattrRRLR1(R"tobj((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pytctype_ofs cCspxit|tjrk|jjdk r?|j|jj}q|jjdk rgtj|jj}qPqW|S(sRemoves all aliases from typenode, returns first non-alias in the typenode alias chain. Returns typenode argument if it is not an alias.N( R7RRRRmR1RlRR(R"ttypenode((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyR&sN(ARRtpropertyR-R+R/R0R2R4R@RPRSRZReRlRoRVt classmethodR1RRWRRRRRRRRRERRRRRRRRRRRRRRRRRRRRRR5RRRRARDR%RFRLR>RRRVRYR&(((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyR 1s~             "       '   )   8 #       1           (-R\RuRRRt cachestoreRt girparserRt sourcescannerRRRRRR R R R R RRRRRRRRRRRRt ExceptionRtenvironR5RgtpathsepRRpR<RrR6tobjectR (((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/transformer.pyts   4