gobject-introspection 2.2.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (294) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +129 -0
  3. data/ext/gobject-introspection/depend +10 -0
  4. data/ext/gobject-introspection/extconf.rb +94 -0
  5. data/ext/gobject-introspection/gobject_introspection.def +5 -0
  6. data/ext/gobject-introspection/rb-gi-arg-info.c +151 -0
  7. data/ext/gobject-introspection/rb-gi-argument.c +2053 -0
  8. data/ext/gobject-introspection/rb-gi-base-info.c +218 -0
  9. data/ext/gobject-introspection/rb-gi-boxed-info.c +48 -0
  10. data/ext/gobject-introspection/rb-gi-callable-info.c +104 -0
  11. data/ext/gobject-introspection/rb-gi-callback-info.c +48 -0
  12. data/ext/gobject-introspection/rb-gi-constant-info.c +77 -0
  13. data/ext/gobject-introspection/rb-gi-constructor-info.c +133 -0
  14. data/ext/gobject-introspection/rb-gi-conversions.h +145 -0
  15. data/ext/gobject-introspection/rb-gi-enum-info.c +155 -0
  16. data/ext/gobject-introspection/rb-gi-field-info.c +153 -0
  17. data/ext/gobject-introspection/rb-gi-flags-info.c +48 -0
  18. data/ext/gobject-introspection/rb-gi-function-info.c +841 -0
  19. data/ext/gobject-introspection/rb-gi-interface-info.c +222 -0
  20. data/ext/gobject-introspection/rb-gi-loader.c +224 -0
  21. data/ext/gobject-introspection/rb-gi-method-info.c +83 -0
  22. data/ext/gobject-introspection/rb-gi-object-info.c +345 -0
  23. data/ext/gobject-introspection/rb-gi-private.h +105 -0
  24. data/ext/gobject-introspection/rb-gi-property-info.c +77 -0
  25. data/ext/gobject-introspection/rb-gi-registered-type-info.c +86 -0
  26. data/ext/gobject-introspection/rb-gi-repository.c +246 -0
  27. data/ext/gobject-introspection/rb-gi-signal-info.c +77 -0
  28. data/ext/gobject-introspection/rb-gi-struct-info.c +202 -0
  29. data/ext/gobject-introspection/rb-gi-type-info.c +143 -0
  30. data/ext/gobject-introspection/rb-gi-type-tag.c +43 -0
  31. data/ext/gobject-introspection/rb-gi-types.h +71 -0
  32. data/ext/gobject-introspection/rb-gi-union-info.c +206 -0
  33. data/ext/gobject-introspection/rb-gi-unresolved-info.c +48 -0
  34. data/ext/gobject-introspection/rb-gi-value-info.c +57 -0
  35. data/ext/gobject-introspection/rb-gi-vfunc-info.c +91 -0
  36. data/ext/gobject-introspection/rb-gobject-introspection.c +44 -0
  37. data/ext/gobject-introspection/rb-gobject-introspection.h +60 -0
  38. data/extconf.rb +71 -0
  39. data/lib/2.0/gobject_introspection.so +0 -0
  40. data/lib/2.1/gobject_introspection.so +0 -0
  41. data/lib/2.2/gobject_introspection.so +0 -0
  42. data/lib/gobject-introspection.rb +53 -0
  43. data/lib/gobject-introspection/boxed-info.rb +28 -0
  44. data/lib/gobject-introspection/callable-info.rb +100 -0
  45. data/lib/gobject-introspection/collection-reader.rb +34 -0
  46. data/lib/gobject-introspection/interface-info.rb +32 -0
  47. data/lib/gobject-introspection/loader.rb +465 -0
  48. data/lib/gobject-introspection/object-info.rb +33 -0
  49. data/lib/gobject-introspection/repository.rb +32 -0
  50. data/lib/gobject-introspection/struct-info.rb +28 -0
  51. data/lib/gobject-introspection/union-info.rb +28 -0
  52. data/test/gobject-introspection-test-utils.rb +26 -0
  53. data/test/run-test.rb +45 -0
  54. data/test/test-arg-info.rb +68 -0
  55. data/test/test-base-info.rb +31 -0
  56. data/test/test-boxed-info.rb +21 -0
  57. data/test/test-callable-info.rb +49 -0
  58. data/test/test-callback-info.rb +29 -0
  59. data/test/test-constant-info.rb +24 -0
  60. data/test/test-enum-info.rb +61 -0
  61. data/test/test-field-type.rb +42 -0
  62. data/test/test-flags-info.rb +27 -0
  63. data/test/test-function-info.rb +39 -0
  64. data/test/test-interface-info.rb +97 -0
  65. data/test/test-loader.rb +30 -0
  66. data/test/test-object-info.rb +131 -0
  67. data/test/test-property-info.rb +38 -0
  68. data/test/test-registered-type-info.rb +35 -0
  69. data/test/test-repository.rb +62 -0
  70. data/test/test-signal-info.rb +40 -0
  71. data/test/test-struct-info.rb +57 -0
  72. data/test/test-type-info.rb +62 -0
  73. data/test/test-type-tag.rb +29 -0
  74. data/test/test-union-info.rb +21 -0
  75. data/test/test-value-info.rb +28 -0
  76. data/test/test-vfunc-info.rb +42 -0
  77. data/vendor/local/bin/g-ir-compiler.exe +0 -0
  78. data/vendor/local/bin/g-ir-generate.exe +0 -0
  79. data/vendor/local/bin/libgirepository-1.0-1.dll +0 -0
  80. data/vendor/local/include/gobject-introspection-1.0/giarginfo.h +82 -0
  81. data/vendor/local/include/gobject-introspection-1.0/gibaseinfo.h +120 -0
  82. data/vendor/local/include/gobject-introspection-1.0/gicallableinfo.h +110 -0
  83. data/vendor/local/include/gobject-introspection-1.0/giconstantinfo.h +58 -0
  84. data/vendor/local/include/gobject-introspection-1.0/gienuminfo.h +82 -0
  85. data/vendor/local/include/gobject-introspection-1.0/gifieldinfo.h +71 -0
  86. data/vendor/local/include/gobject-introspection-1.0/gifunctioninfo.h +100 -0
  87. data/vendor/local/include/gobject-introspection-1.0/giinterfaceinfo.h +106 -0
  88. data/vendor/local/include/gobject-introspection-1.0/giobjectinfo.h +207 -0
  89. data/vendor/local/include/gobject-introspection-1.0/gipropertyinfo.h +56 -0
  90. data/vendor/local/include/gobject-introspection-1.0/giregisteredtypeinfo.h +64 -0
  91. data/vendor/local/include/gobject-introspection-1.0/girepository.h +239 -0
  92. data/vendor/local/include/gobject-introspection-1.0/girffi.h +104 -0
  93. data/vendor/local/include/gobject-introspection-1.0/gisignalinfo.h +57 -0
  94. data/vendor/local/include/gobject-introspection-1.0/gistructinfo.h +77 -0
  95. data/vendor/local/include/gobject-introspection-1.0/gitypeinfo.h +87 -0
  96. data/vendor/local/include/gobject-introspection-1.0/gitypelib.h +80 -0
  97. data/vendor/local/include/gobject-introspection-1.0/gitypes.h +524 -0
  98. data/vendor/local/include/gobject-introspection-1.0/giunioninfo.h +84 -0
  99. data/vendor/local/include/gobject-introspection-1.0/giversionmacros.h +128 -0
  100. data/vendor/local/include/gobject-introspection-1.0/givfuncinfo.h +73 -0
  101. data/vendor/local/lib/girepository-1.0/DBus-1.0.typelib +0 -0
  102. data/vendor/local/lib/girepository-1.0/DBusGLib-1.0.typelib +0 -0
  103. data/vendor/local/lib/girepository-1.0/GIRepository-2.0.typelib +0 -0
  104. data/vendor/local/lib/girepository-1.0/GL-1.0.typelib +0 -0
  105. data/vendor/local/lib/girepository-1.0/GLib-2.0.typelib +0 -0
  106. data/vendor/local/lib/girepository-1.0/GModule-2.0.typelib +0 -0
  107. data/vendor/local/lib/girepository-1.0/GObject-2.0.typelib +0 -0
  108. data/vendor/local/lib/girepository-1.0/Gio-2.0.typelib +0 -0
  109. data/vendor/local/lib/girepository-1.0/cairo-1.0.typelib +0 -0
  110. data/vendor/local/lib/girepository-1.0/fontconfig-2.0.typelib +0 -0
  111. data/vendor/local/lib/girepository-1.0/freetype2-2.0.typelib +0 -0
  112. data/vendor/local/lib/girepository-1.0/libxml2-2.0.typelib +0 -0
  113. data/vendor/local/lib/girepository-1.0/win32-1.0.typelib +0 -0
  114. data/vendor/local/lib/girepository-1.0/xfixes-4.0.typelib +0 -0
  115. data/vendor/local/lib/girepository-1.0/xft-2.0.typelib +0 -0
  116. data/vendor/local/lib/girepository-1.0/xlib-2.0.typelib +0 -0
  117. data/vendor/local/lib/girepository-1.0/xrandr-1.3.typelib +0 -0
  118. data/vendor/local/lib/gobject-introspection/giscanner/__init__.py +24 -0
  119. data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyc +0 -0
  120. data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyo +0 -0
  121. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.py +76 -0
  122. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyc +0 -0
  123. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyo +0 -0
  124. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.py +2161 -0
  125. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyc +0 -0
  126. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyo +0 -0
  127. data/vendor/local/lib/gobject-introspection/giscanner/ast.py +1139 -0
  128. data/vendor/local/lib/gobject-introspection/giscanner/ast.pyc +0 -0
  129. data/vendor/local/lib/gobject-introspection/giscanner/ast.pyo +0 -0
  130. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.py +203 -0
  131. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyc +0 -0
  132. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyo +0 -0
  133. data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.py +202 -0
  134. data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyc +0 -0
  135. data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyo +0 -0
  136. data/vendor/local/lib/gobject-introspection/giscanner/codegen.py +173 -0
  137. data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyc +0 -0
  138. data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyo +0 -0
  139. data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.py +23 -0
  140. data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyc +0 -0
  141. data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyo +0 -0
  142. data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.py +305 -0
  143. data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.pyc +0 -0
  144. data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.pyo +0 -0
  145. data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.py +120 -0
  146. data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyc +0 -0
  147. data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyo +0 -0
  148. data/vendor/local/lib/gobject-introspection/giscanner/docmain.py +72 -0
  149. data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyc +0 -0
  150. data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyo +0 -0
  151. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/callback.tmpl +4 -0
  152. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/class.tmpl +2 -0
  153. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/constructor.tmpl +1 -0
  154. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/default.tmpl +1 -0
  155. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/enum.tmpl +2 -0
  156. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/field.tmpl +1 -0
  157. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/function.tmpl +60 -0
  158. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/interface.tmpl +2 -0
  159. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/method.tmpl +1 -0
  160. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/namespace.tmpl +1 -0
  161. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/property.tmpl +5 -0
  162. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/record.tmpl +1 -0
  163. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/signal.tmpl +5 -0
  164. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/vfunc.tmpl +4 -0
  165. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/callback.tmpl +27 -0
  166. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/class.tmpl +30 -0
  167. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/constructor.tmpl +1 -0
  168. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/default.tmpl +1 -0
  169. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/enum.tmpl +21 -0
  170. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/field.tmpl +9 -0
  171. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/function.tmpl +47 -0
  172. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/interface.tmpl +17 -0
  173. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/method.tmpl +1 -0
  174. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/namespace.tmpl +2 -0
  175. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/property.tmpl +9 -0
  176. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/record.tmpl +2 -0
  177. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/signal.tmpl +38 -0
  178. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/vfunc.tmpl +27 -0
  179. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/callback.tmpl +27 -0
  180. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/class.tmpl +18 -0
  181. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/constructor.tmpl +1 -0
  182. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/default.tmpl +1 -0
  183. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/enum.tmpl +13 -0
  184. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/field.tmpl +1 -0
  185. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/function.tmpl +47 -0
  186. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/interface.tmpl +16 -0
  187. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/method.tmpl +1 -0
  188. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/namespace.tmpl +2 -0
  189. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/property.tmpl +9 -0
  190. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/record.tmpl +2 -0
  191. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/signal.tmpl +41 -0
  192. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/vfunc.tmpl +27 -0
  193. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/base.tmpl +20 -0
  194. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/class.tmpl +61 -0
  195. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/namespace.tmpl +16 -0
  196. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.py +958 -0
  197. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyc +0 -0
  198. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyo +0 -0
  199. data/vendor/local/lib/gobject-introspection/giscanner/dumper.py +338 -0
  200. data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyc +0 -0
  201. data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyo +0 -0
  202. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.py +529 -0
  203. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyc +0 -0
  204. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyo +0 -0
  205. data/vendor/local/lib/gobject-introspection/giscanner/girparser.py +593 -0
  206. data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyc +0 -0
  207. data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyo +0 -0
  208. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.py +612 -0
  209. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyc +0 -0
  210. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyo +0 -0
  211. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.py +240 -0
  212. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyc +0 -0
  213. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyo +0 -0
  214. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.py +76 -0
  215. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyc +0 -0
  216. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyo +0 -0
  217. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.py +1366 -0
  218. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyc +0 -0
  219. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyo +0 -0
  220. data/vendor/local/lib/gobject-introspection/giscanner/message.py +203 -0
  221. data/vendor/local/lib/gobject-introspection/giscanner/message.pyc +0 -0
  222. data/vendor/local/lib/gobject-introspection/giscanner/message.pyo +0 -0
  223. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.py +561 -0
  224. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyc +0 -0
  225. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyo +0 -0
  226. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.py +152 -0
  227. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyc +0 -0
  228. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyo +0 -0
  229. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.py +140 -0
  230. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyc +0 -0
  231. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyo +0 -0
  232. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.py +329 -0
  233. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyc +0 -0
  234. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyo +0 -0
  235. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.py +136 -0
  236. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyc +0 -0
  237. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyo +0 -0
  238. data/vendor/local/lib/gobject-introspection/giscanner/transformer.py +971 -0
  239. data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyc +0 -0
  240. data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyo +0 -0
  241. data/vendor/local/lib/gobject-introspection/giscanner/utils.py +211 -0
  242. data/vendor/local/lib/gobject-introspection/giscanner/utils.pyc +0 -0
  243. data/vendor/local/lib/gobject-introspection/giscanner/utils.pyo +0 -0
  244. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.py +156 -0
  245. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyc +0 -0
  246. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyo +0 -0
  247. data/vendor/local/lib/libgirepository-1.0.a +0 -0
  248. data/vendor/local/lib/libgirepository-1.0.dll.a +0 -0
  249. data/vendor/local/lib/libgirepository-1.0.la +41 -0
  250. data/vendor/local/lib/pkgconfig/gobject-introspection-1.0.pc +26 -0
  251. data/vendor/local/lib/pkgconfig/gobject-introspection-no-export-1.0.pc +23 -0
  252. data/vendor/local/lib/pkgconfig/patched +0 -0
  253. data/vendor/local/share/aclocal/introspection.m4 +96 -0
  254. data/vendor/local/share/gir-1.0/DBus-1.0.gir +32 -0
  255. data/vendor/local/share/gir-1.0/DBusGLib-1.0.gir +18 -0
  256. data/vendor/local/share/gir-1.0/GIRepository-2.0.gir +4042 -0
  257. data/vendor/local/share/gir-1.0/GL-1.0.gir +31 -0
  258. data/vendor/local/share/gir-1.0/GLib-2.0.gir +47221 -0
  259. data/vendor/local/share/gir-1.0/GModule-2.0.gir +301 -0
  260. data/vendor/local/share/gir-1.0/GObject-2.0.gir +14733 -0
  261. data/vendor/local/share/gir-1.0/Gio-2.0.gir +82459 -0
  262. data/vendor/local/share/gir-1.0/cairo-1.0.gir +70 -0
  263. data/vendor/local/share/gir-1.0/fontconfig-2.0.gir +18 -0
  264. data/vendor/local/share/gir-1.0/freetype2-2.0.gir +22 -0
  265. data/vendor/local/share/gir-1.0/libxml2-2.0.gir +25 -0
  266. data/vendor/local/share/gir-1.0/win32-1.0.gir +19 -0
  267. data/vendor/local/share/gir-1.0/xfixes-4.0.gir +10 -0
  268. data/vendor/local/share/gir-1.0/xft-2.0.gir +23 -0
  269. data/vendor/local/share/gir-1.0/xlib-2.0.gir +67 -0
  270. data/vendor/local/share/gir-1.0/xrandr-1.3.gir +16 -0
  271. data/vendor/local/share/gobject-introspection-1.0/Makefile.introspection +166 -0
  272. data/vendor/local/share/gobject-introspection-1.0/gdump.c +569 -0
  273. data/vendor/local/share/gobject-introspection-1.0/tests/annotation.c +831 -0
  274. data/vendor/local/share/gobject-introspection-1.0/tests/annotation.h +301 -0
  275. data/vendor/local/share/gobject-introspection-1.0/tests/drawable.c +57 -0
  276. data/vendor/local/share/gobject-introspection-1.0/tests/drawable.h +44 -0
  277. data/vendor/local/share/gobject-introspection-1.0/tests/everything.c +1579 -0
  278. data/vendor/local/share/gobject-introspection-1.0/tests/everything.h +535 -0
  279. data/vendor/local/share/gobject-introspection-1.0/tests/foo.c +790 -0
  280. data/vendor/local/share/gobject-introspection-1.0/tests/foo.h +582 -0
  281. data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.c +5426 -0
  282. data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.h +1948 -0
  283. data/vendor/local/share/gobject-introspection-1.0/tests/gitestmacros.h +10 -0
  284. data/vendor/local/share/gobject-introspection-1.0/tests/regress.c +4068 -0
  285. data/vendor/local/share/gobject-introspection-1.0/tests/regress.h +1415 -0
  286. data/vendor/local/share/gobject-introspection-1.0/tests/utility.c +47 -0
  287. data/vendor/local/share/gobject-introspection-1.0/tests/utility.h +102 -0
  288. data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.c +47 -0
  289. data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.h +46 -0
  290. data/vendor/local/share/license/gobject-introspection/AUTHORS +9 -0
  291. data/vendor/local/share/license/gobject-introspection/COPYING +12 -0
  292. data/vendor/local/share/man/man1/g-ir-compiler.1 +42 -0
  293. data/vendor/local/share/man/man1/g-ir-generate.1 +29 -0
  294. metadata +363 -0
