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:
Quentin
2013-12-17 11:20:08 +01:00
parent 2e835fac51
commit 26e8968796
929 changed files with 121236 additions and 0 deletions

View File

@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -0,0 +1,33 @@
Ruby/Pango
==========
Ruby/Pango is a Ruby binding of pango-1.x.
Requirements
------------
Ruby: http://www.ruby-lang.org/
GLib: http://www.gtk.org/
Pango: http://www.pango.org/
cairo/rcairo: http://cairographics.org/ (optional)
Ruby/GLib2: http://ruby-gnome2.sourceforge.net/
Install
-------
0. install ruby-1.6.x or later, GLib, Pango, Ruby/GLib2, Ruby/GTK2
(and cairo/rcairo).
1. ruby extconf.rb
(To use rcairo on Win32, set CAIRO_PATH as a environment variable first)
2. make
3. su
4. make install
Copying
-------
Copyright (c) 2002-2005 Ruby-GNOME2 Project Team
This program is free software.
You can distribute/modify this program under the terms of
the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
Project Website
---------------
http://ruby-gnome2.sourceforge.jp/

View File

@ -0,0 +1,61 @@
# -*- ruby -*-
$LOAD_PATH.unshift("./../glib2/lib")
require "gnome2/rake/package-task"
package_task = GNOME2::Rake::PackageTask.new do |package|
package.summary = "Ruby/Pango is a Ruby binding of pango-1.x."
package.description = "Ruby/Pango is a Ruby binding of pango-1.x."
package.dependency.gem.runtime = [["cairo", ">= 1.12.5"], "glib2"]
package.windows.packages = []
package.windows.dependencies = []
package.windows.build_dependencies = ["glib2", "gobject-introspection"]
package.external_packages = [
{
:name => "harfbuzz",
:download_base_url => "http://www.freedesktop.org/software/harfbuzz/release",
:label => "HarfBuzz",
:version => "0.9.17",
:compression_method => "bz2",
:windows => {
:patches => [
"harfbuzz-0.9.17-disable-uniscribe.diff",
],
:need_autoreconf => true,
},
},
{
:name => "pango",
:download_site => :gnome,
:label => "pango",
:version => "1.34.1",
:compression_method => "xz",
:windows => {
:configure_args => [
"--enable-introspection",
],
:patches => [
"pango-1.34.0-enable-fc-font.diff",
],
},
},
]
end
package_task.define
namespace :gcc do
namespace :dll do
desc "Bundle GCC related DLLs"
task(:bundle) do
dlls = ["libgcc_s_sjlj-1.dll", "libstdc++-6.dll"]
dlls.each do |dll|
host = package_task.windows.build_host
binary_dir = package_task.windows.absolute_binary_dir
full_path = `#{host}-g++ -print-file-name=#{dll}`.strip
cp(full_path, (binary_dir + "bin").to_s)
end
end
end
end
task "win32:builder:build:harfbuzz:after" => "gcc:dll:bundle"

View File

@ -0,0 +1,12 @@
install-so: install-headers
install-headers:
$(INSTALL_DATA) $(srcdir)/rbpango.h $(RUBYARCHDIR)
$(INSTALL_DATA) $(srcdir)/rbpangoconversions.h $(RUBYARCHDIR)
$(INSTALL_DATA) rbpangoversion.h $(RUBYARCHDIR)
install: install-pc
install-pc:
if test -n "$(pkgconfigdir)"; then \
$(MAKEDIRS) $(pkgconfigdir); \
$(INSTALL_DATA) ruby-pango.pc $(pkgconfigdir); \
fi

View File

@ -0,0 +1,102 @@
=begin
extconf.rb for Ruby/Pango extention library
=end
require 'pathname'
base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path
top_dir = base_dir.parent
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 = "pango"
package_id = "pango"
begin
require 'mkmf-gnome2'
rescue LoadError
require 'rubygems'
gem 'glib2'
require 'mkmf-gnome2'
end
ruby_header = "ruby.h"
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
rcairo_options = {}
rcairo_source_dir_names = ["rcairo"]
if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM
rcairo_source_dir_names.unshift("rcairo.win32")
end
rcairo_source_dir_names.each do |rcairo_source_dir_name|
rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name
if rcairo_source_dir.exist?
rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s
break
end
end
check_cairo(rcairo_options)
setup_win32(module_name, base_dir)
unless required_pkg_config_package(package_id,
:debian => "libpango1.0-dev",
:redhat => "pango-devel",
:homebrew => "pango",
:macports => "pango")
exit(false)
end
PKGConfig.have_package('pangocairo')
if PKGConfig.have_package("pangowin32")
$defs << " -DHAVE_PANGO_WIN32"
end
if PKGConfig.have_package("pangoft2")
$defs << " -DHAVE_PANGO_FT2"
end
pango_header = "pango/pango.h"
have_func("pango_layout_iter_get_type", pango_header)
have_func("pango_layout_set_ellipsize", pango_header)
have_func("pango_layout_get_font_description", pango_header)
have_func("pango_render_part_get_type", pango_header)
have_func("pango_attr_strikethrough_color_new", pango_header)
have_func("pango_attr_underline_color_new", pango_header)
have_func("pango_glyph_item_free", pango_header)
have_func("pango_glyph_item_get_type", pango_header)
have_func("pango_attr_iterator_get_attrs", pango_header)
have_func("pango_itemize_with_base_dir", pango_header)
have_func("pango_font_family_is_monospace", pango_header)
make_version_header("PANGO", "pango", ".")
create_pkg_config_file("Ruby/Pango", package_id)
$defs << " -DRUBY_PANGO_COMPILATION"
create_makefile(module_name)
pkg_config_dir = with_config("pkg-config-dir")
if pkg_config_dir.is_a?(String)
File.open("Makefile", "ab") do |makefile|
makefile.puts
makefile.puts("pkgconfigdir=#{pkg_config_dir}")
end
end

View File

@ -0,0 +1,18 @@
EXPORTS
Init_pango
mPango DATA
attrstring DATA
pattr DATA
pattrbool DATA
pattrcolor DATA
pattrfloat DATA
pattrint DATA
pango_add_attribute
pango_attr_iter_get_type
pango_get_attribute
pango_get_attribute_klass
pango_item_get_type
pango_layout_iter_get_type
pango_layout_line_get_type
pango_make_attribute
pango_rectangle_get_type

View File

@ -0,0 +1,327 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE mPango
VALUE RG_TARGET_NAMESPACE;
extern void Init_pango(void);
/*
* Rendering
*/
struct rpango_reorder_items_args {
PangoItem *item;
VALUE ary;
long n;
GList *result;
};
static VALUE
rpango_reorder_items_body(VALUE value)
{
struct rpango_reorder_items_args *args = (struct rpango_reorder_items_args *)value;
long i;
GList *result;
for (i = 0; i < args->n; i++)
args->result = g_list_append(args->result,
RVAL2PANGOITEM(RARRAY_PTR(args->ary)[i]));
result = pango_reorder_items(args->result);
g_list_free(args->result);
return GLIST2ARY2(result, PANGO_TYPE_ITEM);
}
static VALUE
rpango_reorder_items_ensure(VALUE value)
{
g_list_free(((struct rpango_reorder_items_args *)value)->result);
return Qnil;
}
static VALUE
rg_s_reorder_items(G_GNUC_UNUSED VALUE self, VALUE attrs)
{
struct rpango_reorder_items_args args;
args.ary = rb_ary_to_ary(attrs);
args.n = RARRAY_LEN(args.ary);
args.result = NULL;
return rb_ensure(rpango_reorder_items_body, (VALUE)&args,
rpango_reorder_items_ensure, (VALUE)&args);
}
#if PANGO_CHECK_VERSION(1,4,0)
static VALUE
rg_s_unichar_direction(G_GNUC_UNUSED VALUE self, VALUE ch)
{
return PANGODIRECTION2RVAL(pango_unichar_direction(NUM2UINT(ch)));
}
static VALUE
rg_s_find_base_dir(G_GNUC_UNUSED VALUE self, VALUE text)
{
StringValue(text);
return PANGODIRECTION2RVAL(pango_find_base_dir(RSTRING_PTR(text), RSTRING_LEN(text)));
}
#endif
struct rbg_pangologattrs2rval_free_args {
PangoLogAttr *attrs;
long n;
};
static VALUE
rbg_pangologattrs2rval_free_body(VALUE value)
{
struct rbg_pangologattrs2rval_free_args *args = (struct rbg_pangologattrs2rval_free_args *)value;
long i;
VALUE ary = rb_ary_new();
for (i = 0; i < args->n; i++)
rb_ary_push(ary, PANGOLOGATTR2RVAL(&args->attrs[i]));
return ary;
}
static VALUE
rbg_pangologattrs2rval_free_ensure(VALUE value)
{
g_free(((struct rbg_pangologattrs2rval_free_args *)value)->attrs);
return Qnil;
}
static VALUE
rbg_pangologattrs2rval_free(PangoLogAttr *attrs, long n)
{
struct rbg_pangologattrs2rval_free_args args = { attrs, n };
return rb_ensure(rbg_pangologattrs2rval_free_body, (VALUE)&args,
rbg_pangologattrs2rval_free_ensure, (VALUE)&args);
}
#define PANGOLOGATTRS2RVAL_FREE(attrs, n) rbg_pangologattrs2rval_free(attrs, n)
static VALUE
rg_s_break(G_GNUC_UNUSED VALUE self, VALUE rbtext, VALUE rbanalysis)
{
const gchar *text = RVAL2CSTR(rbtext);
long length = RSTRING_LEN(rbtext);
PangoAnalysis *analysis = RVAL2PANGOANALYSIS(rbanalysis);
long n = g_utf8_strlen(text, length) + 1;
PangoLogAttr *attrs = g_new(PangoLogAttr, n);
pango_break(text, length, analysis, attrs, n);
return PANGOLOGATTRS2RVAL_FREE(attrs, n);
}
static VALUE
rg_s_get_log_attrs(G_GNUC_UNUSED VALUE self, VALUE rbtext, VALUE rblevel, VALUE rblanguage)
{
const gchar *text = RVAL2CSTR(rbtext);
long length = RSTRING_LEN(rbtext);
int level = NUM2INT(rblevel);
PangoLanguage *language = RVAL2PANGOLANGUAGE(rblanguage);
long n = g_utf8_strlen(text, length) + 1;
PangoLogAttr *attrs = g_new(PangoLogAttr, n);
pango_get_log_attrs(text, length, level, language, attrs, n);
return PANGOLOGATTRS2RVAL_FREE(attrs, n);
}
static VALUE
rg_s_find_paragraph_boundary(G_GNUC_UNUSED VALUE self, VALUE text)
{
gint paragraph_delimiter_index, next_paragraph_start;
StringValue(text);
pango_find_paragraph_boundary(RSTRING_PTR(text), RSTRING_LEN(text),
&paragraph_delimiter_index,
&next_paragraph_start);
return rb_ary_new3(2, INT2NUM(paragraph_delimiter_index),
INT2NUM(next_paragraph_start));
}
/*
Don't need to implement this. Use pango_break instead.
void pango_default_break (const gchar *text,
int length,
PangoAnalysis *analysis,
PangoLogAttr *attrs,
int attrs_len);
*/
static VALUE
rpango_shape_result(VALUE value)
{
return PANGOGLYPHSTRING2RVAL((PangoGlyphString *)value);
}
static VALUE
rpango_shape_ensure(VALUE value)
{
pango_glyph_string_free((PangoGlyphString *)value);
return Qnil;
}
static VALUE
rg_s_shape(G_GNUC_UNUSED VALUE self, VALUE rbtext, VALUE rbanalysis)
{
const gchar *text = RVAL2CSTR(rbtext);
long length = RSTRING_LEN(rbtext);
PangoAnalysis *analysis = RVAL2PANGOANALYSIS(rbanalysis);
PangoGlyphString *glyphs = pango_glyph_string_new();
pango_shape(text, length, analysis, glyphs);
return rb_ensure(rpango_shape_result, (VALUE)glyphs,
rpango_shape_ensure, (VALUE)glyphs);
}
/* This method is from rbpangoattribute.c */
static VALUE
rg_s_parse_markup(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
{
VALUE markup_text, accel_marker;
PangoAttrList *pattr_list;
gchar* gtext;
gunichar accel_char;
GError *error = NULL;
gboolean ret;
char c;
VALUE text = Qnil;
VALUE attr_list = Qnil;
rb_scan_args(argc, argv, "11", &markup_text, &accel_marker);
if (NIL_P(markup_text)) rb_raise(rb_eRuntimeError, "1st argument can't accept nil");
StringValue(markup_text);
ret = pango_parse_markup(RSTRING_PTR(markup_text),
RSTRING_LEN(markup_text),
NIL_P(accel_marker) ? 0 : NUM2CHR(accel_marker),
&pattr_list, &gtext, &accel_char, &error);
if (!ret) RAISE_GERROR(error);
if (pattr_list){
attr_list = PANGOATTRLIST2RVAL(pattr_list);
pango_attr_list_unref(pattr_list);
}
c = (char)accel_char;
if (text){
text = CSTR2RVAL(gtext);
g_free(gtext);
}
return rb_ary_new3(3, attr_list, text,
accel_char ? rb_str_new(&c, 1) : Qnil);
}
static VALUE
rg_s_pixels(G_GNUC_UNUSED VALUE self, VALUE pixels)
{
return rb_float_new(PANGO_PIXELS(NUM2DBL(pixels)));
}
static VALUE
rg_s_cairo_available_p(G_GNUC_UNUSED VALUE self)
{
#ifdef CAIRO_AVAILABLE
return Qtrue;
#else
return Qfalse;
#endif
}
void
Init_pango(void)
{
RG_TARGET_NAMESPACE = rb_define_module("Pango");
rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION",
rb_ary_new3(3,
INT2FIX(PANGO_MAJOR_VERSION),
INT2FIX(PANGO_MINOR_VERSION),
INT2FIX(PANGO_MICRO_VERSION)));
RG_DEF_SMETHOD(reorder_items, 1);
#if PANGO_CHECK_VERSION(1,4,0)
RG_DEF_SMETHOD(unichar_direction, 1);
RG_DEF_SMETHOD(find_base_dir, 1);
#endif
RG_DEF_SMETHOD(break, 2);
RG_DEF_SMETHOD(get_log_attrs, 3);
RG_DEF_SMETHOD(find_paragraph_boundary, 1);
RG_DEF_SMETHOD(shape, 2);
RG_DEF_SMETHOD(parse_markup, -1);
RG_DEF_SMETHOD(pixels, 1);
rb_define_const(RG_TARGET_NAMESPACE, "SCALE", INT2FIX(PANGO_SCALE));
RG_DEF_SMETHOD_P(cairo_available, 0);
Init_pango_analysis(RG_TARGET_NAMESPACE);
Init_pango_attribute(RG_TARGET_NAMESPACE);
Init_pango_attriterator(RG_TARGET_NAMESPACE);
Init_pango_attrlist(RG_TARGET_NAMESPACE);
Init_pango_cairo(RG_TARGET_NAMESPACE);
Init_pango_cairo_context(RG_TARGET_NAMESPACE);
Init_pango_color(RG_TARGET_NAMESPACE);
Init_pango_context(RG_TARGET_NAMESPACE);
Init_pango_coverage(RG_TARGET_NAMESPACE);
Init_pango_engine(RG_TARGET_NAMESPACE);
Init_pango_font(RG_TARGET_NAMESPACE);
Init_pango_font_description(RG_TARGET_NAMESPACE);
Init_pango_font_face(RG_TARGET_NAMESPACE);
Init_pango_font_family(RG_TARGET_NAMESPACE);
Init_pango_font_map(RG_TARGET_NAMESPACE);
Init_pango_font_metrics(RG_TARGET_NAMESPACE);
Init_pango_fontset(RG_TARGET_NAMESPACE);
Init_pango_fontset_simple(RG_TARGET_NAMESPACE);
Init_pango_glyph_info(RG_TARGET_NAMESPACE);
Init_pango_glyph_item(RG_TARGET_NAMESPACE);
Init_pango_glyph_string(RG_TARGET_NAMESPACE);
Init_pango_gravity(RG_TARGET_NAMESPACE);
Init_pango_item(RG_TARGET_NAMESPACE);
Init_pango_language(RG_TARGET_NAMESPACE);
Init_pango_layout(RG_TARGET_NAMESPACE);
Init_pango_layout_iter(RG_TARGET_NAMESPACE);
Init_pango_layout_line(RG_TARGET_NAMESPACE);
Init_pango_logattr(RG_TARGET_NAMESPACE);
Init_pango_matrix(RG_TARGET_NAMESPACE);
Init_pango_rectangle(RG_TARGET_NAMESPACE);
Init_pangorenderer(RG_TARGET_NAMESPACE);
Init_pango_script(RG_TARGET_NAMESPACE);
Init_pango_script_iter(RG_TARGET_NAMESPACE);
Init_pango_array(RG_TARGET_NAMESPACE);
}

View File

@ -0,0 +1,104 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "ruby.h"
#define PANGO_ENABLE_ENGINE
#define PANGO_ENABLE_BACKEND
#include <pango/pango.h>
#ifdef HAVE_FREETYPE2
#include <pango/pangofc-font.h>
#endif
#include "rbgobject.h"
#include "rbpangoversion.h"
#include "rbpangoconversions.h"
#if PANGO_CHECK_VERSION(1,10,0)
#include <pango/pangocairo.h>
# ifdef HAVE_RB_CAIRO_H
#include <rb_cairo.h>
# endif
#endif
#if defined(G_PLATFORM_WIN32) && !defined(RUBY_PANGO_STATIC_COMPILATION)
# ifdef RUBY_PANGO_COMPILATION
# define RUBY_PANGO_VAR __declspec(dllexport)
# else
# define RUBY_PANGO_VAR extern __declspec(dllimport)
# endif
#else
# define RUBY_PANGO_VAR extern
#endif
extern void Init_pango_inits();
RUBY_PANGO_VAR VALUE mPango;
#ifndef PANGO_TYPE_ITEM
#define PANGO_TYPE_ITEM (pango_item_get_type())
#endif
#define PANGO_TYPE_ANALYSIS (pango_analysis_get_type())
#define PANGO_TYPE_LOG_ATTR (pango_log_attr_get_type())
#ifndef PANGO_TYPE_LAYOUT_ITER
#define PANGO_TYPE_LAYOUT_ITER (pango_layout_iter_get_type())
#endif
#ifndef PANGO_TYPE_LAYOUT_LINE
#define PANGO_TYPE_LAYOUT_LINE (pango_layout_line_get_type())
#endif
#define PANGO_TYPE_RECTANGLE (pango_rectangle_get_type())
#define PANGO_TYPE_ATTR_ITERATOR (pango_attr_iter_get_type())
#define PANGO_TYPE_COVERAGE (pango_coverage_get_type())
#define PANGO_TYPE_GLYPH_INFO (pango_glyph_info_get_type())
#ifndef PANGO_TYPE_GLYPH_ITEM
# define PANGO_TYPE_GLYPH_ITEM (pango_glyph_item_get_type())
#endif
#if PANGO_CHECK_VERSION(1,4,0)
#define PANGO_TYPE_SCRIPT_ITER (pango_script_iter_get_type())
#endif
#define ATTR2RVAL(attr) (pango_make_attribute(attr))
#define RVAL2ATTR(attr) (pango_get_attribute(attr))
#define ATTRTYPE2CLASS(attr_type) (pango_get_attribute_klass(attr_type))
#define RBPANGO_ADD_ATTRIBUTE(type, klass) (pango_add_attribute(type, klass))
extern VALUE pango_make_attribute(PangoAttribute* attr);
extern PangoAttribute* pango_get_attribute(VALUE attr);
extern GType pango_item_get_type(void);
extern GType pango_analysis_get_type(void);
extern GType pango_log_attr_get_type(void);
extern GType pango_layout_iter_get_type(void);
extern GType pango_layout_line_get_type(void);
extern GType pango_rectangle_get_type(void);
extern GType pango_attr_iter_get_type(void);
extern GType pango_coverage_get_type(void);
extern GType pango_glyph_info_get_type(void);
#ifndef HAVE_PANGO_GLYPH_ITEM_GET_TYPE
extern GType pango_glyph_item_get_type(void);
#endif
#if PANGO_CHECK_VERSION(1,4,0)
extern GType pango_script_iter_get_type(void);
#endif
extern VALUE pango_get_attribute_klass(VALUE attr_type);
extern void pango_add_attribute(int attr_type, VALUE klass);

View File

@ -0,0 +1,222 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2003-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cAnalysis
#define _SELF(s) (RVAL2PANGOANALYSIS(s))
/**********************************/
static PangoAnalysis*
ana_copy(const PangoAnalysis* val)
{
PangoAnalysis* new_val;
g_return_val_if_fail (val != NULL, NULL);
new_val = g_new(PangoAnalysis, 1);
*new_val = *val;
return new_val;
}
GType
pango_analysis_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoAnalysis",
(GBoxedCopyFunc)ana_copy,
(GBoxedFreeFunc)g_free);
return our_type;
}
/**********************************/
static VALUE
rg_initialize(VALUE self)
{
PangoAnalysis analysis = { NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL };
G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_ANALYSIS, &analysis));
return Qnil;
}
#if PANGO_CHECK_VERSION(1,4,0)
static VALUE
rg_set_shape_engine(VALUE self, VALUE engine)
{
_SELF(self)->shape_engine = RVAL2PANGOENGINESHAPE(engine);
return self;
}
static VALUE
rg_shape_engine(VALUE self)
{
VALUE ret;
if (_SELF(self)->shape_engine){
const gchar* gname = G_OBJECT_TYPE_NAME(_SELF(self)->shape_engine);
gchar* name = g_strdup(gname);
name[0] = g_ascii_toupper(name[0]);
G_DEF_CLASS3(gname, name, mPango);
ret = GOBJ2RVAL(_SELF(self)->shape_engine);
} else {
ret = Qnil;
}
return ret;
}
static VALUE
rg_set_lang_engine(VALUE self, VALUE engine)
{
_SELF(self)->lang_engine = RVAL2PANGOENGINELANG(engine);
return self;
}
static VALUE
rg_lang_engine(VALUE self)
{
VALUE ret;
if (_SELF(self)->lang_engine){
const gchar* gname = G_OBJECT_TYPE_NAME(_SELF(self)->lang_engine);
gchar* name = g_strdup(gname);
name[0] = g_ascii_toupper(name[0]);
G_DEF_CLASS3(name, name, mPango);
ret = GOBJ2RVAL(_SELF(self)->lang_engine);
} else {
ret = Qnil;
}
return ret;
}
#endif
static VALUE
rg_set_font(VALUE self, VALUE font)
{
_SELF(self)->font = RVAL2PANGOFONT(font);
return self;
}
static VALUE
rg_font(VALUE self)
{
return GOBJ2RVAL(_SELF(self)->font);
}
static VALUE
rg_set_level(VALUE self, VALUE level)
{
_SELF(self)->level = NUM2UINT(level);
return self;
}
static VALUE
rg_level(VALUE self)
{
return UINT2NUM(_SELF(self)->level);
}
static VALUE
rg_set_language(VALUE self, VALUE lang)
{
_SELF(self)->language = RVAL2PANGOLANGUAGE(lang);
return self;
}
static VALUE
rg_language(VALUE self)
{
return PANGOLANGUAGE2RVAL(_SELF(self)->language);
}
struct ana_set_extra_attrs_args {
PangoAnalysis *analysis;
VALUE ary;
long n;
GSList *result;
};
static VALUE
ana_set_extra_attrs_body(VALUE value)
{
struct ana_set_extra_attrs_args *args = (struct ana_set_extra_attrs_args *)value;
long i;
for (i = 0; i < args->n; i++)
args->result = g_slist_append(args->result, RVAL2ATTR(RARRAY_PTR(args->ary)[i]));
args->analysis->extra_attrs = args->result;
return Qnil;
}
static G_GNUC_NORETURN VALUE
ana_set_extra_attrs_rescue(VALUE value)
{
g_slist_free(((struct ana_set_extra_attrs_args *)value)->result);
rb_exc_raise(rb_errinfo());
}
static VALUE
rg_set_extra_attrs(VALUE self, VALUE attrs)
{
struct ana_set_extra_attrs_args args;
args.analysis = _SELF(self);
args.ary = rb_ary_to_ary(attrs);
args.n = RARRAY_LEN(args.ary);
args.result = NULL;
rb_rescue(ana_set_extra_attrs_body, (VALUE)&args,
ana_set_extra_attrs_rescue, (VALUE)&args);
return self;
}
static VALUE
rg_extra_attrs(VALUE self)
{
VALUE ary = rb_ary_new();
GSList* list = _SELF(self)->extra_attrs;
while (list) {
rb_ary_push(ary, ATTR2RVAL(list->data));
list = list->next;
}
return ary;
}
void
Init_pango_analysis(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_ANALYSIS, "Analysis", mPango);
RG_DEF_METHOD(initialize, 0);
#if PANGO_CHECK_VERSION(1,4,0)
RG_DEF_METHOD(set_shape_engine, 1);
RG_DEF_METHOD(shape_engine, 0);
RG_DEF_METHOD(set_lang_engine, 1);
RG_DEF_METHOD(lang_engine, 0);
#endif
RG_DEF_METHOD(set_font, 1);
RG_DEF_METHOD(font, 0);
RG_DEF_METHOD(set_level, 1);
RG_DEF_METHOD(level, 0);
RG_DEF_METHOD(set_language, 1);
RG_DEF_METHOD(language, 0);
RG_DEF_METHOD(set_extra_attrs, 1);
RG_DEF_METHOD(extra_attrs, 0);
}

