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,203 @@
1
+ #!/usr/bin/env python
2
+ # -*- Mode: Python -*-
3
+ # GObject-Introspection - a framework for introspecting GObject libraries
4
+ # Copyright (C) 2010 Red Hat, Inc.
5
+ # Copyright (C) 2010 Johan Dahlin
6
+ #
7
+ # This program is free software; you can redistribute it and/or
8
+ # modify it under the terms of the GNU General Public License
9
+ # as published by the Free Software Foundation; either version 2
10
+ # of the License, or (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with this program; if not, write to the Free Software
19
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
+ # 02110-1301, USA.
21
+ #
22
+
23
+ import os
24
+ import sys
25
+
26
+ from . import utils
27
+
28
+ (WARNING,
29
+ ERROR,
30
+ FATAL) = range(3)
31
+
32
+
33
+ class Position(object):
34
+ """
35
+ Represents a position in the source file which we
36
+ want to inform about.
37
+ """
38
+
39
+ __slots__ = ('filename', 'line', 'column')
40
+
41
+ def __init__(self, filename=None, line=None, column=None):
42
+ self.filename = filename
43
+ self.line = line
44
+ self.column = column
45
+
46
+ def __cmp__(self, other):
47
+ return cmp((self.filename, self.line, self.column),
48
+ (other.filename, other.line, other.column))
49
+
50
+ def __repr__(self):
51
+ return '<Position %s:%d:%d>' % (os.path.basename(self.filename), self.line or -1,
52
+ self.column or -1)
53
+
54
+ def format(self, cwd):
55
+ filename = os.path.realpath(self.filename)
56
+ cwd = os.path.realpath(cwd)
57
+ common_prefix = os.path.commonprefix((filename, cwd))
58
+ if common_prefix:
59
+ filename = os.path.relpath(filename, common_prefix)
60
+
61
+ if self.column is not None:
62
+ return '%s:%d:%d' % (filename, self.line, self.column)
63
+ elif self.line is not None:
64
+ return '%s:%d' % (filename, self.line, )
65
+ else:
66
+ return '%s:' % (filename, )
67
+
68
+
69
+ class MessageLogger(object):
70
+ _instance = None
71
+
72
+ def __init__(self, namespace, output=None):
73
+ if output is None:
74
+ output = sys.stderr
75
+ self._cwd = os.getcwd()
76
+ self._output = output
77
+ self._namespace = namespace
78
+ self._enable_warnings = []
79
+ self._warning_count = 0
80
+ self._error_count = 0
81
+
82
+ @classmethod
83
+ def get(cls, *args, **kwargs):
84
+ if cls._instance is None:
85
+ cls._instance = cls(*args, **kwargs)
86
+ return cls._instance
87
+
88
+ def enable_warnings(self, log_types):
89
+ self._enable_warnings = log_types
90
+
91
+ def get_warning_count(self):
92
+ return self._warning_count
93
+
94
+ def get_error_count(self):
95
+ return self._error_count
96
+
97
+ def log(self, log_type, text, positions=None, prefix=None):
98
+ """
99
+ Log a warning, using optional file positioning information.
100
+ If the warning is related to a ast.Node type, see log_node().
101
+ """
102
+ utils.break_on_debug_flag('warning')
103
+
104
+ self._warning_count += 1
105
+
106
+ if not log_type in self._enable_warnings:
107
+ return
108
+
109
+ if type(positions) == set:
110
+ positions = list(positions)
111
+ if isinstance(positions, Position):
112
+ positions = [positions]
113
+
114
+ if not positions:
115
+ positions = [Position('<unknown>')]
116
+
117
+ for position in positions[:-1]:
118
+ self._output.write("%s:\n" % (position.format(cwd=self._cwd), ))
119
+ last_position = positions[-1].format(cwd=self._cwd)
120
+
121
+ if log_type == WARNING:
122
+ error_type = "Warning"
123
+ elif log_type == ERROR:
124
+ error_type = "Error"
125
+ self._error_count += 1
126
+ elif log_type == FATAL:
127
+ error_type = "Fatal"
128
+
129
+ if prefix:
130
+ text = ('%s: %s: %s: %s: %s\n' % (last_position, error_type,
131
+ self._namespace.name, prefix, text))
132
+ else:
133
+ if self._namespace:
134
+ text = ('%s: %s: %s: %s\n' % (last_position, error_type,
135
+ self._namespace.name, text))
136
+ else:
137
+ text = ('%s: %s: %s\n' % (last_position, error_type, text))
138
+
139
+ self._output.write(text)
140
+
141
+ if log_type == FATAL:
142
+ utils.break_on_debug_flag('fatal')
143
+ raise SystemExit(text)
144
+
145
+ def log_node(self, log_type, node, text, context=None, positions=None):
146
+ """
147
+ Log a warning, using information about file positions from
148
+ the given node. The optional context argument, if given, should be
149
+ another ast.Node type which will also be displayed. If no file position
150
+ information is available from the node, the position data from the
151
+ context will be used.
152
+ """
153
+ if positions:
154
+ pass
155
+ elif getattr(node, 'file_positions', None):
156
+ positions = node.file_positions
157
+ elif context and context.file_positions:
158
+ positions = context.file_positions
159
+ else:
160
+ positions = []
161
+ if not context:
162
+ text = "context=%r %s" % (node, text)
163
+
164
+ if context:
165
+ text = "%s: %s" % (getattr(context, 'symbol', context.name), text)
166
+ elif not positions and hasattr(node, 'name'):
167
+ text = "(%s)%s: %s" % (node.__class__.__name__, node.name, text)
168
+
169
+ self.log(log_type, text, positions)
170
+
171
+ def log_symbol(self, log_type, symbol, text):
172
+ """Log a warning in the context of the given symbol."""
173
+ self.log(log_type, text, symbol.position,
174
+ prefix="symbol=%r" % (symbol.ident, ))
175
+
176
+
177
+ def log_node(log_type, node, text, context=None, positions=None):
178
+ ml = MessageLogger.get()
179
+ ml.log_node(log_type, node, text, context=context, positions=positions)
180
+
181
+
182
+ def warn(text, positions=None, prefix=None):
183
+ ml = MessageLogger.get()
184
+ ml.log(WARNING, text, positions, prefix)
185
+
186
+
187
+ def warn_node(node, text, context=None, positions=None):
188
+ log_node(WARNING, node, text, context=context, positions=positions)
189
+
190
+
191
+ def warn_symbol(symbol, text):
192
+ ml = MessageLogger.get()
193
+ ml.log_symbol(WARNING, symbol, text)
194
+
195
+
196
+ def error(text, positions=None, prefix=None):
197
+ ml = MessageLogger.get()
198
+ ml.log(ERROR, text, positions, prefix)
199
+
200
+
201
+ def fatal(text, positions=None, prefix=None):
202
+ ml = MessageLogger.get()
203
+ ml.log(FATAL, text, positions, prefix)
@@ -0,0 +1,561 @@
1
+ #!/usr/bin/env python
2
+ # -*- Mode: Python -*-
3
+ # GObject-Introspection - a framework for introspecting GObject libraries
4
+ # Copyright (C) 2008-2010 Johan Dahlin
5
+ # Copyright (C) 2009 Red Hat, Inc.
6
+ #
7
+ # This program is free software; you can redistribute it and/or
8
+ # modify it under the terms of the GNU General Public License
9
+ # as published by the Free Software Foundation; either version 2
10
+ # of the License, or (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU General Public License
18
+ # along with this program; if not, write to the Free Software
19
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
+ # 02110-1301, USA.
21
+ #
22
+
23
+ import errno
24
+ import optparse
25
+ import os
26
+ import shutil
27
+ import subprocess
28
+ import sys
29
+ import tempfile
30
+ import platform
31
+
32
+ from giscanner import message
33
+ from giscanner.annotationparser import GtkDocCommentBlockParser
34
+ from giscanner.ast import Include, Namespace
35
+ from giscanner.dumper import compile_introspection_binary
36
+ from giscanner.gdumpparser import GDumpParser, IntrospectionBinary
37
+ from giscanner.introspectablepass import IntrospectablePass
38
+ from giscanner.girparser import GIRParser
39
+ from giscanner.girwriter import GIRWriter
40
+ from giscanner.maintransformer import MainTransformer
41
+ from giscanner.shlibs import resolve_shlibs
42
+ from giscanner.sourcescanner import SourceScanner, ALL_EXTS
43
+ from giscanner.transformer import Transformer
44
+ from . import utils
45
+
46
+
47
+ def process_cflags_begin(option, opt, value, parser):
48
+ cflags = getattr(parser.values, option.dest)
49
+ while len(parser.rargs) > 0 and parser.rargs[0] != '--cflags-end':
50
+ arg = parser.rargs.pop(0)
51
+ if arg == "-I" and parser.rargs and parser.rargs[0] != '--cflags-end':
52
+ # This is a special case where there's a space between -I and the path.
53
+ arg += parser.rargs.pop(0)
54
+ cflags.append(utils.cflag_real_include_path(arg))
55
+
56
+
57
+ def process_cflags_end(option, opt, value, parser):
58
+ pass
59
+
60
+
61
+ def process_cpp_includes(option, opt, value, parser):
62
+ cpp_includes = getattr(parser.values, option.dest)
63
+ cpp_includes.append(os.path.realpath(value))
64
+
65
+
66
+ def get_preprocessor_option_group(parser):
67
+ group = optparse.OptionGroup(parser, "Preprocessor options")
68
+ group.add_option("", "--cflags-begin",
69
+ help="Start preprocessor/compiler flags",
70
+ dest="cflags", default=[],
71
+ action="callback", callback=process_cflags_begin)
72
+ group.add_option("", "--cflags-end",
73
+ help="End preprocessor/compiler flags",
74
+ action="callback", callback=process_cflags_end)
75
+ group.add_option("-I", help="Pre-processor include file",
76
+ dest="cpp_includes", default=[], type="string",
77
+ action="callback", callback=process_cpp_includes)
78
+ group.add_option("-D", help="Pre-processor define",
79
+ action="append", dest="cpp_defines",
80
+ default=[])
81
+ group.add_option("-U", help="Pre-processor undefine",
82
+ action="append", dest="cpp_undefines",
83
+ default=[])
84
+ group.add_option("-p", dest="", help="Ignored")
85
+ return group
86
+
87
+
88
+ def get_windows_option_group(parser):
89
+ group = optparse.OptionGroup(parser, "Machine Dependent Options")
90
+ group.add_option("-m", help="some machine dependent option",
91
+ action="append", dest='m_option',
92
+ default=[])
93
+
94
+ return group
95
+
96
+
97
+ def _get_option_parser():
98
+ parser = optparse.OptionParser('%prog [options] sources')
99
+ parser.add_option('', "--quiet",
100
+ action="store_true", dest="quiet",
101
+ default=False,
102
+ help="If passed, do not print details of normal operation")
103
+ parser.add_option("", "--format",
104
+ action="store", dest="format",
105
+ default="gir",
106
+ help="format to use, one of gidl, gir")
107
+ parser.add_option("-i", "--include",
108
+ action="append", dest="includes", default=[],
109
+ help="Add specified gir file as dependency")
110
+ parser.add_option("", "--include-uninstalled",
111
+ action="append", dest="includes_uninstalled", default=[],
112
+ help=("""A file path to a dependency; only use this "
113
+ "when building multiple .gir files inside a "
114
+ "single module."""))
115
+ parser.add_option("", "--add-include-path",
116
+ action="append", dest="include_paths", default=[],
117
+ help="include paths for other GIR files")
118
+ parser.add_option("", "--program",
119
+ action="store", dest="program", default=None,
120
+ help="program to execute")
121
+ parser.add_option("", "--program-arg",
122
+ action="append", dest="program_args", default=[],
123
+ help="extra arguments to program")
124
+ parser.add_option("", "--libtool",
125
+ action="store", dest="libtool_path", default=None,
126
+ help="full path to libtool")
127
+ parser.add_option("", "--no-libtool",
128
+ action="store_true", dest="nolibtool", default=False,
129
+ help="do not use libtool")
130
+ parser.add_option("", "--external-library",
131
+ action="store_true", dest="external_library", default=False,
132
+ help=("""If true, the library is located on the system,""" +
133
+ """not in the current directory"""))
134
+ parser.add_option("-l", "--library",
135
+ action="append", dest="libraries", default=[],
136
+ help="libraries of this unit")
137
+ parser.add_option("-L", "--library-path",
138
+ action="append", dest="library_paths", default=[],
139
+ help="directories to search for libraries")
140
+ parser.add_option("", "--header-only",
141
+ action="store_true", dest="header_only", default=[],
142
+ help="If specified, just generate a GIR for the given header files")
143
+ parser.add_option("-n", "--namespace",
144
+ action="store", dest="namespace_name",
145
+ help=("name of namespace for this unit, also "
146
+ "used to compute --identifier-prefix and --symbol-prefix"))
147
+ parser.add_option("", "--nsversion",
148
+ action="store", dest="namespace_version",
149
+ help="version of namespace for this unit")
150
+ parser.add_option("", "--strip-prefix",
151
+ action="store", dest="strip_prefix",
152
+ help="""Option --strip-prefix is deprecated, please see --identifier-prefix
153
+ and --symbol-prefix.""")
154
+ parser.add_option("", "--identifier-prefix",
155
+ action="append", dest="identifier_prefixes", default=[],
156
+ help="""Remove this prefix from C identifiers (structure typedefs, etc.).
157
+ May be specified multiple times. This is also used as the default for --symbol-prefix if
158
+ the latter is not specified.""")
159
+ parser.add_option("", "--identifier-filter-cmd",
160
+ action="store", dest="identifier_filter_cmd", default='',
161
+ help='Filter identifiers (struct and union typedefs) through the given '
162
+ 'shell command which will receive the identifier name as input '
163
+ 'to stdin and is expected to output the filtered results to stdout.')
164
+ parser.add_option("", "--symbol-prefix",
165
+ action="append", dest="symbol_prefixes", default=[],
166
+ help="Remove this prefix from C symbols (function names)")
167
+ parser.add_option("", "--accept-unprefixed",
168
+ action="store_true", dest="accept_unprefixed", default=False,
169
+ help="""If specified, accept symbols and identifiers that do not
170
+ match the namespace prefix.""")
171
+ parser.add_option("", "--add-init-section",
172
+ action="append", dest="init_sections", default=[],
173
+ help="add extra initialization code in the introspection program")
174
+ parser.add_option("-o", "--output",
175
+ action="store", dest="output", default="-",
176
+ help="output filename to write to, defaults to - (stdout)")
177
+ parser.add_option("", "--pkg",
178
+ action="append", dest="packages", default=[],
179
+ help="pkg-config packages to get cflags from")
180
+ parser.add_option("", "--pkg-export",
181
+ action="append", dest="packages_export", default=[],
182
+ help="Associated pkg-config packages for this library")
183
+ parser.add_option('', "--warn-all",
184
+ action="store_true", dest="warn_all", default=False,
185
+ help="If true, enable all warnings for introspection")
186
+ parser.add_option('', "--warn-error",
187
+ action="store_true", dest="warn_fatal",
188
+ help="Turn warnings into fatal errors")
189
+ parser.add_option("-v", "--verbose",
190
+ action="store_true", dest="verbose",
191
+ help="be verbose")
192
+ parser.add_option("", "--c-include",
193
+ action="append", dest="c_includes", default=[],
194
+ help="headers which should be included in C programs")
195
+ parser.add_option("", "--filelist",
196
+ action="store", dest="filelist", default=[],
197
+ help="file containing headers and sources to be scanned")
198
+
199
+ group = get_preprocessor_option_group(parser)
200
+ parser.add_option_group(group)
201
+
202
+ msystemenv = os.environ.get('MSYSTEM')
203
+ if msystemenv and msystemenv.startswith('MINGW'):
204
+ group = get_windows_option_group(parser)
205
+ parser.add_option_group(group)
206
+
207
+ # Private options
208
+ parser.add_option('', "--generate-typelib-tests",
209
+ action="store", dest="test_codegen", default=None,
210
+ help=optparse.SUPPRESS_HELP)
211
+ parser.add_option('', "--passthrough-gir",
212
+ action="store", dest="passthrough_gir", default=None,
213
+ help=optparse.SUPPRESS_HELP)
214
+ parser.add_option('', "--reparse-validate",
215
+ action="store_true", dest="reparse_validate_gir", default=False,
216
+ help=optparse.SUPPRESS_HELP)
217
+ parser.add_option("", "--typelib-xml",
218
+ action="store_true", dest="typelib_xml",
219
+ help=optparse.SUPPRESS_HELP)
220
+ parser.add_option("", "--function-decoration",
221
+ action="append", dest="function_decoration", default=[],
222
+ help="Macro to decorate functions in generated code")
223
+ parser.add_option("", "--include-first-in-header",
224
+ action="append", dest="include_first_header", default=[],
225
+ help="Header to include first in generated header")
226
+ parser.add_option("", "--include-last-in-header",
227
+ action="append", dest="include_last_header", default=[],
228
+ help="Header to include after the other headers in generated header")
229
+ parser.add_option("", "--include-first-in-src",
230
+ action="append", dest="include_first_src", default=[],
231
+ help="Header to include first in generated sources")
232
+ parser.add_option("", "--include-last-in-src",
233
+ action="append", dest="include_last_src", default=[],
234
+ help="Header to include after the other headers in generated sources")
235
+
236
+ return parser
237
+
238
+
239
+ def _error(msg):
240
+ raise SystemExit('ERROR: %s' % (msg, ))
241
+
242
+
243
+ def passthrough_gir(path, f):
244
+ parser = GIRParser()
245
+ parser.parse(path)
246
+
247
+ writer = GIRWriter(parser.get_namespace())
248
+ f.write(writer.get_xml())
249
+
250
+
251
+ def test_codegen(optstring,
252
+ function_decoration,
253
+ include_first_header,
254
+ include_last_header,
255
+ include_first_src,
256
+ include_last_src):
257
+ (namespace, out_h_filename, out_c_filename) = optstring.split(',')
258
+ if namespace == 'Everything':
259
+ from .testcodegen import EverythingCodeGenerator
260
+ gen = EverythingCodeGenerator(out_h_filename,
261
+ out_c_filename,
262
+ function_decoration,
263
+ include_first_header,
264
+ include_last_header,
265
+ include_first_src,
266
+ include_last_src)
267
+ gen.write()
268
+ else:
269
+ _error("Invaild namespace %r" % (namespace, ))
270
+ return 0
271
+
272
+
273
+ def process_options(output, allowed_flags):
274
+ for option in output.split():
275
+ for flag in allowed_flags:
276
+ if not option.startswith(flag):
277
+ continue
278
+ yield option
279
+ break
280
+
281
+
282
+ def process_packages(options, packages):
283
+ args = ['pkg-config', '--cflags']
284
+ args.extend(packages)
285
+ output = subprocess.Popen(args,
286
+ stdout=subprocess.PIPE).communicate()[0]
287
+ if output is None:
288
+ # the error output should have already appeared on our stderr,
289
+ # so we just exit
290
+ return 1
291
+ # Some pkg-config files on Windows have options we don't understand,
292
+ # so we explicitly filter to only the ones we need.
293
+ options_whitelist = ['-I', '-D', '-U', '-l', '-L']
294
+ filtered_output = list(process_options(output, options_whitelist))
295
+ parser = _get_option_parser()
296
+ pkg_options, unused = parser.parse_args(filtered_output)
297
+ options.cpp_includes.extend([os.path.realpath(f) for f in pkg_options.cpp_includes])
298
+ options.cpp_defines.extend(pkg_options.cpp_defines)
299
+ options.cpp_undefines.extend(pkg_options.cpp_undefines)
300
+
301
+
302
+ def extract_filenames(args):
303
+ filenames = []
304
+ for arg in args:
305
+ # We don't support real C++ parsing yet, but we should be able
306
+ # to understand C API implemented in C++ files.
307
+ if os.path.splitext(arg)[1] in ALL_EXTS:
308
+ if not os.path.exists(arg):
309
+ _error('%s: no such a file or directory' % (arg, ))
310
+ # Make absolute, because we do comparisons inside scannerparser.c
311
+ # against the absolute path that cpp will give us
312
+ filenames.append(arg)
313
+ return filenames
314
+
315
+
316
+ def extract_filelist(options):
317
+ filenames = []
318
+ if not os.path.exists(options.filelist):
319
+ _error('%s: no such filelist file' % (options.filelist, ))
320
+ filelist_file = open(options.filelist, "r")
321
+ lines = filelist_file.readlines()
322
+ for line in lines:
323
+ # We don't support real C++ parsing yet, but we should be able
324
+ # to understand C API implemented in C++ files.
325
+ filename = line.strip()
326
+ if (filename.endswith('.c') or filename.endswith('.cpp')
327
+ or filename.endswith('.cc') or filename.endswith('.cxx')
328
+ or filename.endswith('.h') or filename.endswith('.hpp')
329
+ or filename.endswith('.hxx')):
330
+ if not os.path.exists(filename):
331
+ _error('%s: Invalid filelist entry-no such file or directory' % (line, ))
332
+ # Make absolute, because we do comparisons inside scannerparser.c
333
+ # against the absolute path that cpp will give us
334
+ filenames.append(filename)
335
+ return filenames
336
+
337
+
338
+ def create_namespace(options):
339
+ if options.strip_prefix:
340
+ print """g-ir-scanner: warning: Option --strip-prefix has been deprecated;
341
+ see --identifier-prefix and --symbol-prefix."""
342
+ options.identifier_prefixes.append(options.strip_prefix)
343
+
344
+ # We do this dance because the empty list has different semantics from
345
+ # None; if the user didn't specify the options, we want to use None so
346
+ # the Namespace constructor picks the defaults.
347
+ if options.identifier_prefixes:
348
+ identifier_prefixes = options.identifier_prefixes
349
+ else:
350
+ identifier_prefixes = None
351
+ if options.symbol_prefixes:
352
+ for prefix in options.symbol_prefixes:
353
+ # See Transformer._split_c_string_for_namespace_matches() for
354
+ # why this check is needed
355
+ if prefix.lower() != prefix:
356
+ _error("Values for --symbol-prefix must be entirely lowercase")
357
+ symbol_prefixes = options.symbol_prefixes
358
+ else:
359
+ symbol_prefixes = None
360
+
361
+ return Namespace(options.namespace_name,
362
+ options.namespace_version,
363
+ identifier_prefixes=identifier_prefixes,
364
+ symbol_prefixes=symbol_prefixes)
365
+
366
+
367
+ def create_transformer(namespace, options):
368
+ transformer = Transformer(namespace,
369
+ accept_unprefixed=options.accept_unprefixed,
370
+ identifier_filter_cmd=options.identifier_filter_cmd)
371
+ transformer.set_include_paths(options.include_paths)
372
+ if options.passthrough_gir:
373
+ transformer.disable_cache()
374
+ transformer.set_passthrough_mode()
375
+
376
+ for include in options.includes:
377
+ if os.sep in include:
378
+ _error("Invalid include path %r" % (include, ))
379
+ try:
380
+ include_obj = Include.from_string(include)
381
+ except:
382
+ _error("Malformed include %r\n" % (include, ))
383
+ transformer.register_include(include_obj)
384
+ for include_path in options.includes_uninstalled:
385
+ transformer.register_include_uninstalled(include_path)
386
+
387
+ return transformer
388
+
389
+
390
+ def create_binary(transformer, options, args):
391
+ # Transform the C AST nodes into higher level
392
+ # GLib/GObject nodes
393
+ gdump_parser = GDumpParser(transformer)
394
+
395
+ # Do enough parsing that we have the get_type() functions to reference
396
+ # when creating the introspection binary
397
+ gdump_parser.init_parse()
398
+
399
+ if options.program:
400
+ args = [options.program]
401
+ args.extend(options.program_args)
402
+ binary = IntrospectionBinary(args)
403
+ else:
404
+ binary = compile_introspection_binary(options,
405
+ gdump_parser.get_get_type_functions(),
406
+ gdump_parser.get_error_quark_functions())
407
+
408
+ shlibs = resolve_shlibs(options, binary, options.libraries)
409
+ gdump_parser.set_introspection_binary(binary)
410
+ gdump_parser.parse()
411
+ return shlibs
412
+
413
+
414
+ def create_source_scanner(options, args):
415
+ if hasattr(options, 'filelist') and options.filelist:
416
+ filenames = extract_filelist(options)
417
+ else:
418
+ filenames = extract_filenames(args)
419
+
420
+ if platform.system() == 'Darwin':
421
+ options.cpp_undefines.append('__BLOCKS__')
422
+
423
+ # Run the preprocessor, tokenize and construct simple
424
+ # objects representing the raw C symbols
425
+ ss = SourceScanner()
426
+ ss.set_cpp_options(options.cpp_includes,
427
+ options.cpp_defines,
428
+ options.cpp_undefines,
429
+ cflags=options.cflags)
430
+ ss.parse_files(filenames)
431
+ ss.parse_macros(filenames)
432
+ return ss
433
+
434
+
435
+ def write_output(data, options):
436
+ if options.output == "-":
437
+ output = sys.stdout
438
+ elif options.reparse_validate_gir:
439
+ main_f, main_f_name = tempfile.mkstemp(suffix='.gir')
440
+ main_f = os.fdopen(main_f, 'w')
441
+ main_f.write(data)
442
+ main_f.close()
443
+
444
+ temp_f, temp_f_name = tempfile.mkstemp(suffix='.gir')
445
+ temp_f = os.fdopen(temp_f, 'w')
446
+ passthrough_gir(main_f_name, temp_f)
447
+ temp_f.close()
448
+ if not utils.files_are_identical(main_f_name, temp_f_name):
449
+ _error("Failed to re-parse gir file; scanned=%r passthrough=%r" % (
450
+ main_f_name, temp_f_name))
451
+ os.unlink(temp_f_name)
452
+ try:
453
+ shutil.move(main_f_name, options.output)
454
+ except OSError as e:
455
+ if e.errno == errno.EPERM:
456
+ os.unlink(main_f_name)
457
+ return 0
458
+ raise
459
+ return 0
460
+ else:
461
+ try:
462
+ output = open(options.output, "w")
463
+ except IOError as e:
464
+ _error("opening output for writing: %s" % (e.strerror, ))
465
+
466
+ try:
467
+ output.write(data)
468
+ except IOError as e:
469
+ _error("while writing output: %s" % (e.strerror, ))
470
+
471
+
472
+ def scanner_main(args):
473
+ parser = _get_option_parser()
474
+ (options, args) = parser.parse_args(args)
475
+
476
+ if options.passthrough_gir:
477
+ passthrough_gir(options.passthrough_gir, sys.stdout)
478
+ if options.test_codegen:
479
+ return test_codegen(options.test_codegen,
480
+ options.function_decoration,
481
+ options.include_first_header,
482
+ options.include_last_header,
483
+ options.include_first_src,
484
+ options.include_last_src)
485
+
486
+ if hasattr(options, 'filelist') and not options.filelist:
487
+ if len(args) <= 1:
488
+ _error('Need at least one filename')
489
+
490
+ if not options.namespace_name:
491
+ _error('Namespace name missing')
492
+
493
+ if options.format == 'gir':
494
+ from giscanner.girwriter import GIRWriter as Writer
495
+ else:
496
+ _error("Unknown format: %s" % (options.format, ))
497
+
498
+ if not (options.libraries
499
+ or options.program
500
+ or options.header_only):
501
+ _error("Must specify --program or --library")
502
+
503
+ namespace = create_namespace(options)
504
+ logger = message.MessageLogger.get(namespace=namespace)
505
+ if options.warn_all:
506
+ logger.enable_warnings((message.WARNING, message.ERROR, message.FATAL))
507
+
508
+ transformer = create_transformer(namespace, options)
509
+
510
+ packages = set(options.packages)
511
+ packages.update(transformer.get_pkgconfig_packages())
512
+ if packages:
513
+ exit_code = process_packages(options, packages)
514
+ if exit_code:
515
+ return exit_code
516
+
517
+ ss = create_source_scanner(options, args)
518
+
519
+ cbp = GtkDocCommentBlockParser()
520
+ blocks = cbp.parse_comment_blocks(ss.get_comments())
521
+
522
+ # Transform the C symbols into AST nodes
523
+ transformer.parse(ss.get_symbols())
524
+
525
+ if not options.header_only:
526
+ shlibs = create_binary(transformer, options, args)
527
+ else:
528
+ shlibs = []
529
+
530
+ transformer.namespace.shared_libraries = shlibs
531
+
532
+ main = MainTransformer(transformer, blocks)
533
+ main.transform()
534
+
535
+ utils.break_on_debug_flag('tree')
536
+
537
+ final = IntrospectablePass(transformer, blocks)
538
+ final.validate()
539
+
540
+ warning_count = logger.get_warning_count()
541
+ if options.warn_fatal and warning_count > 0:
542
+ message.fatal("warnings configured as fatal")
543
+ return 1
544
+ elif warning_count > 0 and options.warn_all is False:
545
+ print ("g-ir-scanner: %s: warning: %d warnings suppressed (use --warn-all to see them)"
546
+ % (transformer.namespace.name, warning_count, ))
547
+
548
+ # Write out AST
549
+ if options.packages_export:
550
+ exported_packages = options.packages_export
551
+ else:
552
+ exported_packages = options.packages
553
+
554
+ transformer.namespace.c_includes = options.c_includes
555
+ transformer.namespace.exported_packages = exported_packages
556
+ writer = Writer(transformer.namespace)
557
+ data = writer.get_xml()
558
+
559
+ write_output(data, options)
560
+
561
+ return 0