@@ -0,0 +1,593 @@
1
+ # -*- Mode: Python -*-
2
+ # GObject-Introspection - a framework for introspecting GObject libraries
3
+ # Copyright (C) 2008 Johan Dahlin
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the
17
+ # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
+ # Boston, MA 02111-1307, USA.
19
+ #
20
+
21
+ import os
22
+
23
+ from xml.etree.cElementTree import parse
24
+
25
+ from . import ast
26
+ from .girwriter import COMPATIBLE_GIR_VERSION
27
+
28
+ CORE_NS = "http://www.gtk.org/introspection/core/1.0"
29
+ C_NS = "http://www.gtk.org/introspection/c/1.0"
30
+ GLIB_NS = "http://www.gtk.org/introspection/glib/1.0"
31
+
32
+
33
+ def _corens(tag):
34
+ return '{%s}%s' % (CORE_NS, tag)
35
+
36
+
37
+ def _glibns(tag):
38
+ return '{%s}%s' % (GLIB_NS, tag)
39
+
40
+
41
+ def _cns(tag):
42
+ return '{%s}%s' % (C_NS, tag)
43
+
44
+
45
+ class GIRParser(object):
46
+
47
+ def __init__(self, types_only=False):
48
+ self._types_only = types_only
49
+ self._namespace = None
50
+ self._filename_stack = []
51
+
52
+ # Public API
53
+
54
+ def parse(self, filename):
55
+ filename = os.path.abspath(filename)
56
+ self._filename_stack.append(filename)
57
+ tree = parse(filename)
58
+ self.parse_tree(tree)
59
+ self._filename_stack.pop()
60
+
61
+ def parse_tree(self, tree):
62
+ self._namespace = None
63
+ self._pkgconfig_packages = set()
64
+ self._includes = set()
65
+ self._c_includes = set()
66
+ self._c_prefix = None
67
+ self._parse_api(tree.getroot())
68
+
69
+ def get_namespace(self):
70
+ return self._namespace
71
+
72
+ # Private
73
+
74
+ def _find_first_child(self, node, name_or_names):
75
+ if isinstance(name_or_names, str):
76
+ for child in node.getchildren():
77
+ if child.tag == name_or_names:
78
+ return child
79
+ else:
80
+ for child in node.getchildren():
81
+ if child.tag in name_or_names:
82
+ return child
83
+ return None
84
+
85
+ def _find_children(self, node, name):
86
+ return [child for child in node.getchildren() if child.tag == name]
87
+
88
+ def _get_current_file(self):
89
+ if not self._filename_stack:
90
+ return None
91
+ cwd = os.getcwd() + os.sep
92
+ curfile = self._filename_stack[-1]
93
+ if curfile.startswith(cwd):
94
+ return curfile[len(cwd):]
95
+ return curfile
96
+
97
+ def _parse_api(self, root):
98
+ assert root.tag == _corens('repository')
99
+ version = root.attrib['version']
100
+ if version != COMPATIBLE_GIR_VERSION:
101
+ raise SystemExit("%s: Incompatible version %s (supported: %s)" %
102
+ (self._get_current_file(), version, COMPATIBLE_GIR_VERSION))
103
+
104
+ for node in root.getchildren():
105
+ if node.tag == _corens('include'):
106
+ self._parse_include(node)
107
+ elif node.tag == _corens('package'):
108
+ self._parse_pkgconfig_package(node)
109
+ elif node.tag == _cns('include'):
110
+ self._parse_c_include(node)
111
+
112
+ ns = root.find(_corens('namespace'))
113
+ assert ns is not None
114
+ identifier_prefixes = ns.attrib.get(_cns('identifier-prefixes'))
115
+ if identifier_prefixes:
116
+ identifier_prefixes = identifier_prefixes.split(',')
117
+ symbol_prefixes = ns.attrib.get(_cns('symbol-prefixes'))
118
+ if symbol_prefixes:
119
+ symbol_prefixes = symbol_prefixes.split(',')
120
+ self._namespace = ast.Namespace(ns.attrib['name'],
121
+ ns.attrib['version'],
122
+ identifier_prefixes=identifier_prefixes,
123
+ symbol_prefixes=symbol_prefixes)
124
+ if 'shared-library' in ns.attrib:
125
+ self._namespace.shared_libraries = ns.attrib['shared-library'].split(',')
126
+ self._namespace.includes = self._includes
127
+ self._namespace.c_includes = self._c_includes
128
+ self._namespace.exported_packages = self._pkgconfig_packages
129
+
130
+ parser_methods = {
131
+ _corens('alias'): self._parse_alias,
132
+ _corens('bitfield'): self._parse_enumeration_bitfield,
133
+ _corens('callback'): self._parse_callback,
134
+ _corens('class'): self._parse_object_interface,
135
+ _corens('enumeration'): self._parse_enumeration_bitfield,
136
+ _corens('interface'): self._parse_object_interface,
137
+ _corens('record'): self._parse_record,
138
+ _corens('union'): self._parse_union,
139
+ _glibns('boxed'): self._parse_boxed}
140
+
141
+ if not self._types_only:
142
+ parser_methods[_corens('constant')] = self._parse_constant
143
+ parser_methods[_corens('function')] = self._parse_function
144
+
145
+ for node in ns.getchildren():
146
+ method = parser_methods.get(node.tag)
147
+ if method is not None:
148
+ method(node)
149
+
150
+ def _parse_include(self, node):
151
+ include = ast.Include(node.attrib['name'], node.attrib['version'])
152
+ self._includes.add(include)
153
+
154
+ def _parse_pkgconfig_package(self, node):
155
+ self._pkgconfig_packages.add(node.attrib['name'])
156
+
157
+ def _parse_c_include(self, node):
158
+ self._c_includes.add(node.attrib['name'])
159
+
160
+ def _parse_alias(self, node):
161
+ typeval = self._parse_type(node)
162
+ alias = ast.Alias(node.attrib['name'], typeval, node.attrib.get(_cns('type')))
163
+ self._parse_generic_attribs(node, alias)
164
+ self._namespace.append(alias)
165
+
166
+ def _parse_generic_attribs(self, node, obj):
167
+ assert isinstance(obj, ast.Annotated)
168
+ introspectable = node.attrib.get('introspectable')
169
+ if introspectable:
170
+ obj.introspectable = int(introspectable) > 0
171
+ if self._types_only:
172
+ return
173
+ doc = node.find(_corens('doc'))
174
+ if doc is not None:
175
+ if doc.text:
176
+ obj.doc = doc.text
177
+ version = node.attrib.get('version')
178
+ if version:
179
+ obj.version = version
180
+ version_doc = node.find(_corens('doc-version'))
181
+ if version_doc is not None:
182
+ if version_doc.text:
183
+ obj.version_doc = version_doc.text
184
+ deprecated = node.attrib.get('deprecated-version')
185
+ if deprecated:
186
+ obj.deprecated = deprecated
187
+ deprecated_doc = node.find(_corens('doc-deprecated'))
188
+ if deprecated_doc is not None:
189
+ if deprecated_doc.text:
190
+ obj.deprecated_doc = deprecated_doc.text
191
+ stability = node.attrib.get('stability')
192
+ if stability:
193
+ obj.stability = stability
194
+ stability_doc = node.find(_corens('doc-stability'))
195
+ if stability_doc is not None:
196
+ if stability_doc.text:
197
+ obj.stability_doc = stability_doc.text
198
+
199
+ def _parse_object_interface(self, node):
200
+ parent = node.attrib.get('parent')
201
+ if parent:
202
+ parent_type = self._namespace.type_from_name(parent)
203
+ else:
204
+ parent_type = None
205
+
206
+ ctor_kwargs = {'name': node.attrib['name'],
207
+ 'parent_type': parent_type,
208
+ 'gtype_name': node.attrib[_glibns('type-name')],
209
+ 'get_type': node.attrib[_glibns('get-type')],
210
+ 'c_symbol_prefix': node.attrib.get(_cns('symbol-prefix')),
211
+ 'ctype': node.attrib.get(_cns('type'))}
212
+ if node.tag == _corens('interface'):
213
+ klass = ast.Interface
214
+ elif node.tag == _corens('class'):
215
+ klass = ast.Class
216
+ is_abstract = node.attrib.get('abstract')
217
+ is_abstract = is_abstract and is_abstract != '0'
218
+ ctor_kwargs['is_abstract'] = is_abstract
219
+ else:
220
+ raise AssertionError(node)
221
+
222
+ obj = klass(**ctor_kwargs)
223
+ self._parse_generic_attribs(node, obj)
224
+ type_struct = node.attrib.get(_glibns('type-struct'))
225
+ if type_struct:
226
+ obj.glib_type_struct = self._namespace.type_from_name(type_struct)
227
+ if klass == ast.Class:
228
+ is_fundamental = node.attrib.get(_glibns('fundamental'))
229
+ if is_fundamental and is_fundamental != '0':
230
+ obj.fundamental = True
231
+ for func_id in ['ref-func', 'unref-func',
232
+ 'set-value-func', 'get-value-func']:
233
+ func_name = node.attrib.get(_glibns(func_id))
234
+ obj.__dict__[func_id.replace('-', '_')] = func_name
235
+
236
+ if self._types_only:
237
+ self._namespace.append(obj)
238
+ return
239
+
240
+ for iface in self._find_children(node, _corens('implements')):
241
+ obj.interfaces.append(self._namespace.type_from_name(iface.attrib['name']))
242
+ for iface in self._find_children(node, _corens('prerequisite')):
243
+ obj.prerequisites.append(self._namespace.type_from_name(iface.attrib['name']))
244
+ for func_node in self._find_children(node, _corens('function')):
245
+ func = self._parse_function_common(func_node, ast.Function, obj)
246
+ obj.static_methods.append(func)
247
+ for method in self._find_children(node, _corens('method')):
248
+ func = self._parse_function_common(method, ast.Function, obj)
249
+ func.is_method = True
250
+ obj.methods.append(func)
251
+ for method in self._find_children(node, _corens('virtual-method')):
252
+ func = self._parse_function_common(method, ast.VFunction, obj)
253
+ self._parse_generic_attribs(method, func)
254
+ func.is_method = True
255
+ func.invoker = method.get('invoker')
256
+ obj.virtual_methods.append(func)
257
+ for ctor in self._find_children(node, _corens('constructor')):
258
+ func = self._parse_function_common(ctor, ast.Function, obj)
259
+ func.is_constructor = True
260
+ obj.constructors.append(func)
261
+ obj.fields.extend(self._parse_fields(node, obj))
262
+ for prop in self._find_children(node, _corens('property')):
263
+ obj.properties.append(self._parse_property(prop, obj))
264
+ for signal in self._find_children(node, _glibns('signal')):
265
+ obj.signals.append(self._parse_function_common(signal, ast.Signal, obj))
266
+
267
+ self._namespace.append(obj)
268
+
269
+ def _parse_callback(self, node):
270
+ callback = self._parse_function_common(node, ast.Callback)
271
+ self._namespace.append(callback)
272
+
273
+ def _parse_function(self, node):
274
+ function = self._parse_function_common(node, ast.Function)
275
+ self._namespace.append(function)
276
+
277
+ def _parse_parameter(self, node):
278
+ typeval = self._parse_type(node)
279
+ param = ast.Parameter(node.attrib.get('name'),
280
+ typeval,
281
+ node.attrib.get('direction') or ast.PARAM_DIRECTION_IN,
282
+ node.attrib.get('transfer-ownership'),
283
+ node.attrib.get('nullable') == '1',
284
+ node.attrib.get('optional') == '1',
285
+ node.attrib.get('allow-none') == '1',
286
+ node.attrib.get('scope'),
287
+ node.attrib.get('caller-allocates') == '1')
288
+ self._parse_generic_attribs(node, param)
289
+ return param
290
+
291
+ def _parse_function_common(self, node, klass, parent=None):
292
+ name = node.attrib['name']
293
+ returnnode = node.find(_corens('return-value'))
294
+ if not returnnode:
295
+ raise ValueError('node %r has no return-value' % (name, ))
296
+ transfer = returnnode.attrib.get('transfer-ownership')
297
+ nullable = returnnode.attrib.get('nullable') == '1'
298
+ retval = ast.Return(self._parse_type(returnnode), nullable, transfer)
299
+ self._parse_generic_attribs(returnnode, retval)
300
+ parameters = []
301
+
302
+ throws = (node.attrib.get('throws') == '1')
303
+
304
+ if klass is ast.Callback:
305
+ func = klass(name, retval, parameters, throws,
306
+ node.attrib.get(_cns('type')))
307
+ elif klass is ast.Function:
308
+ identifier = node.attrib.get(_cns('identifier'))
309
+ func = klass(name, retval, parameters, throws, identifier)
310
+ elif klass is ast.VFunction:
311
+ func = klass(name, retval, parameters, throws)
312
+ elif klass is ast.Signal:
313
+ func = klass(name, retval, parameters,
314
+ when=node.attrib.get('when'),
315
+ no_recurse=node.attrib.get('no-recurse', '0') == '1',
316
+ detailed=node.attrib.get('detailed', '0') == '1',
317
+ action=node.attrib.get('action', '0') == '1',
318
+ no_hooks=node.attrib.get('no-hooks', '0') == '1')
319
+ else:
320
+ assert False
321
+
322
+ func.shadows = node.attrib.get('shadows', None)
323
+ func.shadowed_by = node.attrib.get('shadowed-by', None)
324
+ func.moved_to = node.attrib.get('moved-to', None)
325
+ func.parent = parent
326
+
327
+ parameters_node = node.find(_corens('parameters'))
328
+ if (parameters_node is not None):
329
+ paramnode = self._find_first_child(parameters_node, _corens('instance-parameter'))
330
+ if paramnode:
331
+ func.instance_parameter = self._parse_parameter(paramnode)
332
+ for paramnode in self._find_children(parameters_node, _corens('parameter')):
333
+ parameters.append(self._parse_parameter(paramnode))
334
+ for i, paramnode in enumerate(self._find_children(parameters_node,
335
+ _corens('parameter'))):
336
+ param = parameters[i]
337
+ self._parse_type_array_length(parameters, paramnode, param.type)
338
+ closure = paramnode.attrib.get('closure')
339
+ if closure:
340
+ idx = int(closure)
341
+ assert idx < len(parameters), "%d >= %d" % (idx, len(parameters))
342
+ param.closure_name = parameters[idx].argname
343
+ destroy = paramnode.attrib.get('destroy')
344
+ if destroy:
345
+ idx = int(destroy)
346
+ assert idx < len(parameters), "%d >= %d" % (idx, len(parameters))
347
+ param.destroy_name = parameters[idx].argname
348
+
349
+ self._parse_type_array_length(parameters, returnnode, retval.type)
350
+
351
+ self._parse_generic_attribs(node, func)
352
+
353
+ self._namespace.track(func)
354
+ return func
355
+
356
+ def _parse_fields(self, node, obj):
357
+ res = []
358
+ names = (_corens('field'), _corens('record'), _corens('union'), _corens('callback'))
359
+ for child in node.getchildren():
360
+ if child.tag in names:
361
+ fieldobj = self._parse_field(child, obj)
362
+ res.append(fieldobj)
363
+ return res
364
+
365
+ def _parse_compound(self, cls, node):
366
+ compound = cls(node.attrib.get('name'),
367
+ ctype=node.attrib.get(_cns('type')),
368
+ disguised=node.attrib.get('disguised') == '1',
369
+ gtype_name=node.attrib.get(_glibns('type-name')),
370
+ get_type=node.attrib.get(_glibns('get-type')),
371
+ c_symbol_prefix=node.attrib.get(_cns('symbol-prefix')))
372
+ if node.attrib.get('foreign') == '1':
373
+ compound.foreign = True
374
+ self._parse_generic_attribs(node, compound)
375
+ if not self._types_only:
376
+ compound.fields.extend(self._parse_fields(node, compound))
377
+ for method in self._find_children(node, _corens('method')):
378
+ func = self._parse_function_common(method, ast.Function, compound)
379
+ func.is_method = True
380
+ compound.methods.append(func)
381
+ for i, fieldnode in enumerate(self._find_children(node, _corens('field'))):
382
+ field = compound.fields[i]
383
+ self._parse_type_array_length(compound.fields, fieldnode, field.type)
384
+ for func in self._find_children(node, _corens('function')):
385
+ compound.static_methods.append(
386
+ self._parse_function_common(func, ast.Function, compound))
387
+ for ctor in self._find_children(node, _corens('constructor')):
388
+ func = self._parse_function_common(ctor, ast.Function, compound)
389
+ func.is_constructor = True
390
+ compound.constructors.append(func)
391
+ return compound
392
+
393
+ def _parse_record(self, node, anonymous=False):
394
+ struct = self._parse_compound(ast.Record, node)
395
+ is_gtype_struct_for = node.attrib.get(_glibns('is-gtype-struct-for'))
396
+ if is_gtype_struct_for is not None:
397
+ struct.is_gtype_struct_for = self._namespace.type_from_name(is_gtype_struct_for)
398
+ if not anonymous:
399
+ self._namespace.append(struct)
400
+ return struct
401
+
402
+ def _parse_union(self, node, anonymous=False):
403
+ union = self._parse_compound(ast.Union, node)
404
+ if not anonymous:
405
+ self._namespace.append(union)
406
+ return union
407
+
408
+ def _parse_type_simple(self, typenode):
409
+ # ast.Fields can contain inline callbacks
410
+ if typenode.tag == _corens('callback'):
411
+ typeval = self._namespace.type_from_name(typenode.attrib['name'])
412
+ typeval.ctype = typenode.attrib.get(_cns('type'))
413
+ return typeval
414
+ # ast.Arrays have their own toplevel XML
415
+ elif typenode.tag == _corens('array'):
416
+ array_type = typenode.attrib.get('name')
417
+ element_type = self._parse_type(typenode)
418
+ array_ctype = typenode.attrib.get(_cns('type'))
419
+ ret = ast.Array(array_type, element_type, ctype=array_ctype)
420
+ # zero-terminated defaults to true...
421
+ zero = typenode.attrib.get('zero-terminated')
422
+ if zero and zero == '0':
423
+ ret.zeroterminated = False
424
+ fixed_size = typenode.attrib.get('fixed-size')
425
+ if fixed_size:
426
+ ret.size = int(fixed_size)
427
+
428
+ return ret
429
+ elif typenode.tag == _corens('varargs'):
430
+ return ast.Varargs()
431
+ elif typenode.tag == _corens('type'):
432
+ name = typenode.attrib.get('name')
433
+ ctype = typenode.attrib.get(_cns('type'))
434
+ if name is None:
435
+ if ctype is None:
436
+ return ast.TypeUnknown()
437
+ return ast.Type(ctype=ctype)
438
+ elif name in ['GLib.List', 'GLib.SList']:
439
+ subchild = self._find_first_child(typenode,
440
+ map(_corens, ('callback', 'array',
441
+ 'varargs', 'type')))
442
+ if subchild is not None:
443
+ element_type = self._parse_type(typenode)
444
+ else:
445
+ element_type = ast.TYPE_ANY
446
+ return ast.List(name, element_type, ctype=ctype)
447
+ elif name == 'GLib.HashTable':
448
+ subchildren = self._find_children(typenode, _corens('type'))
449
+ subchildren_types = map(self._parse_type_simple, subchildren)
450
+ while len(subchildren_types) < 2:
451
+ subchildren_types.append(ast.TYPE_ANY)
452
+ return ast.Map(subchildren_types[0], subchildren_types[1], ctype=ctype)
453
+ else:
454
+ return self._namespace.type_from_name(name, ctype)
455
+ else:
456
+ assert False, "Failed to parse inner type"
457
+
458
+ def _parse_type(self, node):
459
+ for name in map(_corens, ('callback', 'array', 'varargs', 'type')):
460
+ typenode = node.find(name)
461
+ if typenode is not None:
462
+ return self._parse_type_simple(typenode)
463
+ assert False, "Failed to parse toplevel type"
464
+
465
+ def _parse_type_array_length(self, siblings, node, typeval):
466
+ """A hack necessary to handle the integer parameter/field indexes on
467
+ array types."""
468
+ typenode = node.find(_corens('array'))
469
+ if typenode is None:
470
+ return
471
+ lenidx = typenode.attrib.get('length')
472
+ if lenidx is not None:
473
+ idx = int(lenidx)
474
+ assert idx < len(siblings), "%r %d >= %d" % (parent, idx, len(siblings))
475
+ if isinstance(siblings[idx], ast.Field):
476
+ typeval.length_param_name = siblings[idx].name
477
+ else:
478
+ typeval.length_param_name = siblings[idx].argname
479
+
480
+ def _parse_boxed(self, node):
481
+ obj = ast.Boxed(node.attrib[_glibns('name')],
482
+ gtype_name=node.attrib[_glibns('type-name')],
483
+ get_type=node.attrib[_glibns('get-type')],
484
+ c_symbol_prefix=node.attrib.get(_cns('symbol-prefix')))
485
+ self._parse_generic_attribs(node, obj)
486
+
487
+ if self._types_only:
488
+ self._namespace.append(obj)
489
+ return
490
+
491
+ for method in self._find_children(node, _corens('method')):
492
+ func = self._parse_function_common(method, ast.Function, obj)
493
+ func.is_method = True
494
+ obj.methods.append(func)
495
+ for ctor in self._find_children(node, _corens('constructor')):
496
+ obj.constructors.append(
497
+ self._parse_function_common(ctor, ast.Function, obj))
498
+ for callback in self._find_children(node, _corens('callback')):
499
+ obj.fields.append(
500
+ self._parse_function_common(callback, ast.Callback, obj))
501
+ self._namespace.append(obj)
502
+
503
+ def _parse_field(self, node, parent):
504
+ type_node = None
505
+ anonymous_node = None
506
+ if node.tag in map(_corens, ('record', 'union')):
507
+ anonymous_elt = node
508
+ else:
509
+ anonymous_elt = self._find_first_child(node, _corens('callback'))
510
+ if anonymous_elt is not None:
511
+ if anonymous_elt.tag == _corens('callback'):
512
+ anonymous_node = self._parse_function_common(anonymous_elt, ast.Callback)
513
+ elif anonymous_elt.tag == _corens('record'):
514
+ anonymous_node = self._parse_record(anonymous_elt, anonymous=True)
515
+ elif anonymous_elt.tag == _corens('union'):
516
+ anonymous_node = self._parse_union(anonymous_elt, anonymous=True)
517
+ else:
518
+ assert False, anonymous_elt.tag
519
+ else:
520
+ assert node.tag == _corens('field'), node.tag
521
+ type_node = self._parse_type(node)
522
+ field = ast.Field(node.attrib.get('name'),
523
+ type_node,
524
+ node.attrib.get('readable') != '0',
525
+ node.attrib.get('writable') == '1',
526
+ node.attrib.get('bits'),
527
+ anonymous_node=anonymous_node)
528
+ field.private = node.attrib.get('private') == '1'
529
+ field.parent = parent
530
+ self._parse_generic_attribs(node, field)
531
+ return field
532
+
533
+ def _parse_property(self, node, parent):
534
+ prop = ast.Property(node.attrib['name'],
535
+ self._parse_type(node),
536
+ node.attrib.get('readable') != '0',
537
+ node.attrib.get('writable') == '1',
538
+ node.attrib.get('construct') == '1',
539
+ node.attrib.get('construct-only') == '1',
540
+ node.attrib.get('transfer-ownership'))
541
+ self._parse_generic_attribs(node, prop)
542
+ prop.parent = parent
543
+ return prop
544
+
545
+ def _parse_member(self, node):
546
+ member = ast.Member(node.attrib['name'],
547
+ node.attrib['value'],
548
+ node.attrib.get(_cns('identifier')),
549
+ node.attrib.get(_glibns('nick')))
550
+ self._parse_generic_attribs(node, member)
551
+ return member
552
+
553
+ def _parse_constant(self, node):
554
+ type_node = self._parse_type(node)
555
+ constant = ast.Constant(node.attrib['name'],
556
+ type_node,
557
+ node.attrib['value'],
558
+ node.attrib.get(_cns('type')))
559
+ self._parse_generic_attribs(node, constant)
560
+ self._namespace.append(constant)
561
+
562
+ def _parse_enumeration_bitfield(self, node):
563
+ name = node.attrib.get('name')
564
+ ctype = node.attrib.get(_cns('type'))
565
+ get_type = node.attrib.get(_glibns('get-type'))
566
+ type_name = node.attrib.get(_glibns('type-name'))
567
+ glib_error_domain = node.attrib.get(_glibns('error-domain'))
568
+ if node.tag == _corens('bitfield'):
569
+ klass = ast.Bitfield
570
+ else:
571
+ klass = ast.Enum
572
+ members = []
573
+ obj = klass(name, ctype,
574
+ members=members,
575
+ gtype_name=type_name,
576
+ get_type=get_type)
577
+ obj.error_domain = glib_error_domain
578
+ obj.ctype = ctype
579
+ self._parse_generic_attribs(node, obj)
580
+
581
+ if self._types_only:
582
+ self._namespace.append(obj)
583
+ return
584
+
585
+ for member_node in self._find_children(node, _corens('member')):
586
+ member = self._parse_member(member_node)
587
+ member.parent = obj
588
+ members.append(member)
589
+ for func_node in self._find_children(node, _corens('function')):
590
+ func = self._parse_function_common(func_node, ast.Function)
591
+ func.parent = obj
592
+ obj.static_methods.append(func)
593
+ self._namespace.append(obj)