View File

@ -0,0 +1,524 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE pattr
VALUE RG_TARGET_NAMESPACE, attrstring, pattrint, pattrfloat, pattrcolor, pattrbool;
static VALUE type_to_klass;
/***********************************************/
void
pango_add_attribute(int attr_type, VALUE klass)
{
rb_hash_aset(type_to_klass, INT2FIX(attr_type), klass);
}
/* This is for Attributes which has PangoAttrType. */
VALUE
pango_get_attribute_klass(VALUE attr_type)
{
VALUE type = Qnil;
if (TYPE(attr_type) == T_STRING){
const char *strtype = RVAL2CSTR(attr_type);
if (strcmp(strtype, "Attribute") == 0){
type = RG_TARGET_NAMESPACE;
} else if (strcmp(strtype, "AttrString") == 0){
type = attrstring;
} else if (strcmp(strtype, "AttrInt") == 0){
type = pattrint;
} else if (strcmp(strtype, "AttrFloat") == 0){
type = pattrfloat;
} else if (strcmp(strtype, "AttrColor") == 0){
type = pattrcolor;
} else if (strcmp(strtype, "AttrBool") == 0){
type = pattrbool;
}
} else {
type = rb_hash_aref(type_to_klass, INT2FIX(attr_type));
}
return type;
}
VALUE
pango_make_attribute(PangoAttribute *attr)
{
if (attr == NULL) return Qnil;
return Data_Wrap_Struct(rb_hash_aref(type_to_klass, INT2FIX(attr->klass->type)), 0,
pango_attribute_destroy,
pango_attribute_copy(attr));
}
PangoAttribute*
pango_get_attribute(VALUE attr)
{
PangoAttribute *gattr;
if (NIL_P(attr)) return NULL;
if (!rb_obj_is_kind_of(attr, RG_TARGET_NAMESPACE)) {
rb_raise(rb_eTypeError, "not a Pango::Attribute...");
}
Data_Get_Struct(attr, PangoAttribute, gattr);
return gattr;
}
/***********************************************/
static VALUE
rg_s_allocate(VALUE klass)
{
/* Don't define destroy method here.
return Data_Wrap_Struct(klass, 0, pango_attribute_destroy, 0);
*/
return Data_Wrap_Struct(klass, NULL, NULL, 0);
}
#ifdef HAVE_OBJECT_ALLOCATE
#define attr_s_new rb_class_new_instance
#else
static VALUE
rg_s_new(int argc, VALUE *argv, VALUE klass)
{
VALUE obj = rg_s_allocate(klass);
rb_obj_call_init(obj, argc, argv);
return obj;
}
#endif
/***********************************************/
/* This method implemented at rbpangomain.c
gboolean pango_parse_markup (const char *markup_text,
int length,
gunichar accel_marker,
PangoAttrList **attr_list,
char **text,
gunichar *accel_char,
GError **error);
*/
static VALUE
rg_s_type_register(G_GNUC_UNUSED VALUE self, VALUE name)
{
return INT2NUM(pango_attr_type_register(RVAL2CSTR(name)));
}
static VALUE
rg_operator_attr_equal(VALUE self, VALUE other)
{
return CBOOL2RVAL(pango_attribute_equal(RVAL2ATTR(self), RVAL2ATTR(other)));
}
/*
* Structure accessors
*/
/* PangoAttribute */
static VALUE
rg_start_index(VALUE self)
{
return UINT2NUM(RVAL2ATTR(self)->start_index);
}
static VALUE
rg_set_start_index(VALUE self, VALUE value)
{
RVAL2ATTR(self)->start_index = NUM2UINT(value);
return Qnil;
}
static VALUE
rg_end_index(VALUE self)
{
return UINT2NUM(RVAL2ATTR(self)->end_index);
}
static VALUE
rg_set_end_index(VALUE self, VALUE value)
{
RVAL2ATTR(self)->end_index = NUM2UINT(value);
return Qnil;
}
/* PangoAttrString */
static VALUE
attr_string_value(VALUE self)
{
return CSTR2RVAL(((PangoAttrString*)RVAL2ATTR(self))->value);
}
/* PangoAttrLanguage */
static VALUE
attr_language_value(VALUE self)
{
return PANGOLANGUAGE2RVAL(((PangoAttrLanguage*)RVAL2ATTR(self))->value);
}
/* PangoAttrColor */
static VALUE
attr_color_value(VALUE self)
{
PangoColor color = ((PangoAttrColor*)RVAL2ATTR(self))->color;
return PANGOCOLOR2RVAL(&color);
}
/* PangoAttrInt */
static VALUE
attr_int_value(VALUE self)
{
return INT2NUM(((PangoAttrInt*)RVAL2ATTR(self))->value);
}
/* PangoAttrFloat */
static VALUE
attr_float_value(VALUE self)
{
return rb_float_new(((PangoAttrFloat*)RVAL2ATTR(self))->value);
}
/* PangoAttrBool(This is Ruby/Pango's original class) */
static VALUE
attr_bool_value(VALUE self)
{
return CBOOL2RVAL(((PangoAttrInt*)RVAL2ATTR(self))->value);
}
/* PangoAttrFontDesc */
static VALUE
attr_fontdesc_value(VALUE self)
{
return PANGOFONTDESCRIPTION2RVAL(((PangoAttrFontDesc*)RVAL2ATTR(self))->desc);
}
/* PangoAttrShape */
static VALUE
attr_shape_ink_rect(VALUE self)
{
PangoRectangle rect = ((PangoAttrShape*)RVAL2ATTR(self))->ink_rect;
return PANGORECTANGLE2RVAL(&rect);
}
static VALUE
attr_shape_logical_rect(VALUE self)
{
PangoRectangle rect = ((PangoAttrShape*)RVAL2ATTR(self))->logical_rect;
return PANGORECTANGLE2RVAL(&rect);
}
static VALUE
attr_shape_value(VALUE self)
{
return rb_ary_new3(2, attr_shape_ink_rect(self), attr_shape_logical_rect(self));
}
/*
* Initialize methods
*/
#define MAKE_ATTRINT_INIT(klassname, funcname)\
static VALUE \
attr_ ## klassname ## _initialize(VALUE self, VALUE val)\
{\
DATA_PTR(self) = pango_attr_ ## funcname ## _new(NUM2INT(val));\
return Qnil;\
}
#define MAKE_ATTRENUM_INIT(klassname, funcname, type)\
static VALUE \
attr_ ## klassname ## _initialize(VALUE self, VALUE val)\
{\
DATA_PTR(self) = pango_attr_ ## funcname ## _new(RVAL2GENUM(val, type));\
return Qnil;\
}
static VALUE
attr_AttrLanguage_initialize(VALUE self, VALUE lang)
{
DATA_PTR(self) = pango_attr_language_new(
RVAL2PANGOLANGUAGE(lang));
return Qnil;
}
static VALUE
attr_AttrFamily_initialize(VALUE self, VALUE family)
{
DATA_PTR(self) = pango_attr_family_new(RVAL2CSTR(family));
return Qnil;
}
MAKE_ATTRENUM_INIT(AttrStyle, style, PANGO_TYPE_STYLE);
MAKE_ATTRENUM_INIT(AttrVariant, variant, PANGO_TYPE_VARIANT);
MAKE_ATTRENUM_INIT(AttrStretch, stretch, PANGO_TYPE_STRETCH);
MAKE_ATTRENUM_INIT(AttrWeight, weight, PANGO_TYPE_WEIGHT);
static VALUE
attr_AttrSize_initialize(VALUE self, VALUE size)
{
DATA_PTR(self) = pango_attr_size_new(NUM2INT(size));
return Qnil;
}
#if PANGO_CHECK_VERSION(1,8,1)
static VALUE
attr_AttrAbsoluteSize_initialize(VALUE self, VALUE size)
{
DATA_PTR(self) = pango_attr_size_new_absolute(NUM2INT(size));
return Qnil;
}
#endif
#if PANGO_CHECK_VERSION(1,16,0)
static VALUE
attr_AttrGravity_initialize(VALUE self, VALUE gravity)
{
DATA_PTR(self) = pango_attr_gravity_new(RVAL2PANGOGRAVITY(gravity));
return Qnil;
}
static VALUE
attr_AttrGravityHint_initialize(VALUE self, VALUE gravity_hint)
{
DATA_PTR(self) = pango_attr_gravity_hint_new(RVAL2PANGOGRAVITYHINT(gravity_hint));
return Qnil;
}
#endif
static VALUE
attr_AttrFontDescription_initialize(VALUE self, VALUE fontdescription)
{
DATA_PTR(self) = pango_attr_font_desc_new(RVAL2PANGOFONTDESCRIPTION(fontdescription));
return Qnil;
}
static VALUE
attr_AttrForeground_initialize(VALUE self, VALUE r, VALUE g, VALUE b)
{
DATA_PTR(self) = pango_attr_foreground_new(FIX2UINT(r), FIX2UINT(g), FIX2UINT(b));
return Qnil;
}
static VALUE
attr_AttrBackground_initialize(VALUE self, VALUE r, VALUE g, VALUE b)
{
DATA_PTR(self) = pango_attr_background_new(FIX2UINT(r), FIX2UINT(g), FIX2UINT(b));
return Qnil;
}
static VALUE
attr_AttrStrikethrough_initialize(VALUE self, VALUE strikethrough)
{
DATA_PTR(self) = pango_attr_strikethrough_new(RVAL2CBOOL(strikethrough));
return Qnil;
}
#ifdef HAVE_PANGO_ATTR_STRIKETHROUGH_COLOR_NEW
static VALUE
attr_AttrStrikethroughColor_initialize(VALUE self, VALUE r, VALUE g, VALUE b)
{
DATA_PTR(self) = pango_attr_strikethrough_color_new(FIX2UINT(r), FIX2UINT(g), FIX2UINT(b));
return Qnil;
}
#endif
MAKE_ATTRENUM_INIT(AttrUnderline, underline, PANGO_TYPE_UNDERLINE);
#ifdef HAVE_PANGO_ATTR_UNDERLINE_COLOR_NEW
static VALUE
attr_AttrUnderlineColor_initialize(VALUE self, VALUE r, VALUE g, VALUE b)
{
DATA_PTR(self) = pango_attr_underline_color_new(FIX2UINT(r), FIX2UINT(g), FIX2UINT(b));
return Qnil;
}
#endif
static VALUE
attr_AttrShape_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE ink_rect, logical_rect, data;
rb_scan_args(argc, argv, "21", &ink_rect, &logical_rect, &data);
if (NIL_P(data)){
DATA_PTR(self) = pango_attr_shape_new(
RVAL2PANGORECTANGLE(ink_rect),
RVAL2PANGORECTANGLE(logical_rect));
} else {
#if PANGO_CHECK_VERSION(1,8,0)
G_RELATIVE(self, data);
DATA_PTR(self) = pango_attr_shape_new_with_data(
RVAL2PANGORECTANGLE(ink_rect),
RVAL2PANGORECTANGLE(logical_rect),
(gpointer)data, NULL, NULL);
#else
rb_warning("not supported in Pango-1.6.x. the 3rd parameter was ignored.");
DATA_PTR(self) = pango_attr_shape_new(
RVAL2PANGORECTANGLE(ink_rect),
RVAL2PANGORECTANGLE(logical_rect));
#endif
}
return Qnil;
}
static VALUE
attr_AttrScale_initialize(VALUE self, VALUE scale)
{
DATA_PTR(self) = pango_attr_scale_new(NUM2DBL(scale));
return Qnil;
}
#if PANGO_CHECK_VERSION(1,4,0)
static VALUE
attr_AttrFallback_initialize(VALUE self, VALUE enable_fallback)
{
DATA_PTR(self) = pango_attr_fallback_new(RVAL2CBOOL(enable_fallback));
return Qnil;
}
#endif
MAKE_ATTRINT_INIT(AttrRise, rise);
#if PANGO_CHECK_VERSION(1,6,0)
MAKE_ATTRINT_INIT(AttrLetterSpacing, letter_spacing);
#endif
#define MAKE_ATTR(gtype, name, parent, num)\
tmpklass = rb_define_class_under(mPango, #name, parent);\
rb_hash_aset(type_to_klass, INT2FIX(gtype), tmpklass);\
rbg_define_method(tmpklass, "initialize", attr_## name ## _initialize , num);
void
Init_pango_attribute(VALUE mPango)
{
VALUE tmpklass;
RG_TARGET_NAMESPACE = rb_define_class_under(mPango, "Attribute", rb_cData);
RG_DEF_SMETHOD(type_register, 1);
RG_DEF_METHOD_OPERATOR("==", attr_equal, 1);
RG_DEF_METHOD(start_index, 0);
RG_DEF_METHOD(set_start_index, 1);
RG_DEF_METHOD(end_index, 0);
RG_DEF_METHOD(set_end_index, 1);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
RG_DEF_SMETHOD(allocate, 0);
#else
rb_define_alloc_func(RG_TARGET_NAMESPACE, (VALUE(*)_((VALUE)))rg_s_allocate);
#endif
#ifndef HAVE_OBJECT_ALLOCATE
RG_DEF_SMETHOD(new, -1);
#endif
attrstring = rb_define_class_under(mPango, "AttrString", RG_TARGET_NAMESPACE);
rbg_define_method(attrstring, "value", attr_string_value, 0);
pattrint = rb_define_class_under(mPango, "AttrInt", RG_TARGET_NAMESPACE);
rbg_define_method(pattrint, "value", attr_int_value, 0);
pattrfloat = rb_define_class_under(mPango, "AttrFloat", RG_TARGET_NAMESPACE);
rbg_define_method(pattrfloat, "value", attr_float_value, 0);
pattrcolor = rb_define_class_under(mPango, "AttrColor", RG_TARGET_NAMESPACE);
rbg_define_method(pattrcolor, "value", attr_color_value, 0);
pattrbool = rb_define_class_under(mPango, "AttrBool", RG_TARGET_NAMESPACE);
rbg_define_method(pattrbool, "value", attr_bool_value, 0);
rb_global_variable(&type_to_klass);
type_to_klass = rb_hash_new();
MAKE_ATTR(PANGO_ATTR_LANGUAGE, AttrLanguage, RG_TARGET_NAMESPACE, 1);
rbg_define_method(tmpklass, "value", attr_language_value, 0);
MAKE_ATTR(PANGO_ATTR_FAMILY, AttrFamily, attrstring, 1);
MAKE_ATTR(PANGO_ATTR_STYLE, AttrStyle, pattrint, 1);
MAKE_ATTR(PANGO_ATTR_WEIGHT, AttrWeight, pattrint, 1);
MAKE_ATTR(PANGO_ATTR_VARIANT, AttrVariant, pattrint, 1);
MAKE_ATTR(PANGO_ATTR_STRETCH, AttrStretch, pattrint, 1);
MAKE_ATTR(PANGO_ATTR_SIZE, AttrSize, pattrint, 1);
#if PANGO_CHECK_VERSION(1,8,1)
MAKE_ATTR(PANGO_ATTR_ABSOLUTE_SIZE, AttrAbsoluteSize, pattrint, 1);
#endif
#if PANGO_CHECK_VERSION(1,16,0)
MAKE_ATTR(PANGO_ATTR_GRAVITY, AttrGravity, pattrint, 1);
MAKE_ATTR(PANGO_ATTR_GRAVITY_HINT, AttrGravityHint, pattrint, 1);
#endif
MAKE_ATTR(PANGO_ATTR_FONT_DESC, AttrFontDescription, RG_TARGET_NAMESPACE, 1);
rbg_define_method(tmpklass, "value", attr_fontdesc_value, 0);
MAKE_ATTR(PANGO_ATTR_FOREGROUND, AttrForeground, pattrcolor, 3);
MAKE_ATTR(PANGO_ATTR_BACKGROUND, AttrBackground, pattrcolor, 3);
MAKE_ATTR(PANGO_ATTR_UNDERLINE, AttrUnderline, pattrint, 1);
/* PangoUnderline */
G_DEF_CLASS(PANGO_TYPE_UNDERLINE, "Underline", tmpklass);
G_DEF_CONSTANTS(tmpklass, PANGO_TYPE_UNDERLINE, "PANGO_UNDERLINE_");
#ifdef HAVE_PANGO_ATTR_UNDERLINE_COLOR_NEW
MAKE_ATTR(PANGO_ATTR_UNDERLINE_COLOR, AttrUnderlineColor, pattrcolor, 3);
#endif
MAKE_ATTR(PANGO_ATTR_STRIKETHROUGH, AttrStrikethrough, pattrbool, 1);
#ifdef HAVE_PANGO_ATTR_STRIKETHROUGH_COLOR_NEW
MAKE_ATTR(PANGO_ATTR_STRIKETHROUGH_COLOR, AttrStrikethroughColor, pattrcolor, 3);
#endif
MAKE_ATTR(PANGO_ATTR_RISE, AttrRise, pattrint, 1);
#if PANGO_CHECK_VERSION(1,6,0)
MAKE_ATTR(PANGO_ATTR_LETTER_SPACING, AttrLetterSpacing, pattrint, 1);
#endif
MAKE_ATTR(PANGO_ATTR_SHAPE, AttrShape, RG_TARGET_NAMESPACE, -1);
rbg_define_method(tmpklass, "ink_rect", attr_shape_ink_rect, 0);
rbg_define_method(tmpklass, "logical_rect", attr_shape_logical_rect, 0);
rbg_define_method(tmpklass, "value", attr_shape_value, 0);
MAKE_ATTR(PANGO_ATTR_SCALE, AttrScale, pattrfloat, 1);
/* PangoScale */
rb_define_const(tmpklass, "XX_SMALL", rb_float_new(PANGO_SCALE_XX_SMALL));
rb_define_const(tmpklass, "X_SMALL", rb_float_new(PANGO_SCALE_X_SMALL));
rb_define_const(tmpklass, "SMALL", rb_float_new(PANGO_SCALE_SMALL));
rb_define_const(tmpklass, "MEDIUM", rb_float_new(PANGO_SCALE_MEDIUM));
rb_define_const(tmpklass, "LARGE", rb_float_new(PANGO_SCALE_LARGE));
rb_define_const(tmpklass, "X_LARGE", rb_float_new(PANGO_SCALE_X_LARGE));
rb_define_const(tmpklass, "XX_LARGE", rb_float_new(PANGO_SCALE_XX_LARGE));
#if PANGO_CHECK_VERSION(1,4,0)
MAKE_ATTR(PANGO_ATTR_FALLBACK, AttrFallback, pattrbool, 1);
#endif
/* PangoAttrType */
G_DEF_CLASS(PANGO_TYPE_ATTR_TYPE, "Type", RG_TARGET_NAMESPACE);
#define INT2ATTRTYPE(x) rbgobj_make_enum((x), PANGO_TYPE_ATTR_TYPE)
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_INVALID", INT2ATTRTYPE(PANGO_ATTR_INVALID));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_LANGUAGE", INT2ATTRTYPE(PANGO_ATTR_LANGUAGE));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_FAMILY", INT2ATTRTYPE(PANGO_ATTR_FAMILY));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STYLE", INT2ATTRTYPE(PANGO_ATTR_STYLE));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_WEIGHT", INT2ATTRTYPE(PANGO_ATTR_WEIGHT));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_VARIANT", INT2ATTRTYPE(PANGO_ATTR_VARIANT));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRETCH", INT2ATTRTYPE(PANGO_ATTR_STRETCH));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_SIZE", INT2ATTRTYPE(PANGO_ATTR_SIZE));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_FONT_DESC", INT2ATTRTYPE(PANGO_ATTR_FONT_DESC));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_FOREGROUND", INT2ATTRTYPE(PANGO_ATTR_FOREGROUND));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_BACKGROUND", INT2ATTRTYPE(PANGO_ATTR_BACKGROUND));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_UNDERLINE", INT2ATTRTYPE(PANGO_ATTR_UNDERLINE));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRIKETHROUGH", INT2ATTRTYPE(PANGO_ATTR_STRIKETHROUGH));
#if PANGO_CHECK_VERSION(1,8,0)
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRIKETHROUGH_COLOR", INT2ATTRTYPE(PANGO_ATTR_STRIKETHROUGH_COLOR));
#endif
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_RISE", INT2ATTRTYPE(PANGO_ATTR_RISE));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_SHAPE", INT2ATTRTYPE(PANGO_ATTR_SHAPE));
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_SCALE", INT2ATTRTYPE(PANGO_ATTR_SCALE));
#if PANGO_CHECK_VERSION(1,8,0)
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_FALLBACK", INT2ATTRTYPE(PANGO_ATTR_FALLBACK));
#endif
#if PANGO_CHECK_VERSION(1,6,0)
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_LETTER_SPACING", INT2ATTRTYPE(PANGO_ATTR_LETTER_SPACING));
#endif
}

View File

@ -0,0 +1,141 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cAttrIterator
#define _SELF(self) (RVAL2PANGOATTRITERATOR(self))
/**********************************/
GType
pango_attr_iter_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoAttrIterator",
(GBoxedCopyFunc)pango_attr_iterator_copy,
(GBoxedFreeFunc)pango_attr_iterator_destroy);
return our_type;
}
/**********************************/
static VALUE
rg_next_bang(VALUE self)
{
return CBOOL2RVAL(pango_attr_iterator_next(_SELF(self)));
}
static VALUE
rg_range(VALUE self)
{
gint start = 0;
gint end = 0;
pango_attr_iterator_range(_SELF(self), &start, &end);
return rb_ary_new3(2, INT2NUM(start), INT2NUM(end));
}
static VALUE
rg_get(int argc, VALUE *argv, VALUE self)
{
VALUE type, ret;
PangoAttribute* attr;
int i;
rb_scan_args(argc, argv, "01", &type);
if (NIL_P(type)){
PangoAttrIterator* iter = _SELF(self);
ret = rb_ary_new();
for (i = 0; i < PANGO_ATTR_SCALE + 1; i++){
attr = pango_attr_iterator_get(iter, i);
if (attr)
rb_ary_push(ret, ATTR2RVAL(attr));
}
} else {
attr = pango_attr_iterator_get(_SELF(self), FIX2INT(type));
ret = attr ? ATTR2RVAL(attr) : Qnil;
}
return ret;
}
static VALUE
rg_font(VALUE self)
{
PangoFontDescription* desc;
PangoLanguage* lang;
GSList* extra_attrs;
VALUE ary, ret;
desc = pango_font_description_new();
pango_attr_iterator_get_font(_SELF(self), desc, &lang, &extra_attrs);
ary = rb_ary_new();
while(extra_attrs) {
rb_ary_push(ary, ATTR2RVAL(extra_attrs->data));
extra_attrs = extra_attrs->next;
}
ret = rb_ary_new3(3, PANGOFONTDESCRIPTION2RVAL(desc),
PANGOLANGUAGE2RVAL(lang),
ary);
pango_font_description_free(desc);
return ret;
}
#ifdef HAVE_PANGO_ATTR_ITERATOR_GET_ATTRS
static VALUE
rg_attrs(VALUE self)
{
GSList* list = pango_attr_iterator_get_attrs(_SELF(self));
GSList* base = list;
GSList* old = list;
VALUE ary = rb_ary_new();
while (list) {
rb_ary_push(ary, ATTR2RVAL(list->data));
list = list->next;
}
while (old) {
pango_attribute_destroy((PangoAttribute*)old);
old = old->next;
}
g_slist_free(base);
return ary;
}
#endif
void
Init_pango_attriterator(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_ATTR_ITERATOR, "AttrIterator", mPango);
RG_DEF_METHOD_BANG(next, 0);
RG_DEF_METHOD(range, 0);
RG_DEF_METHOD(get, -1);
RG_DEF_METHOD(font, 0);
#ifdef HAVE_PANGO_ATTR_ITERATOR_GET_ATTRS
RG_DEF_METHOD(attrs, 0);
#endif
}

