ó Ú¶óMc@sdZddlmZddlmZddlTd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zi ed6ed6ed6e d6e d6e d6e d6e d6ed6ed6ed6ed6Zd„ZdS(s XML parser. One function for each top-level element in the schema. Most functions just declare a new object and add it to the module. For typedefs, eventcopies, xidtypes, and other aliases though, we do not create a new type object, we just record the existing one under a new name. iÿÿÿÿ(tjoin(tparse(t*cCsƒddlm}t|jd|jƒ}t|ƒjƒ}|j|ƒ}t||ƒ|j |jƒs|j |j|ƒndS(s For imports, we load the file, create a new namespace object, execute recursively, then record the import (for header files, etc.) iÿÿÿÿ(tstates%s.xmlN( txcbgenRRtdirttextRtgetroott Namespacetexecutet has_importt add_import(tnodetmodulet namespaceRtnew_filetnew_roott new_namespace((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pytimport_s cCsT|jdƒ}|j|f}|j|jdƒƒ}|j||j||ƒdS(Ntnewnametoldname(tgettprefixtget_typetadd_typetns(R R Rtidtnamettype((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pyttypedefscCsK|jdƒ}|j|f}|jdƒ}|j||j||ƒdS(NRtCARD32(RRRRR(R R RRRR((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pytxidtype"scCsK|jdƒ}|j|f}|jdƒ}|j||j||ƒdS(NRR(RRRRR(R R RRRR((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pytxidunion(scCsK|jdƒ}|j|f}t||ƒ}|j||j||ƒdS(NR(RRtEnumRR(R R RRRR((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pytenum.scCsK|jdƒ}|j|f}t||ƒ}|j||j||ƒdS(NR(RRtStructRR(R R RRRR((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pytstruct4scCsK|jdƒ}|j|f}t||ƒ}|j||j||ƒdS(NR(RRtUnionRR(R R RRRR((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pytunion:scCsE|jdƒ}|j|f}t||ƒ}|j|||ƒdS(NR(RRtRequestt add_request(R R RRRR((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pytrequest@scCsa|jdƒ}|j|f}t||ƒ}|j|jdƒ|tƒ|j|||ƒdS(NRtnumber(RRtEventt add_opcodetTruet add_event(R R RRRtevent((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pyR/Fs cCsj|jdƒ}|j|f}|j|jdƒƒ}|j|jdƒ|tƒ|j|||ƒdS(NRtrefR*(RRt get_eventR,tFalseR.(R R RRRR/((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pyt eventcopyMs cCsa|jdƒ}|j|f}t||ƒ}|j|jdƒ|tƒ|j|||ƒdS(NRR*(RRtErrorR,R-t add_error(R R RRRterror((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pyR6Ts cCsj|jdƒ}|j|f}|j|jdƒƒ}|j|jdƒ|tƒ|j|||ƒdS(NRR0R*(RRt get_errorR,R2R5(R R RRRR6((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pyt errorcopy[s timportRRR R"R$R&R)R/R3R6R8cCs5x.t|jƒD]}t|j|||ƒqWdS(N(tlisttroottfuncsttag(R Rtelt((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pyR osN(t__doc__tos.pathRtxml.etree.cElementTreeRt xcbgen.xtypesRRRR R"R$R&R)R/R3R6R8R<R (((s4/usr/lib/python2.7/vendor-packages/xcbgen/matcher.pyts8