gobject-introspection 2.0.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (268) hide show
  1. data/Rakefile +118 -0
  2. data/ext/gobject-introspection/depend +10 -0
  3. data/ext/gobject-introspection/extconf.rb +97 -0
  4. data/ext/gobject-introspection/gobject_introspection.def +5 -0
  5. data/ext/gobject-introspection/rb-gi-arg-info.c +151 -0
  6. data/ext/gobject-introspection/rb-gi-argument.c +1015 -0
  7. data/ext/gobject-introspection/rb-gi-base-info.c +218 -0
  8. data/ext/gobject-introspection/rb-gi-boxed-info.c +48 -0
  9. data/ext/gobject-introspection/rb-gi-callable-info.c +104 -0
  10. data/ext/gobject-introspection/rb-gi-callback-info.c +48 -0
  11. data/ext/gobject-introspection/rb-gi-constant-info.c +77 -0
  12. data/ext/gobject-introspection/rb-gi-constructor-info.c +120 -0
  13. data/ext/gobject-introspection/rb-gi-conversions.h +116 -0
  14. data/ext/gobject-introspection/rb-gi-enum-info.c +145 -0
  15. data/ext/gobject-introspection/rb-gi-field-info.c +153 -0
  16. data/ext/gobject-introspection/rb-gi-flags-info.c +48 -0
  17. data/ext/gobject-introspection/rb-gi-function-info.c +658 -0
  18. data/ext/gobject-introspection/rb-gi-interface-info.c +222 -0
  19. data/ext/gobject-introspection/rb-gi-loader.c +162 -0
  20. data/ext/gobject-introspection/rb-gi-method-info.c +109 -0
  21. data/ext/gobject-introspection/rb-gi-object-info.c +345 -0
  22. data/ext/gobject-introspection/rb-gi-private.h +110 -0
  23. data/ext/gobject-introspection/rb-gi-property-info.c +77 -0
  24. data/ext/gobject-introspection/rb-gi-registered-type-info.c +86 -0
  25. data/ext/gobject-introspection/rb-gi-repository.c +164 -0
  26. data/ext/gobject-introspection/rb-gi-signal-info.c +77 -0
  27. data/ext/gobject-introspection/rb-gi-struct-info.c +190 -0
  28. data/ext/gobject-introspection/rb-gi-type-info.c +143 -0
  29. data/ext/gobject-introspection/rb-gi-type-tag.c +43 -0
  30. data/ext/gobject-introspection/rb-gi-types.h +71 -0
  31. data/ext/gobject-introspection/rb-gi-union-info.c +206 -0
  32. data/ext/gobject-introspection/rb-gi-unresolved-info.c +48 -0
  33. data/ext/gobject-introspection/rb-gi-value-info.c +57 -0
  34. data/ext/gobject-introspection/rb-gi-vfunc-info.c +91 -0
  35. data/ext/gobject-introspection/rb-gobject-introspection.c +44 -0
  36. data/ext/gobject-introspection/rb-gobject-introspection.h +57 -0
  37. data/extconf.rb +71 -0
  38. data/lib/1.9/gobject_introspection.so +0 -0
  39. data/lib/2.0/gobject_introspection.so +0 -0
  40. data/lib/gobject-introspection.rb +52 -0
  41. data/lib/gobject-introspection/callable-info.rb +91 -0
  42. data/lib/gobject-introspection/collection-reader.rb +34 -0
  43. data/lib/gobject-introspection/interface-info.rb +32 -0
  44. data/lib/gobject-introspection/loader.rb +328 -0
  45. data/lib/gobject-introspection/object-info.rb +33 -0
  46. data/lib/gobject-introspection/repository.rb +32 -0
  47. data/lib/gobject-introspection/struct-info.rb +28 -0
  48. data/lib/gobject-introspection/union-info.rb +28 -0
  49. data/test/gobject-introspection-test-utils.rb +26 -0
  50. data/test/run-test.rb +45 -0
  51. data/test/test-arg-info.rb +68 -0
  52. data/test/test-base-info.rb +31 -0
  53. data/test/test-boxed-info.rb +21 -0
  54. data/test/test-callable-info.rb +49 -0
  55. data/test/test-callback-info.rb +29 -0
  56. data/test/test-constant-info.rb +24 -0
  57. data/test/test-enum-info.rb +56 -0
  58. data/test/test-field-type.rb +42 -0
  59. data/test/test-flags-info.rb +27 -0
  60. data/test/test-function-info.rb +37 -0
  61. data/test/test-interface-info.rb +97 -0
  62. data/test/test-loader.rb +30 -0
  63. data/test/test-object-info.rb +131 -0
  64. data/test/test-property-info.rb +38 -0
  65. data/test/test-registered-type-info.rb +35 -0
  66. data/test/test-repository.rb +59 -0
  67. data/test/test-signal-info.rb +37 -0
  68. data/test/test-struct-info.rb +57 -0
  69. data/test/test-type-info.rb +62 -0
  70. data/test/test-type-tag.rb +29 -0
  71. data/test/test-union-info.rb +21 -0
  72. data/test/test-value-info.rb +28 -0
  73. data/test/test-vfunc-info.rb +42 -0
  74. data/vendor/local/bin/g-ir-compiler.exe +0 -0
  75. data/vendor/local/bin/g-ir-generate.exe +0 -0
  76. data/vendor/local/bin/libgirepository-1.0-1.dll +0 -0
  77. data/vendor/local/include/gobject-introspection-1.0/giarginfo.h +52 -0
  78. data/vendor/local/include/gobject-introspection-1.0/gibaseinfo.h +89 -0
  79. data/vendor/local/include/gobject-introspection-1.0/gicallableinfo.h +74 -0
  80. data/vendor/local/include/gobject-introspection-1.0/giconstantinfo.h +46 -0
  81. data/vendor/local/include/gobject-introspection-1.0/gienuminfo.h +56 -0
  82. data/vendor/local/include/gobject-introspection-1.0/gifieldinfo.h +52 -0
  83. data/vendor/local/include/gobject-introspection-1.0/gifunctioninfo.h +77 -0
  84. data/vendor/local/include/gobject-introspection-1.0/giinterfaceinfo.h +68 -0
  85. data/vendor/local/include/gobject-introspection-1.0/giobjectinfo.h +137 -0
  86. data/vendor/local/include/gobject-introspection-1.0/gipropertyinfo.h +44 -0
  87. data/vendor/local/include/gobject-introspection-1.0/giregisteredtypeinfo.h +53 -0
  88. data/vendor/local/include/gobject-introspection-1.0/girepository.h +179 -0
  89. data/vendor/local/include/gobject-introspection-1.0/girffi.h +80 -0
  90. data/vendor/local/include/gobject-introspection-1.0/gisignalinfo.h +45 -0
  91. data/vendor/local/include/gobject-introspection-1.0/gistructinfo.h +53 -0
  92. data/vendor/local/include/gobject-introspection-1.0/gitypeinfo.h +56 -0
  93. data/vendor/local/include/gobject-introspection-1.0/gitypelib.h +55 -0
  94. data/vendor/local/include/gobject-introspection-1.0/gitypes.h +453 -0
  95. data/vendor/local/include/gobject-introspection-1.0/giunioninfo.h +57 -0
  96. data/vendor/local/include/gobject-introspection-1.0/givfuncinfo.h +56 -0
  97. data/vendor/local/lib/girepository-1.0/DBus-1.0.typelib +0 -0
  98. data/vendor/local/lib/girepository-1.0/DBusGLib-1.0.typelib +0 -0
  99. data/vendor/local/lib/girepository-1.0/GIRepository-2.0.typelib +0 -0
  100. data/vendor/local/lib/girepository-1.0/GL-1.0.typelib +0 -0
  101. data/vendor/local/lib/girepository-1.0/GLib-2.0.typelib +0 -0
  102. data/vendor/local/lib/girepository-1.0/GModule-2.0.typelib +0 -0
  103. data/vendor/local/lib/girepository-1.0/GObject-2.0.typelib +0 -0
  104. data/vendor/local/lib/girepository-1.0/Gio-2.0.typelib +0 -0
  105. data/vendor/local/lib/girepository-1.0/cairo-1.0.typelib +0 -0
  106. data/vendor/local/lib/girepository-1.0/fontconfig-2.0.typelib +0 -0
  107. data/vendor/local/lib/girepository-1.0/freetype2-2.0.typelib +0 -0
  108. data/vendor/local/lib/girepository-1.0/libxml2-2.0.typelib +0 -0
  109. data/vendor/local/lib/girepository-1.0/xfixes-4.0.typelib +0 -0
  110. data/vendor/local/lib/girepository-1.0/xft-2.0.typelib +0 -0
  111. data/vendor/local/lib/girepository-1.0/xlib-2.0.typelib +0 -0
  112. data/vendor/local/lib/girepository-1.0/xrandr-1.3.typelib +0 -0
  113. data/vendor/local/lib/gobject-introspection/giscanner/__init__.py +24 -0
  114. data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyc +0 -0
  115. data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyo +0 -0
  116. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.py +74 -0
  117. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyc +0 -0
  118. data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyo +0 -0
  119. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.py +1204 -0
  120. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyc +0 -0
  121. data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyo +0 -0
  122. data/vendor/local/lib/gobject-introspection/giscanner/ast.py +1100 -0
  123. data/vendor/local/lib/gobject-introspection/giscanner/ast.pyc +0 -0
  124. data/vendor/local/lib/gobject-introspection/giscanner/ast.pyo +0 -0
  125. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.py +196 -0
  126. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyc +0 -0
  127. data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyo +0 -0
  128. data/vendor/local/lib/gobject-introspection/giscanner/codegen.py +140 -0
  129. data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyc +0 -0
  130. data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyo +0 -0
  131. data/vendor/local/lib/gobject-introspection/giscanner/docmain.py +60 -0
  132. data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyc +0 -0
  133. data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyo +0 -0
  134. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/class.tmpl +2 -0
  135. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/constructor.tmpl +1 -0
  136. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/default.tmpl +1 -0
  137. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/enum.tmpl +2 -0
  138. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/function.tmpl +61 -0
  139. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/method.tmpl +1 -0
  140. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/namespace.tmpl +1 -0
  141. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/property.tmpl +5 -0
  142. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/record.tmpl +1 -0
  143. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/signal.tmpl +5 -0
  144. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/vfunc.tmpl +4 -0
  145. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/class.tmpl +18 -0
  146. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/constructor.tmpl +1 -0
  147. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/default.tmpl +1 -0
  148. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/enum.tmpl +13 -0
  149. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/function.tmpl +48 -0
  150. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/method.tmpl +1 -0
  151. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/namespace.tmpl +2 -0
  152. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/property.tmpl +10 -0
  153. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/record.tmpl +2 -0
  154. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/signal.tmpl +37 -0
  155. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/vfunc.tmpl +27 -0
  156. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/class.tmpl +17 -0
  157. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/constructor.tmpl +1 -0
  158. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/default.tmpl +1 -0
  159. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/enum.tmpl +13 -0
  160. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/function.tmpl +53 -0
  161. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/method.tmpl +1 -0
  162. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/namespace.tmpl +2 -0
  163. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/property.tmpl +10 -0
  164. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/record.tmpl +2 -0
  165. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/signal.tmpl +42 -0
  166. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/vfunc.tmpl +33 -0
  167. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/base.tmpl +29 -0
  168. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/class.tmpl +40 -0
  169. data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/namespace.tmpl +19 -0
  170. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.py +635 -0
  171. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyc +0 -0
  172. data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyo +0 -0
  173. data/vendor/local/lib/gobject-introspection/giscanner/dumper.py +363 -0
  174. data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyc +0 -0
  175. data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyo +0 -0
  176. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.py +551 -0
  177. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyc +0 -0
  178. data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyo +0 -0
  179. data/vendor/local/lib/gobject-introspection/giscanner/girparser.py +581 -0
  180. data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyc +0 -0
  181. data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyo +0 -0
  182. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.py +584 -0
  183. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyc +0 -0
  184. data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyo +0 -0
  185. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.py +236 -0
  186. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyc +0 -0
  187. data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyo +0 -0
  188. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.py +76 -0
  189. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyc +0 -0
  190. data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyo +0 -0
  191. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.py +1337 -0
  192. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyc +0 -0
  193. data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyo +0 -0
  194. data/vendor/local/lib/gobject-introspection/giscanner/message.py +185 -0
  195. data/vendor/local/lib/gobject-introspection/giscanner/message.pyc +0 -0
  196. data/vendor/local/lib/gobject-introspection/giscanner/message.pyo +0 -0
  197. data/vendor/local/lib/gobject-introspection/giscanner/odict.py +50 -0
  198. data/vendor/local/lib/gobject-introspection/giscanner/odict.pyc +0 -0
  199. data/vendor/local/lib/gobject-introspection/giscanner/odict.pyo +0 -0
  200. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.py +497 -0
  201. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyc +0 -0
  202. data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyo +0 -0
  203. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.py +78 -0
  204. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyc +0 -0
  205. data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyo +0 -0
  206. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.py +132 -0
  207. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyc +0 -0
  208. data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyo +0 -0
  209. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.py +324 -0
  210. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyc +0 -0
  211. data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyo +0 -0
  212. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.py +119 -0
  213. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyc +0 -0
  214. data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyo +0 -0
  215. data/vendor/local/lib/gobject-introspection/giscanner/transformer.py +999 -0
  216. data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyc +0 -0
  217. data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyo +0 -0
  218. data/vendor/local/lib/gobject-introspection/giscanner/utils.py +141 -0
  219. data/vendor/local/lib/gobject-introspection/giscanner/utils.pyc +0 -0
  220. data/vendor/local/lib/gobject-introspection/giscanner/utils.pyo +0 -0
  221. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.py +197 -0
  222. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyc +0 -0
  223. data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyo +0 -0
  224. data/vendor/local/lib/libgirepository-1.0.a +0 -0
  225. data/vendor/local/lib/libgirepository-1.0.dll.a +0 -0
  226. data/vendor/local/lib/libgirepository-1.0.la +41 -0
  227. data/vendor/local/lib/pkgconfig/gobject-introspection-1.0.pc +26 -0
  228. data/vendor/local/lib/pkgconfig/gobject-introspection-no-export-1.0.pc +23 -0
  229. data/vendor/local/share/aclocal/introspection.m4 +96 -0
  230. data/vendor/local/share/gir-1.0/DBus-1.0.gir +32 -0
  231. data/vendor/local/share/gir-1.0/DBusGLib-1.0.gir +18 -0
  232. data/vendor/local/share/gir-1.0/GIRepository-2.0.gir +3833 -0
  233. data/vendor/local/share/gir-1.0/GL-1.0.gir +31 -0
  234. data/vendor/local/share/gir-1.0/GLib-2.0.gir +44304 -0
  235. data/vendor/local/share/gir-1.0/GModule-2.0.gir +184 -0
  236. data/vendor/local/share/gir-1.0/GObject-2.0.gir +13947 -0
  237. data/vendor/local/share/gir-1.0/Gio-2.0.gir +73619 -0
  238. data/vendor/local/share/gir-1.0/cairo-1.0.gir +70 -0
  239. data/vendor/local/share/gir-1.0/fontconfig-2.0.gir +18 -0
  240. data/vendor/local/share/gir-1.0/freetype2-2.0.gir +22 -0
  241. data/vendor/local/share/gir-1.0/libxml2-2.0.gir +25 -0
  242. data/vendor/local/share/gir-1.0/xfixes-4.0.gir +10 -0
  243. data/vendor/local/share/gir-1.0/xft-2.0.gir +23 -0
  244. data/vendor/local/share/gir-1.0/xlib-2.0.gir +67 -0
  245. data/vendor/local/share/gir-1.0/xrandr-1.3.gir +16 -0
  246. data/vendor/local/share/gobject-introspection-1.0/Makefile.introspection +166 -0
  247. data/vendor/local/share/gobject-introspection-1.0/gdump.c +564 -0
  248. data/vendor/local/share/gobject-introspection-1.0/tests/annotation.c +835 -0
  249. data/vendor/local/share/gobject-introspection-1.0/tests/annotation.h +198 -0
  250. data/vendor/local/share/gobject-introspection-1.0/tests/drawable.c +55 -0
  251. data/vendor/local/share/gobject-introspection-1.0/tests/drawable.h +33 -0
  252. data/vendor/local/share/gobject-introspection-1.0/tests/everything.c +1473 -0
  253. data/vendor/local/share/gobject-introspection-1.0/tests/everything.h +428 -0
  254. data/vendor/local/share/gobject-introspection-1.0/tests/foo.c +790 -0
  255. data/vendor/local/share/gobject-introspection-1.0/tests/foo.h +437 -0
  256. data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.c +5256 -0
  257. data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.h +1158 -0
  258. data/vendor/local/share/gobject-introspection-1.0/tests/regress.c +4009 -0
  259. data/vendor/local/share/gobject-introspection-1.0/tests/regress.h +944 -0
  260. data/vendor/local/share/gobject-introspection-1.0/tests/utility.c +45 -0
  261. data/vendor/local/share/gobject-introspection-1.0/tests/utility.h +95 -0
  262. data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.c +33 -0
  263. data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.h +36 -0
  264. data/vendor/local/share/license/gobject-introspection/AUTHORS +9 -0
  265. data/vendor/local/share/license/gobject-introspection/COPYING +12 -0
  266. data/vendor/local/share/man/man1/g-ir-compiler.1 +51 -0
  267. data/vendor/local/share/man/man1/g-ir-generate.1 +29 -0
  268. metadata +343 -0