View File

@ -0,0 +1,105 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
static ID id_call;
#define RG_TARGET_NAMESPACE cAttrList
#define _SELF(self) (RVAL2PANGOATTRLIST(self))
static VALUE
rg_initialize(VALUE self)
{
G_INITIALIZE(self, pango_attr_list_new());
return Qnil;
}
static VALUE
rg_insert(VALUE self, VALUE attr)
{
pango_attr_list_insert(_SELF(self), RVAL2ATTR(attr));
return self;
}
static VALUE
rg_insert_before(VALUE self, VALUE attr)
{
pango_attr_list_insert_before(_SELF(self), RVAL2ATTR(attr));
return self;
}
static VALUE
rg_change(VALUE self, VALUE attr)
{
pango_attr_list_change(_SELF(self), RVAL2ATTR(attr));
return self;
}
static VALUE
rg_splice(VALUE self, VALUE other, VALUE pos, VALUE len)
{
pango_attr_list_splice(_SELF(self), _SELF(other), NUM2INT(pos), NUM2INT(len));
return self;
}
#if PANGO_CHECK_VERSION(1,4,0)
static gboolean
filter_func(PangoAttribute *attr, gpointer data)
{
return CBOOL2RVAL(rb_funcall((VALUE)data, id_call, 1, ATTR2RVAL(attr)));
}
static VALUE
rg_filter(VALUE self)
{
VALUE func = rb_block_proc();
G_RELATIVE(self, func);
return PANGOATTRLIST2RVAL(pango_attr_list_filter(_SELF(self),
(PangoAttrFilterFunc)filter_func,
(gpointer)func));
}
#endif
static VALUE
rg_iterator(VALUE self)
{
return PANGOATTRITERATOR2RVAL(pango_attr_list_get_iterator(_SELF(self)));
}
void
Init_pango_attrlist(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_ATTR_LIST, "AttrList", mPango);
id_call = rb_intern("call");
RG_DEF_METHOD(initialize, 0);
RG_DEF_METHOD(insert, 1);
RG_DEF_METHOD(insert_before, 1);
RG_DEF_METHOD(change, 1);
RG_DEF_METHOD(splice, 3);
#if PANGO_CHECK_VERSION(1,4,0)
RG_DEF_METHOD(filter, 0);
#endif
RG_DEF_METHOD(iterator, 0);
}

View File

@ -0,0 +1,115 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2006 Ruby-GNOME2 Project Team
* Copyright (C) 2005 Kouhei Sutou
*
* 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 "rbpangoprivate.h"
#ifdef CAIRO_AVAILABLE
#define RG_TARGET_NAMESPACE cCairoFontMap
#define _SELF(self) (RVAL2PANGOCAIROFONTMAP(self))
static VALUE
rg_s_create(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass)
{
VALUE rb_font_type;
PangoFontMap *font_map = NULL;
rb_scan_args(argc, argv, "01", &rb_font_type);
if (NIL_P(rb_font_type)) {
font_map = pango_cairo_font_map_new();
} else {
cairo_font_type_t font_type = CAIRO_FONT_TYPE_USER;
if (rbgutil_key_equal(rb_font_type, "ft") ||
rbgutil_key_equal(rb_font_type, "freetype")) {
font_type = CAIRO_FONT_TYPE_FT;
} else if (rbgutil_key_equal(rb_font_type, "win32")) {
font_type = CAIRO_FONT_TYPE_WIN32;
} else if (rbgutil_key_equal(rb_font_type, "quartz")) {
font_type = CAIRO_FONT_TYPE_QUARTZ;
} else {
rb_raise(rb_eArgError,
"font type must be one of "
":ft, :freetype, :win32 or :quartz: %s",
RBG_INSPECT(rb_font_type));
}
font_map = pango_cairo_font_map_new_for_font_type(font_type);
}
return GOBJ2RVAL(font_map);
}
static VALUE
rg_s_default(G_GNUC_UNUSED VALUE klass)
{
return GOBJ2RVAL(pango_cairo_font_map_get_default());
}
# if PANGO_CHECK_VERSION(1, 22, 0)
static VALUE
rg_s_set_default(VALUE klass, VALUE font_map)
{
pango_cairo_font_map_set_default(RVAL2GOBJ(font_map));
return klass;
}
# endif
static VALUE
rg_set_resolution(VALUE self, VALUE dpi)
{
pango_cairo_font_map_set_resolution(_SELF(self), NUM2DBL(dpi));
return self;
}
static VALUE
rg_resolution(VALUE self)
{
return rb_float_new(pango_cairo_font_map_get_resolution(_SELF(self)));
}
static VALUE
rg_create_context(VALUE self)
{
return GOBJ2RVAL_UNREF(pango_cairo_font_map_create_context(_SELF(self)));
}
#endif
void
Init_pango_cairo(VALUE mPango)
{
#ifdef CAIRO_AVAILABLE
VALUE RG_TARGET_NAMESPACE;
/* Pango::CairoFontMap */
RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_CAIRO_FONT_MAP, "CairoFontMap", mPango);
RG_DEF_SMETHOD(create, -1);
RG_DEF_SMETHOD(default, 0);
# if PANGO_CHECK_VERSION(1, 22, 0)
RG_DEF_SMETHOD(set_default, 1);
# endif
RG_DEF_METHOD(set_resolution, 1);
RG_DEF_METHOD(resolution, 0);
RG_DEF_METHOD(create_context, 0);
#endif
}

View File

@ -0,0 +1,151 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2006 Ruby-GNOME2 Project Team
* Copyright (C) 2005 Kouhei Sutou
*
* 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 "rbpangoprivate.h"
#if PANGO_CHECK_VERSION(1,10,0) && defined(HAVE_RB_CAIRO_H)
# define CAIRO_AVAILABLE 1
#endif
#ifdef CAIRO_AVAILABLE
#define RG_TARGET_NAMESPACE rb_cCairo_Context
static VALUE
rg_update_pango_context(VALUE self, VALUE context)
{
pango_cairo_update_context(RVAL2CRCONTEXT(self), RVAL2PANGOCONTEXT(context));
return self;
}
/* Convenience */
static VALUE
rg_create_pango_layout(VALUE self)
{
return GOBJ2RVAL_UNREF(pango_cairo_create_layout(RVAL2CRCONTEXT(self)));
}
static VALUE
rg_update_pango_layout(VALUE self, VALUE layout)
{
pango_cairo_update_layout(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUT(layout));
return self;
}
/* Rendering */
static VALUE
rg_show_pango_glyph_string(VALUE self, VALUE font, VALUE glyphs)
{
pango_cairo_show_glyph_string(RVAL2CRCONTEXT(self),
RVAL2PANGOFONT(font),
RVAL2PANGOGLYPHSTRING(glyphs));
return self;
}
static VALUE
rg_show_pango_layout_line(VALUE self, VALUE line)
{
pango_cairo_show_layout_line(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUTLINE(line));
return self;
}
static VALUE
rg_show_pango_layout(VALUE self, VALUE layout)
{
pango_cairo_show_layout(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUT(layout));
return self;
}
#if PANGO_CHECK_VERSION(1,14,0)
static VALUE
rg_show_pango_error_underline(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
{
pango_cairo_show_error_underline(RVAL2CRCONTEXT(self),
NUM2DBL(x), NUM2DBL(y),
NUM2DBL(width), NUM2DBL(height));
return self;
}
#endif
/* Rendering to a path */
static VALUE
rg_pango_glyph_string_path(VALUE self, VALUE font, VALUE glyphs)
{
pango_cairo_glyph_string_path(RVAL2CRCONTEXT(self),
RVAL2PANGOFONT(font),
RVAL2PANGOGLYPHSTRING(glyphs));
return self;
}
static VALUE
rg_pango_layout_line_path(VALUE self, VALUE line)
{
pango_cairo_layout_line_path(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUTLINE(line));
return self;
}
static VALUE
rg_pango_layout_path(VALUE self, VALUE layout)
{
pango_cairo_layout_path(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUT(layout));
return self;
}
#if PANGO_CHECK_VERSION(1,14,0)
static VALUE
rg_pango_error_underline_path(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
{
pango_cairo_error_underline_path(RVAL2CRCONTEXT(self),
NUM2DBL(x), NUM2DBL(y),
NUM2DBL(width), NUM2DBL(height));
return self;
}
#endif
#endif
void
Init_pango_cairo_context(VALUE mPango)
{
#ifdef CAIRO_AVAILABLE
/* Cairo::Context */
RG_DEF_METHOD(update_pango_context, 1);
/* Convenience */
RG_DEF_METHOD(create_pango_layout, 0);
RG_DEF_METHOD(update_pango_layout, 1);
/* Rendering */
RG_DEF_METHOD(show_pango_glyph_string, 2);
RG_DEF_METHOD(show_pango_layout_line, 1);
RG_DEF_METHOD(show_pango_layout, 1);
#if PANGO_CHECK_VERSION(1,14,0)
RG_DEF_METHOD(show_pango_error_underline, 4);
#endif
/* Rendering to a path */
RG_DEF_METHOD(pango_glyph_string_path, 2);
RG_DEF_METHOD(pango_layout_line_path, 1);
RG_DEF_METHOD(pango_layout_path, 1);
#if PANGO_CHECK_VERSION(1,14,0)
RG_DEF_METHOD(pango_error_underline_path, 4);
#endif
#endif
}

View File

@ -0,0 +1,120 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002,2003 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cColor
#define _SELF(self) (RVAL2PANGOCOLOR(self))
static VALUE
rg_initialize(VALUE self, VALUE red, VALUE green, VALUE blue)
{
PangoColor color;
color.red = NUM2UINT(red);
color.green = NUM2UINT(green);
color.blue = NUM2UINT(blue);
G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_COLOR, &color));
return Qnil;
}
static VALUE
rg_parse(VALUE self, VALUE spec)
{
return CBOOL2RVAL(pango_color_parse(_SELF(self), RVAL2CSTR(spec)));
}
static VALUE
rg_red(VALUE self)
{
return UINT2NUM(_SELF(self)->red);
}
static VALUE
rg_set_red(VALUE self, VALUE red)
{
_SELF(self)->red = NUM2UINT(red);
return self;
}
static VALUE
rg_green(VALUE self)
{
return UINT2NUM(_SELF(self)->green);
}
static VALUE
rg_set_green(VALUE self, VALUE green)
{
_SELF(self)->green = NUM2UINT(green);
return self;
}
static VALUE
rg_blue(VALUE self)
{
return UINT2NUM(_SELF(self)->blue);
}
static VALUE
rg_set_blue(VALUE self, VALUE blue)
{
_SELF(self)->blue = NUM2UINT(blue);
return self;
}
static VALUE
rg_to_a(VALUE self)
{
PangoColor *c = _SELF(self);
return rb_ary_new3(3,
UINT2NUM(c->red),
UINT2NUM(c->green),
UINT2NUM(c->blue));
}
static VALUE
rg_operator_color_equal(VALUE self, VALUE other)
{
PangoColor* c1 = _SELF(self);
PangoColor* c2 = _SELF(other);
return CBOOL2RVAL((c1->red == c2->red) && (c1->green == c2->green) &&
(c1->blue == c2->blue));
}
void
Init_pango_color(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_COLOR, "Color", mPango);
RG_DEF_METHOD(initialize, 3);
RG_DEF_METHOD(parse, 1);
RG_DEF_METHOD(red, 0);
RG_DEF_METHOD(set_red, 1);
RG_DEF_METHOD(green, 0);
RG_DEF_METHOD(set_green, 1);
RG_DEF_METHOD(blue, 0);
RG_DEF_METHOD(set_blue, 1);
RG_DEF_METHOD(to_a, 0);
RG_DEF_METHOD_OPERATOR("==", color_equal, 1);
}

View File

@ -0,0 +1,321 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cContext
#define _SELF(self) (RVAL2PANGOCONTEXT(self))
static VALUE
rg_itemize(int argc, VALUE *argv, VALUE self)
{
VALUE arg1, arg2, arg3, arg4, arg5, arg6;
GList* list;
rb_scan_args(argc, argv, "42", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6);
if (TYPE(arg1) == T_STRING) {
list = pango_itemize(_SELF(self),
RVAL2CSTR(arg1), /* text */
NUM2INT(arg2), /* start_index */
NUM2INT(arg3), /* length */
RVAL2PANGOATTRLIST(arg4), /* attrs */
NIL_P(arg5) ? NULL : RVAL2PANGOATTRITERATOR(arg5)); /* cached_iter */
} else {
#ifdef HAVE_PANGO_ITEMIZE_WITH_BASE_DIR
list = pango_itemize_with_base_dir(_SELF(self),
RVAL2PANGODIRECTION(arg1), /* base_dir */
RVAL2CSTR(arg2), /* text */
NUM2INT(arg3), /* start_index */
NUM2INT(arg4), /* length */
RVAL2PANGOATTRLIST(arg5), /* attrs */
NIL_P(arg6) ? NULL : RVAL2PANGOATTRITERATOR(arg6)); /* cached_iter */
#else
rb_warn("Pango::Context#itemize(base_dir, text, start_index, length, attrs, cached_iter) isn't supported on this environment.");
list = pango_itemize(_SELF(self),
RVAL2CSTR(arg1), /* text */
NUM2INT(arg2), /* start_index */
NUM2INT(arg3), /* length */
RVAL2PANGOATTRLIST(arg4), /* attrs */
NIL_P(arg5) ? NULL : RVAL2PANGOATTRITERATOR(arg5)); /* cached_iter */
#endif
}
return GLIST2ARY2F(list, PANGO_TYPE_ITEM);
}
/* Move to Pango module (rbpangomain.c)
GList* pango_reorder_items (GList *logical_items);
*/
#ifdef PANGO_ENABLE_BACKEND
static VALUE
rg_initialize(VALUE self)
{
G_INITIALIZE(self, pango_context_new());
return Qnil;
}
static VALUE
rg_set_font_map(VALUE self, VALUE font_map)
{
pango_context_set_font_map(_SELF(self), RVAL2PANGOFONTMAP(font_map));
return self;
}
#if PANGO_CHECK_VERSION(1,6,0)
static VALUE
rg_font_map(VALUE self)
{
return GOBJ2RVAL(pango_context_get_font_map(_SELF(self)));
}
#endif
#endif /* PANGO_ENABLE_BACKEND */
static VALUE
rg_font_description(VALUE self)
{
PangoFontDescription* ret = pango_context_get_font_description(_SELF(self));
return PANGOFONTDESCRIPTION2RVAL(ret);
}
static VALUE
rg_set_font_description(VALUE self, VALUE desc)
{
pango_context_set_font_description(_SELF(self), RVAL2PANGOFONTDESCRIPTION(desc));
return self;
}
static VALUE
rg_language(VALUE self)
{
PangoLanguage* ret = pango_context_get_language(_SELF(self));
return PANGOLANGUAGE2RVAL(ret);
}
static VALUE
rg_set_language(VALUE self, VALUE lang)
{
pango_context_set_language(_SELF(self),
RVAL2PANGOLANGUAGE(lang));
return self;
}
static VALUE
rg_base_dir(VALUE self)
{
return PANGODIRECTION2RVAL(pango_context_get_base_dir(_SELF(self)));
}
static VALUE
rg_set_base_dir(VALUE self, VALUE direction)
{
pango_context_set_base_dir(_SELF(self), RVAL2PANGODIRECTION(direction));
return self;
}
#if PANGO_CHECK_VERSION(1,16,0)
static VALUE
rg_base_gravity(VALUE self)
{
return PANGOGRAVITY2RVAL(pango_context_get_base_gravity(_SELF(self)));
}
static VALUE
rg_set_base_gravity(VALUE self, VALUE gravity)
{
pango_context_set_base_gravity(_SELF(self), RVAL2PANGOGRAVITY(gravity));
return self;
}
static VALUE
rg_gravity_hint(VALUE self)
{
return PANGOGRAVITYHINT2RVAL(pango_context_get_gravity_hint(_SELF(self)));
}
static VALUE
rg_set_gravity_hint(VALUE self, VALUE gravity_hint)
{
pango_context_set_gravity_hint(_SELF(self), RVAL2PANGOGRAVITYHINT(gravity_hint));
return self;
}
#endif
#if PANGO_CHECK_VERSION(1,6,0)
static VALUE
rg_matrix(VALUE self)
{
const PangoMatrix* matrix = pango_context_get_matrix(_SELF(self));
return PANGOMATRIX2RVAL((PangoMatrix*)matrix);
}
static VALUE
rg_set_matrix(VALUE self, VALUE matrix)
{
pango_context_set_matrix(_SELF(self),
RVAL2PANGOMATRIX(matrix));
return self;
}
#endif
static VALUE
rg_load_font(VALUE self, VALUE desc)
{
return GOBJ2RVAL(pango_context_load_font(_SELF(self), RVAL2PANGOFONTDESCRIPTION(desc)));
}
static VALUE
rg_load_fontset(VALUE self, VALUE desc, VALUE lang)
{
return GOBJ2RVAL(pango_context_load_fontset(_SELF(self),
RVAL2PANGOFONTDESCRIPTION(desc), RVAL2PANGOLANGUAGE(lang)));
}
static VALUE
rg_get_metrics(int argc, VALUE *argv, VALUE self)
{
VALUE desc, lang;
rb_scan_args(argc, argv, "11", &desc, &lang);
return PANGOFONTMETRICS2RVAL(pango_context_get_metrics(_SELF(self),
RVAL2PANGOFONTDESCRIPTION(desc),
NIL_P(lang) ? NULL : RVAL2PANGOLANGUAGE(lang)));
}
static VALUE
rg_families(VALUE self)
{
int n_families;
PangoFontFamily** families;
int i;
VALUE result;
pango_context_list_families(_SELF(self),
&families,
&n_families);
result = rb_ary_new2(n_families);
for (i = 0; i < n_families; i++)
rb_ary_store(result, i, GOBJ2RVAL(families[i]));
g_free(families);
return result;
}
#if PANGO_CHECK_VERSION(1,10,0)
# ifdef HAVE_RB_CAIRO_H
static VALUE
rg_set_font_options(VALUE self, VALUE options)
{
if (NIL_P(options))
pango_cairo_context_set_font_options(_SELF(self), NULL);
else
pango_cairo_context_set_font_options(_SELF(self),
RVAL2CRFONTOPTIONS(options));
return self;
}
static VALUE
rg_font_options(VALUE self)
{
const cairo_font_options_t *options;
options = pango_cairo_context_get_font_options(_SELF(self));
if (options)
return CRFONTOPTIONS2RVAL(cairo_font_options_copy(options));
else
return Qnil;
}
static VALUE
rg_set_resolution(VALUE self, VALUE dpi)
{
pango_cairo_context_set_resolution(_SELF(self), NUM2DBL(dpi));
return self;
}
static VALUE
rg_resolution(VALUE self)
{
return rb_float_new(pango_cairo_context_get_resolution(_SELF(self)));
}
# endif
#endif
static VALUE
rg_list_families(VALUE self)
{
rb_warn("Deprecated. Use Pango::Context#families instead.");
return rg_families(self);
}
void
Init_pango_context(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_CONTEXT, "Context", mPango);
RG_DEF_METHOD(itemize, -1);
#ifdef PANGO_ENABLE_BACKEND
RG_DEF_METHOD(initialize, 0);
RG_DEF_METHOD(set_font_map, 1);
#if PANGO_CHECK_VERSION(1,6,0)
RG_DEF_METHOD(font_map, 0);
#endif
#endif /* PANGO_ENABLE_BACKEND */
RG_DEF_METHOD(font_description, 0);
RG_DEF_METHOD(set_font_description, 1);
RG_DEF_METHOD(language, 0);
RG_DEF_METHOD(set_language, 1);
RG_DEF_METHOD(base_dir, 0);
RG_DEF_METHOD(set_base_dir, 1);
#if PANGO_CHECK_VERSION(1,16,0)
RG_DEF_METHOD(base_gravity, 0);
RG_DEF_METHOD(set_base_gravity, 1);
RG_DEF_METHOD(gravity_hint, 0);
RG_DEF_METHOD(set_gravity_hint, 1);
#endif
#if PANGO_CHECK_VERSION(1,6,0)
RG_DEF_METHOD(matrix, 0);
RG_DEF_METHOD(set_matrix, 1);
#endif
RG_DEF_METHOD(load_font, 1);
RG_DEF_METHOD(load_fontset, 2);
RG_DEF_METHOD(get_metrics, -1);
RG_DEF_METHOD(families, 0);
#if PANGO_CHECK_VERSION(1,10,0)
# ifdef HAVE_RB_CAIRO_H
RG_DEF_METHOD(set_font_options, 1);
RG_DEF_METHOD(font_options, 0);
RG_DEF_METHOD(set_resolution, 1);
RG_DEF_METHOD(resolution, 0);
# endif
#endif
/* This will remove 2 or 3 releases later since 0.14.0. */
RG_DEF_METHOD(list_families, 0);
/* PangoDirection */
G_DEF_CLASS(PANGO_TYPE_DIRECTION, "Direction", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_DIRECTION, "PANGO_");
}

View File

