goocanvas 0.90.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. data/ChangeLog +87 -0
  2. data/README +37 -0
  3. data/Rakefile +14 -0
  4. data/ext/goocanvas/Makefile +162 -0
  5. data/ext/goocanvas/depend +5 -0
  6. data/ext/goocanvas/extconf.rb +66 -0
  7. data/ext/goocanvas/goocanvas.def +2 -0
  8. data/ext/goocanvas/goocanvas.so +0 -0
  9. data/ext/goocanvas/rbgoo_canvasversion.h +25 -0
  10. data/ext/goocanvas/rbgoocairo.c +74 -0
  11. data/ext/goocanvas/rbgoocairo.o +0 -0
  12. data/ext/goocanvas/rbgoocanvas.c +236 -0
  13. data/ext/goocanvas/rbgoocanvas.h +66 -0
  14. data/ext/goocanvas/rbgoocanvas.o +0 -0
  15. data/ext/goocanvas/rbgoocanvasellipse.c +50 -0
  16. data/ext/goocanvas/rbgoocanvasellipse.o +0 -0
  17. data/ext/goocanvas/rbgoocanvasgroup.c +41 -0
  18. data/ext/goocanvas/rbgoocanvasgroup.o +0 -0
  19. data/ext/goocanvas/rbgoocanvasimage.c +45 -0
  20. data/ext/goocanvas/rbgoocanvasimage.o +0 -0
  21. data/ext/goocanvas/rbgoocanvasitem.c +358 -0
  22. data/ext/goocanvas/rbgoocanvasitem.o +0 -0
  23. data/ext/goocanvas/rbgoocanvaspolyline.c +102 -0
  24. data/ext/goocanvas/rbgoocanvaspolyline.o +0 -0
  25. data/ext/goocanvas/rbgoocanvasrect.c +47 -0
  26. data/ext/goocanvas/rbgoocanvasrect.o +0 -0
  27. data/ext/goocanvas/rbgoocanvasstyle.c +61 -0
  28. data/ext/goocanvas/rbgoocanvasstyle.o +0 -0
  29. data/ext/goocanvas/rbgoocanvastable.c +41 -0
  30. data/ext/goocanvas/rbgoocanvastable.o +0 -0
  31. data/ext/goocanvas/rbgoocanvastext.c +58 -0
  32. data/ext/goocanvas/rbgoocanvastext.o +0 -0
  33. data/ext/goocanvas/rbgoocanvaswidget.c +48 -0
  34. data/ext/goocanvas/rbgoocanvaswidget.o +0 -0
  35. data/ext/goocanvas/rbgooutils.c +44 -0
  36. data/ext/goocanvas/rbgooutils.o +0 -0
  37. data/ext/goocanvas/ruby-goocanvas.pc +3 -0
  38. data/extconf.rb +49 -0
  39. data/lib/goocanvas.rb +145 -0
  40. data/sample/demo-arrowhead.rb +315 -0
  41. data/sample/demo-fifteen.rb +218 -0
  42. data/sample/demo-primitives.rb +720 -0
  43. data/sample/demo.rb +84 -0
  44. data/sample/flower.png +0 -0
  45. data/sample/scalability-demo.rb +130 -0
  46. data/sample/simple-demo.rb +35 -0
  47. data/sample/table-demo.rb +137 -0
  48. data/sample/toroid.png +0 -0
  49. data/sample/units-demo.rb +80 -0
  50. data/sample/widgets-demo.rb +197 -0
  51. metadata +133 -0
