σ wιZc@ΰsŠddlmZddlmZddlmZddlmZddlmZddlmZddlm Z d e fd „ƒYZ d S( i(twith_statement(tabsolute_import(tdivision(tprint_function(tunicode_literals(tcontextmanageri(tasttCCodeGeneratorcBΰs‰eZgggggd„Zd„Zd„Zd„Zd„Zd„Zd„Ze d„ƒZ d„Z d „Z d „Z d „ZRS( c CΰsU||_||_||_||_||_||_||_i|_||_dS(N( tout_h_filenametout_c_filenametfunction_decorationtinclude_first_headertinclude_last_headertinclude_first_srctinclude_last_srct_function_bodiest namespace( tselfRRR R R R R R((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt__init__!s        cCΰs*|jddƒ}d|jjd|fS(Nu u_u%s_%si(treplaceRtsymbol_prefixes(Rtname((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt gen_symbol3scCΰs‚t|tjƒr6|jtjtjfkr6d}nd}|jjtjtj fƒrt|j tj krtd|S|jj |S(Nu*uu const gchar*( t isinstanceRt Parametert directiontPARAM_DIRECTION_OUTtPARAM_DIRECTION_INOUTttypetis_equivt TYPE_STRINGt TYPE_FILENAMEttransfertPARAM_TRANSFER_NONEtctype(Rtparamtsuffix((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt_typecontainer_to_ctype7s cCΰsρ|jr)|jddj|jƒƒn|jd|j|jƒ|jfƒt|jƒ}|jrΣxvt|jƒD]U\}}|j|ƒ}|jd||j fƒ||dkrw|jdƒqwqwWn |jdƒ|jdƒdS( Nu %su u %s %s (u%s %siu, uvoidu)( R twritetjoinR%tretvaltsymboltlent parameterst enumeratetargname(RtouttfunctltiR#R"((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt_write_preludeDs    cCΰs'|j|j|ƒ|jjdƒdS(Nu; (R2tout_hR&(RR/((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt_write_prototypeWscCΰsH|jtjks'|jjjdƒrD|jjd|jfƒndS(Nu*u (transfer %s)(RRt BASIC_TYPESR"tendswithtout_cR&R (Rtnode((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt_write_annotation_transfer[scCΰs4|jjd|jfƒx›|jD]}|jjd|jfƒ|jtjtjfkr€|j rqd}nd}|jjd|j|fƒ|j |ƒn|jjdƒq$W|jjdƒ|jjdƒ|j j tj kr |jjd ƒ|jjd ƒ|j |j ƒn|jjd ƒdS( Nu /** * %s: u * @%su caller-allocatesuu : (%s%s) u: u * u * Undocumented.u * u * Returns: u */(R7R&R)R+R-RRRRtcaller_allocatesR9R(Rt TYPE_NONE(RR/R#tallocate_string((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt _write_docs`s&    ccΰsV|j|ƒ|j|ƒ|j|j|ƒ|jjdƒdV|jjdƒdS(Nu { u} (R4R=R2R7R&(RR/((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt _functionvs   cCΰsd}|jj|ƒ|jjjƒ}x%|jD]}|jjd|ƒq2W|jjd||fƒx%|jD]}|jjd|ƒqtW|jj|ƒx%|jD]}|jjd|ƒq¬W|jjd|j fƒx%|j D]}|jjd|ƒqξWdS(Nu0/* GENERATED BY testcodegen.py; DO NOT EDIT */ u#include "%s" u> #ifndef __%s_H__ #define __%s_H__ #include u#include "%s" ( R3R&RRtupperR R R7R RR(Rtwarningtnsuppertheader((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt_codegen_starts cCΰs.|jjdƒ|jjƒ|jjƒdS(Nu#endif (R3R&tcloseR7(R((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyt _codegen_endœs cCΰs)t|tjƒst‚||j|RtgetR&RE(RR8RH((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pytcodegen¦s  (t__name__t __module__RRR%R2R4R9R=RR>RCRERIRM(((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyR s         N( t __future__RRRRRt contextlibRtRtobjectR(((sk/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/codegen.pyts