@ -0,0 +1,111 @@
/* -*- 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 __PANGOCONVERSIONS_H__
#define __PANGOCONVERSIONS_H__
#define RVAL2PANGOCAIROFONTMAP(o) (PANGO_CAIRO_FONT_MAP(RVAL2GOBJ(o)))
#define RVAL2PANGOCONTEXT(o) (PANGO_CONTEXT(RVAL2GOBJ(o)))
#define RVAL2PANGOENGINE(o) (PANGO_ENGINE(RVAL2GOBJ(o)))
#define RVAL2PANGOENGINELANG(o) (PANGO_ENGINE_LANG(RVAL2GOBJ(o)))
#define RVAL2PANGOENGINESHAPE(o) (PANGO_ENGINE_SHAPE(RVAL2GOBJ(o)))
#define RVAL2PANGOFONT(o) (PANGO_FONT(RVAL2GOBJ(o)))
#define RVAL2PANGOFONTSET(o) (PANGO_FONTSET(RVAL2GOBJ(o)))
#define RVAL2PANGOFONTSETSIMPLE(o) (PANGO_FONTSET_SIMPLE(RVAL2GOBJ(o)))
#define RVAL2PANGOFONTFACE(o) (PANGO_FONT_FACE(RVAL2GOBJ(o)))
#define RVAL2PANGOFONTFAMILY(o) (PANGO_FONT_FAMILY(RVAL2GOBJ(o)))
#define RVAL2PANGOFONTMAP(o) (PANGO_FONT_MAP(RVAL2GOBJ(o)))
#define RVAL2PANGOLAYOUT(o) (PANGO_LAYOUT(RVAL2GOBJ(o)))
#define RVAL2PANGORENDERER(o) (PANGO_RENDERER(RVAL2GOBJ(o)))
#define RVAL2PANGOANALYSIS(o) ((PangoAnalysis*)RVAL2BOXED(o, PANGO_TYPE_ANALYSIS))
#define PANGOANALYSIS2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ANALYSIS))
#define RVAL2PANGOATTRITERATOR(o) ((PangoAttrIterator*)RVAL2BOXED(o, PANGO_TYPE_ATTR_ITERATOR))
#define PANGOATTRITERATOR2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ATTR_ITERATOR))
#define RVAL2PANGOATTRLIST(o) ((PangoAttrList*)RVAL2BOXED(o, PANGO_TYPE_ATTR_LIST))
#define PANGOATTRLIST2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ATTR_LIST))
#define RVAL2PANGOCOLOR(o) ((PangoColor*)RVAL2BOXED(o, PANGO_TYPE_COLOR))
#define PANGOCOLOR2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_COLOR))
#define RVAL2PANGOCOVERAGE(o) ((PangoCoverage*)RVAL2BOXED(o, PANGO_TYPE_COVERAGE))
#define PANGOCOVERAGE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_COVERAGE))
#define RVAL2PANGOFONTDESCRIPTION(o) ((PangoFontDescription*)RVAL2BOXED(o, PANGO_TYPE_FONT_DESCRIPTION))
#define PANGOFONTDESCRIPTION2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_FONT_DESCRIPTION))
#define RVAL2PANGOFONTMETRICS(o) ((PangoFontMetrics*)RVAL2BOXED(o, PANGO_TYPE_FONT_METRICS))
#define PANGOFONTMETRICS2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_FONT_METRICS))
#define RVAL2PANGOGLYPHINFO(o) ((PangoGlyphInfo*)RVAL2BOXED(o, PANGO_TYPE_GLYPH_INFO))
#define PANGOGLYPHINFO2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_GLYPH_INFO))
#define RVAL2PANGOGLYPHITEM(o) ((PangoGlyphItem*)RVAL2BOXED(o, PANGO_TYPE_GLYPH_ITEM))
#define PANGOGLYPHITEM2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_GLYPH_ITEM))
#define RVAL2PANGOGLYPHSTRING(o) ((PangoGlyphString*)RVAL2BOXED(o, PANGO_TYPE_GLYPH_STRING))
#define PANGOGLYPHSTRING2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_GLYPH_STRING))
#define RVAL2PANGOITEM(o) ((PangoItem*)RVAL2BOXED(o, PANGO_TYPE_ITEM))
#define PANGOITEM2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ITEM))
#define RVAL2PANGOLANGUAGE(o) ((PangoLanguage*)RVAL2BOXED(o, PANGO_TYPE_LANGUAGE))
#define PANGOLANGUAGE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LANGUAGE))
#define RVAL2PANGOLAYOUTITER(o) ((PangoLayoutIter*)RVAL2BOXED(o, PANGO_TYPE_LAYOUT_ITER))
#define PANGOLAYOUTITER2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LAYOUT_ITER))
#define RVAL2PANGOLAYOUTLINE(o) ((PangoLayoutLine*)RVAL2BOXED(o, PANGO_TYPE_LAYOUT_LINE))
#define PANGOLAYOUTLINE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LAYOUT_LINE))
#define RVAL2PANGOLOGATTR(o) ((PangoLogAttr*)RVAL2BOXED(o, PANGO_TYPE_LOG_ATTR))
#define PANGOLOGATTR2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LOG_ATTR))
#define RVAL2PANGOMATRIX(o) ((PangoMatrix*)RVAL2BOXED(o, PANGO_TYPE_MATRIX))
#define PANGOMATRIX2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_MATRIX))
#define RVAL2PANGORECTANGLE(o) ((PangoRectangle*)RVAL2BOXED(o, PANGO_TYPE_RECTANGLE))
#define PANGORECTANGLE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_RECTANGLE))
#define RVAL2PANGOSCRIPTITER(o) ((PangoScriptIter*)RVAL2BOXED(o, PANGO_TYPE_SCRIPT_ITER))
#define PANGOSCRIPTITER2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_SCRIPT_ITER))
#define RVAL2PANGOTABARRAY(o) ((PangoTabArray*)RVAL2BOXED(o, PANGO_TYPE_TAB_ARRAY))
#define PANGOTABARRAY2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_TAB_ARRAY))
#define RVAL2PANGOALIGNMENT(o) (RVAL2GENUM(o, PANGO_TYPE_ALIGNMENT))
#define PANGOALIGNMENT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_ALIGNMENT))
#define RVAL2PANGOCOVERAGELEVEL(o) (RVAL2GENUM(o, PANGO_TYPE_COVERAGE_LEVEL))
#define PANGOCOVERAGELEVEL2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_COVERAGE_LEVEL))
#define RVAL2PANGODIRECTION(o) (RVAL2GENUM(o, PANGO_TYPE_DIRECTION))
#define PANGODIRECTION2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_DIRECTION))
#define RVAL2PANGOELLIPSIZEMODE(o) (RVAL2GENUM(o, PANGO_TYPE_ELLIPSIZE_MODE))
#define PANGOELLIPSIZEMODE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_ELLIPSIZE_MODE))
#define RVAL2PANGOGRAVITY(o) (RVAL2GENUM(o, PANGO_TYPE_GRAVITY))
#define PANGOGRAVITY2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_GRAVITY))
#define RVAL2PANGOGRAVITYHINT(o) (RVAL2GENUM(o, PANGO_TYPE_GRAVITY_HINT))
#define PANGOGRAVITYHINT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_GRAVITY_HINT))
#define RVAL2PANGORENDERPART(o) (RVAL2GENUM(o, PANGO_TYPE_RENDER_PART))
#define PANGORENDERPART2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_RENDER_PART))
#define RVAL2PANGOSCRIPT(o) (RVAL2GENUM(o, PANGO_TYPE_SCRIPT))
#define PANGOSCRIPT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_SCRIPT))
#define RVAL2PANGOSTRETCH(o) (RVAL2GENUM(o, PANGO_TYPE_STRETCH))
#define PANGOSTRETCH2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_STRETCH))
#define RVAL2PANGOSTYLE(o) (RVAL2GENUM(o, PANGO_TYPE_STYLE))
#define PANGOSTYLE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_STYLE))
#define RVAL2PANGOTABALIGN(o) (RVAL2GENUM(o, PANGO_TYPE_TAB_ALIGN))
#define PANGOTABALIGN2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_TAB_ALIGN))
#define RVAL2PANGOUNDERLINE(o) (RVAL2GENUM(o, PANGO_TYPE_UNDERLINE))
#define PANGOUNDERLINE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_UNDERLINE))
#define RVAL2PANGOVARIANT(o) (RVAL2GENUM(o, PANGO_TYPE_VARIANT))
#define PANGOVARIANT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_VARIANT))
#define RVAL2PANGOWEIGHT(o) (RVAL2GENUM(o, PANGO_TYPE_WEIGHT))
#define PANGOWEIGHT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_WEIGHT))
#define RVAL2PANGOWRAPMODE(o) (RVAL2GENUM(o, PANGO_TYPE_WRAP_MODE))
#define PANGOWRAPMODE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_WRAP_MODE))
#define RVAL2PANGOFONTMASK(o) (RVAL2GFLAGS(o, PANGO_TYPE_FONT_MASK))
#define PANGOFONTMASK2RVAL(o) (GFLAGS2RVAL(o, PANGO_TYPE_FONT_MASK))
#endif /* __PANGOCONVERSIONS_H__ */

View File

@ -0,0 +1,106 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cCoverage
#define _SELF(self) (RVAL2PANGOCOVERAGE(self))
/**********************************/
GType
pango_coverage_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoCoverage",
(GBoxedCopyFunc)pango_coverage_copy,
(GBoxedFreeFunc)pango_coverage_unref);
return our_type;
}
/**********************************/
static VALUE
rg_initialize(VALUE self)
{
G_INITIALIZE(self, pango_coverage_new());
return Qnil;
}
static VALUE
rg_get_level(VALUE self, VALUE index_)
{
return PANGOCOVERAGELEVEL2RVAL(pango_coverage_get(_SELF(self), NUM2INT(index_)));
}
static VALUE
rg_max_bang(VALUE self, VALUE other)
{
pango_coverage_max(_SELF(self), _SELF(other));
return self;
}
static VALUE
rg_set(VALUE self, VALUE index_, VALUE level)
{
pango_coverage_set(_SELF(self), NUM2INT(index_),
RVAL2PANGOCOVERAGELEVEL(level));
return self;
}
static VALUE
rg_to_bytes(VALUE self)
{
guchar* bytes;
int n_bytes;
VALUE ret;
pango_coverage_to_bytes(_SELF(self), &bytes, &n_bytes);
ret = rb_str_new((const char*)bytes, n_bytes);
g_free(bytes);
return ret;
}
static VALUE
rg_s_from_bytes(G_GNUC_UNUSED VALUE self, VALUE bytes)
{
StringValue(bytes);
return PANGOCOVERAGE2RVAL(pango_coverage_from_bytes((guchar *)RSTRING_PTR(bytes),
RSTRING_LEN(bytes)));
}
void
Init_pango_coverage(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_COVERAGE, "Coverage", mPango);
RG_DEF_METHOD(initialize, 0);
RG_DEF_METHOD(get_level, 0);
RG_DEF_METHOD_BANG(max, 1);
RG_DEF_METHOD(set, 2);
RG_DEF_METHOD(to_bytes, 0);
RG_DEF_SMETHOD(from_bytes, 1);
/* PangoCoverageLevel */
G_DEF_CLASS(PANGO_TYPE_COVERAGE_LEVEL, "Level", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_COVERAGE_LEVEL, "PANGO_COVERAGE_");
}

View File

@ -0,0 +1,73 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#ifdef PANGO_TYPE_ENGINE
#define _SELF(self) (RVAL2PANGOENGINE(self))
/* FIXME
static VALUE
rbpango_s_engine_list(VALUE self)
{
PangoEngineInfo* engines = g_new(PangoEngineInfo, 1);
int i, n;
VALUE ary;
script_engine_list(&engines, &n);
ary = rb_ary_new();
for(i = 0; i < n; i++){
rb_ary_push(ary, GOBJ2RVAL(&engines[i]));
}
return ary;
}
static VALUE
rbpango_s_engine_create(VALUE self, VALUE id)
{
return GOBJ2RVAL(script_engine_create(RVAL2CSTR(id)));
}
*/
/*
void script_engine_init (GTypeModule *module);
void script_engine_exit (void);
PangoEngine* script_engine_create (const char *id);
*/
#endif
void
Init_pango_engine(VALUE mPango)
{
#ifdef PANGO_TYPE_ENGINE
G_DEF_CLASS(PANGO_TYPE_ENGINE, "Engine", mPango);
/* FIXME
rb_define_singleton_method(engine, "engines", rbpango_s_engine_list, 0);
rb_define_singleton_method(engine, "create", rbpango_s_engine_create, 1);
*/
G_DEF_CLASS(PANGO_TYPE_ENGINE_LANG, "EngineLang", mPango);
G_DEF_CLASS(PANGO_TYPE_ENGINE_SHAPE, "EngineShape", mPango);
#endif
}

View File

@ -0,0 +1,122 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2006 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cFont
#define _SELF(self) (RVAL2PANGOFONT(self))
static VALUE
rg_find_shaper(VALUE self, VALUE language, VALUE ch)
{
return GOBJ2RVAL(pango_font_find_shaper(_SELF(self),
RVAL2PANGOLANGUAGE(language),
NUM2UINT(ch)));
}
static VALUE
rg_describe(int argc, VALUE *argv, VALUE self)
{
VALUE desc, absolute_size;
rb_scan_args(argc, argv, "01", &absolute_size);
if (NIL_P(absolute_size) || ! RVAL2CBOOL(absolute_size)){
desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe(_SELF(self)));
} else {
#if PANGO_CHECK_VERSION(1,14,0)
desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe_with_absolute_size(_SELF(self)));
#else
rb_warning("Pango::Font#describe(absolute) has been supported since GTK+-2.10.x. Use Pango::Font#describe() instead.");
desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe(_SELF(self)));
#endif
}
return desc;
}
static VALUE
rg_get_coverage(VALUE self, VALUE language)
{
PangoCoverage* c = pango_font_get_coverage(_SELF(self),
RVAL2PANGOLANGUAGE(language));
return PANGOCOVERAGE2RVAL(c);
}
static VALUE
rg_get_glyph_extents(VALUE self, VALUE glyph)
{
PangoRectangle ink_rect, logical_rect;
pango_font_get_glyph_extents(_SELF(self),
NUM2UINT(glyph),
&ink_rect, &logical_rect);
return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
PANGORECTANGLE2RVAL(&logical_rect));
}
static VALUE
rg_metrics(int argc, VALUE *argv, VALUE self)
{
VALUE language;
PangoLanguage* lang = NULL;
rb_scan_args(argc, argv, "01", &language);
if (!NIL_P(language))
lang = RVAL2PANGOLANGUAGE(language);
return PANGOFONTMETRICS2RVAL(pango_font_get_metrics(_SELF(self), lang));
}
#if PANGO_CHECK_VERSION(1,9,0)
static VALUE
rg_font_map(VALUE self)
{
return GOBJ2RVAL(pango_font_get_font_map(_SELF(self)));
}
#endif
void
Init_pango_font(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT, "Font", mPango);
RG_DEF_METHOD(find_shaper, 2);
RG_DEF_METHOD(describe, -1);
RG_DEF_METHOD(get_coverage, 1);
RG_DEF_METHOD(get_glyph_extents, 1);
RG_DEF_METHOD(metrics, -1);
#if PANGO_CHECK_VERSION(1,9,0)
RG_DEF_METHOD(font_map, 0);
#endif
G_DEF_CLASS3("PangoXFont", "XFont", mPango);
G_DEF_CLASS3("PangoFT2Font", "FT2Font", mPango);
G_DEF_CLASS3("PangoFcFont", "FcFont", mPango);
G_DEF_CLASS3("PangoXftFont", "XftFont", mPango);
G_DEF_CLASS3("PangoCairoFcFont", "CairoFcFont", mPango);
G_DEF_CLASS3("PangoCairoFont", "CairoFont", mPango);
G_DEF_CLASS3("PangoCairoWin32Font", "CairoWin32Font", mPango);
#if PANGO_CHECK_VERSION(1,12,0)
G_DEF_CLASS3("PangoATSUIFont", "ATSUIFont", mPango);
#endif
}

View File

@ -0,0 +1,287 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cFontDescription
#define _SELF(self) (RVAL2PANGOFONTDESCRIPTION(self))
static VALUE
rg_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE str;
PangoFontDescription *description;
rb_scan_args(argc, argv, "01", &str);
if (NIL_P(str)) {
description = pango_font_description_new();
} else {
description = pango_font_description_from_string(RVAL2CSTR(str));
}
G_INITIALIZE(self, description);
return Qnil;
}
/*
PangoFontDescription* pango_font_description_copy
(const PangoFontDescription *desc);
PangoFontDescription* pango_font_description_copy_static
(const PangoFontDescription *desc);
*/
static VALUE
rg_hash(VALUE self)
{
return UINT2NUM(pango_font_description_hash(_SELF(self)));
}
static VALUE
rg_operator_font_desc_equal(VALUE self, VALUE other)
{
return CBOOL2RVAL(pango_font_description_equal(_SELF(self), _SELF(other)));
}
/* Don't we need this?
void pango_font_descriptions_free (PangoFontDescription **descs,
int n_descs);
*/
static VALUE
rg_set_family(VALUE self, VALUE family)
{
pango_font_description_set_family(_SELF(self), RVAL2CSTR(family));
return self;
}
/* Don't we need this?
void pango_font_description_set_family_static
(PangoFontDescription *desc,
const char *family);
*/
static VALUE
rg_family(VALUE self)
{
return CSTR2RVAL(pango_font_description_get_family(_SELF(self)));
}
static VALUE
rg_set_style(VALUE self, VALUE style)
{
pango_font_description_set_style(_SELF(self), RVAL2PANGOSTYLE(style));
return self;
}
static VALUE
rg_style(VALUE self)
{
return PANGOSTYLE2RVAL(pango_font_description_get_style(_SELF(self)));
}
static VALUE
rg_set_variant(VALUE self, VALUE variant)
{
pango_font_description_set_variant(_SELF(self), RVAL2PANGOVARIANT(variant));
return self;
}
static VALUE
rg_variant(VALUE self)
{
return PANGOVARIANT2RVAL(pango_font_description_get_variant(_SELF(self)));
}
static VALUE
rg_set_weight(VALUE self, VALUE weight)
{
pango_font_description_set_weight(_SELF(self),
RVAL2PANGOWEIGHT(weight));
return self;
}
static VALUE
rg_weight(VALUE self)
{
return PANGOWEIGHT2RVAL(pango_font_description_get_weight(_SELF(self)));
}
static VALUE
rg_set_stretch(VALUE self, VALUE stretch)
{
pango_font_description_set_stretch(_SELF(self), RVAL2PANGOSTRETCH(stretch));
return self;
}
static VALUE
rg_stretch(VALUE self)
{
return PANGOSTRETCH2RVAL(pango_font_description_get_stretch(_SELF(self)));
}
static VALUE
rg_set_size(VALUE self, VALUE size)
{
pango_font_description_set_size(_SELF(self), NUM2INT(size));
return self;
}
static VALUE
rg_size(VALUE self)
{
return INT2NUM(pango_font_description_get_size(_SELF(self)));
}
#if PANGO_CHECK_VERSION(1,8,0)
static VALUE
rg_set_absolute_size(VALUE self, VALUE size)
{
pango_font_description_set_absolute_size(_SELF(self), NUM2INT(size));
return self;
}
static VALUE
rg_size_is_absolute_p(VALUE self)
{
return CBOOL2RVAL(pango_font_description_get_size_is_absolute(_SELF(self)));
}
#endif
#if PANGO_CHECK_VERSION(1,16,0)
static VALUE
rg_gravity(VALUE self)
{
return PANGOGRAVITY2RVAL(pango_font_description_get_gravity(_SELF(self)));
}
static VALUE
rg_set_gravity(VALUE self, VALUE gravity)
{
pango_font_description_set_gravity(_SELF(self), RVAL2PANGOGRAVITY(gravity));
return self;
}
#endif
static VALUE
rg_set_fields(VALUE self)
{
return PANGOFONTMASK2RVAL(pango_font_description_get_set_fields(_SELF(self)));
}
static VALUE
rg_unset_fields(VALUE self, VALUE to_unset)
{
pango_font_description_unset_fields(_SELF(self), RVAL2PANGOFONTMASK(to_unset));
return self;
}
static VALUE
rg_merge(VALUE self, VALUE desc_to_merge, VALUE replace_existing)
{
pango_font_description_merge(_SELF(self), _SELF(desc_to_merge),
RVAL2CBOOL(replace_existing));
return self;
}
/* Don't we need this?
void pango_font_description_merge_static
(PangoFontDescription *desc,
const PangoFontDescription *desc_to_merge,
gboolean replace_existing);
*/
static VALUE
rg_better_match(VALUE self, VALUE old_match, VALUE new_match)
{
return CBOOL2RVAL(pango_font_description_better_match(_SELF(self),
_SELF(old_match),
_SELF(new_match)));
}
static VALUE
rg_to_str(VALUE self)
{
return CSTR2RVAL(pango_font_description_to_string(_SELF(self)));
}
static VALUE
rg_to_filename(VALUE self)
{
return CSTR2RVAL(pango_font_description_to_filename(_SELF(self)));
}
void
Init_pango_font_description(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_DESCRIPTION, "FontDescription", mPango);
RG_DEF_METHOD(initialize, -1);
RG_DEF_METHOD(hash, 0);
RG_DEF_METHOD_OPERATOR("==", font_desc_equal, 1);
RG_DEF_METHOD(set_family, 1);
RG_DEF_METHOD(family, 0);
RG_DEF_METHOD(set_style, 1);
RG_DEF_METHOD(style, 0);
RG_DEF_METHOD(set_variant, 1);
RG_DEF_METHOD(variant, 0);
RG_DEF_METHOD(set_weight, 1);
RG_DEF_METHOD(weight, 0);
RG_DEF_METHOD(set_stretch, 1);
RG_DEF_METHOD(stretch, 0);
RG_DEF_METHOD(set_size, 1);
RG_DEF_METHOD(size, 0);
#if PANGO_CHECK_VERSION(1,8,0)
RG_DEF_METHOD(set_absolute_size, 1);
RG_DEF_METHOD_P(size_is_absolute, 0);
#endif
#if PANGO_CHECK_VERSION(1,16,0)
RG_DEF_METHOD(set_gravity, 1);
RG_DEF_METHOD(gravity, 0);
#endif
RG_DEF_METHOD(set_fields, 0);
RG_DEF_METHOD(unset_fields, 1);
RG_DEF_METHOD(merge, 2);
RG_DEF_METHOD(better_match, 2);
RG_DEF_METHOD(to_str, 0);
RG_DEF_ALIAS("to_s", "to_str");
RG_DEF_METHOD(to_filename, 0);
/* PangoStyle */
G_DEF_CLASS(PANGO_TYPE_STYLE, "Style", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_STYLE, "PANGO_");
/* PangoWeight */
G_DEF_CLASS(PANGO_TYPE_WEIGHT, "Weight", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_WEIGHT, "PANGO_");
/* PangoVariant */
G_DEF_CLASS(PANGO_TYPE_VARIANT, "Variant", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_VARIANT, "PANGO_");
/* PangoStretch */
G_DEF_CLASS(PANGO_TYPE_STRETCH, "Stretch", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_STRETCH, "PANGO_");
/* PangoFontMask */
G_DEF_CLASS(PANGO_TYPE_FONT_MASK, "FontMask", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_FONT_MASK, "PANGO_");
}

View File

@ -0,0 +1,79 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002,2003 Masao Mutoh <mutoh@highway.ne.jp>
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cFontFace
#define _SELF(self) (RVAL2PANGOFONTFACE(self))
static VALUE
rg_name(VALUE self)
{
return CSTR2RVAL(pango_font_face_get_face_name(_SELF(self)));
}
static VALUE
rg_describe(VALUE self)
{
return PANGOFONTDESCRIPTION2RVAL(pango_font_face_describe(_SELF(self)));
}
#if PANGO_CHECK_VERSION(1,4,0)
static VALUE
rg_sizes(VALUE self)
{
int n_sizes;
int* sizes;
int i;
VALUE result;
pango_font_face_list_sizes(_SELF(self),
&sizes,
&n_sizes);
result = rb_ary_new();
for (i = 0; i < n_sizes; i++)
rb_ary_push(result, GOBJ2RVAL(&sizes[i]));
g_free(sizes);
return result;
}
#endif
void
Init_pango_font_face(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_FACE, "FontFace", mPango);
RG_DEF_METHOD(name, 0);
RG_DEF_METHOD(describe, 0);
#if PANGO_CHECK_VERSION(1,4,0)
RG_DEF_METHOD(sizes, 0);
#endif
G_DEF_CLASS3("PangoFcFace", "FcFace", mPango);
G_DEF_CLASS3("PangoFT2Face", "FT2Face", mPango);
G_DEF_CLASS3("PangoXftFace", "XftFace", mPango);
G_DEF_CLASS3("PangoXFace", "XFace", mPango);
G_DEF_CLASS3("PangoWin32Face", "Win32Face", mPango);
#if PANGO_CHECK_VERSION(1,12,0)
G_DEF_CLASS3("PangoATSUIFace", "ATSUIFace", mPango);
#endif
}

View File

@ -0,0 +1,82 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cFontFamily
#define _SELF(self) (RVAL2PANGOFONTFAMILY(self))
static VALUE
rg_name(VALUE self)
{
return CSTR2RVAL(pango_font_family_get_name(_SELF(self)));
}
#ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
static VALUE
rg_monospace_p(VALUE self)
{
return CBOOL2RVAL(pango_font_family_is_monospace(_SELF(self)));
}
#endif
static VALUE
rg_faces(VALUE self)
{
int n_faces;
PangoFontFace** faces;
int i;
VALUE result;
pango_font_family_list_faces(_SELF(self),
&faces,
&n_faces);
result = rb_ary_new2(n_faces);
for (i = 0; i < n_faces; i++)
rb_ary_store(result, i, GOBJ2RVAL(faces[i]));
g_free(faces);
return result;
}
void
Init_pango_font_family(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_FAMILY, "FontFamily", mPango);
RG_DEF_METHOD(name, 0);
#ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
RG_DEF_METHOD_P(monospace, 0);
#endif
RG_DEF_METHOD(faces, 0);
G_DEF_CLASS3("PangoFcFamily", "FcFamily", mPango);
G_DEF_CLASS3("PangoFT2Family", "FT2Family", mPango);
G_DEF_CLASS3("PangoXftFamily", "XftFamily", mPango);
G_DEF_CLASS3("PangoXFamily", "XFamily", mPango);
G_DEF_CLASS3("PangoWin32Family", "Win32Family", mPango);
#if PANGO_CHECK_VERSION(1,12,0)
G_DEF_CLASS3("PangoATSUIFamily", "ATSUIFamily", mPango);
#endif
}

View File