@@ -0,0 +1,141 @@
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 re
22
+ import os
23
+ import subprocess
24
+
25
+ _debugflags = None
26
+ def have_debug_flag(flag):
27
+ """Check for whether a specific debugging feature is enabled.
28
+ Well-known flags:
29
+ * start: Drop into debugger just after processing arguments
30
+ * exception: Drop into debugger on fatalexception
31
+ * warning: Drop into debugger on warning
32
+ * posttrans: Drop into debugger just before introspectable pass
33
+ """
34
+ global _debugflags
35
+ if _debugflags is None:
36
+ _debugflags = os.environ.get('GI_SCANNER_DEBUG', '').split(',')
37
+ if '' in _debugflags:
38
+ _debugflags.remove('')
39
+ return flag in _debugflags
40
+
41
+ def break_on_debug_flag(flag):
42
+ if have_debug_flag(flag):
43
+ import pdb
44
+ pdb.set_trace()
45
+
46
+ # Copied from h2defs.py
47
+ _upperstr_pat1 = re.compile(r'([^A-Z])([A-Z])')
48
+ _upperstr_pat2 = re.compile(r'([A-Z][A-Z])([A-Z][0-9a-z])')
49
+ _upperstr_pat3 = re.compile(r'^([A-Z])([A-Z])')
50
+
51
+
52
+ def to_underscores(name):
53
+ """Converts a typename to the equivalent underscores name.
54
+ This is used to form the type conversion macros and enum/flag
55
+ name variables.
56
+ In particular, and differently from to_underscores_noprefix(),
57
+ this function treats the first character differently if it is
58
+ uppercase and followed by another uppercase letter."""
59
+ name = _upperstr_pat1.sub(r'\1_\2', name)
60
+ name = _upperstr_pat2.sub(r'\1_\2', name)
61
+ name = _upperstr_pat3.sub(r'\1_\2', name, count=1)
62
+ return name
63
+
64
+
65
+ def to_underscores_noprefix(name):
66
+ """Like to_underscores, but designed for "unprefixed" names.
67
+ to_underscores("DBusFoo") => dbus_foo, not d_bus_foo."""
68
+ name = _upperstr_pat1.sub(r'\1_\2', name)
69
+ name = _upperstr_pat2.sub(r'\1_\2', name)
70
+ return name
71
+
72
+ _libtool_pat = re.compile("dlname='([A-z0-9\.\-\+]+)'\n")
73
+
74
+ def _extract_dlname_field(la_file):
75
+ f = open(la_file)
76
+ data = f.read()
77
+ f.close()
78
+ m = _libtool_pat.search(data)
79
+ if m:
80
+ return m.groups()[0]
81
+ else:
82
+ return None
83
+
84
+ # Returns the name that we would pass to dlopen() the library
85
+ # corresponding to this .la file
86
+ def extract_libtool_shlib(la_file):
87
+ dlname = _extract_dlname_field(la_file)
88
+ if dlname is None:
89
+ return None
90
+
91
+ # From the comments in extract_libtool(), older libtools had
92
+ # a path rather than the raw dlname
93
+ return os.path.basename(dlname)
94
+
95
+ def extract_libtool(la_file):
96
+ dlname = _extract_dlname_field(la_file)
97
+ if dlname is None:
98
+ raise ValueError("%s has no dlname. Not a shared library?" % la_file)
99
+ libname = os.path.join(os.path.dirname(la_file),
100
+ '.libs', dlname)
101
+ # FIXME: This hackish, but I'm not sure how to do this
102
+ # in a way which is compatible with both libtool 2.2
103
+ # and pre-2.2. Johan 2008-10-21
104
+ libname = libname.replace('.libs/.libs', '.libs')
105
+ return libname
106
+
107
+ # Returns arguments for invoking libtool, if applicable, otherwise None
108
+ def get_libtool_command(options):
109
+ libtool_infection = not options.nolibtool
110
+ if not libtool_infection:
111
+ return None
112
+
113
+ libtool_path = options.libtool_path
114
+ if libtool_path:
115
+ # Automake by default sets:
116
+ # LIBTOOL = $(SHELL) $(top_builddir)/libtool
117
+ # To be strictly correct we would have to parse shell. For now
118
+ # we simply split().
119
+ return libtool_path.split(' ')
120
+
121
+ try:
122
+ subprocess.check_call(['libtool', '--version'],
123
+ stdout=open(os.devnull))
124
+ except (subprocess.CalledProcessError, OSError):
125
+ # If libtool's not installed, assume we don't need it
126
+ return None
127
+
128
+ return ['libtool']
129
+
130
+
131
+ def files_are_identical(path1, path2):
132
+ f1 = open(path1)
133
+ f2 = open(path2)
134
+ buf1 = f1.read(8192)
135
+ buf2 = f2.read(8192)
136
+ while buf1 == buf2 and buf1 != '':
137
+ buf1 = f1.read(8192)
138
+ buf2 = f2.read(8192)
139
+ f1.close()
140
+ f2.close()
141
+ return buf1 == buf2
@@ -0,0 +1,197 @@
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
+ from __future__ import with_statement
22
+
23
+ import os
24
+
25
+ from contextlib import contextmanager
26
+ from cStringIO import StringIO
27
+ from xml.sax.saxutils import escape, quoteattr
28
+
29
+ from .libtoolimporter import LibtoolImporter
30
+
31
+
32
+ def _calc_attrs_length(attributes, indent, self_indent):
33
+ if indent == -1:
34
+ return -1
35
+ attr_length = 0
36
+ for attr, value in attributes:
37
+ # FIXME: actually, if we have attributes with None as value this
38
+ # should be considered a bug and raise an error. We are just
39
+ # ignoring them here while we fix GIRParser to create the right
40
+ # ast with the correct attributes.
41
+ if value is None:
42
+ continue
43
+ attr_length += 2 + len(attr) + len(quoteattr(value))
44
+ return attr_length + indent + self_indent
45
+
46
+
47
+ def collect_attributes(tag_name, attributes, self_indent,
48
+ self_indent_char, indent=-1):
49
+ if not attributes:
50
+ return ''
51
+ if _calc_attrs_length(attributes, indent, self_indent) > 79:
52
+ indent_len = self_indent + len(tag_name) + 1
53
+ else:
54
+ indent_len = 0
55
+ first = True
56
+ attr_value = ''
57
+ for attr, value in attributes:
58
+ # FIXME: actually, if we have attributes with None as value this
59
+ # should be considered a bug and raise an error. We are just
60
+ # ignoring them here while we fix GIRParser to create the right
61
+ # ast with the correct attributes.
62
+ if value is None:
63
+ continue
64
+ if indent_len and not first:
65
+ attr_value += '\n%s' % (self_indent_char * indent_len)
66
+ attr_value += ' %s=%s' % (attr, quoteattr(value))
67
+ if first:
68
+ first = False
69
+ return attr_value
70
+
71
+ def build_xml_tag(tag_name, attributes=None, data=None, self_indent=0,
72
+ self_indent_char=' '):
73
+ if attributes is None:
74
+ attributes = []
75
+ prefix = u'<%s' % (tag_name, )
76
+ if data is not None:
77
+ if isinstance(data, str):
78
+ data = data.decode('UTF-8')
79
+ suffix = u'>%s</%s>' % (escape(data), tag_name)
80
+ else:
81
+ suffix = u'/>'
82
+ attrs = collect_attributes(
83
+ tag_name, attributes,
84
+ self_indent,
85
+ self_indent_char,
86
+ len(prefix) + len(suffix))
87
+ return prefix + attrs + suffix
88
+
89
+ with LibtoolImporter(None, None):
90
+ if 'UNINSTALLED_INTROSPECTION_SRCDIR' in os.environ:
91
+ from _giscanner import collect_attributes
92
+ else:
93
+ from giscanner._giscanner import collect_attributes
94
+
95
+
96
+ class XMLWriter(object):
97
+
98
+ def __init__(self):
99
+ self._data = StringIO()
100
+ self._data.write('<?xml version="1.0"?>\n')
101
+ self._tag_stack = []
102
+ self._indent = 0
103
+ self._indent_unit = 2
104
+ self.enable_whitespace()
105
+
106
+ # Private
107
+
108
+ def _open_tag(self, tag_name, attributes=None):
109
+ if attributes is None:
110
+ attributes = []
111
+ attrs = collect_attributes(
112
+ tag_name, attributes, self._indent,
113
+ self._indent_char,
114
+ len(tag_name) + 2)
115
+ self.write_line(u'<%s%s>' % (tag_name, attrs))
116
+
117
+ def _close_tag(self, tag_name):
118
+ self.write_line(u'</%s>' % (tag_name, ))
119
+
120
+ # Public API
121
+
122
+ def enable_whitespace(self):
123
+ self._indent_char = ' '
124
+ self._newline_char = '\n'
125
+
126
+ def disable_whitespace(self):
127
+ self._indent_char = ''
128
+ self._newline_char = ''
129
+
130
+ def get_xml(self):
131
+ return self._data.getvalue()
132
+
133
+ def write_line(self, line=u'', indent=True, do_escape=False):
134
+ if isinstance(line, str):
135
+ line = line.decode('utf-8')
136
+ assert isinstance(line, unicode)
137
+ if do_escape:
138
+ line = escape(line.encode('utf-8')).decode('utf-8')
139
+ if indent:
140
+ self._data.write('%s%s%s' % (
141
+ self._indent_char * self._indent,
142
+ line.encode('utf-8'),
143
+ self._newline_char))
144
+ else:
145
+ self._data.write('%s%s' % (line.encode('utf-8'), self._newline_char))
146
+
147
+ def write_comment(self, text):
148
+ self.write_line('<!-- %s -->' % (text, ))
149
+
150
+ def write_tag(self, tag_name, attributes, data=None):
151
+ self.write_line(build_xml_tag(tag_name, attributes, data,
152
+ self._indent, self._indent_char))
153
+
154
+ def push_tag(self, tag_name, attributes=None):
155
+ if attributes is None:
156
+ attributes = []
157
+ self._open_tag(tag_name, attributes)
158
+ self._tag_stack.append(tag_name)
159
+ self._indent += self._indent_unit
160
+
161
+ def pop_tag(self):
162
+ self._indent -= self._indent_unit
163
+ tag_name = self._tag_stack.pop()
164
+ self._close_tag(tag_name)
165
+ return tag_name
166
+
167
+ @contextmanager
168
+ def tagcontext(self, tag_name, attributes=None):
169
+ self.push_tag(tag_name, attributes)
170
+ try:
171
+ yield
172
+ finally:
173
+ self.pop_tag()
174
+
175
+
176
+ def test():
177
+ w = XMLWriter()
178
+ w.push_tag('repository')
179
+ w.push_tag('namespace')
180
+ w.push_tag('enumeration')
181
+ w.push_tag('member',
182
+ [('name', 'west'),
183
+ ('value', '7'),
184
+ ('c:identifier', 'GTK_ANCHOR_WEST'),
185
+ ('glib:nick', 'west')])
186
+
187
+ w.pop_tag()
188
+ w.pop_tag()
189
+ w.pop_tag()
190
+ x = w.get_xml()
191
+ lines = x.split('\n')
192
+ import pprint
193
+ pprint.pprint(lines)
194
+ assert len(lines[3]) < 80, len(lines[3])
195
+
196
+ if __name__ == '__main__':
197
+ test()
@@ -0,0 +1,41 @@
1
+ # libgirepository-1.0.la - a libtool library file
2
+ # Generated by libtool (GNU libtool) 2.4.2
3
+ #
4
+ # Please DO NOT delete this file!
5
+ # It is necessary for linking the library.
6
+
7
+ # The name that we can dlopen(3).
8
+ dlname='../bin/libgirepository-1.0-1.dll'
9
+
10
+ # Names of this library.
11
+ library_names='libgirepository-1.0.dll.a'
12
+
13
+ # The name of the static archive.
14
+ old_library='libgirepository-1.0.a'
15
+
16
+ # Linker flags that can not go in dependency_libs.
17
+ inherited_linker_flags=''
18
+
19
+ # Libraries that this one depends upon.
20
+ dependency_libs=' -L/home/kou/work/ruby/ruby-gnome2.win32/glib2/vendor/local/lib -L/home/kou/work/ruby/rcairo.win32/vendor/local/lib -L/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib /home/kou/work/ruby/ruby-gnome2.win32/glib2/vendor/local/lib/libgio-2.0.la /home/kou/work/ruby/ruby-gnome2.win32/glib2/vendor/local/lib/libgmodule-2.0.la -ldnsapi -lz /home/kou/work/ruby/ruby-gnome2.win32/glib2/vendor/local/lib/libgobject-2.0.la /home/kou/work/ruby/ruby-gnome2.win32/glib2/vendor/local/lib/libglib-2.0.la -lws2_32 -lole32 -lwinmm -lshlwapi -lintl -lffi'
21
+
22
+ # Names of additional weak libraries provided by this library
23
+ weak_library_names=''
24
+
25
+ # Version information for libgirepository-1.0.
26
+ current=1
27
+ age=0
28
+ revision=0
29
+
30
+ # Is this an already installed library?
31
+ installed=yes
32
+
33
+ # Should we warn about portability when linking against -modules?
34
+ shouldnotlink=no
35
+
36
+ # Files to dlopen/dlpreopen
37
+ dlopen=''
38
+ dlpreopen=''
39
+
40
+ # Directory that this library needs to be installed in:
41
+ libdir='/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib'
@@ -0,0 +1,26 @@
1
+ native_prefix=/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/tmp/native/local
2
+ native_bindir=${native_prefix}/bin
3
+ prefix=/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local
4
+ exec_prefix=${prefix}
5
+ libdir=${exec_prefix}/lib
6
+ bindir=${exec_prefix}/bin
7
+ datarootdir=${prefix}/share
8
+ datadir=${datarootdir}
9
+ includedir=${prefix}/include
10
+
11
+ g_ir_scanner=${native_bindir}/g-ir-scanner
12
+ g_ir_compiler=${native_bindir}/g-ir-compiler
13
+ g_ir_generate=${bindir}/g-ir-generate
14
+ gidatadir=${datadir}/gobject-introspection-1.0
15
+ girdir=${datadir}/gir-1.0
16
+ typelibdir=${libdir}/girepository-1.0
17
+
18
+ Cflags: -I${includedir}/gobject-introspection-1.0
19
+ Requires: glib-2.0 gobject-2.0
20
+ Requires.private: gmodule-2.0
21
+ Libs: -L${libdir} -lgirepository-1.0
22
+ Libs.private: -lffi
23
+
24
+ Name: gobject-introspection
25
+ Description: GObject Introspection
26
+ Version: 1.36.0
@@ -0,0 +1,23 @@
1
+ prefix=/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local
2
+ exec_prefix=${prefix}
3
+ libdir=${exec_prefix}/lib
4
+ bindir=${exec_prefix}/bin
5
+ datarootdir=${prefix}/share
6
+ datadir=${datarootdir}
7
+ includedir=${prefix}/include
8
+
9
+ g_ir_scanner=${bindir}/g-ir-scanner
10
+ g_ir_compiler=${bindir}/g-ir-compiler
11
+ g_ir_generate=${bindir}/g-ir-generate
12
+ girdir=${datadir}/gir-1.0
13
+ typelibdir=${libdir}/girepository-1.0
14
+
15
+ Cflags: -I${includedir}/gobject-introspection-1.0
16
+ Requires: glib-2.0 gobject-2.0
17
+ Requires.private: gmodule-no-export-2.0
18
+ Libs: -L${libdir} -lgirepository-1.0
19
+ Libs.private: -lffi
20
+
21
+ Name: gobject-introspection
22
+ Description: GObject Introspection
23
+ Version: 1.36.0