@@ -0,0 +1,87 @@
1
+ 2011-01-30 Kouhei Sutou <kou@cozmixng.org>
2
+
3
+ * ./: support gem for Windows build.
4
+
5
+ 2011-01-28 Masaaki Aoyagi
6
+
7
+ * src/lib/: -> lib/.
8
+
9
+ * src/: -> ext/goocanvas/.
10
+
11
+ * extconf.rb: -> ext/goocanvas/extconf.rb
12
+
13
+ * ext/goocanvas/extconf.rb: support directory structure change.
14
+
15
+ * extconf.rb: add.
16
+
17
+ * Rakefile: add.
18
+
19
+ 2010-09-23 Kouhei Sutou <kou@cozmixng.org>
20
+
21
+ * extconf.rb: support Ruby/GLib2 directory structure change.
22
+
23
+ 2008-11-01 Kouhei Sutou <kou@cozmixng.org>
24
+
25
+ * src/: use RARRAY_PTR() and RARRAY_LEN().
26
+
27
+ 2008-09-30 yselkowitz
28
+
29
+ * extconf.rb: add missing dependencies.
30
+
31
+ 2008-09-14 Kouhei Sutou <kou@cozmixng.org>
32
+
33
+ * extconf.rb: fix path.
34
+
35
+ 2008-09-13 Kouhei Sutou <kou@cozmixng.org>
36
+
37
+ * extconf.rb: use check_cairo.
38
+
39
+ * /: move to The Ruby-GNOME2 Project.
40
+
41
+ 2008-08-16 Kouhei Sutou <kou@cozmixng.org>
42
+
43
+ * sample/demo-primitives.rb: update menu widgets to follow the
44
+ latest original demo.
45
+
46
+ * sample/demo-primitives.rb: TAB -> 2 spaces.
47
+
48
+ 2008-07-21 Kouhei Sutou <kou@cozmixng.org>
49
+
50
+ * src/rbgoocairo.c (rb_cairo_pattern_to_goo)
51
+ (rb_cairo_matrix_to_goo): fix a reference count bug.
52
+
53
+ * sample/demo-fifteen.rb (CanvasSampleFifteen#scramble): fix broken.
54
+
55
+ * src/rbgoocanvas.c: bind Goo::Canvas#scroll_to.
56
+
57
+ 2008-06-27 Kouhei Sutou <kou@cozmixng.org>
58
+
59
+ * sample/demo.rb: support quiting by C-q.
60
+
61
+ * sample/demo.rb: set $LOAD_PATH.
62
+
63
+ 2007-06-22 Kouhei Sutou <kou@cozmixng.org>
64
+
65
+ * src/:
66
+ - cleanup macros.
67
+ - cleanup styles.
68
+
69
+ * src/rbgoocanvasitem.c:
70
+ - fixed style.
71
+ - used more self-describing macro.
72
+
73
+ * README: added.
74
+
75
+ 2007-05-02 Kouhei Sutou <kou@cozmixng.org>
76
+
77
+ * sample/demo.rb: cleanup.
78
+
79
+ * extconf.rb, src/rbgoocairo.c: required >= 0.8.0.
80
+
81
+ * sample/demo.rb: untabified.
82
+
83
+ * extconf.rb: supported GooCanvas version check in C.
84
+
85
+ * src/rbgoocanvas.h, src/rbgoocairo.c: supported build with
86
+ GooCanvas 0.6.0.
87
+
data/README ADDED
@@ -0,0 +1,37 @@
1
+ Ruby/GooCanvas
2
+ ==============
3
+ Ruby/GooCanvas is a Ruby binding of GooCanvas.
4
+
5
+ Requirements
6
+ ------------
7
+ Ruby: http://www.ruby-lang.org/
8
+ GooCanvas: http://live.gnome.org/GooCanvas
9
+
10
+ Install
11
+ -------
12
+ 0. install ruby-1.8.x or later and GooCanvas.
13
+ 1. ruby extconf.rb
14
+ 2. make
15
+ 3. su
16
+ 4. make install
17
+
18
+ Copying
19
+ -------
20
+ Copyright (c) 2008 Ruby-GNOME2 Project Team
21
+ Copyright (c) 2007 Vincent Isambart
22
+ Copyright (c) 2007 Kouhei Sutou <kou@cozmixng.org>
23
+ Copyright (c) 2007 Manu
24
+
25
+ This program is free software.
26
+ You can distribute/modify this program under the terms of
27
+ the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
28
+
29
+ Project Website
30
+ ---------------
31
+ http://ruby-gnome2.sourceforge.jp/
32
+
33
+ Thanks
34
+ ------
35
+
36
+ * Andrew Whyte
37
+ - improved rbgoocanvasitem.c.
@@ -0,0 +1,14 @@
1
+ # -*- ruby -*-
2
+
3
+ require './../glib2/lib/gnome2-raketask'
4
+
5
+ package = GNOME2Package.new do |_package|
6
+ _package.summary = "Ruby/GooCanvas is a Ruby binding of GooCanvas."
7
+ _package.description = "Ruby/GooCanvas is a Ruby binding of GooCanvas."
8
+ _package.dependency.gem.runtime = ["gtk2"]
9
+ _package.win32.packages = ["goocanvas"]
10
+ _package.win32.dependencies = []
11
+ _package.post_install_message = "This library is experimental."
12
+ end
13
+ package.define_tasks
14
+
@@ -0,0 +1,162 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ #### Start of system configuration section. ####
5
+
6
+ srcdir = /home/kou/work/ruby/ruby-gnome2/goocanvas/ext/goocanvas
7
+ topdir = /usr/lib/ruby/1.8/x86_64-linux
8
+ hdrdir = $(topdir)
9
+ VPATH = $(srcdir):$(topdir):$(hdrdir)
10
+ exec_prefix = $(prefix)
11
+ prefix = $(DESTDIR)/usr
12
+ sharedstatedir = $(prefix)/com
13
+ mandir = $(prefix)/share/man
14
+ psdir = $(docdir)
15
+ oldincludedir = $(DESTDIR)/usr/include
16
+ localedir = $(datarootdir)/locale
17
+ bindir = $(exec_prefix)/bin
18
+ libexecdir = $(prefix)/lib/ruby1.8
19
+ sitedir = $(DESTDIR)/usr/local/lib/site_ruby
20
+ htmldir = $(docdir)
21
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
22
+ includedir = $(prefix)/include
23
+ infodir = $(prefix)/share/info
24
+ vendorlibdir = $(vendordir)/$(ruby_version)
25
+ sysconfdir = $(DESTDIR)/etc
26
+ libdir = $(exec_prefix)/lib
27
+ sbindir = $(exec_prefix)/sbin
28
+ rubylibdir = $(libdir)/ruby/$(ruby_version)
29
+ docdir = $(datarootdir)/doc/$(PACKAGE)
30
+ dvidir = $(docdir)
31
+ vendordir = $(libdir)/ruby/vendor_ruby
32
+ datarootdir = $(prefix)/share
33
+ pdfdir = $(docdir)
34
+ archdir = $(rubylibdir)/$(arch)
35
+ sitearchdir = $(sitelibdir)/$(sitearch)
36
+ datadir = $(datarootdir)
37
+ localstatedir = $(DESTDIR)/var
38
+ sitelibdir = $(sitedir)/$(ruby_version)
39
+
40
+ CC = gcc
41
+ LIBRUBY = $(LIBRUBY_SO)
42
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
43
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
44
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
45
+
46
+ RUBY_EXTCONF_H =
47
+ CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC $(cflags) -Wall -I/usr/include/goocanvas-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/atk-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -pthread -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/home/kou/work/ruby/rcairo/ext/cairo
48
+ INCFLAGS = -I. -I/home/kou/work/ruby/ruby-gnome2/gtk2/ext/gtk2 -I/home/kou/work/ruby/ruby-gnome2/gtk2/ext/gtk2 -I/home/kou/work/ruby/ruby-gnome2/gtk2/ext/gtk2 -I/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2 -I/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2 -I/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2 -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/ruby-gnome2/goocanvas/ext/goocanvas
49
+ DEFS =
50
+ CPPFLAGS = -DHAVE_RB_DEFINE_ALLOC_FUNC -DHAVE_RB_BLOCK_PROC -DHAVE_OBJECT_ALLOCATE -DHAVE_NODE_ATTRASGN -DHAVE_RB_CAIRO_H -DRUBY_GOO_CANVAS_COMPILATION
51
+ CXXFLAGS = $(CFLAGS)
52
+ ldflags = -L. -rdynamic -Wl,-export-dynamic -pthread
53
+ dldflags =
54
+ archflag =
55
+ DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
56
+ LDSHARED = $(CC) -shared
57
+ AR = ar
58
+ EXEEXT =
59
+
60
+ RUBY_INSTALL_NAME = ruby1.8
61
+ RUBY_SO_NAME = ruby1.8
62
+ arch = x86_64-linux
63
+ sitearch = x86_64-linux
64
+ ruby_version = 1.8
65
+ ruby = /usr/bin/ruby1.8
66
+ RUBY = $(ruby)
67
+ RM = rm -f
68
+ MAKEDIRS = mkdir -p
69
+ INSTALL = /usr/bin/install -c
70
+ INSTALL_PROG = $(INSTALL) -m 0755
71
+ INSTALL_DATA = $(INSTALL) -m 644
72
+ COPY = cp
73
+
74
+ #### End of system configuration section. ####
75
+
76
+ preload =
77
+
78
+ libpath = . $(libdir)
79
+ LIBPATH = -L. -L$(libdir)
80
+ DEFFILE =
81
+
82
+ CLEANFILES = mkmf.log
83
+ DISTCLEANFILES = rbgoo_canvasversion.h
84
+
85
+ extout =
86
+ extout_prefix =
87
+ target_prefix =
88
+ LOCAL_LIBS =
89
+ LIBS = $(LIBRUBYARG_SHARED) -lgoocanvas -lgtk-x11-2.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lglib-2.0 -lgthread-2.0 -lrt -lgmodule-2.0 -lpango-1.0 -lpangocairo-1.0 -lcairo -lgio-2.0 -latk-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lcairo -lpthread -lrt -ldl -lcrypt -lm -lc
90
+ SRCS = rbgoocanvastext.c rbgoocanvasimage.c rbgoocanvastable.c rbgooutils.c rbgoocanvas.c rbgoocanvaspolyline.c rbgoocairo.c rbgoocanvasrect.c rbgoocanvasellipse.c rbgoocanvasitem.c rbgoocanvasstyle.c rbgoocanvaswidget.c rbgoocanvasgroup.c
91
+ OBJS = rbgoocanvastext.o rbgoocanvasimage.o rbgoocanvastable.o rbgooutils.o rbgoocanvas.o rbgoocanvaspolyline.o rbgoocairo.o rbgoocanvasrect.o rbgoocanvasellipse.o rbgoocanvasitem.o rbgoocanvasstyle.o rbgoocanvaswidget.o rbgoocanvasgroup.o
92
+ TARGET = goocanvas
93
+ DLLIB = $(TARGET).so
94
+ EXTSTATIC =
95
+ STATIC_LIB =
96
+
97
+ BINDIR = $(bindir)
98
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
99
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
100
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
101
+
102
+ TARGET_SO = $(DLLIB)
103
+ CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
104
+ CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
105
+
106
+ all: $(DLLIB)
107
+ static: $(STATIC_LIB)
108
+
109
+ clean:
110
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
111
+
112
+ distclean: clean
113
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
114
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
115
+
116
+ realclean: distclean
117
+ install: install-so install-rb
118
+
119
+ install-so: $(RUBYARCHDIR)
120
+ install-so: $(RUBYARCHDIR)/$(DLLIB)
121
+ $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
122
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
123
+ install-rb: pre-install-rb install-rb-default
124
+ install-rb-default: pre-install-rb-default
125
+ pre-install-rb: Makefile
126
+ pre-install-rb-default: Makefile
127
+ $(RUBYARCHDIR):
128
+ $(MAKEDIRS) $@
129
+
130
+ site-install: site-install-so site-install-rb
131
+ site-install-so: install-so
132
+ site-install-rb: install-rb
133
+
134
+ .SUFFIXES: .c .m .cc .cxx .cpp .C .o
135
+
136
+ .cc.o:
137
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
138
+
139
+ .cxx.o:
140
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
141
+
142
+ .cpp.o:
143
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
144
+
145
+ .C.o:
146
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
147
+
148
+ .c.o:
149
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
150
+
151
+ $(DLLIB): $(OBJS) Makefile
152
+ @-$(RM) $@
153
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
154
+
155
+
156
+
157
+ ###
158
+ install:
159
+ if test -n "$(pkgconfigdir)"; then \
160
+ $(MAKEDIRS) $(pkgconfigdir); \
161
+ $(INSTALL_DATA) ../ruby-goocanvas.pc $(pkgconfigdir); \
162
+ fi
@@ -0,0 +1,5 @@
1
+ install:
2
+ if test -n "$(pkgconfigdir)"; then \
3
+ $(MAKEDIRS) $(pkgconfigdir); \
4
+ $(INSTALL_DATA) ../ruby-goocanvas.pc $(pkgconfigdir); \
5
+ fi
@@ -0,0 +1,66 @@
1
+ =begin
2
+ extconf.rb for Ruby/GooCanvas extension library
3
+ =end
4
+
5
+ require 'pathname'
6
+
7
+ base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ top_dir = base_dir.parent.expand_path
9
+ top_build_dir = Pathname(".").parent.parent.parent.expand_path
10
+
11
+ mkmf_gnome2_dir = top_dir + "glib2" + 'lib'
12
+ version_suffix = ""
13
+ unless mkmf_gnome2_dir.exist?
14
+ if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s
15
+ version_suffix = $1
16
+ mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib'
17
+ end
18
+ end
19
+
20
+ $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s)
21
+
22
+ module_name = "goocanvas"
23
+ package_id = "goocanvas"
24
+
25
+ require 'mkmf-gnome2'
26
+
27
+ ["glib2", "atk", "pango", "gdk_pixbuf2", "gtk2"].each do |package|
28
+ directory = "#{package}#{version_suffix}"
29
+ build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
30
+ add_depend_package(package, "#{directory}/ext/#{package}",
31
+ top_dir.to_s,
32
+ :top_build_dir => top_build_dir.to_s,
33
+ :target_build_dir => build_dir)
34
+ end
35
+
36
+ rcairo_options = {}
37
+ rcairo_source_dir_names = ["rcairo"]
38
+ if /mingw|cygwin|mswin32/ =~ RUBY_PLATFORM
39
+ rcairo_source_dir_names.unshift("rcairo.win32")
40
+ end
41
+ rcairo_source_dir_names.each do |rcairo_source_dir_name|
42
+ rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name
43
+ if rcairo_source_dir.exist?
44
+ rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s
45
+ break
46
+ end
47
+ end
48
+ check_cairo(rcairo_options) or exit(false)
49
+
50
+ setup_win32(module_name, base_dir)
51
+
52
+ PKGConfig.have_package(package_id) or exit 1
53
+
54
+ make_version_header("GOO_CANVAS", package_id, ".")
55
+
56
+ create_pkg_config_file("Ruby/GooCanvas", package_id)
57
+ $defs << "-DRUBY_GOO_CANVAS_COMPILATION"
58
+ create_makefile(module_name)
59
+ pkg_config_dir = with_config("pkg-config-dir")
60
+ if pkg_config_dir.is_a?(String)
61
+ File.open("Makefile", "ab") do |makefile|
62
+ makefile.puts
63
+ makefile.puts("pkgconfigdir=#{pkg_config_dir}")
64
+ end
65
+ end
66
+
@@ -0,0 +1,2 @@
1
+ EXPORTS
2
+ Init_goocanvas
@@ -0,0 +1,25 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /************************************************
3
+
4
+ rbgoo_canvasversion.h -
5
+
6
+ This file was generated by mkmf-gnome2.rb.
7
+
8
+ ************************************************/
9
+
10
+ #ifndef __RBGOO_CANVAS_VERSION_H__
11
+ #define __RBGOO_CANVAS_VERSION_H__
12
+
13
+ #define GOO_CANVAS_MAJOR_VERSION (2)
14
+ #define GOO_CANVAS_MINOR_VERSION (0)
15
+ #define GOO_CANVAS_MICRO_VERSION (0)
16
+ #define GOO_CANVAS_TAG_VERSION (b7)
17
+
18
+ #define GOO_CANVAS_CHECK_VERSION(major,minor,micro) \
19
+ (GOO_CANVAS_MAJOR_VERSION > (major) || \
20
+ (GOO_CANVAS_MAJOR_VERSION == (major) && GOO_CANVAS_MINOR_VERSION > (minor)) || \
21
+ (GOO_CANVAS_MAJOR_VERSION == (major) && GOO_CANVAS_MINOR_VERSION == (minor) && \
22
+ GOO_CANVAS_MICRO_VERSION >= (micro)))
23
+
24
+
25
+ #endif /* __RBGOO_CANVAS_VERSION_H__ */
@@ -0,0 +1,74 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /* $Id: rbgoocairo.c 3288 2008-09-13 10:07:44Z ktou $ */
3
+ /* convertion from Cairo types to GooCairo types
4
+ * Copyright (C) 2007 Vincent Isambart <vincent.isambart@gmail.com>
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
+ */
20
+
21
+ #include "rbgoocanvas.h"
22
+
23
+ static VALUE
24
+ rb_cairo_pattern_to_goo(VALUE self)
25
+ {
26
+ GValue gval = {0,};
27
+ VALUE result;
28
+
29
+ g_value_init(&gval, GOO_TYPE_CAIRO_PATTERN);
30
+ g_value_set_boxed(&gval, RVAL2CRPATTERN(self));
31
+
32
+ result = rbgobj_gvalue_to_rvalue(&gval);
33
+ g_value_unset(&gval);
34
+
35
+ return result;
36
+ }
37
+
38
+ static VALUE
39
+ rb_cairo_matrix_to_goo(VALUE self)
40
+ {
41
+ GValue gval = {0,};
42
+ VALUE result;
43
+
44
+ g_value_init(&gval, GOO_TYPE_CAIRO_MATRIX);
45
+ g_value_set_boxed(&gval, RVAL2CRMATRIX(self));
46
+
47
+ result = rbgobj_gvalue_to_rvalue(&gval);
48
+ g_value_unset(&gval);
49
+
50
+ return result;
51
+ }
52
+
53
+ void
54
+ Init_goocairo(void)
55
+ {
56
+ VALUE Cairo, CairoPattern, CairoMatrix;
57
+
58
+ G_DEF_CLASS(GOO_TYPE_CAIRO_MATRIX, "CairoMatrix", mGoo);
59
+ G_DEF_CLASS(GOO_TYPE_CAIRO_PATTERN, "CairoPattern", mGoo);
60
+ G_DEF_CLASS(GOO_TYPE_CAIRO_FILL_RULE, "CairoFillRule", mGoo);
61
+ G_DEF_CLASS(GOO_TYPE_CAIRO_OPERATOR, "CairoOperator", mGoo);
62
+ G_DEF_CLASS(GOO_TYPE_CAIRO_ANTIALIAS, "CairoAntiAlias", mGoo);
63
+ G_DEF_CLASS(GOO_TYPE_CAIRO_LINE_CAP, "CairoLineCap", mGoo);
64
+ G_DEF_CLASS(GOO_TYPE_CAIRO_LINE_JOIN, "CairoLineJoin", mGoo);
65
+ G_DEF_CLASS(GOO_TYPE_CAIRO_HINT_METRICS, "CairoHintMetrics", mGoo);
66
+
67
+ Cairo = rb_const_get(rb_mKernel, rb_intern("Cairo"));
68
+
69
+ CairoPattern = rb_const_get(Cairo, rb_intern("Pattern"));
70
+ rb_define_method(CairoPattern, "to_goo", rb_cairo_pattern_to_goo, 0);
71
+
72
+ CairoMatrix = rb_const_get(Cairo, rb_intern("Matrix"));
73
+ rb_define_method(CairoMatrix, "to_goo", rb_cairo_matrix_to_goo, 0);
74
+ }