@ -0,0 +1,106 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cFontMap
#define _SELF(self) (RVAL2PANGOFONTMAP(self))
/*
static VALUE
rg_initialize(VALUE self)
{
G_INITIALIZE(self, pango_ft2_font_map_new());
return Qnil;
}
*/
static VALUE
rg_load_font(VALUE self, VALUE context, VALUE desc)
{
return GOBJ2RVAL(pango_font_map_load_font(_SELF(self),
RVAL2PANGOCONTEXT(context),
RVAL2PANGOFONTDESCRIPTION(desc)));
}
static VALUE
rg_load_fontset(VALUE self, VALUE context, VALUE desc, VALUE lang)
{
return GOBJ2RVAL(pango_font_map_load_fontset(_SELF(self),
RVAL2PANGOCONTEXT(context),
RVAL2PANGOFONTDESCRIPTION(desc),
RVAL2PANGOLANGUAGE(lang)));
}
static VALUE
rg_families(VALUE self)
{
int n_families;
PangoFontFamily** families;
int i;
VALUE result;
pango_font_map_list_families(_SELF(self),
&families,
&n_families);
result = rb_ary_new2(n_families);
for (i = 0; i < n_families; i++)
rb_ary_store(result, i, GOBJ2RVAL(families[i]));
g_free(families);
return result;
}
#if PANGO_CHECK_VERSION(1,4,0)
static VALUE
rg_shape_engine_type(VALUE self)
{
return CSTR2RVAL(pango_font_map_get_shape_engine_type(_SELF(self)));
}
#endif
void
Init_pango_font_map(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_MAP, "FontMap", mPango);
/*
RG_DEF_METHOD(initialize, 0);
*/
RG_DEF_METHOD(load_font, 2);
RG_DEF_METHOD(load_fontset, 3);
RG_DEF_METHOD(families, 0);
#if PANGO_CHECK_VERSION(1,4,0)
RG_DEF_METHOD(shape_engine_type, 0);
#endif
G_DEF_CLASS3("PangoFcFontMap", "FcFontMap", mPango);
G_DEF_CLASS3("PangoXftFontMap", "XftFontMap", mPango);
G_DEF_CLASS3("PangoFT2FontMap", "FT2FontMap", mPango);
G_DEF_CLASS3("PangoXFontMap", "XFontMap", mPango);
G_DEF_CLASS3("PangoWin32FontMap", "Win32FontMap", mPango);
G_DEF_CLASS3("PangoCoreTextFontMap", "CoreTextFontMap", mPango);
G_DEF_CLASS3("PangoCairoFcFontMap", "CairoFcFontMap", mPango);
G_DEF_CLASS3("PangoCairoWin32FontMap", "CairoWin32FontMap", mPango);
G_DEF_CLASS3("PangoCairoCoreTextFontMap", "CairoCoreTextFontMap", mPango);
}

View File

@ -0,0 +1,88 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cFontMetrics
#define _SELF(self) (RVAL2PANGOFONTMETRICS(self))
static VALUE
rg_ascent(VALUE self)
{
return INT2NUM(pango_font_metrics_get_ascent(_SELF(self)));
}
static VALUE
rg_descent(VALUE self)
{
return INT2NUM(pango_font_metrics_get_descent(_SELF(self)));
}
static VALUE
rg_approximate_char_width(VALUE self)
{
return INT2NUM(pango_font_metrics_get_approximate_char_width(_SELF(self)));
}
static VALUE
rg_approximate_digit_width(VALUE self)
{
return INT2NUM(pango_font_metrics_get_approximate_digit_width(_SELF(self)));
}
#if PANGO_CHECK_VERSION(1,6,0)
static VALUE
rg_underline_thickness(VALUE self)
{
return INT2NUM(pango_font_metrics_get_underline_thickness(_SELF(self)));
}
static VALUE
rg_underline_position(VALUE self)
{
return INT2NUM(pango_font_metrics_get_underline_position(_SELF(self)));
}
static VALUE
rg_strikethrough_thickness(VALUE self)
{
return INT2NUM(pango_font_metrics_get_strikethrough_thickness(_SELF(self)));
}
static VALUE
rg_strikethrough_position(VALUE self)
{
return INT2NUM(pango_font_metrics_get_strikethrough_position(_SELF(self)));
}
#endif
void
Init_pango_font_metrics(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_METRICS, "FontMetrics", mPango);
RG_DEF_METHOD(ascent, 0);
RG_DEF_METHOD(descent, 0);
RG_DEF_METHOD(approximate_char_width, 0);
RG_DEF_METHOD(approximate_digit_width, 0);
#if PANGO_CHECK_VERSION(1,6,0)
RG_DEF_METHOD(underline_thickness, 0);
RG_DEF_METHOD(underline_position, 0);
RG_DEF_METHOD(strikethrough_thickness, 0);
RG_DEF_METHOD(strikethrough_position, 0);
#endif
}

View File

@ -0,0 +1,73 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cFontset
#define _SELF(self) (RVAL2PANGOFONTSET(self))
static ID id_call;
static VALUE
rg_get_font(VALUE self, VALUE wc)
{
return GOBJ2RVAL(pango_fontset_get_font(_SELF(self), NUM2UINT(wc)));
}
static VALUE
rg_metrics(VALUE self)
{
return PANGOFONTMETRICS2RVAL(pango_fontset_get_metrics(_SELF(self)));
}
#if PANGO_CHECK_VERSION(1,4,0)
static gboolean
fontset_each(PangoFontset *fontset, PangoFont *font, gpointer func)
{
return RVAL2CBOOL(rb_funcall((VALUE)func, id_call,
2, GOBJ2RVAL(fontset), GOBJ2RVAL(font)));
}
static VALUE
rg_each(VALUE self)
{
VALUE func = rb_block_proc();
G_RELATIVE(self, func);
pango_fontset_foreach(_SELF(self),
(PangoFontsetForeachFunc)fontset_each,
(gpointer)func);
return self;
}
#endif
void
Init_pango_fontset(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONTSET, "Fontset", mPango);
id_call = rb_intern("call");
RG_DEF_METHOD(get_font, 1);
RG_DEF_METHOD(metrics, 0);
#if PANGO_CHECK_VERSION(1,4,0)
RG_DEF_METHOD(each, 0);
#endif
}

View File

@ -0,0 +1,60 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002,2003 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#ifdef PANGO_ENABLE_BACKEND
#define RG_TARGET_NAMESPACE cFontsetSimple
#define _SELF(self) (RVAL2PANGOFONTSETSIMPLE(self))
static VALUE
rg_initialize(VALUE self, VALUE lang)
{
G_INITIALIZE(self, pango_fontset_simple_new(RVAL2PANGOLANGUAGE(lang)));
return Qnil;
}
static VALUE
rg_append(VALUE self, VALUE font)
{
pango_fontset_simple_append(_SELF(self), RVAL2PANGOFONT(font));
return self;
}
static VALUE
rg_size(VALUE self)
{
return INT2NUM(pango_fontset_simple_size(_SELF(self)));
}
#endif
void
Init_pango_fontset_simple(VALUE mPango)
{
#ifdef PANGO_ENABLE_BACKEND
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONTSET_SIMPLE, "FontsetSimple", mPango);
RG_DEF_METHOD(initialize, 1);
RG_DEF_METHOD(append, 1);
RG_DEF_METHOD(size, 0);
#endif
}

View File

@ -0,0 +1,123 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cGlyphInfo
#define _SELF(self) (RVAL2PANGOGLYPHINFO(self))
/**********************************/
static PangoGlyphInfo *
pango_glyph_info_copy(const PangoGlyphInfo *info)
{
PangoGlyphInfo *data;
g_return_val_if_fail(info != NULL, NULL);
data = g_new(PangoGlyphInfo, 1);
*data = *info;
return data;
}
GType
pango_glyph_info_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoGlyphInfo",
(GBoxedCopyFunc)pango_glyph_info_copy,
(GBoxedFreeFunc)g_free);
return our_type;
}
/**********************************/
static VALUE
rg_initialize(VALUE self)
{
G_INITIALIZE(self, g_new0(PangoGlyphInfo, 1));
return Qnil;
}
static VALUE
rg_glyph(VALUE self)
{
return UINT2NUM(_SELF(self)->glyph);
}
static VALUE
rg_set_glyph(VALUE self, VALUE val)
{
_SELF(self)->glyph = NUM2UINT(val);
return self;
}
static VALUE
rg_geometry(VALUE self)
{
PangoGlyphGeometry geo = _SELF(self)->geometry;
return rb_ary_new3(3, INT2NUM(geo.width),
INT2NUM(geo.x_offset), INT2NUM(geo.y_offset));
}
static VALUE
rg_set_geometry(VALUE self, VALUE width, VALUE x_offset, VALUE y_offset)
{
PangoGlyphGeometry geo = _SELF(self)->geometry;
geo.width = NUM2INT(width);
geo.x_offset = NUM2INT(x_offset);
geo.y_offset = NUM2INT(y_offset);
return self;
}
/*
This method may be changed in the future following Pango implementation.
*/
static VALUE
rg_cluster_start_p(VALUE self)
{
return CBOOL2RVAL(_SELF(self)->attr.is_cluster_start);
}
static VALUE
rg_set_cluster_start(VALUE self, VALUE val)
{
_SELF(self)->attr.is_cluster_start = RVAL2CBOOL(val);
return self;
}
void
Init_pango_glyph_info(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_GLYPH_INFO, "GlyphInfo", mPango);
RG_DEF_METHOD(initialize, 0);
RG_DEF_METHOD(glyph, 0);
RG_DEF_METHOD(set_glyph, 1);
RG_DEF_METHOD(geometry, 0);
RG_DEF_METHOD(set_geometry, 3);
RG_DEF_METHOD_P(cluster_start, 0);
RG_DEF_METHOD(set_cluster_start, 1);
}

View File

@ -0,0 +1,133 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#if PANGO_CHECK_VERSION(1,2,0)
#define RG_TARGET_NAMESPACE cGlyphItem
#define _SELF(r) (RVAL2PANGOGLYPHITEM(r))
/**********************************/
#ifndef HAVE_PANGO_GLYPH_ITEM_GET_TYPE
static PangoGlyphItem*
glyph_item_copy(const PangoGlyphItem *ref)
{
PangoGlyphItem* new_ref;
g_return_val_if_fail (ref != NULL, NULL);
new_ref = g_new(PangoGlyphItem, 1);
*new_ref = *ref;
return new_ref;
}
# ifndef HAVE_PANGO_GLYPH_ITEM_FREE
void
pango_glyph_item_free(PangoGlyphItem* glyph_item)
{
if (glyph_item->item)
pango_item_free(glyph_item->item);
if (glyph_item->glyphs)
pango_glyph_string_free(glyph_item->glyphs);
g_free(glyph_item);
}
# endif
GType
pango_glyph_item_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoGlyphItem",
(GBoxedCopyFunc)glyph_item_copy,
(GBoxedFreeFunc)pango_glyph_item_free);
return our_type;
}
#endif
/**********************************/
static VALUE
rg_item(VALUE self)
{
PangoItem* item = _SELF(self)->item;
return PANGOITEM2RVAL(item);
}
static VALUE
rg_glyphs(VALUE self)
{
PangoGlyphString* glyphs = _SELF(self)->glyphs;
return PANGOGLYPHSTRING2RVAL(glyphs);
}
static VALUE
rg_split(VALUE self, VALUE text, VALUE split_index)
{
return PANGOGLYPHITEM2RVAL(pango_glyph_item_split(_SELF(self), RVAL2CSTR(text),
NUM2INT(split_index)));
}
static VALUE
rg_appy_attrs(VALUE self, VALUE text, VALUE attrs)
{
GSList* list = pango_glyph_item_apply_attrs(_SELF(self), RVAL2CSTR(text),
RVAL2PANGOATTRLIST(attrs));
VALUE ret = rb_ary_new();
while (list) {
rb_ary_push(ret, PANGOGLYPHITEM2RVAL(list->data));
pango_glyph_item_free(list->data);
list = list->next;
}
g_slist_free(list);
return ret;
}
#if PANGO_CHECK_VERSION(1,6,0)
static VALUE
rg_letter_space(VALUE self, VALUE text, VALUE log_attrs, VALUE letter_spacing)
{
pango_glyph_item_letter_space(_SELF(self), RVAL2CSTR(text),
RVAL2PANGOLOGATTR(log_attrs),
NUM2INT(letter_spacing));
return self;
}
#endif
#endif
void
Init_pango_glyph_item(VALUE mPango)
{
#if PANGO_CHECK_VERSION(1,2,0)
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_GLYPH_ITEM, "GlyphItem", mPango);
RG_DEF_METHOD(item, 0);
RG_DEF_METHOD(glyphs, 0);
RG_DEF_METHOD(split, 2);
RG_DEF_METHOD(appy_attrs, 2);
#if PANGO_CHECK_VERSION(1,6,0)
RG_DEF_METHOD(letter_space, 3);
#endif
#endif
}

View File

@ -0,0 +1,155 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2006 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cGlyphString
#define _SELF(self) (RVAL2PANGOGLYPHSTRING(self))
static VALUE
rg_initialize(VALUE self)
{
G_INITIALIZE(self, pango_glyph_string_new());
return Qnil;
}
static VALUE
rg_set_size(VALUE self, VALUE len)
{
pango_glyph_string_set_size(_SELF(self), NUM2INT(len));
return self;
}
static VALUE
rg_extents(int argc, VALUE *argv, VALUE self)
{
VALUE font, start_index, end_index;
PangoRectangle ink_rect;
PangoRectangle logical_rect;
rb_scan_args(argc, argv, "12", &font, &start_index, &end_index);
if (NIL_P(start_index)){
pango_glyph_string_extents(_SELF(self),
RVAL2PANGOFONT(font),
&ink_rect, &logical_rect);
} else {
pango_glyph_string_extents_range(_SELF(self),
NUM2INT(start_index), NUM2INT(end_index),
RVAL2PANGOFONT(font),
&ink_rect, &logical_rect);
}
return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
PANGORECTANGLE2RVAL(&logical_rect));
}
#if PANGO_CHECK_VERSION(1,14,0)
static VALUE
rg_width(VALUE self)
{
return INT2NUM(pango_glyph_string_get_width(_SELF(self)));
}
#endif
static VALUE
rg_index_to_x(VALUE self, VALUE text, VALUE analysis, VALUE index, VALUE trailing)
{
int x_pos;
StringValue(text);
pango_glyph_string_index_to_x(_SELF(self),
/* NOTE: This is a bug in the signature of
* pango_glyph_string_index_to_x */
(char *)RSTRING_PTR(text),
RSTRING_LEN(text),
RVAL2PANGOANALYSIS(analysis),
NUM2INT(index), RVAL2CBOOL(trailing),
&x_pos);
return INT2NUM(x_pos);
}
static VALUE
rg_x_to_index(VALUE self, VALUE text, VALUE analysis, VALUE x_pos)
{
int index;
int trailing;
StringValue(text);
pango_glyph_string_x_to_index(_SELF(self),
/* NOTE: This is a bug in the signature of
* pango_glyph_string_index_to_x */
(char *)RSTRING_PTR(text),
RSTRING_LEN(text),
RVAL2PANGOANALYSIS(analysis),
NUM2INT(x_pos),
&index, &trailing);
return rb_assoc_new(INT2NUM(index), CBOOL2RVAL(trailing));
}
static VALUE
rg_get_logical_widths(VALUE self, VALUE rbtext, VALUE rbembedding_level)
{
PangoGlyphString *glyphs = _SELF(self);
const char *text = RVAL2CSTR(rbtext);
long length = RSTRING_LEN(rbtext);
int embedding_level = NUM2INT(rbembedding_level);
glong n = g_utf8_strlen(text, length);
int *logical_widths = g_new(int, n);
pango_glyph_string_get_logical_widths(glyphs, text, length, embedding_level,
logical_widths);
return GINTS2RVAL_FREE(logical_widths, n);
}
static VALUE
rg_glyphs(VALUE self)
{
int i;
PangoGlyphInfo *glyphs = _SELF(self)->glyphs;
gint* log_clusters = _SELF(self)->log_clusters;
VALUE ret = rb_ary_new();
for (i = 0; i < _SELF(self)->num_glyphs; i++) {
rb_ary_push(ret,
rb_assoc_new(PANGOGLYPHINFO2RVAL(glyphs + i),
INT2NUM(log_clusters[i])));
}
return ret;
}
void
Init_pango_glyph_string(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_GLYPH_STRING, "GlyphString", mPango);
RG_DEF_METHOD(initialize, 0);
RG_DEF_METHOD(set_size, 1);
RG_DEF_METHOD(extents, -1);
#if PANGO_CHECK_VERSION(1,14,0)
RG_DEF_METHOD(width, 0);
#endif
RG_DEF_METHOD(index_to_x, 4);
RG_DEF_METHOD(x_to_index, 3);
RG_DEF_METHOD(get_logical_widths, 2);
RG_DEF_METHOD(glyphs, 0);
}

View File

@ -0,0 +1,54 @@
/* -*- 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 "rbpangoprivate.h"
#if PANGO_CHECK_VERSION(1,16,0)
#define RG_TARGET_NAMESPACE mGravity
static VALUE
rg_s_to_rotation(G_GNUC_UNUSED VALUE self, VALUE gravity)
{
return rb_float_new(pango_gravity_to_rotation(RVAL2PANGOGRAVITY(gravity)));
}
static VALUE
rg_s_vertical_p(G_GNUC_UNUSED VALUE self, VALUE gravity)
{
return CBOOL2RVAL(PANGO_GRAVITY_IS_VERTICAL(RVAL2PANGOGRAVITY(gravity)));
}
#endif
void
Init_pango_gravity(VALUE mPango)
{
#if PANGO_CHECK_VERSION(1,16,0)
VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mPango, "Gravity");
RG_DEF_SMETHOD(to_rotation, 1);
RG_DEF_SMETHOD_P(vertical, 1);
G_DEF_CLASS(PANGO_TYPE_GRAVITY, "Gravity", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_GRAVITY, "PANGO_GRAVITY_");
G_DEF_CLASS(PANGO_TYPE_GRAVITY_HINT, "Hint", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_GRAVITY_HINT, "PANGO_GRAVITY_");
#endif
}

View File

@ -0,0 +1,111 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cItem
#define _SELF(self) (RVAL2PANGOITEM(self))
#define ATTR_INT(name)\
static VALUE \
item_int_ ## name (VALUE self)\
{\
return INT2NUM(_SELF(self)->name);\
}\
static VALUE \
item_int_set_ ## name (VALUE self, VALUE val)\
{\
_SELF(self)->name = NUM2INT(val); \
return self;\
}
#define DEF_INT_ACCESSOR(name) \
rbg_define_method(RG_TARGET_NAMESPACE, G_STRINGIFY(name), item_int_ ## name, 0);\
rbg_define_method(RG_TARGET_NAMESPACE, G_STRINGIFY(set_ ## name), item_int_set_ ## name, 1);
/**********************************/
#if ! PANGO_CHECK_VERSION(1,9,0)
GType
pango_item_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoItem",
(GBoxedCopyFunc)pango_item_copy,
(GBoxedFreeFunc)pango_item_free);
return our_type;
}
#endif
/**********************************/
static VALUE
rg_initialize(VALUE self)
{
G_INITIALIZE(self, pango_item_new());
return Qnil;
}
static VALUE
rg_split(VALUE self, VALUE split_index, VALUE split_offset)
{
return PANGOITEM2RVAL(pango_item_split(_SELF(self),
NUM2INT(split_index),
NUM2INT(split_offset)));
}
/* Move to Pango module (rbpangomain.c)
GList* pango_reorder_items (GList *logical_items);
*/
ATTR_INT(offset);
ATTR_INT(length);
ATTR_INT(num_chars);
static VALUE
rg_analysis(VALUE self)
{
PangoAnalysis ana = _SELF(self)->analysis;
return PANGOANALYSIS2RVAL(&ana);
}
static VALUE
rg_set_analysis(VALUE self, VALUE val)
{
PangoAnalysis* ana = RVAL2PANGOANALYSIS(val);
_SELF(self)->analysis = *ana;
return self;
}
void
Init_pango_item(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_ITEM, "Item", mPango);
RG_DEF_METHOD(initialize, 0);
RG_DEF_METHOD(split, 2);
DEF_INT_ACCESSOR(offset);
DEF_INT_ACCESSOR(length);
DEF_INT_ACCESSOR(num_chars);
RG_DEF_METHOD(analysis, 0);
RG_DEF_METHOD(set_analysis, 1);
}

View File

@ -0,0 +1,91 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2009 Ruby-GNOME2 Project Team
* Copyright (C) 2002,2003 Masao Mutoh <mutoh@highway.ne.jp>
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cLanguage
#define _SELF(self) (RVAL2PANGOLANGUAGE(self))
static VALUE
rg_s_default(G_GNUC_UNUSED VALUE self)
{
return PANGOLANGUAGE2RVAL(pango_language_get_default());
}
static VALUE
rg_initialize(VALUE self, VALUE language)
{
G_INITIALIZE(self, pango_language_from_string(RVAL2CSTR(language)));
return Qnil;
}
static VALUE
rg_s_to_string(G_GNUC_UNUSED VALUE self, VALUE language)
{
return CSTR2RVAL(pango_language_to_string(RVAL2CSTR(language)));
}
static VALUE
rg_matches(int argc, VALUE *argv, VALUE self)
{
VALUE range_list;
rb_scan_args(argc, argv, "01", &range_list);
return CBOOL2RVAL(pango_language_matches(_SELF(self),
RVAL2CSTR_ACCEPT_NIL(range_list)));
}
static VALUE
rg_to_str(VALUE self)
{
return CSTR2RVAL(pango_language_to_string(_SELF(self)));
}
#if PANGO_CHECK_VERSION(1,4,0)
/* Moved from Pango::Script */
static VALUE
rg_includes_script(VALUE self, VALUE script)
{
return CBOOL2RVAL(pango_language_includes_script(_SELF(self),
RVAL2PANGOSCRIPT(script)));
}
#endif
void
Init_pango_language(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LANGUAGE, "Language", mPango);
RG_DEF_SMETHOD(default, 0);
RG_DEF_METHOD(initialize, 1);
RG_DEF_SMETHOD(to_string, 1);
RG_DEF_METHOD(matches, -1);
RG_DEF_METHOD(to_str, 0);
RG_DEF_ALIAS("to_s", "to_str");
#if PANGO_CHECK_VERSION(1,4,0)
RG_DEF_METHOD(includes_script, 1);
#endif
}

View File

