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,1139 @@
1
+ # -*- Mode: Python -*-
2
+ # GObject-Introspection - a framework for introspecting GObject libraries
3
+ # Copyright (C) 2008 Johan Dahlin
4
+ # Copyright (C) 2008, 2009 Red Hat, Inc.
5
+ #
6
+ # This library is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU Lesser General Public
8
+ # License as published by the Free Software Foundation; either
9
+ # version 2 of the License, or (at your option) any later version.
10
+ #
11
+ # This library is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ # Lesser General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public
17
+ # License along with this library; if not, write to the
18
+ # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
+ # Boston, MA 02111-1307, USA.
20
+ #
21
+
22
+ import copy
23
+ from itertools import chain
24
+
25
+ from . import message
26
+
27
+ from .collections import OrderedDict
28
+ from .message import Position
29
+ from .utils import to_underscores
30
+
31
+
32
+ class Type(object):
33
+ """
34
+ A Type can be either:
35
+ * A reference to a node (target_giname)
36
+ * A reference to a "fundamental" type like 'utf8'
37
+ * A "foreign" type - this can be any string."
38
+ If none are specified, then it's in an "unresolved" state. An
39
+ unresolved type can have two data sources; a "ctype" which comes
40
+ from a C type string, or a gtype_name (from g_type_name()).
41
+ """
42
+
43
+ def __init__(self,
44
+ ctype=None,
45
+ gtype_name=None,
46
+ target_fundamental=None,
47
+ target_giname=None,
48
+ target_foreign=None,
49
+ _target_unknown=False,
50
+ is_const=False,
51
+ origin_symbol=None,
52
+ complete_ctype=None):
53
+ self.ctype = ctype
54
+ self.gtype_name = gtype_name
55
+ self.origin_symbol = origin_symbol
56
+ if _target_unknown:
57
+ assert isinstance(self, TypeUnknown)
58
+ elif target_fundamental:
59
+ assert target_giname is None
60
+ assert target_foreign is None
61
+ elif target_giname:
62
+ assert '.' in target_giname
63
+ assert target_fundamental is None
64
+ assert target_foreign is None
65
+ elif target_foreign:
66
+ assert ctype is not None
67
+ assert target_giname is None
68
+ assert target_fundamental is None
69
+ else:
70
+ assert (ctype is not None) or (gtype_name is not None)
71
+ self.target_fundamental = target_fundamental
72
+ self.target_giname = target_giname
73
+ self.target_foreign = target_foreign
74
+ self.is_const = is_const
75
+ self.complete_ctype = complete_ctype
76
+
77
+ @property
78
+ def resolved(self):
79
+ return (self.target_fundamental or
80
+ self.target_giname or
81
+ self.target_foreign)
82
+
83
+ @property
84
+ def unresolved_string(self):
85
+ if self.ctype:
86
+ return self.ctype
87
+ elif self.gtype_name:
88
+ return self.gtype_name
89
+ elif self.target_giname:
90
+ return self.target_giname
91
+ else:
92
+ assert False
93
+
94
+ @classmethod
95
+ def create_from_gtype_name(cls, gtype_name):
96
+ """Parse a GType name (as from g_type_name()), and return a
97
+ Type instance. Note that this function performs namespace lookup,
98
+ in contrast to the other create_type() functions."""
99
+ # First, is it a fundamental?
100
+ fundamental = type_names.get(gtype_name)
101
+ if fundamental is not None:
102
+ return cls(target_fundamental=fundamental.target_fundamental,
103
+ ctype=fundamental.ctype)
104
+ if gtype_name == 'GHashTable':
105
+ return Map(TYPE_ANY, TYPE_ANY, gtype_name=gtype_name)
106
+ elif gtype_name in ('GArray', 'GPtrArray', 'GByteArray'):
107
+ return Array('GLib.' + gtype_name[1:], TYPE_ANY,
108
+ gtype_name=gtype_name)
109
+ elif gtype_name == 'GStrv':
110
+ bare_utf8 = TYPE_STRING.clone()
111
+ bare_utf8.ctype = None
112
+ return Array(None, bare_utf8, ctype=None, gtype_name=gtype_name,
113
+ is_const=False)
114
+
115
+ # Workaround for Gdk.Rectangle being boxed alias for
116
+ # cairo.RectangleInt. G-I does not support boxing of aliases.
117
+ # See https://bugzilla.gnome.org/show_bug.cgi?id=655423
118
+ if gtype_name == 'GdkRectangle':
119
+ gtype_name = 'CairoRectangleInt'
120
+
121
+ return cls(gtype_name=gtype_name)
122
+
123
+ def get_giname(self):
124
+ assert self.target_giname is not None
125
+ return self.target_giname.split('.')[1]
126
+
127
+ def __cmp__(self, other):
128
+ if self.target_fundamental:
129
+ return cmp(self.target_fundamental, other.target_fundamental)
130
+ elif self.target_giname:
131
+ return cmp(self.target_giname, other.target_giname)
132
+ elif self.target_foreign:
133
+ return cmp(self.target_foreign, other.target_foreign)
134
+ else:
135
+ return cmp(self.ctype, other.ctype)
136
+
137
+ def is_equiv(self, typeval):
138
+ """Return True if the specified types are compatible at
139
+ an introspection level, disregarding their C types.
140
+ A sequence may be given for typeval, in which case
141
+ this function returns True if the type is compatible with
142
+ any."""
143
+ if isinstance(typeval, (list, tuple)):
144
+ for val in typeval:
145
+ if self.is_equiv(val):
146
+ return True
147
+ return False
148
+ return self == typeval
149
+
150
+ def clone(self):
151
+ return Type(target_fundamental=self.target_fundamental,
152
+ target_giname=self.target_giname,
153
+ target_foreign=self.target_foreign,
154
+ ctype=self.ctype,
155
+ is_const=self.is_const)
156
+
157
+ def __str__(self):
158
+ if self.target_fundamental:
159
+ return self.target_fundamental
160
+ elif self.target_giname:
161
+ return self.target_giname
162
+ elif self.target_foreign:
163
+ return self.target_foreign
164
+
165
+ def __repr__(self):
166
+ if self.target_fundamental:
167
+ data = 'target_fundamental=%s, ' % (self.target_fundamental, )
168
+ elif self.target_giname:
169
+ data = 'target_giname=%s, ' % (self.target_giname, )
170
+ elif self.target_foreign:
171
+ data = 'target_foreign=%s, ' % (self.target_foreign, )
172
+ else:
173
+ data = ''
174
+ return '%s(%sctype=%s)' % (self.__class__.__name__, data, self.ctype)
175
+
176
+
177
+ class TypeUnknown(Type):
178
+ def __init__(self):
179
+ Type.__init__(self, _target_unknown=True)
180
+
181
+ ######
182
+ ## Fundamental types
183
+ ######
184
+ # Two special ones
185
+ TYPE_NONE = Type(target_fundamental='none', ctype='void')
186
+ TYPE_ANY = Type(target_fundamental='gpointer', ctype='gpointer')
187
+ # "Basic" types
188
+ TYPE_BOOLEAN = Type(target_fundamental='gboolean', ctype='gboolean')
189
+ TYPE_INT8 = Type(target_fundamental='gint8', ctype='gint8')
190
+ TYPE_UINT8 = Type(target_fundamental='guint8', ctype='guint8')
191
+ TYPE_INT16 = Type(target_fundamental='gint16', ctype='gint16')
192
+ TYPE_UINT16 = Type(target_fundamental='guint16', ctype='guint16')
193
+ TYPE_INT32 = Type(target_fundamental='gint32', ctype='gint32')
194
+ TYPE_UINT32 = Type(target_fundamental='guint32', ctype='guint32')
195
+ TYPE_INT64 = Type(target_fundamental='gint64', ctype='gint64')
196
+ TYPE_UINT64 = Type(target_fundamental='guint64', ctype='guint64')
197
+ TYPE_CHAR = Type(target_fundamental='gchar', ctype='gchar')
198
+ TYPE_SHORT = Type(target_fundamental='gshort', ctype='gshort')
199
+ TYPE_USHORT = Type(target_fundamental='gushort', ctype='gushort')
200
+ TYPE_INT = Type(target_fundamental='gint', ctype='gint')
201
+ TYPE_UINT = Type(target_fundamental='guint', ctype='guint')
202
+ TYPE_LONG = Type(target_fundamental='glong', ctype='glong')
203
+ TYPE_ULONG = Type(target_fundamental='gulong', ctype='gulong')
204
+ TYPE_SIZE = Type(target_fundamental='gsize', ctype='gsize')
205
+ TYPE_SSIZE = Type(target_fundamental='gssize', ctype='gssize')
206
+ TYPE_INTPTR = Type(target_fundamental='gintptr', ctype='gintptr')
207
+ TYPE_UINTPTR = Type(target_fundamental='guintptr', ctype='guintptr')
208
+ # C99 types
209
+ TYPE_LONG_LONG = Type(target_fundamental='long long', ctype='long long')
210
+ TYPE_LONG_ULONG = Type(target_fundamental='unsigned long long',
211
+ ctype='unsigned long long')
212
+ TYPE_FLOAT = Type(target_fundamental='gfloat', ctype='gfloat')
213
+ TYPE_DOUBLE = Type(target_fundamental='gdouble', ctype='gdouble')
214
+ # ?
215
+ TYPE_LONG_DOUBLE = Type(target_fundamental='long double',
216
+ ctype='long double')
217
+ TYPE_UNICHAR = Type(target_fundamental='gunichar', ctype='gunichar')
218
+
219
+ # C types with semantics overlaid
220
+ TYPE_GTYPE = Type(target_fundamental='GType', ctype='GType')
221
+ TYPE_STRING = Type(target_fundamental='utf8', ctype='gchar*')
222
+ TYPE_FILENAME = Type(target_fundamental='filename', ctype='gchar*')
223
+
224
+ TYPE_VALIST = Type(target_fundamental='va_list', ctype='va_list')
225
+
226
+ BASIC_GIR_TYPES = [TYPE_BOOLEAN, TYPE_INT8, TYPE_UINT8, TYPE_INT16,
227
+ TYPE_UINT16, TYPE_INT32, TYPE_UINT32, TYPE_INT64,
228
+ TYPE_UINT64, TYPE_CHAR, TYPE_SHORT, TYPE_USHORT, TYPE_INT,
229
+ TYPE_UINT, TYPE_LONG, TYPE_ULONG, TYPE_SIZE, TYPE_SSIZE,
230
+ TYPE_LONG_LONG, TYPE_LONG_ULONG, TYPE_INTPTR, TYPE_UINTPTR,
231
+ TYPE_FLOAT, TYPE_DOUBLE,
232
+ TYPE_LONG_DOUBLE, TYPE_UNICHAR, TYPE_GTYPE]
233
+ GIR_TYPES = [TYPE_NONE, TYPE_ANY]
234
+ GIR_TYPES.extend(BASIC_GIR_TYPES)
235
+ GIR_TYPES.extend([TYPE_STRING, TYPE_FILENAME, TYPE_VALIST])
236
+
237
+ # These are the only basic types that are guaranteed to
238
+ # be as big as a pointer (and thus are allowed in GPtrArray)
239
+ POINTER_TYPES = [TYPE_ANY, TYPE_INTPTR, TYPE_UINTPTR]
240
+
241
+ INTROSPECTABLE_BASIC = list(GIR_TYPES)
242
+ for v in [TYPE_NONE, TYPE_ANY,
243
+ TYPE_LONG_LONG, TYPE_LONG_ULONG,
244
+ TYPE_LONG_DOUBLE, TYPE_VALIST]:
245
+ INTROSPECTABLE_BASIC.remove(v)
246
+
247
+ type_names = {}
248
+ for typeval in GIR_TYPES:
249
+ type_names[typeval.target_fundamental] = typeval
250
+ basic_type_names = {}
251
+ for typeval in BASIC_GIR_TYPES:
252
+ basic_type_names[typeval.target_fundamental] = typeval
253
+
254
+ # C builtin
255
+ type_names['char'] = TYPE_CHAR
256
+ type_names['signed char'] = TYPE_INT8
257
+ type_names['unsigned char'] = TYPE_UINT8
258
+ type_names['short'] = TYPE_SHORT
259
+ type_names['signed short'] = TYPE_SHORT
260
+ type_names['unsigned short'] = TYPE_USHORT
261
+ type_names['int'] = TYPE_INT
262
+ type_names['signed int'] = TYPE_INT
263
+ type_names['unsigned short int'] = TYPE_USHORT
264
+ type_names['signed'] = TYPE_INT
265
+ type_names['unsigned int'] = TYPE_UINT
266
+ type_names['unsigned'] = TYPE_UINT
267
+ type_names['long'] = TYPE_LONG
268
+ type_names['signed long'] = TYPE_LONG
269
+ type_names['unsigned long'] = TYPE_ULONG
270
+ type_names['unsigned long int'] = TYPE_ULONG
271
+ type_names['float'] = TYPE_FLOAT
272
+ type_names['double'] = TYPE_DOUBLE
273
+ type_names['char*'] = TYPE_STRING
274
+ type_names['void*'] = TYPE_ANY
275
+ type_names['void'] = TYPE_NONE
276
+ # Also alias the signed one here
277
+ type_names['signed long long'] = TYPE_LONG_LONG
278
+ # C99 stdint exact width types
279
+ type_names['int8_t'] = TYPE_INT8
280
+ type_names['uint8_t'] = TYPE_UINT8
281
+ type_names['int16_t'] = TYPE_INT16
282
+ type_names['uint16_t'] = TYPE_UINT16
283
+ type_names['int32_t'] = TYPE_INT32
284
+ type_names['uint32_t'] = TYPE_UINT32
285
+ type_names['int64_t'] = TYPE_INT64
286
+ type_names['uint64_t'] = TYPE_UINT64
287
+
288
+ # A few additional GLib type aliases
289
+ type_names['guchar'] = TYPE_UINT8
290
+ type_names['gchararray'] = TYPE_STRING
291
+ type_names['gchar*'] = TYPE_STRING
292
+ type_names['goffset'] = TYPE_INT64
293
+ type_names['gunichar2'] = TYPE_UINT16
294
+ type_names['gsize'] = TYPE_SIZE
295
+ type_names['gssize'] = TYPE_SSIZE
296
+ type_names['gintptr'] = TYPE_INTPTR
297
+ type_names['guintptr'] = TYPE_UINTPTR
298
+ type_names['gconstpointer'] = TYPE_ANY
299
+
300
+ # We used to support these; continue to do so
301
+ type_names['any'] = TYPE_ANY
302
+ type_names['boolean'] = TYPE_BOOLEAN
303
+ type_names['uint'] = TYPE_UINT
304
+ type_names['ulong'] = TYPE_ULONG
305
+
306
+ # C stdio, used in GLib public headers; squash this for now here
307
+ # until we move scanning into GLib and can (skip)
308
+ type_names['FILE*'] = TYPE_ANY
309
+
310
+ # One off C unix type definitions; note some of these may be GNU Libc
311
+ # specific. If someone is actually bitten by this, feel free to do
312
+ # the required configure goop to determine their size and replace
313
+ # here.
314
+ #
315
+ # We don't want to encourage people to use these in their APIs because
316
+ # they compromise the platform-independence that GLib gives you.
317
+ # These are here mostly to avoid blowing when random platform-specific
318
+ # methods are added under #ifdefs inside GLib itself. We could just (skip)
319
+ # the relevant methods, but on the other hand, since these types are just
320
+ # integers it's easy enough to expand them.
321
+ type_names['size_t'] = type_names['gsize']
322
+ type_names['time_t'] = TYPE_LONG
323
+ type_names['off_t'] = type_names['gsize']
324
+ type_names['pid_t'] = TYPE_INT
325
+ type_names['uid_t'] = TYPE_UINT
326
+ type_names['gid_t'] = TYPE_UINT
327
+ type_names['dev_t'] = TYPE_INT
328
+ type_names['socklen_t'] = TYPE_INT32
329
+ type_names['size_t'] = TYPE_ULONG
330
+ type_names['ssize_t'] = TYPE_LONG
331
+
332
+ # Obj-C
333
+ type_names['id'] = TYPE_ANY
334
+
335
+ ##
336
+ ## Parameters
337
+ ##
338
+
339
+ PARAM_DIRECTION_IN = 'in'
340
+ PARAM_DIRECTION_OUT = 'out'
341
+ PARAM_DIRECTION_INOUT = 'inout'
342
+
343
+ PARAM_SCOPE_CALL = 'call'
344
+ PARAM_SCOPE_ASYNC = 'async'
345
+ PARAM_SCOPE_NOTIFIED = 'notified'
346
+
347
+ PARAM_TRANSFER_NONE = 'none'
348
+ PARAM_TRANSFER_CONTAINER = 'container'
349
+ PARAM_TRANSFER_FULL = 'full'
350
+
351
+ SIGNAL_FIRST = 'first'
352
+ SIGNAL_LAST = 'last'
353
+ SIGNAL_CLEANUP = 'cleanup'
354
+ SIGNAL_MUST_COLLECT = 'must-collect'
355
+
356
+
357
+ class Namespace(object):
358
+ def __init__(self, name, version, identifier_prefixes=None, symbol_prefixes=None):
359
+ self.name = name
360
+ self.version = version
361
+ if identifier_prefixes is not None:
362
+ self.identifier_prefixes = identifier_prefixes
363
+ else:
364
+ self.identifier_prefixes = [name]
365
+ if symbol_prefixes is not None:
366
+ self.symbol_prefixes = symbol_prefixes
367
+ else:
368
+ ps = self.identifier_prefixes
369
+ self.symbol_prefixes = [to_underscores(p).lower() for p in ps]
370
+ # cache upper-cased versions
371
+ self._ucase_symbol_prefixes = [p.upper() for p in self.symbol_prefixes]
372
+ self.names = OrderedDict() # Maps from GIName -> node
373
+ self.aliases = {} # Maps from GIName -> GIName
374
+ self.type_names = {} # Maps from GTName -> node
375
+ self.ctypes = {} # Maps from CType -> node
376
+ self.symbols = {} # Maps from function symbols -> Function
377
+ self.includes = set() # Include
378
+ self.shared_libraries = [] # str
379
+ self.c_includes = [] # str
380
+ self.exported_packages = [] # str
381
+
382
+ def type_from_name(self, name, ctype=None):
383
+ """Backwards compatibility method for older .gir files, which
384
+ only use the 'name' attribute. If name refers to a fundamental type,
385
+ create a Type object referncing it. If name is already a
386
+ fully-qualified GIName like 'Foo.Bar', returns a Type targeting it .
387
+ Otherwise a Type targeting name qualififed with the namespace name is
388
+ returned."""
389
+ if name in type_names:
390
+ return Type(target_fundamental=name, ctype=ctype)
391
+ if '.' in name:
392
+ target = name
393
+ else:
394
+ target = '%s.%s' % (self.name, name)
395
+ return Type(target_giname=target, ctype=ctype)
396
+
397
+ def track(self, node):
398
+ """Doesn't directly append the function to our own namespace,
399
+ but adds it to things like ctypes, symbols, and type_names.
400
+ """
401
+ assert isinstance(node, Node)
402
+ if node.namespace is self:
403
+ return
404
+ assert node.namespace is None
405
+ node.namespace = self
406
+ if isinstance(node, Alias):
407
+ self.aliases[node.name] = node
408
+ elif isinstance(node, Registered) and node.gtype_name is not None:
409
+ self.type_names[node.gtype_name] = node
410
+ elif isinstance(node, Function):
411
+ self.symbols[node.symbol] = node
412
+ if isinstance(node, (Compound, Class, Interface, Boxed)):
413
+ for fn in chain(node.methods, node.static_methods, node.constructors):
414
+ if not isinstance(fn, Function):
415
+ continue
416
+ fn.namespace = self
417
+ self.symbols[fn.symbol] = fn
418
+ if isinstance(node, (Compound, Class, Interface)):
419
+ for f in node.fields:
420
+ f.namespace = self
421
+ if isinstance(node, (Class, Interface)):
422
+ for m in chain(node.signals, node.properties):
423
+ m.namespace = self
424
+ if isinstance(node, (Enum, Bitfield)):
425
+ for fn in node.static_methods:
426
+ if not isinstance(fn, Function):
427
+ continue
428
+ fn.namespace = self
429
+ self.symbols[fn.symbol] = fn
430
+ for member in node.members:
431
+ member.namespace = self
432
+ self.symbols[member.symbol] = member
433
+ if hasattr(node, 'ctype'):
434
+ self.ctypes[node.ctype] = node
435
+
436
+ def append(self, node, replace=False):
437
+ previous = self.names.get(node.name)
438
+ if previous is not None:
439
+ if not replace:
440
+ raise ValueError("Namespace conflict: %r" % (node, ))
441
+ self.remove(previous)
442
+
443
+ self.track(node)
444
+ self.names[node.name] = node
445
+
446
+ def remove(self, node):
447
+ if isinstance(node, Alias):
448
+ del self.aliases[node.name]
449
+ elif isinstance(node, Registered) and node.gtype_name is not None:
450
+ del self.type_names[node.gtype_name]
451
+ if hasattr(node, 'ctype'):
452
+ del self.ctypes[node.ctype]
453
+ if isinstance(node, Function):
454
+ del self.symbols[node.symbol]
455
+ node.namespace = None
456
+ self.names.pop(node.name, None)
457
+
458
+ def float(self, node):
459
+ """Like remove(), but doesn't unset the node's namespace
460
+ back-reference, and it's still possible to look up
461
+ functions via get_by_symbol()."""
462
+ if isinstance(node, Function):
463
+ symbol = node.symbol
464
+ self.remove(node)
465
+ self.symbols[symbol] = node
466
+ node.namespace = self
467
+
468
+ def __iter__(self):
469
+ return iter(self.names)
470
+
471
+ def iteritems(self):
472
+ return self.names.iteritems()
473
+
474
+ def itervalues(self):
475
+ return self.names.itervalues()
476
+
477
+ def get(self, name):
478
+ return self.names.get(name)
479
+
480
+ def get_by_ctype(self, ctype):
481
+ return self.ctypes.get(ctype)
482
+
483
+ def get_by_symbol(self, symbol):
484
+ return self.symbols.get(symbol)
485
+
486
+ def walk(self, callback):
487
+ for node in self.itervalues():
488
+ node.walk(callback, [])
489
+
490
+
491
+ class Include(object):
492
+
493
+ def __init__(self, name, version):
494
+ self.name = name
495
+ self.version = version
496
+
497
+ @classmethod
498
+ def from_string(cls, string):
499
+ return cls(*string.split('-', 1))
500
+
501
+ def __cmp__(self, other):
502
+ namecmp = cmp(self.name, other.name)
503
+ if namecmp != 0:
504
+ return namecmp
505
+ return cmp(self.version, other.version)
506
+
507
+ def __hash__(self):
508
+ return hash(str(self))
509
+
510
+ def __str__(self):
511
+ return '%s-%s' % (self.name, self.version)
512
+
513
+
514
+ class Annotated(object):
515
+ """An object which has a few generic metadata
516
+ properties."""
517
+ def __init__(self):
518
+ self.version = None
519
+ self.version_doc = None
520
+ self.skip = False
521
+ self.introspectable = True
522
+ self.attributes = OrderedDict()
523
+ self.stability = None
524
+ self.stability_doc = None
525
+ self.deprecated = None
526
+ self.deprecated_doc = None
527
+ self.doc = None
528
+
529
+
530
+ class Node(Annotated):
531
+ """A node is a type of object which is uniquely identified by its
532
+ (namespace, name) pair. When combined with a ., this is called a
533
+ GIName. It's possible for nodes to contain or point to other nodes."""
534
+
535
+ c_name = property(lambda self: self.namespace.name + self.name)
536
+ gi_name = property(lambda self: '%s.%s' % (self.namespace.name, self.name))
537
+
538
+ def __init__(self, name=None):
539
+ Annotated.__init__(self)
540
+ self.namespace = None # Should be set later by Namespace.append()
541
+ self.name = name
542
+ self.foreign = False
543
+ self.file_positions = set()
544
+ self._parent = None
545
+
546
+ def _get_parent(self):
547
+ if self._parent is not None:
548
+ return self._parent
549
+ else:
550
+ return self.namespace
551
+
552
+ def _set_parent(self, value):
553
+ self._parent = value
554
+ parent = property(_get_parent, _set_parent)
555
+
556
+ def create_type(self):
557
+ """Create a Type object referencing this node."""
558
+ assert self.namespace is not None
559
+ return Type(target_giname=('%s.%s' % (self.namespace.name, self.name)))
560
+
561
+ def __cmp__(self, other):
562
+ nscmp = cmp(self.namespace, other.namespace)
563
+ if nscmp != 0:
564
+ return nscmp
565
+ return cmp(self.name, other.name)
566
+
567
+ def __repr__(self):
568
+ return '%s(%r)' % (self.__class__.__name__, self.name)
569
+
570
+ def inherit_file_positions(self, node):
571
+ self.file_positions.update(node.file_positions)
572
+
573
+ def add_file_position(self, position):
574
+ self.file_positions.add(position)
575
+
576
+ def add_symbol_reference(self, symbol):
577
+ if symbol.source_filename:
578
+ self.add_file_position(Position(symbol.source_filename, symbol.line))
579
+
580
+ def walk(self, callback, chain):
581
+ res = callback(self, chain)
582
+ assert res in (True, False), "Walk function must return boolean, not %r" % (res, )
583
+ if not res:
584
+ return False
585
+ chain.append(self)
586
+ self._walk(callback, chain)
587
+ chain.pop()
588
+
589
+ def _walk(self, callback, chain):
590
+ pass
591
+
592
+
593
+ class Registered:
594
+ """A node that (possibly) has gtype_name and get_type."""
595
+ def __init__(self, gtype_name, get_type):
596
+ assert (gtype_name is None and get_type is None) or \
597
+ (gtype_name is not None and get_type is not None)
598
+ self.gtype_name = gtype_name
599
+ self.get_type = get_type
600
+
601
+
602
+ class Callable(Node):
603
+
604
+ def __init__(self, name, retval, parameters, throws):
605
+ Node.__init__(self, name)
606
+ self.retval = retval
607
+ self.parameters = parameters
608
+ self.throws = not not throws
609
+ self.instance_parameter = None # Parameter
610
+ self.parent = None # A Class or Interface
611
+
612
+ # Returns all parameters, including the instance parameter
613
+ @property
614
+ def all_parameters(self):
615
+ if self.instance_parameter is not None:
616
+ return [self.instance_parameter] + self.parameters
617
+ else:
618
+ return self.parameters
619
+
620
+ def get_parameter_index(self, name):
621
+ for i, parameter in enumerate(self.parameters):
622
+ if parameter.argname == name:
623
+ return i
624
+ raise ValueError("Unknown argument %s" % (name, ))
625
+
626
+ def get_parameter(self, name):
627
+ for parameter in self.all_parameters:
628
+ if parameter.argname == name:
629
+ return parameter
630
+ raise ValueError("Unknown argument %s" % (name, ))
631
+
632
+
633
+ class Function(Callable):
634
+
635
+ def __init__(self, name, retval, parameters, throws, symbol):
636
+ Callable.__init__(self, name, retval, parameters, throws)
637
+ self.symbol = symbol
638
+ self.is_method = False
639
+ self.is_constructor = False
640
+ self.shadowed_by = None # C symbol string
641
+ self.shadows = None # C symbol string
642
+ self.moved_to = None # namespaced function name string
643
+ self.internal_skipped = False # if True, this func will not be written to GIR
644
+
645
+ def clone(self):
646
+ clone = copy.copy(self)
647
+ # copy the parameters array so a change to self.parameters does not
648
+ # influence clone.parameters.
649
+ clone.parameters = self.parameters[:]
650
+ return clone
651
+
652
+ def is_type_meta_function(self):
653
+ # Named correctly
654
+ if not (self.name.endswith('_get_type') or self.name.endswith('_get_gtype')):
655
+ return False
656
+
657
+ # Doesn't have any parameters
658
+ if self.parameters:
659
+ return False
660
+
661
+ # Returns GType
662
+ rettype = self.retval.type
663
+ if (not rettype.is_equiv(TYPE_GTYPE) and rettype.target_giname != 'Gtk.Type'):
664
+ message.warn("function '%s' returns '%r', not a GType" % (self.name, rettype))
665
+ return False
666
+
667
+ return True
668
+
669
+
670
+ class ErrorQuarkFunction(Function):
671
+
672
+ def __init__(self, name, retval, parameters, throws, symbol, error_domain):
673
+ Function.__init__(self, name, retval, parameters, throws, symbol)
674
+ self.error_domain = error_domain
675
+
676
+
677
+ class VFunction(Callable):
678
+
679
+ def __init__(self, name, retval, parameters, throws):
680
+ Callable.__init__(self, name, retval, parameters, throws)
681
+ self.invoker = None
682
+
683
+ @classmethod
684
+ def from_callback(cls, name, cb):
685
+ obj = cls(name, cb.retval, cb.parameters[1:],
686
+ cb.throws)
687
+ return obj
688
+
689
+
690
+ class Varargs(Type):
691
+
692
+ def __init__(self):
693
+ Type.__init__(self, '<varargs>', target_fundamental='<varargs>')
694
+
695
+
696
+ class Array(Type):
697
+ C = '<c>'
698
+ GLIB_ARRAY = 'GLib.Array'
699
+ GLIB_BYTEARRAY = 'GLib.ByteArray'
700
+ GLIB_PTRARRAY = 'GLib.PtrArray'
701
+
702
+ def __init__(self, array_type, element_type, **kwargs):
703
+ Type.__init__(self, target_fundamental='<array>',
704
+ **kwargs)
705
+ if (array_type is None or array_type == self.C):
706
+ self.array_type = self.C
707
+ else:
708
+ assert array_type in (self.GLIB_ARRAY,
709
+ self.GLIB_BYTEARRAY,
710
+ self.GLIB_PTRARRAY), array_type
711
+ self.array_type = array_type
712
+ assert isinstance(element_type, Type)
713
+ self.element_type = element_type
714
+ self.zeroterminated = True
715
+ self.length_param_name = None
716
+ self.size = None
717
+
718
+ def clone(self):
719
+ arr = Array(self.array_type, self.element_type)
720
+ arr.zeroterminated = self.zeroterminated
721
+ arr.length_param_name = self.length_param_name
722
+ arr.size = self.size
723
+ return arr
724
+
725
+
726
+ class List(Type):
727
+
728
+ def __init__(self, name, element_type, **kwargs):
729
+ Type.__init__(self, target_fundamental='<list>',
730
+ **kwargs)
731
+ self.name = name
732
+ assert isinstance(element_type, Type)
733
+ self.element_type = element_type
734
+
735
+ def clone(self):
736
+ return List(self.name, self.element_type)
737
+
738
+
739
+ class Map(Type):
740
+
741
+ def __init__(self, key_type, value_type, **kwargs):
742
+ Type.__init__(self, target_fundamental='<map>', **kwargs)
743
+ assert isinstance(key_type, Type)
744
+ self.key_type = key_type
745
+ assert isinstance(value_type, Type)
746
+ self.value_type = value_type
747
+
748
+ def clone(self):
749
+ return Map(self.key_type, self.value_type)
750
+
751
+
752
+ class Alias(Node):
753
+
754
+ def __init__(self, name, target, ctype=None):
755
+ Node.__init__(self, name)
756
+ self.target = target
757
+ self.ctype = ctype
758
+
759
+
760
+ class TypeContainer(Annotated):
761
+ """A fundamental base class for Return and Parameter."""
762
+
763
+ def __init__(self, typenode, nullable, transfer):
764
+ Annotated.__init__(self)
765
+ self.type = typenode
766
+ self.nullable = nullable
767
+ if transfer is not None:
768
+ self.transfer = transfer
769
+ elif typenode.is_const:
770
+ self.transfer = PARAM_TRANSFER_NONE
771
+ else:
772
+ self.transfer = None
773
+
774
+
775
+ class Parameter(TypeContainer):
776
+ """An argument to a function."""
777
+
778
+ def __init__(self, argname, typenode, direction=None,
779
+ transfer=None, nullable=False, optional=False,
780
+ allow_none=False, scope=None,
781
+ caller_allocates=False):
782
+ TypeContainer.__init__(self, typenode, nullable, transfer)
783
+ self.argname = argname
784
+ self.direction = direction
785
+ self.optional = optional
786
+
787
+ if allow_none:
788
+ if self.direction == PARAM_DIRECTION_OUT:
789
+ self.optional = True
790
+ else:
791
+ self.nullable = True
792
+
793
+ self.scope = scope
794
+ self.caller_allocates = caller_allocates
795
+ self.closure_name = None
796
+ self.destroy_name = None
797
+
798
+
799
+ class Return(TypeContainer):
800
+ """A return value from a function."""
801
+
802
+ def __init__(self, rtype, nullable=False, transfer=None):
803
+ TypeContainer.__init__(self, rtype, nullable, transfer)
804
+ self.direction = PARAM_DIRECTION_OUT
805
+
806
+
807
+ class Enum(Node, Registered):
808
+
809
+ def __init__(self, name, ctype,
810
+ gtype_name=None,
811
+ get_type=None,
812
+ c_symbol_prefix=None,
813
+ members=None):
814
+ Node.__init__(self, name)
815
+ Registered.__init__(self, gtype_name, get_type)
816
+ self.c_symbol_prefix = c_symbol_prefix
817
+ self.ctype = ctype
818
+ self.members = members
819
+ for member in members:
820
+ member.parent = self
821
+ # Associated error domain name
822
+ self.error_domain = None
823
+ self.static_methods = []
824
+
825
+ def _walk(self, callback, chain):
826
+ for meth in self.static_methods:
827
+ meth.walk(callback, chain)
828
+
829
+
830
+ class Bitfield(Node, Registered):
831
+
832
+ def __init__(self, name, ctype,
833
+ gtype_name=None,
834
+ c_symbol_prefix=None,
835
+ get_type=None,
836
+ members=None):
837
+ Node.__init__(self, name)
838
+ Registered.__init__(self, gtype_name, get_type)
839
+ self.ctype = ctype
840
+ self.c_symbol_prefix = c_symbol_prefix
841
+ self.members = members
842
+ for member in members:
843
+ member.parent = self
844
+ self.static_methods = []
845
+
846
+ def _walk(self, callback, chain):
847
+ for meth in self.static_methods:
848
+ meth.walk(callback, chain)
849
+
850
+
851
+ class Member(Annotated):
852
+
853
+ def __init__(self, name, value, symbol, nick):
854
+ Annotated.__init__(self)
855
+ self.name = name
856
+ self.value = value
857
+ self.symbol = symbol
858
+ self.nick = nick
859
+ self.parent = None
860
+
861
+ def __cmp__(self, other):
862
+ return cmp(self.name, other.name)
863
+
864
+ def __repr__(self):
865
+ return '%s(%r)' % (self.__class__.__name__, self.name)
866
+
867
+
868
+ class Compound(Node, Registered):
869
+ def __init__(self, name,
870
+ ctype=None,
871
+ gtype_name=None,
872
+ get_type=None,
873
+ c_symbol_prefix=None,
874
+ disguised=False,
875
+ tag_name=None):
876
+ Node.__init__(self, name)
877
+ Registered.__init__(self, gtype_name, get_type)
878
+ self.ctype = ctype
879
+ self.methods = []
880
+ self.static_methods = []
881
+ self.fields = []
882
+ self.constructors = []
883
+ self.disguised = disguised
884
+ self.gtype_name = gtype_name
885
+ self.get_type = get_type
886
+ self.c_symbol_prefix = c_symbol_prefix
887
+ self.tag_name = tag_name
888
+
889
+ def add_gtype(self, gtype_name, get_type):
890
+ self.gtype_name = gtype_name
891
+ self.get_type = get_type
892
+ self.namespace.type_names[gtype_name] = self
893
+
894
+ def _walk(self, callback, chain):
895
+ for ctor in self.constructors:
896
+ ctor.walk(callback, chain)
897
+ for func in self.methods:
898
+ func.walk(callback, chain)
899
+ for func in self.static_methods:
900
+ func.walk(callback, chain)
901
+ for field in self.fields:
902
+ if field.anonymous_node is not None:
903
+ field.anonymous_node.walk(callback, chain)
904
+
905
+ def get_field(self, name):
906
+ for field in self.fields:
907
+ if field.name == name:
908
+ return field
909
+ raise ValueError("Unknown field %s" % (name, ))
910
+
911
+ def get_field_index(self, name):
912
+ for i, field in enumerate(self.fields):
913
+ if field.name == name:
914
+ return i
915
+ raise ValueError("Unknown field %s" % (name, ))
916
+
917
+
918
+ class Field(Annotated):
919
+
920
+ def __init__(self, name, typenode, readable, writable, bits=None,
921
+ anonymous_node=None):
922
+ Annotated.__init__(self)
923
+ assert (typenode or anonymous_node)
924
+ self.name = name
925
+ self.type = typenode
926
+ self.readable = readable
927
+ self.writable = writable
928
+ self.bits = bits
929
+ self.anonymous_node = anonymous_node
930
+ self.private = False
931
+ self.namespace = None
932
+ self.parent = None # a compound
933
+
934
+ def __cmp__(self, other):
935
+ return cmp(self.name, other.name)
936
+
937
+ def __repr__(self):
938
+ return '%s(%r)' % (self.__class__.__name__, self.name)
939
+
940
+
941
+ class Record(Compound):
942
+
943
+ def __init__(self, name,
944
+ ctype=None,
945
+ gtype_name=None,
946
+ get_type=None,
947
+ c_symbol_prefix=None,
948
+ disguised=False,
949
+ tag_name=None):
950
+ Compound.__init__(self, name,
951
+ ctype=ctype,
952
+ gtype_name=gtype_name,
953
+ get_type=get_type,
954
+ c_symbol_prefix=c_symbol_prefix,
955
+ disguised=disguised,
956
+ tag_name=tag_name)
957
+ # If non-None, this record defines the FooClass C structure
958
+ # for some Foo GObject (or similar for GInterface)
959
+ self.is_gtype_struct_for = None
960
+
961
+
962
+ class Union(Compound):
963
+
964
+ def __init__(self, name,
965
+ ctype=None,
966
+ gtype_name=None,
967
+ get_type=None,
968
+ c_symbol_prefix=None,
969
+ disguised=False,
970
+ tag_name=None):
971
+ Compound.__init__(self, name,
972
+ ctype=ctype,
973
+ gtype_name=gtype_name,
974
+ get_type=get_type,
975
+ c_symbol_prefix=c_symbol_prefix,
976
+ disguised=disguised,
977
+ tag_name=tag_name)
978
+
979
+
980
+ class Boxed(Node, Registered):
981
+ """A boxed type with no known associated structure/union."""
982
+ def __init__(self, name,
983
+ gtype_name=None,
984
+ get_type=None,
985
+ c_symbol_prefix=None):
986
+ assert gtype_name is not None
987
+ assert get_type is not None
988
+ Node.__init__(self, name)
989
+ Registered.__init__(self, gtype_name, get_type)
990
+ if get_type is not None:
991
+ assert c_symbol_prefix is not None
992
+ self.c_symbol_prefix = c_symbol_prefix
993
+ self.constructors = []
994
+ self.methods = []
995
+ self.static_methods = []
996
+
997
+ def _walk(self, callback, chain):
998
+ for ctor in self.constructors:
999
+ ctor.walk(callback, chain)
1000
+ for meth in self.methods:
1001
+ meth.walk(callback, chain)
1002
+ for meth in self.static_methods:
1003
+ meth.walk(callback, chain)
1004
+
1005
+
1006
+ class Signal(Callable):
1007
+
1008
+ def __init__(self, name, retval, parameters, when=None,
1009
+ no_recurse=False, detailed=False, action=False,
1010
+ no_hooks=False):
1011
+ Callable.__init__(self, name, retval, parameters, False)
1012
+ self.when = when
1013
+ self.no_recurse = no_recurse
1014
+ self.detailed = detailed
1015
+ self.action = action
1016
+ self.no_hooks = no_hooks
1017
+
1018
+
1019
+ class Class(Node, Registered):
1020
+
1021
+ def __init__(self, name, parent_type,
1022
+ ctype=None,
1023
+ gtype_name=None,
1024
+ get_type=None,
1025
+ c_symbol_prefix=None,
1026
+ is_abstract=False):
1027
+ Node.__init__(self, name)
1028
+ Registered.__init__(self, gtype_name, get_type)
1029
+ self.ctype = ctype
1030
+ self.c_symbol_prefix = c_symbol_prefix
1031
+ self.parent_type = parent_type
1032
+ self.fundamental = False
1033
+ self.unref_func = None
1034
+ self.ref_func = None
1035
+ self.set_value_func = None
1036
+ self.get_value_func = None
1037
+ # When we're in the scanner, we keep around a list
1038
+ # of parents so that we can transparently fall back
1039
+ # if there are 'hidden' parents
1040
+ self.parent_chain = []
1041
+ self.glib_type_struct = None
1042
+ self.is_abstract = is_abstract
1043
+ self.methods = []
1044
+ self.virtual_methods = []
1045
+ self.static_methods = []
1046
+ self.interfaces = []
1047
+ self.constructors = []
1048
+ self.properties = []
1049
+ self.fields = []
1050
+ self.signals = []
1051
+
1052
+ def _walk(self, callback, chain):
1053
+ for meth in self.methods:
1054
+ meth.walk(callback, chain)
1055
+ for meth in self.virtual_methods:
1056
+ meth.walk(callback, chain)
1057
+ for meth in self.static_methods:
1058
+ meth.walk(callback, chain)
1059
+ for ctor in self.constructors:
1060
+ ctor.walk(callback, chain)
1061
+ for field in self.fields:
1062
+ if field.anonymous_node:
1063
+ field.anonymous_node.walk(callback, chain)
1064
+ for sig in self.signals:
1065
+ sig.walk(callback, chain)
1066
+ for prop in self.properties:
1067
+ prop.walk(callback, chain)
1068
+
1069
+
1070
+ class Interface(Node, Registered):
1071
+
1072
+ def __init__(self, name, parent_type,
1073
+ ctype=None,
1074
+ gtype_name=None,
1075
+ get_type=None,
1076
+ c_symbol_prefix=None):
1077
+ Node.__init__(self, name)
1078
+ Registered.__init__(self, gtype_name, get_type)
1079
+ self.ctype = ctype
1080
+ self.c_symbol_prefix = c_symbol_prefix
1081
+ self.parent_type = parent_type
1082
+ self.parent_chain = []
1083
+ self.methods = []
1084
+ self.signals = []
1085
+ self.static_methods = []
1086
+ self.virtual_methods = []
1087
+ self.glib_type_struct = None
1088
+ self.properties = []
1089
+ self.fields = []
1090
+ self.prerequisites = []
1091
+ # Not used yet, exists just to avoid an exception in
1092
+ # Namespace.append()
1093
+ self.constructors = []
1094
+
1095
+ def _walk(self, callback, chain):
1096
+ for meth in self.methods:
1097
+ meth.walk(callback, chain)
1098
+ for meth in self.static_methods:
1099
+ meth.walk(callback, chain)
1100
+ for meth in self.virtual_methods:
1101
+ meth.walk(callback, chain)
1102
+ for field in self.fields:
1103
+ if field.anonymous_node:
1104
+ field.anonymous_node.walk(callback, chain)
1105
+ for sig in self.signals:
1106
+ sig.walk(callback, chain)
1107
+
1108
+
1109
+ class Constant(Node):
1110
+
1111
+ def __init__(self, name, value_type, value, ctype):
1112
+ Node.__init__(self, name)
1113
+ self.value_type = value_type
1114
+ self.value = value
1115
+ self.ctype = ctype
1116
+
1117
+
1118
+ class Property(Node):
1119
+
1120
+ def __init__(self, name, typeobj, readable, writable,
1121
+ construct, construct_only, transfer=None):
1122
+ Node.__init__(self, name)
1123
+ self.type = typeobj
1124
+ self.readable = readable
1125
+ self.writable = writable
1126
+ self.construct = construct
1127
+ self.construct_only = construct_only
1128
+ if transfer is None:
1129
+ self.transfer = PARAM_TRANSFER_NONE
1130
+ else:
1131
+ self.transfer = transfer
1132
+ self.parent = None # A Class or Interface
1133
+
1134
+
1135
+ class Callback(Callable):
1136
+
1137
+ def __init__(self, name, retval, parameters, throws, ctype=None):
1138
+ Callable.__init__(self, name, retval, parameters, throws)
1139
+ self.ctype = ctype