Please enter the commit message for your changes. Lines starting
with '' will be ignored, and an empty message aborts the commit. On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: lib/ruby-gtk2-2.0.2/AUTHORS new file: lib/ruby-gtk2-2.0.2/COPYING.LIB new file: lib/ruby-gtk2-2.0.2/NEWS new file: lib/ruby-gtk2-2.0.2/README new file: lib/ruby-gtk2-2.0.2/Rakefile new file: lib/ruby-gtk2-2.0.2/atk/COPYING.LIB new file: lib/ruby-gtk2-2.0.2/atk/README new file: lib/ruby-gtk2-2.0.2/atk/Rakefile new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/atk.def new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/depend new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/extconf.rb new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatk.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatk.h new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkaction.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkcomponent.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkconversions.h new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkdocument.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkeditabletext.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkgobjectaccessible.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkhyperlink.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkhypertext.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkimage.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkimplementor.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatknoopobject.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatknoopobjectfactory.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkobject.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkobjectfactory.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkobjectrole.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkprivate.h new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkregistry.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkrelation.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkrelationset.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkrelationtype.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkselection.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkstate.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkstateset.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkstreamablecontent.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatktable.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatktext.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatktextattribute.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatktextrange.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatktextrectangle.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkutil.c new file: lib/ruby-gtk2-2.0.2/atk/ext/atk/rbatkvalue.c new file: lib/ruby-gtk2-2.0.2/atk/extconf.rb new file: lib/ruby-gtk2-2.0.2/atk/lib/atk.rb new file: lib/ruby-gtk2-2.0.2/atk/test/atk-test-utils.rb new file: lib/ruby-gtk2-2.0.2/atk/test/run-test.rb new file: lib/ruby-gtk2-2.0.2/atk/test/test-text-rectangle.rb new file: lib/ruby-gtk2-2.0.2/exec_make.rb new file: lib/ruby-gtk2-2.0.2/extconf.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/COPYING.LIB new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/README new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/Rakefile new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/depend new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/extconf.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/gdk_pixbuf2.def new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf-format.c new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf-loader.c new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf.c new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf.h new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf2conversions.h new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf2private.h new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbufanimation.c new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbufanimationiter.c new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbufsimpleanim.c new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixdata.c new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/extconf.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/lib/gdk_pixbuf2.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/anim.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/composite.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/flip.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/floppybuddy.gif new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/format.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/gnome-foot.png new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/inline.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/loader.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/pixdata.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/rotate.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/save.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/scale.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/simpleanim.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/utils.rb new file: lib/ruby-gtk2-2.0.2/gdk_pixbuf2/sample/xpm.rb new file: lib/ruby-gtk2-2.0.2/gio2/README new file: lib/ruby-gtk2-2.0.2/gio2/Rakefile new file: lib/ruby-gtk2-2.0.2/gio2/TODO new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/depend new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/extconf.rb new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/gio2.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/gio2.def new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/gio2.h new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio2.h new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio2conversions.h new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio2private.h new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioappinfo.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioapplaunchcontext.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioasyncinitable.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioasyncresult.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiobufferedinputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiobufferedoutputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiocancellable.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiocharsetconverter.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiocontenttype.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioconverter.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioconverterinputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioconverteroutputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodatainputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodataoutputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodesktopappinfo.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodrive.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioemblem.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioemblemedicon.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofile.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattribute.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattributeinfo.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattributeinfolist.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattributematcher.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofiledescriptorbased.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileenumerator.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileicon.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileinfo.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileinputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileiostream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilemonitor.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilenamecompleter.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileoutputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilterinputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilteroutputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioicon.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinetaddress.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinetsocketaddress.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinitable.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioio.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioiomodule.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioiomodules.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioioscheduler.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioioschedulerjob.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioiostream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioloadableicon.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomemoryinputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomemoryoutputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomount.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomountoperation.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgionetworkaddress.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgionetworkservice.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiooutputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioresolver.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioseekable.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosimpleasyncresult.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocket.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketaddress.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketaddressenumerator.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketclient.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketconnectable.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketconnection.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketconnectionfactory.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketcontrolmessage.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketlistener.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketservice.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosrvtarget.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiotcpconnection.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiothemedicon.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiothreadedsocketservice.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiotlscertificate.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixconnection.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixfdlist.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixfdmessage.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixinputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmount.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmountmonitor.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmountpoint.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmountpoints.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmounts.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixoutputstream.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixsocketaddress.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiovfs.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiovolume.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiovolumemonitor.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiozlibcompressor.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiozlibdecompressor.c new file: lib/ruby-gtk2-2.0.2/gio2/ext/gio2/util.c new file: lib/ruby-gtk2-2.0.2/gio2/extconf.rb new file: lib/ruby-gtk2-2.0.2/gio2/lib/gio2.rb new file: lib/ruby-gtk2-2.0.2/gio2/lib/gio2/deprecated.rb new file: lib/ruby-gtk2-2.0.2/gio2/test/load-test.rb new file: lib/ruby-gtk2-2.0.2/gio2/test/test_bufferedinputstream.rb new file: lib/ruby-gtk2-2.0.2/gio2/test/test_charsetconverter.rb new file: lib/ruby-gtk2-2.0.2/gio2/test/test_datainputstream.rb new file: lib/ruby-gtk2-2.0.2/gio2/test/test_fileenumerator.rb new file: lib/ruby-gtk2-2.0.2/gio2/test/test_filemonitor.rb new file: lib/ruby-gtk2-2.0.2/gio2/test/test_inetaddress.rb new file: lib/ruby-gtk2-2.0.2/glib2/COPYING.LIB new file: lib/ruby-gtk2-2.0.2/glib2/README new file: lib/ruby-gtk2-2.0.2/glib2/Rakefile new file: lib/ruby-gtk2-2.0.2/glib2/TODO new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/depend new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/extconf.rb new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/glib2.def new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgcompat.h new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib.h new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib2conversions.h new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_bookmarkfile.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_convert.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_error.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_fileutils.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_i18n.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_int64.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_io_constants.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_iochannel.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_iochannel_win32_socket.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_iochannelerror.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_keyfile.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_maincontext.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_mainloop.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_messages.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_pollfd.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_shell.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_shellerror.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_source.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_spawn.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_spawnerror.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_threads.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_timer.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_ucs4.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_unichar.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_unicode.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_utf16.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_utf8.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_utils.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglib_win32.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglibdeprecated.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbglibdeprecated.h new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_boxed.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_closure.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_convert.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_enumflags.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_enums.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_flags.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_object.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_param.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_paramspecs.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_signal.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_strv.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_type.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_typeinstance.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_typeinterface.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_typemodule.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_typeplugin.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_value.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_valuearray.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobj_valuetypes.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobject.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgobject.h new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgprivate.h new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgutil.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgutil.h new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgutil_callback.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgutil_list.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgutil_list.h new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgutildeprecated.c new file: lib/ruby-gtk2-2.0.2/glib2/ext/glib2/rbgutildeprecated.h new file: lib/ruby-gtk2-2.0.2/glib2/extconf.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/glib-mkenums.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/glib2.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/glib2/deprecatable.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/gnome2-raketask.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/gnome2/rake/external-package.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/gnome2/rake/native-binary-build-task.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/gnome2/rake/package-task.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/gnome2/rake/package.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/gnome2/rake/source-download-task.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/gnome2/rake/win32-binary-build-task.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/gnome2/rake/win32-binary-download-task.rb new file: lib/ruby-gtk2-2.0.2/glib2/lib/mkmf-gnome2.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/bookmarkfile.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/idle.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/iochannel.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/keyfile.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/shell.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/spawn.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/timeout.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/timeout2.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/timer.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/type-register.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/type-register2.rb new file: lib/ruby-gtk2-2.0.2/glib2/sample/utils.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/glib-test-init.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/glib-test-utils.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/run-test.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_enum.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_file_utils.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_flags.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_glib2.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_iochannel.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_key_file.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_mkenums.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_poll_fd.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_signal.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_source.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_spawn.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_timeout.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_unicode.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_utils.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_value.rb new file: lib/ruby-gtk2-2.0.2/glib2/test/test_win32.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/COPYING.LIB new file: lib/ruby-gtk2-2.0.2/gobject-introspection/README.md new file: lib/ruby-gtk2-2.0.2/gobject-introspection/Rakefile new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/depend new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/extconf.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/gobject_introspection.def new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-arg-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-argument.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-base-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-boxed-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-callable-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-callback-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-constant-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-constructor-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-conversions.h new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-enum-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-field-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-flags-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-function-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-interface-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-loader.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-method-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-object-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-private.h new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-property-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-registered-type-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-repository.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-signal-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-struct-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-type-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-type-tag.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-types.h new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-union-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-unresolved-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-value-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gi-vfunc-info.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gobject-introspection.c new file: lib/ruby-gtk2-2.0.2/gobject-introspection/ext/gobject-introspection/rb-gobject-introspection.h new file: lib/ruby-gtk2-2.0.2/gobject-introspection/extconf.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection/boxed-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection/callable-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection/collection-reader.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection/interface-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection/loader.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection/object-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection/repository.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection/struct-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/lib/gobject-introspection/union-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/patches/0001-Support-external-g-ir-scanner.patch new file: lib/ruby-gtk2-2.0.2/gobject-introspection/patches/cross-g-ir-scanner.diff new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/gobject-introspection-test-utils.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/run-test.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-arg-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-base-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-boxed-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-callable-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-callback-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-constant-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-enum-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-field-type.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-flags-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-function-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-interface-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-loader.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-object-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-property-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-registered-type-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-repository.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-signal-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-struct-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-type-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-type-tag.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-union-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-value-info.rb new file: lib/ruby-gtk2-2.0.2/gobject-introspection/test/test-vfunc-info.rb new file: lib/ruby-gtk2-2.0.2/gtk2/COPYING.LIB new file: lib/ruby-gtk2-2.0.2/gtk2/README new file: lib/ruby-gtk2-2.0.2/gtk2/Rakefile new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/depend new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/extconf.rb new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/global.h new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/gtk2.def new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/init.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdk.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdk.h new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkatom.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkcairo.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkcolor.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkcolormap.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkconst.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkconversions.h new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkcursor.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkdevice.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkdisplay.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkdisplaymanager.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkdragcontext.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkdraw.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkevent.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkgc.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkgeometry.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkimage.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkinput.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkkeymap.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkkeyval.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkpango.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkpangorenderer.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkpixbuf.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkpixmap.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkproperty.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkrectangle.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkregion.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkrgb.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkscreen.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkselection.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkthreads.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdktimecoord.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkvisual.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkwindow.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkwindowattr.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgdkx11.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtk.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtk.h new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaboutdialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaccelerator.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaccelgroup.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaccelgroupentry.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaccelkey.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaccellabel.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaccelmap.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaccessible.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaction.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkactiongroup.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkadjustment.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkalignment.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkallocation.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkarrow.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkaspectframe.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkassistant.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkbbox.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkbin.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkbindingset.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkborder.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkbox.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkbuildable.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkbuilder.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcalendar.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcelleditable.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcelllayout.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellrenderer.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellrendereraccel.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellrenderercombo.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellrendererpixbuf.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellrendererprogress.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellrendererspin.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellrendererspinner.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellrenderertext.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellrenderertoggle.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcellview.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcheckbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcheckmenuitem.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkclipboard.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcolorbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcolorsel.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcolorselectiondialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcombo.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcombobox.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcomboboxentry.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkconst.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcontainer.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkconversions.h new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkcurve.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkdialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkdrag.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkdrawingarea.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkeditable.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkentry.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkentrycompletion.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkeventbox.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkexpander.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfilechooser.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfilechooserbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfilechooserdialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfilechooserwidget.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfilefilter.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfilesel.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfilesystemerror.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfixed.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfontbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfontselection.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkfontselectiondialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkframe.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkgamma.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkhandlebox.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkhbbox.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkhbox.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkhpaned.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkhruler.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkhscale.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkhscrollbar.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkhseparator.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkiconfactory.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkiconinfo.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkiconset.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkiconsize.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkiconsource.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkicontheme.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkiconview.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkimage.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkimagemenuitem.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkimcontext.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkimcontextsimple.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkimmulticontext.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkinfobar.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkinputdialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkinvisible.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkitem.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkitemfactory.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtklabel.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtklayout.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtklinkbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkliststore.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkmacros.h new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkmenu.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkmenubar.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkmenuitem.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkmenushell.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkmenutoolbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkmessagedialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkmisc.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtknotebook.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkobject.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkoptionmenu.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkpagesetup.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkpagesetupunixdialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkpaned.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkpapersize.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkplug.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkprintcontext.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkprinter.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkprintjob.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkprintoperation.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkprintoperationpreview.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkprintsettings.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkprintunixdialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkprogress.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkprogressbar.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkradioaction.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkradiobutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkradiomenuitem.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkradiotoolbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrange.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrc.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrcstyle.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentaction.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentchooser.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentchooserdialog.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentchoosermenu.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentchooserwidget.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentdata.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentfilter.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentfilterinfo.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentinfo.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkrecentmanager.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkruler.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkscale.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkscalebutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkscrollbar.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkscrolledwindow.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkselection.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkselectiondata.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkseparator.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkseparatormenuitem.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkseparatortoolitem.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtksettings.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtksizegroup.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtksocket.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkspinbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkspinner.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkstatusbar.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkstatusicon.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkstock.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkstyle.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktable.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktargetlist.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktearoffmenuitem.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktextappearance.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktextattributes.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktextbuffer.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktextchild.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktextiter.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktextmark.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktexttag.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktexttagtable.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktextview.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktoggleaction.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktogglebutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktoggletoolbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktoolbar.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktoolbutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktoolitem.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktooltip.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktooltips.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreedragdest.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreedragsource.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreeiter.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreemodel.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreemodelfilter.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreemodelsort.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreepath.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreerowreference.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreeselection.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreesortable.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreestore.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreeview.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtktreeviewcolumn.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkuimanager.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkvbbox.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkvbox.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkviewport.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkvolumebutton.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkvpaned.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkvruler.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkvscale.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkvscrollbar.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkvseparator.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkwidget.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkwindow.c new file: lib/ruby-gtk2-2.0.2/gtk2/ext/gtk2/rbgtkwindowgroup.c new file: lib/ruby-gtk2-2.0.2/gtk2/extconf.rb new file: lib/ruby-gtk2-2.0.2/gtk2/lib/gtk2.rb new file: lib/ruby-gtk2-2.0.2/gtk2/lib/gtk2/base.rb new file: lib/ruby-gtk2-2.0.2/gtk2/patches/gtk+-2.24.14-add-missing-exeext.diff new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/README new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/alphatest.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/apple-red.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/appwindow.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/background.jpg new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/builder.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/button_box.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-arc-negative.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-arc.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-clip-image.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-clip-rectangle.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-clip.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-curve-rectangle.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-curve-to.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-dash.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-fill-and-stroke.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-fill-and-stroke2.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-gradient.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-image-pattern.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-image.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-line-cap.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-line-join.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-long-lines.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-operator.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-path.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-pattern-fill.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-self-intersect.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-text-align-center.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-text-extents.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/cairo-text.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/changedisplay.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/clipboard.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/colorsel.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/common.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/demo.ui new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/dialog.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/drawingarea.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/editable_cells.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/entry_completion.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/expander.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/floppybuddy.gif new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gnome-applets.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gnome-calendar.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gnome-foot.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gnome-fs-directory.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gnome-fs-regular.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gnome-gimp.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gnome-gmush.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gnome-gsame.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gnu-keys.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/gtk-logo-rgb.gif new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/hypertext.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/iconview.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/images.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/item_factory.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/list_store.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/main.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/menus.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/panes.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/pixbufs.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/printing.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/rotated_text.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/ruby-gnome2-logo.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/sizegroup.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/stock_browser.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/textview.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/gtk-demo/tree_store.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/aboutdialog.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/aboutdialog2.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/alpha-demo.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/assistant.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/bindings.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/button.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/button2.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/buttonbox.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/cairo-pong.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/calendar.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/checkbutton.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/colorselection.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/combo_check.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/combobox.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/composited-windows.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/cursor.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/dialog.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/dialog2.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/dnd.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/dndtreeview.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/drag-move.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/drawing.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/entry.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/entrycompletion.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/expander.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/filechooser.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/fileselection.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/frame.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/gc.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/gdkscreen.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/gnome-logo-icon.png new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/helloworld.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/iconview.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/image.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/infobar.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/itemfactory.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/itemfactory2.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/keyboard_grab.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/label.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/linkbutton.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/listview.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/menu.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/misc_button.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/mouse-gesture.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/pangorenderer.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/pointer_grab.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/print.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/properties.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/radiobutton.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/recentchooserdialog.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/rgtk+cairo.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/scalebutton.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/settings.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/statusicon.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/stock.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/style_property.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/style_property.rc new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/t-gtkplug.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/t-gtksocket.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/test.xpm new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/textbuffer_serialize.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/threads.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/to_drawable.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/togglebutton.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/toolbar.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/tooltips.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/tree_combo.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/tree_progress.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/treemodelfilter.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/treeview.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/uimanager.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/uimanager2.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/uimanager2.xml new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/window.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/misc/xbm_cursor.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/3DRings.xpm new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/FilesQueue.xpm new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/Modeller.xpm new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/README new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/button.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/buttonbox.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/check-n.xpm new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/check-y.xpm new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/checkbutton.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/circles.xbm new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/colorselect.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/dialog.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/entry.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/filesel.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/fontselection.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/gammacurve.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/labels.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/layout.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/marble.xpm new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/menu.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/notebook.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/pixmap.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/progressbar.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/radiobutton.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/range.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/reparent.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/rulers.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/sample.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/savedposition.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/scrolledwindow.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/shapedwindow.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/spinbutton.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/statusbar.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/test.xpm new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/testgtk.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/testgtkrc new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/testgtkrc2 new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/togglebutton.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/toolbar.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/tooltips.rb new file: lib/ruby-gtk2-2.0.2/gtk2/sample/testgtk/wmhints.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/gtk-test-utils.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/run-test.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gc.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_color.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_display.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_event.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_gc.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_geometry.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_keymap.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_pango.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_rectangle.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_selection_data.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_window.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gdk_window_attribute.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_about_dialog.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_accel_group_entry.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_accel_key.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_allocation.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_border.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_buildable.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_builder.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_entry.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_icon_theme.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_image.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_list_store.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_menu_item.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_rc_style.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_recent_data.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_recent_filter_info.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_tree_path.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_unix_print.rb new file: lib/ruby-gtk2-2.0.2/gtk2/test/test_gtk_widget.rb new file: lib/ruby-gtk2-2.0.2/pango/COPYING.LIB new file: lib/ruby-gtk2-2.0.2/pango/README new file: lib/ruby-gtk2-2.0.2/pango/Rakefile new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/depend new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/extconf.rb new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/pango.def new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpango.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpango.h new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoanalysis.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoattribute.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoattriterator.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoattrlist.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangocairo.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangocairocontext.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangocolor.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangocontext.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoconversions.h new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangocoverage.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoengine.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangofont.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangofontdescription.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangofontface.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangofontfamily.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangofontmap.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangofontmetrics.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangofontset.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangofontsetsimple.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoglyphinfo.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoglyphitem.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoglyphstring.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangogravity.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoitem.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangolanguage.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangolayout.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangolayoutiter.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangolayoutline.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangologattr.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangomatrix.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoprivate.h new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangorectangle.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangorenderer.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoscript.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangoscriptiter.c new file: lib/ruby-gtk2-2.0.2/pango/ext/pango/rbpangotabarray.c new file: lib/ruby-gtk2-2.0.2/pango/extconf.rb new file: lib/ruby-gtk2-2.0.2/pango/lib/pango.rb new file: lib/ruby-gtk2-2.0.2/pango/patches/harfbuzz-0.9.17-disable-uniscribe.diff new file: lib/ruby-gtk2-2.0.2/pango/patches/pango-1.34.0-enable-fc-font.diff new file: lib/ruby-gtk2-2.0.2/pango/sample/attribute.rb new file: lib/ruby-gtk2-2.0.2/pango/sample/break.rb new file: lib/ruby-gtk2-2.0.2/pango/sample/gdk_layout.rb new file: lib/ruby-gtk2-2.0.2/pango/sample/glyphstring.rb new file: lib/ruby-gtk2-2.0.2/pango/sample/item.rb new file: lib/ruby-gtk2-2.0.2/pango/sample/label.rb new file: lib/ruby-gtk2-2.0.2/pango/sample/layout.rb new file: lib/ruby-gtk2-2.0.2/pango/sample/pango_cairo.rb new file: lib/ruby-gtk2-2.0.2/pango/sample/parse.rb new file: lib/ruby-gtk2-2.0.2/pango/sample/sample.txt new file: lib/ruby-gtk2-2.0.2/pango/sample/script.rb new file: lib/ruby-gtk2-2.0.2/pango/test/pango-test-utils.rb new file: lib/ruby-gtk2-2.0.2/pango/test/run-test.rb new file: lib/ruby-gtk2-2.0.2/pango/test/test-analysis.rb new file: lib/ruby-gtk2-2.0.2/pango/test/test-attribute.rb new file: lib/ruby-gtk2-2.0.2/pango/test/test-color.rb new file: lib/ruby-gtk2-2.0.2/pango/test/test-language.rb new file: lib/ruby-gtk2-2.0.2/pango/test/test-log-attr.rb new file: lib/ruby-gtk2-2.0.2/pango/test/test-matrix.rb new file: lib/ruby-gtk2-2.0.2/pango/test/test-rectangle.rb new file: lib/ruby-gtk2-2.0.2/pango/test/test_layout.rb new file: lib/ruby-gtk2-2.0.2/run-test.rb
This commit is contained in:
502
lib/ruby-gtk2-2.0.2/gobject-introspection/COPYING.LIB
Normal file
502
lib/ruby-gtk2-2.0.2/gobject-introspection/COPYING.LIB
Normal file
@ -0,0 +1,502 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
24
lib/ruby-gtk2-2.0.2/gobject-introspection/README.md
Normal file
24
lib/ruby-gtk2-2.0.2/gobject-introspection/README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# Ruby/GObjectIntrospection
|
||||
|
||||
Ruby/GObjectIntrospection is a Ruby binding of GObject Introspect.
|
||||
|
||||
## Requirements
|
||||
|
||||
* Ruby/GLib2 in
|
||||
[Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/)
|
||||
* [GObject Introspection](http://live.gnome.org/GObjectIntrospection)
|
||||
|
||||
## Install
|
||||
|
||||
gem install gobject-introspection
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2013 Ruby-GNOME2 Project Team
|
||||
|
||||
This program is free software. You can distribute/modify this program
|
||||
under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
|
||||
|
||||
## Project Website
|
||||
|
||||
http://ruby-gnome2.sourceforge.jp/
|
117
lib/ruby-gtk2-2.0.2/gobject-introspection/Rakefile
Normal file
117
lib/ruby-gtk2-2.0.2/gobject-introspection/Rakefile
Normal file
@ -0,0 +1,117 @@
|
||||
# -*- ruby -*-
|
||||
#
|
||||
# Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
$LOAD_PATH.unshift("./../glib2/lib")
|
||||
require "gnome2/rake/package-task"
|
||||
|
||||
package_task = GNOME2::Rake::PackageTask.new do |package|
|
||||
package.summary = "Ruby/GObjectIntrospection is a Ruby binding of GObjectIntrospection."
|
||||
package.description = "Ruby/GObjectIntrospection is a Ruby binding of GObjectIntrospection."
|
||||
package.dependency.gem.runtime = ["glib2"]
|
||||
package.dependency.gem.development = [["test-unit", ">= 2"]]
|
||||
package.windows.packages = []
|
||||
package.windows.dependencies = []
|
||||
package.windows.build_dependencies = ["glib2"]
|
||||
package.external_packages = [
|
||||
{
|
||||
:name => "glib",
|
||||
:download_site => :gnome,
|
||||
:label => "GLib",
|
||||
:version => "2.36.2",
|
||||
:compression_method => "xz",
|
||||
:windows => {
|
||||
:build => false,
|
||||
},
|
||||
:native => {
|
||||
:build => true,
|
||||
:need_autoreconf => true,
|
||||
},
|
||||
},
|
||||
{
|
||||
:name => "gobject-introspection",
|
||||
:download_site => :gnome,
|
||||
:label => "gobject-introspection",
|
||||
:version => "1.36.0",
|
||||
:compression_method => "xz",
|
||||
:windows => {
|
||||
:configure_args => [
|
||||
"--with-g-ir-scanner=#{package.native.absolute_binary_dir}/bin/g-ir-scanner",
|
||||
"--disable-tests",
|
||||
],
|
||||
:patches => [
|
||||
"0001-Support-external-g-ir-scanner.patch",
|
||||
],
|
||||
:need_autoreconf => true,
|
||||
},
|
||||
:native => {
|
||||
:build => true,
|
||||
:patches => [
|
||||
# "cross-compilable-g-ir-scanner.diff",
|
||||
],
|
||||
}
|
||||
},
|
||||
]
|
||||
end
|
||||
package_task.define
|
||||
|
||||
namespace :native do
|
||||
namespace :"gobject-introspection" do
|
||||
desc "Make g-ir-scanner workable for Windows on non Windows"
|
||||
task :cross do
|
||||
g_ir_scanner_dir = package_task.native.absolute_binary_dir
|
||||
g_ir_scanner_dir += "lib/gobject-introspection/giscanner"
|
||||
Dir.chdir(g_ir_scanner_dir.to_s) do
|
||||
patch = "#{package_task.package.patches_dir}/cross-g-ir-scanner.diff"
|
||||
sh("patch -p2 < #{patch}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
namespace :builder do
|
||||
task :after => "native:gobject-introspection:cross"
|
||||
end
|
||||
end
|
||||
|
||||
namespace :win32 do
|
||||
namespace :"gobject-introspection" do
|
||||
desc "Use native tools"
|
||||
task :cross do
|
||||
pkg_config_dir = package_task.windows.absolute_binary_dir + "lib/pkgconfig"
|
||||
pc_path = pkg_config_dir + "gobject-introspection-1.0.pc"
|
||||
original_pc = pc_path.read
|
||||
new_pc = ""
|
||||
new_pc << "native_prefix=#{package_task.native.absolute_binary_dir}\n"
|
||||
new_pc << "native_bindir=${native_prefix}/bin\n"
|
||||
original_pc.each_line do |line|
|
||||
case line
|
||||
when /\Ag_ir_(scanner|compiler)=/
|
||||
new_pc << line.gsub(/\${bindir}/, "${native_bindir}")
|
||||
else
|
||||
new_pc << line
|
||||
end
|
||||
end
|
||||
pc_path.open("w") do |pc_file|
|
||||
pc_file.write(new_pc)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
namespace :builder do
|
||||
task :after => "win32:gobject-introspection:cross"
|
||||
end
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
install-so: install-headers
|
||||
install-headers:
|
||||
$(INSTALL_DATA) $(srcdir)/rb-gobject-introspection.h $(RUBYARCHDIR)
|
||||
|
||||
install: install-pc
|
||||
install-pc:
|
||||
if test -n "$(pkgconfigdir)"; then \
|
||||
$(MAKEDIRS) $(pkgconfigdir); \
|
||||
$(INSTALL_DATA) ruby-gobject-introspection.pc $(pkgconfigdir);\
|
||||
fi
|
@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "pathname"
|
||||
|
||||
source_dir = Pathname(__FILE__).dirname
|
||||
base_dir = source_dir.parent.parent.expand_path
|
||||
top_dir = base_dir.parent.expand_path
|
||||
top_build_dir = Pathname(".").parent.parent.parent.expand_path
|
||||
|
||||
mkmf_gnome2_dir = top_dir + "glib2" + "lib"
|
||||
version_suffix = ""
|
||||
unless mkmf_gnome2_dir.exist?
|
||||
if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s
|
||||
version_suffix = $1
|
||||
mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + "lib"
|
||||
end
|
||||
end
|
||||
|
||||
$LOAD_PATH.unshift(mkmf_gnome2_dir.to_s)
|
||||
|
||||
module_name = "gobject_introspection"
|
||||
package_id = "gobject-introspection-1.0"
|
||||
|
||||
begin
|
||||
require "mkmf-gnome2"
|
||||
rescue LoadError
|
||||
require "rubygems"
|
||||
gem "glib2"
|
||||
require "mkmf-gnome2"
|
||||
end
|
||||
|
||||
["glib2"].each do |package|
|
||||
directory = "#{package}#{version_suffix}"
|
||||
build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
|
||||
add_depend_package(package, "#{directory}/ext/#{package}",
|
||||
top_dir.to_s,
|
||||
:top_build_dir => top_build_dir.to_s,
|
||||
:target_build_dir => build_dir)
|
||||
end
|
||||
|
||||
setup_win32(module_name, base_dir)
|
||||
|
||||
unless required_pkg_config_package(package_id,
|
||||
:debian => "libgirepository1.0-dev",
|
||||
:fedora => "gobject-introspection-devel",
|
||||
:homebrew => "gobject-introspection",
|
||||
:macports => "gobject-introspection")
|
||||
exit(false)
|
||||
end
|
||||
|
||||
make_version_header("GI", package_id, ".")
|
||||
|
||||
gi_headers = ["girepository.h"]
|
||||
have_func("g_interface_info_find_signal", gi_headers)
|
||||
|
||||
enum_type_prefix = "gobject-introspection-enum-types"
|
||||
include_paths = PKGConfig.cflags_only_I(package_id)
|
||||
headers = include_paths.split.inject([]) do |result, path|
|
||||
result + Dir.glob(File.join(path.sub(/^-I/, ""), "gi{repository,types}.h"))
|
||||
end
|
||||
glib_mkenums(enum_type_prefix, headers, "G_TYPE_", ["girepository.h"])
|
||||
|
||||
create_pkg_config_file("Ruby/GObjectIntrospection",
|
||||
package_id, ruby_gnome2_version,
|
||||
"ruby-gobject-introspection.pc")
|
||||
|
||||
ensure_objs
|
||||
|
||||
$defs << "-DRUBY_GOBJECT_INTROSPECTION_COMPILATION"
|
||||
create_makefile(module_name)
|
||||
|
||||
pkg_config_dir = with_config("pkg-config-dir")
|
||||
if pkg_config_dir.is_a?(String)
|
||||
File.open("Makefile", "ab") do |makefile|
|
||||
makefile.puts
|
||||
makefile.puts("pkgconfigdir=#{pkg_config_dir}")
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
EXPORTS
|
||||
Init_gobject_introspection
|
||||
|
||||
rb_gi_callback_data_free
|
||||
rb_gi_callback_register_finder
|
@ -0,0 +1,151 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIArgInfo
|
||||
#define SELF(self) (RVAL2GI_ARG_INFO(self))
|
||||
|
||||
GType
|
||||
gi_arg_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIArgInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_direction(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_DIRECTION2RVAL(g_arg_info_get_direction(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_caller_allocates_p(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_arg_info_is_caller_allocates(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_return_value_p(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_arg_info_is_return_value(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_optional_p(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_arg_info_is_optional(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_may_be_null_p(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_arg_info_may_be_null(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_ownership_transfer(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_TRANSFER2RVAL(g_arg_info_get_ownership_transfer(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_scope(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_SCOPE_TYPE2RVAL(g_arg_info_get_scope(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_closure(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_arg_info_get_closure(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_destroy(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_arg_info_get_destroy(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type(VALUE self)
|
||||
{
|
||||
GIArgInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_arg_info_get_type(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_arg_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_ARG_INFO, "ArgInfo", rb_mGI,
|
||||
rb_cGIBaseInfo);
|
||||
|
||||
RG_DEF_METHOD(direction, 0);
|
||||
RG_DEF_METHOD_P(caller_allocates, 0);
|
||||
RG_DEF_METHOD_P(return_value, 0);
|
||||
RG_DEF_METHOD_P(optional, 0);
|
||||
RG_DEF_METHOD_P(may_be_null, 0);
|
||||
RG_DEF_METHOD(ownership_transfer, 0);
|
||||
RG_DEF_METHOD(scope, 0);
|
||||
RG_DEF_METHOD(closure, 0);
|
||||
RG_DEF_METHOD(destroy, 0);
|
||||
RG_DEF_METHOD(type, 0);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_I_DIRECTION, "Direction", rb_mGI);
|
||||
G_DEF_CLASS(G_TYPE_I_SCOPE_TYPE, "ScopeType", rb_mGI);
|
||||
G_DEF_CLASS(G_TYPE_I_TRANSFER, "Transfer", rb_mGI);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,218 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIBaseInfo
|
||||
#define SELF(self) RVAL2GI_BASE_INFO(self)
|
||||
|
||||
VALUE
|
||||
rb_gi_base_info_to_ruby(GIBaseInfo *info)
|
||||
{
|
||||
GType g_type;
|
||||
GIInfoType info_type;
|
||||
|
||||
if (!info) {
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
info_type = g_base_info_get_type(info);
|
||||
switch (info_type) {
|
||||
case GI_INFO_TYPE_INVALID:
|
||||
g_type = GI_TYPE_BASE_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_FUNCTION:
|
||||
{
|
||||
GIFunctionInfoFlags flags;
|
||||
|
||||
flags = g_function_info_get_flags((GIFunctionInfo *)info);
|
||||
if (flags & GI_FUNCTION_IS_METHOD) {
|
||||
g_type = GI_TYPE_METHOD_INFO;
|
||||
} else if (flags & GI_FUNCTION_IS_CONSTRUCTOR) {
|
||||
g_type = GI_TYPE_CONSTRUCTOR_INFO;
|
||||
} else {
|
||||
g_type = GI_TYPE_FUNCTION_INFO;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GI_INFO_TYPE_CALLBACK:
|
||||
g_type = GI_TYPE_CALLBACK_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_STRUCT:
|
||||
g_type = GI_TYPE_STRUCT_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_BOXED:
|
||||
g_type = GI_TYPE_BOXED_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_ENUM:
|
||||
g_type = GI_TYPE_ENUM_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_FLAGS:
|
||||
g_type = GI_TYPE_FLAGS_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_OBJECT:
|
||||
g_type = GI_TYPE_OBJECT_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_INTERFACE:
|
||||
g_type = GI_TYPE_INTERFACE_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_CONSTANT:
|
||||
g_type = GI_TYPE_CONSTANT_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_INVALID_0:
|
||||
g_type = GI_TYPE_BASE_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_UNION:
|
||||
g_type = GI_TYPE_UNION_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_VALUE:
|
||||
g_type = GI_TYPE_VALUE_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_SIGNAL:
|
||||
g_type = GI_TYPE_SIGNAL_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_VFUNC:
|
||||
g_type = GI_TYPE_VFUNC_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_PROPERTY:
|
||||
g_type = GI_TYPE_PROPERTY_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_FIELD:
|
||||
g_type = GI_TYPE_FIELD_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_ARG:
|
||||
g_type = GI_TYPE_ARG_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_TYPE:
|
||||
g_type = GI_TYPE_TYPE_INFO;
|
||||
break;
|
||||
case GI_INFO_TYPE_UNRESOLVED:
|
||||
g_type = GI_TYPE_UNRESOLVED_INFO;
|
||||
break;
|
||||
default:
|
||||
g_type = GI_TYPE_BASE_INFO;
|
||||
break;
|
||||
}
|
||||
|
||||
return BOXED2RVAL(info, g_type);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_gi_base_info_to_ruby_with_unref(GIBaseInfo *info)
|
||||
{
|
||||
VALUE rb_info;
|
||||
|
||||
rb_info = rb_gi_base_info_to_ruby(info);
|
||||
if (!NIL_P(rb_info)) {
|
||||
g_base_info_unref(info);
|
||||
}
|
||||
|
||||
return rb_info;
|
||||
}
|
||||
|
||||
GIBaseInfo *
|
||||
rb_gi_base_info_from_ruby(VALUE rb_info)
|
||||
{
|
||||
return RVAL2BOXED(rb_info, GI_TYPE_BASE_INFO);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type(VALUE self)
|
||||
{
|
||||
GIBaseInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_INFO_TYPE2RVAL(g_base_info_get_type(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_name(VALUE self)
|
||||
{
|
||||
GIBaseInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_base_info_get_name(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_namespace(VALUE self)
|
||||
{
|
||||
GIBaseInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_base_info_get_namespace(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_operator_aref(VALUE self, VALUE name)
|
||||
{
|
||||
GIBaseInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_base_info_get_attribute(info, RVAL2CSTR(name)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_each(VALUE self)
|
||||
{
|
||||
GIAttributeIter iter = {0, };
|
||||
GIBaseInfo *info;
|
||||
gchar *name, *value;
|
||||
|
||||
RETURN_ENUMERATOR(self, 0, NULL);
|
||||
|
||||
info = SELF(self);
|
||||
while (g_base_info_iterate_attributes(info, &iter, &name, &value)) {
|
||||
VALUE rb_name, rb_value;
|
||||
rb_name = CSTR2RVAL(name);
|
||||
rb_value = CSTR2RVAL(value);
|
||||
rb_yield(rb_ary_new3(2, rb_name, rb_value));
|
||||
}
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_base_info_init(VALUE rb_mGI)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = G_DEF_CLASS(GI_TYPE_BASE_INFO, "BaseInfo", rb_mGI);
|
||||
|
||||
rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable);
|
||||
|
||||
RG_DEF_METHOD(type, 0);
|
||||
RG_DEF_METHOD(name, 0);
|
||||
RG_DEF_METHOD(namespace, 0);
|
||||
RG_DEF_METHOD_OPERATOR("[]", aref, 1);
|
||||
RG_DEF_METHOD(each, 0);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_I_INFO_TYPE, "InfoType", rb_mGI);
|
||||
|
||||
rb_gi_callable_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_registered_type_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_constant_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_value_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_property_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_field_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_arg_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_type_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_unresolved_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIBoxedInfo
|
||||
#define SELF(self) (RVAL2GI_BOXED_INFO(self))
|
||||
|
||||
GType
|
||||
gi_boxed_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIBoxedInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_boxed_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_BOXED_INFO, "BoxedInfo", rb_mGI,
|
||||
rb_cGIRegisteredTypeInfo);
|
||||
|
||||
(void)RG_TARGET_NAMESPACE; /* suppress a warning. */
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGICallableInfo
|
||||
#define SELF(self) ((GICallableInfo *)(RVAL2GI_BASE_INFO(self)))
|
||||
|
||||
GType
|
||||
gi_callable_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GICallableInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_return_type(VALUE self)
|
||||
{
|
||||
GICallableInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL(g_callable_info_get_return_type(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_caller_owns(VALUE self)
|
||||
{
|
||||
GICallableInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_TRANSFER2RVAL(g_callable_info_get_caller_owns(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_may_return_null_p(VALUE self)
|
||||
{
|
||||
GICallableInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_callable_info_may_return_null(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_args(VALUE self)
|
||||
{
|
||||
GICallableInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_callable_info_get_n_args(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_arg(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GICallableInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_callable_info_get_arg(info, n));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_callable_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_CALLABLE_INFO, "CallableInfo", rb_mGI,
|
||||
rb_cGIBaseInfo);
|
||||
|
||||
RG_DEF_METHOD(return_type, 0);
|
||||
RG_DEF_METHOD(caller_owns, 0);
|
||||
RG_DEF_METHOD_P(may_return_null, 0);
|
||||
RG_DEF_METHOD(n_args, 0);
|
||||
RG_DEF_METHOD(get_arg, 1);
|
||||
|
||||
rb_gi_function_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_callback_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_signal_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_vfunc_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGICallbackInfo
|
||||
#define SELF(self) RVAL2GI_BASE_INFO(self)
|
||||
|
||||
GType
|
||||
gi_callback_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GICallbackInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_callback_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_CALLBACK_INFO, "CallbackInfo", rb_mGI,
|
||||
rb_cGICallableInfo);
|
||||
|
||||
(void)RG_TARGET_NAMESPACE; /* suppress a warning. */
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIConstantInfo
|
||||
#define SELF(self) (RVAL2GI_CONSTANT_INFO(self))
|
||||
|
||||
GType
|
||||
gi_constant_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIConstantInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type(VALUE self)
|
||||
{
|
||||
GIConstantInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_constant_info_get_type(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_value(VALUE self)
|
||||
{
|
||||
GIConstantInfo *info;
|
||||
GIArgument value;
|
||||
gint value_size;
|
||||
GITypeInfo *type_info;
|
||||
VALUE rb_value;
|
||||
|
||||
info = SELF(self);
|
||||
type_info = g_constant_info_get_type(info);
|
||||
value_size = g_constant_info_get_value(info, &value);
|
||||
rb_value = GI_ARGUMENT2RVAL(&value, type_info);
|
||||
g_base_info_unref(type_info);
|
||||
g_constant_info_free_value(info, &value);
|
||||
|
||||
return rb_value;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_constant_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_CONSTANT_INFO, "ConstantInfo", rb_mGI,
|
||||
rb_cGIBaseInfo);
|
||||
|
||||
RG_DEF_METHOD(type, 0);
|
||||
RG_DEF_METHOD(value, 0);
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIConstructorInfo
|
||||
#define SELF(self) RVAL2GI_FUNCTION_INFO(self)
|
||||
|
||||
GType
|
||||
gi_constructor_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIConstructorInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
initialize_receiver(VALUE receiver, GITypeInfo *info, GIArgument *value)
|
||||
{
|
||||
GIBaseInfo *interface_info;
|
||||
GIInfoType interface_type;
|
||||
|
||||
if (g_type_info_get_tag(info) != GI_TYPE_TAG_INTERFACE) {
|
||||
rb_raise(rb_eRuntimeError, "TODO: returned value isn't interface");
|
||||
}
|
||||
|
||||
interface_info = g_type_info_get_interface(info);
|
||||
interface_type = g_base_info_get_type(interface_info);
|
||||
g_base_info_unref(interface_info);
|
||||
switch (interface_type) {
|
||||
case GI_INFO_TYPE_OBJECT:
|
||||
g_object_ref_sink(value->v_pointer);
|
||||
G_INITIALIZE(receiver, value->v_pointer);
|
||||
break;
|
||||
case GI_INFO_TYPE_STRUCT:
|
||||
G_INITIALIZE(receiver, value->v_pointer);
|
||||
break;
|
||||
case GI_INFO_TYPE_INVALID:
|
||||
case GI_INFO_TYPE_FUNCTION:
|
||||
case GI_INFO_TYPE_CALLBACK:
|
||||
case GI_INFO_TYPE_BOXED:
|
||||
case GI_INFO_TYPE_ENUM:
|
||||
case GI_INFO_TYPE_FLAGS:
|
||||
case GI_INFO_TYPE_INTERFACE:
|
||||
case GI_INFO_TYPE_CONSTANT:
|
||||
case GI_INFO_TYPE_INVALID_0:
|
||||
case GI_INFO_TYPE_UNION:
|
||||
case GI_INFO_TYPE_VALUE:
|
||||
case GI_INFO_TYPE_SIGNAL:
|
||||
case GI_INFO_TYPE_VFUNC:
|
||||
case GI_INFO_TYPE_PROPERTY:
|
||||
case GI_INFO_TYPE_FIELD:
|
||||
case GI_INFO_TYPE_ARG:
|
||||
case GI_INFO_TYPE_TYPE:
|
||||
case GI_INFO_TYPE_UNRESOLVED:
|
||||
default:
|
||||
rb_raise(rb_eRuntimeError,
|
||||
"TODO: returned value isn't object or struct");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_invoke(VALUE self, VALUE rb_options)
|
||||
{
|
||||
GIFunctionInfo *info;
|
||||
GICallableInfo *callable_info;
|
||||
VALUE receiver;
|
||||
GIArgument return_value;
|
||||
GITypeInfo return_value_info;
|
||||
|
||||
info = SELF(self);
|
||||
callable_info = (GICallableInfo *)info;
|
||||
|
||||
rb_options = rbg_to_hash(rb_options);
|
||||
receiver = rb_hash_delete(rb_options, ID2SYM(rb_intern("receiver")));
|
||||
if (NIL_P(receiver)) {
|
||||
receiver = rb_hash_delete(rb_options, rb_str_new_cstr("receiver"));
|
||||
}
|
||||
if (NIL_P(receiver)) {
|
||||
rb_raise(rb_eArgError,
|
||||
"receiver is missing: %s",
|
||||
RBG_INSPECT(rb_options));
|
||||
}
|
||||
/* TODO: use rb_protect */
|
||||
rb_gi_function_info_invoke_raw(info,
|
||||
rb_options,
|
||||
&return_value);
|
||||
|
||||
g_callable_info_load_return_type(callable_info, &return_value_info);
|
||||
initialize_receiver(receiver, &return_value_info, &return_value);
|
||||
|
||||
return receiver;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_constructor_info_init(VALUE rb_mGI, VALUE rb_cGIFunctionInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_CONSTRUCTOR_INFO,
|
||||
"ConstructorInfo", rb_mGI,
|
||||
rb_cGIFunctionInfo);
|
||||
|
||||
RG_DEF_METHOD(invoke, 1);
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef RB_GI_CONVERSIONS_H
|
||||
#define RB_GI_CONVERSIONS_H
|
||||
|
||||
#define RVAL2GI_REPOSITORY(rb_object) (G_IREPOSITORY(RVAL2GOBJ(rb_object)))
|
||||
#define RVAL2GI_REPOSITORY_LOAD_FLAGS(rb_flags) \
|
||||
(RVAL2GFLAGS(rb_flags, G_TYPE_I_REPOSITORY_LOAD_FLAGS))
|
||||
|
||||
#define GI_BASE_INFO2RVAL(info) \
|
||||
(rb_gi_base_info_to_ruby((GIBaseInfo *)(info)))
|
||||
#define GI_BASE_INFO2RVAL_WITH_UNREF(info) \
|
||||
(rb_gi_base_info_to_ruby_with_unref((GIBaseInfo *)(info)))
|
||||
#define RVAL2GI_BASE_INFO(rb_object) (rb_gi_base_info_from_ruby(rb_object))
|
||||
|
||||
#define GI_ARGUMENT2RVAL(argument, type_info) \
|
||||
(rb_gi_argument_to_ruby((argument), (type_info)))
|
||||
#define GI_OUT_ARGUMENT2RVAL(argument, arg_info) \
|
||||
(rb_gi_out_argument_to_ruby((argument), (arg_info)))
|
||||
#define GI_RETURN_ARGUMENT2RVAL(argument, callable_info) \
|
||||
(rb_gi_return_argument_to_ruby((argument), (callable_info)))
|
||||
#define RVAL2GI_VALUE_ARGUMENT(argument, type_info, rb_argument) \
|
||||
(rb_gi_value_argument_from_ruby((argument), (type_info), (rb_argument)))
|
||||
#define RVAL2GI_IN_ARGUMENT(argument, arg_info, rb_argument) \
|
||||
(rb_gi_in_argument_from_ruby((argument), (arg_info), (rb_argument)))
|
||||
|
||||
|
||||
#define RVAL2GI_REGISTERED_TYPE_INFO(rb_object) \
|
||||
((GIRegisteredTypeInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_FUNCTION_INFO(rb_object) \
|
||||
((GIFunctionInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_STRUCT_INFO(rb_object) \
|
||||
((GIStructInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_ENUM_INFO(rb_object) \
|
||||
((GIEnumInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_OBJECT_INFO(rb_object) \
|
||||
((GIObjectInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_INTERFACE_INFO(rb_object) \
|
||||
((GIInterfaceInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_CONSTANT_INFO(rb_object) \
|
||||
((GIConstantInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_UNION_INFO(rb_object) \
|
||||
((GIUnionInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_VALUE_INFO(rb_object) \
|
||||
((GIValueInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_ARG_INFO(rb_object) \
|
||||
((GIArgInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_FIELD_INFO(rb_object) \
|
||||
((GIFieldInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
#define RVAL2GI_TYPE_INFO(rb_object) \
|
||||
((GITypeInfo *)RVAL2GI_BASE_INFO(rb_object))
|
||||
|
||||
#define GI_INFO_TYPE2RVAL(type) (GENUM2RVAL(type, G_TYPE_I_INFO_TYPE))
|
||||
#define GI_TRANSFER2RVAL(transfer) (GENUM2RVAL(transfer, G_TYPE_I_TRANSFER))
|
||||
#define GI_DIRECTION2RVAL(direction) (GENUM2RVAL(direction, G_TYPE_I_DIRECTION))
|
||||
#define GI_SCOPE_TYPE2RVAL(scope) (GENUM2RVAL(scope, G_TYPE_I_SCOPE_TYPE))
|
||||
#define RVAL2GI_TYPE_TAG(rb_tag) (RVAL2GENUM(rb_tag, G_TYPE_I_TYPE_TAG))
|
||||
#define GI_TYPE_TAG2RVAL(tag) (GENUM2RVAL(tag, G_TYPE_I_TYPE_TAG))
|
||||
#define GI_ARRAY_TYPE2RVAL(type) (rb_gi_array_type_to_ruby(type))
|
||||
|
||||
#define GI_FUNCTION_INFO_FLAGS2RVAL(tag) \
|
||||
(GFLAGS2RVAL(tag, G_TYPE_I_FUNCTION_INFO_FLAGS))
|
||||
#define GI_SIGNAL_FLAGS2RVAL(tag) \
|
||||
(GFLAGS2RVAL(tag, G_TYPE_SIGNAL_FLAGS))
|
||||
#define GI_VFUNC_INFO_FLAGS2RVAL(tag) \
|
||||
(GFLAGS2RVAL(tag, G_TYPE_IV_FUNC_INFO_FLAGS))
|
||||
#define GI_FIELD_INFO_FLAGS2RVAL(tag) \
|
||||
(GFLAGS2RVAL(tag, G_TYPE_I_FIELD_INFO_FLAGS))
|
||||
|
||||
VALUE rb_gi_base_info_to_ruby (GIBaseInfo *info);
|
||||
VALUE rb_gi_base_info_to_ruby_with_unref(GIBaseInfo *info);
|
||||
GIBaseInfo *rb_gi_base_info_from_ruby (VALUE rb_info);
|
||||
|
||||
VALUE rb_gi_argument_to_ruby (GIArgument *argument,
|
||||
GITypeInfo *type_info);
|
||||
void rb_gi_out_argument_init (GIArgument *argument,
|
||||
GIArgInfo *arg_info);
|
||||
VALUE rb_gi_out_argument_to_ruby (GIArgument *argument,
|
||||
GIArgInfo *arg_info);
|
||||
void rb_gi_out_argument_fin (GIArgument *argument,
|
||||
GIArgInfo *arg_info);
|
||||
VALUE rb_gi_return_argument_to_ruby (GIArgument *argument,
|
||||
GICallableInfo *callable_info);
|
||||
GIArgument *rb_gi_value_argument_from_ruby (GIArgument *argument,
|
||||
GITypeInfo *type_info,
|
||||
VALUE rb_argument);
|
||||
GIArgument *rb_gi_in_argument_from_ruby (GIArgument *argument,
|
||||
GIArgInfo *arg_info,
|
||||
VALUE rb_argument);
|
||||
void rb_gi_value_argument_free (GIArgument *argument,
|
||||
GITypeInfo *type_info);
|
||||
void rb_gi_in_argument_free (GIArgument *argument,
|
||||
GIArgInfo *arg_info);
|
||||
|
||||
VALUE rb_gi_array_type_to_ruby (GIArrayType type);
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1,145 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIEnumInfo
|
||||
#define SELF(self) (RVAL2GI_ENUM_INFO(self))
|
||||
|
||||
GType
|
||||
gi_enum_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIEnumInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_values(VALUE self)
|
||||
{
|
||||
GIEnumInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_enum_info_get_n_values(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_value(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIEnumInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_enum_info_get_value(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_values(VALUE self)
|
||||
{
|
||||
GIEnumInfo *info;
|
||||
gint i, n;
|
||||
VALUE rb_values;
|
||||
|
||||
info = SELF(self);
|
||||
|
||||
rb_values = rb_ary_new();
|
||||
n = g_enum_info_get_n_values(info);
|
||||
for (i = 0; i < n; i++) {
|
||||
GIValueInfo *value_info;
|
||||
value_info = g_enum_info_get_value(info, i);
|
||||
rb_ary_push(rb_values, GI_BASE_INFO2RVAL_WITH_UNREF(value_info));
|
||||
}
|
||||
|
||||
return rb_values;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_methods(VALUE self)
|
||||
{
|
||||
GIEnumInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_enum_info_get_n_methods(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_method(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIEnumInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_enum_info_get_method(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_methods(VALUE self)
|
||||
{
|
||||
GIEnumInfo *info;
|
||||
gint i, n;
|
||||
VALUE rb_methods;
|
||||
|
||||
info = SELF(self);
|
||||
|
||||
rb_methods = rb_ary_new();
|
||||
n = g_enum_info_get_n_methods(info);
|
||||
for (i = 0; i < n; i++) {
|
||||
GIFunctionInfo *function_info;
|
||||
function_info = g_enum_info_get_method(info, i);
|
||||
rb_ary_push(rb_methods, GI_BASE_INFO2RVAL_WITH_UNREF(function_info));
|
||||
}
|
||||
|
||||
return rb_methods;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_storage_type(VALUE self)
|
||||
{
|
||||
GIEnumInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_TYPE_TAG2RVAL(g_enum_info_get_storage_type(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_enum_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_ENUM_INFO, "EnumInfo", rb_mGI,
|
||||
rb_cGIRegisteredTypeInfo);
|
||||
|
||||
RG_DEF_METHOD(n_values, 0);
|
||||
RG_DEF_METHOD(get_value, 1);
|
||||
RG_DEF_METHOD(values, 0);
|
||||
RG_DEF_METHOD(n_methods, 0);
|
||||
RG_DEF_METHOD(get_method, 1);
|
||||
RG_DEF_METHOD(methods, 0);
|
||||
RG_DEF_METHOD(storage_type, 0);
|
||||
|
||||
rb_gi_flags_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIFieldInfo
|
||||
#define SELF(self) (RVAL2GI_FIELD_INFO(self))
|
||||
|
||||
GType
|
||||
gi_field_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIFieldInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_flags(VALUE self)
|
||||
{
|
||||
GIFieldInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_FIELD_INFO_FLAGS2RVAL(g_field_info_get_flags(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_size(VALUE self)
|
||||
{
|
||||
GIFieldInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_field_info_get_size(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_offset(VALUE self)
|
||||
{
|
||||
GIFieldInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_field_info_get_offset(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type(VALUE self)
|
||||
{
|
||||
GIFieldInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_field_info_get_type(info));
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_gi_field_info_get_field_raw(GIFieldInfo *info, gpointer memory)
|
||||
{
|
||||
GIArgument argument;
|
||||
GITypeInfo *type_info;
|
||||
VALUE rb_field_value;
|
||||
|
||||
if (!g_field_info_get_field(info, memory, &argument)) {
|
||||
rb_raise(rb_eArgError, "failed to get field value");
|
||||
}
|
||||
|
||||
type_info = g_field_info_get_type(info);
|
||||
rb_field_value = GI_ARGUMENT2RVAL(&argument, type_info);
|
||||
g_base_info_unref(type_info);
|
||||
|
||||
return rb_field_value;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_field_info_set_field_raw(GIFieldInfo *info, gpointer memory,
|
||||
VALUE rb_field_value)
|
||||
{
|
||||
GIArgument field_value;
|
||||
GITypeInfo *type_info;
|
||||
gboolean succeeded;
|
||||
|
||||
type_info = g_field_info_get_type(info);
|
||||
RVAL2GI_VALUE_ARGUMENT(&field_value, type_info, rb_field_value);
|
||||
|
||||
succeeded = g_field_info_set_field(info, memory, &field_value);
|
||||
rb_gi_value_argument_free(&field_value, type_info);
|
||||
g_base_info_unref(type_info);
|
||||
|
||||
if (!succeeded) {
|
||||
rb_raise(rb_eArgError, "failed to set field value");
|
||||
}
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_field(VALUE self, VALUE rb_memory)
|
||||
{
|
||||
GIFieldInfo *info;
|
||||
gpointer memory;
|
||||
|
||||
info = SELF(self);
|
||||
memory = GUINT_TO_POINTER(NUM2ULONG(rb_memory));
|
||||
return rb_gi_field_info_get_field_raw(info, memory);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_field(VALUE self, VALUE rb_memory, VALUE rb_field_value)
|
||||
{
|
||||
GIFieldInfo *info;
|
||||
gpointer memory;
|
||||
|
||||
info = SELF(self);
|
||||
memory = GUINT_TO_POINTER(NUM2ULONG(rb_memory));
|
||||
rb_gi_field_info_set_field_raw(info, memory, rb_field_value);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_field_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_FIELD_INFO, "FieldInfo", rb_mGI,
|
||||
rb_cGIBaseInfo);
|
||||
|
||||
RG_DEF_METHOD(flags, 0);
|
||||
RG_DEF_METHOD(size, 0);
|
||||
RG_DEF_METHOD(offset, 0);
|
||||
RG_DEF_METHOD(type, 0);
|
||||
RG_DEF_METHOD(get_field, 1);
|
||||
RG_DEF_METHOD(set_field, 2);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_I_FIELD_INFO_FLAGS, "FieldInfoFlags", rb_mGI);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIFlagsInfo
|
||||
|
||||
GType
|
||||
gi_flags_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIFlagsInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_flags_info_init(VALUE rb_mGI, VALUE rb_cGIEnumInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_FLAGS_INFO, "FlagsInfo", rb_mGI,
|
||||
rb_cGIEnumInfo);
|
||||
|
||||
/* Suppress a warning. */
|
||||
(void)RG_TARGET_NAMESPACE;
|
||||
}
|
@ -0,0 +1,764 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#ifdef HAVE_RUBY_THREAD_H
|
||||
# include <ruby/thread.h>
|
||||
# define RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_TYPE void *
|
||||
# define RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_VALUE NULL
|
||||
#else
|
||||
# define rb_thread_call_without_gvl(func, func_data, ubf, ubf_data) \
|
||||
rb_thread_blocking_region(func, func_data, ubf, ubf_data)
|
||||
# define RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_TYPE VALUE
|
||||
# define RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_VALUE Qnil
|
||||
#endif
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIFunctionInfo
|
||||
#define SELF(self) RVAL2GI_FUNCTION_INFO(self)
|
||||
|
||||
static VALUE RG_TARGET_NAMESPACE;
|
||||
static VALUE rb_cGLibError;
|
||||
static const char *callbacks_key = "gi_callbacks";
|
||||
static GPtrArray *callback_finders;
|
||||
|
||||
GType
|
||||
gi_function_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIFunctionInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_symbol(VALUE self)
|
||||
{
|
||||
GIFunctionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_function_info_get_symbol(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_flags(VALUE self)
|
||||
{
|
||||
GIFunctionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_FUNCTION_INFO_FLAGS2RVAL(g_function_info_get_flags(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_property(VALUE self)
|
||||
{
|
||||
GIFunctionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL(g_function_info_get_property(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_vfunc(VALUE self)
|
||||
{
|
||||
GIFunctionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL(g_function_info_get_vfunc(info));
|
||||
}
|
||||
|
||||
static void
|
||||
allocate_arguments(GICallableInfo *info,
|
||||
GArray *in_args, GArray *out_args,
|
||||
GPtrArray *args_metadata)
|
||||
{
|
||||
gint i, n_args;
|
||||
gint rb_arg_index = 0;
|
||||
|
||||
n_args = g_callable_info_get_n_args(info);
|
||||
for (i = 0; i < n_args; i++) {
|
||||
GIArgument argument;
|
||||
RBGIArgMetadata *metadata;
|
||||
GIArgInfo *arg_info;
|
||||
GIDirection direction;
|
||||
|
||||
memset(&argument, 0, sizeof(GIArgument));
|
||||
|
||||
metadata = ALLOC(RBGIArgMetadata);
|
||||
arg_info = &(metadata->arg_info);
|
||||
g_callable_info_load_arg(info, i, arg_info);
|
||||
metadata->scope_type = g_arg_info_get_scope(arg_info);
|
||||
metadata->direction = g_arg_info_get_direction(arg_info);
|
||||
metadata->callback_p = (metadata->scope_type != GI_SCOPE_TYPE_INVALID);
|
||||
metadata->closure_p = FALSE;
|
||||
metadata->destroy_p = FALSE;
|
||||
metadata->inout_argv_p = FALSE;
|
||||
metadata->in_arg_index = -1;
|
||||
metadata->closure_in_arg_index = -1;
|
||||
metadata->destroy_in_arg_index = -1;
|
||||
metadata->rb_arg_index = -1;
|
||||
metadata->out_arg_index = -1;
|
||||
metadata->inout_argc_arg_index = -1;
|
||||
|
||||
direction = metadata->direction;
|
||||
if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) {
|
||||
metadata->in_arg_index = in_args->len;
|
||||
g_array_append_val(in_args, argument);
|
||||
metadata->rb_arg_index = rb_arg_index++;
|
||||
}
|
||||
if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) {
|
||||
metadata->out_arg_index = out_args->len;
|
||||
g_array_append_val(out_args, argument);
|
||||
}
|
||||
|
||||
g_ptr_array_add(args_metadata, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fill_metadata_inout_argv(GPtrArray *args_metadata)
|
||||
{
|
||||
guint i;
|
||||
gint inout_argc_arg_index = -1;
|
||||
|
||||
for (i = 0; i < args_metadata->len; i++) {
|
||||
RBGIArgMetadata *metadata;
|
||||
GIArgInfo *arg_info;
|
||||
const gchar *name;
|
||||
|
||||
metadata = g_ptr_array_index(args_metadata, i);
|
||||
if (metadata->direction != GI_DIRECTION_INOUT) {
|
||||
continue;
|
||||
}
|
||||
arg_info = &(metadata->arg_info);
|
||||
name = g_base_info_get_name(arg_info);
|
||||
if (strcmp(name, "argc") == 0) {
|
||||
inout_argc_arg_index = i;
|
||||
} else if (strcmp(name, "argv") == 0) {
|
||||
metadata->inout_argv_p = TRUE;
|
||||
metadata->inout_argc_arg_index = inout_argc_arg_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fill_metadata_callback(GPtrArray *args_metadata)
|
||||
{
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < args_metadata->len; i++) {
|
||||
RBGIArgMetadata *metadata;
|
||||
GIArgInfo *arg_info;
|
||||
gint closure_index;
|
||||
gint destroy_index;
|
||||
|
||||
metadata = g_ptr_array_index(args_metadata, i);
|
||||
if (!metadata->callback_p) {
|
||||
continue;
|
||||
}
|
||||
|
||||
arg_info = &(metadata->arg_info);
|
||||
closure_index = g_arg_info_get_closure(arg_info);
|
||||
if (closure_index != -1) {
|
||||
RBGIArgMetadata *closure_metadata;
|
||||
closure_metadata = g_ptr_array_index(args_metadata, closure_index);
|
||||
closure_metadata->closure_p = TRUE;
|
||||
metadata->closure_in_arg_index = closure_metadata->in_arg_index;
|
||||
closure_metadata->rb_arg_index = -1;
|
||||
}
|
||||
|
||||
destroy_index = g_arg_info_get_destroy(arg_info);
|
||||
if (destroy_index != -1) {
|
||||
RBGIArgMetadata *destroy_metadata;
|
||||
destroy_metadata = g_ptr_array_index(args_metadata, destroy_index);
|
||||
destroy_metadata->destroy_p = TRUE;
|
||||
metadata->destroy_in_arg_index = destroy_metadata->in_arg_index;
|
||||
destroy_metadata->rb_arg_index = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fill_metadata(GPtrArray *args_metadata)
|
||||
{
|
||||
fill_metadata_inout_argv(args_metadata);
|
||||
fill_metadata_callback(args_metadata);
|
||||
}
|
||||
|
||||
static void
|
||||
callback_data_guard_from_gc(RBGICallbackData *callback_data)
|
||||
{
|
||||
VALUE rb_callbacks;
|
||||
|
||||
rb_callbacks = rb_iv_get(RG_TARGET_NAMESPACE, callbacks_key);
|
||||
callback_data->rb_gc_guard_key = rb_class_new_instance(0, NULL, rb_cObject);
|
||||
rb_hash_aset(rb_callbacks,
|
||||
callback_data->rb_gc_guard_key,
|
||||
callback_data->rb_callback);
|
||||
}
|
||||
|
||||
static void
|
||||
callback_data_unguard_from_gc(RBGICallbackData *callback_data)
|
||||
{
|
||||
VALUE rb_callbacks;
|
||||
|
||||
rb_callbacks = rb_iv_get(RG_TARGET_NAMESPACE, callbacks_key);
|
||||
rb_hash_delete(rb_callbacks, callback_data->rb_gc_guard_key);
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_callback_data_free(RBGICallbackData *callback_data)
|
||||
{
|
||||
callback_data_unguard_from_gc(callback_data);
|
||||
xfree(callback_data->metadata);
|
||||
xfree(callback_data);
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_notify(gpointer data)
|
||||
{
|
||||
RBGICallbackData *callback_data = data;
|
||||
rb_gi_callback_data_free(callback_data);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
find_callback_function(GIArgInfo *info)
|
||||
{
|
||||
guint i;
|
||||
gpointer callback = NULL;
|
||||
|
||||
for (i = 0; i < callback_finders->len; i++) {
|
||||
RBGICallbackFinderFunc finder = g_ptr_array_index(callback_finders, i);
|
||||
callback = finder(info);
|
||||
if (callback) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return callback;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_callback_register_finder(RBGICallbackFinderFunc finder)
|
||||
{
|
||||
g_ptr_array_add(callback_finders, finder);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
source_func_p(GIArgInfo *info)
|
||||
{
|
||||
GITypeInfo type_info;
|
||||
GIBaseInfo *interface_info;
|
||||
GICallableInfo *callback_info;
|
||||
GITypeInfo return_type_info;
|
||||
GIArgInfo first_arg_info;
|
||||
GITypeInfo first_arg_type_info;
|
||||
|
||||
g_arg_info_load_type(info, &type_info);
|
||||
if (g_type_info_get_tag(&type_info) != GI_TYPE_TAG_INTERFACE) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
interface_info = g_type_info_get_interface(&type_info);
|
||||
if (g_base_info_get_type(interface_info) != GI_INFO_TYPE_CALLBACK) {
|
||||
g_base_info_unref(interface_info);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
callback_info = (GICallableInfo *)interface_info;
|
||||
g_callable_info_load_return_type(callback_info, &return_type_info);
|
||||
if (g_type_info_get_tag(&return_type_info) != GI_TYPE_TAG_BOOLEAN) {
|
||||
g_base_info_unref(interface_info);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (g_callable_info_get_n_args(interface_info) != 1) {
|
||||
g_base_info_unref(interface_info);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_callable_info_load_arg(interface_info, 0, &first_arg_info);
|
||||
g_arg_info_load_type(&first_arg_info, &first_arg_type_info);
|
||||
if (g_type_info_get_tag(&first_arg_type_info) != GI_TYPE_TAG_VOID) {
|
||||
g_base_info_unref(interface_info);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_base_info_unref(interface_info);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
source_func_callback(gpointer user_data)
|
||||
{
|
||||
RBGICallbackData *callback_data = user_data;
|
||||
VALUE rb_keep;
|
||||
ID id_call;
|
||||
|
||||
CONST_ID(id_call, "call");
|
||||
rb_keep = rb_funcall(callback_data->rb_callback, id_call, 0);
|
||||
if (callback_data->metadata->scope_type == GI_SCOPE_TYPE_ASYNC) {
|
||||
rb_gi_callback_data_free(callback_data);
|
||||
}
|
||||
return RVAL2CBOOL(rb_keep);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
source_func_callback_finder(GIArgInfo *arg_info)
|
||||
{
|
||||
if (!source_func_p(arg_info)) {
|
||||
return NULL;
|
||||
}
|
||||
return source_func_callback;
|
||||
}
|
||||
|
||||
static void
|
||||
in_callback_argument_from_ruby(RBGIArgMetadata *metadata, GArray *in_args)
|
||||
{
|
||||
gpointer callback;
|
||||
GIArgInfo *arg_info;
|
||||
GIArgument *callback_argument;
|
||||
|
||||
arg_info = &(metadata->arg_info);
|
||||
callback = find_callback_function(arg_info);
|
||||
if (!callback) {
|
||||
GITypeInfo type_info;
|
||||
GIBaseInfo *interface_info;
|
||||
VALUE rb_type_name;
|
||||
g_arg_info_load_type(arg_info, &type_info);
|
||||
interface_info = g_type_info_get_interface(&type_info);
|
||||
rb_type_name = CSTR2RVAL(g_base_info_get_name(interface_info));
|
||||
g_base_info_unref(interface_info);
|
||||
rb_raise(rb_eNotImpError,
|
||||
"TODO: <%s>(%s) callback is not supported yet.",
|
||||
RVAL2CSTR(rb_type_name),
|
||||
g_base_info_get_name(arg_info));
|
||||
}
|
||||
|
||||
callback_argument = &(g_array_index(in_args,
|
||||
GIArgument,
|
||||
metadata->in_arg_index));
|
||||
callback_argument->v_pointer = callback;
|
||||
|
||||
if (metadata->closure_in_arg_index != -1) {
|
||||
RBGICallbackData *callback_data;
|
||||
GIArgument *closure_argument;
|
||||
|
||||
callback_data = ALLOC(RBGICallbackData);
|
||||
callback_data->metadata = metadata;
|
||||
callback_data->rb_callback = rb_block_proc();
|
||||
callback_data_guard_from_gc(callback_data);
|
||||
closure_argument = &(g_array_index(in_args,
|
||||
GIArgument,
|
||||
metadata->closure_in_arg_index));
|
||||
closure_argument->v_pointer = callback_data;
|
||||
}
|
||||
|
||||
if (metadata->destroy_in_arg_index != -1) {
|
||||
GIArgument *destroy_argument;
|
||||
destroy_argument = &(g_array_index(in_args,
|
||||
GIArgument,
|
||||
metadata->destroy_in_arg_index));
|
||||
destroy_argument->v_pointer = destroy_notify;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
in_argument_from_ruby(RBGIArgMetadata *metadata, VALUE rb_arguments,
|
||||
GArray *in_args)
|
||||
{
|
||||
if (metadata->rb_arg_index == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (metadata->callback_p) {
|
||||
in_callback_argument_from_ruby(metadata, in_args);
|
||||
} else {
|
||||
GIArgument *argument;
|
||||
VALUE rb_argument = Qnil;
|
||||
|
||||
if (RARRAY_LEN(rb_arguments) > metadata->rb_arg_index) {
|
||||
rb_argument = RARRAY_PTR(rb_arguments)[metadata->rb_arg_index];
|
||||
}
|
||||
argument = &(g_array_index(in_args, GIArgument, metadata->in_arg_index));
|
||||
RVAL2GI_IN_ARGUMENT(argument,
|
||||
&(metadata->arg_info),
|
||||
rb_argument);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
out_argument_from_ruby(RBGIArgMetadata *metadata, GArray *out_args)
|
||||
{
|
||||
GIArgument *argument;
|
||||
|
||||
argument = &(g_array_index(out_args, GIArgument, metadata->out_arg_index));
|
||||
rb_gi_out_argument_init(argument, &(metadata->arg_info));
|
||||
}
|
||||
|
||||
static void
|
||||
arg_metadata_free(gpointer data)
|
||||
{
|
||||
RBGIArgMetadata *metadata = data;
|
||||
if (metadata->scope_type == GI_SCOPE_TYPE_ASYNC ||
|
||||
metadata->scope_type == GI_SCOPE_TYPE_NOTIFIED) {
|
||||
return;
|
||||
}
|
||||
xfree(metadata);
|
||||
}
|
||||
|
||||
static void
|
||||
arguments_from_ruby(GICallableInfo *info, VALUE rb_arguments,
|
||||
GArray *in_args, GArray *out_args,
|
||||
GPtrArray *args_metadata)
|
||||
{
|
||||
gint i, n_args;
|
||||
|
||||
allocate_arguments(info, in_args, out_args, args_metadata);
|
||||
fill_metadata(args_metadata);
|
||||
|
||||
n_args = g_callable_info_get_n_args(info);
|
||||
for (i = 0; i < n_args; i++) {
|
||||
RBGIArgMetadata *metadata;
|
||||
|
||||
metadata = g_ptr_array_index(args_metadata, i);
|
||||
if (metadata->in_arg_index != -1) {
|
||||
in_argument_from_ruby(metadata, rb_arguments, in_args);
|
||||
} else {
|
||||
out_argument_from_ruby(metadata, out_args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static VALUE
|
||||
inout_argv_argument_to_ruby(GArray *in_args, RBGIArgMetadata *metadata)
|
||||
{
|
||||
GIArgument *inout_argc_argument;
|
||||
GIArgument *inout_argv_argument;
|
||||
gint i, argc;
|
||||
gchar **argv;
|
||||
VALUE rb_argv_argument;
|
||||
|
||||
inout_argc_argument = &g_array_index(in_args, GIArgument,
|
||||
metadata->inout_argc_arg_index);
|
||||
inout_argv_argument = &g_array_index(in_args, GIArgument,
|
||||
metadata->in_arg_index);
|
||||
argc = *((gint *)(inout_argc_argument->v_pointer));
|
||||
argv = *((gchar ***)(inout_argv_argument->v_pointer));
|
||||
rb_argv_argument = rb_ary_new2(argc);
|
||||
for (i = 0; i < argc; i++) {
|
||||
rb_ary_push(rb_argv_argument, CSTR2RVAL(argv[i]));
|
||||
}
|
||||
return rb_argv_argument;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
out_arguments_to_ruby(GICallableInfo *callable_info,
|
||||
GArray *in_args, GArray *out_args,
|
||||
GPtrArray *args_metadata)
|
||||
{
|
||||
gint i, n_args;
|
||||
VALUE rb_out_args;
|
||||
|
||||
rb_out_args = rb_ary_new();
|
||||
n_args = g_callable_info_get_n_args(callable_info);
|
||||
for (i = 0; i < n_args; i++) {
|
||||
RBGIArgMetadata *metadata;
|
||||
GIArgument *argument = NULL;
|
||||
VALUE rb_argument;
|
||||
|
||||
metadata = g_ptr_array_index(args_metadata, i);
|
||||
switch (metadata->direction) {
|
||||
case GI_DIRECTION_IN:
|
||||
break;
|
||||
case GI_DIRECTION_OUT:
|
||||
argument = &g_array_index(out_args, GIArgument,
|
||||
metadata->out_arg_index);
|
||||
break;
|
||||
case GI_DIRECTION_INOUT:
|
||||
argument = &g_array_index(in_args, GIArgument,
|
||||
metadata->in_arg_index);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
break;
|
||||
}
|
||||
|
||||
if (!argument) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (metadata->inout_argv_p) {
|
||||
rb_argument = inout_argv_argument_to_ruby(in_args, metadata);
|
||||
} else {
|
||||
rb_argument = GI_OUT_ARGUMENT2RVAL(argument, &(metadata->arg_info));
|
||||
}
|
||||
rb_ary_push(rb_out_args, rb_argument);
|
||||
}
|
||||
|
||||
if (RARRAY_LEN(rb_out_args) == 0) {
|
||||
return Qnil;
|
||||
} else {
|
||||
return rb_out_args;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
arguments_init(GArray **in_args, GArray **out_args, GPtrArray **args_metadata)
|
||||
{
|
||||
*in_args = g_array_new(FALSE, FALSE, sizeof(GIArgument));
|
||||
*out_args = g_array_new(FALSE, FALSE, sizeof(GIArgument));
|
||||
*args_metadata = g_ptr_array_new_with_free_func(arg_metadata_free);
|
||||
}
|
||||
|
||||
static void
|
||||
arguments_free(GArray *in_args, GArray *out_args, GPtrArray *args_metadata)
|
||||
{
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < args_metadata->len; i++) {
|
||||
RBGIArgMetadata *metadata;
|
||||
gint in_arg_index;
|
||||
|
||||
metadata = g_ptr_array_index(args_metadata, i);
|
||||
if (metadata->direction == GI_DIRECTION_IN ||
|
||||
metadata->direction == GI_DIRECTION_INOUT) {
|
||||
in_arg_index = metadata->in_arg_index;
|
||||
if (in_arg_index != -1) {
|
||||
GIArgument *argument;
|
||||
argument = &(g_array_index(in_args, GIArgument, in_arg_index));
|
||||
rb_gi_in_argument_free(argument, &(metadata->arg_info));
|
||||
}
|
||||
} else {
|
||||
GIArgument *argument;
|
||||
argument = &(g_array_index(out_args, GIArgument,
|
||||
metadata->out_arg_index));
|
||||
rb_gi_out_argument_fin(argument, &(metadata->arg_info));
|
||||
}
|
||||
}
|
||||
|
||||
g_array_unref(in_args);
|
||||
g_array_unref(out_args);
|
||||
g_ptr_array_unref(args_metadata);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GIFunctionInfo *info;
|
||||
GArray *in_args;
|
||||
GArray *out_args;
|
||||
GIArgument *return_value;
|
||||
GError **error;
|
||||
gboolean succeeded;
|
||||
} InvokeData;
|
||||
|
||||
static void
|
||||
rb_gi_function_info_invoke_raw_call(InvokeData *data)
|
||||
{
|
||||
data->succeeded =
|
||||
g_function_info_invoke(data->info,
|
||||
(GIArgument *)(data->in_args->data),
|
||||
data->in_args->len,
|
||||
(GIArgument *)(data->out_args->data),
|
||||
data->out_args->len,
|
||||
data->return_value,
|
||||
data->error);
|
||||
}
|
||||
|
||||
static RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_TYPE
|
||||
rb_gi_function_info_invoke_raw_call_without_gvl_body(void *user_data)
|
||||
{
|
||||
InvokeData *data = (InvokeData *)user_data;
|
||||
|
||||
rb_gi_function_info_invoke_raw_call(data);
|
||||
|
||||
return RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_VALUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gobject_based_p(GIBaseInfo *info)
|
||||
{
|
||||
GIBaseInfo *container_info;
|
||||
GIRegisteredTypeInfo *registered_type_info;
|
||||
|
||||
container_info = g_base_info_get_container(info);
|
||||
if (g_base_info_get_type(container_info) != GI_INFO_TYPE_STRUCT) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
registered_type_info = (GIRegisteredTypeInfo *)container_info;
|
||||
if (g_registered_type_info_get_type_init(registered_type_info)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_gi_function_info_invoke_raw(GIFunctionInfo *info, VALUE rb_options,
|
||||
GIArgument *return_value)
|
||||
{
|
||||
GICallableInfo *callable_info;
|
||||
GIArgument receiver;
|
||||
GArray *in_args, *out_args;
|
||||
GPtrArray *args_metadata;
|
||||
VALUE rb_out_args = Qnil;
|
||||
gboolean succeeded;
|
||||
GError *error = NULL;
|
||||
gboolean unlock_gvl = FALSE;
|
||||
VALUE rb_receiver, rb_arguments, rb_unlock_gvl;
|
||||
|
||||
if (RB_TYPE_P(rb_options, RUBY_T_ARRAY)) {
|
||||
rb_receiver = Qnil;
|
||||
rb_arguments = rb_options;
|
||||
rb_unlock_gvl = Qnil;
|
||||
} else if (NIL_P(rb_options)) {
|
||||
rb_receiver = Qnil;
|
||||
rb_arguments = rb_ary_new();
|
||||
rb_unlock_gvl = Qnil;
|
||||
} else {
|
||||
rb_options = rbg_check_hash_type(rb_options);
|
||||
rbg_scan_options(rb_options,
|
||||
"receiver", &rb_receiver,
|
||||
"arguments", &rb_arguments,
|
||||
"unlock_gvl", &rb_unlock_gvl,
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (NIL_P(rb_receiver)) {
|
||||
receiver.v_pointer = NULL;
|
||||
} else {
|
||||
if (gobject_based_p((GIBaseInfo *)info)) {
|
||||
receiver.v_pointer = RVAL2GOBJ(rb_receiver);
|
||||
} else {
|
||||
receiver.v_pointer = DATA_PTR(rb_receiver);
|
||||
}
|
||||
}
|
||||
rb_arguments = rbg_to_array(rb_arguments);
|
||||
if (!NIL_P(rb_unlock_gvl) && RVAL2CBOOL(rb_unlock_gvl)) {
|
||||
unlock_gvl = TRUE;
|
||||
}
|
||||
|
||||
callable_info = (GICallableInfo *)info;
|
||||
arguments_init(&in_args, &out_args, &args_metadata);
|
||||
if (receiver.v_pointer) {
|
||||
g_array_append_val(in_args, receiver);
|
||||
}
|
||||
arguments_from_ruby(callable_info, rb_arguments,
|
||||
in_args, out_args, args_metadata);
|
||||
{
|
||||
InvokeData data;
|
||||
data.info = info;
|
||||
data.in_args = in_args;
|
||||
data.out_args = out_args;
|
||||
data.return_value = return_value;
|
||||
data.error = &error;
|
||||
if (unlock_gvl) {
|
||||
rb_thread_call_without_gvl(
|
||||
rb_gi_function_info_invoke_raw_call_without_gvl_body, &data,
|
||||
NULL, NULL);
|
||||
} else {
|
||||
rb_gi_function_info_invoke_raw_call(&data);
|
||||
}
|
||||
succeeded = data.succeeded;
|
||||
}
|
||||
|
||||
if (succeeded) {
|
||||
rb_out_args = out_arguments_to_ruby(callable_info,
|
||||
in_args, out_args,
|
||||
args_metadata);
|
||||
}
|
||||
arguments_free(in_args, out_args, args_metadata);
|
||||
if (!succeeded) {
|
||||
RG_RAISE_ERROR(error);
|
||||
}
|
||||
|
||||
if (!NIL_P(rb_out_args) && RARRAY_LEN(rb_out_args) == 1) {
|
||||
VALUE rb_out_arg;
|
||||
rb_out_arg = RARRAY_PTR(rb_out_args)[0];
|
||||
if (rb_obj_is_kind_of(rb_out_arg, rb_cGLibError)) {
|
||||
rb_exc_raise(rb_out_arg);
|
||||
}
|
||||
}
|
||||
|
||||
return rb_out_args;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_invoke(VALUE self, VALUE rb_options)
|
||||
{
|
||||
GIFunctionInfo *info;
|
||||
GICallableInfo *callable_info;
|
||||
GIArgument return_value;
|
||||
VALUE rb_out_args;
|
||||
VALUE rb_return_value;
|
||||
|
||||
info = SELF(self);
|
||||
/* TODO: use rb_protect() */
|
||||
rb_out_args = rb_gi_function_info_invoke_raw(info,
|
||||
rb_options,
|
||||
&return_value);
|
||||
|
||||
callable_info = (GICallableInfo *)info;
|
||||
rb_return_value = GI_RETURN_ARGUMENT2RVAL(&return_value, callable_info);
|
||||
|
||||
if (NIL_P(rb_out_args)) {
|
||||
return rb_return_value;
|
||||
} else {
|
||||
GITypeInfo return_value_info;
|
||||
g_callable_info_load_return_type(callable_info, &return_value_info);
|
||||
if (g_type_info_get_tag(&return_value_info) != GI_TYPE_TAG_VOID) {
|
||||
rb_ary_unshift(rb_out_args, rb_return_value);
|
||||
}
|
||||
if (RARRAY_LEN(rb_out_args) == 1) {
|
||||
return RARRAY_PTR(rb_out_args)[0];
|
||||
} else {
|
||||
return rb_out_args;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_function_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo)
|
||||
{
|
||||
rb_cGLibError = rb_const_get(mGLib, rb_intern("Error"));
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_FUNCTION_INFO, "FunctionInfo", rb_mGI,
|
||||
rb_cGICallableInfo);
|
||||
|
||||
rb_iv_set(RG_TARGET_NAMESPACE, callbacks_key, rb_hash_new());
|
||||
|
||||
callback_finders = g_ptr_array_new();
|
||||
rb_gi_callback_register_finder(source_func_callback_finder);
|
||||
|
||||
RG_DEF_METHOD(symbol, 0);
|
||||
RG_DEF_METHOD(flags, 0);
|
||||
RG_DEF_METHOD(property, 0);
|
||||
RG_DEF_METHOD(vfunc, 0);
|
||||
RG_DEF_METHOD(invoke, 1);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_I_FUNCTION_INFO_FLAGS, "FunctionInfoFlags", rb_mGI);
|
||||
|
||||
rb_gi_method_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_constructor_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
}
|
@ -0,0 +1,222 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIInterfaceInfo
|
||||
#define SELF(self) (RVAL2GI_INTERFACE_INFO(self))
|
||||
|
||||
GType
|
||||
gi_interface_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIInterfaceInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_prerequisites(VALUE self)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_interface_info_get_n_prerequisites(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_prerequisite(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_prerequisite(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_properties(VALUE self)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_interface_info_get_n_properties(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_property(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_property(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_methods(VALUE self)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_interface_info_get_n_methods(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_method(VALUE self, VALUE rb_n_or_name)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
GIFunctionInfo *function_info;
|
||||
|
||||
info = SELF(self);
|
||||
if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) {
|
||||
gint n;
|
||||
n = NUM2INT(rb_n_or_name);
|
||||
function_info = g_interface_info_get_method(info, n);
|
||||
} else {
|
||||
const char *name;
|
||||
name = RVAL2CSTR(rb_n_or_name);
|
||||
function_info = g_interface_info_find_method(info, name);
|
||||
}
|
||||
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(function_info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_signals(VALUE self)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_interface_info_get_n_signals(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_signal(VALUE self, VALUE rb_n_or_name)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
GISignalInfo *signal_info;
|
||||
|
||||
info = SELF(self);
|
||||
if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) {
|
||||
gint n;
|
||||
n = NUM2INT(rb_n_or_name);
|
||||
signal_info = g_interface_info_get_signal(info, n);
|
||||
} else {
|
||||
#ifdef HAVE_G_INTERFACE_INFO_FIND_SIGNAL
|
||||
const char *name;
|
||||
name = RVAL2CSTR(rb_n_or_name);
|
||||
signal_info = g_interface_info_find_signal(info, name);
|
||||
#else
|
||||
rb_raise(rb_eArgError,
|
||||
"g_interface_info_find_signal() is defined "
|
||||
"since GObjectIntrospection 1.34");
|
||||
#endif
|
||||
}
|
||||
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(signal_info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_vfuncs(VALUE self)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_interface_info_get_n_vfuncs(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_vfunc(VALUE self, VALUE rb_n_or_name)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
GIVFuncInfo *vfunc_info;
|
||||
|
||||
info = SELF(self);
|
||||
if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) {
|
||||
gint n;
|
||||
n = NUM2INT(rb_n_or_name);
|
||||
vfunc_info = g_interface_info_get_vfunc(info, n);
|
||||
} else {
|
||||
const gchar *name;
|
||||
name = RVAL2CSTR(rb_n_or_name);
|
||||
vfunc_info = g_interface_info_find_vfunc(info, name);
|
||||
}
|
||||
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(vfunc_info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_constants(VALUE self)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_interface_info_get_n_constants(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_constant(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_constant(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_iface_struct(VALUE self)
|
||||
{
|
||||
GIInterfaceInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_iface_struct(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_interface_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_INTERFACE_INFO, "InterfaceInfo", rb_mGI,
|
||||
rb_cGIRegisteredTypeInfo);
|
||||
|
||||
RG_DEF_METHOD(n_prerequisites, 0);
|
||||
RG_DEF_METHOD(get_prerequisite, 1);
|
||||
RG_DEF_METHOD(n_properties, 0);
|
||||
RG_DEF_METHOD(get_property, 1);
|
||||
RG_DEF_METHOD(n_methods, 0);
|
||||
RG_DEF_METHOD(get_method, 1);
|
||||
RG_DEF_METHOD(n_signals, 0);
|
||||
RG_DEF_METHOD(get_signal, 1);
|
||||
RG_DEF_METHOD(n_vfuncs, 0);
|
||||
RG_DEF_METHOD(get_vfunc, 1);
|
||||
RG_DEF_METHOD(n_constants, 0);
|
||||
RG_DEF_METHOD(get_constant, 1);
|
||||
RG_DEF_METHOD(iface_struct, 0);
|
||||
}
|
@ -0,0 +1,162 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGILoader
|
||||
|
||||
static const gchar *boxed_class_converters_name = "@@boxed_class_converters";
|
||||
|
||||
static VALUE
|
||||
rg_s_define_class(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass)
|
||||
{
|
||||
VALUE rb_gtype, rb_name, rb_module;
|
||||
VALUE rb_options, rb_parent;
|
||||
GType gtype;
|
||||
|
||||
rb_scan_args(argc, argv, "31", &rb_gtype, &rb_name, &rb_module, &rb_options);
|
||||
rbg_scan_options(rb_options,
|
||||
"parent", &rb_parent,
|
||||
NULL);
|
||||
|
||||
gtype = NUM2ULONG(rb_to_int(rb_gtype));
|
||||
return G_DEF_CLASS_WITH_PARENT(gtype, RVAL2CSTR(rb_name),
|
||||
rb_module, rb_parent);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_define_interface(G_GNUC_UNUSED VALUE klass,
|
||||
VALUE rb_gtype, VALUE rb_name, VALUE rb_module)
|
||||
{
|
||||
GType gtype;
|
||||
|
||||
gtype = NUM2ULONG(rb_to_int(rb_gtype));
|
||||
return G_DEF_INTERFACE(gtype, RVAL2CSTR(rb_name), rb_module);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
struct_alloc(VALUE klass)
|
||||
{
|
||||
VALUE rb_size;
|
||||
|
||||
rb_size = rb_iv_get(klass, "@size");
|
||||
return Data_Wrap_Struct(klass, NULL, xfree, xmalloc(NUM2ULONG(rb_size)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_define_struct(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass)
|
||||
{
|
||||
VALUE rb_size, rb_name, rb_module;
|
||||
VALUE rb_options, rb_parent;
|
||||
VALUE rb_class;
|
||||
|
||||
rb_scan_args(argc, argv, "31", &rb_size, &rb_name, &rb_module, &rb_options);
|
||||
rbg_scan_options(rb_options,
|
||||
"parent", &rb_parent,
|
||||
NULL);
|
||||
|
||||
rb_size = rb_to_int(rb_size);
|
||||
if (NIL_P(rb_parent)) {
|
||||
rb_parent = rb_cObject;
|
||||
}
|
||||
rb_class = rb_define_class_under(rb_module, RVAL2CSTR(rb_name), rb_parent);
|
||||
rb_iv_set(rb_class, "@size", rb_size);
|
||||
rb_define_alloc_func(rb_class, struct_alloc);
|
||||
return rb_class;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GType type;
|
||||
VALUE rb_converters;
|
||||
VALUE rb_converter;
|
||||
} BoxedInstance2RObjData;
|
||||
|
||||
static void
|
||||
boxed_class_converter_free(gpointer user_data)
|
||||
{
|
||||
BoxedInstance2RObjData *data = user_data;
|
||||
rb_ary_delete(data->rb_converters, data->rb_converter);
|
||||
g_free(data);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
boxed_instance2robj(gpointer instance, gpointer user_data)
|
||||
{
|
||||
BoxedInstance2RObjData *data = user_data;
|
||||
VALUE default_rb_instance;
|
||||
VALUE klass;
|
||||
gint flags = 0;
|
||||
ID id_call;
|
||||
|
||||
default_rb_instance = rbgobj_make_boxed_default(instance, data->type);
|
||||
CONST_ID(id_call, "call");
|
||||
klass = rb_funcall(data->rb_converter, id_call, 1, default_rb_instance);
|
||||
return rbgobj_make_boxed_raw(instance, data->type, klass, flags);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_register_boxed_class_converter(VALUE klass, VALUE rb_gtype)
|
||||
{
|
||||
RGConvertTable table;
|
||||
BoxedInstance2RObjData *data;
|
||||
ID id_to_i;
|
||||
VALUE boxed_class_converters;
|
||||
|
||||
memset(&table, 0, sizeof(RGConvertTable));
|
||||
CONST_ID(id_to_i, "to_i");
|
||||
table.type = NUM2UINT(rb_funcall(rb_gtype, id_to_i, 0));
|
||||
table.klass = Qnil;
|
||||
table.instance2robj = boxed_instance2robj;
|
||||
|
||||
data = g_new(BoxedInstance2RObjData, 1);
|
||||
data->type = table.type;
|
||||
data->rb_converter = rb_block_proc();
|
||||
boxed_class_converters = rb_cv_get(klass, boxed_class_converters_name);
|
||||
rb_ary_push(boxed_class_converters, data->rb_converter);
|
||||
table.user_data = data;
|
||||
table.notify = boxed_class_converter_free;
|
||||
|
||||
rbgobj_convert_define(&table);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_start_callback_dispatch_thread(G_GNUC_UNUSED VALUE klass)
|
||||
{
|
||||
rbgutil_start_callback_dispatch_thread();
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_loader_init(VALUE rb_mGI)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = rb_define_class_under(rb_mGI, "Loader", rb_cObject);
|
||||
|
||||
rb_cv_set(RG_TARGET_NAMESPACE, boxed_class_converters_name, rb_ary_new());
|
||||
|
||||
RG_DEF_SMETHOD(define_class, -1);
|
||||
RG_DEF_SMETHOD(define_interface, 3);
|
||||
RG_DEF_SMETHOD(define_struct, -1);
|
||||
RG_DEF_SMETHOD(register_boxed_class_converter, 1);
|
||||
RG_DEF_SMETHOD(start_callback_dispatch_thread, 0);
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIMethodInfo
|
||||
#define SELF(self) RVAL2GI_FUNCTION_INFO(self)
|
||||
|
||||
GType
|
||||
gi_method_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIMethodInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_invoke(VALUE self, VALUE rb_options)
|
||||
{
|
||||
GIFunctionInfo *info;
|
||||
GICallableInfo *callable_info;
|
||||
GIArgument return_value;
|
||||
VALUE rb_out_args;
|
||||
VALUE rb_return_value;
|
||||
|
||||
info = SELF(self);
|
||||
|
||||
/* TODO: use rb_protect */
|
||||
rb_out_args = rb_gi_function_info_invoke_raw(info,
|
||||
rb_options,
|
||||
&return_value);
|
||||
|
||||
callable_info = (GICallableInfo *)info;
|
||||
rb_return_value = GI_RETURN_ARGUMENT2RVAL(&return_value, callable_info);
|
||||
|
||||
if (NIL_P(rb_out_args)) {
|
||||
return rb_return_value;
|
||||
} else {
|
||||
GITypeInfo return_value_info;
|
||||
g_callable_info_load_return_type(callable_info, &return_value_info);
|
||||
if (g_type_info_get_tag(&return_value_info) != GI_TYPE_TAG_VOID) {
|
||||
rb_ary_unshift(rb_out_args, rb_return_value);
|
||||
}
|
||||
if (RARRAY_LEN(rb_out_args) == 1) {
|
||||
return RARRAY_PTR(rb_out_args)[0];
|
||||
} else {
|
||||
return rb_out_args;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_method_info_init(VALUE rb_mGI, VALUE rb_cGIFunctionInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_METHOD_INFO, "MethodInfo", rb_mGI,
|
||||
rb_cGIFunctionInfo);
|
||||
|
||||
RG_DEF_METHOD(invoke, 1);
|
||||
}
|
@ -0,0 +1,345 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIObjectInfo
|
||||
#define SELF(self) (RVAL2GI_OBJECT_INFO(self))
|
||||
|
||||
GType
|
||||
gi_object_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIObjectInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type_name(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_object_info_get_type_name(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type_init(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_object_info_get_type_init(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_abstract_p(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_object_info_get_abstract(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_fundamental_p(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_object_info_get_fundamental(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_parent(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_parent(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_interfaces(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_object_info_get_n_interfaces(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_interface(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_interface(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_fields(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_object_info_get_n_fields(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_field(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_field(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_field_value(VALUE self, VALUE rb_object, VALUE rb_n)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
gint n;
|
||||
GIFieldInfo *field_info;
|
||||
VALUE rb_value;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
field_info = g_object_info_get_field(info, n);
|
||||
rb_value = rb_gi_field_info_get_field_raw(field_info, RVAL2GOBJ(rb_object));
|
||||
g_base_info_unref(field_info);
|
||||
|
||||
return rb_value;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_field_value(VALUE self, VALUE rb_object, VALUE rb_n, VALUE rb_value)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
gint n;
|
||||
GIFieldInfo *field_info;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
field_info = g_object_info_get_field(info, n);
|
||||
rb_gi_field_info_set_field_raw(field_info, RVAL2GOBJ(rb_object), rb_value);
|
||||
/* TODO: use rb_ensure() to unref field_info. */
|
||||
g_base_info_unref(field_info);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_properties(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_object_info_get_n_properties(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_property(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_property(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_methods(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_object_info_get_n_methods(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_method(VALUE self, VALUE rb_n_or_name)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
GIFunctionInfo *function_info;
|
||||
|
||||
info = SELF(self);
|
||||
if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) {
|
||||
gint n;
|
||||
n = NUM2INT(rb_n_or_name);
|
||||
function_info = g_object_info_get_method(info, n);
|
||||
} else {
|
||||
const gchar *name;
|
||||
name = RVAL2CSTR(rb_n_or_name);
|
||||
function_info = g_object_info_find_method(info, name);
|
||||
}
|
||||
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(function_info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_signals(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_object_info_get_n_signals(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_signal(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_signal(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_vfuncs(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_object_info_get_n_vfuncs(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_vfunc(VALUE self, VALUE rb_n_or_name)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
GIVFuncInfo *vfunc_info;
|
||||
|
||||
info = SELF(self);
|
||||
if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) {
|
||||
gint n;
|
||||
n = NUM2INT(rb_n_or_name);
|
||||
vfunc_info = g_object_info_get_vfunc(info, n);
|
||||
} else {
|
||||
const gchar *name;
|
||||
name = RVAL2CSTR(rb_n_or_name);
|
||||
vfunc_info = g_object_info_find_vfunc(info, name);
|
||||
}
|
||||
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(vfunc_info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_constants(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_object_info_get_n_constants(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_constant(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_constant(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_unref_function(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_object_info_get_unref_function(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_ref_function(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_object_info_get_ref_function(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_value_function(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_object_info_get_set_value_function(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_value_function(VALUE self)
|
||||
{
|
||||
GIObjectInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_object_info_get_get_value_function(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_object_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_OBJECT_INFO, "ObjectInfo", rb_mGI,
|
||||
rb_cGIRegisteredTypeInfo);
|
||||
|
||||
RG_DEF_METHOD(type_name, 0);
|
||||
RG_DEF_METHOD(type_init, 0);
|
||||
RG_DEF_METHOD_P(abstract, 0);
|
||||
RG_DEF_METHOD_P(fundamental, 0);
|
||||
RG_DEF_METHOD(parent, 0);
|
||||
RG_DEF_METHOD(n_interfaces, 0);
|
||||
RG_DEF_METHOD(get_interface, 1);
|
||||
RG_DEF_METHOD(n_fields, 0);
|
||||
RG_DEF_METHOD(get_field, 1);
|
||||
RG_DEF_METHOD(get_field_value, 2);
|
||||
RG_DEF_METHOD(set_field_value, 3);
|
||||
RG_DEF_METHOD(n_properties, 0);
|
||||
RG_DEF_METHOD(get_property, 1);
|
||||
RG_DEF_METHOD(n_methods, 0);
|
||||
RG_DEF_METHOD(get_method, 1);
|
||||
RG_DEF_METHOD(n_signals, 0);
|
||||
RG_DEF_METHOD(get_signal, 1);
|
||||
RG_DEF_METHOD(n_vfuncs, 0);
|
||||
RG_DEF_METHOD(get_vfunc, 1);
|
||||
RG_DEF_METHOD(n_constants, 0);
|
||||
RG_DEF_METHOD(get_constant, 1);
|
||||
RG_DEF_METHOD(unref_function, 0);
|
||||
RG_DEF_METHOD(ref_function, 0);
|
||||
RG_DEF_METHOD(set_value_function, 0);
|
||||
RG_DEF_METHOD(get_value_function, 0);
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef RB_GI_PRIVATE_H
|
||||
#define RB_GI_PRIVATE_H
|
||||
|
||||
#include <ruby.h>
|
||||
#include <rbgobject.h>
|
||||
#include <glib-enum-types.h>
|
||||
|
||||
#include <girffi.h>
|
||||
#include "gobject-introspection-enum-types.h"
|
||||
|
||||
#include "rbgiversion.h"
|
||||
|
||||
#include "rb-gi-types.h"
|
||||
#include "rb-gi-conversions.h"
|
||||
|
||||
#include "rb-gobject-introspection.h"
|
||||
|
||||
#ifndef RB_TYPE_P
|
||||
# define RB_TYPE_P(object, type) (TYPE(object) == type)
|
||||
#endif
|
||||
|
||||
extern void Init_gobject_introspection(void);
|
||||
|
||||
void rb_gi_argument_init (void);
|
||||
|
||||
void rb_gi_type_tag_init (VALUE rb_mGI);
|
||||
void rb_gi_base_info_init (VALUE rb_mGI);
|
||||
void rb_gi_callable_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIBaseInfo);
|
||||
void rb_gi_function_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGICallableInfo);
|
||||
void rb_gi_method_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIFunctionInfo);
|
||||
void rb_gi_constructor_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIFunctionInfo);
|
||||
void rb_gi_callback_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGICallableInfo);
|
||||
void rb_gi_registered_type_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIBaseInfo);
|
||||
void rb_gi_struct_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIRegisteredTypeInfo);
|
||||
void rb_gi_boxed_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIRegisteredTypeInfo);
|
||||
void rb_gi_enum_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIRegisteredTypeInfo);
|
||||
void rb_gi_flags_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIEnumInfo);
|
||||
void rb_gi_object_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIRegisteredTypeInfo);
|
||||
void rb_gi_interface_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIRegisteredTypeInfo);
|
||||
void rb_gi_constant_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIBaseInfo);
|
||||
void rb_gi_union_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIRegisteredTypeInfo);
|
||||
void rb_gi_value_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIBaseInfo);
|
||||
void rb_gi_signal_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGICallableInfo);
|
||||
void rb_gi_vfunc_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGICallableInfo);
|
||||
void rb_gi_property_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIBaseInfo);
|
||||
void rb_gi_field_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIBaseInfo);
|
||||
void rb_gi_arg_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIBaseInfo);
|
||||
void rb_gi_type_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIBaseInfo);
|
||||
void rb_gi_unresolved_info_init (VALUE rb_mGI,
|
||||
VALUE rb_cGIBaseInfo);
|
||||
void rb_gi_repository_init (VALUE rb_mGI);
|
||||
void rb_gi_loader_init (VALUE rb_mGI);
|
||||
|
||||
VALUE rb_gi_function_info_invoke_raw (GIFunctionInfo *info,
|
||||
VALUE rb_options,
|
||||
GIArgument *return_value);
|
||||
|
||||
VALUE rb_gi_field_info_get_field_raw (GIFieldInfo *info,
|
||||
gpointer memory);
|
||||
void rb_gi_field_info_set_field_raw (GIFieldInfo *info,
|
||||
gpointer memory,
|
||||
VALUE rb_field_value);
|
||||
|
||||
#endif
|
@ -0,0 +1,77 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIPropertyInfo
|
||||
#define SELF(self) RVAL2GI_BASE_INFO(self)
|
||||
|
||||
GType
|
||||
gi_property_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIPropertyInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_flags(VALUE self)
|
||||
{
|
||||
GIPropertyInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_property_info_get_flags(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type(VALUE self)
|
||||
{
|
||||
GIPropertyInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_property_info_get_type(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_ownership_transfer(VALUE self)
|
||||
{
|
||||
GIPropertyInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_TRANSFER2RVAL(g_property_info_get_ownership_transfer(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_property_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_PROPERTY_INFO, "PropertyInfo", rb_mGI,
|
||||
rb_cGICallableInfo);
|
||||
|
||||
RG_DEF_METHOD(flags, 0);
|
||||
RG_DEF_METHOD(type, 0);
|
||||
RG_DEF_METHOD(ownership_transfer, 0);
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIRegisteredTypeInfo
|
||||
#define SELF(self) (RVAL2GI_REGISTERED_TYPE_INFO(self))
|
||||
|
||||
GType
|
||||
gi_registered_type_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIRegisteredTypeInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type_name(VALUE self)
|
||||
{
|
||||
GIRegisteredTypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_registered_type_info_get_type_name(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type_init(VALUE self)
|
||||
{
|
||||
GIRegisteredTypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CSTR2RVAL(g_registered_type_info_get_type_init(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_gtype(VALUE self)
|
||||
{
|
||||
GIRegisteredTypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return rbgobj_gtype_new(g_registered_type_info_get_g_type(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_registered_type_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_REGISTERED_TYPE_INFO,
|
||||
"RegisteredTypeInfo",
|
||||
rb_mGI,
|
||||
rb_cGIBaseInfo);
|
||||
|
||||
RG_DEF_METHOD(type_name, 0);
|
||||
RG_DEF_METHOD(type_init, 0);
|
||||
RG_DEF_METHOD(gtype, 0);
|
||||
|
||||
rb_gi_struct_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_boxed_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_enum_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_object_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_interface_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
rb_gi_union_info_init(rb_mGI, RG_TARGET_NAMESPACE);
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIRepository
|
||||
#define SELF(self) RVAL2GI_REPOSITORY(self)
|
||||
|
||||
static VALUE
|
||||
rg_s_default(G_GNUC_UNUSED VALUE klass)
|
||||
{
|
||||
return GOBJ2RVAL(g_irepository_get_default());
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_require(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rb_namespace, rb_version, rb_flags;
|
||||
const gchar *namespace_, *version;
|
||||
GIRepositoryLoadFlags flags = 0;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "12", &rb_namespace, &rb_version, &rb_flags);
|
||||
|
||||
namespace_ = RVAL2CSTR(rb_namespace);
|
||||
version = RVAL2CSTR_ACCEPT_NIL(rb_version);
|
||||
if (!NIL_P(rb_flags)) {
|
||||
flags = RVAL2GI_REPOSITORY_LOAD_FLAGS(rb_flags);
|
||||
}
|
||||
|
||||
g_irepository_require(SELF(self), namespace_, version, flags, &error);
|
||||
if (error) {
|
||||
RG_RAISE_ERROR(error);
|
||||
}
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_dependencies(VALUE self, VALUE rb_namespace)
|
||||
{
|
||||
GIRepository *repository;
|
||||
const gchar *namespace_;
|
||||
VALUE rb_dependencies;
|
||||
gchar **dependencies;
|
||||
gint i;
|
||||
|
||||
repository = SELF(self);
|
||||
namespace_ = RVAL2CSTR(rb_namespace);
|
||||
dependencies = g_irepository_get_dependencies(repository, namespace_);
|
||||
rb_dependencies = rb_ary_new();
|
||||
for (i = 0; dependencies[i]; i++) {
|
||||
rb_ary_push(rb_dependencies, CSTR2RVAL(dependencies[i]));
|
||||
}
|
||||
g_strfreev(dependencies);
|
||||
|
||||
return rb_dependencies;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_loaded_namespaces(VALUE self)
|
||||
{
|
||||
GIRepository *repository;
|
||||
VALUE rb_namespaces;
|
||||
gchar **namespaces;
|
||||
gint i;
|
||||
|
||||
repository = SELF(self);
|
||||
namespaces = g_irepository_get_loaded_namespaces(repository);
|
||||
rb_namespaces = rb_ary_new();
|
||||
for (i = 0; namespaces[i]; i++) {
|
||||
rb_ary_push(rb_namespaces, CSTR2RVAL(namespaces[i]));
|
||||
}
|
||||
g_strfreev(namespaces);
|
||||
|
||||
return rb_namespaces;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_n_infos(VALUE self, VALUE rb_namespace)
|
||||
{
|
||||
const gchar *namespace_;
|
||||
gint n_infos;
|
||||
|
||||
namespace_ = RVAL2CSTR(rb_namespace);
|
||||
n_infos = g_irepository_get_n_infos(SELF(self), namespace_);
|
||||
|
||||
return INT2NUM(n_infos);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_info(VALUE self, VALUE rb_namespace, VALUE rb_n)
|
||||
{
|
||||
GIRepository *repository;
|
||||
const gchar *namespace_;
|
||||
gint n;
|
||||
GIBaseInfo *info;
|
||||
|
||||
repository = SELF(self);
|
||||
namespace_ = RVAL2CSTR(rb_namespace);
|
||||
n = NUM2INT(rb_n);
|
||||
info = g_irepository_get_info(repository, namespace_, n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_find(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
GIBaseInfo *info;
|
||||
|
||||
if (argc == 1) {
|
||||
VALUE rb_gtype;
|
||||
GType gtype;
|
||||
rb_gtype = argv[0];
|
||||
gtype = NUM2UINT(rb_gtype);
|
||||
info = g_irepository_find_by_gtype(SELF(self), gtype);
|
||||
} else {
|
||||
VALUE rb_namespace, rb_name;
|
||||
const gchar *namespace_, *name;
|
||||
|
||||
rb_scan_args(argc, argv, "2", &rb_namespace, &rb_name);
|
||||
namespace_ = RVAL2CSTR(rb_namespace);
|
||||
name = RVAL2CSTR(rb_name);
|
||||
info = g_irepository_find_by_name(SELF(self), namespace_, name);
|
||||
}
|
||||
|
||||
return GI_BASE_INFO2RVAL(info);
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_repository_init(VALUE rb_mGI)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IREPOSITORY, "Repository", rb_mGI);
|
||||
|
||||
RG_DEF_SMETHOD(default, 0);
|
||||
RG_DEF_METHOD(require, -1);
|
||||
RG_DEF_METHOD(get_dependencies, 1);
|
||||
RG_DEF_METHOD(loaded_namespaces, 0);
|
||||
RG_DEF_METHOD(get_n_infos, 1);
|
||||
RG_DEF_METHOD(get_info, 2);
|
||||
RG_DEF_METHOD(find, -1);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_I_REPOSITORY_LOAD_FLAGS, "RepositoryLoadFlags", rb_mGI);
|
||||
G_DEF_CLASS(G_TYPE_I_REPOSITORY_ERROR, "RepositoryError", rb_mGI);
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGISignalInfo
|
||||
#define SELF(self) RVAL2GI_BASE_INFO(self)
|
||||
|
||||
GType
|
||||
gi_signal_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GISignalInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_flags(VALUE self)
|
||||
{
|
||||
GISignalInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_SIGNAL_FLAGS2RVAL(g_signal_info_get_flags(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_class_closure(VALUE self)
|
||||
{
|
||||
GISignalInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_signal_info_get_class_closure(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_true_stops_emit_p(VALUE self)
|
||||
{
|
||||
GISignalInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_signal_info_true_stops_emit(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_signal_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_SIGNAL_INFO, "SignalInfo", rb_mGI,
|
||||
rb_cGICallableInfo);
|
||||
|
||||
RG_DEF_METHOD(flags, 0);
|
||||
RG_DEF_METHOD(class_closure, 0);
|
||||
RG_DEF_METHOD_P(true_stops_emit, 0);
|
||||
}
|
@ -0,0 +1,190 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIStructInfo
|
||||
#define SELF(self) (RVAL2GI_STRUCT_INFO(self))
|
||||
|
||||
GType
|
||||
gi_struct_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIStructInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_fields(VALUE self)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_struct_info_get_n_fields(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_field(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_struct_info_get_field(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_field_value(VALUE self, VALUE rb_struct, VALUE rb_n)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
gint n;
|
||||
GIFieldInfo *field_info;
|
||||
VALUE rb_value;
|
||||
gpointer instance;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
field_info = g_struct_info_get_field(info, n);
|
||||
if (rb_respond_to(rb_struct, rb_intern("gtype"))) {
|
||||
VALUE rb_gtype;
|
||||
GType gtype;
|
||||
rb_gtype = rb_funcall(rb_struct, rb_intern("gtype"), 0);
|
||||
gtype = NUM2UINT(rb_funcall(rb_gtype, rb_intern("to_i"), 0));
|
||||
instance = RVAL2BOXED(rb_struct, gtype);
|
||||
} else {
|
||||
Data_Get_Struct(rb_struct, void, instance);
|
||||
}
|
||||
rb_value = rb_gi_field_info_get_field_raw(field_info, instance);
|
||||
g_base_info_unref(field_info);
|
||||
|
||||
return rb_value;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_field_value(VALUE self, VALUE rb_struct, VALUE rb_n, VALUE rb_value)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
gint n;
|
||||
GIFieldInfo *field_info;
|
||||
GType gtype;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
field_info = g_struct_info_get_field(info, n);
|
||||
gtype = g_registered_type_info_get_g_type(info);
|
||||
rb_gi_field_info_set_field_raw(field_info,
|
||||
RVAL2BOXED(rb_struct, gtype),
|
||||
rb_value);
|
||||
/* TODO: use rb_ensure() to unref field_info. */
|
||||
g_base_info_unref(field_info);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_methods(VALUE self)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_struct_info_get_n_methods(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_method(VALUE self, VALUE rb_n_or_name)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
GIFunctionInfo *function_info;
|
||||
|
||||
info = SELF(self);
|
||||
if (RB_TYPE_P(rb_n_or_name, RUBY_T_FIXNUM)) {
|
||||
gint n;
|
||||
n = NUM2INT(rb_n_or_name);
|
||||
function_info = g_struct_info_get_method(info, n);
|
||||
} else {
|
||||
const gchar *name;
|
||||
name = RVAL2CSTR(rb_n_or_name);
|
||||
function_info = g_struct_info_find_method(info, name);
|
||||
}
|
||||
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(function_info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_size(VALUE self)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return UINT2NUM(g_struct_info_get_size(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_alignment(VALUE self)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return UINT2NUM(g_struct_info_get_alignment(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_gtype_struct_p(VALUE self)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_struct_info_is_gtype_struct(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_foreign_p(VALUE self)
|
||||
{
|
||||
GIStructInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_struct_info_is_foreign(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_struct_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_STRUCT_INFO, "StructInfo", rb_mGI,
|
||||
rb_cGIRegisteredTypeInfo);
|
||||
|
||||
RG_DEF_METHOD(n_fields, 0);
|
||||
RG_DEF_METHOD(get_field, 1);
|
||||
RG_DEF_METHOD(get_field_value, 2);
|
||||
RG_DEF_METHOD(set_field_value, 3);
|
||||
RG_DEF_METHOD(n_methods, 0);
|
||||
RG_DEF_METHOD(get_method, 1);
|
||||
RG_DEF_METHOD(size, 0);
|
||||
RG_DEF_METHOD(alignment, 0);
|
||||
RG_DEF_METHOD_P(gtype_struct, 0);
|
||||
RG_DEF_METHOD_P(foreign, 0);
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGITypeInfo
|
||||
#define SELF(self) (RVAL2GI_TYPE_INFO(self))
|
||||
|
||||
GType
|
||||
gi_type_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GITypeInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_gi_array_type_to_ruby(GIArrayType type)
|
||||
{
|
||||
if (type == (GIArrayType)-1) {
|
||||
return Qnil;
|
||||
} else {
|
||||
return GENUM2RVAL(type, G_TYPE_I_ARRAY_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_pointer_p(VALUE self)
|
||||
{
|
||||
GITypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_type_info_is_pointer(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_tag(VALUE self)
|
||||
{
|
||||
GITypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_TYPE_TAG2RVAL(g_type_info_get_tag(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_param_type(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GITypeInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_type_info_get_param_type(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_interface(VALUE self)
|
||||
{
|
||||
GITypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_type_info_get_interface(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_array_length(VALUE self)
|
||||
{
|
||||
GITypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_type_info_get_array_length(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_array_fixed_size(VALUE self)
|
||||
{
|
||||
GITypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_type_info_get_array_fixed_size(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_zero_terminated_p(VALUE self)
|
||||
{
|
||||
GITypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_type_info_is_zero_terminated(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_array_type(VALUE self)
|
||||
{
|
||||
GITypeInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_ARRAY_TYPE2RVAL(g_type_info_get_array_type(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_type_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_TYPE_INFO, "TypeInfo", rb_mGI,
|
||||
rb_cGIBaseInfo);
|
||||
|
||||
RG_DEF_METHOD_P(pointer, 0);
|
||||
RG_DEF_METHOD(tag, 0);
|
||||
RG_DEF_METHOD(get_param_type, 1);
|
||||
RG_DEF_METHOD(interface, 0);
|
||||
RG_DEF_METHOD(array_length, 0);
|
||||
RG_DEF_METHOD(array_fixed_size, 0);
|
||||
RG_DEF_METHOD_P(zero_terminated, 0);
|
||||
RG_DEF_METHOD(array_type, 0);
|
||||
|
||||
rb_undef_method(RG_TARGET_NAMESPACE, "name");
|
||||
|
||||
G_DEF_CLASS(G_TYPE_I_ARRAY_TYPE, "ArrayType", rb_mGI);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGITypeTag
|
||||
#define SELF(self) (RVAL2GI_TYPE_TAG(self))
|
||||
|
||||
static VALUE
|
||||
rg_to_s(VALUE self)
|
||||
{
|
||||
GITypeTag tag;
|
||||
|
||||
tag = SELF(self);
|
||||
return CSTR2RVAL(g_type_tag_to_string(tag));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_type_tag_init(VALUE rb_mGI)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_I_TYPE_TAG, "TypeTag", rb_mGI);
|
||||
|
||||
RG_DEF_METHOD(to_s, 0);
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef RB_GI_TYPES_H
|
||||
#define RB_GI_TYPES_H
|
||||
|
||||
#define GI_TYPE_CALLABLE_INFO (gi_callable_info_get_type())
|
||||
#define GI_TYPE_FUNCTION_INFO (gi_function_info_get_type())
|
||||
#define GI_TYPE_METHOD_INFO (gi_method_info_get_type())
|
||||
#define GI_TYPE_CONSTRUCTOR_INFO (gi_constructor_info_get_type())
|
||||
#define GI_TYPE_CALLBACK_INFO (gi_callback_info_get_type())
|
||||
#define GI_TYPE_REGISTERED_TYPE_INFO (gi_registered_type_info_get_type())
|
||||
#define GI_TYPE_STRUCT_INFO (gi_struct_info_get_type())
|
||||
#define GI_TYPE_BOXED_INFO (gi_boxed_info_get_type())
|
||||
#define GI_TYPE_ENUM_INFO (gi_enum_info_get_type())
|
||||
#define GI_TYPE_FLAGS_INFO (gi_flags_info_get_type())
|
||||
#define GI_TYPE_OBJECT_INFO (gi_object_info_get_type())
|
||||
#define GI_TYPE_INTERFACE_INFO (gi_interface_info_get_type())
|
||||
#define GI_TYPE_CONSTANT_INFO (gi_constant_info_get_type())
|
||||
#define GI_TYPE_UNION_INFO (gi_union_info_get_type())
|
||||
#define GI_TYPE_VALUE_INFO (gi_value_info_get_type())
|
||||
#define GI_TYPE_SIGNAL_INFO (gi_signal_info_get_type())
|
||||
#define GI_TYPE_VFUNC_INFO (gi_vfunc_info_get_type())
|
||||
#define GI_TYPE_PROPERTY_INFO (gi_property_info_get_type())
|
||||
#define GI_TYPE_FIELD_INFO (gi_field_info_get_type())
|
||||
#define GI_TYPE_ARG_INFO (gi_arg_info_get_type())
|
||||
#define GI_TYPE_TYPE_INFO (gi_type_info_get_type())
|
||||
#define GI_TYPE_UNRESOLVED_INFO (gi_unresolved_info_get_type())
|
||||
|
||||
GType gi_callable_info_get_type (void);
|
||||
GType gi_function_info_get_type (void);
|
||||
GType gi_method_info_get_type (void);
|
||||
GType gi_constructor_info_get_type (void);
|
||||
GType gi_callback_info_get_type (void);
|
||||
GType gi_registered_type_info_get_type (void);
|
||||
GType gi_struct_info_get_type (void);
|
||||
GType gi_boxed_info_get_type (void);
|
||||
GType gi_enum_info_get_type (void);
|
||||
GType gi_flags_info_get_type (void);
|
||||
GType gi_object_info_get_type (void);
|
||||
GType gi_interface_info_get_type (void);
|
||||
GType gi_constant_info_get_type (void);
|
||||
GType gi_union_info_get_type (void);
|
||||
GType gi_value_info_get_type (void);
|
||||
GType gi_signal_info_get_type (void);
|
||||
GType gi_vfunc_info_get_type (void);
|
||||
GType gi_property_info_get_type (void);
|
||||
GType gi_field_info_get_type (void);
|
||||
GType gi_arg_info_get_type (void);
|
||||
GType gi_type_info_get_type (void);
|
||||
GType gi_unresolved_info_get_type (void);
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,206 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIUnionInfo
|
||||
#define SELF(self) (RVAL2GI_UNION_INFO(self))
|
||||
|
||||
GType
|
||||
gi_union_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIUnionInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_fields(VALUE self)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_union_info_get_n_fields(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_field(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_union_info_get_field(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_field_value(VALUE self, VALUE rb_union, VALUE rb_n)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
gint n;
|
||||
GIFieldInfo *field_info;
|
||||
GType gtype;
|
||||
VALUE rb_value;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
field_info = g_union_info_get_field(info, n);
|
||||
gtype = g_registered_type_info_get_g_type(info);
|
||||
rb_value = rb_gi_field_info_get_field_raw(field_info,
|
||||
RVAL2BOXED(rb_union, gtype));
|
||||
g_base_info_unref(field_info);
|
||||
|
||||
return rb_value;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_field_value(VALUE self, VALUE rb_union, VALUE rb_n, VALUE rb_value)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
gint n;
|
||||
GIFieldInfo *field_info;
|
||||
GType gtype;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
field_info = g_union_info_get_field(info, n);
|
||||
gtype = g_registered_type_info_get_g_type(info);
|
||||
rb_gi_field_info_set_field_raw(field_info,
|
||||
RVAL2BOXED(rb_union, gtype),
|
||||
rb_value);
|
||||
/* TODO: use rb_ensure() to unref field_info. */
|
||||
g_base_info_unref(field_info);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_n_methods(VALUE self)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_union_info_get_n_methods(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_method(VALUE self, VALUE rb_n_or_name)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
GIFunctionInfo *function_info;
|
||||
|
||||
info = SELF(self);
|
||||
if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) {
|
||||
gint n;
|
||||
n = NUM2INT(rb_n_or_name);
|
||||
function_info = g_union_info_get_method(info, n);
|
||||
} else {
|
||||
const gchar *name;
|
||||
name = RVAL2CSTR(rb_n_or_name);
|
||||
function_info = g_union_info_find_method(info, name);
|
||||
}
|
||||
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(function_info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_discriminated_p(VALUE self)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return CBOOL2RVAL(g_union_info_is_discriminated(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_discriminator_offset(VALUE self)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_union_info_get_discriminator_offset(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_discriminator_type(VALUE self)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_union_info_get_discriminator_type(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_discriminator(VALUE self, VALUE rb_n)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
gint n;
|
||||
|
||||
info = SELF(self);
|
||||
n = NUM2INT(rb_n);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_union_info_get_discriminator(info, n));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_size(VALUE self)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return ULONG2NUM(g_union_info_get_size(info));
|
||||
}
|
||||
|
||||
|
||||
static VALUE
|
||||
rg_alignment(VALUE self)
|
||||
{
|
||||
GIUnionInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return ULONG2NUM(g_union_info_get_alignment(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_union_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_UNION_INFO, "UnionInfo", rb_mGI,
|
||||
rb_cGIRegisteredTypeInfo);
|
||||
|
||||
RG_DEF_METHOD(n_fields, 0);
|
||||
RG_DEF_METHOD(get_field, 1);
|
||||
RG_DEF_METHOD(get_field_value, 2);
|
||||
RG_DEF_METHOD(set_field_value, 3);
|
||||
RG_DEF_METHOD(n_methods, 0);
|
||||
RG_DEF_METHOD(get_method, 1);
|
||||
RG_DEF_METHOD_P(discriminated, 0);
|
||||
RG_DEF_METHOD(discriminator_offset, 0);
|
||||
RG_DEF_METHOD(discriminator_type, 0);
|
||||
RG_DEF_METHOD(get_discriminator, 1);
|
||||
RG_DEF_METHOD(size, 0);
|
||||
RG_DEF_METHOD(alignment, 0);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TUNRESOLVEDET_NAMESPACE rb_cGIUnresolvedInfo
|
||||
|
||||
GType
|
||||
gi_unresolved_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIUnresolvedInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_unresolved_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_UNRESOLVED_INFO,
|
||||
"UnresolvedInfo", rb_mGI,
|
||||
rb_cGIBaseInfo);
|
||||
|
||||
(void)RG_TARGET_NAMESPACE; /* suppress a warning. */
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIValueInfo
|
||||
#define SELF(self) (RVAL2GI_VALUE_INFO(self))
|
||||
|
||||
GType
|
||||
gi_value_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIValueInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_value(VALUE self)
|
||||
{
|
||||
GIValueInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return LONG2NUM(g_value_info_get_value(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_value_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_VALUE_INFO, "ValueInfo", rb_mGI,
|
||||
rb_cGIBaseInfo);
|
||||
|
||||
RG_DEF_METHOD(value, 0);
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_cGIVFuncInfo
|
||||
#define SELF(self) RVAL2GI_BASE_INFO(self)
|
||||
|
||||
GType
|
||||
gi_vfunc_info_get_type(void)
|
||||
{
|
||||
static GType type = 0;
|
||||
if (type == 0) {
|
||||
type = g_boxed_type_register_static("GIVFuncInfo",
|
||||
(GBoxedCopyFunc)g_base_info_ref,
|
||||
(GBoxedFreeFunc)g_base_info_unref);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_flags(VALUE self)
|
||||
{
|
||||
GIVFuncInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_VFUNC_INFO_FLAGS2RVAL(g_vfunc_info_get_flags(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_offset(VALUE self)
|
||||
{
|
||||
GIVFuncInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return INT2NUM(g_vfunc_info_get_offset(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_signal(VALUE self)
|
||||
{
|
||||
GIVFuncInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_vfunc_info_get_signal(info));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_invoker(VALUE self)
|
||||
{
|
||||
GIVFuncInfo *info;
|
||||
|
||||
info = SELF(self);
|
||||
return GI_BASE_INFO2RVAL_WITH_UNREF(g_vfunc_info_get_invoker(info));
|
||||
}
|
||||
|
||||
void
|
||||
rb_gi_vfunc_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE =
|
||||
G_DEF_CLASS_WITH_PARENT(GI_TYPE_VFUNC_INFO, "VFuncInfo", rb_mGI,
|
||||
rb_cGICallableInfo);
|
||||
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNKNOWN_OFFSET", INT2NUM(0xFFFF));
|
||||
|
||||
RG_DEF_METHOD(flags, 0);
|
||||
RG_DEF_METHOD(offset, 0);
|
||||
RG_DEF_METHOD(signal, 0);
|
||||
RG_DEF_METHOD(invoker, 0);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_IV_FUNC_INFO_FLAGS, "VFuncInfoFlags", rb_mGI);
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "rb-gi-private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE rb_mGObjectIntrospection
|
||||
|
||||
void
|
||||
Init_gobject_introspection(void)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = rb_define_module("GObjectIntrospection");
|
||||
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION",
|
||||
rb_ary_new3(3,
|
||||
INT2FIX(GI_MAJOR_VERSION),
|
||||
INT2FIX(GI_MINOR_VERSION),
|
||||
INT2FIX(GI_MICRO_VERSION)));
|
||||
|
||||
rb_gi_argument_init();
|
||||
|
||||
rb_gi_type_tag_init(RG_TARGET_NAMESPACE);
|
||||
rb_gi_base_info_init(RG_TARGET_NAMESPACE);
|
||||
rb_gi_repository_init(RG_TARGET_NAMESPACE);
|
||||
rb_gi_loader_init(RG_TARGET_NAMESPACE);
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef RB_GOBJECT_INTROSPECTION_H
|
||||
#define RB_GOBJECT_INTROSPECTION_H
|
||||
|
||||
#include <ruby.h>
|
||||
#include <rbgobject.h>
|
||||
|
||||
#include <girepository.h>
|
||||
|
||||
typedef gpointer (*RBGICallbackFinderFunc)(GIArgInfo *info);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GIArgInfo arg_info;
|
||||
GIScopeType scope_type;
|
||||
GIDirection direction;
|
||||
gboolean callback_p;
|
||||
gboolean closure_p;
|
||||
gboolean destroy_p;
|
||||
gboolean inout_argv_p;
|
||||
gint in_arg_index;
|
||||
gint closure_in_arg_index;
|
||||
gint destroy_in_arg_index;
|
||||
gint rb_arg_index;
|
||||
gint out_arg_index;
|
||||
gint inout_argc_arg_index;
|
||||
} RBGIArgMetadata;
|
||||
|
||||
typedef struct {
|
||||
RBGIArgMetadata *metadata;
|
||||
VALUE rb_gc_guard_key;
|
||||
VALUE rb_callback;
|
||||
} RBGICallbackData;
|
||||
|
||||
void rb_gi_callback_register_finder (RBGICallbackFinderFunc finder);
|
||||
void rb_gi_callback_data_free (RBGICallbackData *callback_data);
|
||||
|
||||
#endif
|
71
lib/ruby-gtk2-2.0.2/gobject-introspection/extconf.rb
Executable file
71
lib/ruby-gtk2-2.0.2/gobject-introspection/extconf.rb
Executable file
@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "pathname"
|
||||
require "mkmf"
|
||||
require "rbconfig"
|
||||
require "fileutils"
|
||||
|
||||
module_name = "gobject_introspection"
|
||||
package = "gobject-introspection"
|
||||
|
||||
base_dir = Pathname(__FILE__).dirname.expand_path
|
||||
ext_dir = base_dir + "ext" + package
|
||||
mkmf_gnome2_dir = base_dir + 'lib'
|
||||
|
||||
if RbConfig.respond_to?(:ruby)
|
||||
ruby = RbConfig.ruby
|
||||
else
|
||||
ruby = File.join(RbConfig::CONFIG['bindir'],
|
||||
RbConfig::CONFIG['ruby_install_name'] +
|
||||
RbConfig::CONFIG["EXEEXT"])
|
||||
end
|
||||
build_dir = Pathname("ext") + package
|
||||
FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist?
|
||||
extconf_rb_path = ext_dir + "extconf.rb"
|
||||
unless system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV)
|
||||
exit(false)
|
||||
end
|
||||
|
||||
create_makefile(module_name)
|
||||
FileUtils.mv("Makefile", "Makefile.lib")
|
||||
|
||||
File.open("Makefile", "w") do |makefile|
|
||||
makefile.puts(<<-EOM)
|
||||
all:
|
||||
(cd ext/#{package} && $(MAKE))
|
||||
$(MAKE) -f Makefile.lib
|
||||
|
||||
install:
|
||||
(cd ext/#{package} && $(MAKE) install)
|
||||
$(MAKE) -f Makefile.lib install
|
||||
|
||||
site-install:
|
||||
(cd ext/#{package} && $(MAKE) site-install)
|
||||
$(MAKE) -f Makefile.lib site-install
|
||||
|
||||
clean:
|
||||
(cd ext/#{package} && $(MAKE) clean)
|
||||
$(MAKE) -f Makefile.lib clean
|
||||
|
||||
distclean:
|
||||
(cd ext/#{package} && $(MAKE) distclean)
|
||||
$(MAKE) -f Makefile.lib distclean
|
||||
@rm -f Makefile.lib
|
||||
EOM
|
||||
end
|
@ -0,0 +1,53 @@
|
||||
# Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "glib2"
|
||||
|
||||
module GObjectIntrospection
|
||||
class << self
|
||||
def prepend_typelib_path(path)
|
||||
GLib.prepend_path_to_environment_variable(path, "GI_TYPELIB_PATH")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
|
||||
vendor_dir = base_dir + "vendor" + "local"
|
||||
vendor_bin_dir = vendor_dir + "bin"
|
||||
GLib.prepend_dll_path(vendor_bin_dir)
|
||||
begin
|
||||
major, minor, _ = RUBY_VERSION.split(/\./)
|
||||
require "#{major}.#{minor}/gobject_introspection.so"
|
||||
rescue LoadError
|
||||
require "gobject_introspection.so"
|
||||
end
|
||||
|
||||
vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
|
||||
GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
|
||||
|
||||
module GObjectIntrospection
|
||||
LOG_DOMAIN = "GObjectIntrospection"
|
||||
end
|
||||
GLib::Log.set_log_domain(GObjectIntrospection::LOG_DOMAIN)
|
||||
|
||||
require "gobject-introspection/repository"
|
||||
require "gobject-introspection/callable-info"
|
||||
require "gobject-introspection/object-info"
|
||||
require "gobject-introspection/interface-info"
|
||||
require "gobject-introspection/struct-info"
|
||||
require "gobject-introspection/boxed-info"
|
||||
require "gobject-introspection/union-info"
|
||||
require "gobject-introspection/loader"
|
@ -0,0 +1,28 @@
|
||||
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "gobject-introspection/collection-reader"
|
||||
|
||||
module GObjectIntrospection
|
||||
class BoxedInfo
|
||||
extend CollectionReader
|
||||
|
||||
alias_method :__methods__, :methods
|
||||
|
||||
collection_reader("fields")
|
||||
collection_reader("methods")
|
||||
end
|
||||
end
|
@ -0,0 +1,91 @@
|
||||
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "gobject-introspection/collection-reader"
|
||||
|
||||
module GObjectIntrospection
|
||||
class CallableInfo
|
||||
extend CollectionReader
|
||||
|
||||
collection_reader("args")
|
||||
|
||||
def in_args
|
||||
callback_indexes = []
|
||||
closure_indexes = []
|
||||
destroy_indexes = []
|
||||
args.each_with_index do |arg, i|
|
||||
next if arg.scope == ScopeType::INVALID
|
||||
callback_indexes << i
|
||||
closure_index = arg.closure
|
||||
closure_indexes << closure_index if closure_index != -1
|
||||
destroy_index = arg.destroy
|
||||
destroy_indexes << destroy_index if destroy_index != -1
|
||||
end
|
||||
|
||||
args.find_all.with_index do |arg, i|
|
||||
case arg.direction
|
||||
when Direction::IN, Direction::INOUT
|
||||
if callback_indexes.include?(i)
|
||||
false
|
||||
elsif closure_indexes.include?(i)
|
||||
false
|
||||
elsif destroy_indexes.include?(i)
|
||||
false
|
||||
else
|
||||
true
|
||||
end
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def required_in_args
|
||||
in_args.reject do |arg|
|
||||
arg.may_be_null?
|
||||
end
|
||||
end
|
||||
|
||||
def n_in_args
|
||||
in_args.size
|
||||
end
|
||||
|
||||
def n_required_in_args
|
||||
required_in_args.size
|
||||
end
|
||||
|
||||
def require_callback?
|
||||
args.any? do |arg|
|
||||
arg.direction == Direction::IN and arg.scope != ScopeType::INVALID
|
||||
end
|
||||
end
|
||||
|
||||
def out_args
|
||||
args.find_all do |arg|
|
||||
case arg.direction
|
||||
when Direction::OUT, Direction::INOUT
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def n_out_args
|
||||
out_args.size
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,34 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
module GObjectIntrospection
|
||||
module CollectionReader
|
||||
def collection_reader(name)
|
||||
n_getter = "n_#{name}"
|
||||
if name.end_with?("ies")
|
||||
singular = name.sub(/ies\z/, "y")
|
||||
else
|
||||
singular = name.sub(/s\z/, "")
|
||||
end
|
||||
getter = "get_#{singular}"
|
||||
define_method(name) do
|
||||
send(n_getter).times.collect do |i|
|
||||
send(getter, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,32 @@
|
||||
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "gobject-introspection/collection-reader"
|
||||
|
||||
module GObjectIntrospection
|
||||
class InterfaceInfo
|
||||
extend CollectionReader
|
||||
|
||||
alias_method :__methods__, :methods
|
||||
|
||||
collection_reader("prerequisites")
|
||||
collection_reader("properties")
|
||||
collection_reader("methods")
|
||||
collection_reader("signals")
|
||||
collection_reader("vfuncs")
|
||||
collection_reader("constants")
|
||||
end
|
||||
end
|
@ -0,0 +1,371 @@
|
||||
# Copyright (C) 2012-2013 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
module GObjectIntrospection
|
||||
class Loader
|
||||
class << self
|
||||
def load(namespace, base_module, options={})
|
||||
loader = new(base_module)
|
||||
loader.version = options[:version]
|
||||
loader.load(namespace)
|
||||
end
|
||||
end
|
||||
|
||||
attr_accessor :version
|
||||
def initialize(base_module)
|
||||
@base_module = base_module
|
||||
@version = nil
|
||||
end
|
||||
|
||||
def load(namespace)
|
||||
repository = Repository.default
|
||||
repository.require(namespace, @version)
|
||||
pre_load(repository, namespace)
|
||||
repository.each(namespace) do |info|
|
||||
load_info(info)
|
||||
end
|
||||
post_load(repository, namespace)
|
||||
end
|
||||
|
||||
private
|
||||
def pre_load(repository, namespace)
|
||||
end
|
||||
|
||||
def post_load(repository, namespace)
|
||||
end
|
||||
|
||||
def load_info(info)
|
||||
case info
|
||||
when FunctionInfo
|
||||
load_function_info(info)
|
||||
when StructInfo
|
||||
load_struct_info(info)
|
||||
when BoxedInfo
|
||||
load_boxed_info(info)
|
||||
when FlagsInfo
|
||||
load_flags_info(info)
|
||||
when EnumInfo
|
||||
load_enum_info(info)
|
||||
when ObjectInfo
|
||||
load_object_info(info)
|
||||
when InterfaceInfo
|
||||
load_interface_info(info)
|
||||
when ConstantInfo
|
||||
load_constant_info(info)
|
||||
when UnionInfo
|
||||
load_union_info(info)
|
||||
end
|
||||
end
|
||||
|
||||
def load_function_info(info)
|
||||
name = rubyish_method_name(info)
|
||||
define_module_function(@base_module, name, info)
|
||||
end
|
||||
|
||||
def define_module_function(target_module, name, function_info)
|
||||
unlock_gvl = should_unlock_gvl?(function_info, target_module)
|
||||
validate = lambda do |arguments|
|
||||
method_name = "#{target_module}\#.#{name}"
|
||||
validate_arguments(function_info, method_name, arguments)
|
||||
end
|
||||
target_module.module_eval do
|
||||
define_method(name) do |*arguments, &block|
|
||||
validate.call(arguments, &block)
|
||||
function_info.invoke({
|
||||
:arguments => arguments,
|
||||
:unlock_gvl => unlock_gvl,
|
||||
},
|
||||
&block)
|
||||
end
|
||||
module_function(name)
|
||||
end
|
||||
end
|
||||
|
||||
def define_struct(info, options={})
|
||||
if info.gtype == GLib::Type::NONE
|
||||
klass = self.class.define_struct(info.size, info.name, @base_module,
|
||||
:parent => options[:parent])
|
||||
else
|
||||
klass = self.class.define_class(info.gtype, info.name, @base_module,
|
||||
:parent => options[:parent])
|
||||
end
|
||||
load_fields(info, klass)
|
||||
load_methods(info, klass)
|
||||
end
|
||||
|
||||
def load_struct_info(info)
|
||||
return if info.gtype_struct?
|
||||
|
||||
define_struct(info)
|
||||
end
|
||||
|
||||
def define_boxed(info)
|
||||
klass = self.class.define_class(info.gtype, info.name, @base_module)
|
||||
# TODO
|
||||
# load_fields(info, klass)
|
||||
# load_methods(info, klass)
|
||||
end
|
||||
|
||||
def load_boxed_info(info)
|
||||
define_boxed(info)
|
||||
end
|
||||
|
||||
def load_enum_value(value_info, enum_module)
|
||||
enum_module.const_set(value_info.name.upcase, value_info.value)
|
||||
end
|
||||
|
||||
def load_enum_info(info)
|
||||
if info.gtype == GLib::Type::NONE
|
||||
enum_module = Module.new
|
||||
info.values.each do |value_info|
|
||||
load_enum_value(value_info, enum_module)
|
||||
end
|
||||
@base_module.const_set(info.name, enum_module)
|
||||
else
|
||||
self.class.define_class(info.gtype, info.name, @base_module)
|
||||
end
|
||||
end
|
||||
|
||||
def load_flag_value(value_info, flags_module)
|
||||
flags_module.const_set(value_info.name.upcase, value_info.value)
|
||||
end
|
||||
|
||||
def load_flags_info(info)
|
||||
if info.gtype == GLib::Type::NONE
|
||||
flags_module = Module.new
|
||||
info.values.each do |value_info|
|
||||
load_flag_value(value_info, flags_module)
|
||||
end
|
||||
@base_module.const_set(info.name, flags_module)
|
||||
else
|
||||
self.class.define_class(info.gtype, info.name, @base_module)
|
||||
end
|
||||
end
|
||||
|
||||
def load_object_info(info)
|
||||
klass = self.class.define_class(info.gtype, info.name, @base_module)
|
||||
load_fields(info, klass)
|
||||
load_methods(info, klass)
|
||||
end
|
||||
|
||||
def load_fields(info, klass)
|
||||
info.n_fields.times do |i|
|
||||
field_info = info.get_field(i)
|
||||
load_field(info, i, field_info, klass)
|
||||
end
|
||||
end
|
||||
|
||||
def load_field(info, i, field_info, klass)
|
||||
name = field_info.name
|
||||
flags = field_info.flags
|
||||
|
||||
if flags.readable?
|
||||
klass.__send__(:define_method, name) do ||
|
||||
info.get_field_value(self, i)
|
||||
end
|
||||
end
|
||||
|
||||
if flags.writable?
|
||||
klass.__send__(:define_method, "#{name}=") do |value|
|
||||
info.set_field_value(self, i, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def load_methods(info, klass)
|
||||
grouped_methods = info.methods.group_by do |method_info|
|
||||
method_info.class
|
||||
end
|
||||
grouped_methods.each do |method_info_class, method_infos|
|
||||
next if method_infos.empty?
|
||||
case method_infos.first
|
||||
when ConstructorInfo
|
||||
load_constructor_infos(method_infos, klass)
|
||||
when MethodInfo
|
||||
load_method_infos(method_infos, klass)
|
||||
when FunctionInfo
|
||||
load_function_infos(method_infos, klass)
|
||||
else
|
||||
raise "TODO: #{method_info_class}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def load_constructor_infos(infos, klass)
|
||||
return if infos.empty?
|
||||
|
||||
validate = lambda do |info, method_name, arguments|
|
||||
validate_arguments(info, "#{klass}\##{method_name}", arguments)
|
||||
end
|
||||
infos.each do |info|
|
||||
name = "initialize_#{info.name}"
|
||||
unlock_gvl = should_unlock_gvl?(info, klass)
|
||||
klass.__send__(:define_method, name) do |*arguments, &block|
|
||||
validate.call(info, name, arguments, &block)
|
||||
info.invoke({
|
||||
:receiver => self,
|
||||
:arguments => arguments,
|
||||
:unlock_gvl => unlock_gvl,
|
||||
},
|
||||
&block)
|
||||
end
|
||||
klass.__send__(:private, name)
|
||||
end
|
||||
|
||||
find_info = lambda do |arguments|
|
||||
find_suitable_callable_info(infos, arguments)
|
||||
end
|
||||
klass.__send__(:define_method, "initialize") do |*arguments, &block|
|
||||
info = find_info.call(arguments, &block)
|
||||
__send__("initialize_#{info.name}", *arguments, &block)
|
||||
end
|
||||
end
|
||||
|
||||
def validate_arguments(info, method_name, arguments)
|
||||
n_in_args = info.n_in_args
|
||||
n_required_in_args = info.n_required_in_args
|
||||
return if (n_required_in_args..n_in_args).cover?(arguments.size)
|
||||
|
||||
detail = "#{arguments.size} for "
|
||||
if n_in_args == n_required_in_args
|
||||
detail << "#{info.n_in_args}"
|
||||
else
|
||||
detail << "#{info.n_required_in_args}..#{info.n_in_args}"
|
||||
end
|
||||
message = "#{method_name}: wrong number of arguments (#{detail})"
|
||||
raise ArgumentError, message
|
||||
end
|
||||
|
||||
def find_suitable_callable_info(infos, arguments)
|
||||
min_n_args = nil
|
||||
max_n_args = nil
|
||||
infos.each do |info|
|
||||
if arguments.size == info.n_in_args
|
||||
return info
|
||||
end
|
||||
n_in_args = info.n_in_args
|
||||
min_n_args = [min_n_args || n_in_args, n_in_args].min
|
||||
max_n_args = [max_n_args || n_in_args, n_in_args].max
|
||||
end
|
||||
detail = "#{arguments.size} for #{min_n_args}"
|
||||
if min_n_args < max_n_args
|
||||
detail << "..#{max_n_args}"
|
||||
end
|
||||
raise ArgumentError, "wrong number of arguments (#{detail})"
|
||||
end
|
||||
|
||||
def rubyish_method_name(function_info)
|
||||
name = function_info.name
|
||||
return_type = function_info.return_type
|
||||
if return_type.tag == GObjectIntrospection::TypeTag::BOOLEAN
|
||||
case name
|
||||
when /\A(?:is|get_is|get)_/
|
||||
"#{$POSTMATCH}?"
|
||||
when /\A(?:has|use)_/
|
||||
"#{name}?"
|
||||
else
|
||||
name
|
||||
end
|
||||
elsif /\Aget_/ =~ name and function_info.n_in_args.zero?
|
||||
$POSTMATCH
|
||||
else
|
||||
case name
|
||||
when "to_string"
|
||||
"to_s"
|
||||
when "foreach"
|
||||
"each"
|
||||
else
|
||||
name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def should_unlock_gvl?(function_info, klass)
|
||||
false
|
||||
end
|
||||
|
||||
def load_method_infos(infos, klass)
|
||||
infos.each do |info|
|
||||
method_name = rubyish_method_name(info)
|
||||
load_method_info(info, klass, method_name)
|
||||
if /\Aset_/ =~ method_name and info.n_args == 1
|
||||
klass.__send__(:alias_method, "#{$POSTMATCH}=", method_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def load_method_info(info, klass, method_name)
|
||||
unlock_gvl = should_unlock_gvl?(info, klass)
|
||||
validate = lambda do |arguments|
|
||||
validate_arguments(info, "#{klass}\##{method_name}", arguments)
|
||||
end
|
||||
klass.__send__(:define_method, method_name) do |*arguments, &block|
|
||||
validate.call(arguments, &block)
|
||||
if block.nil? and info.require_callback?
|
||||
Enumerator.new(self, method_name, *arguments)
|
||||
else
|
||||
info.invoke({
|
||||
:receiver => self,
|
||||
:arguments => arguments,
|
||||
:unlock_gvl => unlock_gvl,
|
||||
},
|
||||
&block)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def load_function_infos(infos, klass)
|
||||
infos.each do |info|
|
||||
name = rubyish_method_name(info)
|
||||
next if name == "new"
|
||||
next if name == "alloc"
|
||||
unlock_gvl = should_unlock_gvl?(info, klass)
|
||||
validate = lambda do |arguments|
|
||||
validate_arguments(info, "#{klass}.#{name}", arguments)
|
||||
end
|
||||
singleton_class = (class << klass; self; end)
|
||||
singleton_class.__send__(:define_method, name) do |*arguments, &block|
|
||||
validate.call(arguments, &block)
|
||||
if block.nil? and info.require_callback?
|
||||
Enumerator.new(self, name, *arguments)
|
||||
else
|
||||
info.invoke({
|
||||
:arguments => arguments,
|
||||
:unlock_gvl => unlock_gvl,
|
||||
},
|
||||
&block)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def load_interface_info(info)
|
||||
interface_module =
|
||||
self.class.define_interface(info.gtype, info.name, @base_module)
|
||||
load_methods(info, interface_module)
|
||||
end
|
||||
|
||||
def load_constant_info(info)
|
||||
@base_module.const_set(info.name, info.value)
|
||||
end
|
||||
|
||||
def load_union_info(info)
|
||||
klass = self.class.define_class(info.gtype, info.name, @base_module)
|
||||
load_fields(info, klass)
|
||||
load_methods(info, klass)
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,33 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "gobject-introspection/collection-reader"
|
||||
|
||||
module GObjectIntrospection
|
||||
class ObjectInfo
|
||||
extend CollectionReader
|
||||
|
||||
alias_method :__methods__, :methods
|
||||
|
||||
collection_reader("interfaces")
|
||||
collection_reader("fields")
|
||||
collection_reader("properties")
|
||||
collection_reader("methods")
|
||||
collection_reader("signals")
|
||||
collection_reader("vfuncs")
|
||||
collection_reader("constants")
|
||||
end
|
||||
end
|
@ -0,0 +1,32 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
module GObjectIntrospection
|
||||
class Repository
|
||||
include Enumerable
|
||||
|
||||
def each(*namespaces)
|
||||
if namespaces.empty?
|
||||
namespaces = loaded_namespaces
|
||||
end
|
||||
namespaces.each do |namespace|
|
||||
get_n_infos(namespace).times do |i|
|
||||
yield(get_info(namespace, i))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,28 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "gobject-introspection/collection-reader"
|
||||
|
||||
module GObjectIntrospection
|
||||
class StructInfo
|
||||
extend CollectionReader
|
||||
|
||||
alias_method :__methods__, :methods
|
||||
|
||||
collection_reader("fields")
|
||||
collection_reader("methods")
|
||||
end
|
||||
end
|
@ -0,0 +1,28 @@
|
||||
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "gobject-introspection/collection-reader"
|
||||
|
||||
module GObjectIntrospection
|
||||
class UnionInfo
|
||||
extend CollectionReader
|
||||
|
||||
alias_method :__methods__, :methods
|
||||
|
||||
collection_reader("fields")
|
||||
collection_reader("methods")
|
||||
end
|
||||
end
|
@ -0,0 +1,365 @@
|
||||
From be397a8f143edc9808035f78c60159bb9aeedca2 Mon Sep 17 00:00:00 2001
|
||||
From: Kouhei Sutou <kou@clear-code.com>
|
||||
Date: Sun, 7 Apr 2013 18:51:45 +0900
|
||||
Subject: [PATCH] Support external g-ir-scanner
|
||||
|
||||
With this change, you can build binaries for Windows on Debian
|
||||
GNU/Linux.
|
||||
|
||||
Run configure with the following options:
|
||||
|
||||
% ./configure \
|
||||
--host=i686-w64-mingw32 \
|
||||
--with-g-ir-scanner=/usr/bin/g-ir-scanner \
|
||||
--disable-tests
|
||||
---
|
||||
Makefile-gir.am | 29 +++++++++++++----------
|
||||
Makefile-giscanner.am | 6 +++++
|
||||
Makefile-tools.am | 15 +++++++++++-
|
||||
Makefile.am | 5 +++-
|
||||
common.mk | 9 ++++---
|
||||
configure.ac | 54 ++++++++++++++++++++++++++++++++----------
|
||||
tests/Makefile.am | 2 ++
|
||||
tests/offsets/Makefile.am | 6 +++++
|
||||
tests/repository/Makefile.am | 2 ++
|
||||
tests/scanner/Makefile.am | 4 ++++
|
||||
10 files changed, 103 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/Makefile-gir.am b/Makefile-gir.am
|
||||
index 2b39e54..63b2f2b 100644
|
||||
--- a/Makefile-gir.am
|
||||
+++ b/Makefile-gir.am
|
||||
@@ -26,17 +26,17 @@ CLEANFILES += gir/cairo-1.0.gir
|
||||
EXTRA_DIST += gir/cairo-1.0.gir.in
|
||||
|
||||
# Doesn't seem to work to do gir/%.typelib =(
|
||||
-gir/cairo-1.0.typelib: g-ir-compiler
|
||||
-gir/DBus-1.0.typelib: g-ir-compiler
|
||||
-gir/DBusGLib-1.0.typelib: g-ir-compiler
|
||||
-gir/fontconfig-2.0.typelib: g-ir-compiler
|
||||
-gir/freetype2-2.0.typelib: g-ir-compiler
|
||||
-gir/GL-1.0.typelib: g-ir-compiler
|
||||
-gir/libxml2-2.0.typelib: g-ir-compiler
|
||||
-gir/xft-2.0.typelib: g-ir-compiler
|
||||
-gir/xlib-2.0.typelib: g-ir-compiler
|
||||
-gir/xfixes-4.0.typelib: g-ir-compiler
|
||||
-gir/xrandr-1.3.typelib: g-ir-compiler
|
||||
+gir/cairo-1.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/DBus-1.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/DBusGLib-1.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/fontconfig-2.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/freetype2-2.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/GL-1.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/libxml2-2.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/xft-2.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/xlib-2.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/xfixes-4.0.typelib: g-ir-compiler$(EXEEXT)
|
||||
+gir/xrandr-1.3.typelib: g-ir-compiler$(EXEEXT)
|
||||
|
||||
# glib with source (to enable documentation)
|
||||
if WITH_GLIBSRC
|
||||
@@ -89,7 +89,12 @@ endif
|
||||
|
||||
BUILT_GIRSOURCES += GLib-2.0.gir
|
||||
|
||||
-GLib-2.0.gir: g-ir-scanner g-ir-compiler$(EXEEXT)
|
||||
+if BUILD_SCANNER
|
||||
+G_IR_SCANNER_DEPENDENCY = g-ir-scanner
|
||||
+else
|
||||
+G_IR_SCANNER_DEPENDENCY =
|
||||
+endif
|
||||
+GLib-2.0.gir: $(G_IR_SCANNER_DEPENDENCY) g-ir-compiler$(EXEEXT)
|
||||
|
||||
gir/DBusGLib-1.0.typelib: GObject-2.0.gir
|
||||
|
||||
diff --git a/Makefile-giscanner.am b/Makefile-giscanner.am
|
||||
index e8def0e..4c1d21e 100644
|
||||
--- a/Makefile-giscanner.am
|
||||
+++ b/Makefile-giscanner.am
|
||||
@@ -1,17 +1,21 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
+if BUILD_SCANNER
|
||||
BUILT_SOURCES += \
|
||||
scannerparser.c \
|
||||
scannerparser.h \
|
||||
scannerlexer.c \
|
||||
scannerlexer.h
|
||||
+endif
|
||||
|
||||
AM_YFLAGS = -d -t
|
||||
|
||||
# Why do I have to do this automake?
|
||||
scannerlexer.h: scannerlexer.c
|
||||
|
||||
+if BUILD_SCANNER
|
||||
noinst_LTLIBRARIES += libgiscanner.la
|
||||
+endif
|
||||
|
||||
libgiscanner_la_SOURCES = \
|
||||
giscanner/sourcescanner.c \
|
||||
@@ -25,7 +29,9 @@ libgiscanner_la_CFLAGS = $(GOBJECT_CFLAGS) $(GIO_CFLAGS)
|
||||
|
||||
# Python module
|
||||
pkgpyexecdir = $(pkglibdir)/giscanner
|
||||
+if BUILD_SCANNER
|
||||
pkgpyexec_LTLIBRARIES = _giscanner.la
|
||||
+endif
|
||||
pkgpyexec_PYTHON = \
|
||||
giscanner/__init__.py \
|
||||
giscanner/annotationmain.py \
|
||||
diff --git a/Makefile-tools.am b/Makefile-tools.am
|
||||
index 34d2a25..87c3a1f 100644
|
||||
--- a/Makefile-tools.am
|
||||
+++ b/Makefile-tools.am
|
||||
@@ -1,5 +1,8 @@
|
||||
bin_PROGRAMS += g-ir-compiler g-ir-generate
|
||||
+
|
||||
+if BUILD_SCANNER
|
||||
bin_SCRIPTS += g-ir-scanner g-ir-annotation-tool
|
||||
+endif
|
||||
|
||||
if BUILD_DOCTOOL
|
||||
bin_SCRIPTS += g-ir-doc-tool
|
||||
@@ -12,6 +15,7 @@ EXTRA_DIST += \
|
||||
|
||||
TOOL_SUBSTITUTIONS = sed -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON\@,$(PYTHON),
|
||||
|
||||
+if BUILD_SCANNER
|
||||
g-ir-scanner: tools/g-ir-scanner.in _giscanner.la Makefile
|
||||
$(AM_V_GEN) $(TOOL_SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@
|
||||
@chmod a+x $@
|
||||
@@ -19,10 +23,13 @@ g-ir-scanner: tools/g-ir-scanner.in _giscanner.la Makefile
|
||||
g-ir-annotation-tool: tools/g-ir-annotation-tool.in _giscanner.la Makefile
|
||||
$(AM_V_GEN) $(TOOL_SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@
|
||||
@chmod a+x $@
|
||||
+endif
|
||||
|
||||
+if BUILD_DOCTOOL
|
||||
g-ir-doc-tool: tools/g-ir-doc-tool.in _giscanner.la Makefile
|
||||
$(AM_V_GEN) $(TOOL_SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@
|
||||
@chmod a+x $@
|
||||
+endif
|
||||
|
||||
g_ir_compiler_SOURCES = tools/compiler.c
|
||||
g_ir_compiler_CPPFLAGS = -DGIREPO_DEFAULT_SEARCH_PATH="\"$(libdir)\"" \
|
||||
@@ -46,4 +53,10 @@ GCOVSOURCES = \
|
||||
$(g_ir_compiler_SOURCES) \
|
||||
$(g_ir_generate_SOURCES)
|
||||
|
||||
-CLEANFILES += g-ir-scanner g-ir-annotation-tool g-ir-doc-tool
|
||||
+if BUILD_SCANNER
|
||||
+CLEANFILES += g-ir-scanner g-ir-annotation-tool
|
||||
+endif
|
||||
+
|
||||
+if BUILD_DOCTOOL
|
||||
+CLEANFILES += g-ir-doc-tool
|
||||
+endif
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 736f3ad..08014bc 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -33,8 +33,11 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
|
||||
|
||||
man_MANS += \
|
||||
docs/g-ir-compiler.1 \
|
||||
- docs/g-ir-generate.1 \
|
||||
+ docs/g-ir-generate.1
|
||||
+if BUILD_SCANNER
|
||||
+man_MANS += \
|
||||
docs/g-ir-scanner.1
|
||||
+endif
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = gobject-introspection-1.0.pc gobject-introspection-no-export-1.0.pc
|
||||
diff --git a/common.mk b/common.mk
|
||||
index 28b73c7..15552fa 100644
|
||||
--- a/common.mk
|
||||
+++ b/common.mk
|
||||
@@ -9,11 +9,14 @@
|
||||
INTROSPECTION_SCANNER = \
|
||||
env PATH=.libs:$(PATH) \
|
||||
LPATH=.libs \
|
||||
- CC="$(CC)" \
|
||||
+ CC="$(CC)"
|
||||
+if BUILD_SCANNER
|
||||
+INTROSPECTION_SCANNER += \
|
||||
PYTHONPATH=$(top_builddir):$(top_srcdir) \
|
||||
UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
|
||||
- UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
|
||||
- $(top_builddir)/g-ir-scanner
|
||||
+ UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir)
|
||||
+endif
|
||||
+INTROSPECTION_SCANNER += $(G_IR_SCANNER)
|
||||
|
||||
INTROSPECTION_SCANNER_ARGS = \
|
||||
--verbose \
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 3537af1..604b164 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -246,19 +246,42 @@ AC_FUNC_STRTOD
|
||||
AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull])
|
||||
AC_CHECK_FUNCS([backtrace backtrace_symbols])
|
||||
|
||||
-# Python
|
||||
-AM_PATH_PYTHON([2.5])
|
||||
-case "$host" in
|
||||
-*-*-mingw*)
|
||||
- # Change backslashes to forward slashes in pyexecdir to avoid
|
||||
- # quoting issues
|
||||
- pyexecdir=`echo $pyexecdir | tr '\\\\' '/'`
|
||||
- ;;
|
||||
+AC_ARG_WITH(g_ir_scanner,
|
||||
+ AS_HELP_STRING([--with-g-ir-scanner],
|
||||
+ [Use existing g-ir-scanner instead of building. @<:@default=no@:>@]),
|
||||
+ [],
|
||||
+ [with_g_ir_scanner=no])
|
||||
+case "x${with_g_ir_scanner}" in
|
||||
+xyes)
|
||||
+ AC_PATH_PROG(G_IR_SCANNER,
|
||||
+ [g-ir-scanner],
|
||||
+ [AC_MSG_ERROR([g-ir-scanner not found.])])
|
||||
+ build_g_ir_scanner=no
|
||||
+ ;;
|
||||
+xno)
|
||||
+ # Python
|
||||
+ AM_PATH_PYTHON([2.5])
|
||||
+ case "$host" in
|
||||
+ *-*-mingw*)
|
||||
+ # Change backslashes to forward slashes in pyexecdir to avoid
|
||||
+ # quoting issues
|
||||
+ pyexecdir=`echo $pyexecdir | tr '\\\\' '/'`
|
||||
+ ;;
|
||||
+ esac
|
||||
+ AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found]))
|
||||
+ if test "x$os_win32" = "xyes"; then
|
||||
+ AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.]))
|
||||
+ fi
|
||||
+ G_IR_SCANNER="\$(top_builddir)/g-ir-scanner"
|
||||
+ build_g_ir_scanner=yes
|
||||
+ ;;
|
||||
+*)
|
||||
+ G_IR_SCANNER="${with_g_ir_scanner}"
|
||||
+ build_g_ir_scanner=no
|
||||
+ ;;
|
||||
esac
|
||||
-AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found]))
|
||||
-if test "x$os_win32" = "xyes"; then
|
||||
- AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.]))
|
||||
-fi
|
||||
+AC_SUBST(G_IR_SCANNER)
|
||||
+AM_CONDITIONAL(BUILD_SCANNER, test x${build_g_ir_scanner} = xyes)
|
||||
|
||||
dnl Not enabled by default until 3.6 cycle when we can propose mako as
|
||||
dnl an external dependency
|
||||
@@ -310,6 +333,13 @@ fi
|
||||
|
||||
AC_SUBST(EXTRA_LINK_FLAGS)
|
||||
|
||||
+AC_ARG_ENABLE(tests,
|
||||
+ [AS_HELP_STRING([--disable-tests],
|
||||
+ [disable tests])],
|
||||
+ [],
|
||||
+ [enable_tests=yes])
|
||||
+AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = xyes)
|
||||
+
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
m4/Makefile
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index b4985b9..5c9db00 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -16,7 +16,9 @@ tests_DATA = \
|
||||
gimarshallingtests.c \
|
||||
gimarshallingtests.h
|
||||
|
||||
+if ENABLE_TESTS
|
||||
check_LTLIBRARIES = libeverything-1.0.la libgimarshallingtests-1.0.la
|
||||
+endif
|
||||
|
||||
libeverything_1_0_la_SOURCES = everything.c
|
||||
libgimarshallingtests_1_0_la_SOURCES = gimarshallingtests.c
|
||||
diff --git a/tests/offsets/Makefile.am b/tests/offsets/Makefile.am
|
||||
index 4f03830..053bd93 100644
|
||||
--- a/tests/offsets/Makefile.am
|
||||
+++ b/tests/offsets/Makefile.am
|
||||
@@ -11,7 +11,9 @@ check_PROGRAMS =
|
||||
|
||||
############################################################
|
||||
|
||||
+if ENABLE_TESTS
|
||||
check_LTLIBRARIES += liboffsets.la
|
||||
+endif
|
||||
|
||||
liboffsets_la_SOURCES = \
|
||||
offsets.h \
|
||||
@@ -32,7 +34,9 @@ CLEANFILES += Offsets-1.0.gir Offsets-1.0.typelib
|
||||
|
||||
############################################################
|
||||
|
||||
+if ENABLE_TESTS
|
||||
check_PROGRAMS += gitestoffsets
|
||||
+endif
|
||||
|
||||
nodist_gitestoffsets_SOURCES = gitestoffsets.c
|
||||
gitestoffsets_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
|
||||
@@ -42,8 +46,10 @@ gitestoffsets.c: gen-gitestoffsets offsets.h
|
||||
$(AM_V_GEN) $(PYTHON) $(srcdir)/gen-gitestoffsets $(srcdir)/offsets.h > $@ || ( rm -f $@ && false )
|
||||
|
||||
EXTRA_DIST += gen-gitestoffsets
|
||||
+if ENABLE_TESTS
|
||||
BUILT_SOURCES += gitestoffsets.c
|
||||
CLEANFILES += gitestoffsets.c
|
||||
+endif
|
||||
|
||||
############################################################
|
||||
|
||||
diff --git a/tests/repository/Makefile.am b/tests/repository/Makefile.am
|
||||
index 96afb89..0553a8b 100644
|
||||
--- a/tests/repository/Makefile.am
|
||||
+++ b/tests/repository/Makefile.am
|
||||
@@ -2,7 +2,9 @@ AM_CFLAGS = $(GOBJECT_CFLAGS)
|
||||
AM_LDFLAGS = -module -avoid-version
|
||||
LIBS = $(GOBJECT_LIBS)
|
||||
|
||||
+if ENABLE_TESTS
|
||||
check_PROGRAMS = gitestrepo gitestthrows gitypelibtest
|
||||
+endif
|
||||
|
||||
gitestrepo_SOURCES = $(srcdir)/gitestrepo.c
|
||||
gitestrepo_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
|
||||
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
|
||||
index 31487a6..65c02fa 100644
|
||||
--- a/tests/scanner/Makefile.am
|
||||
+++ b/tests/scanner/Makefile.am
|
||||
@@ -5,6 +5,7 @@ include $(top_srcdir)/Makefile.introspection
|
||||
|
||||
INTROSPECTION_SCANNER_ARGS += --warn-all
|
||||
|
||||
+if ENABLE_TESTS
|
||||
check_LTLIBRARIES = \
|
||||
libsletter.la \
|
||||
libutility.la \
|
||||
@@ -13,6 +14,7 @@ check_LTLIBRARIES = \
|
||||
libregress.la \
|
||||
libwarnlib.la \
|
||||
$(NULL)
|
||||
+endif
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/girepository
|
||||
AM_CFLAGS = $(GIO_CFLAGS) $(GOBJECT_CFLAGS) $(GTHREAD_CFLAGS)
|
||||
@@ -126,7 +128,9 @@ GetType_1_0_gir_SCANNERFLAGS = --c-include="gettype.h" --identifier-prefix=GetTy
|
||||
GIRS += GetType-1.0.gir
|
||||
|
||||
if !OS_WIN32
|
||||
+if ENABLE_TESTS
|
||||
check_PROGRAMS = barapp
|
||||
+endif
|
||||
|
||||
barapp_SOURCES = $(srcdir)/barapp.c $(srcdir)/barapp.h
|
||||
barapp_LDADD = $(top_builddir)/libgirepository-1.0.la
|
||||
--
|
||||
1.7.10.4
|
||||
|
@ -0,0 +1,36 @@
|
||||
diff --git a/giscanner/dumper.py b/giscanner/dumper.py
|
||||
index d95ea6b..84a7afc 100644
|
||||
--- a/giscanner/dumper.py
|
||||
+++ b/giscanner/dumper.py
|
||||
@@ -157,8 +157,9 @@ class DumpCompiler(object):
|
||||
else:
|
||||
o_path = self._generate_tempfile(tmpdir, '.o')
|
||||
|
||||
+ os.name = 'nt'
|
||||
if os.name == 'nt':
|
||||
- ext = 'exe'
|
||||
+ ext = '.exe'
|
||||
else:
|
||||
ext = ''
|
||||
|
||||
@@ -257,10 +258,7 @@ class DumpCompiler(object):
|
||||
else:
|
||||
args.extend(['-o', output])
|
||||
if libtool:
|
||||
- if os.name == 'nt':
|
||||
- args.append('-export-all-symbols')
|
||||
- else:
|
||||
- args.append('-export-dynamic')
|
||||
+ args.append('-export-dynamic')
|
||||
|
||||
cflags = os.environ.get('CFLAGS', '')
|
||||
for cflag in cflags.split():
|
||||
@@ -354,6 +352,8 @@ class DumpCompiler(object):
|
||||
if self._pkgconfig_msvc_flags == '':
|
||||
if library.endswith(".la"): # explicitly specified libtool library
|
||||
args.append(library)
|
||||
+ elif library.startswith("lib") and library.endswith("-0"):
|
||||
+ args.append('-l' + library[3:-2])
|
||||
else:
|
||||
args.append('-l' + library)
|
||||
|
@ -0,0 +1,26 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
require "test-unit"
|
||||
require "test/unit/notify"
|
||||
|
||||
module GObjectIntrospectionTestUtils
|
||||
def require_version(major, minor, micro)
|
||||
if (GObjectIntrospection::BUILD_VERSION <=> [major, minor, micro]) < 0
|
||||
omit("require GObjectIntrospection #{major}.#{minor}.#{micro} or later.")
|
||||
end
|
||||
end
|
||||
end
|
45
lib/ruby-gtk2-2.0.2/gobject-introspection/test/run-test.rb
Executable file
45
lib/ruby-gtk2-2.0.2/gobject-introspection/test/run-test.rb
Executable file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
|
||||
ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
|
||||
|
||||
glib_base = File.join(ruby_gnome2_base, "glib2")
|
||||
gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
|
||||
|
||||
modules = [
|
||||
[glib_base, "glib2"],
|
||||
[gobject_introspection_base, "gobject-introspection"]
|
||||
]
|
||||
modules.each do |target, module_name|
|
||||
if system("which make > /dev/null")
|
||||
`make -C #{target.dump} > /dev/null` or exit(false)
|
||||
end
|
||||
$LOAD_PATH.unshift(File.join(target, "ext", module_name))
|
||||
$LOAD_PATH.unshift(File.join(target, "lib"))
|
||||
end
|
||||
|
||||
$LOAD_PATH.unshift(File.join(glib_base, "test"))
|
||||
require "glib-test-init"
|
||||
|
||||
$LOAD_PATH.unshift(File.join(gobject_introspection_base, "test"))
|
||||
require "gobject-introspection-test-utils"
|
||||
|
||||
require "gobject-introspection"
|
||||
|
||||
exit Test::Unit::AutoRunner.run(true)
|
@ -0,0 +1,68 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestArgInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@callable_info = @repository.find("GObject", "signal_name")
|
||||
@info = @callable_info.get_arg(0)
|
||||
end
|
||||
|
||||
def test_direction
|
||||
assert_equal(GObjectIntrospection::Direction::IN,
|
||||
@info.direction)
|
||||
end
|
||||
|
||||
def test_caller_allocate?
|
||||
assert_false(@info.caller_allocates?)
|
||||
end
|
||||
|
||||
def test_return_value?
|
||||
assert_false(@info.return_value?)
|
||||
end
|
||||
|
||||
def test_optional?
|
||||
assert_false(@info.optional?)
|
||||
end
|
||||
|
||||
def test_may_be_null?
|
||||
assert_false(@info.may_be_null?)
|
||||
end
|
||||
|
||||
def test_ownership_transfer
|
||||
assert_equal(GObjectIntrospection::Transfer::NOTHING,
|
||||
@info.ownership_transfer)
|
||||
end
|
||||
|
||||
def test_scope
|
||||
assert_equal(GObjectIntrospection::ScopeType::INVALID,
|
||||
@info.scope)
|
||||
end
|
||||
|
||||
def test_closure
|
||||
assert_equal(-1, @info.closure)
|
||||
end
|
||||
|
||||
def test_destroy
|
||||
assert_equal(-1, @info.destroy)
|
||||
end
|
||||
|
||||
def test_type
|
||||
assert_kind_of(GObjectIntrospection::TypeInfo,
|
||||
@info.type)
|
||||
end
|
||||
end
|
@ -0,0 +1,31 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestBaseInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@info = @repository.find("GObject", "Object")
|
||||
end
|
||||
|
||||
def test_name
|
||||
assert_equal("Object", @info.name)
|
||||
end
|
||||
|
||||
def test_namespace
|
||||
assert_equal("GObject", @info.namespace)
|
||||
end
|
||||
end
|
@ -0,0 +1,21 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestBoxedInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
# TODO: find BoxedInfo
|
||||
end
|
||||
end
|
@ -0,0 +1,49 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestCallableInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@info = @repository.find("GObject", "signal_name")
|
||||
end
|
||||
|
||||
def test_return_type
|
||||
assert_kind_of(GObjectIntrospection::TypeInfo,
|
||||
@info.return_type)
|
||||
end
|
||||
|
||||
def test_caller_owns
|
||||
assert_equal(GObjectIntrospection::Transfer::NOTHING,
|
||||
@info.caller_owns)
|
||||
end
|
||||
|
||||
def test_may_return_null?
|
||||
assert_false(@info.may_return_null?)
|
||||
end
|
||||
|
||||
def test_n_args
|
||||
assert_equal(1, @info.n_args)
|
||||
end
|
||||
|
||||
def test_get_arg
|
||||
assert_equal("signal_id", @info.get_arg(0).name)
|
||||
end
|
||||
|
||||
def test_args
|
||||
assert_equal(["signal_id"], @info.args.collect(&:name))
|
||||
end
|
||||
end
|
@ -0,0 +1,29 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestCallbackInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("Gio")
|
||||
@info = @repository.find("Gio", "AsyncReadyCallback")
|
||||
end
|
||||
|
||||
def test_name
|
||||
assert_equal(GObjectIntrospection::Transfer::NOTHING,
|
||||
@info.caller_owns)
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,24 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestConstantInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
# TODO: find ConstantInfo
|
||||
# @info = @repository.find("GObject", "Object")
|
||||
end
|
||||
end
|
@ -0,0 +1,56 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestEnumInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("Gio")
|
||||
@info = @repository.find("Gio", "ResourceError")
|
||||
end
|
||||
|
||||
def test_n_values
|
||||
assert_equal(2, @info.n_values)
|
||||
end
|
||||
|
||||
def test_value
|
||||
assert_kind_of(GObjectIntrospection::ValueInfo,
|
||||
@info.get_value(0))
|
||||
end
|
||||
|
||||
def test_values
|
||||
assert_equal([GObjectIntrospection::ValueInfo] * @info.n_values,
|
||||
@info.values.collect(&:class))
|
||||
end
|
||||
|
||||
def test_n_methods
|
||||
assert_equal(1, @info.n_methods)
|
||||
end
|
||||
|
||||
def test_method
|
||||
assert_kind_of(GObjectIntrospection::FunctionInfo,
|
||||
@info.get_method(0))
|
||||
end
|
||||
|
||||
def test_methods
|
||||
assert_equal([GObjectIntrospection::FunctionInfo] * @info.n_methods,
|
||||
@info.methods.collect(&:class))
|
||||
end
|
||||
|
||||
def test_storage_type
|
||||
assert_equal(GObjectIntrospection::TypeTag::UINT32,
|
||||
@info.storage_type)
|
||||
end
|
||||
end
|
@ -0,0 +1,42 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestFieldInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("Gio")
|
||||
@object_info = @repository.find("Gio", "FileOutputStream")
|
||||
@info = @object_info.get_field(0)
|
||||
end
|
||||
|
||||
def test_flags
|
||||
assert_equal(GObjectIntrospection::FieldInfoFlags::READABLE,
|
||||
@info.flags)
|
||||
end
|
||||
|
||||
def test_size
|
||||
assert_equal(0, @info.size)
|
||||
end
|
||||
|
||||
def test_offset
|
||||
assert_equal(0, @info.offset)
|
||||
end
|
||||
|
||||
def test_type
|
||||
assert_kind_of(GObjectIntrospection::TypeInfo,
|
||||
@info.type)
|
||||
end
|
||||
end
|
@ -0,0 +1,27 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestFlagsInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
end
|
||||
|
||||
def test_class
|
||||
assert_kind_of(GObjectIntrospection::FlagsInfo,
|
||||
@repository.find("GObject", "SignalFlags"))
|
||||
end
|
||||
end
|
@ -0,0 +1,37 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestFunctionInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@info = @repository.find("GObject", "signal_name")
|
||||
end
|
||||
|
||||
def test_symbol
|
||||
assert_equal("g_signal_name", @info.symbol)
|
||||
end
|
||||
|
||||
def test_flags
|
||||
assert_equal(GObjectIntrospection::FunctionInfoFlags.new(0),
|
||||
@info.flags)
|
||||
end
|
||||
|
||||
def test_invoke
|
||||
assert_equal("notify", @info.invoke(1))
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,97 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestInterfaceInfo < Test::Unit::TestCase
|
||||
include GObjectIntrospectionTestUtils
|
||||
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("Gio")
|
||||
@info = @repository.find("Gio", "TlsServerConnection")
|
||||
end
|
||||
|
||||
def test_n_prerequisites
|
||||
assert_equal(1, @info.n_prerequisites)
|
||||
end
|
||||
|
||||
def test_prerequisite
|
||||
assert_kind_of(GObjectIntrospection::ObjectInfo,
|
||||
@info.get_prerequisite(0))
|
||||
end
|
||||
|
||||
def test_n_properties
|
||||
assert_equal(1, @info.n_properties)
|
||||
end
|
||||
|
||||
def test_propertiy
|
||||
assert_kind_of(GObjectIntrospection::PropertyInfo,
|
||||
@info.get_property(0))
|
||||
end
|
||||
|
||||
def test_n_methods
|
||||
assert_equal(1, @info.n_methods)
|
||||
end
|
||||
|
||||
def test_get_method_n
|
||||
assert_kind_of(GObjectIntrospection::FunctionInfo,
|
||||
@info.get_method(0))
|
||||
end
|
||||
|
||||
def test_get_method_name
|
||||
assert_kind_of(GObjectIntrospection::FunctionInfo,
|
||||
@info.get_method("new"))
|
||||
end
|
||||
|
||||
def test_n_signals
|
||||
info = @repository.find("Gio", "Volume")
|
||||
assert_equal(2, info.n_signals)
|
||||
end
|
||||
|
||||
def test_get_signal_n
|
||||
info = @repository.find("Gio", "Volume")
|
||||
assert_kind_of(GObjectIntrospection::SignalInfo,
|
||||
info.get_signal(0))
|
||||
end
|
||||
|
||||
def test_get_signal_name
|
||||
require_version(1, 34, 0)
|
||||
info = @repository.find("Gio", "Volume")
|
||||
assert_kind_of(GObjectIntrospection::FunctionInfo,
|
||||
info.get_signal("changed"))
|
||||
end
|
||||
|
||||
def test_n_vfuncs
|
||||
info = @repository.find("Gio", "Volume")
|
||||
assert_operator(0, :<, info.n_vfuncs)
|
||||
end
|
||||
|
||||
def test_get_vfunc_n
|
||||
info = @repository.find("Gio", "Volume")
|
||||
assert_kind_of(GObjectIntrospection::VFuncInfo,
|
||||
info.get_vfunc(0))
|
||||
end
|
||||
|
||||
def test_get_vfunc_name
|
||||
info = @repository.find("Gio", "Volume")
|
||||
assert_kind_of(GObjectIntrospection::VFuncInfo,
|
||||
info.get_vfunc("can_eject"))
|
||||
end
|
||||
|
||||
def test_iface_struct
|
||||
assert_kind_of(GObjectIntrospection::StructInfo,
|
||||
@info.iface_struct)
|
||||
end
|
||||
end
|
@ -0,0 +1,30 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestLoaderInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("Gio")
|
||||
@info = @repository.find("Gio", "Application")
|
||||
@sandbox = Module.new
|
||||
end
|
||||
|
||||
def test_define_class
|
||||
gtype = @info.gtype
|
||||
GObjectIntrospection::Loader.define_class(gtype, "Application", @sandbox)
|
||||
assert_equal(gtype, @sandbox::Application.gtype)
|
||||
end
|
||||
end
|
@ -0,0 +1,131 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestObjectInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("Gio")
|
||||
@info = @repository.find("Gio", "FileOutputStream")
|
||||
end
|
||||
|
||||
def test_type_name
|
||||
assert_equal("GFileOutputStream", @info.type_name)
|
||||
end
|
||||
|
||||
def test_type_init
|
||||
assert_equal("g_file_output_stream_get_type", @info.type_init)
|
||||
end
|
||||
|
||||
def test_abstract?
|
||||
assert_false(@info.abstract?)
|
||||
end
|
||||
|
||||
def test_fundamental?
|
||||
assert_false(@info.fundamental?)
|
||||
end
|
||||
|
||||
def test_parent
|
||||
assert_equal("OutputStream", @info.parent.name)
|
||||
end
|
||||
|
||||
def test_n_interfaces
|
||||
assert_equal(1, @info.n_interfaces)
|
||||
end
|
||||
|
||||
def test_get_interface
|
||||
assert_kind_of(GObjectIntrospection::InterfaceInfo,
|
||||
@info.get_interface(0))
|
||||
end
|
||||
|
||||
def test_n_fields
|
||||
assert_equal(2, @info.n_fields)
|
||||
end
|
||||
|
||||
def test_get_field
|
||||
assert_kind_of(GObjectIntrospection::FieldInfo,
|
||||
@info.get_field(0))
|
||||
end
|
||||
|
||||
def test_n_properties
|
||||
info = @repository.find("Gio", "BufferedOutputStream")
|
||||
assert_equal(2, info.n_properties)
|
||||
end
|
||||
|
||||
def test_get_property
|
||||
info = @repository.find("Gio", "BufferedOutputStream")
|
||||
assert_kind_of(GObjectIntrospection::PropertyInfo,
|
||||
info.get_property(0))
|
||||
end
|
||||
|
||||
def test_n_methods
|
||||
assert_equal(4, @info.n_methods)
|
||||
end
|
||||
|
||||
def test_get_method_n
|
||||
assert_kind_of(GObjectIntrospection::FunctionInfo,
|
||||
@info.get_method(0))
|
||||
end
|
||||
|
||||
def test_get_method_name
|
||||
assert_kind_of(GObjectIntrospection::FunctionInfo,
|
||||
@info.get_method("get_etag"))
|
||||
end
|
||||
|
||||
def test_n_signals
|
||||
info = @repository.find("Gio", "Application")
|
||||
assert_equal(5, info.n_signals)
|
||||
end
|
||||
|
||||
def test_get_signal
|
||||
info = @repository.find("Gio", "Application")
|
||||
assert_kind_of(GObjectIntrospection::SignalInfo,
|
||||
info.get_signal(0))
|
||||
end
|
||||
|
||||
def test_n_vfuncs
|
||||
assert_equal(9, @info.n_vfuncs)
|
||||
end
|
||||
|
||||
def test_get_vfunc_n
|
||||
assert_kind_of(GObjectIntrospection::VFuncInfo,
|
||||
@info.get_vfunc(0))
|
||||
end
|
||||
|
||||
def test_get_vfunc_name
|
||||
assert_kind_of(GObjectIntrospection::VFuncInfo,
|
||||
@info.get_vfunc("can_seek"))
|
||||
end
|
||||
|
||||
def test_n_constants
|
||||
assert_equal(0, @info.n_constants)
|
||||
end
|
||||
|
||||
def test_unref_function
|
||||
assert_nil(@info.unref_function)
|
||||
end
|
||||
|
||||
def test_ref_function
|
||||
assert_nil(@info.ref_function)
|
||||
end
|
||||
|
||||
def test_set_value_function
|
||||
assert_nil(@info.set_value_function)
|
||||
end
|
||||
|
||||
def test_get_value_function
|
||||
assert_nil(@info.get_value_function)
|
||||
end
|
||||
end
|
@ -0,0 +1,38 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestPropertyInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("Gio")
|
||||
@object_info = @repository.find("Gio", "Application")
|
||||
@info = @object_info.get_property(0)
|
||||
end
|
||||
|
||||
def test_flags
|
||||
assert_equal(GLib::Param::WRITABLE, @info.flags)
|
||||
end
|
||||
|
||||
def test_type
|
||||
assert_kind_of(GObjectIntrospection::TypeInfo,
|
||||
@info.type)
|
||||
end
|
||||
|
||||
def test_ownership_transfer
|
||||
assert_equal(GObjectIntrospection::Transfer::NOTHING,
|
||||
@info.ownership_transfer)
|
||||
end
|
||||
end
|
@ -0,0 +1,35 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestRegisteredTypeInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@info = @repository.find("GObject", "TypePlugin")
|
||||
end
|
||||
|
||||
def test_type_name
|
||||
assert_equal("GTypePlugin", @info.type_name)
|
||||
end
|
||||
|
||||
def test_type_init
|
||||
assert_equal("g_type_plugin_get_type", @info.type_init)
|
||||
end
|
||||
|
||||
def test_gtype
|
||||
assert_equal(GLib::Type.new("GTypePlugin"), @info.gtype)
|
||||
end
|
||||
end
|
@ -0,0 +1,59 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestRepository < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@repository.require("Gio")
|
||||
end
|
||||
|
||||
def test_get_n_infos
|
||||
assert_kind_of(Integer, @repository.get_n_infos("GObject"))
|
||||
end
|
||||
|
||||
def test_get_info
|
||||
assert_kind_of(GObjectIntrospection::BaseInfo,
|
||||
@repository.get_info("GObject", 0))
|
||||
end
|
||||
|
||||
def test_get_dependencies
|
||||
assert_equal(["GLib-2.0", "GObject-2.0"].sort,
|
||||
@repository.get_dependencies("Gio").sort)
|
||||
end
|
||||
|
||||
def test_loaded_namespaces
|
||||
assert_equal(["GLib", "GObject", "Gio"].sort,
|
||||
@repository.loaded_namespaces.sort)
|
||||
end
|
||||
|
||||
def test_enumerable
|
||||
namespaces = @repository.collect do |info|
|
||||
info.namespace
|
||||
end
|
||||
assert_equal(["GLib", "GObject", "Gio"].sort, namespaces.uniq.sort)
|
||||
end
|
||||
|
||||
def test_find_by_gtype
|
||||
info = @repository.find(GLib::Object.gtype)
|
||||
assert_equal("Object", info.name)
|
||||
end
|
||||
|
||||
def test_find_by_name
|
||||
info = @repository.find("GObject", "Object")
|
||||
assert_equal("Object", info.name)
|
||||
end
|
||||
end
|
@ -0,0 +1,37 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestSignalInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("Gio")
|
||||
@object_info = @repository.find("Gio", "Application")
|
||||
@info = @object_info.get_signal(0)
|
||||
end
|
||||
|
||||
def test_flags
|
||||
assert_equal(GLib::SignalFlags::RUN_CLEANUP,
|
||||
@info.flags)
|
||||
end
|
||||
|
||||
def test_class_closure
|
||||
assert_nil(@info.class_closure)
|
||||
end
|
||||
|
||||
def test_true_stops_emit?
|
||||
assert_false(@info.true_stops_emit?)
|
||||
end
|
||||
end
|
@ -0,0 +1,57 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestStructInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@info = @repository.find("GObject", "Value")
|
||||
end
|
||||
|
||||
def test_n_fields
|
||||
assert_equal(2, @info.n_fields)
|
||||
end
|
||||
|
||||
def test_get_field
|
||||
assert_kind_of(GObjectIntrospection::FieldInfo,
|
||||
@info.get_field(0))
|
||||
end
|
||||
|
||||
def test_n_methods
|
||||
assert_equal(62, @info.n_methods)
|
||||
end
|
||||
|
||||
def test_get_method
|
||||
assert_kind_of(GObjectIntrospection::FunctionInfo,
|
||||
@info.get_method(0))
|
||||
end
|
||||
|
||||
def test_size
|
||||
assert_equal(24, @info.size)
|
||||
end
|
||||
|
||||
def test_alignment
|
||||
assert_equal(8, @info.alignment)
|
||||
end
|
||||
|
||||
def test_gtype_struct?
|
||||
assert_false(@info.gtype_struct?)
|
||||
end
|
||||
|
||||
def test_foreign?
|
||||
assert_false(@info.foreign?)
|
||||
end
|
||||
end
|
@ -0,0 +1,62 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestTypeInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@function_info = @repository.find("GObject", "signal_list_ids")
|
||||
@info = @function_info.return_type
|
||||
end
|
||||
|
||||
def test_pointer?
|
||||
assert_true(@info.pointer?)
|
||||
end
|
||||
|
||||
def test_tag
|
||||
assert_kind_of(GObjectIntrospection::TypeTag,
|
||||
@info.tag)
|
||||
end
|
||||
|
||||
def test_param_type
|
||||
assert_kind_of(GObjectIntrospection::TypeInfo,
|
||||
@info.get_param_type(0))
|
||||
end
|
||||
|
||||
def test_interface
|
||||
function_info = @repository.find("GObject", "type_class_ref")
|
||||
info = function_info.return_type
|
||||
assert_kind_of(GObjectIntrospection::StructInfo,
|
||||
info.interface)
|
||||
end
|
||||
|
||||
def test_array_length
|
||||
assert_equal(1, @info.array_length)
|
||||
end
|
||||
|
||||
def test_array_fixed_size
|
||||
assert_equal(-1, @info.array_fixed_size)
|
||||
end
|
||||
|
||||
def test_zero_terminated?
|
||||
assert_false(@info.zero_terminated?)
|
||||
end
|
||||
|
||||
def test_array_type
|
||||
assert_equal(GObjectIntrospection::ArrayType::C,
|
||||
@info.array_type)
|
||||
end
|
||||
end
|
@ -0,0 +1,29 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestTypeTag < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@function_info = @repository.find("GObject", "signal_list_ids")
|
||||
@type_info = @function_info.return_type
|
||||
@tag = @type_info.tag
|
||||
end
|
||||
|
||||
def test_to_s
|
||||
assert_equal("array", @tag.to_s)
|
||||
end
|
||||
end
|
@ -0,0 +1,21 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestUnionInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
# TODO: find UnionInfo
|
||||
end
|
||||
end
|
@ -0,0 +1,28 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestValueInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("GObject")
|
||||
@flags_info = @repository.find("GObject", "SignalFlags")
|
||||
@info = @flags_info.get_value(0)
|
||||
end
|
||||
|
||||
def test_value
|
||||
assert_equal(1, @info.value)
|
||||
end
|
||||
end
|
@ -0,0 +1,42 @@
|
||||
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
class TestVFuncInfo < Test::Unit::TestCase
|
||||
def setup
|
||||
@repository = GObjectIntrospection::Repository.default
|
||||
@repository.require("Gio")
|
||||
@object_info = @repository.find("Gio", "FileOutputStream")
|
||||
@info = @object_info.get_vfunc(0)
|
||||
end
|
||||
|
||||
def test_flags
|
||||
assert_equal(GObjectIntrospection::VFuncInfoFlags.new,
|
||||
@info.flags)
|
||||
end
|
||||
|
||||
def test_offset
|
||||
assert_equal(GObjectIntrospection::VFuncInfo::UNKNOWN_OFFSET,
|
||||
@info.offset)
|
||||
end
|
||||
|
||||
def test_signal
|
||||
assert_nil(@info.signal)
|
||||
end
|
||||
|
||||
def test_invoker
|
||||
assert_nil(@info.invoker)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user