@ -0,0 +1,555 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cLayout
#define _SELF(self) (RVAL2PANGOLAYOUT(self))
static VALUE
rg_initialize(VALUE self, VALUE context)
{
G_INITIALIZE(self, pango_layout_new(RVAL2PANGOCONTEXT(context)));
return Qnil;
}
static VALUE
rg_copy(VALUE self)
{
return GOBJ2RVAL_UNREF(pango_layout_copy(_SELF(self)));
}
static VALUE
rg_context(VALUE self)
{
return GOBJ2RVAL(pango_layout_get_context(_SELF(self)));
}
static VALUE
rg_context_changed(VALUE self)
{
pango_layout_context_changed(_SELF(self));
return Qnil;
}
static VALUE
rg_set_text(VALUE self, VALUE text)
{
StringValue(text);
pango_layout_set_text(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text));
return self;
}
static VALUE
rg_text(VALUE self)
{
return CSTR2RVAL(pango_layout_get_text(_SELF(self)));
}
static VALUE
rg_set_markup(int argc, VALUE *argv, VALUE self)
{
VALUE markup, accel_marker;
gunichar accel_char = 0;
rb_scan_args(argc, argv, "11", &markup, &accel_marker);
StringValue(markup);
if (NIL_P(accel_marker)){
pango_layout_set_markup(_SELF(self),
RSTRING_PTR(markup),
RSTRING_LEN(markup));
} else {
pango_layout_set_markup_with_accel(_SELF(self),
RSTRING_PTR(markup),
RSTRING_LEN(markup),
NUM2CHR(accel_marker), &accel_char);
}
return CHR2FIX(accel_char);
}
static VALUE
rg_operator_layout_set_markup_eq(VALUE self, VALUE markup)
{
StringValue(markup);
pango_layout_set_markup(_SELF(self), RSTRING_PTR(markup), RSTRING_LEN(markup));
return markup;
}
static VALUE
rg_set_attributes(VALUE self, VALUE attrs)
{
pango_layout_set_attributes(_SELF(self),
RVAL2PANGOATTRLIST(attrs));
return self;
}
static VALUE
rg_attributes(VALUE self)
{
return PANGOATTRLIST2RVAL(pango_layout_get_attributes(_SELF(self)));
}
static VALUE
rg_set_font_description(VALUE self, VALUE rb_desc)
{
PangoFontDescription *desc;
gboolean desc_created = FALSE;
if (RVAL2CBOOL(rb_obj_is_kind_of(rb_desc, rb_cString))) {
desc = pango_font_description_from_string(RVAL2CSTR(rb_desc));
desc_created = TRUE;
} else {
desc = RVAL2PANGOFONTDESCRIPTION(rb_desc);
}
pango_layout_set_font_description(_SELF(self), desc);
if (desc_created)
pango_font_description_free(desc);
return self;
}
#ifdef HAVE_PANGO_LAYOUT_GET_FONT_DESCRIPTION
static VALUE
rg_font_description(VALUE self)
{
const PangoFontDescription* desc = pango_layout_get_font_description(_SELF(self));
return PANGOFONTDESCRIPTION2RVAL((gpointer)desc);
}
#endif
static VALUE
rg_set_width(VALUE self, VALUE width)
{
pango_layout_set_width(_SELF(self), NUM2INT(width));
return self;
}
static VALUE
rg_width(VALUE self)
{
return INT2NUM(pango_layout_get_width(_SELF(self)));
}
static VALUE
rg_set_wrap(VALUE self, VALUE wrap)
{
pango_layout_set_wrap(_SELF(self), RVAL2PANGOWRAPMODE(wrap));
return self;
}
static VALUE
rg_wrap(VALUE self)
{
return PANGOWRAPMODE2RVAL(pango_layout_get_wrap(_SELF(self)));
}
#ifdef HAVE_PANGO_LAYOUT_SET_ELLIPSIZE
static VALUE
rg_set_ellipsize(VALUE self, VALUE ellipsize)
{
pango_layout_set_ellipsize(_SELF(self), RVAL2PANGOELLIPSIZEMODE(ellipsize));
return self;
}
static VALUE
rg_ellipsize(VALUE self)
{
return PANGOELLIPSIZEMODE2RVAL(pango_layout_get_ellipsize(_SELF(self)));
}
#endif
static VALUE
rg_set_indent(VALUE self, VALUE indent)
{
pango_layout_set_indent(_SELF(self), NUM2INT(indent));
return self;
}
static VALUE
rg_indent(VALUE self)
{
return INT2NUM(pango_layout_get_indent(_SELF(self)));
}
static VALUE
rg_spacing(VALUE self)
{
return INT2NUM(pango_layout_get_spacing(_SELF(self)));
}
static VALUE
rg_set_spacing(VALUE self, VALUE spacing)
{
pango_layout_set_spacing(_SELF(self), NUM2INT(spacing));
return self;
}
static VALUE
rg_set_justify(VALUE self, VALUE justify)
{
pango_layout_set_justify(_SELF(self), RVAL2CBOOL(justify));
return self;
}
static VALUE
rg_justify_p(VALUE self)
{
return CBOOL2RVAL(pango_layout_get_justify(_SELF(self)));
}
#if PANGO_CHECK_VERSION(1,4,0)
static VALUE
rg_set_auto_dir(VALUE self, VALUE auto_dir)
{
pango_layout_set_auto_dir(_SELF(self), RVAL2CBOOL(auto_dir));
return self;
}
static VALUE
rg_auto_dir_p(VALUE self)
{
return CBOOL2RVAL(pango_layout_get_auto_dir(_SELF(self)));
}
#endif
static VALUE
rg_set_alignment(VALUE self, VALUE align)
{
pango_layout_set_alignment(_SELF(self), RVAL2PANGOALIGNMENT(align));
return self;
}
static VALUE
rg_alignment(VALUE self)
{
return PANGOALIGNMENT2RVAL(pango_layout_get_alignment(_SELF(self)));
}
static VALUE
rg_set_tabs(VALUE self, VALUE tabs)
{
pango_layout_set_tabs(_SELF(self),
RVAL2PANGOTABARRAY(tabs));
return self;
}
static VALUE
rg_tabs(VALUE self)
{
VALUE ret = Qnil;
PangoTabArray* tabs = pango_layout_get_tabs(_SELF(self));
if (tabs) {
ret = PANGOTABARRAY2RVAL(tabs);
pango_tab_array_free(tabs);
}
return ret;
}
static VALUE
rg_set_single_paragraph_mode(VALUE self, VALUE setting)
{
pango_layout_set_single_paragraph_mode(_SELF(self), RVAL2CBOOL(setting));
return self;
}
static VALUE
rg_single_paragraph_mode_p(VALUE self)
{
return CBOOL2RVAL(pango_layout_get_single_paragraph_mode(_SELF(self)));
}
static VALUE
rg_log_attrs(VALUE self)
{
PangoLogAttr* attrs;
gint i, n_attrs;
VALUE ary;
pango_layout_get_log_attrs(_SELF(self), &attrs, &n_attrs);
ary = rb_ary_new();
for (i = 0; i < n_attrs; i++) {
rb_ary_assoc(ary, PANGOLOGATTR2RVAL(&attrs[i]));
}
g_free(attrs);
return ary;
}
static VALUE
rg_xy_to_index(VALUE self, VALUE x, VALUE y)
{
int index, trailing;
gboolean ret = pango_layout_xy_to_index(_SELF(self),
NUM2INT(x), NUM2INT(y),
&index, &trailing);
return rb_ary_new3(3, CBOOL2RVAL(ret), INT2NUM(index), INT2NUM(trailing));
}
static VALUE
rg_index_to_pos(VALUE self, VALUE index)
{
PangoRectangle pos;
pango_layout_index_to_pos(_SELF(self), NUM2INT(index), &pos);
return PANGORECTANGLE2RVAL(&pos);
}
static VALUE
rg_get_cursor_pos(VALUE self, VALUE index)
{
PangoRectangle strong_pos, weak_pos;
pango_layout_get_cursor_pos(_SELF(self), NUM2INT(index), &strong_pos, &weak_pos);
return rb_ary_new3(2, PANGORECTANGLE2RVAL(&strong_pos),
PANGORECTANGLE2RVAL(&weak_pos));
}
static VALUE
rg_move_cursor_visually(VALUE self, VALUE strong, VALUE old_index, VALUE old_trailing, VALUE direction)
{
int new_index, new_trailing;
pango_layout_move_cursor_visually(_SELF(self), RVAL2CBOOL(strong),
NUM2INT(old_index), NUM2INT(old_trailing),
NUM2INT(direction),
&new_index, &new_trailing);
return rb_ary_new3(2, INT2NUM(new_index), INT2NUM(new_trailing));
}
static VALUE
rg_get_extents(int argc, VALUE *argv, VALUE self)
{
VALUE ink_rect, logical_rect;
PangoRectangle rink, rlog;
rb_scan_args(argc, argv, "02", &ink_rect, &logical_rect);
if (NIL_P(ink_rect)){
rink.x = 0;
rink.y = 0;
rink.width = 0;
rink.height = 0;
} else {
PangoRectangle* rect = RVAL2PANGORECTANGLE(ink_rect);
rink.x = rect->x;
rink.y = rect->y;
rink.width = rect->width;
rink.height = rect->height;
}
if (NIL_P(logical_rect)){
rlog.x = 0;
rlog.y = 0;
rlog.width = 0;
rlog.height = 0;
} else {
PangoRectangle* rect = RVAL2PANGORECTANGLE(logical_rect);
rlog.x = rect->x;
rlog.y = rect->y;
rlog.width = rect->width;
rlog.height = rect->height;
}
pango_layout_get_extents(_SELF(self), &rink, &rlog);
return rb_assoc_new(PANGORECTANGLE2RVAL(&rink),
PANGORECTANGLE2RVAL(&rlog));
}
static VALUE
rg_extents(VALUE self)
{
PangoRectangle rink = {0, 0, 0, 0};
PangoRectangle rlog = {0, 0, 0, 0};
pango_layout_get_extents(_SELF(self), &rink, &rlog);
return rb_assoc_new(PANGORECTANGLE2RVAL(&rink),
PANGORECTANGLE2RVAL(&rlog));
}
static VALUE
rg_get_pixel_extents(int argc, VALUE *argv, VALUE self)
{
VALUE ink_rect, logical_rect;
PangoRectangle rink, rlog;
rb_scan_args(argc, argv, "02", &ink_rect, &logical_rect);
if (NIL_P(ink_rect)){
rink.x = 0;
rink.y = 0;
rink.width = 0;
rink.height = 0;
} else {
PangoRectangle* rect = RVAL2PANGORECTANGLE(ink_rect);
rink.x = rect->x;
rink.y = rect->y;
rink.width = rect->width;
rink.height = rect->height;
}
if (NIL_P(logical_rect)){
rlog.x = 0;
rlog.y = 0;
rlog.width = 0;
rlog.height = 0;
} else {
PangoRectangle* rect = RVAL2PANGORECTANGLE(logical_rect);
rlog.x = rect->x;
rlog.y = rect->y;
rlog.width = rect->width;
rlog.height = rect->height;
}
pango_layout_get_pixel_extents(_SELF(self), &rink, &rlog);
return rb_assoc_new(PANGORECTANGLE2RVAL(&rink),
PANGORECTANGLE2RVAL(&rlog));
}
static VALUE
rg_pixel_extents(VALUE self)
{
PangoRectangle rink = {0, 0, 0, 0};
PangoRectangle rlog = {0, 0, 0, 0};
pango_layout_get_pixel_extents(_SELF(self), &rink, &rlog);
return rb_assoc_new(PANGORECTANGLE2RVAL(&rink),
PANGORECTANGLE2RVAL(&rlog));
}
static VALUE
rg_size(VALUE self)
{
int width, height;
pango_layout_get_size(_SELF(self), &width, &height);
return rb_ary_new3(2, INT2NUM(width), INT2NUM(height));
}
static VALUE
rg_pixel_size(VALUE self)
{
int width, height;
pango_layout_get_pixel_size(_SELF(self), &width, &height);
return rb_ary_new3(2, INT2NUM(width), INT2NUM(height));
}
static VALUE
rg_line_count(VALUE self)
{
return INT2NUM(pango_layout_get_line_count(_SELF(self)));
}
static VALUE
rg_get_line(VALUE self, VALUE line)
{
return PANGOLAYOUTLINE2RVAL(pango_layout_get_line(_SELF(self), NUM2INT(line)));
}
static VALUE
rg_lines(VALUE self)
{
return GSLIST2ARY2(pango_layout_get_lines(_SELF(self)), PANGO_TYPE_LAYOUT_LINE);
}
static VALUE
rg_iter(VALUE self)
{
return PANGOLAYOUTITER2RVAL(pango_layout_get_iter(_SELF(self)));
}
void
Init_pango_layout(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LAYOUT, "Layout", mPango);
RG_DEF_METHOD(initialize, 1);
RG_DEF_METHOD(copy, 0);
RG_DEF_METHOD(context, 0);
RG_DEF_METHOD(context_changed, 0);
RG_DEF_METHOD(set_text, 1);
RG_DEF_METHOD(text, 0);
RG_DEF_METHOD(set_markup, -1);
RG_DEF_METHOD_OPERATOR("markup=", layout_set_markup_eq, 1);
RG_DEF_METHOD(set_attributes, 1);
RG_DEF_METHOD(attributes, 0);
RG_DEF_METHOD(set_font_description, 1);
#ifdef HAVE_PANGO_LAYOUT_GET_FONT_DESCRIPTION
RG_DEF_METHOD(font_description, 0);
#endif
RG_DEF_METHOD(set_width, 1);
RG_DEF_METHOD(width, 0);
RG_DEF_METHOD(set_wrap, 1);
RG_DEF_METHOD(wrap, 0);
#ifdef HAVE_PANGO_LAYOUT_SET_ELLIPSIZE
RG_DEF_METHOD(set_ellipsize, 1);
RG_DEF_METHOD(ellipsize, 0);
#endif
RG_DEF_METHOD(set_indent, 1);
RG_DEF_METHOD(indent, 0);
RG_DEF_METHOD(spacing, 0);
RG_DEF_METHOD(set_spacing, 1);
RG_DEF_METHOD(set_justify, 1);
RG_DEF_METHOD_P(justify, 0);
#if PANGO_CHECK_VERSION(1,4,0)
RG_DEF_METHOD(set_auto_dir, 1);
RG_DEF_METHOD_P(auto_dir, 0);
#endif
RG_DEF_METHOD(set_alignment, 1);
RG_DEF_METHOD(alignment, 0);
RG_DEF_METHOD(set_tabs, 1);
RG_DEF_METHOD(tabs, 0);
RG_DEF_METHOD(set_single_paragraph_mode, 1);
RG_DEF_METHOD_P(single_paragraph_mode, 0);
RG_DEF_METHOD(log_attrs, 0);
RG_DEF_METHOD(xy_to_index, 2);
RG_DEF_METHOD(index_to_pos, 1);
RG_DEF_METHOD(get_cursor_pos, 1);
RG_DEF_METHOD(move_cursor_visually, 4);
RG_DEF_METHOD(get_extents, -1);
RG_DEF_METHOD(extents, 0);
RG_DEF_METHOD(get_pixel_extents, -1);
RG_DEF_METHOD(pixel_extents, 0);
RG_DEF_METHOD(size, 0);
RG_DEF_METHOD(pixel_size, 0);
RG_DEF_METHOD(line_count, 0);
RG_DEF_METHOD(get_line, 1);
RG_DEF_METHOD(lines, 0);
RG_DEF_METHOD(iter, 0);
/* PangoWrapMode */
G_DEF_CLASS(PANGO_TYPE_WRAP_MODE, "WrapMode", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_WRAP_MODE, "PANGO_");
/* PangoAlignment */
G_DEF_CLASS(PANGO_TYPE_ALIGNMENT, "Alignment", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_ALIGNMENT, "PANGO_");
#ifdef HAVE_PANGO_LAYOUT_SET_ELLIPSIZE
/* PangoEllipsizeMode */
G_DEF_CLASS(PANGO_TYPE_ELLIPSIZE_MODE, "EllipsizeMode", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_ELLIPSIZE_MODE, "PANGO_");
#endif
}

View File

@ -0,0 +1,189 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cLayoutIter
#define _SELF(r) (RVAL2PANGOLAYOUTITER(r))
/**********************************/
#ifndef HAVE_PANGO_LAYOUT_ITER_GET_TYPE
static PangoLayoutIter *
layout_iter_copy(const PangoLayoutIter *ref)
{
return (PangoLayoutIter *)ref;
}
GType
pango_layout_iter_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoLayoutIter",
(GBoxedCopyFunc)layout_iter_copy,
(GBoxedFreeFunc)pango_layout_iter_free);
return our_type;
}
#endif
/**********************************/
static VALUE
rg_next_run_bang(VALUE self)
{
return CBOOL2RVAL(pango_layout_iter_next_run(_SELF(self)));
}
static VALUE
rg_next_char_bang(VALUE self)
{
return CBOOL2RVAL(pango_layout_iter_next_char(_SELF(self)));
}
static VALUE
rg_next_cluster_bang(VALUE self)
{
return CBOOL2RVAL(pango_layout_iter_next_cluster(_SELF(self)));
}
static VALUE
rg_next_line_bang(VALUE self)
{
return CBOOL2RVAL(pango_layout_iter_next_line(_SELF(self)));
}
static VALUE
rg_at_last_line_p(VALUE self)
{
return CBOOL2RVAL(pango_layout_iter_at_last_line(_SELF(self)));
}
static VALUE
rg_index(VALUE self)
{
return INT2NUM(pango_layout_iter_get_index(_SELF(self)));
}
static VALUE
rg_baseline(VALUE self)
{
return INT2NUM(pango_layout_iter_get_baseline(_SELF(self)));
}
static VALUE
rg_run(VALUE self)
{
PangoLayoutRun* run = pango_layout_iter_get_run(_SELF(self));
return PANGOGLYPHITEM2RVAL(run);
}
static VALUE
rg_line(VALUE self)
{
return PANGOLAYOUTLINE2RVAL(pango_layout_iter_get_line(_SELF(self)));
}
static VALUE
rg_char_extents(VALUE self)
{
PangoRectangle logical_rect;
pango_layout_iter_get_char_extents(_SELF(self), &logical_rect);
return PANGORECTANGLE2RVAL(&logical_rect);
}
static VALUE
rg_cluster_extents(VALUE self)
{
PangoRectangle ink_rect, logical_rect;
pango_layout_iter_get_cluster_extents(_SELF(self), &ink_rect, &logical_rect);
return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
PANGORECTANGLE2RVAL(&logical_rect));
}
static VALUE
rg_run_extents(VALUE self)
{
PangoRectangle ink_rect, logical_rect;
pango_layout_iter_get_run_extents(_SELF(self), &ink_rect, &logical_rect);
return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
PANGORECTANGLE2RVAL(&logical_rect));
}
static VALUE
rg_line_yrange(VALUE self)
{
int y0, y1;
pango_layout_iter_get_line_yrange(_SELF(self), &y0, &y1);
return rb_assoc_new(INT2NUM(y0), INT2NUM(y1));
}
static VALUE
rg_line_extents(VALUE self)
{
PangoRectangle ink_rect, logical_rect;
pango_layout_iter_get_line_extents(_SELF(self), &ink_rect, &logical_rect);
return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
PANGORECTANGLE2RVAL(&logical_rect));
}
static VALUE
rg_layout_extents(VALUE self)
{
PangoRectangle ink_rect, logical_rect;
pango_layout_iter_get_layout_extents(_SELF(self), &ink_rect, &logical_rect);
return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
PANGORECTANGLE2RVAL(&logical_rect));
}
void
Init_pango_layout_iter(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LAYOUT_ITER, "LayoutIter", mPango);
rbgobj_boxed_not_copy_obj(PANGO_TYPE_LAYOUT_ITER);
RG_DEF_METHOD_BANG(next_run, 0);
RG_DEF_METHOD_BANG(next_char, 0);
RG_DEF_METHOD_BANG(next_cluster, 0);
RG_DEF_METHOD_BANG(next_line, 0);
RG_DEF_METHOD_P(at_last_line, 0);
/* for backword compatibility. :< */
RG_DEF_ALIAS("at_last_line!", "at_last_line?");
RG_DEF_METHOD(index, 0);
RG_DEF_METHOD(baseline, 0);
RG_DEF_METHOD(run, 0);
RG_DEF_METHOD(line, 0);
RG_DEF_METHOD(char_extents, 0);
RG_DEF_METHOD(cluster_extents, 0);
RG_DEF_METHOD(run_extents, 0);
RG_DEF_METHOD(line_yrange, 0);
RG_DEF_METHOD(line_extents, 0);
RG_DEF_METHOD(layout_extents, 0);
}

View File

@ -0,0 +1,272 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002-2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cLayoutLine
#define _SELF(r) (RVAL2PANGOLAYOUTLINE(r))
/**********************************/
#if !PANGO_CHECK_VERSION(1,9,0)
static PangoLayoutLine*
layout_line_copy(PangoLayoutLine *ref)
{
g_return_val_if_fail (ref != NULL, NULL);
pango_layout_line_ref(ref);
return ref;
}
GType
pango_layout_line_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoLayoutLine",
(GBoxedCopyFunc)layout_line_copy,
(GBoxedFreeFunc)pango_layout_line_unref);
return our_type;
}
#endif
/**********************************/
static VALUE
rg_extents(VALUE self)
{
PangoRectangle ink_rect, logical_rect;
pango_layout_line_get_extents(_SELF(self), &ink_rect, &logical_rect);
return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
PANGORECTANGLE2RVAL(&logical_rect));
}
static VALUE
rg_pixel_extents(VALUE self)
{
PangoRectangle ink_rect, logical_rect;
pango_layout_line_get_pixel_extents(_SELF(self), &ink_rect, &logical_rect);
return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
PANGORECTANGLE2RVAL(&logical_rect));
}
static VALUE
rg_index_to_x(VALUE self, VALUE index, VALUE trailing)
{
int x_pos;
pango_layout_line_index_to_x(_SELF(self), NUM2INT(index),
RVAL2CBOOL(trailing), &x_pos);
return INT2NUM(x_pos);
}
static VALUE
rg_x_to_index(VALUE self, VALUE x_pos)
{
int index, trailing;
gboolean ret = pango_layout_line_x_to_index(_SELF(self), NUM2INT(x_pos),
&index, &trailing);
return rb_ary_new3(CBOOL2RVAL(ret), INT2NUM(index), INT2NUM(trailing));
}
static VALUE
rg_get_x_ranges(VALUE self, VALUE start_index, VALUE end_index)
{
int* ranges;
int i, n_ranges;
VALUE ary;
pango_layout_line_get_x_ranges(_SELF(self), NUM2INT(start_index),
NUM2INT(end_index), &ranges, &n_ranges);
ary = rb_ary_new();
for (i = 0; i < n_ranges; i++) {
rb_ary_push(ary, INT2NUM(ranges[i]));
}
g_free(ranges);
return ary;
}
/* Structure members */
static VALUE
rg_layout(VALUE self)
{
return GOBJ2RVAL(_SELF(self)->layout);
}
static VALUE
rg_set_layout(VALUE self, VALUE val)
{
_SELF(self)->layout = RVAL2PANGOLAYOUT(val);
return self;
}
static VALUE
rg_start_index(VALUE self)
{
return INT2NUM(_SELF(self)->start_index);
}
static VALUE
rg_set_start_index(VALUE self, VALUE val)
{
_SELF(self)->start_index = NUM2INT(val);
return self;
}
static VALUE
rg_length(VALUE self)
{
return INT2NUM(_SELF(self)->length);
}
static VALUE
rg_set_length(VALUE self, VALUE val)
{
_SELF(self)->length = NUM2INT(val);
return self;
}
#if PANGO_CHECK_VERSION(1,2,0)
static VALUE
rg_runs(VALUE self)
{
GSList* list = _SELF(self)->runs;
VALUE ary = rb_ary_new();
while (list) {
PangoGlyphItem* old_item = (PangoGlyphItem*)list->data;
PangoGlyphItem new_item;
new_item.item = pango_item_copy(old_item->item);
new_item.glyphs = pango_glyph_string_copy(old_item->glyphs);
rb_ary_push(ary, PANGOGLYPHITEM2RVAL(&new_item));
list = list->next;
}
return ary;
}
#endif
struct layout_line_set_runs_args {
PangoLayoutLine *line;
VALUE ary;
long n;
GSList *result;
};
static VALUE
layout_line_set_runs_body(VALUE value)
{
struct layout_line_set_runs_args *args = (struct layout_line_set_runs_args *)value;
long i;
for (i = 0; i < args->n; i++)
args->result = g_slist_append(args->result,
RVAL2PANGOGLYPHITEM(RARRAY_PTR(args->ary)[i]));
g_slist_free(args->line->runs);
args->line->runs = args->result;
return Qnil;
}
static G_GNUC_NORETURN VALUE
layout_line_set_runs_rescue(VALUE value)
{
g_slist_free(((struct layout_line_set_runs_args *)value)->result);
rb_exc_raise(rb_errinfo());
}
static VALUE
rg_set_runs(VALUE self, VALUE attrs)
{
struct layout_line_set_runs_args args;
args.line = _SELF(self);
args.ary = rb_ary_to_ary(attrs);
args.n = RARRAY_LEN(args.ary);
args.result = NULL;
rb_rescue(layout_line_set_runs_body, (VALUE)&args,
layout_line_set_runs_rescue, (VALUE)&args);
return self;
}
#if PANGO_CHECK_VERSION(1,4,0)
static VALUE
rg_paragraph_start_p(VALUE self)
{
return CBOOL2RVAL(_SELF(self)->is_paragraph_start);
}
static VALUE
rg_set_paragraph_start(VALUE self, VALUE val)
{
_SELF(self)->is_paragraph_start = RVAL2CBOOL(val);
return self;
}
static VALUE
rg_resolved_dir(VALUE self)
{
return UINT2NUM(_SELF(self)->resolved_dir);
}
static VALUE
rg_set_resolved_dir(VALUE self, VALUE val)
{
_SELF(self)->resolved_dir = NUM2UINT(val);
return self;
}
#endif
void
Init_pango_layout_line(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LAYOUT_LINE, "LayoutLine", mPango);
RG_DEF_METHOD(extents, 0);
RG_DEF_METHOD(pixel_extents, 0);
RG_DEF_METHOD(index_to_x, 2);
RG_DEF_METHOD(x_to_index, 1);
RG_DEF_METHOD(get_x_ranges, 2);
RG_DEF_METHOD(layout, 0);
RG_DEF_METHOD(set_layout, 1);
RG_DEF_METHOD(start_index, 0);
RG_DEF_METHOD(set_start_index, 1);
RG_DEF_METHOD(length, 0);
RG_DEF_METHOD(set_length, 1);
#if PANGO_CHECK_VERSION(1,2,0)
RG_DEF_METHOD(runs, 0);
#endif
RG_DEF_METHOD(set_runs, 1);
#if PANGO_CHECK_VERSION(1,4,0)
RG_DEF_METHOD_P(paragraph_start, 0);
RG_DEF_METHOD(set_paragraph_start, 1);
RG_DEF_METHOD(resolved_dir, 0);
RG_DEF_METHOD(set_resolved_dir, 1);
#endif
}

