ó ÊQ_Tc@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}|jd|_t|jd|jƒ}t|ƒjƒ}|j|ƒ}t ||ƒ|jd|_|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ÿÿÿÿ(tstateis%s.xmlN( txcbgenRt import_levelRtdirttextRtgetroott Namespacetexecutet has_importt add_import(tnodetmodulet namespaceRtnew_filetnew_roott new_namespace((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pytimport_s cCsT|jdƒ}|j|f}|j|jdƒƒ}|j||j||ƒdS(Ntnewnametoldname(tgettprefixtget_typetadd_typetns(R RRtidtnamettype((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pyttypedefscCsK|jdƒ}|j|f}|jdƒ}|j||j||ƒdS(NRtCARD32(RRRRR(R RRRRR((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pytxidtype$scCsK|jdƒ}|j|f}|jdƒ}|j||j||ƒdS(NRR(RRRRR(R RRRRR((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pytxidunion*scCsK|jdƒ}|j|f}t||ƒ}|j||j||ƒdS(NR(RRtEnumRR(R RRRRR((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pytenum0scCsK|jdƒ}|j|f}t||ƒ}|j||j||ƒdS(NR(RRtStructRR(R RRRRR((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pytstruct6scCsK|jdƒ}|j|f}t||ƒ}|j||j||ƒdS(NR(RRtUnionRR(R RRRRR((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pytunion<scCsE|jdƒ}|j|f}t||ƒ}|j|||ƒdS(NR(RRtRequestt add_request(R RRRRR((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pytrequestBscCsa|jdƒ}|j|f}t||ƒ}|j|jdƒ|tƒ|j|||ƒdS(NRtnumber(RRtEventt add_opcodetTruet add_event(R RRRRtevent((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pyR0Hs cCsj|jdƒ}|j|f}|j|jdƒƒ}|j|jdƒ|tƒ|j|||ƒdS(NRtrefR+(RRt get_eventR-tFalseR/(R RRRRR0((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pyt eventcopyOs cCsa|jdƒ}|j|f}t||ƒ}|j|jdƒ|tƒ|j|||ƒdS(NRR+(RRtErrorR-R.t add_error(R RRRRterror((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pyR7Vs cCsj|jdƒ}|j|f}|j|jdƒƒ}|j|jdƒ|tƒ|j|||ƒdS(NRR1R+(RRt get_errorR-R3R6(R RRRRR7((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pyt errorcopy]s timportRR R!R#R%R'R*R0R4R7R9cCs5x.t|jƒD]}t|j|||ƒqWdS(N(tlisttroottfuncsttag(RRtelt((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pyR qsN(t__doc__tos.pathRtxml.etree.cElementTreeRt xcbgen.xtypesRRR R!R#R%R'R*R0R4R7R9R=R (((s8/usr/local/lib/python2.7/site-packages/xcbgen/matcher.pyts8