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:
11
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/depend
Normal file
11
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/depend
Normal file
@ -0,0 +1,11 @@
|
||||
install-so: install-headers
|
||||
install-headers:
|
||||
$(INSTALL_DATA) $(srcdir)/rbgio2.h $(RUBYARCHDIR)
|
||||
$(INSTALL_DATA) $(srcdir)/rbgio2conversions.h $(RUBYARCHDIR)
|
||||
|
||||
install: install-pc
|
||||
install-pc:
|
||||
if test -n "$(pkgconfigdir)"; then \
|
||||
$(MAKEDIRS) $(pkgconfigdir); \
|
||||
$(INSTALL_DATA) ruby-gio2.pc $(pkgconfigdir); \
|
||||
fi
|
67
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/extconf.rb
Normal file
67
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/extconf.rb
Normal file
@ -0,0 +1,67 @@
|
||||
=begin
|
||||
extconf.rb for Ruby/GIO extention library
|
||||
=end
|
||||
|
||||
require 'pathname'
|
||||
|
||||
base_dir = Pathname(__FILE__).dirname.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 = "gio2"
|
||||
package_id = "gio-2.0"
|
||||
|
||||
begin
|
||||
require 'mkmf-gnome2'
|
||||
rescue LoadError
|
||||
require 'rubygems'
|
||||
gem 'glib2'
|
||||
require 'mkmf-gnome2'
|
||||
end
|
||||
|
||||
ruby_header = 'ruby.h'
|
||||
have_func 'rb_exec_recursive', ruby_header
|
||||
have_func 'rb_errinfo', ruby_header
|
||||
|
||||
["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
|
||||
|
||||
win32 = setup_win32(module_name, base_dir)
|
||||
|
||||
defines = '-DRUBY_GIO2_COMPILATION'
|
||||
|
||||
PKGConfig.have_package(package_id) or exit 1
|
||||
unless win32
|
||||
PKGConfig.have_package('gio-unix-2.0') and defines += ' -DHAVE_GIO_UNIX'
|
||||
end
|
||||
PKGConfig.have_package('gobject-2.0') or exit 1
|
||||
|
||||
create_pkg_config_file("Ruby/GIO2", package_id)
|
||||
|
||||
$defs << defines
|
||||
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
|
31
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/gio2.c
Normal file
31
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/gio2.c
Normal file
@ -0,0 +1,31 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
void Init_gio2(void);
|
||||
|
||||
void
|
||||
Init_gio2(void)
|
||||
{
|
||||
Init_util();
|
||||
Init_gio();
|
||||
}
|
2
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/gio2.def
Normal file
2
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/gio2.def
Normal file
@ -0,0 +1,2 @@
|
||||
EXPORTS
|
||||
Init_gio2
|
30
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/gio2.h
Normal file
30
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/gio2.h
Normal file
@ -0,0 +1,30 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 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 __GIO2_H__
|
||||
#define __GIO2_H__
|
||||
|
||||
#ifdef __GNUC__
|
||||
#warning "<gio2.h> has been deprecated. Use <rbgio2.h> instead."
|
||||
#endif
|
||||
|
||||
#include "rbgio2.h"
|
||||
|
||||
#endif /* __GIO2_H__ */
|
133
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio.c
Normal file
133
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio.c
Normal file
@ -0,0 +1,133 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mGio
|
||||
|
||||
static VALUE
|
||||
rg_s_has_unix_p(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
return Qtrue;
|
||||
#else
|
||||
return Qfalse;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Init_gio(void)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = rb_define_module("Gio");
|
||||
G_DEF_CLASS(G_TYPE_FILESYSTEM_PREVIEW_TYPE, "FilesystemPreviewType", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CLASS(G_TYPE_DATA_STREAM_BYTE_ORDER, "DataStreamByteOrder", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CLASS(G_TYPE_DATA_STREAM_NEWLINE_TYPE, "DataStreamNewlineType", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CLASS(G_TYPE_ASK_PASSWORD_FLAGS, "AskPasswordFlags", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CLASS(G_TYPE_PASSWORD_SAVE, "PasswordSave", RG_TARGET_NAMESPACE);
|
||||
|
||||
RG_DEF_SMETHOD_P(has_unix, 0);
|
||||
|
||||
Init_gappinfo(RG_TARGET_NAMESPACE);
|
||||
Init_gapplaunchcontext(RG_TARGET_NAMESPACE);
|
||||
Init_gasyncinitable(RG_TARGET_NAMESPACE);
|
||||
Init_gasyncresult(RG_TARGET_NAMESPACE);
|
||||
Init_gbufferedinputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gbufferedoutputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gcancellable(RG_TARGET_NAMESPACE);
|
||||
Init_gcharsetconverter(RG_TARGET_NAMESPACE);
|
||||
Init_gcontenttype(RG_TARGET_NAMESPACE);
|
||||
Init_gconverter(RG_TARGET_NAMESPACE);
|
||||
Init_gconverterinputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gconverteroutputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gdatainputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gdesktopappinfo(RG_TARGET_NAMESPACE);
|
||||
Init_gdataoutputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gdrive(RG_TARGET_NAMESPACE);
|
||||
Init_gemblem(RG_TARGET_NAMESPACE);
|
||||
Init_gemblemedicon(RG_TARGET_NAMESPACE);
|
||||
Init_gfile(RG_TARGET_NAMESPACE);
|
||||
Init_gfileattribute(RG_TARGET_NAMESPACE);
|
||||
Init_gfileattributeinfo(RG_TARGET_NAMESPACE);
|
||||
Init_gfileattributematcher(RG_TARGET_NAMESPACE);
|
||||
Init_gfiledescriptorbased(RG_TARGET_NAMESPACE);
|
||||
Init_gfileenumerator(RG_TARGET_NAMESPACE);
|
||||
Init_gfileicon(RG_TARGET_NAMESPACE);
|
||||
Init_gfileinfo(RG_TARGET_NAMESPACE);
|
||||
Init_gfileinputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gfileiostream(RG_TARGET_NAMESPACE);
|
||||
Init_gfilemonitor(RG_TARGET_NAMESPACE);
|
||||
Init_gfilenamecompleter(RG_TARGET_NAMESPACE);
|
||||
Init_gfileoutputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gfilterinputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gfilteroutputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gicon(RG_TARGET_NAMESPACE);
|
||||
Init_ginetaddress(RG_TARGET_NAMESPACE);
|
||||
Init_ginetsocketaddress(RG_TARGET_NAMESPACE);
|
||||
Init_ginitable(RG_TARGET_NAMESPACE);
|
||||
Init_ginputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gioerror(RG_TARGET_NAMESPACE);
|
||||
Init_giomodule(RG_TARGET_NAMESPACE);
|
||||
Init_giomodules(RG_TARGET_NAMESPACE);
|
||||
Init_gioscheduler(RG_TARGET_NAMESPACE);
|
||||
Init_gioschedulerjob(RG_TARGET_NAMESPACE);
|
||||
Init_giostream(RG_TARGET_NAMESPACE);
|
||||
Init_gloadableicon(RG_TARGET_NAMESPACE);
|
||||
Init_gmemoryinputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gmemoryoutputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gmount(RG_TARGET_NAMESPACE);
|
||||
Init_gmountoperation(RG_TARGET_NAMESPACE);
|
||||
Init_gnetworkaddress(RG_TARGET_NAMESPACE);
|
||||
Init_gnetworkservice(RG_TARGET_NAMESPACE);
|
||||
Init_goutputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gresolver(RG_TARGET_NAMESPACE);
|
||||
Init_gseekable(RG_TARGET_NAMESPACE);
|
||||
Init_gsimpleasyncresult(RG_TARGET_NAMESPACE);
|
||||
Init_gsocket(RG_TARGET_NAMESPACE);
|
||||
Init_gsocketaddress(RG_TARGET_NAMESPACE);
|
||||
Init_gsocketclient(RG_TARGET_NAMESPACE);
|
||||
Init_gsocketconnectable(RG_TARGET_NAMESPACE);
|
||||
Init_gsocketaddressenumerator(RG_TARGET_NAMESPACE);
|
||||
Init_gsocketconnection(RG_TARGET_NAMESPACE);
|
||||
Init_gsocketconnectionfactory(RG_TARGET_NAMESPACE);
|
||||
Init_gsocketcontrolmessage(RG_TARGET_NAMESPACE);
|
||||
Init_gsocketlistener(RG_TARGET_NAMESPACE);
|
||||
Init_gsocketservice(RG_TARGET_NAMESPACE);
|
||||
Init_gsrvtarget(RG_TARGET_NAMESPACE);
|
||||
Init_gtcpconnection(RG_TARGET_NAMESPACE);
|
||||
Init_gthemedicon(RG_TARGET_NAMESPACE);
|
||||
Init_gthreadedsocketservice(RG_TARGET_NAMESPACE);
|
||||
Init_gtlscertificate(RG_TARGET_NAMESPACE);
|
||||
Init_gunixconnection(RG_TARGET_NAMESPACE);
|
||||
Init_gunixfdlist(RG_TARGET_NAMESPACE);
|
||||
Init_gunixfdmessage(RG_TARGET_NAMESPACE);
|
||||
Init_gunixinputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gunixmount(RG_TARGET_NAMESPACE);
|
||||
Init_gunixmounts(RG_TARGET_NAMESPACE);
|
||||
Init_gunixmountpoint(RG_TARGET_NAMESPACE);
|
||||
Init_gunixmountpoints(RG_TARGET_NAMESPACE);
|
||||
Init_gunixmountmonitor(RG_TARGET_NAMESPACE);
|
||||
Init_gunixoutputstream(RG_TARGET_NAMESPACE);
|
||||
Init_gunixsocketaddress(RG_TARGET_NAMESPACE);
|
||||
Init_gvfs(RG_TARGET_NAMESPACE);
|
||||
Init_gvolume(RG_TARGET_NAMESPACE);
|
||||
Init_gvolumemonitor(RG_TARGET_NAMESPACE);
|
||||
Init_gzlibcompressor(RG_TARGET_NAMESPACE);
|
||||
Init_gzlibdecompressor(RG_TARGET_NAMESPACE);
|
||||
}
|
158
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio2.h
Normal file
158
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio2.h
Normal file
@ -0,0 +1,158 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 __RBGIO2_H__
|
||||
#define __RBGIO2_H__
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
#include "rbgio2conversions.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Block Handling */
|
||||
#define SAVE_BLOCK(block) G_STMT_START { \
|
||||
if (!NIL_P(block)) \
|
||||
G_CHILD_ADD(mGLib, (block)); \
|
||||
} G_STMT_END
|
||||
|
||||
#define USE_BLOCK(data) \
|
||||
rbgio_child_remove_and_return(mGLib, (VALUE)(data))
|
||||
|
||||
#define USE_BLOCK_AND_SAVE(data) ((VALUE)data)
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 34, 0)
|
||||
#define G_TYPE_FILE_ATTRIBUTE_MATCHER (g_file_attribute_matcher_get_type())
|
||||
GType g_file_attribute_matcher_get_type(void);
|
||||
|
||||
#define G_TYPE_FILE_ATTRIBUTE_INFO_LIST (g_file_attribute_info_list_get_type())
|
||||
GType g_file_attribute_info_list_get_type(void);
|
||||
#endif
|
||||
|
||||
#define G_TYPE_FILE_ATTRIBUTE_INFO (g_file_attribute_info_get_type())
|
||||
GType g_file_attribute_info_get_type(void);
|
||||
|
||||
/* Conversion Macros */
|
||||
#define RVAL2TYPE_WITH_DEFAULT(value, type, default_value) \
|
||||
(NIL_P(value) ? (default_value) : type(value))
|
||||
|
||||
#define RVAL2ATTRIBUTESDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), RVAL2CSTR, "standard::*")
|
||||
|
||||
#define RVAL2GDRIVESTARTFLAGSDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), \
|
||||
RVAL2GDRIVESTARTFLAGS, \
|
||||
G_DRIVE_START_NONE)
|
||||
|
||||
#define RVAL2GMOUNTMOUNTFLAGSDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), \
|
||||
RVAL2GMOUNTMOUNTFLAGS, \
|
||||
G_MOUNT_MOUNT_NONE)
|
||||
|
||||
#define RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), \
|
||||
RVAL2GMOUNTUNMOUNTFLAGS, \
|
||||
G_MOUNT_UNMOUNT_NONE)
|
||||
|
||||
#define RVAL2GSOCKETPROTOCOLDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), \
|
||||
RVAL2GSOCKETPROTOCOL, \
|
||||
G_SOCKET_PROTOCOL_DEFAULT)
|
||||
|
||||
#define GTIMEVAL2RVAL(value) rb_time_new((value)->tv_sec, (value)->tv_usec)
|
||||
|
||||
#define RVAL2GZLIBCOMPRESSORFORMATDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), \
|
||||
RVAL2GZLIBCOMPRESSORFORMAT, \
|
||||
G_ZLIB_COMPRESSOR_FORMAT_ZLIB)
|
||||
|
||||
#define RVAL2IOPRIORITYDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), NUM2INT, G_PRIORITY_DEFAULT)
|
||||
|
||||
/* Integer Type Conversion Macros */
|
||||
#define FD2RVAL(value) INT2FIX(value)
|
||||
#define RVAL2FD(value) FIX2INT(value)
|
||||
#define RVAL2FDS(value, n) RVAL2GINTS(value, n)
|
||||
|
||||
#define GINT2RVAL(value) INT2NUM(value)
|
||||
#define RVAL2GINT(value) NUM2INT(value)
|
||||
|
||||
#define GINT162RVAL(value) INT2FIX(value)
|
||||
#define RVAL2GINT16(value) FIX2INT(value)
|
||||
|
||||
#define GINT322RVAL(value) INT2NUM(value)
|
||||
#define RVAL2GINT32(value) NUM2INT(value)
|
||||
|
||||
#define GINT642RVAL(value) rbglib_int64_to_num(value)
|
||||
#define RVAL2GINT64(value) rbglib_num_to_int64(value)
|
||||
|
||||
#define GSIZE2RVAL(value) ULONG2NUM(value)
|
||||
#define RVAL2GSIZE(value) NUM2ULONG(value)
|
||||
|
||||
#define GLONG2RVAL(value) LONG2NUM(value)
|
||||
#define RVAL2GLONG(value) NUM2LONG(value)
|
||||
|
||||
#define GOFFSET2RVAL(value) rbglib_int64_to_num(value)
|
||||
#define RVAL2GOFFSET(value) rbglib_num_to_int64(value)
|
||||
|
||||
#define GSSIZE2RVAL(value) LONG2NUM(value)
|
||||
#define RVAL2GSSIZE(value) NUM2LONG(value)
|
||||
|
||||
/* TODO: Should we be zeroing out bits? */
|
||||
#define GUCHAR2RVAL(value) INT2FIX(value)
|
||||
#define RVAL2GUCHAR(value) FIX2INT(value)
|
||||
|
||||
#define GUINT2RVAL(value) UINT2NUM(value)
|
||||
#define RVAL2GUINT(value) NUM2UINT(value)
|
||||
|
||||
/* TODO: Should we be zeroing out bits? */
|
||||
#define GUINT162RVAL(value) INT2FIX(value)
|
||||
#define RVAL2GUINT16(value) FIX2INT(value)
|
||||
|
||||
#define GUINT322RVAL(value) UINT2NUM(value)
|
||||
#define RVAL2GUINT32(value) NUM2UINT(value)
|
||||
|
||||
#define GUINT642RVAL(value) rbglib_uint64_to_num(value)
|
||||
#define RVAL2GUINT64(value) rbglib_num_to_uint64(value)
|
||||
|
||||
#define GULONG2RVAL(value) ULONG2NUM(value)
|
||||
#define RVAL2GULONG(value) NUM2ULONG(value)
|
||||
|
||||
VALUE rbgio_define_domain_error(VALUE module,
|
||||
const char *name,
|
||||
GQuark domain,
|
||||
const char *enum_name,
|
||||
VALUE parent);
|
||||
VALUE rbgio_define_error(VALUE module,
|
||||
const char *name,
|
||||
gint code,
|
||||
VALUE domain_error);
|
||||
NORETURN(void rbgio_raise_error(GError *error));
|
||||
GObject *rbgio_ginitable_new(GType type, VALUE parameters, VALUE cancellable);
|
||||
void rbgio_gasyncinitable_new_async(GType type,
|
||||
VALUE parameters,
|
||||
VALUE io_priority,
|
||||
VALUE cancellable,
|
||||
VALUE block);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __RBGIO2_H__ */
|
154
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio2conversions.h
Normal file
154
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio2conversions.h
Normal file
@ -0,0 +1,154 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 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 __RBGIO2CONVERSIONS_H__
|
||||
#define __RBGIO2CONVERSIONS_H__
|
||||
|
||||
#define RVAL2GAPPINFO(o) (G_APP_INFO(RVAL2GOBJ(o)))
|
||||
#define RVAL2GAPPLAUNCHCONTEXT(o) (G_APP_LAUNCH_CONTEXT(RVAL2GOBJ(o)))
|
||||
#define RVAL2GASYNCINITABLE(o) (G_ASYNC_INITABLE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GASYNCRESULT(o) (G_ASYNC_RESULT(RVAL2GOBJ(o)))
|
||||
#define RVAL2GBUFFEREDINPUTSTREAM(o) (G_BUFFERED_INPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GBUFFEREDOUTPUTSTREAM(o) (G_BUFFERED_OUTPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GCANCELLABLE(o) (G_CANCELLABLE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GCHARSETCONVERTER(o) (G_CHARSET_CONVERTER(RVAL2GOBJ(o)))
|
||||
#define RVAL2GCONVERTER(o) (G_CONVERTER(RVAL2GOBJ(o)))
|
||||
#define RVAL2GCONVERTERINPUTSTREAM(o) (G_CONVERTER_INPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GCONVERTEROUTPUTSTREAM(o) (G_CONVERTER_OUTPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GDATAINPUTSTREAM(o) (G_DATA_INPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GDATAOUTPUTSTREAM(o) (G_DATA_OUTPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GDESKTOPAPPINFO(o) (G_DESKTOP_APP_INFO(RVAL2GOBJ(o)))
|
||||
#define RVAL2GDRIVE(o) (G_DRIVE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GEMBLEM(o) (G_EMBLEM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GEMBLEMEDICON(o) (G_EMBLEMED_ICON(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILE(o) (G_FILE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILEDESCRIPTORBASED(o) (G_FILE_DESCRIPTOR_BASED(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILEENUMERATOR(o) (G_FILE_ENUMERATOR(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILEICON(o) (G_FILE_ICON(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILEINFO(o) (G_FILE_INFO(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILEINPUTSTREAM(o) (G_FILE_INPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILEIOSTREAM(o) (G_FILE_IO_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILEMONITOR(o) (G_FILE_MONITOR(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILENAMECOMPLETER(o) (G_FILENAME_COMPLETER(RVAL2GOBJ(o)))
|
||||
#define RVAL2GFILEOUTPUTSTREAM(o) (G_FILE_OUTPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GICON(o) (G_ICON(RVAL2GOBJ(o)))
|
||||
#define RVAL2GINETADDRESS(o) (G_INET_ADDRESS(RVAL2GOBJ(o)))
|
||||
#define RVAL2GINITABLE(o) (G_INITABLE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GINPUTSTREAM(o) (G_INPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GIOMODULE(o) (G_IO_MODULE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GIOSTREAM(o) (G_IO_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GLOADABLEICON(o) (G_LOADABLE_ICON(RVAL2GOBJ(o)))
|
||||
#define RVAL2GMEMORYINPUTSTREAM(o) (G_MEMORY_INPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GMOUNT(o) (G_MOUNT(RVAL2GOBJ(o)))
|
||||
#define RVAL2GMOUNTOPERATION(o) (G_MOUNT_OPERATION(RVAL2GOBJ(o)))
|
||||
#define RVAL2GNETWORKADDRESS(o) (G_NETWORK_ADDRESS(RVAL2GOBJ(o)))
|
||||
#define RVAL2GNETWORKSERVICE(o) (G_NETWORK_SERVICE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GOUTPUTSTREAM(o) (G_OUTPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GPERMISSION(o) (G_PERMISSION(RVAL2GOBJ(o)))
|
||||
#define RVAL2GRESOLVER(o) (G_RESOLVER(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSEEKABLE(o) (G_SEEKABLE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSIMPLEASYNCRESULT(o) (G_SIMPLE_ASYNC_RESULT(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSOCKET(o) (G_SOCKET(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSOCKETADDRESS(o) (G_SOCKET_ADDRESS(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSOCKETADDRESSENUMERATOR(o) (G_SOCKET_ADDRESS_ENUMERATOR(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSOCKETCLIENT(o) (G_SOCKET_CLIENT(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSOCKETCONNECTABLE(o) (G_SOCKET_CONNECTABLE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSOCKETCONNECTION(o) (G_SOCKET_CONNECTION(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSOCKETCONTROLMESSAGE(o) (G_SOCKET_CONTROL_MESSAGE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSOCKETLISTENER(o) (G_SOCKET_LISTENER(RVAL2GOBJ(o)))
|
||||
#define RVAL2GSOCKETSERVICE(o) (G_SOCKET_SERVICE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GTHEMEDICON(o) (G_THEMED_ICON(RVAL2GOBJ(o)))
|
||||
#define RVAL2GUNIXCONNECTION(o) (G_UNIX_CONNECTION(RVAL2GOBJ(o)))
|
||||
#define RVAL2GUNIXFDLIST(o) (G_UNIX_FD_LIST(RVAL2GOBJ(o)))
|
||||
#define RVAL2GUNIXFDMESSAGE(o) (G_UNIX_FD_MESSAGE(RVAL2GOBJ(o)))
|
||||
#define RVAL2GUNIXINPUTSTREAM(o) (G_UNIX_INPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GUNIXMOUNTMONITOR(o) (G_UNIX_MOUNT_MONITOR(RVAL2GOBJ(o)))
|
||||
#define RVAL2GUNIXOUTPUTSTREAM(o) (G_UNIX_OUTPUT_STREAM(RVAL2GOBJ(o)))
|
||||
#define RVAL2GUNIXSOCKETADDRESS(o) (G_UNIX_SOCKET_ADDRESS(RVAL2GOBJ(o)))
|
||||
#define RVAL2GVFS(o) (G_VFS(RVAL2GOBJ(o)))
|
||||
#define RVAL2GVOLUME(o) (G_VOLUME(RVAL2GOBJ(o)))
|
||||
#define RVAL2GVOLUMEMONITOR(o) (G_VOLUME_MONITOR(RVAL2GOBJ(o)))
|
||||
#define RVAL2GZLIBCOMPRESSOR(o) (G_ZLIB_COMPRESSOR(RVAL2GOBJ(o)))
|
||||
#define RVAL2GZLIBDECOMPRESSOR(o) (G_ZLIB_DECOMPRESSOR(RVAL2GOBJ(o)))
|
||||
|
||||
#define RVAL2GFILEATTRIBUTEINFO(o) ((GFileAttributeInfo*)RVAL2BOXED(o, G_TYPE_FILE_ATTRIBUTE_INFO))
|
||||
#define GFILEATTRIBUTEINFO2RVAL(o) (BOXED2RVAL(o, G_TYPE_FILE_ATTRIBUTE_INFO))
|
||||
#define RVAL2GFILEATTRIBUTEINFOLIST(o) ((GFileAttributeInfoList*)RVAL2BOXED(o, G_TYPE_FILE_ATTRIBUTE_INFO_LIST))
|
||||
#define GFILEATTRIBUTEINFOLIST2RVAL(o) (BOXED2RVAL(o, G_TYPE_FILE_ATTRIBUTE_INFO_LIST))
|
||||
#define RVAL2GFILEATTRIBUTEMATCHER(o) ((GFileAttributeMatcher*)RVAL2BOXED(o, G_TYPE_FILE_ATTRIBUTE_MATCHER))
|
||||
#define GFILEATTRIBUTEMATCHER2RVAL(o) (BOXED2RVAL(o, G_TYPE_FILE_ATTRIBUTE_MATCHER))
|
||||
#define RVAL2GSRVTARGET(o) ((GSrvTarget*)RVAL2BOXED(o, G_TYPE_SRV_TARGET))
|
||||
#define GSRVTARGET2RVAL(o) (BOXED2RVAL(o, G_TYPE_SRV_TARGET))
|
||||
|
||||
#define RVAL2GDATASTREAMBYTEORDER(o) (RVAL2GENUM(o, G_TYPE_DATA_STREAM_BYTE_ORDER))
|
||||
#define GDATASTREAMBYTEORDER2RVAL(o) (GENUM2RVAL(o, G_TYPE_DATA_STREAM_BYTE_ORDER))
|
||||
#define RVAL2GDATASTREAMNEWLINETYPE(o) (RVAL2GENUM(o, G_TYPE_DATA_STREAM_NEWLINE_TYPE))
|
||||
#define GDATASTREAMNEWLINETYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_DATA_STREAM_NEWLINE_TYPE))
|
||||
#define RVAL2GDRIVESTARTFLAGS(o) (RVAL2GENUM(o, G_TYPE_DRIVE_START_FLAGS))
|
||||
#define GDRIVESTARTFLAGS2RVAL(o) (GENUM2RVAL(o, G_TYPE_DRIVE_START_FLAGS))
|
||||
#define RVAL2GDRIVESTARTSTOPTYPE(o) (RVAL2GENUM(o, G_TYPE_DRIVE_START_STOP_TYPE))
|
||||
#define GDRIVESTARTSTOPTYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_DRIVE_START_STOP_TYPE))
|
||||
#define RVAL2GEMBLEMORIGIN(o) (RVAL2GENUM(o, G_TYPE_EMBLEM_ORIGIN))
|
||||
#define GEMBLEMORIGIN2RVAL(o) (GENUM2RVAL(o, G_TYPE_EMBLEM_ORIGIN))
|
||||
#define RVAL2GFILEATTRIBUTESTATUS(o) (RVAL2GENUM(o, G_TYPE_FILE_ATTRIBUTE_STATUS))
|
||||
#define GFILEATTRIBUTESTATUS2RVAL(o) (GENUM2RVAL(o, G_TYPE_FILE_ATTRIBUTE_STATUS))
|
||||
#define RVAL2GFILEATTRIBUTETYPE(o) (RVAL2GENUM(o, G_TYPE_FILE_ATTRIBUTE_TYPE))
|
||||
#define GFILEATTRIBUTETYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_FILE_ATTRIBUTE_TYPE))
|
||||
#define RVAL2GFILETYPE(o) (RVAL2GENUM(o, G_TYPE_FILE_TYPE))
|
||||
#define GFILETYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_FILE_TYPE))
|
||||
#define RVAL2GMOUNTMOUNTFLAGS(o) (RVAL2GENUM(o, G_TYPE_MOUNT_MOUNT_FLAGS))
|
||||
#define GMOUNTMOUNTFLAGS2RVAL(o) (GENUM2RVAL(o, G_TYPE_MOUNT_MOUNT_FLAGS))
|
||||
#define RVAL2GMOUNTOPERATIONRESULT(o) (RVAL2GENUM(o, G_TYPE_MOUNT_OPERATION_RESULT))
|
||||
#define GMOUNTOPERATIONRESULT2RVAL(o) (GENUM2RVAL(o, G_TYPE_MOUNT_OPERATION_RESULT))
|
||||
#define RVAL2GPASSWORDSAVE(o) (RVAL2GENUM(o, G_TYPE_PASSWORD_SAVE))
|
||||
#define GPASSWORDSAVE2RVAL(o) (GENUM2RVAL(o, G_TYPE_PASSWORD_SAVE))
|
||||
#define RVAL2GSOCKETFAMILY(o) (RVAL2GENUM(o, G_TYPE_SOCKET_FAMILY))
|
||||
#define GSOCKETFAMILY2RVAL(o) (GENUM2RVAL(o, G_TYPE_SOCKET_FAMILY))
|
||||
#define RVAL2GSOCKETPROTOCOL(o) (RVAL2GENUM(o, G_TYPE_SOCKET_PROTOCOL))
|
||||
#define GSOCKETPROTOCOL2RVAL(o) (GENUM2RVAL(o, G_TYPE_SOCKET_PROTOCOL))
|
||||
#define RVAL2GSOCKETTYPE(o) (RVAL2GENUM(o, G_TYPE_SOCKET_TYPE))
|
||||
#define GSOCKETTYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_SOCKET_TYPE))
|
||||
|
||||
#define RVAL2GAPPINFOCREATEFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_APP_INFO_CREATE_FLAGS))
|
||||
#define GAPPINFOCREATEFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_APP_INFO_CREATE_FLAGS))
|
||||
#define RVAL2GAPPLICATIONFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_APPLICATION_FLAGS))
|
||||
#define GAPPLICATIONFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_APPLICATION_FLAGS))
|
||||
#define RVAL2GCONVERTERFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_CONVERTER_FLAGS))
|
||||
#define GCONVERTERFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_CONVERTER_FLAGS))
|
||||
#define RVAL2GCONVERTERRESULT(o) (RVAL2GFLAGS(o, G_TYPE_CONVERTER_RESULT))
|
||||
#define GCONVERTERRESULT2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_CONVERTER_RESULT))
|
||||
#define RVAL2GFILEATTRIBUTEINFOFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS))
|
||||
#define GFILEATTRIBUTEINFOFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS))
|
||||
#define RVAL2GFILECOPYFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_COPY_FLAGS))
|
||||
#define GFILECOPYFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_COPY_FLAGS))
|
||||
#define RVAL2GFILECREATEFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_CREATE_FLAGS))
|
||||
#define GFILECREATEFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_CREATE_FLAGS))
|
||||
#define RVAL2GFILEMONITORFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_MONITOR_FLAGS))
|
||||
#define GFILEMONITORFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_MONITOR_FLAGS))
|
||||
#define RVAL2GFILEQUERYINFOFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_QUERY_INFO_FLAGS))
|
||||
#define GFILEQUERYINFOFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_QUERY_INFO_FLAGS))
|
||||
#define RVAL2GMOUNTUNMOUNTFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_MOUNT_UNMOUNT_FLAGS))
|
||||
#define GMOUNTUNMOUNTFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_MOUNT_UNMOUNT_FLAGS))
|
||||
#define RVAL2GOUTPUTSTREAMSPLICEFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS))
|
||||
#define GOUTPUTSTREAMSPLICEFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS))
|
||||
#define RVAL2GZLIBCOMPRESSORFORMAT(o) (RVAL2GFLAGS(o, G_TYPE_ZLIB_COMPRESSOR_FORMAT))
|
||||
#define GZLIBCOMPRESSORFORMAT2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_ZLIB_COMPRESSOR_FORMAT))
|
||||
|
||||
#endif /* __RBGIO2CONVERSIONS_H__ */
|
148
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio2private.h
Normal file
148
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgio2private.h
Normal file
@ -0,0 +1,148 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 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 __RBGIO2PRIVATE_H__
|
||||
#define __RBGIO2PRIVATE_H__
|
||||
|
||||
#include <ruby.h>
|
||||
|
||||
#include <rbglib.h>
|
||||
#include <rbgobject.h>
|
||||
#include "rbgio2.h"
|
||||
|
||||
#define CSTR2RVAL_TAINTED(string, length) \
|
||||
rbgio_cstr_to_rval_tainted((string), (length))
|
||||
#define CSTR2RVAL_TAINTED_FREE(string, length) \
|
||||
rbgio_cstr_to_rval_tainted_free((string), (length))
|
||||
|
||||
#define GLIST2ARY_UNREF_FREE(list) rbgio_glist_to_ary_unref_free(list)
|
||||
|
||||
#define GFDS2ARY(fds) rbgio_fds_to_ary(fds)
|
||||
#define GFDS2ARY_FREE(fds) rbgio_fds_to_ary_free(fds)
|
||||
|
||||
#define GFILEARY2GLIST(ary) rbgio_gfile_ary_to_glist(ary)
|
||||
#define GFILEARY2GLIST_ACCEPT_NIL(ary) rbgio_gfile_ary_to_glist_accept_nil(ary)
|
||||
|
||||
G_GNUC_INTERNAL VALUE rbgio_cstr_to_rval_tainted(const char *string,
|
||||
gsize length);
|
||||
G_GNUC_INTERNAL VALUE rbgio_cstr_to_rval_tainted_free(char *string,
|
||||
gsize length);
|
||||
G_GNUC_INTERNAL VALUE rbgio_glist_to_ary_unref_free(GList *list);
|
||||
G_GNUC_INTERNAL VALUE rbgio_fds_to_ary(const gint *fds);
|
||||
G_GNUC_INTERNAL VALUE rbgio_fds_to_ary_free(gint *fds);
|
||||
G_GNUC_INTERNAL GList *rbgio_gfile_ary_to_glist(VALUE ary);
|
||||
G_GNUC_INTERNAL GList *rbgio_gfile_ary_to_glist_accept_nil(VALUE ary);
|
||||
G_GNUC_INTERNAL void rbgio_rval_to_gtimeval(VALUE value, GTimeVal *time);
|
||||
G_GNUC_INTERNAL void rbgio_async_ready_callback(GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data);
|
||||
G_GNUC_INTERNAL VALUE rbgio_child_remove_and_return(VALUE parent, VALUE child);
|
||||
|
||||
G_GNUC_INTERNAL void Init_gio(void);
|
||||
G_GNUC_INTERNAL void Init_gappinfo(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gapplaunchcontext(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gasyncinitable(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gasyncresult(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gbufferedinputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gbufferedoutputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gcancellable(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gcharsetconverter(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gcontenttype(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gconverter(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gconverterinputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gconverteroutputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gdatainputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gdataoutputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gdesktopappinfo(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gdrive(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gemblem(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gemblemedicon(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfile(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfileattribute(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfileattributeinfo(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_fileattributeinfolist(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfileattributematcher(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfiledescriptorbased(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfileenumerator(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfileicon(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfileinfo(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfileinputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfileiostream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfilemonitor(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfilenamecompleter(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfileoutputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfilterinputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gfilteroutputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gicon(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_ginetaddress(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_ginetsocketaddress(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_ginitable(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_ginputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gioerror(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_giomodule(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_giomodules(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gioscheduler(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gioschedulerjob(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_giostream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gloadableicon(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gmemoryinputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gmemoryoutputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gmount(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gmountoperation(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gnetworkaddress(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gnetworkservice(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_goutputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gresolver(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gseekable(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsimpleasyncresult(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocket(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocketaddress(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocketclient(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocketconnectable(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocketaddressenumerator(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocketconnection(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocketconnectionfactory(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocketcontrolmessage(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocketlistener(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsocketservice(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gsrvtarget(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gtcpconnection(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gthreadedsocketservice(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gthemedicon(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gtlscertificate(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixconnection(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixfdlist(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixfdmessage(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixinputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixmount(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixmounts(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixmountpoint(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixmountpoints(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixmountmonitor(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixoutputstream(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gunixsocketaddress(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gvfs(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gvolume(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gvolumemonitor(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gzlibcompressor(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_gzlibdecompressor(VALUE mGio);
|
||||
G_GNUC_INTERNAL void Init_util(void);
|
||||
|
||||
#endif /* __RBGIO2PRIVATE_H__ */
|
317
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioappinfo.c
Normal file
317
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioappinfo.c
Normal file
@ -0,0 +1,317 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mAppInfo
|
||||
#define _SELF(value) RVAL2GAPPINFO(value)
|
||||
|
||||
#define RVAL2GAPPINFOCREATEFLAGSDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), \
|
||||
RVAL2GAPPINFOCREATEFLAGS, \
|
||||
G_APP_INFO_CREATE_NONE)
|
||||
|
||||
static VALUE
|
||||
rg_s_create_from_commandline(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
VALUE commandline, application_name, flags;
|
||||
GError *error = NULL;
|
||||
GAppInfo *info;
|
||||
|
||||
rb_scan_args(argc, argv, "12", &commandline, &application_name, &flags);
|
||||
info = g_app_info_create_from_commandline(RVAL2CSTR(commandline),
|
||||
RVAL2CSTR_ACCEPT_NIL(application_name),
|
||||
RVAL2GAPPINFOCREATEFLAGSDEFAULT(flags),
|
||||
&error);
|
||||
if (info == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_reset_type_associations(VALUE self, VALUE content_type)
|
||||
{
|
||||
g_app_info_reset_type_associations(RVAL2CSTR(content_type));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_get_all_for_type(G_GNUC_UNUSED VALUE self, VALUE content_type)
|
||||
{
|
||||
return GLIST2ARY_FREE(g_app_info_get_all_for_type(RVAL2CSTR(content_type)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_all(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE content_type;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &content_type);
|
||||
if (!NIL_P(content_type))
|
||||
return rg_s_get_all_for_type(self, content_type);
|
||||
|
||||
return GLIST2ARY_FREE(g_app_info_get_all());
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_get_default_for_type(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
VALUE content_type, must_support_uris;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &content_type, &must_support_uris);
|
||||
|
||||
return GOBJ2RVAL_UNREF(g_app_info_get_default_for_type(RVAL2CSTR(content_type),
|
||||
RVAL2CBOOL(must_support_uris)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_get_default_for_uri_scheme(G_GNUC_UNUSED VALUE self, VALUE uri_scheme)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_app_info_get_default_for_uri_scheme(RVAL2CSTR(uri_scheme)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_launch_default_for_uri(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE uri, launch_context;
|
||||
GError *error;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &uri, &launch_context);
|
||||
if (!g_app_info_launch_default_for_uri(RVAL2CSTR(uri),
|
||||
RVAL2GAPPLAUNCHCONTEXT(launch_context),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_dup(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_app_info_dup(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_equal_p(VALUE self, VALUE other)
|
||||
{
|
||||
return CBOOL2RVAL(g_app_info_equal(_SELF(self), _SELF(other)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_id(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_app_info_get_id(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_app_info_get_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_display_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_app_info_get_display_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_description(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_app_info_get_description(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_executable(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_app_info_get_executable(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_commandline(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_app_info_get_commandline(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_icon(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL(g_app_info_get_icon(_SELF(self)));
|
||||
}
|
||||
|
||||
typedef gboolean (*LaunchMethod)(GAppInfo *,
|
||||
GList *,
|
||||
GAppLaunchContext *,
|
||||
GError **);
|
||||
|
||||
static VALUE
|
||||
launch_method(LaunchMethod method, int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbfiles, rblaunch_context;
|
||||
GList *files;
|
||||
GAppLaunchContext *launch_context;
|
||||
GError *error = NULL;
|
||||
gboolean launched;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &rbfiles, &rblaunch_context);
|
||||
launch_context = RVAL2GAPPLAUNCHCONTEXT(rblaunch_context);
|
||||
files = GFILEARY2GLIST_ACCEPT_NIL(rbfiles);
|
||||
launched = method(_SELF(self), files, launch_context, &error);
|
||||
g_list_free(files);
|
||||
|
||||
if (!launched)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_launch(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return launch_method(g_app_info_launch, argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_supports_files_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_app_info_supports_files(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_supports_uris_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_app_info_supports_uris(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_launch_uris(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return launch_method(g_app_info_launch_uris, argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_should_show_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_app_info_should_show(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_delete_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_app_info_can_delete(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_delete(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_app_info_delete(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_as_default_for_type(VALUE self, VALUE value)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_app_info_set_as_default_for_type(_SELF(self), RVAL2CSTR(value), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_as_default_for_extension(VALUE self, VALUE value)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_app_info_set_as_default_for_extension(_SELF(self), RVAL2CSTR(value), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_add_supports_type(VALUE self, VALUE value)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_app_info_add_supports_type(_SELF(self), RVAL2CSTR(value), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_remove_supports_type(VALUE self, VALUE value)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_app_info_remove_supports_type(_SELF(self), RVAL2CSTR(value), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_remove_supports_type_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_app_info_can_remove_supports_type(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gappinfo(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_APP_INFO, "AppInfo", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_APP_INFO_CREATE_FLAGS, "CreateFlags", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_APP_INFO_CREATE_FLAGS, "G_APP_INFO_");
|
||||
|
||||
RG_DEF_SMETHOD(create_from_commandline, -1);
|
||||
RG_DEF_SMETHOD(reset_type_associations, -1);
|
||||
RG_DEF_SMETHOD(all, 0);
|
||||
RG_DEF_SMETHOD(get_all_for_type, 1);
|
||||
RG_DEF_SMETHOD(get_default_for_type, -1);
|
||||
RG_DEF_SMETHOD(get_default_for_uri_scheme, 1);
|
||||
RG_DEF_SMETHOD(launch_default_for_uri, 0);
|
||||
|
||||
RG_DEF_METHOD(dup, 0);
|
||||
RG_DEF_METHOD_P(equal, 1);
|
||||
RG_DEF_METHOD(id, 0);
|
||||
RG_DEF_METHOD(name, 0);
|
||||
RG_DEF_METHOD(display_name, 0);
|
||||
RG_DEF_METHOD(description, 0);
|
||||
RG_DEF_METHOD(executable, 0);
|
||||
RG_DEF_METHOD(commandline, 0);
|
||||
RG_DEF_METHOD(icon, 0);
|
||||
RG_DEF_METHOD(launch, -1);
|
||||
RG_DEF_METHOD_P(supports_files, 0);
|
||||
RG_DEF_METHOD_P(supports_uris, 0);
|
||||
RG_DEF_METHOD(launch_uris, -1);
|
||||
RG_DEF_METHOD_P(should_show, 0);
|
||||
RG_DEF_METHOD_P(can_delete, 0);
|
||||
RG_DEF_METHOD(delete, 0);
|
||||
RG_DEF_METHOD(set_as_default_for_type, 1);
|
||||
RG_DEF_METHOD(set_as_default_for_extension, 1);
|
||||
RG_DEF_METHOD(add_supports_type, 1);
|
||||
RG_DEF_METHOD_P(can_remove_supports_type, 1);
|
||||
RG_DEF_METHOD(remove_supports_type, 1);
|
||||
}
|
81
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioapplaunchcontext.c
Normal file
81
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioapplaunchcontext.c
Normal file
@ -0,0 +1,81 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cAppLaunchContext
|
||||
#define _SELF(value) RVAL2GAPPLAUNCHCONTEXT(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self)
|
||||
{
|
||||
G_INITIALIZE(self, g_app_launch_context_new());
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
typedef char *(*GetMethod)(GAppLaunchContext *, GAppInfo *, GList *);
|
||||
|
||||
static VALUE
|
||||
get_value_by(GetMethod method, int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE info, rbfiles;
|
||||
GList *files;
|
||||
char *value;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &info, &rbfiles);
|
||||
files = GFILEARY2GLIST_ACCEPT_NIL(rbfiles);
|
||||
value = method(_SELF(self), RVAL2GAPPINFO(info), files);
|
||||
g_list_free(files);
|
||||
|
||||
return CSTR2RVAL_FREE(value);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_display(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return get_value_by(g_app_launch_context_get_display, argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_startup_notify_id(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return get_value_by(g_app_launch_context_get_startup_notify_id, argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_launch_failed(VALUE self, VALUE sn_id)
|
||||
{
|
||||
g_app_launch_context_launch_failed(_SELF(self), RVAL2CSTR(sn_id));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gapplaunchcontext(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_APP_LAUNCH_CONTEXT, "AppLaunchContext", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 0);
|
||||
RG_DEF_METHOD(get_display, -1);
|
||||
RG_DEF_METHOD(get_startup_notify_id, -1);
|
||||
RG_DEF_METHOD(launch_failed, 1);
|
||||
}
|
246
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioasyncinitable.c
Normal file
246
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioasyncinitable.c
Normal file
@ -0,0 +1,246 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mAsyncInitable
|
||||
#define _SELF(value) RVAL2GASYNCINITABLE(value)
|
||||
|
||||
static VALUE
|
||||
rg_init_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbio_priority, rbcancellable, block;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_async_initable_init_async(_SELF(self),
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_init_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_async_initable_init_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/* NOTE: We don't implement g_async_initable_new_async. */
|
||||
|
||||
/* NOTE: We don't implement g_async_initable_new_valist_async. */
|
||||
|
||||
struct rbgio_gasyncinitable_new_async_data {
|
||||
GObjectClass *gclass;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
VALUE block;
|
||||
VALUE rbparameters;
|
||||
guint index;
|
||||
guint n_parameters;
|
||||
GParameter *parameters;
|
||||
};
|
||||
|
||||
static VALUE
|
||||
rbgio_gasyncinitiable_new_async_parameters_initialize(VALUE key_value,
|
||||
struct rbgio_gasyncinitable_new_async_data *data)
|
||||
{
|
||||
VALUE key, value;
|
||||
GParamSpec *spec;
|
||||
|
||||
if (data->index >= data->n_parameters)
|
||||
rb_raise(rb_eArgError,
|
||||
"too many parameters (%d >= %d)",
|
||||
data->index, data->n_parameters);
|
||||
|
||||
key = rb_ary_entry(key_value, 0);
|
||||
value = rb_ary_entry(key_value, 1);
|
||||
|
||||
data->parameters[data->index].name = SYMBOL_P(key) ?
|
||||
rb_id2name(SYM2ID(key)) :
|
||||
StringValuePtr(key);
|
||||
spec = g_object_class_find_property(data->gclass,
|
||||
data->parameters[data->index].name);
|
||||
if (spec == NULL)
|
||||
rb_raise(rb_eArgError,
|
||||
"%s: no such property",
|
||||
data->parameters[data->index].name);
|
||||
g_value_init(&(data->parameters[data->index].value),
|
||||
G_PARAM_SPEC_VALUE_TYPE(spec));
|
||||
rbgobj_rvalue_to_gvalue(value, &(data->parameters[data->index].value));
|
||||
|
||||
data->index++;
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rbgio_gasyncinitable_new_async_body(struct rbgio_gasyncinitable_new_async_data *data)
|
||||
{
|
||||
rb_iterate(rb_each,
|
||||
data->rbparameters,
|
||||
rbgio_gasyncinitiable_new_async_parameters_initialize,
|
||||
(VALUE)data);
|
||||
|
||||
SAVE_BLOCK(data->block);
|
||||
|
||||
g_async_initable_newv_async(G_TYPE_FROM_CLASS(data->gclass),
|
||||
data->n_parameters,
|
||||
data->parameters,
|
||||
data->io_priority,
|
||||
data->cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)data->block);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rbgio_gasyncinitable_new_async_ensure(struct rbgio_gasyncinitable_new_async_data *data)
|
||||
{
|
||||
guint i;
|
||||
|
||||
g_type_class_unref(data->gclass);
|
||||
for (i = 0; i < data->n_parameters; i++)
|
||||
if (G_IS_VALUE(&data->parameters[i].value))
|
||||
g_value_unset(&data->parameters[i].value);
|
||||
|
||||
g_free(data->parameters);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
rbgio_gasyncinitable_new_async(GType type,
|
||||
VALUE parameters,
|
||||
VALUE io_priority,
|
||||
VALUE cancellable,
|
||||
VALUE block)
|
||||
{
|
||||
static ID s_id_length;
|
||||
struct rbgio_gasyncinitable_new_async_data data;
|
||||
|
||||
if (s_id_length == 0)
|
||||
s_id_length = rb_intern("length");
|
||||
|
||||
if (!g_type_is_a(type, G_TYPE_OBJECT))
|
||||
rb_raise(rb_eArgError,
|
||||
"%s is not a descendant of GObject",
|
||||
g_type_name(type));
|
||||
|
||||
if (NIL_P(parameters)) {
|
||||
SAVE_BLOCK(block);
|
||||
g_async_initable_newv_async(type,
|
||||
0,
|
||||
NULL,
|
||||
RVAL2IOPRIORITYDEFAULT(io_priority),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return;
|
||||
} else {
|
||||
parameters = rb_convert_type(parameters,
|
||||
T_HASH,
|
||||
"Hash",
|
||||
"to_hash");
|
||||
}
|
||||
|
||||
data.gclass = G_OBJECT_CLASS(g_type_class_ref(type));
|
||||
data.io_priority = RVAL2IOPRIORITYDEFAULT(io_priority);
|
||||
data.cancellable = RVAL2GCANCELLABLE(cancellable);
|
||||
data.block = block;
|
||||
data.rbparameters = parameters;
|
||||
data.index = 0;
|
||||
data.n_parameters = RVAL2GUINT(rb_funcall(parameters, s_id_length, 0));
|
||||
data.parameters = g_new(GParameter, data.n_parameters);
|
||||
|
||||
rb_ensure(rbgio_gasyncinitable_new_async_body, (VALUE)&data,
|
||||
rbgio_gasyncinitable_new_async_ensure, (VALUE)&data);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
const RGObjClassInfo* info;
|
||||
VALUE io_priority, cancellable, parameters, block;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &io_priority, &cancellable, ¶meters, &block);
|
||||
|
||||
info = CLASS2CINFO(self);
|
||||
if (info->klass != self)
|
||||
rb_raise(rb_eTypeError,
|
||||
"%s: class not registered with GLib",
|
||||
rb_class2name(self));
|
||||
|
||||
rbgio_gasyncinitable_new_async(info->gtype,
|
||||
parameters,
|
||||
io_priority,
|
||||
cancellable,
|
||||
block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_initialize_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GObject *object;
|
||||
VALUE rbobject;
|
||||
|
||||
object = g_async_initable_new_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (object == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
rbobject = GOBJ2RVAL(object);
|
||||
g_object_unref(object);
|
||||
|
||||
return rbobject;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gasyncinitable(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_ASYNC_INITABLE, "AsyncInitable", mGio);
|
||||
|
||||
RG_DEF_METHOD(init_async, -1);
|
||||
RG_DEF_METHOD(init_finish, 1);
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(initialize_finish, 1);
|
||||
}
|
41
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioasyncresult.c
Normal file
41
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioasyncresult.c
Normal file
@ -0,0 +1,41 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mAsyncResult
|
||||
#define _SELF(value) RVAL2GASYNCRESULT(value)
|
||||
|
||||
/* NOTE: g_async_result_get_user_data isn't of any use from Ruby. */
|
||||
|
||||
static VALUE
|
||||
rg_source_object(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_async_result_get_source_object(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gasyncresult(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_ASYNC_RESULT, "AsyncResult", mGio);
|
||||
|
||||
RG_DEF_METHOD(source_object, 0);
|
||||
}
|
167
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiobufferedinputstream.c
Normal file
167
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiobufferedinputstream.c
Normal file
@ -0,0 +1,167 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cBufferedInputStream
|
||||
#define _SELF(value) RVAL2GBUFFEREDINPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbbase_stream, size;
|
||||
GInputStream *base_stream, *stream;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbbase_stream, &size);
|
||||
base_stream = RVAL2GINPUTSTREAM(rbbase_stream);
|
||||
|
||||
stream = NIL_P(size) ?
|
||||
g_buffered_input_stream_new(base_stream) :
|
||||
g_buffered_input_stream_new_sized(base_stream, RVAL2GSIZE(size));
|
||||
G_INITIALIZE(self, stream);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_available(VALUE self)
|
||||
{
|
||||
return GSIZE2RVAL(g_buffered_input_stream_get_available(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_peek_buffer(VALUE self)
|
||||
{
|
||||
gsize size;
|
||||
const void *buffer;
|
||||
|
||||
buffer = g_buffered_input_stream_peek_buffer(_SELF(self), &size);
|
||||
|
||||
return CSTR2RVAL_TAINTED(buffer, size);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_peek(VALUE self, VALUE rboffset, VALUE rbcount)
|
||||
{
|
||||
gsize offset = RVAL2GSIZE(rboffset);
|
||||
gsize count = RVAL2GSIZE(rbcount);
|
||||
VALUE result = rb_str_new(NULL, count);
|
||||
gsize bytes_peeked = g_buffered_input_stream_peek(_SELF(self),
|
||||
RSTRING_PTR(result),
|
||||
offset,
|
||||
count);
|
||||
|
||||
rb_str_set_len(result, bytes_peeked);
|
||||
rb_str_resize(result, bytes_peeked);
|
||||
OBJ_TAINT(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_fill(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE count, cancellable;
|
||||
GError *error = NULL;
|
||||
gsize bytes_read;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &count, &cancellable);
|
||||
bytes_read = g_buffered_input_stream_fill(_SELF(self),
|
||||
NIL_P(count) ?
|
||||
-1 :
|
||||
RVAL2GSSIZE(count),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSSIZE2RVAL(bytes_read);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_fill_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbcount, rbio_priority, rbcancellable, block;
|
||||
gssize count;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &rbcount, &rbio_priority, &rbcancellable, &block);
|
||||
count = NIL_P(rbcount) ? -1 : RVAL2GSSIZE(rbcount);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_buffered_input_stream_fill_async(_SELF(self),
|
||||
count,
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_fill_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gsize bytes_read;
|
||||
|
||||
bytes_read = g_buffered_input_stream_fill_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSSIZE2RVAL(bytes_read);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_byte(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
int byte;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
byte = g_buffered_input_stream_read_byte(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return INT2FIX(byte);
|
||||
}
|
||||
|
||||
void
|
||||
Init_gbufferedinputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BUFFERED_INPUT_STREAM, "BufferedInputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(available, 0);
|
||||
RG_DEF_METHOD(peek_buffer, 0);
|
||||
RG_DEF_METHOD(peek, 2);
|
||||
RG_DEF_METHOD(fill, -1);
|
||||
RG_DEF_METHOD(fill_async, -1);
|
||||
RG_DEF_METHOD(fill_finish, 1);
|
||||
RG_DEF_METHOD(read_byte, -1);
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cBufferedOutputStream
|
||||
#define _SELF(value) RVAL2GBUFFEREDOUTPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbbase_stream, size;
|
||||
GOutputStream *base_stream, *stream;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbbase_stream, &size);
|
||||
base_stream = RVAL2GOUTPUTSTREAM(rbbase_stream);
|
||||
|
||||
stream = NIL_P(size) ?
|
||||
g_buffered_output_stream_new(base_stream) :
|
||||
g_buffered_output_stream_new_sized(base_stream, RVAL2GSIZE(size));
|
||||
G_INITIALIZE(self, stream);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gbufferedoutputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BUFFERED_OUTPUT_STREAM, "BufferedOutputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
}
|
180
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiocancellable.c
Normal file
180
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiocancellable.c
Normal file
@ -0,0 +1,180 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cCancellable
|
||||
#define _SELF(value) RVAL2GCANCELLABLE(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self)
|
||||
{
|
||||
G_INITIALIZE(self, g_cancellable_new());
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_cancelled_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_cancellable_is_cancelled(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_raise_error_if_cancelled(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (g_cancellable_set_error_if_cancelled(_SELF(self), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_fd(VALUE self)
|
||||
{
|
||||
return FD2RVAL(g_cancellable_get_fd(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_make_pollfd(VALUE self)
|
||||
{
|
||||
GCancellable *cancellable = _SELF(self);
|
||||
GPollFD *gfd = g_new(GPollFD, 1);
|
||||
|
||||
g_cancellable_make_pollfd(cancellable, gfd);
|
||||
|
||||
return GPOLLFD2RVAL(gfd);
|
||||
}
|
||||
|
||||
G_GNUC_NORETURN static VALUE
|
||||
rg_release_fd(VALUE self)
|
||||
{
|
||||
/* TODO: How do we implement this? Maybe not at all? */
|
||||
self = self;
|
||||
rb_raise(rb_eNotImpError, "release_fd has not been implemented yet");
|
||||
#if 0
|
||||
g_cancellable_release_fd(_SELF(self));
|
||||
|
||||
return self;
|
||||
#endif
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_current(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL(g_cancellable_get_current());
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_pop_current(VALUE self)
|
||||
{
|
||||
g_cancellable_pop_current(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_push_current(VALUE self)
|
||||
{
|
||||
g_cancellable_push_current(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_reset(VALUE self)
|
||||
{
|
||||
g_cancellable_reset(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
cancellable_connect_callback_call(VALUE block)
|
||||
{
|
||||
static ID s_id_call;
|
||||
|
||||
if (s_id_call == 0)
|
||||
s_id_call = rb_intern("call");
|
||||
|
||||
rb_funcall(block, s_id_call, 0);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static void
|
||||
cancellable_connect_callback(gpointer block)
|
||||
{
|
||||
G_PROTECT_CALLBACK(cancellable_connect_callback_call, block);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect(VALUE self)
|
||||
{
|
||||
VALUE block;
|
||||
|
||||
block = rb_block_proc();
|
||||
G_RELATIVE(self, block);
|
||||
|
||||
return GULONG2RVAL(g_cancellable_connect(_SELF(self),
|
||||
G_CALLBACK(cancellable_connect_callback),
|
||||
(gpointer)block,
|
||||
NULL));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_disconnect(VALUE self, VALUE handler_id)
|
||||
{
|
||||
g_cancellable_disconnect(_SELF(self), RVAL2GULONG(handler_id));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_cancel(VALUE self)
|
||||
{
|
||||
g_cancellable_cancel(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gcancellable(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CANCELLABLE, "Cancellable", mGio);
|
||||
|
||||
RG_DEF_SMETHOD(current, 0);
|
||||
|
||||
RG_DEF_METHOD(initialize, 0);
|
||||
RG_DEF_METHOD_P(cancelled, 0);
|
||||
RG_DEF_METHOD(raise_error_if_cancelled, 0);
|
||||
RG_DEF_METHOD(fd, 0);
|
||||
RG_DEF_METHOD(make_pollfd, 0);
|
||||
RG_DEF_METHOD(release_fd, 0);
|
||||
RG_DEF_METHOD(pop_current, 0);
|
||||
RG_DEF_METHOD(push_current, 0);
|
||||
RG_DEF_METHOD(reset, 0);
|
||||
RG_DEF_METHOD(connect, 0);
|
||||
RG_DEF_METHOD(disconnect, 1);
|
||||
RG_DEF_METHOD(cancel, 0);
|
||||
}
|
57
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiocharsetconverter.c
Normal file
57
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiocharsetconverter.c
Normal file
@ -0,0 +1,57 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cCharsetConverter
|
||||
#define _SELF(value) RVAL2GCHARSETCONVERTER(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE to, VALUE from)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GCharsetConverter *converter;
|
||||
|
||||
converter = g_charset_converter_new(RVAL2CSTR(to),
|
||||
RVAL2CSTR(from),
|
||||
&error);
|
||||
if (converter == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
G_INITIALIZE(self, converter);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_num_fallbacks(VALUE self)
|
||||
{
|
||||
return GUINT2RVAL(g_charset_converter_get_num_fallbacks(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gcharsetconverter(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CHARSET_CONVERTER, "CharsetConverter", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 2);
|
||||
RG_DEF_METHOD(num_fallbacks, 0);
|
||||
}
|
131
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiocontenttype.c
Normal file
131
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiocontenttype.c
Normal file
@ -0,0 +1,131 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mContentType
|
||||
|
||||
static VALUE
|
||||
rg_s_equals_p(G_GNUC_UNUSED VALUE self, VALUE arg1, VALUE arg2)
|
||||
{
|
||||
return CBOOL2RVAL(g_content_type_equals(RVAL2CSTR(arg1), RVAL2CSTR(arg2)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_is_a_p(G_GNUC_UNUSED VALUE self, VALUE arg1, VALUE arg2)
|
||||
{
|
||||
return CBOOL2RVAL(g_content_type_is_a(RVAL2CSTR(arg1), RVAL2CSTR(arg2)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_unknown_p(G_GNUC_UNUSED VALUE type)
|
||||
{
|
||||
return CBOOL2RVAL(g_content_type_is_unknown(RVAL2CSTR(type)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_get_description(G_GNUC_UNUSED VALUE type)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_content_type_get_description(RVAL2CSTR(type)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_get_mime_type(G_GNUC_UNUSED VALUE type)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_content_type_get_mime_type(RVAL2CSTR(type)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_get_icon(G_GNUC_UNUSED VALUE type)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_content_type_get_icon(RVAL2CSTR(type)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_can_be_executable_p(G_GNUC_UNUSED VALUE type)
|
||||
{
|
||||
return CBOOL2RVAL(g_content_type_can_be_executable(RVAL2CSTR(type)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_from_mime_type(G_GNUC_UNUSED VALUE type)
|
||||
{
|
||||
return CSTR2RVAL(g_content_type_from_mime_type(RVAL2CSTR(type)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_guess(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
VALUE rbfilename,
|
||||
rbdata;
|
||||
const char *filename;
|
||||
const guchar *data;
|
||||
gboolean result_uncertain;
|
||||
char *type;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &rbfilename, &rbdata);
|
||||
|
||||
if (NIL_P(rbfilename) && NIL_P(rbdata))
|
||||
rb_raise(rb_eArgError,
|
||||
"Either filename or data can be nil but not both");
|
||||
|
||||
filename = RVAL2CSTR_ACCEPT_NIL(rbfilename);
|
||||
data = (guchar *)RVAL2CSTR_ACCEPT_NIL(rbdata);
|
||||
|
||||
type = g_content_type_guess(filename,
|
||||
data,
|
||||
(gsize)((data != NULL) ? RSTRING_LEN(rbdata) : 0),
|
||||
&result_uncertain);
|
||||
|
||||
return rb_assoc_new(CSTR2RVAL_FREE(type), CBOOL2RVAL(result_uncertain));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_guess_for_tree(G_GNUC_UNUSED VALUE self, VALUE root)
|
||||
{
|
||||
return STRV2RVAL_FREE(g_content_type_guess_for_tree(RVAL2GFILE(root)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_registered(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
return GLIST2ARY_STR_FREE(g_content_types_get_registered());
|
||||
}
|
||||
|
||||
void
|
||||
Init_gcontenttype(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "ContentType");
|
||||
|
||||
/* TODO: Should wrap this in a class. */
|
||||
RG_DEF_SMETHOD_P(equals, 2);
|
||||
/* TODO: This name isn't great. */
|
||||
RG_DEF_SMETHOD_P(is_a, 2);
|
||||
RG_DEF_SMETHOD_P(unknown, 1);
|
||||
RG_DEF_SMETHOD(get_description, 1);
|
||||
RG_DEF_SMETHOD(get_mime_type, 1);
|
||||
RG_DEF_SMETHOD(get_icon, 1);
|
||||
RG_DEF_SMETHOD_P(can_be_executable, 1);
|
||||
RG_DEF_SMETHOD(from_mime_type, 1);
|
||||
RG_DEF_SMETHOD(guess, -1);
|
||||
RG_DEF_SMETHOD(guess_for_tree, 1);
|
||||
RG_DEF_SMETHOD(registered, 0);
|
||||
}
|
113
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioconverter.c
Normal file
113
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioconverter.c
Normal file
@ -0,0 +1,113 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mConverter
|
||||
#define _SELF(value) RVAL2GCONVERTER(value)
|
||||
|
||||
#define RVAL2GCONVERTERFLAGSDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), \
|
||||
RVAL2GCONVERTERFLAGS, \
|
||||
G_CONVERTER_NO_FLAGS)
|
||||
|
||||
/* TODO: Look at gconverteroutputstream for implementing this. */
|
||||
/* TODO: Actually, is there any point in implementing this? */
|
||||
static VALUE
|
||||
rg_convert(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE input, rbflags;
|
||||
GConverter *converter;
|
||||
gsize input_remaining, output_size, output_remaining, bytes_read, bytes_written;
|
||||
GConverterFlags flags;
|
||||
/* TODO: Use a Ruby string instead. */
|
||||
char *output_base, *output;
|
||||
GError *error = NULL;
|
||||
GConverterResult result;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &input, &rbflags);
|
||||
converter = _SELF(self);
|
||||
StringValue(input);
|
||||
input_remaining = RSTRING_LEN(input);
|
||||
flags = RVAL2GCONVERTERFLAGSDEFAULT(rbflags);
|
||||
output_remaining = output_size = BUFSIZ;
|
||||
output_base = output = ALLOCA_N(char, output_size);
|
||||
do {
|
||||
result = g_converter_convert(converter,
|
||||
RSTRING_PTR(input),
|
||||
input_remaining,
|
||||
output,
|
||||
output_remaining,
|
||||
flags,
|
||||
&bytes_read,
|
||||
&bytes_written,
|
||||
&error);
|
||||
switch (result) {
|
||||
case G_CONVERTER_ERROR:
|
||||
switch (error->code) {
|
||||
case G_IO_ERROR_NO_SPACE:
|
||||
/* TODO: Expand the buffer? */
|
||||
break;
|
||||
case G_IO_ERROR_PARTIAL_INPUT:
|
||||
/* TODO: How do we request/tell the user that
|
||||
* they need to provide more data? */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
rbgio_raise_error(error);
|
||||
break;
|
||||
case G_CONVERTER_CONVERTED:
|
||||
case G_CONVERTER_FLUSHED:
|
||||
input_remaining -= bytes_read;
|
||||
input += bytes_read;
|
||||
output_remaining -= bytes_written;
|
||||
output += bytes_written;
|
||||
/* TODO: Do we need to do anything else? */
|
||||
break;
|
||||
case G_CONVERTER_FINISHED:
|
||||
/* TODO: Do we simply break, or do we need to consider
|
||||
* something else? */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (input_remaining > 0);
|
||||
|
||||
return CSTR2RVAL(output_base);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_reset(VALUE self)
|
||||
{
|
||||
g_converter_reset(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gconverter(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_CONVERTER, "Converter", mGio);
|
||||
|
||||
RG_DEF_METHOD(convert, -1);
|
||||
RG_DEF_METHOD(reset, 0);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cConverterInputStream
|
||||
#define _SELF(value) RVAL2GCONVERTERINPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE base_stream, VALUE converter)
|
||||
{
|
||||
G_INITIALIZE(self,
|
||||
g_converter_input_stream_new(RVAL2GINPUTSTREAM(base_stream),
|
||||
RVAL2GCONVERTER(converter)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gconverterinputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CONVERTER_INPUT_STREAM, "ConverterInputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 2);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cConverterOutputStream
|
||||
#define _SELF(value) RVAL2GCONVERTEROUTPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE base_stream, VALUE converter)
|
||||
{
|
||||
G_INITIALIZE(self,
|
||||
g_converter_output_stream_new(RVAL2GOUTPUTSTREAM(base_stream),
|
||||
RVAL2GCONVERTER(converter)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gconverteroutputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CONVERTER_OUTPUT_STREAM, "ConverterOutputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 2);
|
||||
}
|
309
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodatainputstream.c
Normal file
309
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodatainputstream.c
Normal file
@ -0,0 +1,309 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cDataInputStream
|
||||
#define _SELF(value) RVAL2GDATAINPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE base_stream, byte_order, newline_type;
|
||||
|
||||
rb_scan_args(argc, argv, "12", &base_stream, &byte_order, &newline_type);
|
||||
|
||||
G_INITIALIZE(self, g_data_input_stream_new(RVAL2GINPUTSTREAM(base_stream)));
|
||||
|
||||
if (!NIL_P(byte_order))
|
||||
g_data_input_stream_set_byte_order(_SELF(self),
|
||||
RVAL2GDATASTREAMBYTEORDER(byte_order));
|
||||
|
||||
if (!NIL_P(newline_type))
|
||||
g_data_input_stream_set_newline_type(_SELF(self),
|
||||
RVAL2GDATASTREAMNEWLINETYPE(newline_type));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_byte(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
guchar value;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
value = g_data_input_stream_read_byte(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GUCHAR2RVAL(value);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_int16(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
gint16 value;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
value = g_data_input_stream_read_int16(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GINT162RVAL(value);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_uint16(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
guint16 value;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
value = g_data_input_stream_read_uint16(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GUINT162RVAL(value);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_int32(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
gint32 value;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
value = g_data_input_stream_read_int32(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GINT322RVAL(value);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_uint32(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
guint32 value;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
value = g_data_input_stream_read_uint32(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GUINT322RVAL(value);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_int64(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
gint64 value;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
value = g_data_input_stream_read_int64(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GINT642RVAL(value);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_uint64(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
guint64 value;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
value = g_data_input_stream_read_uint64(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GUINT642RVAL(value);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_line(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
gsize length;
|
||||
GError *error;
|
||||
char *line;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
line = g_data_input_stream_read_line(_SELF(self),
|
||||
&length,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return CSTR2RVAL_TAINTED_FREE(line, length);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_line_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbio_priority, rbcancellable, block;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_data_input_stream_read_line_async(_SELF(self),
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_line_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gsize length;
|
||||
char *line;
|
||||
|
||||
line = g_data_input_stream_read_line_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&length,
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return CSTR2RVAL_TAINTED_FREE(line, length);
|
||||
}
|
||||
|
||||
#if GLIB_CHECK_VERSION(2, 26, 0)
|
||||
static VALUE
|
||||
rg_read_upto(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbstop_chars, cancellable;
|
||||
const char *stop_chars;
|
||||
gsize length;
|
||||
GError *error;
|
||||
char *string;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbstop_chars, &cancellable);
|
||||
stop_chars = RVAL2CSTR(rbstop_chars);
|
||||
string = g_data_input_stream_read_upto(_SELF(self),
|
||||
stop_chars,
|
||||
RSTRING_LEN(rbstop_chars),
|
||||
&length,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return CSTR2RVAL_TAINTED_FREE(string, length);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_upto_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbstop_chars, rbcancellable, rbio_priority, block;
|
||||
const char *stop_chars;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "12&", &rbstop_chars, &rbio_priority, &rbcancellable, &block);
|
||||
stop_chars = RVAL2CSTR(rbstop_chars);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_data_input_stream_read_upto_async(_SELF(self),
|
||||
stop_chars,
|
||||
RSTRING_LEN(rbstop_chars),
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_upto_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gsize length;
|
||||
char *string;
|
||||
|
||||
string = g_data_input_stream_read_upto_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&length,
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return CSTR2RVAL_TAINTED_FREE(string, length);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gdatainputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DATA_INPUT_STREAM, "DataInputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(read_byte, -1);
|
||||
RG_DEF_METHOD(read_int16, -1);
|
||||
RG_DEF_METHOD(read_uint16, -1);
|
||||
RG_DEF_METHOD(read_int32, -1);
|
||||
RG_DEF_METHOD(read_uint32, -1);
|
||||
RG_DEF_METHOD(read_int64, -1);
|
||||
RG_DEF_METHOD(read_uint64, -1);
|
||||
RG_DEF_METHOD(read_line, -1);
|
||||
RG_DEF_METHOD(read_line_async, -1);
|
||||
RG_DEF_METHOD(read_line_finish, 1);
|
||||
#if GLIB_CHECK_VERSION(2, 26, 0)
|
||||
RG_DEF_METHOD(read_upto, -1);
|
||||
RG_DEF_METHOD(read_upto_async, -1);
|
||||
RG_DEF_METHOD(read_upto_finish, 1);
|
||||
#endif
|
||||
}
|
186
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodataoutputstream.c
Normal file
186
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodataoutputstream.c
Normal file
@ -0,0 +1,186 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cDataOutputStream
|
||||
#define _SELF(value) RVAL2GDATAOUTPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE base_stream,
|
||||
byte_order;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &base_stream, &byte_order);
|
||||
|
||||
G_INITIALIZE(self, g_data_output_stream_new(RVAL2GOUTPUTSTREAM(base_stream)));
|
||||
|
||||
if (!NIL_P(byte_order))
|
||||
g_data_output_stream_set_byte_order(_SELF(self),
|
||||
RVAL2GDATASTREAMBYTEORDER(byte_order));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_put_byte(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE value, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &value, &cancellable);
|
||||
if (!g_data_output_stream_put_byte(_SELF(self),
|
||||
RVAL2GUCHAR(value),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_put_int16(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE value, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &value, &cancellable);
|
||||
if (!g_data_output_stream_put_int16(_SELF(self),
|
||||
RVAL2GINT16(value),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_put_uint16(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE value, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &value, &cancellable);
|
||||
if (!g_data_output_stream_put_uint16(_SELF(self),
|
||||
RVAL2GUINT16(value),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_put_int32(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE value, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &value, &cancellable);
|
||||
if (!g_data_output_stream_put_int32(_SELF(self),
|
||||
RVAL2GINT32(value),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_put_uint32(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE value, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &value, &cancellable);
|
||||
if (!g_data_output_stream_put_uint32(_SELF(self),
|
||||
RVAL2GINT32(value),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_put_int64(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE value, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &value, &cancellable);
|
||||
if (!g_data_output_stream_put_int64(_SELF(self),
|
||||
RVAL2GINT64(value),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_put_uint64(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE value, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &value, &cancellable);
|
||||
if (!g_data_output_stream_put_uint64(_SELF(self),
|
||||
RVAL2GUINT64(value),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_put_string(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE value, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &value, &cancellable);
|
||||
if (!g_data_output_stream_put_string(_SELF(self),
|
||||
RVAL2CSTR(value),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gdataoutputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DATA_OUTPUT_STREAM, "DataOutputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(put_byte, -1);
|
||||
RG_DEF_METHOD(put_int16, -1);
|
||||
RG_DEF_METHOD(put_uint16, -1);
|
||||
RG_DEF_METHOD(put_int32, -1);
|
||||
RG_DEF_METHOD(put_uint32, -1);
|
||||
RG_DEF_METHOD(put_int64, -1);
|
||||
RG_DEF_METHOD(put_uint64, -1);
|
||||
RG_DEF_METHOD(put_string, -1);
|
||||
}
|
87
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodesktopappinfo.c
Normal file
87
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodesktopappinfo.c
Normal file
@ -0,0 +1,87 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gdesktopappinfo.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE cDesktopAppInfo
|
||||
#define _SELF(value) RVAL2GDESKTOPAPPINFO(value)
|
||||
|
||||
static VALUE
|
||||
rg_s_new_from_filename(G_GNUC_UNUSED VALUE self, VALUE filename)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_desktop_app_info_new_from_filename(RVAL2CSTR(filename)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_new_from_keyfile(G_GNUC_UNUSED VALUE self, VALUE keyfile)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_desktop_app_info_new_from_keyfile(RVAL2GKEYFILE(keyfile)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE desktop_id)
|
||||
{
|
||||
G_INITIALIZE(self, g_desktop_app_info_new(RVAL2CSTR(desktop_id)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_filename(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_desktop_app_info_get_filename(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_hidden_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_desktop_app_info_get_is_hidden(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_set_desktop_env(G_GNUC_UNUSED VALUE self, VALUE desktop_env)
|
||||
{
|
||||
g_desktop_app_info_set_desktop_env(RVAL2CSTR(desktop_env));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/* TODO: g_desktop_app_info_lookup_get_default_for_uri_scheme ()? */
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gdesktopappinfo(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DESKTOP_APP_INFO, "DesktopAppInfo", mGio);
|
||||
|
||||
RG_DEF_SMETHOD(new_from_filename, 1);
|
||||
RG_DEF_SMETHOD(new_from_keyfile, 1);
|
||||
RG_DEF_SMETHOD(set_desktop_env, 1);
|
||||
|
||||
RG_DEF_METHOD(initialize, 1);
|
||||
RG_DEF_METHOD(filename, 0);
|
||||
RG_DEF_METHOD_P(hidden, 0);
|
||||
#endif
|
||||
}
|
266
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodrive.c
Normal file
266
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiodrive.c
Normal file
@ -0,0 +1,266 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mDrive
|
||||
#define _SELF(value) RVAL2GDRIVE(value)
|
||||
|
||||
static VALUE
|
||||
rg_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_drive_get_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_icon(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_drive_get_icon(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_has_volumes_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_drive_has_volumes(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_volumes(VALUE self)
|
||||
{
|
||||
return GLIST2ARY_FREE(g_drive_get_volumes(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_eject_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_drive_can_eject(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_start_stop_type(VALUE self)
|
||||
{
|
||||
return GDRIVESTARTSTOPTYPE2RVAL(g_drive_get_start_stop_type(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_start_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_drive_can_start(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_start_degraded_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_drive_can_start_degraded(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_stop_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_drive_can_stop(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_poll_for_media_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_drive_can_poll_for_media(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_poll_for_media(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbcancellable, block;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "01&", &rbcancellable, &block);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
g_drive_poll_for_media(_SELF(self),
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
typedef gboolean (*BooleanFinishMethod)(GDrive *, GAsyncResult *, GError **);
|
||||
|
||||
static VALUE
|
||||
boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_poll_for_media_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_drive_poll_for_media_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_has_media_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_drive_has_media(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_media_check_automatic_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_drive_is_media_check_automatic(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_media_removable_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_drive_is_media_removable(_SELF(self)));
|
||||
}
|
||||
|
||||
typedef void (*EjectStopMethod)(GDrive *,
|
||||
GMountUnmountFlags,
|
||||
GMountOperation *,
|
||||
GCancellable *,
|
||||
GAsyncReadyCallback,
|
||||
gpointer);
|
||||
|
||||
static VALUE
|
||||
eject_stop_method(EjectStopMethod method, int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbflags, rbmount_operation, rbcancellable, block;
|
||||
GMountUnmountFlags flags;
|
||||
GMountOperation *mount_operation;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block);
|
||||
flags = RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(rbflags);
|
||||
mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
method(_SELF(self),
|
||||
flags,
|
||||
mount_operation,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_eject_with_operation(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return eject_stop_method(g_drive_eject_with_operation, argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_eject_with_operation_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_drive_eject_with_operation_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_start(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbflags, rbmount_operation, rbcancellable, block;
|
||||
GDriveStartFlags flags;
|
||||
GMountOperation *mount_operation;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03", &rbflags, &rbmount_operation, &rbcancellable, &block);
|
||||
flags = RVAL2GDRIVESTARTFLAGSDEFAULT(rbflags);
|
||||
mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_drive_start(_SELF(self), flags, mount_operation, cancellable,
|
||||
rbgio_async_ready_callback, (gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_start_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_drive_start_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_stop(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return eject_stop_method(g_drive_stop, argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_stop_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_drive_stop_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_enumerate_identifiers(VALUE self)
|
||||
{
|
||||
return STRV2RVAL_FREE(g_drive_enumerate_identifiers(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_identifier(VALUE self, VALUE kind)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_drive_get_identifier(_SELF(self), RVAL2CSTR(kind)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gdrive(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_DRIVE, "Drive", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_DRIVE_START_FLAGS, "StartFlags", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_DRIVE_START_FLAGS, "G_DRIVE_");
|
||||
|
||||
G_DEF_CLASS(G_TYPE_DRIVE_START_STOP_TYPE, "StartStopType", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_DRIVE_START_STOP_TYPE, "G_DRIVE_");
|
||||
|
||||
RG_DEF_METHOD(name, 0);
|
||||
RG_DEF_METHOD(icon, 0);
|
||||
RG_DEF_METHOD_P(has_volumes, 0);
|
||||
RG_DEF_METHOD(volumes, 0);
|
||||
RG_DEF_METHOD_P(can_eject, 0);
|
||||
RG_DEF_METHOD(start_stop_type, 0);
|
||||
RG_DEF_METHOD_P(can_start, 0);
|
||||
RG_DEF_METHOD_P(can_start_degraded, 0);
|
||||
RG_DEF_METHOD_P(can_stop, 0);
|
||||
RG_DEF_METHOD_P(can_poll_for_media, 0);
|
||||
RG_DEF_METHOD(poll_for_media, -1);
|
||||
RG_DEF_METHOD(poll_for_media_finish, 1);
|
||||
RG_DEF_METHOD_P(has_media, 0);
|
||||
RG_DEF_METHOD_P(media_check_automatic, 0);
|
||||
RG_DEF_METHOD_P(media_removable, 0);
|
||||
RG_DEF_METHOD(eject_with_operation, -1);
|
||||
RG_DEF_METHOD(eject_with_operation_finish, 1);
|
||||
RG_DEF_METHOD(start, -1);
|
||||
RG_DEF_METHOD(start_finish, 1);
|
||||
RG_DEF_METHOD(stop, -1);
|
||||
RG_DEF_METHOD(stop_finish, 1);
|
||||
RG_DEF_METHOD(enumerate_identifiers, -1);
|
||||
RG_DEF_ALIAS("identifiers", "enumerate_identifiers");
|
||||
RG_DEF_METHOD(get_identifier, 1);
|
||||
}
|
52
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioemblem.c
Normal file
52
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioemblem.c
Normal file
@ -0,0 +1,52 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cEmblem
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbicon, origin;
|
||||
GIcon *icon;
|
||||
GEmblem *emblem;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbicon, &origin);
|
||||
icon = RVAL2GICON(rbicon);
|
||||
emblem = NIL_P(origin) ?
|
||||
g_emblem_new(icon) :
|
||||
g_emblem_new_with_origin(icon, RVAL2GEMBLEMORIGIN(origin));
|
||||
G_INITIALIZE(self, emblem);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gemblem(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_EMBLEM, "Emblem", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_EMBLEM_ORIGIN, "Origin", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_EMBLEM_ORIGIN, "G_EMBLEM_");
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
}
|
65
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioemblemedicon.c
Normal file
65
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioemblemedicon.c
Normal file
@ -0,0 +1,65 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cEmblemedIcon
|
||||
#define _SELF(value) RVAL2GEMBLEMEDICON(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE icon, VALUE emblem)
|
||||
{
|
||||
G_INITIALIZE(self, g_emblemed_icon_new(RVAL2GICON(icon), RVAL2GEMBLEM(emblem)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_icon(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL(g_emblemed_icon_get_icon(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_emblems(VALUE self)
|
||||
{
|
||||
return GLIST2ARY_FREE(g_emblemed_icon_get_emblems(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_add_emblem(VALUE self, VALUE emblem)
|
||||
{
|
||||
g_emblemed_icon_add_emblem(_SELF(self), RVAL2GEMBLEM(emblem));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gemblemedicon(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_EMBLEMED_ICON, "EmblemedIcon", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 2);
|
||||
RG_DEF_METHOD(icon, 0);
|
||||
RG_DEF_METHOD(emblems, 0);
|
||||
RG_DEF_METHOD(add_emblem, 1);
|
||||
RG_DEF_ALIAS("<<", "add_emblem");
|
||||
}
|
2045
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofile.c
Normal file
2045
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofile.c
Normal file
File diff suppressed because it is too large
Load Diff
114
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattribute.c
Normal file
114
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattribute.c
Normal file
@ -0,0 +1,114 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mFileAttribute
|
||||
|
||||
void
|
||||
Init_gfileattribute(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "FileAttribute");
|
||||
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_TYPE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_HIDDEN", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_BACKUP", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_SYMLINK", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_VIRTUAL", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_NAME));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_DISPLAY_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_EDIT_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_COPY_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_COPY_NAME));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_DESCRIPTION", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_ICON", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_ICON));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_CONTENT_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_FAST_CONTENT_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SIZE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_ALLOCATED_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_SYMLINK_TARGET", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_TARGET_URI", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_TARGET_URI));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_SORT_ORDER", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "ETAG_VALUE", CSTR2RVAL(G_FILE_ATTRIBUTE_ETAG_VALUE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "ID_FILE", CSTR2RVAL(G_FILE_ATTRIBUTE_ID_FILE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "ID_FILESYSTEM", CSTR2RVAL(G_FILE_ATTRIBUTE_ID_FILESYSTEM));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_READ", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_READ));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_WRITE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_EXECUTE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_DELETE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_TRASH", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_RENAME", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_MOUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_UNMOUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_EJECT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_UNIX_DEVICE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_UNIX_DEVICE_FILE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_HAL_UDI", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_POLL", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_START", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_START_DEGRADED", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_STOP", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_START_STOP_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TIME_MODIFIED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_MODIFIED));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TIME_MODIFIED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TIME_ACCESS", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_ACCESS));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TIME_ACCESS_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_ACCESS_USEC));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TIME_CHANGED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CHANGED));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TIME_CHANGED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CHANGED_USEC));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TIME_CREATED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CREATED));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TIME_CREATED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CREATED_USEC));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_DEVICE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_DEVICE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_INODE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_INODE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_MODE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_MODE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_NLINK", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_NLINK));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_UID", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_UID));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_GID", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_GID));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_RDEV", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_RDEV));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_BLOCK_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_BLOCKS", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_BLOCKS));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "UNIX_IS_MOUNTPOINT", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "DOS_IS_ARCHIVE", CSTR2RVAL(G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "DOS_IS_SYSTEM", CSTR2RVAL(G_FILE_ATTRIBUTE_DOS_IS_SYSTEM));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "OWNER_USER", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_USER));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "OWNER_USER_REAL", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_USER_REAL));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "OWNER_GROUP", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_GROUP));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "THUMBNAIL_PATH", CSTR2RVAL(G_FILE_ATTRIBUTE_THUMBNAIL_PATH));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "THUMBNAILING_FAILED", CSTR2RVAL(G_FILE_ATTRIBUTE_THUMBNAILING_FAILED));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "PREVIEW_ICON", CSTR2RVAL(G_FILE_ATTRIBUTE_PREVIEW_ICON));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_SIZE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_FREE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_FREE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_TYPE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_READONLY", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_READONLY));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_USE_PREVIEW", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "GVFS_BACKEND", CSTR2RVAL(G_FILE_ATTRIBUTE_GVFS_BACKEND));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "SELINUX_CONTEXT", CSTR2RVAL(G_FILE_ATTRIBUTE_SELINUX_CONTEXT));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TRASH_ITEM_COUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TRASH_DELETION_DATE", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_DELETION_DATE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "TRASH_ORIG_PATH", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_ORIG_PATH));
|
||||
|
||||
G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_TYPE, "Type", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_ATTRIBUTE_TYPE, "G_FILE_ATTRIBUTE_");
|
||||
|
||||
G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_STATUS, "Status", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_ATTRIBUTE_STATUS, "G_FILE_ATTRIBUTE_");
|
||||
}
|
86
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattributeinfo.c
Normal file
86
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattributeinfo.c
Normal file
@ -0,0 +1,86 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileAttributeInfo
|
||||
|
||||
static GFileAttributeInfo *
|
||||
fileattributeinfo_copy(const GFileAttributeInfo *info)
|
||||
{
|
||||
return (GFileAttributeInfo *)info;
|
||||
}
|
||||
|
||||
static void
|
||||
fileattributeinfo_free(G_GNUC_UNUSED GFileAttributeInfo *info)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GType
|
||||
g_file_attribute_info_get_type(void)
|
||||
{
|
||||
static GType our_type = 0;
|
||||
|
||||
if (our_type == 0)
|
||||
our_type = g_boxed_type_register_static("GFileAttributeInfo",
|
||||
(GBoxedCopyFunc)fileattributeinfo_copy,
|
||||
(GBoxedFreeFunc)fileattributeinfo_free);
|
||||
|
||||
return our_type;
|
||||
}
|
||||
|
||||
#define _SELF(value) RVAL2GFILEATTRIBUTEINFO(value)
|
||||
|
||||
static VALUE
|
||||
rg_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(_SELF(self)->name);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_type(VALUE self)
|
||||
{
|
||||
return GFILEATTRIBUTETYPE2RVAL(_SELF(self)->type);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_flags(VALUE self)
|
||||
{
|
||||
return GFILEATTRIBUTEINFOFLAGS2RVAL(_SELF(self)->flags);
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfileattributeinfo(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO, "FileAttributeInfo", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS, "Flags", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS, "G_FILE_ATTRIBUTE_INFO_");
|
||||
|
||||
rbgobj_boxed_not_copy_obj(G_TYPE_FILE_ATTRIBUTE_INFO);
|
||||
|
||||
RG_DEF_METHOD(name, 0);
|
||||
RG_DEF_METHOD(type, 0);
|
||||
RG_DEF_METHOD(flags, 0);
|
||||
}
|
108
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattributeinfolist.c
Normal file
108
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileattributeinfolist.c
Normal file
@ -0,0 +1,108 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileAttributeInfoList
|
||||
|
||||
#define RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), \
|
||||
RVAL2GFILEATTRIBUTEINFOFLAGS, \
|
||||
G_FILE_ATTRIBUTE_INFO_NONE)
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 34, 0)
|
||||
GType
|
||||
g_file_attribute_info_list_get_type(void)
|
||||
{
|
||||
static GType our_type = 0;
|
||||
if (our_type == 0)
|
||||
our_type = g_boxed_type_register_static("GFileAttributeInfoList",
|
||||
(GBoxedCopyFunc)g_file_attribute_info_list_ref,
|
||||
(GBoxedFreeFunc)g_file_attribute_info_list_unref);
|
||||
return our_type;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define _SELF(value) RVAL2GFILEATTRIBUTEINFOLIST(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self)
|
||||
{
|
||||
G_INITIALIZE(self, g_file_attribute_info_list_new());
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_dup(VALUE self)
|
||||
{
|
||||
return GFILEATTRIBUTEINFOLIST2RVAL(g_file_attribute_info_list_dup(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup(VALUE self, VALUE name)
|
||||
{
|
||||
/* TODO: How do we deal with the const? */
|
||||
return GFILEATTRIBUTEINFO2RVAL((GFileAttributeInfo *)g_file_attribute_info_list_lookup(_SELF(self),
|
||||
RVAL2CSTR(name)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_add(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE name, type, flags;
|
||||
|
||||
rb_scan_args(argc, argv, "21", &name, &type, &flags);
|
||||
|
||||
g_file_attribute_info_list_add(_SELF(self),
|
||||
RVAL2CSTR(name),
|
||||
RVAL2GFILEATTRIBUTETYPE(type),
|
||||
RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(flags));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_each(VALUE self)
|
||||
{
|
||||
GFileAttributeInfoList *list = RVAL2GFILEATTRIBUTEINFOLIST(self);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < list->n_infos; i++)
|
||||
rb_yield(GFILEATTRIBUTEINFO2RVAL(&list->infos[i]));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_fileattributeinfolist(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO_LIST, "FileAttributeInfoList", mGio);
|
||||
|
||||
rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable);
|
||||
|
||||
RG_DEF_METHOD(initialize, 0);
|
||||
RG_DEF_METHOD(dup, 0);
|
||||
RG_DEF_METHOD(lookup, 1);
|
||||
RG_DEF_ALIAS("[]", "lookup");
|
||||
RG_DEF_METHOD(add, 3);
|
||||
RG_DEF_METHOD(each, 0);
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileAttributeMatcher
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2, 34, 0)
|
||||
GType
|
||||
g_file_attribute_matcher_get_type(void)
|
||||
{
|
||||
static GType our_type = 0;
|
||||
if (our_type == 0)
|
||||
our_type = g_boxed_type_register_static("GFileAttributeMatcher",
|
||||
(GBoxedCopyFunc)g_file_attribute_matcher_ref,
|
||||
(GBoxedFreeFunc)g_file_attribute_matcher_unref);
|
||||
return our_type;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define _SELF(value) RVAL2GFILEATTRIBUTEMATCHER(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE attributes)
|
||||
{
|
||||
G_INITIALIZE(self, g_file_attribute_matcher_new(RVAL2CSTR(attributes)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_matches_p(VALUE self, VALUE attribute)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_attribute_matcher_matches(_SELF(self), RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_matches_only_p(VALUE self, VALUE attribute)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_attribute_matcher_matches_only(_SELF(self), RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_enumerate_namespace(VALUE self, VALUE ns)
|
||||
{
|
||||
const char *match;
|
||||
gboolean matches_all = g_file_attribute_matcher_enumerate_namespace(_SELF(self),
|
||||
RVAL2CSTR(ns));
|
||||
if (!rb_block_given_p())
|
||||
return CBOOL2RVAL(matches_all);
|
||||
|
||||
while ((match = g_file_attribute_matcher_enumerate_next(_SELF(self))) != NULL)
|
||||
rb_yield(CSTR2RVAL(match));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_enumerate_next(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_file_attribute_matcher_enumerate_next(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfileattributematcher(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_MATCHER, "FileAttributeMatcher", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 1);
|
||||
RG_DEF_METHOD_P(matches, 1);
|
||||
/* TODO: Is this confusing when we have both #matches and
|
||||
* #matches_only? What does #=~ call? */
|
||||
RG_DEF_ALIAS("=~", "matches?");
|
||||
RG_DEF_METHOD_P(matches_only, 1);
|
||||
RG_DEF_METHOD(enumerate_namespace, 1);
|
||||
RG_DEF_METHOD(enumerate_next, 0);
|
||||
}
|
45
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofiledescriptorbased.c
Normal file
45
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofiledescriptorbased.c
Normal file
@ -0,0 +1,45 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gfiledescriptorbased.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE mFileDescriptorBased
|
||||
#define _SELF(value) RVAL2GFILEDESCRIPTORBASED(value)
|
||||
|
||||
static VALUE
|
||||
rg_fd(VALUE self)
|
||||
{
|
||||
return FD2RVAL(g_file_descriptor_based_get_fd(_SELF(self)));
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gfiledescriptorbased(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_FILE_DESCRIPTOR_BASED, "FileDescriptorBased", mGio);
|
||||
|
||||
RG_DEF_METHOD(fd, 0);
|
||||
#endif
|
||||
}
|
166
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileenumerator.c
Normal file
166
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileenumerator.c
Normal file
@ -0,0 +1,166 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileEnumerator
|
||||
#define _SELF(value) RVAL2GFILEENUMERATOR(value)
|
||||
|
||||
static VALUE
|
||||
rg_next_file(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
GFileInfo *info;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
info = g_file_enumerator_next_file(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
if (!g_file_enumerator_close(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_next_files_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbnum_files, rbio_priority, rbcancellable, block;
|
||||
int num_files;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "12&", &rbnum_files, &rbio_priority, &rbcancellable, &block);
|
||||
num_files = NUM2INT(rbnum_files);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_file_enumerator_next_files_async(_SELF(self),
|
||||
num_files,
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_next_files_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GList *files = g_file_enumerator_next_files_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GLIST2ARY_FREE(files);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbio_priority, rbcancellable, block;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_file_enumerator_close_async(_SELF(self),
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
if (!g_file_enumerator_close_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_closed_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_enumerator_is_closed(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_has_pending_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_enumerator_has_pending(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_pending(VALUE self, VALUE pending)
|
||||
{
|
||||
g_file_enumerator_set_pending(_SELF(self), RVAL2CBOOL(pending));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_container(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL(g_file_enumerator_get_container(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfileenumerator(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ENUMERATOR, "FileEnumerator", mGio);
|
||||
|
||||
RG_DEF_METHOD(next_file, -1);
|
||||
RG_DEF_METHOD(close, -1);
|
||||
RG_DEF_METHOD(next_files_async, -1);
|
||||
RG_DEF_METHOD(next_files_finish, 1);
|
||||
RG_DEF_METHOD(close_async, -1);
|
||||
RG_DEF_METHOD(close_finish, 1);
|
||||
RG_DEF_METHOD_P(closed, 0);
|
||||
RG_DEF_METHOD_P(has_pending, 0);
|
||||
RG_DEF_METHOD(set_pending, 1);
|
||||
RG_DEF_METHOD(container, 0);
|
||||
}
|
41
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileicon.c
Normal file
41
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileicon.c
Normal file
@ -0,0 +1,41 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileIcon
|
||||
#define _SELF(value) RVAL2GFILEICON(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE file)
|
||||
{
|
||||
G_INITIALIZE(self, g_file_icon_new(RVAL2GFILE(file)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfileicon(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ICON, "FileIcon", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 1);
|
||||
}
|
617
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileinfo.c
Normal file
617
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileinfo.c
Normal file
@ -0,0 +1,617 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileInfo
|
||||
#define _SELF(value) RVAL2GFILEINFO(value)
|
||||
|
||||
#define RVAL2FILEINFONAMESPACEDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), RVAL2CSTR, "*")
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self)
|
||||
{
|
||||
G_INITIALIZE(self, g_file_info_new());
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_dup(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_file_info_dup(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_copy_into(VALUE self, VALUE other)
|
||||
{
|
||||
g_file_info_copy_into(_SELF(self), _SELF(other));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_has_attribute_p(VALUE self, VALUE attribute)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_info_has_attribute(_SELF(self), RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_has_namespace_p(VALUE self, VALUE namespace)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_info_has_namespace(_SELF(self), RVAL2CSTR(namespace)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_status(VALUE self, VALUE attribute, VALUE status)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_info_set_attribute_status(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
RVAL2GFILEATTRIBUTESTATUS(status)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_list_attributes(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE name_space;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &name_space);
|
||||
|
||||
return STRV2RVAL_FREE(g_file_info_list_attributes(_SELF(self),
|
||||
RVAL2FILEINFONAMESPACEDEFAULT(name_space)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_type(VALUE self, VALUE attribute)
|
||||
{
|
||||
return GFILEATTRIBUTETYPE2RVAL(g_file_info_get_attribute_type(_SELF(self), RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_remove_attribute(VALUE self, VALUE attribute)
|
||||
{
|
||||
g_file_info_remove_attribute(_SELF(self), RVAL2CSTR(attribute));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_as_string(VALUE self, VALUE attribute)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_file_info_get_attribute_as_string(_SELF(self), RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
file_attribute_to_value(GFileAttributeType type, gpointer value)
|
||||
{
|
||||
switch (type) {
|
||||
case G_FILE_ATTRIBUTE_TYPE_STRING:
|
||||
case G_FILE_ATTRIBUTE_TYPE_BYTE_STRING:
|
||||
return CSTR2RVAL(value);
|
||||
case G_FILE_ATTRIBUTE_TYPE_BOOLEAN:
|
||||
return CBOOL2RVAL(*(gboolean *)value);
|
||||
case G_FILE_ATTRIBUTE_TYPE_UINT32:
|
||||
return GUINT322RVAL(*(guint32 *)value);
|
||||
case G_FILE_ATTRIBUTE_TYPE_INT32:
|
||||
return GINT322RVAL(*(gint32 *)value);
|
||||
case G_FILE_ATTRIBUTE_TYPE_UINT64:
|
||||
return GUINT642RVAL(*(guint64 *)value);
|
||||
case G_FILE_ATTRIBUTE_TYPE_INT64:
|
||||
return GINT642RVAL(*(gint64 *)value);
|
||||
case G_FILE_ATTRIBUTE_TYPE_OBJECT:
|
||||
return GOBJ2RVAL((GObject *)value);
|
||||
case G_FILE_ATTRIBUTE_TYPE_STRINGV:
|
||||
return STRV2RVAL_FREE((gchar **)value);
|
||||
case G_FILE_ATTRIBUTE_TYPE_INVALID:
|
||||
rb_raise(rb_eArgError, "invalid file attribute type");
|
||||
break;
|
||||
default:
|
||||
rb_raise(rb_eArgError, "unknown file attribute type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_data(VALUE self, VALUE attribute)
|
||||
{
|
||||
GFileAttributeType type;
|
||||
gpointer value;
|
||||
GFileAttributeStatus status;
|
||||
|
||||
if (!g_file_info_get_attribute_data(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
&type,
|
||||
&value,
|
||||
&status))
|
||||
return Qnil;
|
||||
|
||||
return rb_ary_new3(3,
|
||||
GFILEATTRIBUTETYPE2RVAL(type),
|
||||
file_attribute_to_value(type, value),
|
||||
GFILEATTRIBUTESTATUS2RVAL(status));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_status(VALUE self, VALUE attribute)
|
||||
{
|
||||
return GFILEATTRIBUTESTATUS2RVAL(g_file_info_get_attribute_status(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_string(VALUE self, VALUE attribute)
|
||||
{
|
||||
return CSTR2RVAL(g_file_info_get_attribute_string(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_stringv(VALUE self, VALUE attribute)
|
||||
{
|
||||
return STRV2RVAL((const gchar **)g_file_info_get_attribute_stringv(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_byte_string(VALUE self, VALUE attribute)
|
||||
{
|
||||
return CSTR2RVAL(g_file_info_get_attribute_byte_string(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_boolean(VALUE self, VALUE attribute)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_info_get_attribute_boolean(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_uint32(VALUE self, VALUE attribute)
|
||||
{
|
||||
return GUINT322RVAL(g_file_info_get_attribute_uint32(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_int32(VALUE self, VALUE attribute)
|
||||
{
|
||||
return GINT322RVAL(g_file_info_get_attribute_int32(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_uint64(VALUE self, VALUE attribute)
|
||||
{
|
||||
return GUINT642RVAL(g_file_info_get_attribute_uint64(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_int64(VALUE self, VALUE attribute)
|
||||
{
|
||||
return GINT642RVAL(g_file_info_get_attribute_int64(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_object(VALUE self, VALUE attribute)
|
||||
{
|
||||
return GOBJ2RVAL(g_file_info_get_attribute_object(_SELF(self),
|
||||
RVAL2CSTR(attribute)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_attribute_value(VALUE self, VALUE attribute)
|
||||
{
|
||||
GFileAttributeType type;
|
||||
gpointer value;
|
||||
GFileAttributeStatus status;
|
||||
|
||||
if (!g_file_info_get_attribute_data(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
&type,
|
||||
&value,
|
||||
&status))
|
||||
return Qnil;
|
||||
|
||||
return file_attribute_to_value(type, value);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_string(VALUE self, VALUE attribute, VALUE value)
|
||||
{
|
||||
g_file_info_set_attribute_string(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
RVAL2CSTR(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_byte_string(VALUE self, VALUE attribute, VALUE value)
|
||||
{
|
||||
g_file_info_set_attribute_byte_string(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
RVAL2CSTR(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_boolean(VALUE self, VALUE attribute, VALUE value)
|
||||
{
|
||||
g_file_info_set_attribute_boolean(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
RVAL2CBOOL(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_uint32(VALUE self, VALUE attribute, VALUE value)
|
||||
{
|
||||
g_file_info_set_attribute_uint32(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
RVAL2GUINT32(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_int32(VALUE self, VALUE attribute, VALUE value)
|
||||
{
|
||||
g_file_info_set_attribute_int32(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
RVAL2GINT32(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_uint64(VALUE self, VALUE attribute, VALUE value)
|
||||
{
|
||||
g_file_info_set_attribute_uint64(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
RVAL2GUINT64(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_int64(VALUE self, VALUE attribute, VALUE value)
|
||||
{
|
||||
g_file_info_set_attribute_int64(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
RVAL2GINT64(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_object(VALUE self, VALUE attribute, VALUE value)
|
||||
{
|
||||
g_file_info_set_attribute_object(_SELF(self),
|
||||
RVAL2CSTR(attribute),
|
||||
RVAL2GOBJ(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_clear_status(VALUE self)
|
||||
{
|
||||
g_file_info_clear_status(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_file_type(VALUE self)
|
||||
{
|
||||
return GFILETYPE2RVAL(g_file_info_get_file_type(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_hidden_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_info_get_is_hidden(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_backup_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_info_get_is_backup(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_symlink_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_info_get_is_symlink(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_file_info_get_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_display_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_file_info_get_display_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_edit_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_file_info_get_edit_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_icon(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL(g_file_info_get_icon(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_content_type(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_file_info_get_content_type(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_size(VALUE self)
|
||||
{
|
||||
return GOFFSET2RVAL(g_file_info_get_size(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_modification_time(VALUE self)
|
||||
{
|
||||
GTimeVal time;
|
||||
|
||||
g_file_info_get_modification_time(_SELF(self), &time);
|
||||
|
||||
return GTIMEVAL2RVAL(&time);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_symlink_target(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_file_info_get_symlink_target(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_etag(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_file_info_get_etag(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_sort_order(VALUE self)
|
||||
{
|
||||
return GINT322RVAL(g_file_info_get_sort_order(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_attribute_mask(VALUE self, VALUE rbmask)
|
||||
{
|
||||
gboolean should_unref;
|
||||
GFileAttributeMatcher *mask;
|
||||
|
||||
if (NIL_P(rbmask)) {
|
||||
g_file_info_unset_attribute_mask(_SELF(self));
|
||||
return self;
|
||||
}
|
||||
|
||||
if (TYPE(rbmask) == T_STRING) {
|
||||
mask = g_file_attribute_matcher_new(RVAL2CSTR(rbmask));
|
||||
should_unref = TRUE;
|
||||
} else {
|
||||
mask = RVAL2GFILEATTRIBUTEMATCHER(rbmask);
|
||||
should_unref = FALSE;
|
||||
}
|
||||
|
||||
g_file_info_set_attribute_mask(_SELF(self), mask);
|
||||
|
||||
if (should_unref)
|
||||
g_file_attribute_matcher_unref(mask);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_unset_attribute_mask(VALUE self)
|
||||
{
|
||||
g_file_info_unset_attribute_mask(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_file_type(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_file_type(_SELF(self), RVAL2GFILETYPE(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_hidden(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_is_hidden(_SELF(self), RVAL2CBOOL(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_symlink(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_is_symlink(_SELF(self), RVAL2CBOOL(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_name(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_name(_SELF(self), RVAL2CSTR(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_display_name(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_display_name(_SELF(self), RVAL2CSTR(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_edit_name(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_edit_name(_SELF(self), RVAL2CSTR(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_icon(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_icon(_SELF(self), RVAL2GICON(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_content_type(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_content_type(_SELF(self), RVAL2CSTR(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_size(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_size(_SELF(self), RVAL2GOFFSET(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_modification_time(VALUE self, VALUE rbtime)
|
||||
{
|
||||
GTimeVal time;
|
||||
|
||||
rbgio_rval_to_gtimeval(rbtime, &time);
|
||||
|
||||
g_file_info_set_modification_time(_SELF(self), &time);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_symlink_target(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_symlink_target(_SELF(self), RVAL2CSTR(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_sort_order(VALUE self, VALUE value)
|
||||
{
|
||||
g_file_info_set_sort_order(_SELF(self), RVAL2GINT32(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfileinfo(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_INFO, "FileInfo", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 0);
|
||||
RG_DEF_METHOD(dup, 0);
|
||||
RG_DEF_METHOD(copy_into, 1);
|
||||
RG_DEF_METHOD_P(has_attribute, 1);
|
||||
RG_DEF_METHOD_P(has_namespace, 1);
|
||||
RG_DEF_METHOD(list_attributes, -1);
|
||||
RG_DEF_ALIAS("attributes", "list_attributes");
|
||||
RG_DEF_METHOD(get_attribute_type, 1);
|
||||
RG_DEF_METHOD(remove_attribute, 1);
|
||||
RG_DEF_METHOD(get_attribute_as_string, 1);
|
||||
RG_DEF_METHOD(get_attribute_data, 1);
|
||||
RG_DEF_METHOD(get_attribute_status, 1);
|
||||
RG_DEF_METHOD(get_attribute_string, 1);
|
||||
RG_DEF_METHOD(get_attribute_stringv, 1);
|
||||
RG_DEF_METHOD(get_attribute_byte_string, 1);
|
||||
RG_DEF_METHOD(get_attribute_boolean, 1);
|
||||
RG_DEF_METHOD(get_attribute_uint32, 1);
|
||||
RG_DEF_METHOD(get_attribute_int32, 1);
|
||||
RG_DEF_METHOD(get_attribute_uint64, 1);
|
||||
RG_DEF_METHOD(get_attribute_int64, 1);
|
||||
RG_DEF_METHOD(get_attribute_object, 1);
|
||||
RG_DEF_METHOD(get_attribute_value, 1);
|
||||
RG_DEF_ALIAS("[]", "get_attribute_value");
|
||||
RG_DEF_METHOD(set_attribute_status, 2);
|
||||
RG_DEF_METHOD(set_attribute_string, 2);
|
||||
RG_DEF_METHOD(set_attribute_byte_string, 2);
|
||||
RG_DEF_METHOD(set_attribute_boolean, 2);
|
||||
RG_DEF_METHOD(set_attribute_uint32, 2);
|
||||
RG_DEF_METHOD(set_attribute_int32, 2);
|
||||
RG_DEF_METHOD(set_attribute_uint64, 2);
|
||||
RG_DEF_METHOD(set_attribute_int64, 2);
|
||||
RG_DEF_METHOD(set_attribute_object, 2);
|
||||
RG_DEF_METHOD(clear_status, 0);
|
||||
RG_DEF_METHOD(file_type, 0);
|
||||
RG_DEF_METHOD_P(hidden, 0);
|
||||
RG_DEF_METHOD_P(backup, 0);
|
||||
RG_DEF_METHOD_P(symlink, 0);
|
||||
RG_DEF_METHOD(name, 0);
|
||||
RG_DEF_METHOD(display_name, 0);
|
||||
RG_DEF_METHOD(edit_name, 0);
|
||||
RG_DEF_METHOD(icon, 0);
|
||||
RG_DEF_METHOD(content_type, 0);
|
||||
RG_DEF_METHOD(size, 0);
|
||||
RG_DEF_METHOD(modification_time, 0);
|
||||
RG_DEF_METHOD(symlink_target, 0);
|
||||
RG_DEF_METHOD(etag, 0);
|
||||
RG_DEF_METHOD(sort_order, 0);
|
||||
RG_DEF_METHOD(set_attribute_mask, 1);
|
||||
RG_DEF_METHOD(unset_attribute_mask, 0);
|
||||
RG_DEF_METHOD(set_file_type, 1);
|
||||
RG_DEF_METHOD(set_hidden, 1);
|
||||
RG_DEF_METHOD(set_symlink, 1);
|
||||
RG_DEF_METHOD(set_name, 1);
|
||||
RG_DEF_METHOD(set_display_name, 1);
|
||||
RG_DEF_METHOD(set_edit_name, 1);
|
||||
RG_DEF_METHOD(set_icon, 1);
|
||||
RG_DEF_METHOD(set_content_type, 1);
|
||||
RG_DEF_METHOD(set_size, 1);
|
||||
RG_DEF_METHOD(set_modification_time, 1);
|
||||
RG_DEF_METHOD(set_symlink_target, 1);
|
||||
RG_DEF_METHOD(set_sort_order, 1);
|
||||
}
|
91
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileinputstream.c
Normal file
91
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileinputstream.c
Normal file
@ -0,0 +1,91 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileInputStream
|
||||
#define _SELF(value) RVAL2GFILEINPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_query_info(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE attributes, cancellable;
|
||||
GError *error = NULL;
|
||||
GFileInfo *info;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &attributes, &cancellable);
|
||||
info = g_file_input_stream_query_info(_SELF(self),
|
||||
RVAL2ATTRIBUTESDEFAULT(attributes),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (info == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_query_info_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbattributes, rbio_priority, rbcancellable, block;
|
||||
const char *attributes;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &rbattributes, &rbio_priority, &rbcancellable, &block);
|
||||
attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_file_input_stream_query_info_async(_SELF(self),
|
||||
attributes,
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_query_info_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GFileInfo *info;
|
||||
|
||||
info = g_file_input_stream_query_info_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (info == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(info);
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfileinputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_INPUT_STREAM, "FileInputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(query_info, -1);
|
||||
RG_DEF_METHOD(query_info_async, -1);
|
||||
RG_DEF_METHOD(query_info_finish, 1);
|
||||
}
|
98
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileiostream.c
Normal file
98
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileiostream.c
Normal file
@ -0,0 +1,98 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileIOStream
|
||||
#define _SELF(value) RVAL2GFILEIOSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_etag(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_file_io_stream_get_etag(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_query_info(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE attributes, cancellable;
|
||||
GError *error = NULL;
|
||||
GFileInfo *info;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &attributes, &cancellable);
|
||||
info = g_file_io_stream_query_info(_SELF(self),
|
||||
RVAL2ATTRIBUTESDEFAULT(attributes),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (info == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_query_info_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbattributes, rbio_priority, rbcancellable, block;
|
||||
const char *attributes;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &rbattributes, &rbio_priority, &rbcancellable, &block);
|
||||
attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_file_io_stream_query_info_async(_SELF(self),
|
||||
attributes,
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_query_info_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GFileInfo *info;
|
||||
|
||||
info = g_file_io_stream_query_info_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (info == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(info);
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfileiostream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_IO_STREAM, "FileIOStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(etag, 0);
|
||||
RG_DEF_METHOD(query_info, -1);
|
||||
RG_DEF_METHOD(query_info_async, -1);
|
||||
RG_DEF_METHOD(query_info_finish, 1);
|
||||
}
|
46
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilemonitor.c
Normal file
46
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilemonitor.c
Normal file
@ -0,0 +1,46 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileMonitor
|
||||
#define _SELF(value) RVAL2GFILEMONITOR(value)
|
||||
|
||||
static VALUE
|
||||
rg_cancel(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_file_monitor_cancel(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfilemonitor(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_MONITOR, "FileMonitor", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_FILE_MONITOR_EVENT, "Event", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_MONITOR_EVENT, "G_FILE_MONITOR_");
|
||||
|
||||
G_DEF_CLASS(G_TYPE_FILE_MONITOR_FLAGS, "Flags", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_MONITOR_FLAGS, "G_FILE_MONITOR_");
|
||||
|
||||
RG_DEF_METHOD(cancel, 0);
|
||||
/* TODO: Do we need #emit_event? */
|
||||
}
|
73
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilenamecompleter.c
Normal file
73
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilenamecompleter.c
Normal file
@ -0,0 +1,73 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFilenameCompleter
|
||||
#define _SELF(value) RVAL2GFILENAMECOMPLETER(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE dirs_only;
|
||||
GFilenameCompleter *completer;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &dirs_only);
|
||||
completer = g_filename_completer_new();
|
||||
g_filename_completer_set_dirs_only(completer, RVAL2CBOOL(dirs_only));
|
||||
|
||||
G_INITIALIZE(self, completer);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_completion_suffix(VALUE self, VALUE initial_text)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_filename_completer_get_completion_suffix(_SELF(self),
|
||||
RVAL2CSTR(initial_text)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_completions(VALUE self, VALUE initial_text)
|
||||
{
|
||||
return STRV2RVAL_FREE(g_filename_completer_get_completions(_SELF(self),
|
||||
RVAL2CSTR(initial_text)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_dirs_only(VALUE self, VALUE dirs_only)
|
||||
{
|
||||
g_filename_completer_set_dirs_only(_SELF(self), RVAL2CBOOL(dirs_only));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfilenamecompleter(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILENAME_COMPLETER, "FilenameCompleter", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(get_completion_suffix, 1);
|
||||
RG_DEF_METHOD(get_completions, 1);
|
||||
RG_DEF_METHOD(set_dirs_only, 1);
|
||||
}
|
98
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileoutputstream.c
Normal file
98
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofileoutputstream.c
Normal file
@ -0,0 +1,98 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cFileOutputStream
|
||||
#define _SELF(value) RVAL2GFILEOUTPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_query_info(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE attributes, cancellable;
|
||||
GError *error = NULL;
|
||||
GFileInfo *info;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &attributes, &cancellable);
|
||||
info = g_file_output_stream_query_info(_SELF(self),
|
||||
RVAL2ATTRIBUTESDEFAULT(attributes),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (info == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_query_info_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbattributes, rbio_priority, rbcancellable, block;
|
||||
const char *attributes;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &rbattributes, &rbio_priority, &rbcancellable, &block);
|
||||
attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_file_output_stream_query_info_async(_SELF(self),
|
||||
attributes,
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_query_info_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GFileInfo *info;
|
||||
|
||||
info = g_file_output_stream_query_info_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (info == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(info);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_etag(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_file_output_stream_get_etag(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gfileoutputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_OUTPUT_STREAM, "FileOutputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(query_info, -1);
|
||||
RG_DEF_METHOD(query_info_async, -1);
|
||||
RG_DEF_METHOD(query_info_finish, 1);
|
||||
RG_DEF_METHOD(etag, 0);
|
||||
}
|
28
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilterinputstream.c
Normal file
28
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilterinputstream.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
void
|
||||
Init_gfilterinputstream(VALUE mGio)
|
||||
{
|
||||
(void)G_DEF_CLASS(G_TYPE_FILTER_INPUT_STREAM, "FilterInputStream", mGio);
|
||||
}
|
28
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilteroutputstream.c
Normal file
28
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiofilteroutputstream.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
void
|
||||
Init_gfilteroutputstream(VALUE mGio)
|
||||
{
|
||||
(void)G_DEF_CLASS(G_TYPE_FILTER_OUTPUT_STREAM, "FilterOutputStream", mGio);
|
||||
}
|
69
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioicon.c
Normal file
69
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioicon.c
Normal file
@ -0,0 +1,69 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mIcon
|
||||
#define _SELF(value) RVAL2GICON(value)
|
||||
|
||||
static VALUE
|
||||
rg_s_new_for_string(G_GNUC_UNUSED VALUE self, VALUE string)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GIcon *icon;
|
||||
|
||||
icon = g_icon_new_for_string(RVAL2CSTR(string), &error);
|
||||
if (icon == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(icon);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_hash(VALUE self)
|
||||
{
|
||||
return GUINT2RVAL(g_icon_hash(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_operator_icon_equal(VALUE self, VALUE other)
|
||||
{
|
||||
return CBOOL2RVAL(g_icon_equal(_SELF(self), _SELF(other)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_to_string(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_icon_to_string(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gicon(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_ICON, "Icon", mGio);
|
||||
|
||||
RG_DEF_SMETHOD(new_for_string, 1);
|
||||
|
||||
RG_DEF_METHOD(hash, 0);
|
||||
RG_DEF_METHOD_OPERATOR("==", icon_equal, 1);
|
||||
RG_DEF_METHOD(to_string, 0);
|
||||
RG_DEF_ALIAS("to_s", "to_string");
|
||||
}
|
118
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinetaddress.c
Normal file
118
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinetaddress.c
Normal file
@ -0,0 +1,118 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mInetAddress
|
||||
#define _SELF(value) RVAL2GINETADDRESS(value)
|
||||
|
||||
static VALUE
|
||||
rg_s_new_from_string(G_GNUC_UNUSED VALUE self, VALUE string)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_inet_address_new_from_string(RVAL2CSTR(string)));
|
||||
}
|
||||
|
||||
/* TODO: Should this take an array instead? */
|
||||
static VALUE
|
||||
rg_s_new_from_bytes(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
VALUE rbbytes, rbfamily;
|
||||
guint8 *bytes;
|
||||
GSocketFamily family;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbbytes, &rbfamily);
|
||||
bytes = (guint8 *)RVAL2CSTR(rbbytes);
|
||||
family = RVAL2GSOCKETFAMILY(rbfamily);
|
||||
|
||||
/* TODO: Should check encoding. */
|
||||
/* TODO: We can't pass bytes as such, as it will be NULL-terminated. */
|
||||
/* TODO: Do we need to deal with G_SOCKET_FAMILY_UNIX? */
|
||||
switch (family) {
|
||||
case G_SOCKET_FAMILY_IPV4:
|
||||
if (RSTRING_LEN(rbbytes) != 4)
|
||||
rb_raise(rb_eArgError, "string containing 4 bytes expected");
|
||||
break;
|
||||
case G_SOCKET_FAMILY_IPV6:
|
||||
if (RSTRING_LEN(rbbytes) != 16)
|
||||
rb_raise(rb_eArgError, "string containing 16 bytes expected");
|
||||
break;
|
||||
case G_SOCKET_FAMILY_INVALID:
|
||||
case G_SOCKET_FAMILY_UNIX:
|
||||
rb_raise(rb_eArgError, "invalid family: %d", family);
|
||||
default:
|
||||
rb_raise(rb_eArgError, "unknown family: %d", family);
|
||||
break;
|
||||
}
|
||||
|
||||
return GOBJ2RVAL_UNREF(g_inet_address_new_from_bytes(bytes, family));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_new_any(G_GNUC_UNUSED VALUE self, VALUE family)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_inet_address_new_any(RVAL2GSOCKETFAMILY(family)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_new_loopback(G_GNUC_UNUSED VALUE self, VALUE family)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_inet_address_new_loopback(RVAL2GSOCKETFAMILY(family)));
|
||||
}
|
||||
|
||||
/* TODO: Return array of bytes instead? */
|
||||
static VALUE
|
||||
rg_to_bytes(VALUE self)
|
||||
{
|
||||
gsize size;
|
||||
|
||||
size = g_inet_address_get_native_size(_SELF(self));
|
||||
return rb_str_new((const gchar *)g_inet_address_to_bytes(_SELF(self)),
|
||||
size);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_native_size(VALUE self)
|
||||
{
|
||||
return GSIZE2RVAL(g_inet_address_get_native_size(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_to_string(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_inet_address_to_string(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_ginetaddress(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_INET_ADDRESS, "InetAddress", mGio);
|
||||
|
||||
RG_DEF_SMETHOD(new_from_string, 1);
|
||||
RG_DEF_SMETHOD(new_from_bytes, -1);
|
||||
RG_DEF_SMETHOD(new_any, 1);
|
||||
RG_DEF_SMETHOD(new_loopback, 1);
|
||||
|
||||
RG_DEF_METHOD(to_bytes, 0);
|
||||
RG_DEF_METHOD(get_native_size, 0);
|
||||
RG_DEF_METHOD(to_string, 0);
|
||||
RG_DEF_ALIAS("to_str", "to_string");
|
||||
RG_DEF_ALIAS("to_s", "to_string");
|
||||
}
|
41
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinetsocketaddress.c
Normal file
41
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinetsocketaddress.c
Normal file
@ -0,0 +1,41 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cInetSocketAddress
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE address, VALUE port)
|
||||
{
|
||||
G_INITIALIZE(self, g_inet_socket_address_new(RVAL2GINETADDRESS(address),
|
||||
RVAL2GUINT16(port)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_ginetsocketaddress(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_INET_SOCKET_ADDRESS, "InetSocketAddress", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 2);
|
||||
}
|
199
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinitable.c
Normal file
199
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinitable.c
Normal file
@ -0,0 +1,199 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mInitable
|
||||
#define _SELF(value) RVAL2GINITABLE(value)
|
||||
|
||||
static VALUE
|
||||
rg_init(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
if (!g_initable_init(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
struct rbgio_ginitable_new_data {
|
||||
GObjectClass *gclass;
|
||||
GCancellable *cancellable;
|
||||
VALUE rbparameters;
|
||||
guint index;
|
||||
guint n_parameters;
|
||||
GParameter *parameters;
|
||||
GError *error;
|
||||
};
|
||||
|
||||
static VALUE
|
||||
rbgio_ginitiable_new_parameters_initialize(VALUE key_value,
|
||||
struct rbgio_ginitable_new_data *data)
|
||||
{
|
||||
VALUE key, value;
|
||||
GParamSpec *spec;
|
||||
|
||||
if (data->index >= data->n_parameters)
|
||||
rb_raise(rb_eArgError,
|
||||
"too many parameters (%d >= %d)",
|
||||
data->index, data->n_parameters);
|
||||
|
||||
key = rb_ary_entry(key_value, 0);
|
||||
value = rb_ary_entry(key_value, 1);
|
||||
|
||||
data->parameters[data->index].name = SYMBOL_P(key) ?
|
||||
rb_id2name(SYM2ID(key)) :
|
||||
StringValuePtr(key);
|
||||
spec = g_object_class_find_property(data->gclass,
|
||||
data->parameters[data->index].name);
|
||||
if (spec == NULL)
|
||||
rb_raise(rb_eArgError,
|
||||
"%s: no such property",
|
||||
data->parameters[data->index].name);
|
||||
g_value_init(&(data->parameters[data->index].value),
|
||||
G_PARAM_SPEC_VALUE_TYPE(spec));
|
||||
rbgobj_rvalue_to_gvalue(value, &(data->parameters[data->index].value));
|
||||
|
||||
data->index++;
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rbgio_ginitable_new_body(struct rbgio_ginitable_new_data *data)
|
||||
{
|
||||
rb_iterate(rb_each,
|
||||
data->rbparameters,
|
||||
rbgio_ginitiable_new_parameters_initialize,
|
||||
(VALUE)data);
|
||||
|
||||
return (VALUE)g_initable_newv(G_TYPE_FROM_CLASS(data->gclass),
|
||||
data->n_parameters,
|
||||
data->parameters,
|
||||
data->cancellable,
|
||||
&data->error);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rbgio_ginitable_new_ensure(struct rbgio_ginitable_new_data *data)
|
||||
{
|
||||
guint i;
|
||||
|
||||
g_type_class_unref(data->gclass);
|
||||
for (i = 0; i < data->n_parameters; i++)
|
||||
if (G_IS_VALUE(&data->parameters[i].value))
|
||||
g_value_unset(&data->parameters[i].value);
|
||||
|
||||
g_free(data->parameters);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
GObject *
|
||||
rbgio_ginitable_new(GType type, VALUE parameters, VALUE cancellable)
|
||||
{
|
||||
static ID s_id_length;
|
||||
GError *error = NULL;
|
||||
GObject *object;
|
||||
struct rbgio_ginitable_new_data data;
|
||||
|
||||
if (s_id_length == 0)
|
||||
s_id_length = rb_intern("length");
|
||||
|
||||
if (!g_type_is_a(type, G_TYPE_OBJECT))
|
||||
rb_raise(rb_eArgError,
|
||||
"%s is not a descendant of GObject",
|
||||
g_type_name(type));
|
||||
|
||||
if (NIL_P(parameters)) {
|
||||
object = g_initable_newv(type,
|
||||
0,
|
||||
NULL,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (object == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return object;
|
||||
} else {
|
||||
parameters = rb_convert_type(parameters,
|
||||
T_HASH,
|
||||
"Hash",
|
||||
"to_hash");
|
||||
}
|
||||
|
||||
data.gclass = G_OBJECT_CLASS(g_type_class_ref(type));
|
||||
data.cancellable = RVAL2GCANCELLABLE(cancellable);
|
||||
data.rbparameters = parameters;
|
||||
data.index = 0;
|
||||
data.n_parameters = RVAL2GUINT(rb_funcall(parameters, s_id_length, 0));
|
||||
data.parameters = g_new(GParameter, data.n_parameters);
|
||||
data.error = NULL;
|
||||
|
||||
object = (GObject *)rb_ensure(rbgio_ginitable_new_body, (VALUE)&data,
|
||||
rbgio_ginitable_new_ensure, (VALUE)&data);
|
||||
if (object == NULL)
|
||||
rbgio_raise_error(data.error);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
/* NOTE: We don't implement g_initable_new. */
|
||||
|
||||
/* NOTE: We don't implement g_initable_new_valist. */
|
||||
|
||||
static VALUE
|
||||
rg_s_new(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
const RGObjClassInfo* info;
|
||||
VALUE cancellable, parameters;
|
||||
GObject *object;
|
||||
VALUE result;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &cancellable, ¶meters);
|
||||
|
||||
info = CLASS2CINFO(self);
|
||||
if (info->klass != self)
|
||||
rb_raise(rb_eTypeError,
|
||||
"%s: class not registered with GLib",
|
||||
rb_class2name(self));
|
||||
|
||||
object = rbgio_ginitable_new(info->gtype, parameters, cancellable);
|
||||
result = GOBJ2RVAL(object);
|
||||
g_object_unref(object);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
Init_ginitable(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_INITABLE, "Initable", mGio);
|
||||
|
||||
RG_DEF_SMETHOD(new, -1);
|
||||
|
||||
RG_DEF_METHOD(init, -1);
|
||||
}
|
341
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinputstream.c
Normal file
341
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioinputstream.c
Normal file
@ -0,0 +1,341 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cInputStream
|
||||
#define _SELF(value) RVAL2GINPUTSTREAM(value)
|
||||
|
||||
static VALUE s_cReadAsyncResult;
|
||||
|
||||
static VALUE
|
||||
rg_read(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbcount, cancellable, result;
|
||||
gsize count;
|
||||
GError *error = NULL;
|
||||
gssize bytes_read;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbcount, &cancellable);
|
||||
count = RVAL2GSIZE(rbcount);
|
||||
result = rb_str_new(NULL, count);
|
||||
bytes_read = g_input_stream_read(_SELF(self),
|
||||
RSTRING_PTR(result),
|
||||
count,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (bytes_read == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
rb_str_set_len(result, bytes_read);
|
||||
rb_str_resize(result, bytes_read);
|
||||
OBJ_TAINT(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_all(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbcount, cancellable, result;
|
||||
gsize count;
|
||||
GError *error = NULL;
|
||||
gsize bytes_read;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbcount, &cancellable);
|
||||
count = RVAL2GSIZE(rbcount);
|
||||
result = rb_str_new(NULL, count);
|
||||
if (!g_input_stream_read_all(_SELF(self),
|
||||
RSTRING_PTR(result),
|
||||
count,
|
||||
&bytes_read,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
rb_str_set_len(result, bytes_read);
|
||||
rb_str_resize(result, bytes_read);
|
||||
OBJ_TAINT(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_skip(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE count, cancellable;
|
||||
GError *error = NULL;
|
||||
gssize bytes_skipped;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &count, &cancellable);
|
||||
bytes_skipped = g_input_stream_skip(_SELF(self),
|
||||
RVAL2GSIZE(count),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (bytes_skipped == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSSIZE2RVAL(bytes_skipped);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
if (!g_input_stream_close(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
struct read_async_result
|
||||
{
|
||||
VALUE string;
|
||||
GAsyncResult *result;
|
||||
};
|
||||
|
||||
static void
|
||||
read_async_result_mark(struct read_async_result *result)
|
||||
{
|
||||
rb_gc_mark(result->string);
|
||||
}
|
||||
|
||||
struct read_async_callback_data
|
||||
{
|
||||
GAsyncResult *result;
|
||||
gpointer user_data;
|
||||
};
|
||||
|
||||
static VALUE
|
||||
read_async_callback_call(VALUE data)
|
||||
{
|
||||
static ID s_id_call;
|
||||
struct read_async_callback_data *real;
|
||||
VALUE ary;
|
||||
struct read_async_result *result;
|
||||
|
||||
if (s_id_call == 0)
|
||||
s_id_call = rb_intern("call");
|
||||
|
||||
real = (struct read_async_callback_data *)data;
|
||||
|
||||
ary = (VALUE)real->user_data;
|
||||
G_CHILD_REMOVE(mGLib, ary);
|
||||
if (NIL_P(RARRAY_PTR(ary)[1]))
|
||||
return Qnil;
|
||||
|
||||
result = g_new(struct read_async_result, 1);
|
||||
result->string = RARRAY_PTR(ary)[0];
|
||||
result->result = real->result;
|
||||
|
||||
rb_funcall(RARRAY_PTR(ary)[1], s_id_call, 1,
|
||||
Data_Wrap_Struct(s_cReadAsyncResult,
|
||||
read_async_result_mark,
|
||||
g_free,
|
||||
result));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static void
|
||||
read_async_callback(G_GNUC_UNUSED GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
struct read_async_callback_data real = { result, user_data };
|
||||
|
||||
G_PROTECT_CALLBACK(read_async_callback_call, &real);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbcount, rbio_priority, rbcancellable, block, data;
|
||||
gsize count;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "12&", &rbcount, &rbio_priority, &rbcancellable, &block);
|
||||
count = RVAL2GSIZE(rbcount);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
data = rb_assoc_new(rb_str_new(NULL, count), block);
|
||||
G_CHILD_ADD(mGLib, data);
|
||||
g_input_stream_read_async(_SELF(self),
|
||||
RSTRING_PTR(RARRAY_PTR(data)[0]),
|
||||
count,
|
||||
io_priority,
|
||||
cancellable,
|
||||
read_async_callback,
|
||||
(gpointer)data);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_read_finish(VALUE self, VALUE rbresult)
|
||||
{
|
||||
struct read_async_result *result;
|
||||
GError *error = NULL;
|
||||
gssize bytes_read;
|
||||
|
||||
Data_Get_Struct(rbresult, struct read_async_result, result);
|
||||
bytes_read = g_input_stream_read_finish(_SELF(self),
|
||||
result->result,
|
||||
&error);
|
||||
if (bytes_read == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
rb_str_set_len(result->string, bytes_read);
|
||||
rb_str_resize(result->string, bytes_read);
|
||||
OBJ_TAINT(result->string);
|
||||
|
||||
return result->string;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_skip_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbcount, rbio_priority, rbcancellable, block;
|
||||
gsize count;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "12&", &rbcount, &rbio_priority, &rbcancellable, &block);
|
||||
count = RVAL2GSIZE(rbcount);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_input_stream_skip_async(_SELF(self),
|
||||
count,
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_skip_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gssize skipped_bytes;
|
||||
|
||||
skipped_bytes = g_input_stream_skip_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (skipped_bytes == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSSIZE2RVAL(skipped_bytes);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbio_priority, rbcancellable, block;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_input_stream_close_async(_SELF(self),
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
if (!g_input_stream_skip_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_closed_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_input_stream_is_closed(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_has_pending_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_input_stream_has_pending(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_pending(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_input_stream_set_pending(_SELF(self), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_clear_pending(VALUE self)
|
||||
{
|
||||
g_input_stream_clear_pending(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_ginputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_INPUT_STREAM, "InputStream", mGio);
|
||||
|
||||
s_cReadAsyncResult = rb_define_class_under(RG_TARGET_NAMESPACE, "ReadAsyncResult", rb_cObject);
|
||||
|
||||
RG_DEF_METHOD(read, -1);
|
||||
RG_DEF_METHOD(read_all, -1);
|
||||
RG_DEF_METHOD(skip, -1);
|
||||
RG_DEF_METHOD(close, -1);
|
||||
RG_DEF_METHOD(read_async, -1);
|
||||
RG_DEF_METHOD(read_finish, 1);
|
||||
RG_DEF_METHOD(skip_async, -1);
|
||||
RG_DEF_METHOD(skip_finish, 1);
|
||||
RG_DEF_METHOD(close_async, -1);
|
||||
RG_DEF_METHOD(close_finish, 1);
|
||||
RG_DEF_METHOD_P(closed, 0);
|
||||
RG_DEF_METHOD_P(has_pending, 0);
|
||||
RG_DEF_METHOD(set_pending, 0);
|
||||
RG_DEF_METHOD(clear_pending, 0);
|
||||
}
|
73
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioio.c
Normal file
73
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioio.c
Normal file
@ -0,0 +1,73 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mIO
|
||||
|
||||
/* NOTE: g_io_error_from_errno doesn't make sense from Ruby. */
|
||||
|
||||
void
|
||||
Init_gioerror(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE, error;
|
||||
|
||||
RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "IO");
|
||||
|
||||
error = rbgio_define_domain_error(RG_TARGET_NAMESPACE, "Error", G_IO_ERROR, "GIOErrorEnum", rb_eIOError);
|
||||
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "FailedError", G_IO_ERROR_FAILED, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotFoundError", G_IO_ERROR_NOT_FOUND, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "ExistsError", G_IO_ERROR_EXISTS, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "IsDirectoryError", G_IO_ERROR_IS_DIRECTORY, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotDirectoryError", G_IO_ERROR_NOT_DIRECTORY, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotEmptyError", G_IO_ERROR_NOT_EMPTY, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotRegularFileError", G_IO_ERROR_NOT_REGULAR_FILE, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotSymbolicLinkError", G_IO_ERROR_NOT_SYMBOLIC_LINK, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotMountableFileError", G_IO_ERROR_NOT_MOUNTABLE_FILE, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "FilenameTooLongError", G_IO_ERROR_FILENAME_TOO_LONG, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "InvalidFilenameError", G_IO_ERROR_INVALID_FILENAME, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "TooManyLinksError", G_IO_ERROR_TOO_MANY_LINKS, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NoSpaceError", G_IO_ERROR_NO_SPACE, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "InvalidArgumentError", G_IO_ERROR_INVALID_ARGUMENT, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "PermissionDeniedError", G_IO_ERROR_PERMISSION_DENIED, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotSupportedError", G_IO_ERROR_NOT_SUPPORTED, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotMountedError", G_IO_ERROR_NOT_MOUNTED, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "AlreadyMountedError", G_IO_ERROR_ALREADY_MOUNTED, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "ClosedError", G_IO_ERROR_CLOSED, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "CancelledError", G_IO_ERROR_CANCELLED, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "PendingError", G_IO_ERROR_PENDING, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "ReadOnlyError", G_IO_ERROR_READ_ONLY, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "CantCreateBackupError", G_IO_ERROR_CANT_CREATE_BACKUP, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "WrongEtagError", G_IO_ERROR_WRONG_ETAG, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "TimedOutError", G_IO_ERROR_TIMED_OUT, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "WouldRecurseError", G_IO_ERROR_WOULD_RECURSE, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "BusyError", G_IO_ERROR_BUSY, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "WouldBlockError", G_IO_ERROR_WOULD_BLOCK, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "HostNotFoundError", G_IO_ERROR_HOST_NOT_FOUND, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "WouldMergeError", G_IO_ERROR_WOULD_MERGE, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "FailedHandledError", G_IO_ERROR_FAILED_HANDLED, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "TooManyOpenFilesError", G_IO_ERROR_TOO_MANY_OPEN_FILES, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotInitializedError", G_IO_ERROR_NOT_INITIALIZED, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "AddressInUseError", G_IO_ERROR_ADDRESS_IN_USE, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "PartialInputError", G_IO_ERROR_PARTIAL_INPUT, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "InvalidDataError", G_IO_ERROR_INVALID_DATA, error);
|
||||
}
|
45
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioiomodule.c
Normal file
45
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioiomodule.c
Normal file
@ -0,0 +1,45 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cIOModule
|
||||
#define _SELF(value) RVAL2GIOMODULE(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE filename)
|
||||
{
|
||||
G_INITIALIZE(self, g_io_module_new(RVAL2CSTR(filename)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
/* NOTE: No point in implementing g_io_module_query. */
|
||||
|
||||
void
|
||||
Init_giomodule(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_IO_TYPE_MODULE, "IOModule", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 1);
|
||||
}
|
47
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioiomodules.c
Normal file
47
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioiomodules.c
Normal file
@ -0,0 +1,47 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mIOModules
|
||||
|
||||
static VALUE
|
||||
rg_s_load_all_in_directory(G_GNUC_UNUSED VALUE self, VALUE dirname)
|
||||
{
|
||||
return GLIST2ARY_FREE(g_io_modules_load_all_in_directory(RVAL2CSTR(dirname)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_scan_all_in_directory(VALUE self, VALUE dirname)
|
||||
{
|
||||
g_io_modules_scan_all_in_directory(RVAL2CSTR(dirname));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_giomodules(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "IOModules");
|
||||
|
||||
RG_DEF_SMETHOD(load_all_in_directory, 1);
|
||||
RG_DEF_SMETHOD(scan_all_in_directory, 1);
|
||||
}
|
102
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioioscheduler.c
Normal file
102
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioioscheduler.c
Normal file
@ -0,0 +1,102 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mIOScheduler
|
||||
|
||||
struct ioscheduler_job_callback_data
|
||||
{
|
||||
GIOSchedulerJob *job;
|
||||
GCancellable *cancellable;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
static VALUE
|
||||
ioscheduler_job_callback_call(VALUE data)
|
||||
{
|
||||
static VALUE s_id_call;
|
||||
struct ioscheduler_job_callback_data *real;
|
||||
|
||||
if (s_id_call == 0)
|
||||
s_id_call = rb_intern("call");
|
||||
|
||||
real = (struct ioscheduler_job_callback_data *)data;
|
||||
|
||||
/* TODO: Totally unsure if _UNREF is correct here or not. */
|
||||
return rb_funcall(USE_BLOCK_AND_SAVE(real->data), s_id_call, 2,
|
||||
GOBJ2RVAL_UNREF(real->job),
|
||||
GOBJ2RVAL_UNREF(real->cancellable));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ioscheduler_job_callback(GIOSchedulerJob *job,
|
||||
GCancellable *cancellable,
|
||||
gpointer data)
|
||||
{
|
||||
struct ioscheduler_job_callback_data real = { job, cancellable, data };
|
||||
|
||||
return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_job_callback_call,
|
||||
&real));
|
||||
}
|
||||
|
||||
static void
|
||||
ioscheduler_job_callback_free(gpointer data)
|
||||
{
|
||||
USE_BLOCK((VALUE)data);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_push_job(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbio_priority, rbcancellable, block;
|
||||
gint io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &rbio_priority, &rbcancellable);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
block = rb_block_proc();
|
||||
SAVE_BLOCK(block);
|
||||
g_io_scheduler_push_job(ioscheduler_job_callback,
|
||||
(gpointer)block,
|
||||
ioscheduler_job_callback_free,
|
||||
io_priority,
|
||||
cancellable);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_cancel_all_jobs(VALUE self)
|
||||
{
|
||||
g_io_scheduler_cancel_all_jobs();
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gioscheduler(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "IOScheduler");
|
||||
RG_DEF_SMETHOD(push_job, -1);
|
||||
RG_DEF_SMETHOD(cancel_all_jobs, 0);
|
||||
}
|
121
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioioschedulerjob.c
Normal file
121
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioioschedulerjob.c
Normal file
@ -0,0 +1,121 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define G_TYPE_IO_SCHEDULER_JOB (g_io_scheduler_job_get_type())
|
||||
|
||||
#define RVAL2GIOSCHEDULERJOB(object) \
|
||||
((GIOSchedulerJob *)(RVAL2BOXED(object, G_TYPE_IO_SCHEDULER_JOB)))
|
||||
|
||||
#define GIOSCHEDULERJOB2RVAL(object) \
|
||||
BOXED2RVAL(object, G_TYPE_IO_SCHEDULER_JOB)
|
||||
|
||||
#define RG_TARGET_NAMESPACE cIOSchedulerJob
|
||||
#define _SELF(value) RVAL2GIOSCHEDULERJOB(value)
|
||||
|
||||
static GIOSchedulerJob *
|
||||
ioschedulerjob_copy(const GIOSchedulerJob *job)
|
||||
{
|
||||
return (GIOSchedulerJob *)job;
|
||||
}
|
||||
|
||||
static void
|
||||
ioschedulerjob_free(G_GNUC_UNUSED GIOSchedulerJob *job)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static GType
|
||||
g_io_scheduler_job_get_type(void)
|
||||
{
|
||||
static GType our_type = 0;
|
||||
|
||||
if (our_type == 0)
|
||||
our_type = g_boxed_type_register_static("GIOSchedulerJob",
|
||||
(GBoxedCopyFunc)ioschedulerjob_copy,
|
||||
(GBoxedFreeFunc)ioschedulerjob_free);
|
||||
|
||||
return our_type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
ioscheduler_source_callback_call(VALUE data)
|
||||
{
|
||||
static VALUE s_id_call;
|
||||
|
||||
if (s_id_call == 0)
|
||||
s_id_call = rb_intern("call");
|
||||
|
||||
return rb_funcall(USE_BLOCK_AND_SAVE(data), s_id_call, 0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ioscheduler_source_callback(gpointer data)
|
||||
{
|
||||
return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_source_callback_call,
|
||||
data));
|
||||
}
|
||||
|
||||
static void
|
||||
ioscheduler_source_callback_free(gpointer data)
|
||||
{
|
||||
USE_BLOCK(data);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_send_to_mainloop(VALUE self)
|
||||
{
|
||||
VALUE block;
|
||||
|
||||
block = rb_block_proc();
|
||||
SAVE_BLOCK(block);
|
||||
|
||||
return CBOOL2RVAL(g_io_scheduler_job_send_to_mainloop(_SELF(self),
|
||||
ioscheduler_source_callback,
|
||||
(gpointer)block,
|
||||
ioscheduler_source_callback_free));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_send_to_mainloop_async(VALUE self)
|
||||
{
|
||||
VALUE block;
|
||||
|
||||
block = rb_block_proc();
|
||||
SAVE_BLOCK(block);
|
||||
|
||||
g_io_scheduler_job_send_to_mainloop_async(_SELF(self),
|
||||
ioscheduler_source_callback,
|
||||
(gpointer)block,
|
||||
ioscheduler_source_callback_free);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gioschedulerjob(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_SCHEDULER_JOB, "IOSchedulerJob", mGio);
|
||||
|
||||
RG_DEF_METHOD(send_to_mainloop, 0);
|
||||
RG_DEF_METHOD(send_to_mainloop_async, 0);
|
||||
}
|
107
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioiostream.c
Normal file
107
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioiostream.c
Normal file
@ -0,0 +1,107 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cIOStream
|
||||
#define _SELF(value) RVAL2GIOSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_close(VALUE self, VALUE cancellable)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_io_stream_close(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbio_priority, rbcancellable, block;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "01&", &rbio_priority, &rbcancellable, &block);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_io_stream_close_async(_SELF(self),
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_io_stream_close_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_has_pending_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_io_stream_has_pending(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_pending(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_io_stream_set_pending(_SELF(self), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_clear_pending(VALUE self)
|
||||
{
|
||||
g_io_stream_clear_pending(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_giostream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_STREAM, "IOStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(close, 1);
|
||||
RG_DEF_METHOD(close_async, -1);
|
||||
RG_DEF_METHOD(close_finish, 1);
|
||||
RG_DEF_METHOD_P(has_pending, 0);
|
||||
RG_DEF_METHOD(set_pending, 0);
|
||||
RG_DEF_METHOD(clear_pending, 0);
|
||||
}
|
92
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioloadableicon.c
Normal file
92
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioloadableicon.c
Normal file
@ -0,0 +1,92 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mLoadableIcon
|
||||
#define _SELF(value) RVAL2GLOADABLEICON(value)
|
||||
|
||||
static VALUE
|
||||
rg_load(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE size, cancellable;
|
||||
char *type;
|
||||
GError *error = NULL;
|
||||
GInputStream *stream;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &size, &cancellable);
|
||||
stream = g_loadable_icon_load(_SELF(self),
|
||||
NUM2INT(size),
|
||||
&type,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return rb_assoc_new(GOBJ2RVAL_UNREF(stream), CSTR2RVAL_FREE(type));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_load_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbsize, rbcancellable, block;
|
||||
int size;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "11&", &rbsize, &rbcancellable, &block);
|
||||
size = NUM2INT(rbsize);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_loadable_icon_load_async(_SELF(self),
|
||||
size,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_load_finish(VALUE self, VALUE result)
|
||||
{
|
||||
char *type;
|
||||
GError *error = NULL;
|
||||
GInputStream *stream;
|
||||
|
||||
stream = g_loadable_icon_load_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&type,
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return rb_assoc_new(GOBJ2RVAL_UNREF(stream), CSTR2RVAL_FREE(type));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gloadableicon(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_LOADABLE_ICON, "LoadableIcon", mGio);
|
||||
|
||||
RG_DEF_METHOD(load, -1);
|
||||
RG_DEF_METHOD(load_async, -1);
|
||||
RG_DEF_METHOD(load_finish, 1);
|
||||
}
|
67
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomemoryinputstream.c
Normal file
67
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomemoryinputstream.c
Normal file
@ -0,0 +1,67 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cMemoryInputStream
|
||||
#define _SELF(value) RVAL2GMEMORYINPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE data;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &data);
|
||||
if (NIL_P(data)) {
|
||||
G_INITIALIZE(self, g_memory_input_stream_new());
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
StringValue(data);
|
||||
G_RELATIVE(self, data);
|
||||
G_INITIALIZE(self, g_memory_input_stream_new_from_data(RSTRING_PTR(data),
|
||||
RSTRING_LEN(data),
|
||||
NULL));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_add_data(VALUE self, VALUE data)
|
||||
{
|
||||
StringValue(data);
|
||||
G_RELATIVE(self, data);
|
||||
g_memory_input_stream_add_data(_SELF(self),
|
||||
RSTRING_PTR(data),
|
||||
RSTRING_LEN(data),
|
||||
NULL);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gmemoryinputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MEMORY_INPUT_STREAM, "MemoryInputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(add_data, 1);
|
||||
}
|
44
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomemoryoutputstream.c
Normal file
44
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomemoryoutputstream.c
Normal file
@ -0,0 +1,44 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cMemoryOutputStream
|
||||
|
||||
/* TODO: Take string argument? */
|
||||
static VALUE
|
||||
rg_initialize(VALUE self)
|
||||
{
|
||||
G_INITIALIZE(self, g_memory_output_stream_new(NULL,
|
||||
0,
|
||||
g_realloc,
|
||||
g_free));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gmemoryoutputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MEMORY_OUTPUT_STREAM, "MemoryOutputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 0);
|
||||
}
|
286
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomount.c
Normal file
286
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomount.c
Normal file
@ -0,0 +1,286 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mMount
|
||||
#define _SELF(value) RVAL2GMOUNT(value)
|
||||
|
||||
static VALUE
|
||||
rg_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_mount_get_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_uuid(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_mount_get_uuid(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_icon(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_mount_get_icon(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_drive(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_mount_get_drive(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_root(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_mount_get_root(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_volume(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_mount_get_volume(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_default_location(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_mount_get_default_location(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_unmount_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_mount_can_unmount(_SELF(self)));
|
||||
}
|
||||
|
||||
typedef void (*UnmountEjectMethod)(GMount *,
|
||||
GMountUnmountFlags,
|
||||
GMountOperation *,
|
||||
GCancellable *,
|
||||
GAsyncReadyCallback,
|
||||
gpointer);
|
||||
|
||||
static VALUE
|
||||
unmount_eject_method(UnmountEjectMethod method, int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbflags, rbmount_operation, rbcancellable, block;
|
||||
GMountUnmountFlags flags;
|
||||
GMountOperation *mount_operation;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block);
|
||||
flags = RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(rbflags);
|
||||
mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
method(_SELF(self),
|
||||
flags,
|
||||
mount_operation,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_unmount_with_operation(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return unmount_eject_method(g_mount_unmount_with_operation, argc, argv, self);
|
||||
}
|
||||
|
||||
typedef gboolean (*BooleanFinishMethod)(GMount *,
|
||||
GAsyncResult *,
|
||||
GError **);
|
||||
|
||||
static VALUE
|
||||
boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_unmount_with_operation_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_mount_unmount_with_operation_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_remount(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbflags, rbmount_operation, rbcancellable, block;
|
||||
GMountMountFlags flags;
|
||||
GMountOperation *mount_operation;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block);
|
||||
flags = RVAL2GMOUNTMOUNTFLAGSDEFAULT(rbflags);
|
||||
mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_mount_remount(_SELF(self),
|
||||
flags,
|
||||
mount_operation,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_remount_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_mount_remount_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_eject_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_mount_can_eject(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_eject_with_operation(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return unmount_eject_method(g_mount_eject_with_operation, argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_eject_with_operation_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_mount_eject_with_operation_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_content_type(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbforce_rescan, rbcancellable, block;
|
||||
gboolean force_rescan;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "02&", &rbforce_rescan, &rbcancellable, &block);
|
||||
force_rescan = RVAL2CBOOL(rbforce_rescan);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_mount_guess_content_type(_SELF(self),
|
||||
force_rescan,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_content_type_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gchar **content_types;
|
||||
|
||||
content_types = g_mount_guess_content_type_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (content_types == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return STRV2RVAL_FREE(content_types);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_content_type_sync(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE force_rescan, cancellable;
|
||||
GError *error = NULL;
|
||||
gchar **content_types;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &force_rescan, &cancellable);
|
||||
content_types = g_mount_guess_content_type_sync(_SELF(self),
|
||||
RVAL2CBOOL(force_rescan),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (content_types == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return STRV2RVAL_FREE(content_types);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_shadowed_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_mount_is_shadowed(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_shadow(VALUE self)
|
||||
{
|
||||
g_mount_shadow(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_unshadow(VALUE self)
|
||||
{
|
||||
g_mount_unshadow(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gmount(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_MOUNT, "Mount", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_MOUNT_MOUNT_FLAGS, "MountFlags", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_MOUNT_MOUNT_FLAGS, "G_MOUNT_");
|
||||
|
||||
G_DEF_CLASS(G_TYPE_MOUNT_UNMOUNT_FLAGS, "UnmountFlags", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_MOUNT_UNMOUNT_FLAGS, "G_MOUNT_");
|
||||
|
||||
RG_DEF_METHOD(name, 0);
|
||||
RG_DEF_METHOD(uuid, 0);
|
||||
RG_DEF_METHOD(icon, 0);
|
||||
RG_DEF_METHOD(drive, 0);
|
||||
RG_DEF_METHOD(root, 0);
|
||||
RG_DEF_METHOD(volume, 0);
|
||||
RG_DEF_METHOD(default_location, 0);
|
||||
RG_DEF_METHOD_P(can_unmount, 0);
|
||||
RG_DEF_METHOD(unmount_with_operation, -1);
|
||||
RG_DEF_METHOD(unmount_with_operation_finish, 1);
|
||||
RG_DEF_METHOD(remount, -1);
|
||||
RG_DEF_METHOD(remount_finish, 1);
|
||||
RG_DEF_METHOD_P(can_eject, 0);
|
||||
RG_DEF_METHOD(eject_with_operation, -1);
|
||||
RG_DEF_METHOD(eject_with_operation_finish, 1);
|
||||
RG_DEF_METHOD(guess_content_type, -1);
|
||||
RG_DEF_METHOD(guess_content_type_finish, 1);
|
||||
RG_DEF_METHOD(guess_content_type_sync, -1);
|
||||
RG_DEF_METHOD_P(shadowed, 0);
|
||||
RG_DEF_METHOD(shadow, 0);
|
||||
RG_DEF_METHOD(unshadow, 0);
|
||||
}
|
53
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomountoperation.c
Normal file
53
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiomountoperation.c
Normal file
@ -0,0 +1,53 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cMountOperation
|
||||
#define _SELF(value) RVAL2GMOUNTOPERATION(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self)
|
||||
{
|
||||
G_INITIALIZE(self, g_mount_operation_new());
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_reply(VALUE self, VALUE value)
|
||||
{
|
||||
g_mount_operation_reply(_SELF(self), RVAL2GMOUNTOPERATIONRESULT(value));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gmountoperation(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MOUNT_OPERATION, "MountOperation", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_MOUNT_OPERATION_RESULT, "Result", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_MOUNT_OPERATION_RESULT, "G_MOUNT_OPERATION_");
|
||||
|
||||
RG_DEF_METHOD(initialize, 0);
|
||||
RG_DEF_METHOD(reply, 1);
|
||||
}
|
59
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgionetworkaddress.c
Normal file
59
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgionetworkaddress.c
Normal file
@ -0,0 +1,59 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cNetworkAddress
|
||||
#define _SELF(value) RVAL2GNETWORKADDRESS(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE hostname, VALUE port)
|
||||
{
|
||||
G_INITIALIZE(self, g_network_address_new(RVAL2CSTR(hostname),
|
||||
RVAL2GUINT16(port)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE host_and_port, VALUE default_port)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GSocketConnectable *connectable;
|
||||
|
||||
connectable = g_network_address_parse(RVAL2CSTR(host_and_port),
|
||||
RVAL2GUINT16(default_port),
|
||||
&error);
|
||||
if (connectable == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(connectable);
|
||||
}
|
||||
|
||||
void
|
||||
Init_gnetworkaddress(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_NETWORK_ADDRESS, "NetworkAddress", mGio);
|
||||
|
||||
RG_DEF_SMETHOD(parse, 2);
|
||||
|
||||
RG_DEF_METHOD(initialize, 2);
|
||||
}
|
45
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgionetworkservice.c
Normal file
45
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgionetworkservice.c
Normal file
@ -0,0 +1,45 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cNetworkService
|
||||
#define _SELF(value) RVAL2GNETWORKSERVICE(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE service, VALUE protocol, VALUE domain)
|
||||
{
|
||||
/* TODO: If these are infected, so should they be when returned. How
|
||||
* do we deal with that? */
|
||||
G_INITIALIZE(self, g_network_service_new(RVAL2CSTR(service),
|
||||
RVAL2CSTR(protocol),
|
||||
RVAL2CSTR(domain)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gnetworkservice(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_NETWORK_SERVICE, "NetworkService", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 3);
|
||||
}
|
331
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiooutputstream.c
Normal file
331
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiooutputstream.c
Normal file
@ -0,0 +1,331 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cOutputStream
|
||||
#define _SELF(value) RVAL2GOUTPUTSTREAM(value)
|
||||
|
||||
#define RVAL2GOUTPUTSTREAMSPLICEFLAGSDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), \
|
||||
RVAL2GOUTPUTSTREAMSPLICEFLAGS, \
|
||||
G_OUTPUT_STREAM_SPLICE_NONE)
|
||||
|
||||
static VALUE
|
||||
rg_write(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbbuffer, cancellable;
|
||||
const char *buffer;
|
||||
GError *error = NULL;
|
||||
gssize bytes_written;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbbuffer, &cancellable);
|
||||
buffer = RVAL2CSTR(rbbuffer);
|
||||
bytes_written = g_output_stream_write(_SELF(self),
|
||||
buffer,
|
||||
(gsize)RSTRING_LEN(rbbuffer),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (bytes_written == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSSIZE2RVAL(bytes_written);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_write_all(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbbuffer, cancellable;
|
||||
const char *buffer;
|
||||
gsize bytes_written;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbbuffer, &cancellable);
|
||||
buffer = RVAL2CSTR(rbbuffer);
|
||||
if (!g_output_stream_write_all(_SELF(self),
|
||||
buffer,
|
||||
(gsize)RSTRING_LEN(rbbuffer),
|
||||
&bytes_written,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSIZE2RVAL(bytes_written);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_splice(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE source, flags, cancellable;
|
||||
GError *error = NULL;
|
||||
gssize bytes_spliced;
|
||||
|
||||
rb_scan_args(argc, argv, "12", &source, &flags, &cancellable);
|
||||
bytes_spliced = g_output_stream_splice(_SELF(self),
|
||||
RVAL2GINPUTSTREAM(source),
|
||||
RVAL2GOUTPUTSTREAMSPLICEFLAGSDEFAULT(flags),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (bytes_spliced == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSSIZE2RVAL(bytes_spliced);
|
||||
}
|
||||
|
||||
typedef gboolean (*CancellableMethod)(GOutputStream *, GCancellable *, GError **);
|
||||
|
||||
static VALUE
|
||||
cancellable_method(CancellableMethod method, int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
if (!method(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_flush(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return cancellable_method(g_output_stream_flush, argc, argv, self);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
return cancellable_method(g_output_stream_close, argc, argv, self);
|
||||
}
|
||||
|
||||
/* TODO: Does it make sense to use buffer and count? We should probably
|
||||
* provide a better wrapper that simply pumps out buffer while count hasn't
|
||||
* been reached, calling the callback with the bytes written, then with the
|
||||
* result. */
|
||||
static VALUE
|
||||
rg_write_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbbuffer, rbcount, rbio_priority, rbcancellable, block;
|
||||
const gchar *buffer;
|
||||
gsize count;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "22&", &rbbuffer, &rbcount, &rbio_priority, &rbcancellable, &block);
|
||||
buffer = RVAL2CSTR(rbbuffer);
|
||||
count = RVAL2GSIZE(rbcount);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_output_stream_write_async(_SELF(self),
|
||||
buffer,
|
||||
count,
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
typedef gssize (*SSizeFinishMethod)(GOutputStream *, GAsyncResult *, GError **);
|
||||
|
||||
static VALUE
|
||||
ssize_finish_method(SSizeFinishMethod method, VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gssize bytes_read;
|
||||
|
||||
bytes_read = method(_SELF(self), RVAL2GASYNCRESULT(result), &error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSSIZE2RVAL(bytes_read);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_write_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return ssize_finish_method(g_output_stream_write_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_splice_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbsource, rbflags, rbio_priority, rbcancellable, block;
|
||||
GInputStream *source;
|
||||
GOutputStreamSpliceFlags flags;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "12&", &rbsource, &rbflags, &rbio_priority, &rbcancellable, &block);
|
||||
source = RVAL2GINPUTSTREAM(rbsource);
|
||||
flags = RVAL2GOUTPUTSTREAMSPLICEFLAGSDEFAULT(rbflags);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_output_stream_splice_async(_SELF(self),
|
||||
source,
|
||||
flags,
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_splice_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return ssize_finish_method(g_output_stream_splice_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_flush_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbio_priority, rbcancellable, block;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_output_stream_flush_async(_SELF(self),
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
typedef gboolean (*BooleanFinishMethod)(GOutputStream *, GAsyncResult *, GError **);
|
||||
|
||||
static VALUE
|
||||
boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_flush_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_output_stream_flush_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbio_priority, rbcancellable, block;
|
||||
int io_priority;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block);
|
||||
io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_output_stream_close_async(_SELF(self),
|
||||
io_priority,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_output_stream_close_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_closing_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_output_stream_is_closing(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_closed_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_output_stream_is_closed(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_has_pending_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_output_stream_has_pending(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_pending(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_output_stream_set_pending(_SELF(self), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_clear_pending(VALUE self)
|
||||
{
|
||||
g_output_stream_clear_pending(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_goutputstream(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_OUTPUT_STREAM, "OutputStream", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS, "SpliceFlags", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS, "G_OUTPUT_STREAM_");
|
||||
|
||||
RG_DEF_METHOD(write, -1);
|
||||
RG_DEF_METHOD(write_all, -1);
|
||||
RG_DEF_METHOD(splice, -1);
|
||||
RG_DEF_METHOD(flush, -1);
|
||||
RG_DEF_METHOD(close, -1);
|
||||
RG_DEF_METHOD(write_async, -1);
|
||||
RG_DEF_METHOD(write_finish, 1);
|
||||
RG_DEF_METHOD(splice_async, -1);
|
||||
RG_DEF_METHOD(splice_finish, 1);
|
||||
RG_DEF_METHOD(flush_async, -1);
|
||||
RG_DEF_METHOD(flush_finish, 1);
|
||||
RG_DEF_METHOD(close_async, -1);
|
||||
RG_DEF_METHOD(close_finish, 0);
|
||||
RG_DEF_METHOD_P(closing, 0);
|
||||
RG_DEF_METHOD_P(closed, 0);
|
||||
RG_DEF_METHOD_P(has_pending, 0);
|
||||
RG_DEF_METHOD(set_pending, 0);
|
||||
RG_DEF_METHOD(clear_pending, 0);
|
||||
}
|
230
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioresolver.c
Normal file
230
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioresolver.c
Normal file
@ -0,0 +1,230 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cResolver
|
||||
#define _SELF(value) RVAL2GRESOLVER(value)
|
||||
|
||||
static VALUE
|
||||
rg_s_default(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_resolver_get_default());
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_set_default(G_GNUC_UNUSED VALUE self, VALUE resolver)
|
||||
{
|
||||
g_resolver_set_default(_SELF(resolver));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup_by_name(VALUE self, VALUE hostname, VALUE cancellable)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GList *addresses;
|
||||
|
||||
addresses = g_resolver_lookup_by_name(_SELF(self),
|
||||
RVAL2CSTR(hostname),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (addresses == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GLIST2ARY_UNREF_FREE(addresses);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup_by_name_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbhostname, rbcancellable, block;
|
||||
const gchar *hostname;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "11&", &hostname, &rbcancellable, &block);
|
||||
hostname = RVAL2CSTR(rbhostname);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_resolver_lookup_by_name_async(_SELF(self),
|
||||
hostname,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup_by_name_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GList *addresses;
|
||||
|
||||
addresses = g_resolver_lookup_by_name_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (addresses == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GLIST2ARY_UNREF_FREE(addresses);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup_by_address(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE address, cancellable;
|
||||
GError *error = NULL;
|
||||
gchar *hostname;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &address, &cancellable);
|
||||
hostname = g_resolver_lookup_by_address(_SELF(self),
|
||||
RVAL2GINETADDRESS(address),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (hostname == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return CSTR2RVAL_FREE(hostname);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup_by_address_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbaddress, rbcancellable, block;
|
||||
GInetAddress *address;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "11&", &rbaddress, &rbcancellable, &block);
|
||||
address = RVAL2GINETADDRESS(rbaddress);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_resolver_lookup_by_address_async(_SELF(self),
|
||||
address,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup_by_address_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gchar *hostname;
|
||||
|
||||
hostname = g_resolver_lookup_by_address_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (hostname == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return CSTR2RVAL_FREE(hostname);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup_service(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE service, protocol, domain, cancellable;
|
||||
GError *error = NULL;
|
||||
GList *targets;
|
||||
|
||||
rb_scan_args(argc, argv, "31", &service, &protocol, &domain, &cancellable);
|
||||
targets = g_resolver_lookup_service(_SELF(self),
|
||||
RVAL2CSTR(service),
|
||||
RVAL2CSTR(protocol),
|
||||
RVAL2CSTR(domain),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (targets == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GLIST2ARY_UNREF_FREE(targets);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup_service_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbservice, rbprotocol, rbdomain, rbcancellable, block;
|
||||
const gchar *service;
|
||||
const gchar *protocol;
|
||||
const gchar *domain;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "31&", &rbservice, &rbprotocol, &rbdomain, &rbcancellable, &block);
|
||||
service = RVAL2CSTR(rbservice);
|
||||
protocol = RVAL2CSTR(rbprotocol);
|
||||
domain = RVAL2CSTR(rbdomain);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_resolver_lookup_service_async(_SELF(self),
|
||||
service,
|
||||
protocol,
|
||||
domain,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_lookup_service_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GList *targets;
|
||||
|
||||
targets = g_resolver_lookup_service_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error);
|
||||
if (targets == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GLIST2ARY_UNREF_FREE(targets);
|
||||
}
|
||||
|
||||
void
|
||||
Init_gresolver(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE, error;
|
||||
|
||||
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_RESOLVER, "Resolver", mGio);
|
||||
|
||||
RG_DEF_SMETHOD(default, 0);
|
||||
RG_DEF_SMETHOD(set_default, 1);
|
||||
|
||||
/* TODO: Taint result of these methods? */
|
||||
RG_DEF_METHOD(lookup_by_name, 2);
|
||||
RG_DEF_METHOD(lookup_by_name_async, -1);
|
||||
RG_DEF_METHOD(lookup_by_name_finish, 1);
|
||||
RG_DEF_METHOD(lookup_by_address, -1);
|
||||
RG_DEF_METHOD(lookup_by_address_async, -1);
|
||||
RG_DEF_METHOD(lookup_by_address_finish, 1);
|
||||
RG_DEF_METHOD(lookup_service, -1);
|
||||
RG_DEF_METHOD(lookup_service_async, -1);
|
||||
RG_DEF_METHOD(lookup_service_finish, 1);
|
||||
|
||||
error = rbgio_define_domain_error(RG_TARGET_NAMESPACE, "Error", G_RESOLVER_ERROR, "GResolverErrorEnum", rb_eIOError);
|
||||
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "NotFoundError", G_RESOLVER_ERROR_NOT_FOUND, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "TemporaryFailureError", G_RESOLVER_ERROR_TEMPORARY_FAILURE, error);
|
||||
rbgio_define_error(RG_TARGET_NAMESPACE, "InternalError", G_RESOLVER_ERROR_INTERNAL, error);
|
||||
}
|
91
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioseekable.c
Normal file
91
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgioseekable.c
Normal file
@ -0,0 +1,91 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mSeekable
|
||||
#define _SELF(value) RVAL2GSEEKABLE(value)
|
||||
|
||||
#define RVAL2GSEEKTYPEDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), NUM2INT, G_SEEK_CUR)
|
||||
|
||||
static VALUE
|
||||
rg_tell(VALUE self)
|
||||
{
|
||||
return GOFFSET2RVAL(g_seekable_tell(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_seek_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_seekable_can_seek(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_seek(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE offset, type, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "12", &offset, &type, &cancellable);
|
||||
if (!g_seekable_seek(_SELF(self),
|
||||
RVAL2GOFFSET(offset),
|
||||
RVAL2GSEEKTYPEDEFAULT(type),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_truncate_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_seekable_can_truncate(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_truncate(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE offset, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &offset, &cancellable);
|
||||
if (!g_seekable_truncate(_SELF(self),
|
||||
RVAL2GOFFSET(offset),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gseekable(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_SEEKABLE, "Seekable", mGio);
|
||||
|
||||
RG_DEF_METHOD(tell, 0);
|
||||
RG_DEF_METHOD_P(can_seek, 0);
|
||||
RG_DEF_METHOD(seek, -1);
|
||||
RG_DEF_METHOD_P(can_truncate, 0);
|
||||
RG_DEF_METHOD(truncate, -1);
|
||||
}
|
152
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosimpleasyncresult.c
Normal file
152
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosimpleasyncresult.c
Normal file
@ -0,0 +1,152 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cSimpleAsyncResult
|
||||
#define _SELF(value) RVAL2GSIMPLEASYNCRESULT(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE object)
|
||||
{
|
||||
VALUE block;
|
||||
|
||||
/* TODO: I have absolutely no idea if this makes sense. Should we even
|
||||
* be providing this method? */
|
||||
block = rb_block_proc();
|
||||
SAVE_BLOCK(block);
|
||||
G_INITIALIZE(self,
|
||||
g_simple_async_result_new(RVAL2GOBJ(object),
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block,
|
||||
(gpointer)block));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_new_error. */
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_new_from_error. */
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_set_op_res_gpointer. */
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_get_op_res_gpointer. */
|
||||
|
||||
static VALUE
|
||||
rg_set_op_res_gssize(VALUE self, VALUE op_res)
|
||||
{
|
||||
g_simple_async_result_set_op_res_gssize(_SELF(self),
|
||||
RVAL2GSSIZE(op_res));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_op_res_gssize(VALUE self)
|
||||
{
|
||||
return GSSIZE2RVAL(g_simple_async_result_get_op_res_gssize(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_op_res_gboolean(VALUE self, VALUE op_res)
|
||||
{
|
||||
g_simple_async_result_set_op_res_gboolean(_SELF(self),
|
||||
RVAL2CBOOL(op_res));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_op_res_gboolean(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_simple_async_result_get_op_res_gboolean(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_source_tag(VALUE self)
|
||||
{
|
||||
return (VALUE)g_simple_async_result_get_source_tag(_SELF(self));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_valid_p(VALUE self, VALUE source, VALUE source_tag)
|
||||
{
|
||||
return CBOOL2RVAL(g_simple_async_result_is_valid(RVAL2GASYNCRESULT(self),
|
||||
RVAL2GOBJ(source),
|
||||
(gpointer)source_tag));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_handle_cancellation(VALUE self, VALUE handle_cancellation)
|
||||
{
|
||||
g_simple_async_result_set_handle_cancellation(_SELF(self),
|
||||
RVAL2CBOOL(handle_cancellation));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_complete(VALUE self)
|
||||
{
|
||||
g_simple_async_result_complete(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_complete_in_idle(VALUE self)
|
||||
{
|
||||
g_simple_async_result_complete_in_idle(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/* TODO: Should we implement g_simple_async_result_run_in_thread? I'd say no,
|
||||
* but I'm not sure. */
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_set_from_error. */
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_propagate_error. */
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_set_error. */
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_set_error_va. */
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_report_error_in_idle. */
|
||||
|
||||
/* NOTE: Can't implement g_simple_async_result_report_gerror_in_idle. */
|
||||
|
||||
void
|
||||
Init_gsimpleasyncresult(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SIMPLE_ASYNC_RESULT, "SimpleAsyncResult", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 1);
|
||||
RG_DEF_METHOD(set_op_res_gssize, 1);
|
||||
RG_DEF_METHOD(op_res_gssize, 0);
|
||||
RG_DEF_METHOD(set_op_res_gboolean, 1);
|
||||
RG_DEF_METHOD(op_res_gboolean, 0);
|
||||
RG_DEF_METHOD(source_tag, 0);
|
||||
RG_DEF_METHOD_P(valid, 2);
|
||||
RG_DEF_METHOD(set_handle_cancellation, 1);
|
||||
RG_DEF_METHOD(complete, 0);
|
||||
RG_DEF_METHOD(complete_in_idle, 0);
|
||||
}
|
390
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocket.c
Normal file
390
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocket.c
Normal file
@ -0,0 +1,390 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011-2012 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cSocket
|
||||
#define _SELF(value) RVAL2GSOCKET(value)
|
||||
|
||||
static ID id_call;
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE family, type, protocol;
|
||||
GError *error = NULL;
|
||||
GSocket *socket;
|
||||
|
||||
rb_scan_args(argc, argv, "21", &family, &type, &protocol);
|
||||
socket = g_socket_new(RVAL2GSOCKETFAMILY(family),
|
||||
RVAL2GSOCKETTYPE(type),
|
||||
RVAL2GSOCKETPROTOCOLDEFAULT(protocol),
|
||||
&error);
|
||||
if (socket == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
G_INITIALIZE(self, socket);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_new_from_fd(G_GNUC_UNUSED VALUE self, VALUE id)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GSocket *socket;
|
||||
|
||||
socket = g_socket_new_from_fd(RVAL2FD(id), &error);
|
||||
if (socket == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(socket);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_bind(VALUE self, VALUE address, VALUE allow_reuse)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_socket_bind(_SELF(self),
|
||||
RVAL2GSOCKETADDRESS(address),
|
||||
RVAL2CBOOL(allow_reuse),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_listen(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_socket_listen(_SELF(self), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_accept(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
GSocket *socket;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
socket = g_socket_accept(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (socket == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE address, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &address, &cancellable);
|
||||
if (!g_socket_connect(_SELF(self),
|
||||
RVAL2GSOCKETADDRESS(address),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
/* TODO: This makes very little sense in Ruby. How do we deal with it? */
|
||||
static VALUE
|
||||
rg_check_connect_result(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_socket_check_connect_result(_SELF(self), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_receive(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbbytes, cancellable, result;
|
||||
GError *error = NULL;
|
||||
gsize bytes;
|
||||
gssize read;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbbytes, &cancellable);
|
||||
bytes = RVAL2GSIZE(rbbytes);
|
||||
result = rb_str_new(NULL, bytes);
|
||||
read = g_socket_receive(_SELF(self),
|
||||
RSTRING_PTR(result),
|
||||
bytes,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (read == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
/* TODO: This is what Ruby does, but I can't figure out why one needs
|
||||
* both. */
|
||||
rb_str_set_len(result, read);
|
||||
rb_str_resize(result, read);
|
||||
OBJ_TAINT(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_receive_from(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbbytes, cancellable, result;
|
||||
GSocketAddress *address;
|
||||
GError *error = NULL;
|
||||
gsize bytes;
|
||||
gssize read;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &rbbytes, &cancellable);
|
||||
bytes = RVAL2GSIZE(rbbytes);
|
||||
result = rb_str_new(NULL, bytes);
|
||||
read = g_socket_receive_from(_SELF(self),
|
||||
&address,
|
||||
RSTRING_PTR(result),
|
||||
bytes,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (read == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
rb_str_set_len(result, read);
|
||||
rb_str_resize(result, read);
|
||||
OBJ_TAINT(result);
|
||||
|
||||
return rb_assoc_new(GOBJ2RVAL_UNREF(address), result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_send(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE buffer, cancellable;
|
||||
GError *error = NULL;
|
||||
gssize sent;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &buffer, &cancellable);
|
||||
StringValue(buffer);
|
||||
sent = g_socket_send(_SELF(self),
|
||||
RSTRING_PTR(buffer),
|
||||
RSTRING_LEN(buffer),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (sent == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSSIZE2RVAL(sent);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_send_to(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE address, buffer, cancellable;
|
||||
GError *error = NULL;
|
||||
gssize sent;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &address, &buffer, &cancellable);
|
||||
StringValue(buffer);
|
||||
sent = g_socket_send_to(_SELF(self),
|
||||
RVAL2GSOCKETADDRESS(address),
|
||||
RSTRING_PTR(buffer),
|
||||
RSTRING_LEN(buffer),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (sent == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GSSIZE2RVAL(sent);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_socket_close(_SELF(self), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_closed_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_socket_is_closed(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_shutdown(VALUE self, VALUE shutdown_read, VALUE shutdown_write)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_socket_shutdown(_SELF(self),
|
||||
RVAL2CBOOL(shutdown_read),
|
||||
RVAL2CBOOL(shutdown_write),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connected_p(VALUE self)
|
||||
{
|
||||
return (g_socket_is_connected(_SELF(self)));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
source_func(GSocket *socket, GIOCondition condition, gpointer user_data)
|
||||
{
|
||||
VALUE callback = (VALUE)user_data;
|
||||
return RVAL2CBOOL(rb_funcall(callback, id_call, 2,
|
||||
GOBJ2RVAL(socket),
|
||||
GIOCONDITION2RVAL(condition)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_create_source(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE condition, cancellable, callback;
|
||||
GSource *source;
|
||||
|
||||
rb_scan_args(argc, argv, "11&", &condition, &cancellable, &callback);
|
||||
|
||||
source = g_socket_create_source(_SELF(self),
|
||||
RVAL2GIOCONDITION(condition),
|
||||
RVAL2GCANCELLABLE(cancellable));
|
||||
G_RELATIVE(self, callback);
|
||||
g_source_set_callback(source,
|
||||
(GSourceFunc)source_func,
|
||||
(gpointer)callback,
|
||||
NULL);
|
||||
return GSOURCE2RVAL(source);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_condition_check(VALUE self, VALUE condition)
|
||||
{
|
||||
return GIOCONDITION2RVAL(g_socket_condition_check(_SELF(self),
|
||||
RVAL2GIOCONDITION(condition)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_condition_wait(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE condition, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &condition, &cancellable);
|
||||
if (!g_socket_condition_wait(_SELF(self),
|
||||
RVAL2GIOCONDITION(condition),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
socket_get_local_address(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GSocketAddress *address;
|
||||
|
||||
address = g_socket_get_local_address(_SELF(self), &error);
|
||||
if (address == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(address);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
socket_get_remote_address(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GSocketAddress *address;
|
||||
|
||||
address = g_socket_get_remote_address(_SELF(self), &error);
|
||||
if (address == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(address);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_speaks_ipv4_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_socket_speaks_ipv4(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gsocket(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET, "Socket", mGio);
|
||||
|
||||
id_call = rb_intern("call");
|
||||
|
||||
G_DEF_CLASS(G_TYPE_SOCKET_FAMILY, "Family", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SOCKET_FAMILY, "G_SOCKET_");
|
||||
|
||||
G_DEF_CLASS(G_TYPE_SOCKET_TYPE, "Type", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SOCKET_TYPE, "G_SOCKET_");
|
||||
|
||||
G_DEF_CLASS(G_TYPE_SOCKET_PROTOCOL, "Protocol", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SOCKET_PROTOCOL, "G_SOCKET_");
|
||||
|
||||
G_DEF_CLASS(G_TYPE_SOCKET_MSG_FLAGS, "MsgFlags", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SOCKET_MSG_FLAGS, "G_SOCKET_");
|
||||
|
||||
RG_DEF_SMETHOD(new_from_fd, 1);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(bind, 2);
|
||||
RG_DEF_METHOD(listen, 0);
|
||||
RG_DEF_METHOD(accept, -1);
|
||||
RG_DEF_METHOD(connect, -1);
|
||||
RG_DEF_METHOD(check_connect_result, 0);
|
||||
RG_DEF_METHOD(receive, -1);
|
||||
RG_DEF_METHOD(receive_from, -1);
|
||||
RG_DEF_METHOD(send, -1);
|
||||
RG_DEF_METHOD(send_to, -1);
|
||||
RG_DEF_METHOD(close, 0);
|
||||
RG_DEF_METHOD_P(closed, 0);
|
||||
RG_DEF_METHOD(shutdown, 2);
|
||||
RG_DEF_METHOD_P(connected, 0);
|
||||
RG_DEF_METHOD(create_source, -1);
|
||||
RG_DEF_METHOD(condition_check, 1);
|
||||
RG_DEF_METHOD(condition_wait, -1);
|
||||
G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "local_address", socket_get_local_address, 0);
|
||||
G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "remote_address", socket_get_remote_address, 0);
|
||||
RG_DEF_METHOD_P(speaks_ipv4, 0);
|
||||
}
|
34
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketaddress.c
Normal file
34
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketaddress.c
Normal file
@ -0,0 +1,34 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
/* TODO: new_from_native? */
|
||||
|
||||
/* TODO: to_native? */
|
||||
|
||||
/* TODO: get_native_size? */
|
||||
|
||||
void
|
||||
Init_gsocketaddress(VALUE mGio)
|
||||
{
|
||||
(void)G_DEF_CLASS(G_TYPE_SOCKET_ADDRESS, "SocketAddress", mGio);
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cSocketAddressEnumerator
|
||||
#define _SELF(value) RVAL2GSOCKETADDRESSENUMERATOR(value)
|
||||
|
||||
static VALUE
|
||||
rg_next(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
GSocketAddress *address;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
address = g_socket_address_enumerator_next(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (error != NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL(address);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_next_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbcancellable, block;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "01&", &rbcancellable, &block);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_socket_address_enumerator_next_async(_SELF(self),
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_next_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GSocketAddress *address;
|
||||
|
||||
address = g_socket_address_enumerator_next_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&error);
|
||||
if (address == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL(address);
|
||||
}
|
||||
|
||||
void
|
||||
Init_gsocketaddressenumerator(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_ADDRESS_ENUMERATOR, "SocketAddressEnumerator", mGio);
|
||||
|
||||
RG_DEF_METHOD(next, -1);
|
||||
RG_DEF_METHOD(next_async, -1);
|
||||
RG_DEF_METHOD(next_finish, 1);
|
||||
}
|
207
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketclient.c
Normal file
207
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketclient.c
Normal file
@ -0,0 +1,207 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cSocketClient
|
||||
#define _SELF(value) RVAL2GSOCKETCLIENT(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self)
|
||||
{
|
||||
G_INITIALIZE(self, g_socket_client_new());
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE connectable, cancellable;
|
||||
GError *error = NULL;
|
||||
GSocketConnection *connection;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &connectable, &cancellable);
|
||||
connection = g_socket_client_connect(_SELF(self),
|
||||
RVAL2GSOCKETCONNECTABLE(connectable),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (connection == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(connection);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbconnectable, rbcancellable, block;
|
||||
GCancellable *cancellable;
|
||||
GSocketConnectable *connectable;
|
||||
|
||||
rb_scan_args(argc, argv, "11&", &rbconnectable, &rbcancellable, &block);
|
||||
connectable = RVAL2GSOCKETCONNECTABLE(rbconnectable);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_socket_client_connect_async(_SELF(self),
|
||||
connectable,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
typedef GSocketConnection *(*ConnectionFinishMethod)(GSocketClient *,
|
||||
GAsyncResult *,
|
||||
GError **);
|
||||
|
||||
static VALUE
|
||||
connection_finish_method(ConnectionFinishMethod method, VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GSocketConnection *connection;
|
||||
|
||||
connection = method(_SELF(self), RVAL2GASYNCRESULT(result), &error);
|
||||
if (connection == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(connection);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return connection_finish_method(g_socket_client_connect_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect_to_host(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE host_and_port, default_port, cancellable;
|
||||
GError *error = NULL;
|
||||
GSocketConnection *connection;
|
||||
|
||||
rb_scan_args(argc, argv, "21", &host_and_port, &default_port, &cancellable);
|
||||
connection = g_socket_client_connect_to_host(_SELF(self),
|
||||
RVAL2CSTR(host_and_port),
|
||||
RVAL2GUINT16(default_port),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (connection == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(connection);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect_to_host_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbhost_and_port, rbdefault_port, rbcancellable, block;
|
||||
GCancellable *cancellable;
|
||||
const gchar *host_and_port;
|
||||
guint16 default_port;
|
||||
|
||||
rb_scan_args(argc, argv, "21&", &rbhost_and_port, &rbdefault_port, &rbcancellable, &block);
|
||||
host_and_port = RVAL2CSTR(rbhost_and_port);
|
||||
default_port = RVAL2GUINT16(rbdefault_port);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_socket_client_connect_to_host_async(_SELF(self),
|
||||
host_and_port,
|
||||
default_port,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect_to_host_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return connection_finish_method(g_socket_client_connect_to_host_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect_to_service(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE domain, service, cancellable;
|
||||
GError *error = NULL;
|
||||
GSocketConnection *connection;
|
||||
|
||||
rb_scan_args(argc, argv, "21", &domain, &service, &cancellable);
|
||||
connection = g_socket_client_connect_to_service(_SELF(self),
|
||||
RVAL2CSTR(domain),
|
||||
RVAL2CSTR(service),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (connection == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(connection);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect_to_service_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbdomain, rbservice, rbcancellable, block;
|
||||
GCancellable *cancellable;
|
||||
const gchar *domain;
|
||||
const gchar *service;
|
||||
|
||||
rb_scan_args(argc, argv, "21&", &domain, &service, &rbcancellable, &block);
|
||||
domain = RVAL2CSTR(rbdomain);
|
||||
service = RVAL2CSTR(rbservice);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_socket_client_connect_to_service_async(_SELF(self),
|
||||
domain,
|
||||
service,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connect_to_service_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return connection_finish_method(g_socket_client_connect_to_service_finish, self, result);
|
||||
}
|
||||
|
||||
void
|
||||
Init_gsocketclient(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_CLIENT, "SocketClient", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 0);
|
||||
RG_DEF_METHOD(connect, -1);
|
||||
RG_DEF_METHOD(connect_async, -1);
|
||||
RG_DEF_METHOD(connect_finish, 1);
|
||||
RG_DEF_METHOD(connect_to_host, -1);
|
||||
RG_DEF_METHOD(connect_to_host_async, -1);
|
||||
RG_DEF_METHOD(connect_to_host_finish, 1);
|
||||
RG_DEF_METHOD(connect_to_service, -1);
|
||||
RG_DEF_METHOD(connect_to_service_async, -1);
|
||||
RG_DEF_METHOD(connect_to_service_finish, 1);
|
||||
}
|
41
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketconnectable.c
Normal file
41
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketconnectable.c
Normal file
@ -0,0 +1,41 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mSocketConnectable
|
||||
#define _SELF(value) RVAL2GSOCKETCONNECTABLE(value)
|
||||
|
||||
static VALUE
|
||||
rg_enumerate(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL(g_socket_connectable_enumerate(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gsocketconnectable(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_SOCKET_CONNECTABLE, "SocketConnectable", mGio);
|
||||
|
||||
RG_DEF_METHOD(enumerate, 0);
|
||||
}
|
66
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketconnection.c
Normal file
66
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketconnection.c
Normal file
@ -0,0 +1,66 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cSocketConnection
|
||||
#define _SELF(value) RVAL2GSOCKETCONNECTION(value)
|
||||
|
||||
static VALUE
|
||||
rg_local_address(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GSocketAddress *address;
|
||||
|
||||
address = g_socket_connection_get_local_address(_SELF(self), &error);
|
||||
if (address == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(address);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_remote_address(VALUE self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GSocketAddress *address;
|
||||
|
||||
address = g_socket_connection_get_remote_address(_SELF(self), &error);
|
||||
if (address == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(address);
|
||||
}
|
||||
|
||||
/* TODO: lookup_type */
|
||||
|
||||
/* TODO: register_type */
|
||||
|
||||
void
|
||||
Init_gsocketconnection(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_CONNECTION, "SocketConnection", mGio);
|
||||
|
||||
RG_DEF_METHOD(local_address, 0);
|
||||
RG_DEF_METHOD(remote_address, 0);
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mSocketConnectionFactory
|
||||
|
||||
static VALUE
|
||||
rg_s_create_connection(G_GNUC_UNUSED VALUE self, VALUE socket)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_socket_connection_factory_create_connection(RVAL2GSOCKET(socket)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gsocketconnectionfactory(VALUE mGio)
|
||||
{
|
||||
/* TODO: Perhaps just move this to SocketConnection? */
|
||||
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "SocketConnectionFactory");
|
||||
|
||||
RG_DEF_SMETHOD(create_connection, 1);
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cSocketControlMessage
|
||||
#define _SELF(value) RVAL2GSOCKETCONTROLMESSAGE(value)
|
||||
|
||||
static VALUE
|
||||
rg_s_deserialize(G_GNUC_UNUSED VALUE self, VALUE level, VALUE type, VALUE data)
|
||||
{
|
||||
StringValue(data);
|
||||
return GOBJ2RVAL(g_socket_control_message_deserialize(FIX2INT(level),
|
||||
FIX2INT(type),
|
||||
RSTRING_LEN(data),
|
||||
RSTRING_PTR(data)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_level(VALUE self)
|
||||
{
|
||||
return INT2FIX(g_socket_control_message_get_level(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_msg_type(VALUE self)
|
||||
{
|
||||
return INT2FIX(g_socket_control_message_get_msg_type(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_size(VALUE self)
|
||||
{
|
||||
return GSIZE2RVAL(g_socket_control_message_get_size(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_serialize(VALUE self)
|
||||
{
|
||||
gsize size;
|
||||
VALUE result;
|
||||
|
||||
/* TODO: Is tainting really necessary? Where does the message come
|
||||
* from? */
|
||||
size = g_socket_control_message_get_size(_SELF(self));
|
||||
result = rb_str_new(NULL, size);
|
||||
g_socket_control_message_serialize(_SELF(self), RSTRING_PTR(result));
|
||||
OBJ_TAINT(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gsocketcontrolmessage(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_CONTROL_MESSAGE, "SocketControlMessage", mGio);
|
||||
|
||||
RG_DEF_SMETHOD(deserialize, 3);
|
||||
|
||||
RG_DEF_METHOD(level, 0);
|
||||
RG_DEF_METHOD(msg_type, 0);
|
||||
RG_DEF_METHOD(size, 0);
|
||||
RG_DEF_METHOD(serialize, 0);
|
||||
}
|
246
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketlistener.c
Normal file
246
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketlistener.c
Normal file
@ -0,0 +1,246 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cSocketListener
|
||||
#define _SELF(value) RVAL2GSOCKETLISTENER(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self)
|
||||
{
|
||||
G_INITIALIZE(self, g_socket_listener_new());
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_add_socket(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE socket, source_object;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &socket, &source_object);
|
||||
if (!g_socket_listener_add_socket(_SELF(self), RVAL2GSOCKET(socket),
|
||||
RVAL2GOBJ(source_object), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_add_address(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbaddress, type, protocol, source_object;
|
||||
GError *error = NULL;
|
||||
GSocketAddress *address;
|
||||
|
||||
rb_scan_args(argc, argv, "22", &rbaddress, &type, &protocol, &source_object);
|
||||
if (!g_socket_listener_add_address(_SELF(self),
|
||||
RVAL2GSOCKETADDRESS(rbaddress),
|
||||
RVAL2GSOCKETTYPE(type),
|
||||
RVAL2GSOCKETPROTOCOLDEFAULT(protocol),
|
||||
RVAL2GOBJ(source_object),
|
||||
&address,
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(address);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_add_inet_port(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE port, source_object;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &port, &source_object);
|
||||
if (!g_socket_listener_add_inet_port(_SELF(self),
|
||||
RVAL2GUINT16(port),
|
||||
RVAL2GOBJ(source_object),
|
||||
&error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_add_any_inet_port(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE source_object;
|
||||
GError *error = NULL;
|
||||
guint16 port;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &source_object);
|
||||
port = g_socket_listener_add_any_inet_port(_SELF(self),
|
||||
RVAL2GOBJ(source_object),
|
||||
&error);
|
||||
if (port == 0)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_accept(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GObject *source_object;
|
||||
GError *error = NULL;
|
||||
GSocketConnection *connection;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
connection = g_socket_listener_accept(_SELF(self),
|
||||
&source_object,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (connection == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return rb_assoc_new(GOBJ2RVAL_UNREF(connection),
|
||||
GOBJ2RVAL(source_object));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_accept_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbcancellable, block;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "01&", &rbcancellable, &block);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_socket_listener_accept_async(_SELF(self),
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_accept_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GObject *source_object;
|
||||
GError *error = NULL;
|
||||
GSocketConnection *connection;
|
||||
|
||||
connection = g_socket_listener_accept_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&source_object,
|
||||
&error);
|
||||
if (connection == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return rb_assoc_new(GOBJ2RVAL_UNREF(connection),
|
||||
GOBJ2RVAL(source_object));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_accept_socket(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GObject *source_object;
|
||||
GError *error = NULL;
|
||||
GSocket *socket;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
socket = g_socket_listener_accept_socket(_SELF(self),
|
||||
&source_object,
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (socket == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return rb_assoc_new(GOBJ2RVAL_UNREF(socket),
|
||||
GOBJ2RVAL(source_object));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_accept_socket_async(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbcancellable, block;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "01&", &rbcancellable, &block);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_socket_listener_accept_socket_async(_SELF(self),
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_accept_socket_finish(VALUE self, VALUE result)
|
||||
{
|
||||
GObject *source_object;
|
||||
GError *error = NULL;
|
||||
GSocket *socket;
|
||||
|
||||
socket = g_socket_listener_accept_socket_finish(_SELF(self),
|
||||
RVAL2GASYNCRESULT(result),
|
||||
&source_object,
|
||||
&error);
|
||||
if (socket == NULL)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return rb_assoc_new(GOBJ2RVAL_UNREF(socket),
|
||||
GOBJ2RVAL(source_object));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_close(VALUE self)
|
||||
{
|
||||
g_socket_listener_close(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_backlog(VALUE self, VALUE listen_backlog)
|
||||
{
|
||||
g_socket_listener_set_backlog(_SELF(self), FIX2INT(listen_backlog));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gsocketlistener(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_LISTENER, "SocketListener", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 0);
|
||||
RG_DEF_METHOD(add_socket, -1);
|
||||
RG_DEF_METHOD(add_address, -1);
|
||||
RG_DEF_METHOD(add_inet_port, -1);
|
||||
RG_DEF_METHOD(add_any_inet_port, -1);
|
||||
RG_DEF_METHOD(accept, -1);
|
||||
RG_DEF_METHOD(accept_async, -1);
|
||||
RG_DEF_METHOD(accept_finish, 1);
|
||||
RG_DEF_METHOD(accept_socket, -1);
|
||||
RG_DEF_METHOD(accept_socket_async, -1);
|
||||
RG_DEF_METHOD(accept_socket_finish, 1);
|
||||
RG_DEF_METHOD(close, 0);
|
||||
RG_DEF_METHOD(set_backlog, 1);
|
||||
}
|
66
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketservice.c
Normal file
66
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosocketservice.c
Normal file
@ -0,0 +1,66 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cSocketService
|
||||
#define _SELF(value) RVAL2GSOCKETSERVICE(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self)
|
||||
{
|
||||
G_INITIALIZE(self, g_socket_service_new());
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_start(VALUE self)
|
||||
{
|
||||
g_socket_service_start(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_stop(VALUE self)
|
||||
{
|
||||
g_socket_service_stop(_SELF(self));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_active_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_socket_service_is_active(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gsocketservice(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_SERVICE, "SocketService", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 0);
|
||||
RG_DEF_METHOD(start, 0);
|
||||
RG_DEF_METHOD(stop, 0);
|
||||
RG_DEF_METHOD_P(active, 0);
|
||||
}
|
76
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosrvtarget.c
Normal file
76
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiosrvtarget.c
Normal file
@ -0,0 +1,76 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cSrvTarget
|
||||
#define _SELF(value) RVAL2GSRVTARGET(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE hostname, VALUE port, VALUE priority, VALUE weight)
|
||||
{
|
||||
/* TODO: Does this work with boxed? */
|
||||
/* TODO: hostname should be infected when returned. */
|
||||
G_INITIALIZE(self, g_srv_target_new(RVAL2CSTR(hostname),
|
||||
RVAL2GUINT16(port),
|
||||
RVAL2GUINT16(priority),
|
||||
RVAL2GUINT16(weight)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_hostname(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_srv_target_get_hostname(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_port(VALUE self)
|
||||
{
|
||||
return GUINT162RVAL(g_srv_target_get_port(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_priority(VALUE self)
|
||||
{
|
||||
return GUINT162RVAL(g_srv_target_get_priority(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_weight(VALUE self)
|
||||
{
|
||||
return GUINT162RVAL(g_srv_target_get_weight(_SELF(self)));
|
||||
}
|
||||
|
||||
/* TODO: srvtarget_list_sort */
|
||||
|
||||
void
|
||||
Init_gsrvtarget(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SRV_TARGET, "SrvTarget", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, 4);
|
||||
RG_DEF_METHOD(hostname, 0);
|
||||
RG_DEF_METHOD(port, 0);
|
||||
RG_DEF_METHOD(priority, 0);
|
||||
RG_DEF_METHOD(weight, 0);
|
||||
}
|
28
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiotcpconnection.c
Normal file
28
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiotcpconnection.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
void
|
||||
Init_gtcpconnection(VALUE mGio)
|
||||
{
|
||||
(void)G_DEF_CLASS(G_TYPE_TCP_CONNECTION, "TcpConnection", mGio);
|
||||
}
|
83
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiothemedicon.c
Normal file
83
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiothemedicon.c
Normal file
@ -0,0 +1,83 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mThemedIcon
|
||||
#define _SELF(value) RVAL2GTHEMEDICON(value)
|
||||
|
||||
/* TODO: Is this unnecessarily complicated? */
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE iconnames, with_default_fallbacks;
|
||||
GIcon *icon;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &iconnames, &with_default_fallbacks);
|
||||
|
||||
if (TYPE(iconnames) != T_ARRAY) {
|
||||
const char *iconname = RVAL2CSTR(iconnames);
|
||||
|
||||
icon = RVAL2CBOOL(with_default_fallbacks) ?
|
||||
g_themed_icon_new_with_default_fallbacks(iconname) :
|
||||
g_themed_icon_new(iconname);
|
||||
|
||||
G_INITIALIZE(self, icon);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
if (argc > 1)
|
||||
rb_raise(rb_eArgError,
|
||||
"only one argument allowed when first argument is an Array");
|
||||
|
||||
icon = g_themed_icon_new_from_names(RVAL2STRV_DUP(iconnames), -1);
|
||||
|
||||
G_INITIALIZE(self, icon);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_prepend_name(VALUE self, VALUE iconname)
|
||||
{
|
||||
g_themed_icon_prepend_name(_SELF(self), RVAL2CSTR(iconname));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_append_name(VALUE self, VALUE iconname)
|
||||
{
|
||||
g_themed_icon_append_name(_SELF(self), RVAL2CSTR(iconname));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gthemedicon(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_THEMED_ICON, "ThemedIcon", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(prepend_name, 1);
|
||||
RG_DEF_METHOD(append_name, 1);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cThreadedSocketService
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE max_threads)
|
||||
{
|
||||
G_INITIALIZE(self,
|
||||
g_threaded_socket_service_new(RVAL2TYPE_WITH_DEFAULT(max_threads,
|
||||
RVAL2GINT,
|
||||
10)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gthreadedsocketservice(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_THREADED_SOCKET_SERVICE, "ThreadedSocketService", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
}
|
89
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiotlscertificate.c
Normal file
89
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiotlscertificate.c
Normal file
@ -0,0 +1,89 @@
|
||||
/* -*- 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cTlsCertificate
|
||||
#define _SELF(value) RVAL2GOBJ(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE data)
|
||||
{
|
||||
GTlsCertificate *certificate;
|
||||
GError *error = NULL;
|
||||
|
||||
certificate = g_tls_certificate_new_from_pem(StringValuePtr(data),
|
||||
RSTRING_LEN(data),
|
||||
&error);
|
||||
if (error)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
G_INITIALIZE(self, certificate);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_load(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
VALUE cert_file, key_file;
|
||||
GError *error = NULL;
|
||||
GTlsCertificate *certificate;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &cert_file, &key_file);
|
||||
if (NIL_P(key_file)) {
|
||||
certificate = g_tls_certificate_new_from_file(StringValuePtr(cert_file),
|
||||
&error);
|
||||
} else {
|
||||
certificate = g_tls_certificate_new_from_files(StringValuePtr(cert_file),
|
||||
StringValuePtr(key_file),
|
||||
&error);
|
||||
}
|
||||
|
||||
if (error)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return GOBJ2RVAL_UNREF(certificate);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_verify(VALUE self, VALUE identity, VALUE trusted_ca)
|
||||
{
|
||||
GTlsCertificateFlags flags;
|
||||
|
||||
flags = g_tls_certificate_verify(_SELF(self),
|
||||
RVAL2GOBJ(identity),
|
||||
RVAL2GOBJ(trusted_ca));
|
||||
return GFLAGS2RVAL(flags, G_TYPE_TLS_CERTIFICATE_FLAGS);
|
||||
}
|
||||
|
||||
void
|
||||
Init_gtlscertificate(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_TLS_CERTIFICATE,
|
||||
"TlsCertificate", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_TLS_CERTIFICATE_FLAGS, "TlsCertificateFlags", mGio);
|
||||
|
||||
RG_DEF_SMETHOD(load, -1);
|
||||
|
||||
RG_DEF_METHOD(initialize, 1);
|
||||
RG_DEF_METHOD(verify, 2);
|
||||
}
|
71
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixconnection.c
Normal file
71
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixconnection.c
Normal file
@ -0,0 +1,71 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixconnection.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE cUnixConnection
|
||||
#define _SELF(value) RVAL2GUNIXCONNECTION(value)
|
||||
|
||||
static VALUE
|
||||
rg_receive_fd(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE cancellable;
|
||||
GError *error = NULL;
|
||||
gint fd;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &cancellable);
|
||||
fd = g_unix_connection_receive_fd(_SELF(self),
|
||||
RVAL2GCANCELLABLE(cancellable),
|
||||
&error);
|
||||
if (fd == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return FD2RVAL(fd);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_send_fd(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE fd, cancellable;
|
||||
GError *error = NULL;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &fd, &cancellable);
|
||||
if (!g_unix_connection_send_fd(_SELF(self), RVAL2FD(fd),
|
||||
RVAL2GCANCELLABLE(cancellable), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixconnection(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_CONNECTION, "UnixConnection", mGio);
|
||||
|
||||
RG_DEF_METHOD(receive_fd, -1);
|
||||
RG_DEF_METHOD(send_fd, -1);
|
||||
#endif
|
||||
}
|
115
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixfdlist.c
Normal file
115
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixfdlist.c
Normal file
@ -0,0 +1,115 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixfdlist.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE cUnixFDList
|
||||
#define _SELF(value) RVAL2GUNIXFDLIST(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbfds;
|
||||
long n;
|
||||
gint *fds;
|
||||
GUnixFDList *list;
|
||||
|
||||
rb_scan_args(argc, argv, "0*", &rbfds);
|
||||
fds = RVAL2FDS(rbfds, n);
|
||||
if (n == 0) {
|
||||
G_INITIALIZE(self, g_unix_fd_list_new());
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
list = g_unix_fd_list_new_from_array(fds, n);
|
||||
|
||||
g_free(fds);
|
||||
|
||||
G_INITIALIZE(self, list);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_length(VALUE self)
|
||||
{
|
||||
return GINT2RVAL(g_unix_fd_list_get_length(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get(VALUE self, VALUE index)
|
||||
{
|
||||
GError *error = NULL;
|
||||
gint fd;
|
||||
|
||||
fd = g_unix_fd_list_get(_SELF(self), RVAL2GINT(index), &error);
|
||||
if (fd == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
/* TODO: This fd must be closed properly. How do we deal with that? */
|
||||
return FD2RVAL(fd);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_peek_fds(VALUE self)
|
||||
{
|
||||
return GFDS2ARY(g_unix_fd_list_peek_fds(_SELF(self), NULL));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_steal_fds(VALUE self)
|
||||
{
|
||||
return GFDS2ARY_FREE(g_unix_fd_list_steal_fds(_SELF(self), NULL));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_append(VALUE self, VALUE fd)
|
||||
{
|
||||
GError *error = NULL;
|
||||
int index;
|
||||
|
||||
index = g_unix_fd_list_append(_SELF(self), RVAL2FD(fd), &error);
|
||||
if (index == -1)
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixfdlist(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_FD_LIST, "UnixFDList", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(length, 0);
|
||||
RG_DEF_METHOD(get, 1);
|
||||
RG_DEF_ALIAS("[]", "get");
|
||||
RG_DEF_METHOD(peek_fds, 0);
|
||||
RG_DEF_METHOD(steal_fds, 0);
|
||||
RG_DEF_METHOD(append, 1);
|
||||
RG_DEF_ALIAS("<<", "append");
|
||||
#endif
|
||||
}
|
74
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixfdmessage.c
Normal file
74
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixfdmessage.c
Normal file
@ -0,0 +1,74 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixfdmessage.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE cUnixFDMessage
|
||||
#define _SELF(value) RVAL2GUNIXFDMESSAGE(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE fd_list;
|
||||
GSocketControlMessage *message;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &fd_list);
|
||||
message = NIL_P(fd_list) ?
|
||||
g_unix_fd_message_new() :
|
||||
g_unix_fd_message_new_with_fd_list(RVAL2GUNIXFDLIST(fd_list));
|
||||
G_INITIALIZE(self, message);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_append_fd(VALUE self, VALUE fd)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!g_unix_fd_message_append_fd(_SELF(self), RVAL2FD(fd), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_steal_fds(VALUE self)
|
||||
{
|
||||
return GFDS2ARY_FREE(g_unix_fd_message_steal_fds(_SELF(self), NULL));
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixfdmessage(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_FD_MESSAGE, "UnixFDMessage", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(append_fd, 1);
|
||||
RG_DEF_ALIAS("<<", "append_fd");
|
||||
RG_DEF_METHOD(steal_fds, 0);
|
||||
#endif
|
||||
}
|
51
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixinputstream.c
Normal file
51
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixinputstream.c
Normal file
@ -0,0 +1,51 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixinputstream.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE cUnixInputStream
|
||||
#define _SELF(value) RVAL2GUNIXINPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE fd, close_fd;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &fd, &close_fd);
|
||||
G_INITIALIZE(self, g_unix_input_stream_new(RVAL2FD(fd),
|
||||
RVAL2CBOOL(close_fd)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixinputstream(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_INPUT_STREAM, "UnixInputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
#endif
|
||||
}
|
164
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmount.c
Normal file
164
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmount.c
Normal file
@ -0,0 +1,164 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixmounts.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE cUnixMount
|
||||
|
||||
static GUnixMountEntry *
|
||||
unixmount_copy(const GUnixMountEntry *mount)
|
||||
{
|
||||
return (GUnixMountEntry *)mount;
|
||||
}
|
||||
|
||||
static GType
|
||||
g_unix_mount_entry_get_type(void)
|
||||
{
|
||||
static GType our_type = 0;
|
||||
|
||||
if (our_type == 0)
|
||||
our_type = g_boxed_type_register_static("GUnixMountEntry",
|
||||
(GBoxedCopyFunc)unixmount_copy,
|
||||
(GBoxedFreeFunc)g_unix_mount_free);
|
||||
|
||||
return our_type;
|
||||
}
|
||||
|
||||
#define G_TYPE_UNIX_MOUNT_ENTRY (g_unix_mount_entry_get_type())
|
||||
|
||||
#define _SELF(value) \
|
||||
((GUnixMountEntry *)(RVAL2BOXED((value), G_TYPE_UNIX_MOUNT_ENTRY)))
|
||||
|
||||
#define GUNIXMOUNTENTRY2RVAL(value) BOXED2RVAL((value), G_TYPE_UNIX_MOUNT_ENTRY)
|
||||
|
||||
static VALUE
|
||||
rg_compare(VALUE self, VALUE other)
|
||||
{
|
||||
return INT2FIX(g_unix_mount_compare(_SELF(self), _SELF(other)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_mount_path(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_unix_mount_get_mount_path(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_device_path(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_unix_mount_get_device_path(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_fs_type(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_unix_mount_get_fs_type(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_readonly_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mount_is_readonly(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_system_internal_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mount_is_system_internal(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_icon(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_unix_mount_guess_icon(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_unix_mount_guess_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_can_eject_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mount_guess_can_eject(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_should_display_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mount_guess_should_display(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_at(G_GNUC_UNUSED VALUE self, VALUE mount_path)
|
||||
{
|
||||
guint64 time_read;
|
||||
GUnixMountEntry *mount;
|
||||
|
||||
mount = g_unix_mount_at(RVAL2CSTR(mount_path), &time_read);
|
||||
|
||||
return rb_assoc_new(GUNIXMOUNTENTRY2RVAL(mount),
|
||||
GUINT642RVAL(time_read));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_mount_path_system_internal_p(G_GNUC_UNUSED VALUE self, VALUE mount_path)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_is_mount_path_system_internal(RVAL2CSTR(mount_path)));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixmount(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE;
|
||||
|
||||
RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_ENTRY, "UnixMount", mGio);
|
||||
|
||||
rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable);
|
||||
|
||||
/* TODO: This doesn't follow the naming conventions, but it seems
|
||||
* overkill to have GLib::Unix just for mount_path_system_internal?. */
|
||||
RG_DEF_SMETHOD_P(mount_path_system_internal, 1);
|
||||
RG_DEF_SMETHOD(at, 1);
|
||||
|
||||
rbgobj_boxed_not_copy_obj(G_TYPE_UNIX_MOUNT_ENTRY);
|
||||
|
||||
RG_DEF_METHOD(compare, 1);
|
||||
RG_DEF_ALIAS("<=>", "compare");
|
||||
RG_DEF_METHOD(mount_path, 0);
|
||||
RG_DEF_METHOD(device_path, 0);
|
||||
RG_DEF_METHOD(fs_type, 0);
|
||||
RG_DEF_METHOD_P(readonly, 0);
|
||||
RG_DEF_METHOD_P(system_internal, 0);
|
||||
RG_DEF_METHOD(guess_icon, 0);
|
||||
RG_DEF_METHOD(guess_name, 0);
|
||||
RG_DEF_METHOD_P(guess_can_eject, 0);
|
||||
RG_DEF_METHOD_P(guess_should_display, 0);
|
||||
#endif
|
||||
}
|
65
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmountmonitor.c
Normal file
65
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmountmonitor.c
Normal file
@ -0,0 +1,65 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixmounts.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE cUnixMountMonitor
|
||||
#define _SELF(value) RVAL2GUNIXMOUNTMONITOR(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE limit_msec;
|
||||
GUnixMountMonitor *monitor;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &limit_msec);
|
||||
monitor = g_unix_mount_monitor_new();
|
||||
if (!NIL_P(limit_msec))
|
||||
g_unix_mount_monitor_set_rate_limit(monitor,
|
||||
FIX2INT(limit_msec));
|
||||
G_INITIALIZE(self, monitor);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_set_rate_limit(VALUE self, VALUE limit_msec)
|
||||
{
|
||||
g_unix_mount_monitor_set_rate_limit(_SELF(self), FIX2INT(limit_msec));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixmountmonitor(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_MONITOR, "UnixMountMonitor", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
RG_DEF_METHOD(set_rate_limit, 1);
|
||||
#endif
|
||||
}
|
136
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmountpoint.c
Normal file
136
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmountpoint.c
Normal file
@ -0,0 +1,136 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixmounts.h>
|
||||
|
||||
#define G_TYPE_UNIX_MOUNT_POINT (g_unix_mount_point_get_type())
|
||||
|
||||
#define RG_TARGET_NAMESPACE cUnixMountPoint
|
||||
#define _SELF(value) \
|
||||
((GUnixMountPoint *)(RVAL2BOXED((value), G_TYPE_UNIX_MOUNT_POINT)))
|
||||
|
||||
static GUnixMountPoint *
|
||||
unixmountpoint_copy(const GUnixMountPoint *mount_point)
|
||||
{
|
||||
return (GUnixMountPoint *)mount_point;
|
||||
}
|
||||
|
||||
static GType
|
||||
g_unix_mount_point_get_type(void)
|
||||
{
|
||||
static GType our_type = 0;
|
||||
|
||||
if (our_type == 0)
|
||||
our_type = g_boxed_type_register_static("GUnixMountPoint",
|
||||
(GBoxedCopyFunc)unixmountpoint_copy,
|
||||
(GBoxedFreeFunc)g_unix_mount_point_free);
|
||||
|
||||
return our_type;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_compare(VALUE self, VALUE other)
|
||||
{
|
||||
return INT2FIX(g_unix_mount_point_compare(_SELF(self), _SELF(other)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_mount_path(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_unix_mount_point_get_mount_path(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_device_path(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_unix_mount_point_get_device_path(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_fs_type(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL(g_unix_mount_point_get_fs_type(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_readonly_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mount_point_is_readonly(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_user_mountable_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mount_point_is_user_mountable(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_loopback_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mount_point_is_loopback(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_icon(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_unix_mount_point_guess_icon(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_unix_mount_point_guess_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_guess_can_eject_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mount_point_guess_can_eject(_SELF(self)));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixmountpoint(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_POINT, "UnixMountPoint", mGio);
|
||||
|
||||
rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable);
|
||||
|
||||
rbgobj_boxed_not_copy_obj(G_TYPE_UNIX_MOUNT_POINT);
|
||||
|
||||
RG_DEF_METHOD(compare, 1);
|
||||
RG_DEF_ALIAS("<=>", "compare");
|
||||
RG_DEF_METHOD(mount_path, 0);
|
||||
RG_DEF_METHOD(device_path, 0);
|
||||
RG_DEF_METHOD(fs_type, 0);
|
||||
RG_DEF_METHOD_P(readonly, 0);
|
||||
RG_DEF_METHOD_P(user_mountable, 0);
|
||||
RG_DEF_METHOD_P(loopback, 0);
|
||||
RG_DEF_METHOD(guess_icon, 0);
|
||||
RG_DEF_METHOD(guess_name, 0);
|
||||
RG_DEF_METHOD_P(guess_can_eject, 0);
|
||||
#endif
|
||||
}
|
58
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmountpoints.c
Normal file
58
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmountpoints.c
Normal file
@ -0,0 +1,58 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixmounts.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE mUnixMountPoints
|
||||
|
||||
static VALUE
|
||||
rg_s_get(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
guint64 time_read;
|
||||
GList *mount_points;
|
||||
|
||||
mount_points = g_unix_mount_points_get(&time_read);
|
||||
|
||||
return rb_assoc_new(GLIST2ARY_STR_FREE(mount_points),
|
||||
GUINT642RVAL(time_read));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_changed_since_p(G_GNUC_UNUSED VALUE self, VALUE time_read)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mount_points_changed_since(RVAL2GUINT64(time_read)));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixmountpoints(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "UnixMountPoints");
|
||||
|
||||
RG_DEF_SMETHOD(get, 0);
|
||||
RG_DEF_SMETHOD_P(changed_since, 1);
|
||||
#endif
|
||||
}
|
58
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmounts.c
Normal file
58
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixmounts.c
Normal file
@ -0,0 +1,58 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixmounts.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE mUnixMounts
|
||||
|
||||
static VALUE
|
||||
rg_s_get(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
guint64 time_read;
|
||||
GList *mounts;
|
||||
|
||||
mounts = g_unix_mounts_get(&time_read);
|
||||
|
||||
return rb_assoc_new(GLIST2ARY_STR_FREE(mounts),
|
||||
GUINT642RVAL(time_read));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_changed_since_p(G_GNUC_UNUSED VALUE self, VALUE time_read)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_mounts_changed_since(RVAL2GUINT64(time_read)));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixmounts(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "UnixMounts");
|
||||
|
||||
RG_DEF_SMETHOD(get, 0);
|
||||
RG_DEF_SMETHOD_P(changed_since, 1);
|
||||
#endif
|
||||
}
|
51
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixoutputstream.c
Normal file
51
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixoutputstream.c
Normal file
@ -0,0 +1,51 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixoutputstream.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE cUnixOutputStream
|
||||
#define _SELF(value) RVAL2GUNIXOUTPUTSTREAM(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE fd, close_fd;
|
||||
|
||||
rb_scan_args(argc, argv, "11", &fd, &close_fd);
|
||||
G_INITIALIZE(self, g_unix_output_stream_new(RVAL2FD(fd),
|
||||
RVAL2CBOOL(close_fd)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixoutputstream(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_OUTPUT_STREAM, "UnixOutputStream", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
#endif
|
||||
}
|
69
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixsocketaddress.c
Normal file
69
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiounixsocketaddress.c
Normal file
@ -0,0 +1,69 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
#include <gio/gunixsocketaddress.h>
|
||||
|
||||
#define RG_TARGET_NAMESPACE cUnixSocketAddress
|
||||
#define _SELF(value) RVAL2GUNIXSOCKETADDRESS(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(VALUE self, VALUE path)
|
||||
{
|
||||
G_INITIALIZE(self, g_unix_socket_address_new(RVAL2CSTR(path)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_new_abstract(G_GNUC_UNUSED VALUE self, VALUE path)
|
||||
{
|
||||
StringValue(path);
|
||||
return GOBJ2RVAL_UNREF(g_unix_socket_address_new_abstract(RSTRING_PTR(path),
|
||||
RSTRING_LEN(path)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_abstract_names_supported_p(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_unix_socket_address_abstract_names_supported());
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Init_gunixsocketaddress(G_GNUC_UNUSED VALUE mGio)
|
||||
{
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_SOCKET_ADDRESS, "UnixSocketAddress", mGio);
|
||||
|
||||
# if GLIB_CHECK_VERSION(2, 26, 0)
|
||||
G_DEF_CLASS(G_TYPE_UNIX_SOCKET_ADDRESS_TYPE, "Type", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_UNIX_SOCKET_ADDRESS_TYPE, "G_UNIX_SOCKET_ADDRESS_");
|
||||
# endif
|
||||
|
||||
RG_DEF_SMETHOD(new_abstract, 1);
|
||||
RG_DEF_SMETHOD_P(abstract_names_supported, 0);
|
||||
|
||||
RG_DEF_METHOD(initialize, 1);
|
||||
#endif
|
||||
}
|
84
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiovfs.c
Normal file
84
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiovfs.c
Normal file
@ -0,0 +1,84 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cVfs
|
||||
#define _SELF(value) RVAL2GVFS(value)
|
||||
|
||||
static VALUE
|
||||
rg_file_for_path(VALUE self, VALUE path)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_vfs_get_file_for_path(_SELF(self), RVAL2CSTR(path)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_file_for_uri(VALUE self, VALUE uri)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_vfs_get_file_for_uri(_SELF(self), RVAL2CSTR(uri)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_parse_name(VALUE self, VALUE parse_name)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_vfs_parse_name(_SELF(self), RVAL2CSTR(parse_name)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_default(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL(g_vfs_get_default());
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_s_local(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL(g_vfs_get_local());
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_active_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_vfs_is_active(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_supported_uri_schemes(VALUE self)
|
||||
{
|
||||
return STRV2RVAL((const gchar **)g_vfs_get_supported_uri_schemes(_SELF(self)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gvfs(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_VFS, "Vfs", mGio);
|
||||
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "EXTENSION_POINT_NAME", CSTR2RVAL(G_VFS_EXTENSION_POINT_NAME));
|
||||
|
||||
RG_DEF_SMETHOD(default, 0);
|
||||
RG_DEF_SMETHOD(local, 0);
|
||||
|
||||
RG_DEF_METHOD(file_for_path, 1);
|
||||
RG_DEF_METHOD(file_for_uri, 1);
|
||||
RG_DEF_METHOD(parse_name, 1);
|
||||
RG_DEF_METHOD_P(active, 0);
|
||||
RG_DEF_METHOD(supported_uri_schemes, 0);
|
||||
}
|
193
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiovolume.c
Normal file
193
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiovolume.c
Normal file
@ -0,0 +1,193 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE mVolume
|
||||
#define _SELF(value) RVAL2GVOLUME(value)
|
||||
|
||||
static VALUE
|
||||
rg_name(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_volume_get_name(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_uuid(VALUE self)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_volume_get_uuid(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_icon(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_volume_get_icon(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_drive(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_volume_get_drive(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_mount(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_volume_get_mount(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_mount_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_volume_can_mount(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_should_automount_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_volume_should_automount(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_activation_root(VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_volume_get_activation_root(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_mount(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbflags, rbmount_operation, rbcancellable, block;
|
||||
GMountMountFlags flags;
|
||||
GMountOperation *mount_operation;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block);
|
||||
flags = RVAL2GMOUNTMOUNTFLAGSDEFAULT(rbflags);
|
||||
mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_volume_mount(_SELF(self),
|
||||
flags,
|
||||
mount_operation,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
typedef gboolean (*BooleanFinishMethod)(GVolume *,
|
||||
GAsyncResult *,
|
||||
GError **);
|
||||
|
||||
static VALUE
|
||||
boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error))
|
||||
rbgio_raise_error(error);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_mount_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_volume_mount_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_can_eject_p(VALUE self)
|
||||
{
|
||||
return CBOOL2RVAL(g_volume_can_eject(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_eject_with_operation(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE rbflags, rbmount_operation, rbcancellable, block;
|
||||
GMountUnmountFlags flags;
|
||||
GMountOperation *mount_operation;
|
||||
GCancellable *cancellable;
|
||||
|
||||
rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block);
|
||||
flags = RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(rbflags);
|
||||
mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation);
|
||||
cancellable = RVAL2GCANCELLABLE(rbcancellable);
|
||||
SAVE_BLOCK(block);
|
||||
g_volume_eject_with_operation(_SELF(self),
|
||||
flags,
|
||||
mount_operation,
|
||||
cancellable,
|
||||
rbgio_async_ready_callback,
|
||||
(gpointer)block);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_eject_with_operation_finish(VALUE self, VALUE result)
|
||||
{
|
||||
return boolean_finish_method(g_volume_eject_with_operation_finish, self, result);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_enumerate_identifiers(VALUE self)
|
||||
{
|
||||
return STRV2RVAL_FREE(g_volume_enumerate_identifiers(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_identifier(VALUE self, VALUE kind)
|
||||
{
|
||||
return CSTR2RVAL_FREE(g_volume_get_identifier(_SELF(self), RVAL2CSTR(kind)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gvolume(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_VOLUME, "Volume", mGio);
|
||||
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_HAL_UDI", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_HAL_UDI));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_LABEL", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_LABEL));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_NFS_MOUNT", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_NFS_MOUNT));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_UNIX_DEVICE", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE));
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_UUID", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_UUID));
|
||||
|
||||
RG_DEF_METHOD(name, 0);
|
||||
RG_DEF_METHOD(uuid, 0);
|
||||
RG_DEF_METHOD(icon, 0);
|
||||
RG_DEF_METHOD(drive, 0);
|
||||
RG_DEF_METHOD(get_mount, 0);
|
||||
RG_DEF_METHOD_P(can_mount, 0);
|
||||
RG_DEF_METHOD_P(should_automount, 0);
|
||||
RG_DEF_METHOD(activation_root, 0);
|
||||
RG_DEF_METHOD(mount, -1);
|
||||
RG_DEF_METHOD(mount_finish, 1);
|
||||
RG_DEF_METHOD_P(can_eject, 0);
|
||||
RG_DEF_METHOD(eject_with_operation, -1);
|
||||
RG_DEF_METHOD(eject_with_operation_finish, 1);
|
||||
RG_DEF_METHOD(enumerate_identifiers, -1);
|
||||
RG_DEF_ALIAS("identifiers", "enumerate_identifiers");
|
||||
RG_DEF_METHOD(get_identifier, 1);
|
||||
}
|
77
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiovolumemonitor.c
Normal file
77
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiovolumemonitor.c
Normal file
@ -0,0 +1,77 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cVolumeMonitor
|
||||
#define _SELF(value) RVAL2GVOLUMEMONITOR(value)
|
||||
|
||||
static VALUE
|
||||
rg_s_get(G_GNUC_UNUSED VALUE self)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_volume_monitor_get());
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_connected_drives(VALUE self)
|
||||
{
|
||||
return GLIST2ARY_FREE(g_volume_monitor_get_connected_drives(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_volumes(VALUE self)
|
||||
{
|
||||
return GLIST2ARY_FREE(g_volume_monitor_get_volumes(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_mounts(VALUE self)
|
||||
{
|
||||
return GLIST2ARY_FREE(g_volume_monitor_get_mounts(_SELF(self)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_mount_for_uuid(VALUE self, VALUE value)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_volume_monitor_get_mount_for_uuid(_SELF(self), RVAL2CSTR(value)));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rg_get_volume_for_uuid(VALUE self, VALUE value)
|
||||
{
|
||||
return GOBJ2RVAL_UNREF(g_volume_monitor_get_volume_for_uuid(_SELF(self), RVAL2CSTR(value)));
|
||||
}
|
||||
|
||||
void
|
||||
Init_gvolumemonitor(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_VOLUME_MONITOR, "VolumeMonitor", mGio);
|
||||
|
||||
rb_define_const(RG_TARGET_NAMESPACE, "EXTENSION_POINT_NAME", CSTR2RVAL(G_VOLUME_MONITOR_EXTENSION_POINT_NAME));
|
||||
|
||||
RG_DEF_SMETHOD(get, 0);
|
||||
|
||||
RG_DEF_METHOD(connected_drives, 0);
|
||||
RG_DEF_METHOD(volumes, 0);
|
||||
RG_DEF_METHOD(mounts, 0);
|
||||
RG_DEF_METHOD(get_mount_for_uuid, 0);
|
||||
RG_DEF_METHOD(get_volume_for_uuid, 0);
|
||||
}
|
52
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiozlibcompressor.c
Normal file
52
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiozlibcompressor.c
Normal file
@ -0,0 +1,52 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cZlibCompressor
|
||||
#define _SELF(value) RVAL2GZLIBCOMPRESSOR(value)
|
||||
|
||||
#define RVAL2ZLIBCOMPRESSORLEVELDEFAULT(value) \
|
||||
RVAL2TYPE_WITH_DEFAULT((value), FIX2INT, -1)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE format, level;
|
||||
|
||||
rb_scan_args(argc, argv, "02", &format, &level);
|
||||
G_INITIALIZE(self,
|
||||
g_zlib_compressor_new(RVAL2GZLIBCOMPRESSORFORMATDEFAULT(format),
|
||||
RVAL2GZLIBCOMPRESSORFORMATDEFAULT(level)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gzlibcompressor(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_ZLIB_COMPRESSOR, "ZlibCompressor", mGio);
|
||||
|
||||
G_DEF_CLASS(G_TYPE_ZLIB_COMPRESSOR_FORMAT, "Format", RG_TARGET_NAMESPACE);
|
||||
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_ZLIB_COMPRESSOR_FORMAT, "G_ZLIB_");
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
}
|
45
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiozlibdecompressor.c
Normal file
45
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/rbgiozlibdecompressor.c
Normal file
@ -0,0 +1,45 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
#define RG_TARGET_NAMESPACE cZlibDecompressor
|
||||
#define _SELF(value) RVAL2GZLIBDECOMPRESSOR(value)
|
||||
|
||||
static VALUE
|
||||
rg_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE format;
|
||||
|
||||
rb_scan_args(argc, argv, "01", &format);
|
||||
G_INITIALIZE(self,
|
||||
g_zlib_decompressor_new(RVAL2GZLIBCOMPRESSORFORMATDEFAULT(format)));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
Init_gzlibdecompressor(VALUE mGio)
|
||||
{
|
||||
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_ZLIB_DECOMPRESSOR, "ZlibDecompressor", mGio);
|
||||
|
||||
RG_DEF_METHOD(initialize, -1);
|
||||
}
|
303
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/util.c
Normal file
303
lib/ruby-gtk2-2.0.2/gio2/ext/gio2/util.c
Normal file
@ -0,0 +1,303 @@
|
||||
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
||||
* Copyright (C) 2008-2009 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 "rbgio2private.h"
|
||||
|
||||
|
||||
#ifndef HAVE_RB_ERRINFO
|
||||
# define rb_errinfo() (ruby_errinfo)
|
||||
#endif
|
||||
|
||||
|
||||
static ID s_id_enum_name;
|
||||
static ID s_id_errors;
|
||||
|
||||
static VALUE s_errors;
|
||||
|
||||
|
||||
VALUE
|
||||
rbgio_cstr_to_rval_tainted(const char *string, gsize length)
|
||||
{
|
||||
VALUE result;
|
||||
|
||||
if (string == NULL)
|
||||
return Qnil;
|
||||
|
||||
result = rb_str_new(string, length);
|
||||
OBJ_TAINT(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
struct rbgio_cstr_to_rval_tainted_free_data
|
||||
{
|
||||
char *string;
|
||||
gsize length;
|
||||
};
|
||||
|
||||
static VALUE
|
||||
rbgio_cstr_to_rval_tainted_free_body(VALUE data)
|
||||
{
|
||||
struct rbgio_cstr_to_rval_tainted_free_data *real;
|
||||
|
||||
real = (struct rbgio_cstr_to_rval_tainted_free_data *)data;
|
||||
|
||||
return rbgio_cstr_to_rval_tainted(real->string, real->length);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rbgio_cstr_to_rval_tainted_free_ensure(VALUE data)
|
||||
{
|
||||
g_free(((struct rbgio_cstr_to_rval_tainted_free_data *)data)->string);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rbgio_cstr_to_rval_tainted_free(char *string, gsize length)
|
||||
{
|
||||
struct rbgio_cstr_to_rval_tainted_free_data data = { string, length };
|
||||
|
||||
return rb_ensure(rbgio_cstr_to_rval_tainted_free_body, (VALUE)&data,
|
||||
rbgio_cstr_to_rval_tainted_free_ensure, (VALUE)&data);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rbgio_glist_to_ary_unref_free(GList *list)
|
||||
{
|
||||
VALUE ary;
|
||||
GList *i;
|
||||
|
||||
ary = rb_ary_new();
|
||||
for (i = list; i != NULL; i = i->next)
|
||||
rb_ary_push(ary, GOBJ2RVAL_UNREF(i->data));
|
||||
g_list_free(list);
|
||||
|
||||
return ary;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rbgio_fds_to_ary(const gint *fds)
|
||||
{
|
||||
int i, n;
|
||||
VALUE ary;
|
||||
|
||||
for (i = n = 0; fds[i] != -1; i++)
|
||||
n++;
|
||||
|
||||
ary = rb_ary_new2(n);
|
||||
for (i = 0; i < n; i++)
|
||||
RARRAY_PTR(ary)[i] = FD2RVAL(fds[i]);
|
||||
|
||||
return ary;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rbgio_fds_to_ary_free_ensure(gint *fds)
|
||||
{
|
||||
g_free(fds);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rbgio_fds_to_ary_free(gint *fds)
|
||||
{
|
||||
return rb_ensure(rbgio_fds_to_ary, (VALUE)fds,
|
||||
rbgio_fds_to_ary_free_ensure, (VALUE)fds);
|
||||
}
|
||||
|
||||
struct rbgio_gfile_ary_to_glist_args {
|
||||
VALUE ary;
|
||||
long n;
|
||||
GList *result;
|
||||
};
|
||||
|
||||
static VALUE
|
||||
rbgio_gfile_ary_to_glist_body(VALUE value)
|
||||
{
|
||||
long i;
|
||||
struct rbgio_gfile_ary_to_glist_args *args = (struct rbgio_gfile_ary_to_glist_args *)value;
|
||||
|
||||
for (i = 0; i < args->n; i++)
|
||||
args->result = g_list_append(args->result, RVAL2GFILE(RARRAY_PTR(args->ary)[i]));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static G_GNUC_NORETURN VALUE
|
||||
rbgio_gfile_ary_to_glist_rescue(VALUE value)
|
||||
{
|
||||
g_list_free(((struct rbgio_gfile_ary_to_glist_args *)value)->result);
|
||||
|
||||
rb_exc_raise(rb_errinfo());
|
||||
}
|
||||
|
||||
GList *
|
||||
rbgio_gfile_ary_to_glist(VALUE value)
|
||||
{
|
||||
struct rbgio_gfile_ary_to_glist_args args;
|
||||
|
||||
args.ary = rb_ary_to_ary(value);
|
||||
args.n = RARRAY_LEN(args.ary);
|
||||
args.result = NULL;
|
||||
|
||||
rb_rescue(rbgio_gfile_ary_to_glist_body, (VALUE)&args,
|
||||
rbgio_gfile_ary_to_glist_rescue, (VALUE)&args);
|
||||
|
||||
return args.result;
|
||||
}
|
||||
|
||||
GList *
|
||||
rbgio_gfile_ary_to_glist_accept_nil(VALUE ary)
|
||||
{
|
||||
if (NIL_P(ary))
|
||||
return NULL;
|
||||
|
||||
return rbgio_gfile_ary_to_glist(ary);
|
||||
}
|
||||
|
||||
void
|
||||
rbgio_rval_to_gtimeval(VALUE value, GTimeVal *time)
|
||||
{
|
||||
if (rb_respond_to(value, rb_intern("tv_sec"))) {
|
||||
time->tv_sec = RVAL2GLONG(rb_funcall(value, rb_intern("tv_sec"), 0));
|
||||
time->tv_usec = rb_respond_to(value, rb_intern("tv_usec")) ?
|
||||
RVAL2GLONG(rb_funcall(value, rb_intern("tv_usec"), 0)) :
|
||||
0;
|
||||
} else if (rb_respond_to(value, rb_intern("to_ary"))) {
|
||||
VALUE ary = rb_ary_to_ary(value);
|
||||
if (RARRAY_LEN(ary) < 1 || RARRAY_LEN(ary) > 2)
|
||||
rb_raise(rb_eArgError, "Array of length 1 or 2 expected");
|
||||
time->tv_sec = RVAL2GLONG(RARRAY_PTR(ary)[0]);
|
||||
time->tv_usec = RARRAY_LEN(ary) > 1 ? RVAL2GLONG(RARRAY_PTR(ary)[1]) : 0;
|
||||
} else {
|
||||
time->tv_sec = RVAL2GLONG(value);
|
||||
time->tv_usec = 0;
|
||||
}
|
||||
}
|
||||
|
||||
struct async_ready_callback_data
|
||||
{
|
||||
GAsyncResult *result;
|
||||
gpointer data;
|
||||
};
|
||||
|
||||
static VALUE
|
||||
rbgio_async_ready_callback_call(VALUE data)
|
||||
{
|
||||
static VALUE s_id_call;
|
||||
struct async_ready_callback_data *real;
|
||||
VALUE block;
|
||||
|
||||
if (s_id_call == 0)
|
||||
s_id_call = rb_intern("call");
|
||||
|
||||
real = (struct async_ready_callback_data *)data;
|
||||
block = USE_BLOCK(real->data);
|
||||
if (!NIL_P(block))
|
||||
rb_funcall(block, s_id_call, 1, GOBJ2RVAL_UNREF(real->result));
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
void
|
||||
rbgio_async_ready_callback(G_GNUC_UNUSED GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
struct async_ready_callback_data real = { result, data };
|
||||
|
||||
G_PROTECT_CALLBACK(rbgio_async_ready_callback_call, &real);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rbgio_child_remove_and_return(VALUE parent, VALUE child)
|
||||
{
|
||||
G_CHILD_REMOVE(parent, child);
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rbgio_define_domain_error(VALUE module,
|
||||
const char *name,
|
||||
GQuark domain,
|
||||
const char *enum_name,
|
||||
VALUE parent)
|
||||
{
|
||||
VALUE error;
|
||||
|
||||
error = rb_define_class_under(module, name, parent);
|
||||
rb_ivar_set(error, s_id_enum_name, CSTR2RVAL(enum_name));
|
||||
rb_ivar_set(error, s_id_errors, rb_hash_new());
|
||||
rb_hash_aset(s_errors, UINT2NUM(domain), error);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rbgio_define_error(VALUE module,
|
||||
const char *name,
|
||||
gint code,
|
||||
VALUE domain_error)
|
||||
{
|
||||
VALUE error;
|
||||
|
||||
error = rb_define_class_under(module, name, domain_error);
|
||||
rb_hash_aset(rb_ivar_get(domain_error, s_id_errors),
|
||||
INT2NUM(code),
|
||||
error);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void
|
||||
rbgio_raise_error(GError *error)
|
||||
{
|
||||
VALUE domain_error, rberror;
|
||||
|
||||
domain_error = rb_hash_aref(s_errors, UINT2NUM(error->domain));
|
||||
if (NIL_P(domain_error))
|
||||
RAISE_GERROR(error);
|
||||
|
||||
rberror = rb_hash_aref(rb_ivar_get(domain_error, s_id_errors),
|
||||
INT2NUM(error->code));
|
||||
if (NIL_P(rberror)) {
|
||||
VALUE enum_name = rb_ivar_get(domain_error, s_id_enum_name);
|
||||
|
||||
rb_raise(rb_eNotImpError,
|
||||
"%s contains error codes that have not been implemented: %d",
|
||||
RVAL2CSTR(enum_name), error->code);
|
||||
}
|
||||
|
||||
rb_raise(rberror, "%s", error->message);
|
||||
}
|
||||
|
||||
void
|
||||
Init_util(void)
|
||||
{
|
||||
s_id_enum_name = rb_intern("@enum_name");
|
||||
s_id_errors = rb_intern("@errors");
|
||||
|
||||
s_errors = rb_hash_new();
|
||||
rb_global_variable(&s_errors);
|
||||
}
|
Reference in New Issue
Block a user