View File

@ -0,0 +1,114 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2003 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cLogAttr
#define _SELF(s) (RVAL2PANGOLOGATTR(s))
/**********************************/
static PangoLogAttr*
log_copy(const PangoLogAttr* val)
{
PangoLogAttr* new_val;
g_return_val_if_fail (val != NULL, NULL);
new_val = g_new(PangoLogAttr, 1);
*new_val = *val;
return new_val;
}
GType
pango_log_attr_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoLogAttr",
(GBoxedCopyFunc)log_copy,
(GBoxedFreeFunc)g_free);
return our_type;
}
/**********************************/
#define ATTR_BOOL(name)\
static VALUE \
log_get_ ## name (VALUE self)\
{\
return CBOOL2RVAL(_SELF(self)->name);\
}\
static VALUE \
log_set_ ## name (VALUE self, VALUE val)\
{\
_SELF(self)->name = RVAL2CBOOL(val);\
return self;\
}
static VALUE
rg_initialize(VALUE self)
{
PangoLogAttr attribute;
memset(&attribute, 0, sizeof(PangoLogAttr));
G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_LOG_ATTR, &attribute));
return Qnil;
}
#define DEFINE_ACCESSOR(logattr, name) \
rbg_define_method(logattr, G_STRINGIFY(name?), log_get_is_ ## name, 0);\
rbg_define_method(logattr, G_STRINGIFY(set_ ## name), log_set_is_ ## name, 1);
ATTR_BOOL(is_line_break);
ATTR_BOOL(is_mandatory_break);
ATTR_BOOL(is_char_break);
ATTR_BOOL(is_white);
ATTR_BOOL(is_cursor_position);
ATTR_BOOL(is_word_start);
ATTR_BOOL(is_word_end);
ATTR_BOOL(is_sentence_boundary);
ATTR_BOOL(is_sentence_start);
ATTR_BOOL(is_sentence_end);
#if PANGO_CHECK_VERSION(1,4,0)
ATTR_BOOL(backspace_deletes_character);
#endif
void
Init_pango_logattr(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LOG_ATTR, "LogAttr", mPango);
RG_DEF_METHOD(initialize, 0);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, line_break);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, mandatory_break);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, char_break);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, white);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, cursor_position);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, word_start);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, word_end);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, sentence_boundary);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, sentence_start);
DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, sentence_end);
#if PANGO_CHECK_VERSION(1,4,0)
rbg_define_method(RG_TARGET_NAMESPACE, "backspace_deletes_character?", log_get_backspace_deletes_character, 0);
rbg_define_method(RG_TARGET_NAMESPACE, "set_backspace_deletes_character", log_set_backspace_deletes_character, 1);
#endif
}

View File

@ -0,0 +1,153 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#if PANGO_CHECK_VERSION(1,6,0)
#define RG_TARGET_NAMESPACE cMatrix
#define _SELF(self) (RVAL2PANGOMATRIX(self))
#define ATTR_FLOAT(name)\
static VALUE \
matrix_get_ ## name (VALUE self)\
{\
return rb_float_new(_SELF(self)->name);\
}\
static VALUE \
matrix_set_ ## name (VALUE self, VALUE val)\
{\
_SELF(self)->name = NUM2DBL(val);\
return self;\
}
#define DEFINE_ACCESSOR(name) \
rbg_define_method(RG_TARGET_NAMESPACE, G_STRINGIFY(name), matrix_get_ ## name, 0);\
rbg_define_method(RG_TARGET_NAMESPACE, G_STRINGIFY(set_ ## name), matrix_set_## name, 1);
static VALUE
rg_initialize(int argc, VALUE *argv, VALUE self)
{
PangoMatrix matrix = PANGO_MATRIX_INIT;
VALUE xx, xy, yx, yy, x0, y0;
rb_scan_args(argc, argv, "06", &xx, &xy, &yx, &yy, &x0, &y0);
if (argc > 0){
matrix.xx = NUM2DBL(xx);
matrix.xy = NUM2DBL(xy);
matrix.yx = NUM2DBL(yx);
matrix.yy = NUM2DBL(yy);
matrix.x0 = NUM2DBL(x0);
matrix.y0 = NUM2DBL(y0);
}
G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_MATRIX, &matrix));
return Qnil;
}
static VALUE
rg_translate_bang(VALUE self, VALUE tx, VALUE ty)
{
pango_matrix_translate(_SELF(self), NUM2DBL(tx), NUM2DBL(ty));
return self;
}
static VALUE
rg_scale_bang(VALUE self, VALUE scale_x, VALUE scale_y)
{
pango_matrix_scale(_SELF(self), NUM2DBL(scale_x), NUM2DBL(scale_y));
return self;
}
static VALUE
rg_rotate_bang(VALUE self, VALUE degrees)
{
pango_matrix_rotate(_SELF(self), NUM2DBL(degrees));
return self;
}
#if PANGO_CHECK_VERSION(1,16,0)
static VALUE
rg_gravity(VALUE self)
{
return PANGOGRAVITY2RVAL(pango_gravity_get_for_matrix(_SELF(self)));
}
#endif
static VALUE
rg_concat_bang(VALUE self, VALUE new_matrix)
{
pango_matrix_concat(_SELF(self), _SELF(new_matrix));
return self;
}
#if PANGO_CHECK_VERSION(1,12,0)
static VALUE
rg_font_scale_factor(VALUE self)
{
return rb_float_new(pango_matrix_get_font_scale_factor(_SELF(self)));
}
#endif
ATTR_FLOAT(xx);
ATTR_FLOAT(xy);
ATTR_FLOAT(yx);
ATTR_FLOAT(yy);
ATTR_FLOAT(x0);
ATTR_FLOAT(y0);
static VALUE
rg_to_a(VALUE self)
{
PangoMatrix* matrix = _SELF(self);
return rb_ary_new3(6, INT2NUM(matrix->xx), INT2NUM(matrix->xy), INT2NUM(matrix->yx),
INT2NUM(matrix->yy), INT2NUM(matrix->x0), INT2NUM(matrix->y0));
}
#endif
void
Init_pango_matrix(VALUE mPango)
{
#if PANGO_CHECK_VERSION(1,6,0)
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_MATRIX, "Matrix", mPango);
RG_DEF_METHOD(initialize, -1);
RG_DEF_METHOD_BANG(translate, 2);
RG_DEF_METHOD_BANG(scale, 2);
RG_DEF_METHOD_BANG(rotate, 1);
RG_DEF_METHOD_BANG(concat, 1);
#if PANGO_CHECK_VERSION(1,12,0)
RG_DEF_METHOD(font_scale_factor, 0);
#endif
#if PANGO_CHECK_VERSION(1,16,0)
RG_DEF_METHOD(gravity, 0);
#endif
RG_DEF_METHOD(to_a, 0);
DEFINE_ACCESSOR(xx);
DEFINE_ACCESSOR(xy);
DEFINE_ACCESSOR(yx);
DEFINE_ACCESSOR(yy);
DEFINE_ACCESSOR(x0);
DEFINE_ACCESSOR(y0);
#endif
}

View File

