gobject-introspection 2.0.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +118 -0
- data/ext/gobject-introspection/depend +10 -0
- data/ext/gobject-introspection/extconf.rb +97 -0
- data/ext/gobject-introspection/gobject_introspection.def +5 -0
- data/ext/gobject-introspection/rb-gi-arg-info.c +151 -0
- data/ext/gobject-introspection/rb-gi-argument.c +1015 -0
- data/ext/gobject-introspection/rb-gi-base-info.c +218 -0
- data/ext/gobject-introspection/rb-gi-boxed-info.c +48 -0
- data/ext/gobject-introspection/rb-gi-callable-info.c +104 -0
- data/ext/gobject-introspection/rb-gi-callback-info.c +48 -0
- data/ext/gobject-introspection/rb-gi-constant-info.c +77 -0
- data/ext/gobject-introspection/rb-gi-constructor-info.c +120 -0
- data/ext/gobject-introspection/rb-gi-conversions.h +116 -0
- data/ext/gobject-introspection/rb-gi-enum-info.c +145 -0
- data/ext/gobject-introspection/rb-gi-field-info.c +153 -0
- data/ext/gobject-introspection/rb-gi-flags-info.c +48 -0
- data/ext/gobject-introspection/rb-gi-function-info.c +658 -0
- data/ext/gobject-introspection/rb-gi-interface-info.c +222 -0
- data/ext/gobject-introspection/rb-gi-loader.c +162 -0
- data/ext/gobject-introspection/rb-gi-method-info.c +109 -0
- data/ext/gobject-introspection/rb-gi-object-info.c +345 -0
- data/ext/gobject-introspection/rb-gi-private.h +110 -0
- data/ext/gobject-introspection/rb-gi-property-info.c +77 -0
- data/ext/gobject-introspection/rb-gi-registered-type-info.c +86 -0
- data/ext/gobject-introspection/rb-gi-repository.c +164 -0
- data/ext/gobject-introspection/rb-gi-signal-info.c +77 -0
- data/ext/gobject-introspection/rb-gi-struct-info.c +190 -0
- data/ext/gobject-introspection/rb-gi-type-info.c +143 -0
- data/ext/gobject-introspection/rb-gi-type-tag.c +43 -0
- data/ext/gobject-introspection/rb-gi-types.h +71 -0
- data/ext/gobject-introspection/rb-gi-union-info.c +206 -0
- data/ext/gobject-introspection/rb-gi-unresolved-info.c +48 -0
- data/ext/gobject-introspection/rb-gi-value-info.c +57 -0
- data/ext/gobject-introspection/rb-gi-vfunc-info.c +91 -0
- data/ext/gobject-introspection/rb-gobject-introspection.c +44 -0
- data/ext/gobject-introspection/rb-gobject-introspection.h +57 -0
- data/extconf.rb +71 -0
- data/lib/1.9/gobject_introspection.so +0 -0
- data/lib/2.0/gobject_introspection.so +0 -0
- data/lib/gobject-introspection.rb +52 -0
- data/lib/gobject-introspection/callable-info.rb +91 -0
- data/lib/gobject-introspection/collection-reader.rb +34 -0
- data/lib/gobject-introspection/interface-info.rb +32 -0
- data/lib/gobject-introspection/loader.rb +328 -0
- data/lib/gobject-introspection/object-info.rb +33 -0
- data/lib/gobject-introspection/repository.rb +32 -0
- data/lib/gobject-introspection/struct-info.rb +28 -0
- data/lib/gobject-introspection/union-info.rb +28 -0
- data/test/gobject-introspection-test-utils.rb +26 -0
- data/test/run-test.rb +45 -0
- data/test/test-arg-info.rb +68 -0
- data/test/test-base-info.rb +31 -0
- data/test/test-boxed-info.rb +21 -0
- data/test/test-callable-info.rb +49 -0
- data/test/test-callback-info.rb +29 -0
- data/test/test-constant-info.rb +24 -0
- data/test/test-enum-info.rb +56 -0
- data/test/test-field-type.rb +42 -0
- data/test/test-flags-info.rb +27 -0
- data/test/test-function-info.rb +37 -0
- data/test/test-interface-info.rb +97 -0
- data/test/test-loader.rb +30 -0
- data/test/test-object-info.rb +131 -0
- data/test/test-property-info.rb +38 -0
- data/test/test-registered-type-info.rb +35 -0
- data/test/test-repository.rb +59 -0
- data/test/test-signal-info.rb +37 -0
- data/test/test-struct-info.rb +57 -0
- data/test/test-type-info.rb +62 -0
- data/test/test-type-tag.rb +29 -0
- data/test/test-union-info.rb +21 -0
- data/test/test-value-info.rb +28 -0
- data/test/test-vfunc-info.rb +42 -0
- data/vendor/local/bin/g-ir-compiler.exe +0 -0
- data/vendor/local/bin/g-ir-generate.exe +0 -0
- data/vendor/local/bin/libgirepository-1.0-1.dll +0 -0
- data/vendor/local/include/gobject-introspection-1.0/giarginfo.h +52 -0
- data/vendor/local/include/gobject-introspection-1.0/gibaseinfo.h +89 -0
- data/vendor/local/include/gobject-introspection-1.0/gicallableinfo.h +74 -0
- data/vendor/local/include/gobject-introspection-1.0/giconstantinfo.h +46 -0
- data/vendor/local/include/gobject-introspection-1.0/gienuminfo.h +56 -0
- data/vendor/local/include/gobject-introspection-1.0/gifieldinfo.h +52 -0
- data/vendor/local/include/gobject-introspection-1.0/gifunctioninfo.h +77 -0
- data/vendor/local/include/gobject-introspection-1.0/giinterfaceinfo.h +68 -0
- data/vendor/local/include/gobject-introspection-1.0/giobjectinfo.h +137 -0
- data/vendor/local/include/gobject-introspection-1.0/gipropertyinfo.h +44 -0
- data/vendor/local/include/gobject-introspection-1.0/giregisteredtypeinfo.h +53 -0
- data/vendor/local/include/gobject-introspection-1.0/girepository.h +179 -0
- data/vendor/local/include/gobject-introspection-1.0/girffi.h +80 -0
- data/vendor/local/include/gobject-introspection-1.0/gisignalinfo.h +45 -0
- data/vendor/local/include/gobject-introspection-1.0/gistructinfo.h +53 -0
- data/vendor/local/include/gobject-introspection-1.0/gitypeinfo.h +56 -0
- data/vendor/local/include/gobject-introspection-1.0/gitypelib.h +55 -0
- data/vendor/local/include/gobject-introspection-1.0/gitypes.h +453 -0
- data/vendor/local/include/gobject-introspection-1.0/giunioninfo.h +57 -0
- data/vendor/local/include/gobject-introspection-1.0/givfuncinfo.h +56 -0
- data/vendor/local/lib/girepository-1.0/DBus-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/DBusGLib-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GIRepository-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GL-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GLib-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GModule-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GObject-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/Gio-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/cairo-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/fontconfig-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/freetype2-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/libxml2-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/xfixes-4.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/xft-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/xlib-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/xrandr-1.3.typelib +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.py +24 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.py +74 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.py +1204 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.py +1100 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.py +196 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.py +140 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.py +60 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/class.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/constructor.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/default.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/enum.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/function.tmpl +61 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/method.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/namespace.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/property.tmpl +5 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/record.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/signal.tmpl +5 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/C/vfunc.tmpl +4 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/class.tmpl +18 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/constructor.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/default.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/enum.tmpl +13 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/function.tmpl +48 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/method.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/namespace.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/property.tmpl +10 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/record.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/signal.tmpl +37 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Gjs/vfunc.tmpl +27 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/class.tmpl +17 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/constructor.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/default.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/enum.tmpl +13 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/function.tmpl +53 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/method.tmpl +1 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/namespace.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/property.tmpl +10 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/record.tmpl +2 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/signal.tmpl +42 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/Python/vfunc.tmpl +33 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/base.tmpl +29 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/class.tmpl +40 -0
- data/vendor/local/lib/gobject-introspection/giscanner/doctemplates/namespace.tmpl +19 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.py +635 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.py +363 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.py +551 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.py +581 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.py +584 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.py +236 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.py +76 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.py +1337 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.py +185 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/odict.py +50 -0
- data/vendor/local/lib/gobject-introspection/giscanner/odict.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/odict.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.py +497 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.py +78 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.py +132 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.py +324 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.py +119 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.py +999 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.py +141 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.py +197 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyo +0 -0
- data/vendor/local/lib/libgirepository-1.0.a +0 -0
- data/vendor/local/lib/libgirepository-1.0.dll.a +0 -0
- data/vendor/local/lib/libgirepository-1.0.la +41 -0
- data/vendor/local/lib/pkgconfig/gobject-introspection-1.0.pc +26 -0
- data/vendor/local/lib/pkgconfig/gobject-introspection-no-export-1.0.pc +23 -0
- data/vendor/local/share/aclocal/introspection.m4 +96 -0
- data/vendor/local/share/gir-1.0/DBus-1.0.gir +32 -0
- data/vendor/local/share/gir-1.0/DBusGLib-1.0.gir +18 -0
- data/vendor/local/share/gir-1.0/GIRepository-2.0.gir +3833 -0
- data/vendor/local/share/gir-1.0/GL-1.0.gir +31 -0
- data/vendor/local/share/gir-1.0/GLib-2.0.gir +44304 -0
- data/vendor/local/share/gir-1.0/GModule-2.0.gir +184 -0
- data/vendor/local/share/gir-1.0/GObject-2.0.gir +13947 -0
- data/vendor/local/share/gir-1.0/Gio-2.0.gir +73619 -0
- data/vendor/local/share/gir-1.0/cairo-1.0.gir +70 -0
- data/vendor/local/share/gir-1.0/fontconfig-2.0.gir +18 -0
- data/vendor/local/share/gir-1.0/freetype2-2.0.gir +22 -0
- data/vendor/local/share/gir-1.0/libxml2-2.0.gir +25 -0
- data/vendor/local/share/gir-1.0/xfixes-4.0.gir +10 -0
- data/vendor/local/share/gir-1.0/xft-2.0.gir +23 -0
- data/vendor/local/share/gir-1.0/xlib-2.0.gir +67 -0
- data/vendor/local/share/gir-1.0/xrandr-1.3.gir +16 -0
- data/vendor/local/share/gobject-introspection-1.0/Makefile.introspection +166 -0
- data/vendor/local/share/gobject-introspection-1.0/gdump.c +564 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/annotation.c +835 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/annotation.h +198 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/drawable.c +55 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/drawable.h +33 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/everything.c +1473 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/everything.h +428 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/foo.c +790 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/foo.h +437 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.c +5256 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/gimarshallingtests.h +1158 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/regress.c +4009 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/regress.h +944 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/utility.c +45 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/utility.h +95 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.c +33 -0
- data/vendor/local/share/gobject-introspection-1.0/tests/warnlib.h +36 -0
- data/vendor/local/share/license/gobject-introspection/AUTHORS +9 -0
- data/vendor/local/share/license/gobject-introspection/COPYING +12 -0
- data/vendor/local/share/man/man1/g-ir-compiler.1 +51 -0
- data/vendor/local/share/man/man1/g-ir-generate.1 +29 -0
- metadata +343 -0
Binary file
|
Binary file
|
@@ -0,0 +1,196 @@
|
|
1
|
+
# -*- Mode: Python -*-
|
2
|
+
# GObject-Introspection - a framework for introspecting GObject libraries
|
3
|
+
# Copyright (C) 2008-2010 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 errno
|
22
|
+
import cPickle
|
23
|
+
import glob
|
24
|
+
import hashlib
|
25
|
+
import os
|
26
|
+
import shutil
|
27
|
+
import sys
|
28
|
+
import tempfile
|
29
|
+
|
30
|
+
import giscanner
|
31
|
+
|
32
|
+
_CACHE_VERSION_FILENAME = '.cache-version'
|
33
|
+
|
34
|
+
def _get_versionhash():
|
35
|
+
toplevel = os.path.dirname(giscanner.__file__)
|
36
|
+
# Use pyc instead of py to avoid extra IO
|
37
|
+
sources = glob.glob(os.path.join(toplevel, '*.pyc'))
|
38
|
+
sources.append(sys.argv[0])
|
39
|
+
# Using mtimes is a bit (5x) faster than hashing the file contents
|
40
|
+
mtimes = (str(os.stat(source).st_mtime) for source in sources)
|
41
|
+
return hashlib.sha1(''.join(mtimes)).hexdigest()
|
42
|
+
|
43
|
+
def _get_cachedir():
|
44
|
+
if 'GI_SCANNER_DISABLE_CACHE' in os.environ:
|
45
|
+
return None
|
46
|
+
homedir = os.environ.get('HOME')
|
47
|
+
if homedir is None:
|
48
|
+
return None
|
49
|
+
if not os.path.exists(homedir):
|
50
|
+
return None
|
51
|
+
|
52
|
+
cachedir = os.path.join(homedir, '.cache')
|
53
|
+
if not os.path.exists(cachedir):
|
54
|
+
try:
|
55
|
+
os.mkdir(cachedir, 0755)
|
56
|
+
except OSError:
|
57
|
+
return None
|
58
|
+
|
59
|
+
scannerdir = os.path.join(cachedir, 'g-ir-scanner')
|
60
|
+
if not os.path.exists(scannerdir):
|
61
|
+
try:
|
62
|
+
os.mkdir(scannerdir, 0755)
|
63
|
+
except OSError:
|
64
|
+
return None
|
65
|
+
# If it exists and is a file, don't cache at all
|
66
|
+
elif not os.path.isdir(scannerdir):
|
67
|
+
return None
|
68
|
+
return scannerdir
|
69
|
+
|
70
|
+
|
71
|
+
class CacheStore(object):
|
72
|
+
|
73
|
+
def __init__(self):
|
74
|
+
try:
|
75
|
+
self._directory = _get_cachedir()
|
76
|
+
except OSError, e:
|
77
|
+
if e.errno != errno.EPERM:
|
78
|
+
raise
|
79
|
+
self._directory = None
|
80
|
+
|
81
|
+
self._check_cache_version()
|
82
|
+
|
83
|
+
def _check_cache_version(self):
|
84
|
+
if self._directory is None:
|
85
|
+
return
|
86
|
+
|
87
|
+
current_hash = _get_versionhash()
|
88
|
+
version = os.path.join(self._directory, _CACHE_VERSION_FILENAME)
|
89
|
+
try:
|
90
|
+
cache_hash = open(version).read()
|
91
|
+
except IOError, e:
|
92
|
+
# File does not exist
|
93
|
+
if e.errno == errno.ENOENT:
|
94
|
+
cache_hash = 0
|
95
|
+
else:
|
96
|
+
raise
|
97
|
+
|
98
|
+
if current_hash == cache_hash:
|
99
|
+
return
|
100
|
+
|
101
|
+
self._clean()
|
102
|
+
try:
|
103
|
+
fp = open(version, 'w')
|
104
|
+
except IOError, e:
|
105
|
+
# Permission denied
|
106
|
+
if e.errno == errno.EACCES:
|
107
|
+
return
|
108
|
+
else:
|
109
|
+
raise
|
110
|
+
|
111
|
+
fp.write(current_hash)
|
112
|
+
|
113
|
+
def _get_filename(self, filename):
|
114
|
+
# If we couldn't create the directory we're probably
|
115
|
+
# on a read only home directory where we just disable
|
116
|
+
# the cache all together.
|
117
|
+
if self._directory is None:
|
118
|
+
return
|
119
|
+
hexdigest = hashlib.sha1(filename).hexdigest()
|
120
|
+
return os.path.join(self._directory, hexdigest)
|
121
|
+
|
122
|
+
def _cache_is_valid(self, store_filename, filename):
|
123
|
+
return (os.stat(store_filename).st_mtime >=
|
124
|
+
os.stat(filename).st_mtime)
|
125
|
+
|
126
|
+
def _remove_filename(self, filename):
|
127
|
+
try:
|
128
|
+
os.unlink(filename)
|
129
|
+
except IOError, e:
|
130
|
+
# Permission denied
|
131
|
+
if e.errno == errno.EACCES:
|
132
|
+
return
|
133
|
+
else:
|
134
|
+
raise
|
135
|
+
except OSError, e:
|
136
|
+
# File does not exist
|
137
|
+
if e.errno == errno.ENOENT:
|
138
|
+
return
|
139
|
+
else:
|
140
|
+
raise
|
141
|
+
|
142
|
+
def _clean(self):
|
143
|
+
for filename in os.listdir(self._directory):
|
144
|
+
if filename == _CACHE_VERSION_FILENAME:
|
145
|
+
continue
|
146
|
+
self._remove_filename(os.path.join(self._directory, filename))
|
147
|
+
|
148
|
+
def store(self, filename, data):
|
149
|
+
store_filename = self._get_filename(filename)
|
150
|
+
if store_filename is None:
|
151
|
+
return
|
152
|
+
|
153
|
+
if (os.path.exists(store_filename) and
|
154
|
+
self._cache_is_valid(store_filename, filename)):
|
155
|
+
return None
|
156
|
+
|
157
|
+
tmp_fd, tmp_filename = tempfile.mkstemp(prefix='g-ir-scanner-cache-')
|
158
|
+
try:
|
159
|
+
cPickle.dump(data, os.fdopen(tmp_fd, 'w'))
|
160
|
+
except IOError, e:
|
161
|
+
# No space left on device
|
162
|
+
if e.errno == errno.ENOSPC:
|
163
|
+
self._remove_filename(tmp_filename)
|
164
|
+
return
|
165
|
+
else:
|
166
|
+
raise
|
167
|
+
|
168
|
+
try:
|
169
|
+
shutil.move(tmp_filename, store_filename)
|
170
|
+
except IOError, e:
|
171
|
+
# Permission denied
|
172
|
+
if e.errno == errno.EACCES:
|
173
|
+
self._remove_filename(tmp_filename)
|
174
|
+
else:
|
175
|
+
raise
|
176
|
+
|
177
|
+
def load(self, filename):
|
178
|
+
store_filename = self._get_filename(filename)
|
179
|
+
if store_filename is None:
|
180
|
+
return
|
181
|
+
try:
|
182
|
+
fd = open(store_filename)
|
183
|
+
except IOError, e:
|
184
|
+
if e.errno == errno.ENOENT:
|
185
|
+
return None
|
186
|
+
else:
|
187
|
+
raise
|
188
|
+
if not self._cache_is_valid(store_filename, filename):
|
189
|
+
return None
|
190
|
+
try:
|
191
|
+
data = cPickle.load(fd)
|
192
|
+
except (AttributeError, EOFError, ValueError, cPickle.BadPickleGet):
|
193
|
+
# Broken cache entry, remove it
|
194
|
+
self._remove_filename(store_filename)
|
195
|
+
data = None
|
196
|
+
return data
|
Binary file
|
Binary file
|
@@ -0,0 +1,140 @@
|
|
1
|
+
# -*- Mode: Python -*-
|
2
|
+
# GObject-Introspection - a framework for introspecting GObject libraries
|
3
|
+
# Copyright (C) 2010 Red Hat, Inc.
|
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
|
+
from contextlib import contextmanager
|
24
|
+
|
25
|
+
from . import ast
|
26
|
+
|
27
|
+
class CCodeGenerator(object):
|
28
|
+
def __init__(self, namespace, out_h_filename, out_c_filename):
|
29
|
+
self.out_h_filename = out_h_filename
|
30
|
+
self.out_c_filename = out_c_filename
|
31
|
+
self._function_bodies = {}
|
32
|
+
self.namespace = namespace
|
33
|
+
|
34
|
+
def gen_symbol(self, name):
|
35
|
+
name = name.replace(' ', '_')
|
36
|
+
return '%s_%s' % (self.namespace.symbol_prefixes[0], name)
|
37
|
+
|
38
|
+
def _typecontainer_to_ctype(self, param):
|
39
|
+
if (isinstance(param, ast.Parameter) and
|
40
|
+
param.direction in (ast.PARAM_DIRECTION_OUT,
|
41
|
+
ast.PARAM_DIRECTION_INOUT)):
|
42
|
+
suffix = '*'
|
43
|
+
else:
|
44
|
+
suffix = ''
|
45
|
+
if (param.type.is_equiv((ast.TYPE_STRING, ast.TYPE_FILENAME)) and
|
46
|
+
param.transfer == ast.PARAM_TRANSFER_NONE):
|
47
|
+
return "const gchar*" + suffix
|
48
|
+
return param.type.ctype + suffix
|
49
|
+
|
50
|
+
def _write_prelude(self, out, func):
|
51
|
+
out.write("""
|
52
|
+
%s
|
53
|
+
%s (""" % (self._typecontainer_to_ctype(func.retval), func.symbol))
|
54
|
+
l = len(func.parameters)
|
55
|
+
if func.parameters:
|
56
|
+
for i, param in enumerate(func.parameters):
|
57
|
+
ctype = self._typecontainer_to_ctype(param)
|
58
|
+
out.write('%s %s' % (ctype, param.argname))
|
59
|
+
if i < l - 1:
|
60
|
+
out.write(", ")
|
61
|
+
else:
|
62
|
+
out.write('void')
|
63
|
+
out.write(")")
|
64
|
+
|
65
|
+
def _write_prototype(self, func):
|
66
|
+
self._write_prelude(self.out_h, func)
|
67
|
+
self.out_h.write(";\n\n")
|
68
|
+
|
69
|
+
def _write_annotation_transfer(self, transfer):
|
70
|
+
self.out_c.write("(transfer %s)" % (transfer, ))
|
71
|
+
|
72
|
+
def _write_docs(self, func):
|
73
|
+
self.out_c.write("/**\n * %s:\n" % (func.symbol, ))
|
74
|
+
for param in func.parameters:
|
75
|
+
self.out_c.write(" * @%s: " % (param.argname, ))
|
76
|
+
if param.direction in (ast.PARAM_DIRECTION_OUT,
|
77
|
+
ast.PARAM_DIRECTION_INOUT):
|
78
|
+
if param.caller_allocates:
|
79
|
+
allocate_string = ' caller-allocates'
|
80
|
+
else:
|
81
|
+
allocate_string = ''
|
82
|
+
self.out_c.write("(%s%s) " % (param.direction,
|
83
|
+
allocate_string))
|
84
|
+
self._write_annotation_transfer(param.transfer)
|
85
|
+
self.out_c.write(":\n")
|
86
|
+
self.out_c.write(' *\n')
|
87
|
+
self.out_c.write(' * Undocumented.\n')
|
88
|
+
self.out_c.write(' *\n')
|
89
|
+
self.out_c.write(' * Returns: ')
|
90
|
+
self._write_annotation_transfer(func.retval.transfer)
|
91
|
+
self.out_c.write('\n */')
|
92
|
+
|
93
|
+
@contextmanager
|
94
|
+
def _function(self, func):
|
95
|
+
self._write_prototype(func)
|
96
|
+
self._write_docs(func)
|
97
|
+
self._write_prelude(self.out_c, func)
|
98
|
+
self.out_c.write("\n{\n")
|
99
|
+
yield
|
100
|
+
self.out_c.write("}\n\n")
|
101
|
+
|
102
|
+
def _codegen_start(self):
|
103
|
+
warning = '/* GENERATED BY testcodegen.py; DO NOT EDIT */\n\n'
|
104
|
+
self.out_h.write(warning)
|
105
|
+
nsupper = self.namespace.name.upper()
|
106
|
+
self.out_h.write("""
|
107
|
+
#ifndef __%s_H__
|
108
|
+
#define __%s_H__
|
109
|
+
|
110
|
+
#include <glib-object.h>
|
111
|
+
""" % (nsupper, nsupper))
|
112
|
+
|
113
|
+
self.out_c.write(warning)
|
114
|
+
self.out_c.write("""#include "%s"\n\n""" % (self.out_h_filename, ))
|
115
|
+
|
116
|
+
def _codegen_end(self):
|
117
|
+
self.out_h.write("""#endif\n""")
|
118
|
+
|
119
|
+
self.out_h.close()
|
120
|
+
self.out_c.close()
|
121
|
+
|
122
|
+
def set_function_body(self, node, body):
|
123
|
+
assert isinstance(node, ast.Function)
|
124
|
+
self._function_bodies[node] = body
|
125
|
+
|
126
|
+
def codegen(self):
|
127
|
+
self.out_h = open(self.out_h_filename, 'w')
|
128
|
+
self.out_c = open(self.out_c_filename, 'w')
|
129
|
+
|
130
|
+
self._codegen_start()
|
131
|
+
|
132
|
+
for node in self.namespace.itervalues():
|
133
|
+
if isinstance(node, ast.Function):
|
134
|
+
with self._function(node):
|
135
|
+
body = self._function_bodies.get(node)
|
136
|
+
if not body:
|
137
|
+
body = ''
|
138
|
+
self.out_c.write(body)
|
139
|
+
|
140
|
+
self._codegen_end()
|
Binary file
|
Binary file
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# -*- Mode: Python -*-
|
2
|
+
# GObject-Introspection - a framework for introspecting GObject libraries
|
3
|
+
# Copyright (C) 2008-2011 Johan Dahlin
|
4
|
+
#
|
5
|
+
# This program is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU General Public License
|
7
|
+
# as published by the Free Software Foundation; either version 2
|
8
|
+
# of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This program 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
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with this program; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
18
|
+
# 02110-1301, USA.
|
19
|
+
#
|
20
|
+
|
21
|
+
import os
|
22
|
+
import optparse
|
23
|
+
|
24
|
+
from .docwriter import DocWriter
|
25
|
+
from .transformer import Transformer
|
26
|
+
|
27
|
+
def doc_main(args):
|
28
|
+
parser = optparse.OptionParser('%prog [options] GIR-file')
|
29
|
+
|
30
|
+
parser.add_option("-o", "--output",
|
31
|
+
action="store", dest="output",
|
32
|
+
help="Directory to write output to")
|
33
|
+
parser.add_option("-l", "--language",
|
34
|
+
action="store", dest="language",
|
35
|
+
default="c",
|
36
|
+
help="Output language")
|
37
|
+
parser.add_option("", "--add-include-path",
|
38
|
+
action="append", dest="include_paths", default=[],
|
39
|
+
help="include paths for other GIR files")
|
40
|
+
|
41
|
+
options, args = parser.parse_args(args)
|
42
|
+
if not options.output:
|
43
|
+
raise SystemExit("missing output parameter")
|
44
|
+
|
45
|
+
if len(args) < 2:
|
46
|
+
raise SystemExit("Need an input GIR filename")
|
47
|
+
|
48
|
+
if 'UNINSTALLED_INTROSPECTION_SRCDIR' in os.environ:
|
49
|
+
top_srcdir = os.environ['UNINSTALLED_INTROSPECTION_SRCDIR']
|
50
|
+
top_builddir = os.environ['UNINSTALLED_INTROSPECTION_BUILDDIR']
|
51
|
+
extra_include_dirs = [os.path.join(top_srcdir, 'gir'), top_builddir]
|
52
|
+
else:
|
53
|
+
extra_include_dirs = []
|
54
|
+
extra_include_dirs.extend(options.include_paths)
|
55
|
+
transformer = Transformer.parse_from_gir(args[1], extra_include_dirs)
|
56
|
+
|
57
|
+
writer = DocWriter(transformer, options.language)
|
58
|
+
writer.write(options.output)
|
59
|
+
|
60
|
+
return 0
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<%inherit file="./function.tmpl"/>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%inherit file="/base.tmpl"/>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<%inherit file="/base.tmpl"/>
|
2
|
+
<%block name="info">
|
3
|
+
${formatter.format_xref(node.parent, type="guide", group=page_kind)}
|
4
|
+
<api:function>
|
5
|
+
<api:returns>
|
6
|
+
<api:type>${formatter.format_type(node.retval.type) | x}</api:type>
|
7
|
+
</api:returns>
|
8
|
+
<api:name>${formatter.format_function_name(node)}</api:name>
|
9
|
+
% for arg in formatter.get_parameters(node):
|
10
|
+
% if arg.type.ctype == '<varargs>':
|
11
|
+
<api:varargs/>
|
12
|
+
% else:
|
13
|
+
<api:arg>
|
14
|
+
<api:type>${formatter.format_type(arg.type) | x}</api:type>
|
15
|
+
<api:name>${formatter.format_parameter_name(node, arg)}</api:name>
|
16
|
+
</api:arg>
|
17
|
+
% endif
|
18
|
+
% endfor
|
19
|
+
</api:function>
|
20
|
+
</%block>
|
21
|
+
<%block name="synopsis">
|
22
|
+
<synopsis><code mime="text/x-csrc">
|
23
|
+
${node.retval.type.ctype} ${formatter.format_function_name(node)} (\
|
24
|
+
% if not formatter.get_parameters(node):
|
25
|
+
void\
|
26
|
+
% else:
|
27
|
+
% for ix, arg in enumerate(formatter.get_parameters(node)):
|
28
|
+
% if ix != 0:
|
29
|
+
${' ' * (len(formatter.format_type(node.retval.type)) + len(formatter.format_function_name(node)) + 3)}\
|
30
|
+
% endif
|
31
|
+
% if arg.type.ctype == '<varargs>':
|
32
|
+
...\
|
33
|
+
% else:
|
34
|
+
${formatter.format_type(arg.type) | x} ${arg.argname}\
|
35
|
+
% endif
|
36
|
+
% if ix != len(formatter.get_parameters(node)) - 1:
|
37
|
+
,
|
38
|
+
% endif
|
39
|
+
% endfor
|
40
|
+
% endif
|
41
|
+
);
|
42
|
+
</code></synopsis>
|
43
|
+
</%block>
|
44
|
+
<%block name="details">
|
45
|
+
% if formatter.get_parameters(node) or node.retval:
|
46
|
+
<terms>
|
47
|
+
% for arg in formatter.get_parameters(node):
|
48
|
+
<item>
|
49
|
+
<title><code>${arg.argname}</code></title>
|
50
|
+
${formatter.format(node, arg.doc)}
|
51
|
+
</item>
|
52
|
+
% endfor
|
53
|
+
% if node.retval:
|
54
|
+
<item>
|
55
|
+
<title><code>Returns</code></title>
|
56
|
+
${formatter.format(node, node.retval.doc)}
|
57
|
+
</item>
|
58
|
+
% endif
|
59
|
+
</terms>
|
60
|
+
% endif
|
61
|
+
</%block>
|