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
@@ -0,0 +1,120 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
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.1 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 Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
+
* MA 02110-1301 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "rb-gi-private.h"
|
22
|
+
|
23
|
+
#define RG_TARGET_NAMESPACE rb_cGIConstructorInfo
|
24
|
+
#define SELF(self) RVAL2GI_FUNCTION_INFO(self)
|
25
|
+
|
26
|
+
GType
|
27
|
+
gi_constructor_info_get_type(void)
|
28
|
+
{
|
29
|
+
static GType type = 0;
|
30
|
+
if (type == 0) {
|
31
|
+
type = g_boxed_type_register_static("GIConstructorInfo",
|
32
|
+
(GBoxedCopyFunc)g_base_info_ref,
|
33
|
+
(GBoxedFreeFunc)g_base_info_unref);
|
34
|
+
}
|
35
|
+
return type;
|
36
|
+
}
|
37
|
+
|
38
|
+
static void
|
39
|
+
initialize_receiver(VALUE receiver, GITypeInfo *info, GIArgument *value)
|
40
|
+
{
|
41
|
+
GIBaseInfo *interface_info;
|
42
|
+
GIInfoType interface_type;
|
43
|
+
|
44
|
+
if (g_type_info_get_tag(info) != GI_TYPE_TAG_INTERFACE) {
|
45
|
+
rb_raise(rb_eRuntimeError, "TODO: returned value isn't interface");
|
46
|
+
}
|
47
|
+
|
48
|
+
interface_info = g_type_info_get_interface(info);
|
49
|
+
interface_type = g_base_info_get_type(interface_info);
|
50
|
+
g_base_info_unref(interface_info);
|
51
|
+
switch (interface_type) {
|
52
|
+
case GI_INFO_TYPE_OBJECT:
|
53
|
+
g_object_ref_sink(value->v_pointer);
|
54
|
+
G_INITIALIZE(receiver, value->v_pointer);
|
55
|
+
break;
|
56
|
+
case GI_INFO_TYPE_STRUCT:
|
57
|
+
G_INITIALIZE(receiver, value->v_pointer);
|
58
|
+
break;
|
59
|
+
case GI_INFO_TYPE_INVALID:
|
60
|
+
case GI_INFO_TYPE_FUNCTION:
|
61
|
+
case GI_INFO_TYPE_CALLBACK:
|
62
|
+
case GI_INFO_TYPE_BOXED:
|
63
|
+
case GI_INFO_TYPE_ENUM:
|
64
|
+
case GI_INFO_TYPE_FLAGS:
|
65
|
+
case GI_INFO_TYPE_INTERFACE:
|
66
|
+
case GI_INFO_TYPE_CONSTANT:
|
67
|
+
case GI_INFO_TYPE_INVALID_0:
|
68
|
+
case GI_INFO_TYPE_UNION:
|
69
|
+
case GI_INFO_TYPE_VALUE:
|
70
|
+
case GI_INFO_TYPE_SIGNAL:
|
71
|
+
case GI_INFO_TYPE_VFUNC:
|
72
|
+
case GI_INFO_TYPE_PROPERTY:
|
73
|
+
case GI_INFO_TYPE_FIELD:
|
74
|
+
case GI_INFO_TYPE_ARG:
|
75
|
+
case GI_INFO_TYPE_TYPE:
|
76
|
+
case GI_INFO_TYPE_UNRESOLVED:
|
77
|
+
default:
|
78
|
+
rb_raise(rb_eRuntimeError,
|
79
|
+
"TODO: returned value isn't object or struct");
|
80
|
+
break;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
static VALUE
|
85
|
+
rg_invoke(int argc, VALUE *argv, VALUE self)
|
86
|
+
{
|
87
|
+
GIFunctionInfo *info;
|
88
|
+
GICallableInfo *callable_info;
|
89
|
+
VALUE receiver;
|
90
|
+
GIArgument return_value;
|
91
|
+
GITypeInfo return_value_info;
|
92
|
+
|
93
|
+
info = SELF(self);
|
94
|
+
callable_info = (GICallableInfo *)info;
|
95
|
+
|
96
|
+
/* TODO: check argc. */
|
97
|
+
receiver = argv[0];
|
98
|
+
/* TODO: use rb_protect */
|
99
|
+
rb_gi_function_info_invoke_raw(info, NULL,
|
100
|
+
argc - 1, argv + 1,
|
101
|
+
&return_value);
|
102
|
+
|
103
|
+
g_callable_info_load_return_type(callable_info, &return_value_info);
|
104
|
+
initialize_receiver(receiver, &return_value_info, &return_value);
|
105
|
+
|
106
|
+
return receiver;
|
107
|
+
}
|
108
|
+
|
109
|
+
void
|
110
|
+
rb_gi_constructor_info_init(VALUE rb_mGI, VALUE rb_cGIFunctionInfo)
|
111
|
+
{
|
112
|
+
VALUE RG_TARGET_NAMESPACE;
|
113
|
+
|
114
|
+
RG_TARGET_NAMESPACE =
|
115
|
+
G_DEF_CLASS_WITH_PARENT(GI_TYPE_CONSTRUCTOR_INFO,
|
116
|
+
"ConstructorInfo", rb_mGI,
|
117
|
+
rb_cGIFunctionInfo);
|
118
|
+
|
119
|
+
RG_DEF_METHOD(invoke, -1);
|
120
|
+
}
|
@@ -0,0 +1,116 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
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.1 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 Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
+
* MA 02110-1301 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#ifndef RB_GI_CONVERSIONS_H
|
22
|
+
#define RB_GI_CONVERSIONS_H
|
23
|
+
|
24
|
+
#define RVAL2GI_REPOSITORY(rb_object) (G_IREPOSITORY(RVAL2GOBJ(rb_object)))
|
25
|
+
#define RVAL2GI_REPOSITORY_LOAD_FLAGS(rb_flags) \
|
26
|
+
(RVAL2GFLAGS(rb_flags, G_TYPE_I_REPOSITORY_LOAD_FLAGS))
|
27
|
+
|
28
|
+
#define GI_BASE_INFO2RVAL(info) \
|
29
|
+
(rb_gi_base_info_to_ruby((GIBaseInfo *)(info)))
|
30
|
+
#define GI_BASE_INFO2RVAL_WITH_UNREF(info) \
|
31
|
+
(rb_gi_base_info_to_ruby_with_unref((GIBaseInfo *)(info)))
|
32
|
+
#define RVAL2GI_BASE_INFO(rb_object) (rb_gi_base_info_from_ruby(rb_object))
|
33
|
+
|
34
|
+
#define GI_ARGUMENT2RVAL(argument, type_info) \
|
35
|
+
(rb_gi_argument_to_ruby((argument), (type_info)))
|
36
|
+
#define GI_OUT_ARGUMENT2RVAL(argument, arg_info) \
|
37
|
+
(rb_gi_out_argument_to_ruby((argument), (arg_info)))
|
38
|
+
#define GI_RETURN_ARGUMENT2RVAL(argument, callable_info) \
|
39
|
+
(rb_gi_return_argument_to_ruby((argument), (callable_info)))
|
40
|
+
#define RVAL2GI_IN_ARGUMENT(argument, type_info, rb_argument) \
|
41
|
+
(rb_gi_in_argument_from_ruby((argument), (type_info), (rb_argument)))
|
42
|
+
#define RVAL2GI_CALL_ARGUMENT(argument, arg_info, rb_argument) \
|
43
|
+
(rb_gi_call_argument_from_ruby((argument), (arg_info), (rb_argument)))
|
44
|
+
|
45
|
+
|
46
|
+
#define RVAL2GI_REGISTERED_TYPE_INFO(rb_object) \
|
47
|
+
((GIRegisteredTypeInfo *)RVAL2GI_BASE_INFO(rb_object))
|
48
|
+
#define RVAL2GI_FUNCTION_INFO(rb_object) \
|
49
|
+
((GIFunctionInfo *)RVAL2GI_BASE_INFO(rb_object))
|
50
|
+
#define RVAL2GI_STRUCT_INFO(rb_object) \
|
51
|
+
((GIStructInfo *)RVAL2GI_BASE_INFO(rb_object))
|
52
|
+
#define RVAL2GI_ENUM_INFO(rb_object) \
|
53
|
+
((GIEnumInfo *)RVAL2GI_BASE_INFO(rb_object))
|
54
|
+
#define RVAL2GI_OBJECT_INFO(rb_object) \
|
55
|
+
((GIObjectInfo *)RVAL2GI_BASE_INFO(rb_object))
|
56
|
+
#define RVAL2GI_INTERFACE_INFO(rb_object) \
|
57
|
+
((GIInterfaceInfo *)RVAL2GI_BASE_INFO(rb_object))
|
58
|
+
#define RVAL2GI_CONSTANT_INFO(rb_object) \
|
59
|
+
((GIConstantInfo *)RVAL2GI_BASE_INFO(rb_object))
|
60
|
+
#define RVAL2GI_UNION_INFO(rb_object) \
|
61
|
+
((GIUnionInfo *)RVAL2GI_BASE_INFO(rb_object))
|
62
|
+
#define RVAL2GI_VALUE_INFO(rb_object) \
|
63
|
+
((GIValueInfo *)RVAL2GI_BASE_INFO(rb_object))
|
64
|
+
#define RVAL2GI_ARG_INFO(rb_object) \
|
65
|
+
((GIArgInfo *)RVAL2GI_BASE_INFO(rb_object))
|
66
|
+
#define RVAL2GI_FIELD_INFO(rb_object) \
|
67
|
+
((GIFieldInfo *)RVAL2GI_BASE_INFO(rb_object))
|
68
|
+
#define RVAL2GI_TYPE_INFO(rb_object) \
|
69
|
+
((GITypeInfo *)RVAL2GI_BASE_INFO(rb_object))
|
70
|
+
|
71
|
+
#define GI_INFO_TYPE2RVAL(type) (GENUM2RVAL(type, G_TYPE_I_INFO_TYPE))
|
72
|
+
#define GI_TRANSFER2RVAL(transfer) (GENUM2RVAL(transfer, G_TYPE_I_TRANSFER))
|
73
|
+
#define GI_DIRECTION2RVAL(direction) (GENUM2RVAL(direction, G_TYPE_I_DIRECTION))
|
74
|
+
#define GI_SCOPE_TYPE2RVAL(scope) (GENUM2RVAL(scope, G_TYPE_I_SCOPE_TYPE))
|
75
|
+
#define RVAL2GI_TYPE_TAG(rb_tag) (RVAL2GENUM(rb_tag, G_TYPE_I_TYPE_TAG))
|
76
|
+
#define GI_TYPE_TAG2RVAL(tag) (GENUM2RVAL(tag, G_TYPE_I_TYPE_TAG))
|
77
|
+
#define GI_ARRAY_TYPE2RVAL(type) (rb_gi_array_type_to_ruby(type))
|
78
|
+
|
79
|
+
#define GI_FUNCTION_INFO_FLAGS2RVAL(tag) \
|
80
|
+
(GFLAGS2RVAL(tag, G_TYPE_I_FUNCTION_INFO_FLAGS))
|
81
|
+
#define GI_SIGNAL_FLAGS2RVAL(tag) \
|
82
|
+
(GFLAGS2RVAL(tag, G_TYPE_SIGNAL_FLAGS))
|
83
|
+
#define GI_VFUNC_INFO_FLAGS2RVAL(tag) \
|
84
|
+
(GFLAGS2RVAL(tag, G_TYPE_IV_FUNC_INFO_FLAGS))
|
85
|
+
#define GI_FIELD_INFO_FLAGS2RVAL(tag) \
|
86
|
+
(GFLAGS2RVAL(tag, G_TYPE_I_FIELD_INFO_FLAGS))
|
87
|
+
|
88
|
+
VALUE rb_gi_base_info_to_ruby (GIBaseInfo *info);
|
89
|
+
VALUE rb_gi_base_info_to_ruby_with_unref(GIBaseInfo *info);
|
90
|
+
GIBaseInfo *rb_gi_base_info_from_ruby (VALUE rb_info);
|
91
|
+
|
92
|
+
VALUE rb_gi_argument_to_ruby (GIArgument *argument,
|
93
|
+
GITypeInfo *type_info);
|
94
|
+
void rb_gi_out_argument_init (GIArgument *argument,
|
95
|
+
GIArgInfo *arg_info);
|
96
|
+
VALUE rb_gi_out_argument_to_ruby (GIArgument *argument,
|
97
|
+
GIArgInfo *arg_info);
|
98
|
+
void rb_gi_out_argument_fin (GIArgument *argument,
|
99
|
+
GIArgInfo *arg_info);
|
100
|
+
VALUE rb_gi_return_argument_to_ruby (GIArgument *argument,
|
101
|
+
GICallableInfo *callable_info);
|
102
|
+
GIArgument *rb_gi_in_argument_from_ruby (GIArgument *argument,
|
103
|
+
GITypeInfo *type_info,
|
104
|
+
VALUE rb_argument);
|
105
|
+
GIArgument *rb_gi_call_argument_from_ruby (GIArgument *argument,
|
106
|
+
GIArgInfo *arg_info,
|
107
|
+
VALUE rb_argument);
|
108
|
+
void rb_gi_in_argument_free (GIArgument *argument,
|
109
|
+
GITypeInfo *type_info);
|
110
|
+
void rb_gi_call_argument_free (GIArgument *argument,
|
111
|
+
GIArgInfo *arg_info);
|
112
|
+
|
113
|
+
VALUE rb_gi_array_type_to_ruby (GIArrayType type);
|
114
|
+
|
115
|
+
#endif
|
116
|
+
|
@@ -0,0 +1,145 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
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.1 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 Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
+
* MA 02110-1301 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "rb-gi-private.h"
|
22
|
+
|
23
|
+
#define RG_TARGET_NAMESPACE rb_cGIEnumInfo
|
24
|
+
#define SELF(self) (RVAL2GI_ENUM_INFO(self))
|
25
|
+
|
26
|
+
GType
|
27
|
+
gi_enum_info_get_type(void)
|
28
|
+
{
|
29
|
+
static GType type = 0;
|
30
|
+
if (type == 0) {
|
31
|
+
type = g_boxed_type_register_static("GIEnumInfo",
|
32
|
+
(GBoxedCopyFunc)g_base_info_ref,
|
33
|
+
(GBoxedFreeFunc)g_base_info_unref);
|
34
|
+
}
|
35
|
+
return type;
|
36
|
+
}
|
37
|
+
|
38
|
+
static VALUE
|
39
|
+
rg_n_values(VALUE self)
|
40
|
+
{
|
41
|
+
GIEnumInfo *info;
|
42
|
+
|
43
|
+
info = SELF(self);
|
44
|
+
return INT2NUM(g_enum_info_get_n_values(info));
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE
|
48
|
+
rg_get_value(VALUE self, VALUE rb_n)
|
49
|
+
{
|
50
|
+
GIEnumInfo *info;
|
51
|
+
gint n;
|
52
|
+
|
53
|
+
info = SELF(self);
|
54
|
+
n = NUM2INT(rb_n);
|
55
|
+
return GI_BASE_INFO2RVAL_WITH_UNREF(g_enum_info_get_value(info, n));
|
56
|
+
}
|
57
|
+
|
58
|
+
static VALUE
|
59
|
+
rg_values(VALUE self)
|
60
|
+
{
|
61
|
+
GIEnumInfo *info;
|
62
|
+
gint i, n;
|
63
|
+
VALUE rb_values;
|
64
|
+
|
65
|
+
info = SELF(self);
|
66
|
+
|
67
|
+
rb_values = rb_ary_new();
|
68
|
+
n = g_enum_info_get_n_values(info);
|
69
|
+
for (i = 0; i < n; i++) {
|
70
|
+
GIValueInfo *value_info;
|
71
|
+
value_info = g_enum_info_get_value(info, i);
|
72
|
+
rb_ary_push(rb_values, GI_BASE_INFO2RVAL_WITH_UNREF(value_info));
|
73
|
+
}
|
74
|
+
|
75
|
+
return rb_values;
|
76
|
+
}
|
77
|
+
|
78
|
+
static VALUE
|
79
|
+
rg_n_methods(VALUE self)
|
80
|
+
{
|
81
|
+
GIEnumInfo *info;
|
82
|
+
|
83
|
+
info = SELF(self);
|
84
|
+
return INT2NUM(g_enum_info_get_n_methods(info));
|
85
|
+
}
|
86
|
+
|
87
|
+
static VALUE
|
88
|
+
rg_get_method(VALUE self, VALUE rb_n)
|
89
|
+
{
|
90
|
+
GIEnumInfo *info;
|
91
|
+
gint n;
|
92
|
+
|
93
|
+
info = SELF(self);
|
94
|
+
n = NUM2INT(rb_n);
|
95
|
+
return GI_BASE_INFO2RVAL_WITH_UNREF(g_enum_info_get_method(info, n));
|
96
|
+
}
|
97
|
+
|
98
|
+
static VALUE
|
99
|
+
rg_methods(VALUE self)
|
100
|
+
{
|
101
|
+
GIEnumInfo *info;
|
102
|
+
gint i, n;
|
103
|
+
VALUE rb_methods;
|
104
|
+
|
105
|
+
info = SELF(self);
|
106
|
+
|
107
|
+
rb_methods = rb_ary_new();
|
108
|
+
n = g_enum_info_get_n_methods(info);
|
109
|
+
for (i = 0; i < n; i++) {
|
110
|
+
GIFunctionInfo *function_info;
|
111
|
+
function_info = g_enum_info_get_method(info, i);
|
112
|
+
rb_ary_push(rb_methods, GI_BASE_INFO2RVAL_WITH_UNREF(function_info));
|
113
|
+
}
|
114
|
+
|
115
|
+
return rb_methods;
|
116
|
+
}
|
117
|
+
|
118
|
+
static VALUE
|
119
|
+
rg_storage_type(VALUE self)
|
120
|
+
{
|
121
|
+
GIEnumInfo *info;
|
122
|
+
|
123
|
+
info = SELF(self);
|
124
|
+
return GI_TYPE_TAG2RVAL(g_enum_info_get_storage_type(info));
|
125
|
+
}
|
126
|
+
|
127
|
+
void
|
128
|
+
rb_gi_enum_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo)
|
129
|
+
{
|
130
|
+
VALUE RG_TARGET_NAMESPACE;
|
131
|
+
|
132
|
+
RG_TARGET_NAMESPACE =
|
133
|
+
G_DEF_CLASS_WITH_PARENT(GI_TYPE_ENUM_INFO, "EnumInfo", rb_mGI,
|
134
|
+
rb_cGIRegisteredTypeInfo);
|
135
|
+
|
136
|
+
RG_DEF_METHOD(n_values, 0);
|
137
|
+
RG_DEF_METHOD(get_value, 1);
|
138
|
+
RG_DEF_METHOD(values, 0);
|
139
|
+
RG_DEF_METHOD(n_methods, 0);
|
140
|
+
RG_DEF_METHOD(get_method, 1);
|
141
|
+
RG_DEF_METHOD(methods, 0);
|
142
|
+
RG_DEF_METHOD(storage_type, 0);
|
143
|
+
|
144
|
+
rb_gi_flags_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
145
|
+
}
|
@@ -0,0 +1,153 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
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.1 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 Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
+
* MA 02110-1301 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "rb-gi-private.h"
|
22
|
+
|
23
|
+
#define RG_TARGET_NAMESPACE rb_cGIFieldInfo
|
24
|
+
#define SELF(self) (RVAL2GI_FIELD_INFO(self))
|
25
|
+
|
26
|
+
GType
|
27
|
+
gi_field_info_get_type(void)
|
28
|
+
{
|
29
|
+
static GType type = 0;
|
30
|
+
if (type == 0) {
|
31
|
+
type = g_boxed_type_register_static("GIFieldInfo",
|
32
|
+
(GBoxedCopyFunc)g_base_info_ref,
|
33
|
+
(GBoxedFreeFunc)g_base_info_unref);
|
34
|
+
}
|
35
|
+
return type;
|
36
|
+
}
|
37
|
+
|
38
|
+
static VALUE
|
39
|
+
rg_flags(VALUE self)
|
40
|
+
{
|
41
|
+
GIFieldInfo *info;
|
42
|
+
|
43
|
+
info = SELF(self);
|
44
|
+
return GI_FIELD_INFO_FLAGS2RVAL(g_field_info_get_flags(info));
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE
|
48
|
+
rg_size(VALUE self)
|
49
|
+
{
|
50
|
+
GIFieldInfo *info;
|
51
|
+
|
52
|
+
info = SELF(self);
|
53
|
+
return INT2NUM(g_field_info_get_size(info));
|
54
|
+
}
|
55
|
+
|
56
|
+
static VALUE
|
57
|
+
rg_offset(VALUE self)
|
58
|
+
{
|
59
|
+
GIFieldInfo *info;
|
60
|
+
|
61
|
+
info = SELF(self);
|
62
|
+
return INT2NUM(g_field_info_get_offset(info));
|
63
|
+
}
|
64
|
+
|
65
|
+
static VALUE
|
66
|
+
rg_type(VALUE self)
|
67
|
+
{
|
68
|
+
GIFieldInfo *info;
|
69
|
+
|
70
|
+
info = SELF(self);
|
71
|
+
return GI_BASE_INFO2RVAL_WITH_UNREF(g_field_info_get_type(info));
|
72
|
+
}
|
73
|
+
|
74
|
+
VALUE
|
75
|
+
rb_gi_field_info_get_field_raw(GIFieldInfo *info, gpointer memory)
|
76
|
+
{
|
77
|
+
GIArgument argument;
|
78
|
+
GITypeInfo *type_info;
|
79
|
+
VALUE rb_field_value;
|
80
|
+
|
81
|
+
if (!g_field_info_get_field(info, memory, &argument)) {
|
82
|
+
rb_raise(rb_eArgError, "failed to get field value");
|
83
|
+
}
|
84
|
+
|
85
|
+
type_info = g_field_info_get_type(info);
|
86
|
+
rb_field_value = GI_ARGUMENT2RVAL(&argument, type_info);
|
87
|
+
g_base_info_unref(type_info);
|
88
|
+
|
89
|
+
return rb_field_value;
|
90
|
+
}
|
91
|
+
|
92
|
+
void
|
93
|
+
rb_gi_field_info_set_field_raw(GIFieldInfo *info, gpointer memory,
|
94
|
+
VALUE rb_field_value)
|
95
|
+
{
|
96
|
+
GIArgument field_value;
|
97
|
+
GITypeInfo *type_info;
|
98
|
+
gboolean succeeded;
|
99
|
+
|
100
|
+
type_info = g_field_info_get_type(info);
|
101
|
+
RVAL2GI_IN_ARGUMENT(&field_value, type_info, rb_field_value);
|
102
|
+
|
103
|
+
succeeded = g_field_info_set_field(info, memory, &field_value);
|
104
|
+
rb_gi_in_argument_free(&field_value, type_info);
|
105
|
+
g_base_info_unref(type_info);
|
106
|
+
|
107
|
+
if (!succeeded) {
|
108
|
+
rb_raise(rb_eArgError, "failed to set field value");
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
static VALUE
|
113
|
+
rg_get_field(VALUE self, VALUE rb_memory)
|
114
|
+
{
|
115
|
+
GIFieldInfo *info;
|
116
|
+
gpointer memory;
|
117
|
+
|
118
|
+
info = SELF(self);
|
119
|
+
memory = GUINT_TO_POINTER(NUM2ULONG(rb_memory));
|
120
|
+
return rb_gi_field_info_get_field_raw(info, memory);
|
121
|
+
}
|
122
|
+
|
123
|
+
static VALUE
|
124
|
+
rg_set_field(VALUE self, VALUE rb_memory, VALUE rb_field_value)
|
125
|
+
{
|
126
|
+
GIFieldInfo *info;
|
127
|
+
gpointer memory;
|
128
|
+
|
129
|
+
info = SELF(self);
|
130
|
+
memory = GUINT_TO_POINTER(NUM2ULONG(rb_memory));
|
131
|
+
rb_gi_field_info_set_field_raw(info, memory, rb_field_value);
|
132
|
+
|
133
|
+
return Qnil;
|
134
|
+
}
|
135
|
+
|
136
|
+
void
|
137
|
+
rb_gi_field_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
|
138
|
+
{
|
139
|
+
VALUE RG_TARGET_NAMESPACE;
|
140
|
+
|
141
|
+
RG_TARGET_NAMESPACE =
|
142
|
+
G_DEF_CLASS_WITH_PARENT(GI_TYPE_FIELD_INFO, "FieldInfo", rb_mGI,
|
143
|
+
rb_cGIBaseInfo);
|
144
|
+
|
145
|
+
RG_DEF_METHOD(flags, 0);
|
146
|
+
RG_DEF_METHOD(size, 0);
|
147
|
+
RG_DEF_METHOD(offset, 0);
|
148
|
+
RG_DEF_METHOD(type, 0);
|
149
|
+
RG_DEF_METHOD(get_field, 1);
|
150
|
+
RG_DEF_METHOD(set_field, 2);
|
151
|
+
|
152
|
+
G_DEF_CLASS(G_TYPE_I_FIELD_INFO_FLAGS, "FieldInfoFlags", rb_mGI);
|
153
|
+
}
|