@ -0,0 +1,53 @@
#ifndef RB_PANGO_PRIVATE_H
#define RB_PANGO_PRIVATE_H
#include "rbpango.h"
#ifndef HAVE_RB_ERRINFO
# define rb_errinfo() (ruby_errinfo)
#endif
#if PANGO_CHECK_VERSION(1,10,0) && defined(HAVE_RB_CAIRO_H)
# define CAIRO_AVAILABLE 1
#endif
G_BEGIN_DECLS
G_GNUC_INTERNAL void Init_pango_analysis(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_attribute(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_attriterator(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_attrlist(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_cairo(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_cairo_context(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_color(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_context(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_coverage(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_engine(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_font(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_font_description(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_font_face(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_font_family(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_font_map(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_font_metrics(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_fontset(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_fontset_simple(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_glyph_info(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_glyph_item(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_glyph_string(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_gravity(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_item(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_language(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_layout(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_layout_iter(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_layout_line(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_logattr(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_matrix(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_rectangle(VALUE mPango);
G_GNUC_INTERNAL void Init_pangorenderer(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_script(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_script_iter(VALUE mPango);
G_GNUC_INTERNAL void Init_pango_array(VALUE mPango);
G_END_DECLS
#endif /* RB_PANGO_PRIVATE_H */

View File

@ -0,0 +1,170 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002,2003 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cRectangle
#define _SELF(s) (RVAL2PANGORECTANGLE(s))
/**********************************/
static PangoRectangle*
pango_rectangle_copy(const PangoRectangle *ref)
{
PangoRectangle* new_ref;
g_return_val_if_fail (ref != NULL, NULL);
new_ref = g_new(PangoRectangle, 1);
*new_ref = *ref;
return new_ref;
}
GType
pango_rectangle_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoRectangle",
(GBoxedCopyFunc)pango_rectangle_copy,
(GBoxedFreeFunc)g_free);
return our_type;
}
/**********************************/
static VALUE
rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
{
PangoRectangle rectangle;
rectangle.x = NUM2INT(x);
rectangle.y = NUM2INT(y);
rectangle.width = NUM2INT(width);
rectangle.height = NUM2INT(height);
G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_RECTANGLE, &rectangle));
return Qnil;
}
static VALUE
rg_x(VALUE self)
{
return INT2NUM(_SELF(self)->x);
}
static VALUE
rg_y(VALUE self)
{
return INT2NUM(_SELF(self)->y);
}
static VALUE
rg_width(VALUE self)
{
return INT2NUM(_SELF(self)->width);
}
static VALUE
rg_height(VALUE self)
{
return INT2NUM(_SELF(self)->height);
}
static VALUE
rg_set_x(VALUE self, VALUE x)
{
_SELF(self)->x = NUM2INT(x);
return self;
}
static VALUE
rg_set_y(VALUE self, VALUE y)
{
_SELF(self)->y = NUM2INT(y);
return self;
}
static VALUE
rg_set_width(VALUE self, VALUE width)
{
_SELF(self)->width = NUM2INT(width);
return self;
}
static VALUE
rg_set_height(VALUE self, VALUE height)
{
_SELF(self)->height = NUM2INT(height);
return self;
}
static VALUE
rg_to_a(VALUE self)
{
PangoRectangle* a = _SELF(self);
return rb_ary_new3(4, INT2FIX(a->x), INT2FIX(a->y),
INT2FIX(a->width), INT2FIX(a->height));
}
static VALUE
rg_ascent(VALUE self)
{
PangoRectangle* r =_SELF(self);
return INT2NUM(PANGO_ASCENT(*r));
}
static VALUE
rg_descent(VALUE self)
{
PangoRectangle* r =_SELF(self);
return INT2NUM(PANGO_DESCENT(*r));
}
static VALUE
rg_lbearing(VALUE self)
{
PangoRectangle* r =_SELF(self);
return INT2NUM(PANGO_LBEARING(*r));
}
static VALUE
rg_rbearing(VALUE self)
{
PangoRectangle* r =_SELF(self);
return INT2NUM(PANGO_RBEARING(*r));
}
void
Init_pango_rectangle(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_RECTANGLE, "Rectangle", mPango);
RG_DEF_METHOD(initialize, 4);
RG_DEF_METHOD(x, 0);
RG_DEF_METHOD(y, 0);
RG_DEF_METHOD(width, 0);
RG_DEF_METHOD(height, 0);
RG_DEF_METHOD(set_x, 1);
RG_DEF_METHOD(set_y, 1);
RG_DEF_METHOD(set_width, 1);
RG_DEF_METHOD(set_height, 1);
RG_DEF_METHOD(to_a, 0);
RG_DEF_METHOD(ascent, 0);
RG_DEF_METHOD(descent, 0);
RG_DEF_METHOD(lbearing, 0);
RG_DEF_METHOD(rbearing, 0);
}

View File

@ -0,0 +1,199 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#if PANGO_CHECK_VERSION(1,8,0)
#define RG_TARGET_NAMESPACE cRenderer
#define _SELF(self) (RVAL2PANGORENDERER(self))
static VALUE
rg_draw_layout(VALUE self, VALUE layout, VALUE x, VALUE y)
{
pango_renderer_draw_layout(_SELF(self),
RVAL2PANGOLAYOUT(layout),
NUM2INT(x), NUM2INT(y));
return self;
}
static VALUE
rg_draw_layout_line(VALUE self, VALUE line, VALUE x, VALUE y)
{
pango_renderer_draw_layout_line(_SELF(self),
RVAL2PANGOLAYOUTLINE(line),
NUM2INT(x), NUM2INT(y));
return self;
}
static VALUE
rg_draw_glyphs(VALUE self, VALUE font, VALUE glyphs, VALUE x, VALUE y)
{
pango_renderer_draw_glyphs(_SELF(self),
RVAL2PANGOFONT(font),
RVAL2PANGOGLYPHSTRING(glyphs),
NUM2INT(x), NUM2INT(y));
return self;
}
static VALUE
rg_draw_rectangle(VALUE self, VALUE part, VALUE x, VALUE y, VALUE width, VALUE height)
{
#ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
pango_renderer_draw_rectangle(_SELF(self), RVAL2PANGORENDERPART(part),
NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height));
#else
pango_renderer_draw_rectangle(_SELF(self), NUM2INT(part),
NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height));
#endif
return self;
}
static VALUE
rg_draw_error_underline(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
{
pango_renderer_draw_error_underline(_SELF(self),
NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height));
return self;
}
static VALUE
rg_draw_trapezoid(VALUE self, VALUE part, VALUE y1, VALUE x11, VALUE x21, VALUE y2, VALUE x12, VALUE x22)
{
#ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
pango_renderer_draw_trapezoid(_SELF(self),
RVAL2PANGORENDERPART(part),
NUM2DBL(y1), NUM2DBL(x11), NUM2DBL(x21),
NUM2DBL(y2), NUM2DBL(x12), NUM2DBL(x22));
#else
pango_renderer_draw_trapezoid(_SELF(self), NUM2INT(part),
NUM2DBL(y1), NUM2DBL(x11), NUM2DBL(x21),
NUM2DBL(y2), NUM2DBL(x12), NUM2DBL(x22));
#endif
return self;
}
static VALUE
rg_draw_glyph(VALUE self, VALUE font, VALUE glyph, VALUE x, VALUE y)
{
pango_renderer_draw_glyph(_SELF(self), RVAL2PANGOFONT(font),
NUM2INT(glyph), NUM2INT(x), NUM2INT(y));
return self;
}
static VALUE
rg_deactivate(VALUE self)
{
pango_renderer_deactivate(_SELF(self));
return self;
}
static VALUE
rg_activate(VALUE self)
{
pango_renderer_activate(_SELF(self));
if (rb_block_given_p()) {
rb_ensure(rb_yield, self, rg_deactivate, self);
}
return self;
}
static VALUE
rg_part_changed(VALUE self, VALUE part)
{
#ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
pango_renderer_part_changed(_SELF(self), RVAL2PANGORENDERPART(part));
#else
pango_renderer_part_changed(_SELF(self), NUM2INT(part));
#endif
return self;
}
static VALUE
rg_set_color(VALUE self, VALUE part, VALUE color)
{
#ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
pango_renderer_set_color(_SELF(self), RVAL2PANGORENDERPART(part),
NIL_P(color) ? NULL : RVAL2PANGOCOLOR(color));
#else
pango_renderer_set_color(_SELF(self), NUM2INT(part),
NIL_P(color) ? NULL : RVAL2PANGOCOLOR(color));
#endif
return self;
}
static VALUE
rg_get_color(VALUE self, VALUE part)
{
#ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
PangoColor* color = pango_renderer_get_color(_SELF(self),
RVAL2PANGORENDERPART(part));
#else
PangoColor* color = pango_renderer_get_color(_SELF(self),NUM2INT(part));
#endif
return PANGOCOLOR2RVAL(color);
}
static VALUE
rg_set_matrix(VALUE self, VALUE matrix)
{
pango_renderer_set_matrix(_SELF(self),
NIL_P(matrix) ? NULL : RVAL2PANGOMATRIX(matrix));
return self;
}
static VALUE
rg_matrix(VALUE self)
{
const PangoMatrix* matrix = pango_renderer_get_matrix(_SELF(self));
return PANGOMATRIX2RVAL((PangoMatrix*)matrix);
}
#endif
void
Init_pangorenderer(VALUE mPango)
{
#if PANGO_CHECK_VERSION(1,8,0)
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_RENDERER, "Renderer", mPango);
RG_DEF_METHOD(draw_layout, 3);
RG_DEF_METHOD(draw_layout_line, 3);
RG_DEF_METHOD(draw_glyphs, 4);
RG_DEF_METHOD(draw_rectangle, 5);
RG_DEF_METHOD(draw_error_underline, 4);
RG_DEF_METHOD(draw_trapezoid, 7);
RG_DEF_METHOD(draw_glyph, 4);
RG_DEF_METHOD(activate, 0);
RG_DEF_METHOD(deactivate, 0);
RG_DEF_METHOD(part_changed, 1);
RG_DEF_METHOD(set_color, 2);
RG_DEF_METHOD(get_color, 1);
RG_DEF_METHOD(set_matrix, 1);
RG_DEF_METHOD(matrix, 0);
/* PangoRenderPart */
#ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
G_DEF_CLASS(PANGO_TYPE_RENDER_PART, "Part", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_RENDER_PART, "PANGO_RENDER_");
#endif
#endif
}

View File

@ -0,0 +1,88 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#if PANGO_CHECK_VERSION(1,4,0)
#define RG_TARGET_NAMESPACE cScript
#define _SELF(r) (RVAL2PANGOSCRIPT(r))
static VALUE
rg_s_for_unichar(G_GNUC_UNUSED VALUE self, VALUE ch)
{
return PANGOSCRIPT2RVAL(pango_script_for_unichar(NUM2UINT(ch)));
}
static VALUE
rg_sample_language(VALUE self)
{
PangoLanguage* lang = pango_script_get_sample_language(_SELF(self));
return PANGOLANGUAGE2RVAL(lang);
}
#if PANGO_CHECK_VERSION(1,16,0)
static VALUE
rg_get_gravity(int argc, VALUE *argv, VALUE self)
{
VALUE wide, gravity, gravity_hint;
int n;
PangoGravity g;
n = rb_scan_args(argc, argv, "21", &gravity, &gravity_hint, &wide);
if (n == 2) {
g = pango_gravity_get_for_script(_SELF(self),
RVAL2PANGOGRAVITY(gravity),
RVAL2PANGOGRAVITYHINT(gravity_hint));
} else {
# if PANGO_CHECK_VERSION(1,26,0)
g = pango_gravity_get_for_script_and_width(_SELF(self),
RVAL2CBOOL(wide),
RVAL2PANGOGRAVITY(gravity),
RVAL2PANGOGRAVITYHINT(gravity_hint));
# else
rb_raise(rb_eArgError,
"the 3rd 'wide' argument requires Pango >= 1.26");
# endif
}
return PANGOGRAVITY2RVAL(g);
}
#endif
/* Move to Pango::Language
gboolean pango_language_includes_script (PangoLanguage *language,
PangoScript script);
*/
#endif
void
Init_pango_script(VALUE mPango)
{
#if PANGO_CHECK_VERSION(1,4,0)
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_SCRIPT, "Script", mPango);
RG_DEF_SMETHOD(for_unichar, 1);
RG_DEF_METHOD(sample_language, 0);
#endif
#if PANGO_CHECK_VERSION(1,16,0)
RG_DEF_METHOD(get_gravity, -1);
#endif
}

View File

@ -0,0 +1,97 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2005 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#if PANGO_CHECK_VERSION(1,4,0)
/**********************************/
static PangoScriptIter*
rbpango_script_iter_copy(PangoScriptIter *ref)
{
/*
PangoScriptIter* new_ref = pango_script_iter_new("", 0);
g_return_val_if_fail (ref != NULL, NULL);
new_ref = g_new(PangoScriptIter, 1);
*new_ref = *ref;
return new_ref;
*/
return ref;
}
GType
pango_script_iter_get_type(void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("PangoScriptIter",
(GBoxedCopyFunc)rbpango_script_iter_copy,
(GBoxedFreeFunc)pango_script_iter_free);
return our_type;
}
/**********************************/
#define RG_TARGET_NAMESPACE cScriptIter
#define _SELF(r) (RVAL2PANGOSCRIPTITER(r))
static VALUE
rg_initialize(VALUE self, VALUE text)
{
PangoScriptIter* iter;
StringValue(text);
iter = pango_script_iter_new(RSTRING_PTR(text), RSTRING_LEN(text));
G_INITIALIZE(self, iter);
return Qnil;
}
static VALUE
rg_range(VALUE self)
{
G_CONST_RETURN char* start;
G_CONST_RETURN char* end;
PangoScript script;
pango_script_iter_get_range(_SELF(self), &start, &end, &script);
return rb_ary_new3(3, CSTR2RVAL(start), CSTR2RVAL(end),
PANGOSCRIPT2RVAL(script));
}
static VALUE
rg_next_bang(VALUE self)
{
return CBOOL2RVAL(pango_script_iter_next(_SELF(self)));
}
#endif
void
Init_pango_script_iter(VALUE mPango)
{
#if PANGO_CHECK_VERSION(1,4,0)
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_SCRIPT_ITER, "ScriptIter", mPango);
RG_DEF_METHOD(initialize, 1);
RG_DEF_METHOD(range, 0);
RG_DEF_METHOD_BANG(next, 0);
#endif
}

View File

@ -0,0 +1,128 @@
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
/*
* Copyright (C) 2011 Ruby-GNOME2 Project Team
* Copyright (C) 2002,2003 Masao Mutoh
*
* 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 "rbpangoprivate.h"
#define RG_TARGET_NAMESPACE cTabArray
#define _SELF(self) (RVAL2PANGOTABARRAY(self))
static VALUE
rg_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE size, positions_in_pixels, attr_ary;
PangoTabArray *array;
int i;
rb_scan_args(argc, argv, "2*", &size, &positions_in_pixels, &attr_ary);
array = pango_tab_array_new(NUM2INT(size),
RVAL2CBOOL(positions_in_pixels));
G_INITIALIZE(self, array);
if (! NIL_P(attr_ary)){
for (i = 0; i < RARRAY_LEN(attr_ary); i++) {
pango_tab_array_set_tab(array, i,
RVAL2PANGOTABALIGN(RARRAY_PTR(RARRAY_PTR(attr_ary)[i])[0]),
FIX2INT(RARRAY_PTR(RARRAY_PTR(attr_ary)[i])[1]));
}
}
return Qnil;
}
/* This is implemented in rtab_initialize.
PangoTabArray* pango_tab_array_new_with_positions
(gint size,
gboolean positions_in_pixels,
PangoTabAlign first_alignment,
gint first_position,
...);
*/
static VALUE
rg_size(VALUE self)
{
return INT2NUM(pango_tab_array_get_size(_SELF(self)));
}
static VALUE
rg_resize(VALUE self, VALUE size)
{
pango_tab_array_resize(_SELF(self), NUM2INT(size));
return self;
}
static VALUE
rg_set_tab(VALUE self, VALUE tab_index, VALUE align, VALUE location)
{
pango_tab_array_set_tab(_SELF(self), NUM2INT(tab_index), RVAL2PANGOTABALIGN(align),
NUM2INT(location));
return self;
}
static VALUE
rg_get_tab(VALUE self, VALUE tab_index)
{
PangoTabAlign align;
gint location;
pango_tab_array_get_tab(_SELF(self), NUM2INT(tab_index),
&align, &location);
return rb_ary_new3(2, PANGOTABALIGN2RVAL(align), INT2NUM(location));
}
static VALUE
rg_tabs(VALUE self)
{
PangoTabAlign* aligns;
gint* locations;
VALUE ary = rb_ary_new();
PangoTabArray* tab_array = _SELF(self);
gint i;
pango_tab_array_get_tabs(tab_array, &aligns, &locations);
for (i = 0; i < pango_tab_array_get_size(tab_array); i++){
rb_ary_push(ary, rb_ary_new3(2, PANGOTABALIGN2RVAL(aligns[i]),
INT2NUM(locations[i])));
}
return ary;
}
static VALUE
rg_positions_in_pixels_p(VALUE self)
{
return CBOOL2RVAL(pango_tab_array_get_positions_in_pixels(_SELF(self)));
}
void
Init_pango_array(VALUE mPango)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_TAB_ARRAY, "TabArray", mPango);
RG_DEF_METHOD(initialize, -1);
RG_DEF_METHOD(size, 0);
RG_DEF_METHOD(resize, 1);
RG_DEF_METHOD(set_tab, 3);
RG_DEF_METHOD(get_tab, 1);
RG_DEF_METHOD(tabs, 0);
RG_DEF_METHOD_P(positions_in_pixels, 0);
/* PangoTabAlign */
G_DEF_CLASS(PANGO_TYPE_TAB_ALIGN, "TabAlign", RG_TARGET_NAMESPACE);
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_TAB_ALIGN, "PANGO_");
}

View File

@ -0,0 +1,49 @@
#!/usr/bin/env ruby
require 'pathname'
require 'mkmf'
require 'rbconfig'
require 'fileutils'
package = "pango"
base_dir = Pathname(__FILE__).dirname.expand_path
ext_dir = base_dir + "ext" + package
mkmf_gnome2_dir = base_dir + 'lib'
ruby = File.join(RbConfig::CONFIG['bindir'],
RbConfig::CONFIG['ruby_install_name'] +
RbConfig::CONFIG["EXEEXT"])
build_dir = Pathname("ext") + package
FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist?
extconf_rb_path = ext_dir + "extconf.rb"
system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false)
create_makefile(package)
FileUtils.mv("Makefile", "Makefile.lib")
File.open("Makefile", "w") do |makefile|
makefile.puts(<<-EOM)
all:
(cd ext/#{package} && $(MAKE))
$(MAKE) -f Makefile.lib
install:
(cd ext/#{package} && $(MAKE) install)
$(MAKE) -f Makefile.lib install
site-install:
(cd ext/#{package} && $(MAKE) site-install)
$(MAKE) -f Makefile.lib site-install
clean:
(cd ext/#{package} && $(MAKE) clean)
$(MAKE) -f Makefile.lib clean
distclean:
(cd ext/#{package} && $(MAKE) distclean)
$(MAKE) -f Makefile.lib distclean
@rm -f Makefile.lib
EOM
end

View File

@ -0,0 +1,79 @@
#
# pango.rb
# Copyright(C) 2005, 2009 Ruby-GNOME2 Project.
#
# This program is licenced under the same
# license of Ruby-GNOME2.
#
require 'glib2'
begin
begin
require 'cairo'
rescue LoadError
require 'rubygems'
require 'cairo'
end
rescue LoadError
end
base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
vendor_dir = base_dir + "vendor" + "local"
vendor_bin_dir = vendor_dir + "bin"
GLib.prepend_dll_path(vendor_bin_dir)
begin
major, minor, _ = RUBY_VERSION.split(/\./)
require "#{major}.#{minor}/pango.so"
rescue LoadError
require "pango.so"
end
if vendor_dir.exist?
begin
require "gobject-introspection"
vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
rescue LoadError
end
end
module Pango
LOG_DOMAIN = "Pango"
class AttrList
def each(text = nil)
iter = iterator
begin
if text
s, e = iter.range
yield(iter, text[s, e - s], s, e)
else
yield(iter)
end
end while iter.next!
end
end
# [[klass, prefix], ....]]
targets = [[Layout::Alignment, "ALIGN_"], [AttrScale, "SCALE_"],
[Coverage::Level, "COVERAGE_"], [Context::Direction, "DIRECTION_"],
[Layout::WrapMode, "WRAP_"], [FontDescription::FontMask, "FONT_MASK_"],
[FontDescription::Stretch, "STRETCH_"], [FontDescription::Style, "STYLE_"],
[FontDescription::Variant, "VARIANT_"], [FontDescription::Weight, "WEIGHT_"],
[TabArray::TabAlign, "TAB_"],
[AttrUnderline::Underline, "UNDERLINE_"]]
targets << [Script, "SCRIPT_"] if defined? Script
targets << [Layout::EllipsizeMode, "ELLIPSIZE_"] if defined? Layout::EllipsizeMode
targets << [Renderer::Part, "PART_"] if defined? Renderer::Part
targets.each do |klass, prefix|
(klass.constants - klass.superclass.constants).each do |name|
unless klass.const_get(name).is_a? Class
const_set("#{prefix}#{name}", klass.const_get(name))
end
end
end
end
GLib::Log.set_log_domain(Pango::LOG_DOMAIN)

View File

@ -0,0 +1,12 @@
diff -ru harfbuzz-0.9.17.orig/configure.ac harfbuzz-0.9.17/configure.ac
--- harfbuzz-0.9.17.orig/configure.ac 2013-05-20 22:21:57.000000000 +0900
+++ harfbuzz-0.9.17/configure.ac 2013-05-26 09:01:41.881876729 +0900
@@ -248,7 +248,7 @@
LIBS="$LIBS -lusp10 -lgdi32"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[
- #define _WIN32_WINNT 0x0600
+ #define _WIN32_WINNT 0x0501
#include <windows.h>
#include <usp10.h>
]],

View File

@ -0,0 +1,14 @@
diff -ru pango-1.34.0.orig/pango/pangocairo.def pango-1.34.0/pango/pangocairo.def
--- pango-1.34.0.orig/pango/pangocairo.def 2013-01-24 12:39:14.000000000 +0900
+++ pango-1.34.0/pango/pangocairo.def 2013-05-18 20:28:04.017761164 +0900
@@ -8,8 +8,8 @@
pango_cairo_create_context
pango_cairo_create_layout
pango_cairo_error_underline_path
-; pango_cairo_fc_font_get_type
-; pango_cairo_fc_font_map_get_type
+ pango_cairo_fc_font_get_type
+ pango_cairo_fc_font_map_get_type
pango_cairo_font_get_type
pango_cairo_font_get_scaled_font
pango_cairo_font_map_create_context

View File

@ -0,0 +1,82 @@
=begin
attribute.rb - Ruby/Pango sample script.
Copyright (c) 2002,2003 Ruby-GNOME2 Project Team
This program is licenced under the same licence as Ruby-GNOME2.
$Id: attribute.rb,v 1.6 2006/06/17 13:37:01 mutoh Exp $
=end
require 'pango'
p a = Pango::AttrSize.new(1)
puts "value = #{a.value}"
puts "start_index = #{a.start_index}"
puts "end_index = #{a.end_index}"
p a = Pango::AttrStyle.new(Pango::FontDescription::STYLE_NORMAL)
puts "value = #{a.value}"
p a = Pango::AttrVariant.new(Pango::FontDescription::VARIANT_SMALL_CAPS)
puts "value = #{a.value}"
p a = Pango::AttrStretch.new(Pango::FontDescription::STRETCH_EXPANDED)
puts "value = #{a.value}"
p a = Pango::AttrWeight.new(Pango::FontDescription::WEIGHT_BOLD)
puts "value = #{a.value}"
p a = Pango::AttrRise.new(10)
puts "value = #{a.value}"
p a = Pango::AttrLanguage.new(Pango::Language.new("ja"))
p a.value
p a.value.to_str
p a = Pango::AttrFamily.new("family")
p a.value
p b = Pango::FontDescription.new
p b.to_str
p a = Pango::AttrFontDescription.new(b)
p a.value
p a.value.to_str
p a = Pango::AttrForeground.new(10, 20, 30)
p a.value
p a.value.to_a
p a = Pango::AttrBackground.new(20, 30, 40)
p a.value
p a.value.to_a
p a = Pango::AttrStrikethrough.new(true)
p a.value
p Pango::AttrUnderline::SINGLE
p a = Pango::AttrUnderline.new(Pango::AttrUnderline::SINGLE)
p a.value
p ink = Pango::Rectangle.new(1, 2, 3, 4)
p log = Pango::Rectangle.new(5, 6, 7, 8)
p a = Pango::AttrShape.new(ink, log)
p a.value[0].to_a
p a.value[1].to_a
p a = Pango::AttrScale.new(2.3)
p a.value
begin
require 'gtk2'
rescue
p "Ruby/GTK2 is not existed."
exit 0
end
p a = Gdk::PangoAttrEmbossed.new(true)
p a.value
mask = Gdk::Pixmap.new(Gtk::Window.new.realize.window, 100, 100, 1)
p a = Gdk::PangoAttrStipple.new(mask)
p a.value

View File

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
=begin
break.rb - Ruby/Pango sample script.
Copyright (c) 2005 Ruby-GNOME2 Project
This program is licenced under the same licence as Ruby-GNOME2.
$Id: break.rb,v 1.1 2005/09/17 17:09:12 mutoh Exp $
=end
require 'pango'
attr = Pango.break("Hello Worldです\n2nd line", Pango::Analysis.new)
p attr.length
attr.each do |v|
print "line_break:#{v.line_break?}"
print ", mandatory_break:#{v.mandatory_break?}"
print ", char_break:#{v.char_break?}"
print ", white:#{v.white?}"
print ", cursor_position:#{v.cursor_position?}"
print ", word_start:#{v.word_start?}"
print ", word_end:#{v.word_end?}"
print ", sentence_boundary:#{v.sentence_boundary?}"
print ", sentence_start:#{v.sentence_start?}"
print ", sentence_end:#{v.sentence_end?}\n"
end

View File

@ -0,0 +1,27 @@
=begin
gdk_layout.rb - Ruby/Pango sample script.
Copyright (c) 2003-2006 Ruby-GNOME2 Project
This program is licenced under the same licence as Ruby-GNOME2.
$Id: gdk_layout.rb,v 1.7 2006/06/17 13:36:11 mutoh Exp $
=end
require 'gtk2'
window = Gtk::Window.new("Ruby/Pango sample")
window.signal_connect("destroy"){Gtk.main_quit}
window.realize
gdkwin = window.window
gc = Gdk::GC.new(gdkwin)
layout = window.create_pango_layout
layout.set_markup(File.read("sample.txt"), "$")
window.signal_connect("expose_event") do
gdkwin.draw_layout(gc, 10, 10, layout)
end
window.set_default_size(500,400).show_all
Gtk.main

View File

@ -0,0 +1,61 @@
#!/usr/bin/env ruby
=begin
glyphstring.rb - Ruby/Pango sample script.
Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
This program is licenced under the same licence as Ruby-GNOME2.
$Id: glyphstring.rb,v 1.3 2006/06/17 14:16:53 ktou Exp $
=end
require 'gtk2'
str = "Hello World"
lang = Pango::Language.new("ja_JP")
fd = Pango::FontDescription.new("Sans 18")
context = Gdk::Pango.context
context.language = lang
context.base_dir = Pango::DIRECTION_LTR
context.font_description = fd
p font = context.load_font(fd)
family = context.families[10]
puts "#{family.class}, #{family.name}"
family.faces.each do |face|
puts face.name
end
p fmap = font.font_map
p fset = fmap.load_fontset(context, fd, lang)
gs = Pango::GlyphString.new
ink_rect, logical_rect = gs.extents(font)
p ink_rect.to_a
p logical_rect.to_a
item = Pango::Item.new
item.analysis.font = font
item.analysis.shape_engine = font.find_shaper(lang, str.codepoints.first)
gs = Pango.shape(str, item.analysis)
ink_rect, logical_rect = gs.extents(font, 0, 11)
p ink_rect.to_a
p logical_rect.to_a
gs.glyphs.each do |info, log_clusters|
puts "Pango::GlyphInfo: log_clusters = #{log_clusters}, glyph = #{info.glyph}, geometry = #{info.geometry.inspect}, cluster_start? = #{info.cluster_start?}"
end
p gs.index_to_x(str, item.analysis, 3, false)
p gs.x_to_index(str, item.analysis, 103)
p logical_widths = gs.get_logical_widths(str, item.analysis.level)

View File

@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
=begin
item.rb - Ruby/Pango sample script.
Copyright (c) 2005 Ruby-GNOME2 Project
This program is licenced under the same licence as Ruby-GNOME2.
$Id: item.rb,v 1.3 2006/06/17 13:37:01 mutoh Exp $
=end
require 'gtk2'
str = "Ruby-GNOME2こんにちわ"
win = Gtk::Window.new("Ruby/Pango sample")
win.realize
p screen = Gdk::Screen.default
p context = Gdk::Pango.context(screen)
p attrlist = Pango::AttrList.new
p a = Pango::AttrBackground.new(65535, 0, 0)
attrlist.insert(Pango::AttrBackground.new(65535, 0,0))
attrs = [Pango::AttrBackground.new(65535, 0,0), Pango::AttrForeground.new(65535, 0,0)]
items = context.itemize(Pango::Context::DIRECTION_RTL, str, 0, 40, attrlist)
items.each do |v|
ana = v.analysis
puts "shape_engine = #{ana.shape_engine}, lang_engine = #{ana.lang_engine}, font = #{ana.font}, level = #{ana.level}"
puts "language = #{ana.language}"
p ana.font.get_glyph_extents("a".codepoints.first)[0].to_a
ana.set_extra_attrs(attrs)
p ana.extra_attrs
end

View File

@ -0,0 +1,23 @@
=begin
label.rb - Ruby/Pango sample script.
Copyright (c) 2002,2003 Ruby-GNOME2 Project Team
This program is licenced under the same licence as Ruby-GNOME2.
$Id: label.rb,v 1.4 2006/06/17 13:36:11 mutoh Exp $
=end
require 'gtk2'
str = File.read("sample.txt")
attrs, text, accel_char = Pango.parse_markup(str, '$')
#This is same as Gtk::Label#set_markup()
label = Gtk::Label.new(text)
label.attributes = attrs
win = Gtk::Window.new
win.signal_connect("destroy"){Gtk.main_quit}
win.add(label).show_all
Gtk.main

View File

@ -0,0 +1,102 @@
#!/usr/local/bin/ruby
=begin
layout.rb - Ruby/Pango sample script.
Copyright (c) 2005 Ruby-GNOME2 Project Team
This program is licenced under the same licence as Ruby-GNOME2.
$Id: layout.rb,v 1.2 2006/06/17 13:36:11 mutoh Exp $
=end
require 'gtk2'
require 'pp'
puts
puts "Start----------"
puts
str = File.read("sample.txt")
context = Gdk::Pango.context
context.base_dir = Pango::Context::DIRECTION_LTR
context.language = Pango::Language.new("ja_JP")
fd = Pango::FontDescription.new("Sans 18")
font = context.load_font(fd)
font_map = context.font_map
p "context: #{context}"
p "font_desc: #{fd}"
p "font: #{font}"
p "font_map: #{font_map}"
puts
puts "Pango::Layout----------"
puts
p layout = Pango::Layout.new(context)
layout.set_markup(str)
layout.font_description = fd
layout.auto_dir = true
layout.alignment = Pango::Layout::ALIGN_LEFT
p "attributes: #{layout.attributes}"
p "font_description: #{layout.font_description}"
p "width: #{layout.width}"
p "wrap: #{layout.wrap}"
p "ellipsize: #{layout.ellipsize}"
p "indent: #{layout.indent}"
p "spacing: #{layout.spacing}"
p "justify?: #{layout.justify?}"
p "auto_dir?: #{layout.auto_dir?}"
p "alignment: #{layout.alignment.inspect}"
p "tabs: #{layout.tabs}"
p "single_paragraph_mode?: #{layout.single_paragraph_mode?}"
p "size: #{layout.size}"
p "pixel_size: #{layout.pixel_size}"
p "line_count: #{layout.line_count}"
puts "lines:"
pp layout.lines
puts
puts "Pango::LayoutIter--------"
puts
iter = layout.iter
p "iter: #{iter}"
p "index: #{iter.index}"
p "baseline: #{iter.baseline}"
p "line: #{iter.line}"
p "char_extents: #{iter.char_extents}"
p "cluster_extents: #{iter.cluster_extents}"
p "run_extents: #{iter.run_extents}"
p "layout_extents: #{iter.layout_extents}"
p "line_extents: #{iter.line_extents}"
p "line_yrange: #{iter.line_yrange}"
puts
puts "Pango::GlyphItem-------"
puts
glyph = iter.run
p "glyph: #{glyph}"
p "item: #{glyph.item}"
p "glyphs: #{glyph.glyphs}"
puts
puts "Pango::LayoutLine ----------"
puts
line = iter.line
p "line = #{line}"
p "extents: #{line.extents}"
p "pixel_extents: #{line.pixel_extents}"
p "index_to_x: #{line.index_to_x(1, true)}"
p "x_to_index: #{line.x_to_index(1)}"
p "x_ranges: #{line.get_x_ranges(0, 2)}"
p "layout: #{line.layout}"
p "start_index: #{line.start_index}"
p "length: #{line.length}"
p "paragraph_start?: #{line.paragraph_start?}"
p "resolved_dir: #{line.resolved_dir}"
puts "runs:"
pp line.runs
puts
puts "End----------"

View File

@ -0,0 +1,66 @@
=begin
cairo.rb - Ruby/Pango with cairo sample script.
Copyright (c) 2005 Ruby-GNOME2 Project
This program is licenced under the same licence as Ruby-GNOME2.
$Id: pango_cairo.rb,v 1.1 2005/10/15 07:57:52 mutoh Exp $
=end
require 'pango'
unless Pango.cairo_available?
STDERR.puts "This sample requires Pango 1.0.0 or later and cairo support"
exit 1
end
filename = ARGV.shift
filename ||= "cairo.png"
RADIUS = 150
N_WORDS = 10
FONT = "Sans Bold 27"
def draw_text(cr)
# Center coordinates on the middle of the region we are drawing
cr.translate(RADIUS, RADIUS);
# Create a PangoLayout, set the font and text
layout = cr.create_pango_layout
layout.set_text("Text")
desc = Pango::FontDescription.new(FONT)
layout.set_font_description(desc)
# Draw the layout N_WORDS times in a circle
N_WORDS.times do |i|
angle = (360.0 * i) / N_WORDS;
cr.save do
# Gradient from red at angle == 60 to blue at angle == 300
red = (1 + Math.cos((angle - 60) * Math::PI / 180.0)) / 2
cr.set_source_rgb(red, 0, 1.0 - red)
cr.rotate(angle * Math::PI / 180.0)
# Inform Pango to re-layout the text with the new transformation
cr.update_pango_layout(layout)
width, height = layout.size
cr.move_to(-(width.to_f / Pango::SCALE) / 2, -RADIUS)
cr.show_pango_layout(layout)
end
end
end
diameter = 2 * RADIUS
surface = Cairo::ImageSurface.new(Cairo::FORMAT_ARGB32, diameter, diameter)
cr = Cairo::Context.new(surface)
cr.set_source_rgb(1.0, 1.0, 1.0)
cr.rectangle(0, 0, diameter, diameter);
cr.fill
draw_text(cr)
File.open(filename, "wb") do |f|
cr.target.write_to_png(f)
end
# or
# cr.target.write_to_png(filename)

View File

@ -0,0 +1,33 @@
#!/usr/bin/env ruby
=begin
parse.rb - Ruby/Pango sample script.
Copyright (c) 2002,2003 Ruby-GNOME2 Project Team
This program is licenced under the same licence as Ruby-GNOME2.
$Id: parse.rb,v 1.4 2005/03/22 17:41:29 silicio Exp $
=end
require 'pango'
str = File.read("sample.txt")
puts str
puts "------"
attr_list, text, accel_char = Pango.parse_markup(str, '$')
puts "attr_list = #{attr_list}"
puts "text = #{text}"
puts "accel_char = #{accel_char}"
puts "------"
iterator = attr_list.iterator
attr_list.each(text) do |iterator, text, start_pos, end_pos|
puts "range = #{start_pos}, #{end_pos}"
puts "text = #{text}"
iterator.get.each do |attr|
puts "#{attr} = #{attr.value}"
end
puts "---"
end

View File

@ -0,0 +1,10 @@
<u><span foreground="red" size="x-large" style="italic"
lang="en">Hello World!</span></u> <span background="yellow" lang="ja"
font_desc="Sans Italic 20" stretch="normal">こんにちわ世界!</span>
<span size="xx-large" face="Serif" foreground="#006600" background="#ffffee">
<span size="larger" underline="double" weight="heavy">Ruby/Pango</span> <span
rise="10000" variant="normal" weight="heavy">$Ruby-GNOME2</span>
</span>
<span strikethrough="true" size="xx-large" style="oblique" foreground="blue">ABCDEF</span>

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
=begin
script.rb - Ruby/Pango sample script.
Copyright (c) 2005 Ruby-GNOME2 Project
This program is licenced under the same licence as Ruby-GNOME2.
$Id: script.rb,v 1.1 2005/09/17 17:09:12 mutoh Exp $
=end
require 'pango'
iter = Pango::ScriptIter.new("Helloこんにちはコンニチハ안녕하세요السلام عليكمΕλληνικάவணக்கம்")
begin
start_pos, end_pos, script = iter.range
puts "-----"
puts "start : #{start_pos}"
puts "end : #{end_pos}"
puts "script: #{script.nick}"
puts "sample_language: #{script.sample_language.to_s}"
end while iter.next!

View File

@ -0,0 +1,9 @@
module PangoTestUtils
private
def only_pango_version(major, minor, micro=nil)
micro ||= 0
unless Pango.check_version?(major, minor, micro)
omit("Require Pango >= #{major}.#{minor}.#{micro}")
end
end
end

View File

@ -0,0 +1,28 @@
#!/usr/bin/env ruby
$VERBOSE = true
ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
glib_base = File.join(ruby_gnome2_base, "glib2")
pango_base = File.join(ruby_gnome2_base, "pango")
$LOAD_PATH.unshift(File.join(glib_base, "test"))
require 'glib-test-init'
[[glib_base, "glib2"],
[pango_base, "pango"]].each do |target, module_name|
if system("which make > /dev/null")
`make -C #{target.dump} > /dev/null` or exit(1)
end
$LOAD_PATH.unshift(File.join(target, "ext", module_name))
$LOAD_PATH.unshift(File.join(target, "lib"))
end
$LOAD_PATH.unshift(File.join(pango_base, "test"))
require 'pango-test-utils'
require 'pango'
exit Test::Unit::AutoRunner.run(true)

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
class TestPangoAnalysis < Test::Unit::TestCase
include PangoTestUtils
def test_level
analysis = Pango::Analysis.new
assert_equal(0, analysis.level)
end
end

View File

@ -0,0 +1,19 @@
class TestAttribute < Test::Unit::TestCase
include PangoTestUtils
def setup
@attribute = Pango::AttrLanguage.new(Pango::Language.default)
end
def test_start_index
assert_equal(0, @attribute.start_index)
@attribute.start_index = 5
assert_equal(5, @attribute.start_index)
end
def test_end_index
assert_equal(GLib::MAXUINT, @attribute.end_index)
@attribute.end_index = 5
assert_equal(5, @attribute.end_index)
end
end

View File

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
class TestPangoColor < Test::Unit::TestCase
include PangoTestUtils
def test_red
color = Pango::Color.new(0, 0, 0)
assert_equal(0, color.red)
color.red = 32768
assert_equal(32768, color.red)
end
def test_blue
color = Pango::Color.new(0, 0, 0)
assert_equal(0, color.blue)
color.blue = 32768
assert_equal(32768, color.blue)
end
def test_green
color = Pango::Color.new(0, 0, 0)
assert_equal(0, color.green)
color.green = 32768
assert_equal(32768, color.green)
end
def test_to_a
color = Pango::Color.new(65535, 32768, 0)
assert_equal([65535, 32768, 0], color.to_a)
end
end

View File

@ -0,0 +1,7 @@
class TestLanguage < Test::Unit::TestCase
include PangoTestUtils
def test_default
assert_match(/\A[a-z]{2}-[a-z]{2}\z/, Pango::Language.default.to_s)
end
end

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
class TestPangoLogAttr < Test::Unit::TestCase
include PangoTestUtils
def test_line_break?
attribute = Pango::LogAttr.new
assert_false(attribute.line_break?)
end
end

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
class TestPangoMatrix < Test::Unit::TestCase
include PangoTestUtils
def test_xx
matrix = Pango::Matrix.new
assert_equal(1.0, matrix.xx)
end
end

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
class TestPangoRectangle < Test::Unit::TestCase
include PangoTestUtils
def test_width
rectangle = Pango::Rectangle.new(0, 10, 20, 30)
assert_equal(20, rectangle.width)
end
end

View File

@ -0,0 +1,20 @@
class TestLayout < Test::Unit::TestCase
include PangoTestUtils
def setup
@context = Pango::Context.new
@layout = Pango::Layout.new(@context)
end
def test_set_font_description
assert_nil(@layout.font_description)
@layout.font_description = "sans 14"
assert_equal("sans 14", @layout.font_description.to_s)
description = Pango::FontDescription.new("monospace")
description.size = 10 * Pango::SCALE
@layout.font_description = description
assert_equal("monospace 10", @layout.font_description.to_s)
end
end