goocanvas 0.90.6-x86-mingw32

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 (136) hide show
  1. data/ChangeLog +87 -0
  2. data/README +37 -0
  3. data/Rakefile +14 -0
  4. data/ext/goocanvas/depend +5 -0
  5. data/ext/goocanvas/extconf.rb +66 -0
  6. data/ext/goocanvas/goocanvas.def +2 -0
  7. data/ext/goocanvas/rbgoocairo.c +74 -0
  8. data/ext/goocanvas/rbgoocanvas.c +236 -0
  9. data/ext/goocanvas/rbgoocanvas.h +66 -0
  10. data/ext/goocanvas/rbgoocanvasellipse.c +50 -0
  11. data/ext/goocanvas/rbgoocanvasgroup.c +41 -0
  12. data/ext/goocanvas/rbgoocanvasimage.c +45 -0
  13. data/ext/goocanvas/rbgoocanvasitem.c +358 -0
  14. data/ext/goocanvas/rbgoocanvaspolyline.c +102 -0
  15. data/ext/goocanvas/rbgoocanvasrect.c +47 -0
  16. data/ext/goocanvas/rbgoocanvasstyle.c +61 -0
  17. data/ext/goocanvas/rbgoocanvastable.c +41 -0
  18. data/ext/goocanvas/rbgoocanvastext.c +58 -0
  19. data/ext/goocanvas/rbgoocanvaswidget.c +48 -0
  20. data/ext/goocanvas/rbgooutils.c +44 -0
  21. data/extconf.rb +49 -0
  22. data/lib/1.8/goocanvas.so +0 -0
  23. data/lib/1.9/goocanvas.so +0 -0
  24. data/lib/goocanvas.rb +145 -0
  25. data/sample/demo-arrowhead.rb +315 -0
  26. data/sample/demo-fifteen.rb +218 -0
  27. data/sample/demo-primitives.rb +720 -0
  28. data/sample/demo.rb +84 -0
  29. data/sample/flower.png +0 -0
  30. data/sample/scalability-demo.rb +130 -0
  31. data/sample/simple-demo.rb +35 -0
  32. data/sample/table-demo.rb +137 -0
  33. data/sample/toroid.png +0 -0
  34. data/sample/units-demo.rb +80 -0
  35. data/sample/widgets-demo.rb +197 -0
  36. data/vendor/local/bin/libgoocanvas-3.dll +0 -0
  37. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvas.h +334 -0
  38. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasatk.h +22 -0
  39. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasellipse.h +120 -0
  40. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasenumtypes.h +33 -0
  41. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasgrid.h +153 -0
  42. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasgroup.h +109 -0
  43. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasimage.h +121 -0
  44. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasitem.h +479 -0
  45. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasitemmodel.h +275 -0
  46. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasitemsimple.h +247 -0
  47. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasmarshal.h +61 -0
  48. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvaspath.h +116 -0
  49. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvaspolyline.h +176 -0
  50. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasprivate.h +59 -0
  51. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasrect.h +121 -0
  52. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasstyle.h +110 -0
  53. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvastable.h +139 -0
  54. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvastext.h +133 -0
  55. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasutils.h +333 -0
  56. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvaswidget.h +66 -0
  57. data/vendor/local/include/goocanvas-1.0.0/goocanvas/stamp-goocanvasmarshal.h +1 -0
  58. data/vendor/local/lib/libgoocanvas.a +0 -0
  59. data/vendor/local/lib/libgoocanvas.dll.a +0 -0
  60. data/vendor/local/lib/pkgconfig/goocanvas.pc +13 -0
  61. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvas.html +1982 -0
  62. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasEllipse.html +269 -0
  63. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasEllipseModel.html +274 -0
  64. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasGrid.html +469 -0
  65. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasGridModel.html +476 -0
  66. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasGroup.html +183 -0
  67. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasGroupModel.html +184 -0
  68. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasImage.html +247 -0
  69. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasImageModel.html +252 -0
  70. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasItem.html +3014 -0
  71. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasItemModel.html +1764 -0
  72. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasItemModelSimple.html +298 -0
  73. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasItemSimple.html +809 -0
  74. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasPath.html +279 -0
  75. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasPathModel.html +280 -0
  76. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasPolyline.html +369 -0
  77. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasPolylineModel.html +375 -0
  78. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasRect.html +247 -0
  79. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasRectModel.html +252 -0
  80. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasStyle.html +489 -0
  81. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasTable.html +452 -0
  82. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasTableModel.html +452 -0
  83. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasText.html +324 -0
  84. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasTextModel.html +287 -0
  85. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasWidget.html +266 -0
  86. data/vendor/local/share/gtk-doc/html/goocanvas/ch01.html +53 -0
  87. data/vendor/local/share/gtk-doc/html/goocanvas/ch02.html +50 -0
  88. data/vendor/local/share/gtk-doc/html/goocanvas/ch03.html +62 -0
  89. data/vendor/local/share/gtk-doc/html/goocanvas/ch04.html +60 -0
  90. data/vendor/local/share/gtk-doc/html/goocanvas/ch05.html +33 -0
  91. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-GooCanvas-Types.html +815 -0
  92. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-architecture.html +157 -0
  93. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-coordinates.html +106 -0
  94. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-creating-items.html +420 -0
  95. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-model-view-canvas.html +246 -0
  96. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-overview.html +106 -0
  97. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-simple-canvas.html +238 -0
  98. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-wysiwyg.html +84 -0
  99. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas.devhelp +608 -0
  100. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas.devhelp2 +639 -0
  101. data/vendor/local/share/gtk-doc/html/goocanvas/home.png +0 -0
  102. data/vendor/local/share/gtk-doc/html/goocanvas/index.html +138 -0
  103. data/vendor/local/share/gtk-doc/html/goocanvas/index.sgml +814 -0
  104. data/vendor/local/share/gtk-doc/html/goocanvas/left.png +0 -0
  105. data/vendor/local/share/gtk-doc/html/goocanvas/right.png +0 -0
  106. data/vendor/local/share/gtk-doc/html/goocanvas/style.css +257 -0
  107. data/vendor/local/share/gtk-doc/html/goocanvas/up.png +0 -0
  108. data/vendor/local/share/gtk-doc/tmpl/goocanvas/dummy.sgml +0 -0
  109. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvas-unused.sgml +0 -0
  110. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvas.sgml +536 -0
  111. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasellipse.sgml +82 -0
  112. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasellipsemodel.sgml +82 -0
  113. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasgrid.sgml +176 -0
  114. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasgridmodel.sgml +176 -0
  115. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasgroup.sgml +58 -0
  116. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasgroupmodel.sgml +58 -0
  117. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasimage.sgml +81 -0
  118. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasimagemodel.sgml +81 -0
  119. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasitem.sgml +773 -0
  120. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasitemmodel.sgml +490 -0
  121. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasitemmodelsimple.sgml +135 -0
  122. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasitemsimple.sgml +254 -0
  123. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaspath.sgml +64 -0
  124. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaspathmodel.sgml +64 -0
  125. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaspolyline.sgml +109 -0
  126. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaspolylinemodel.sgml +109 -0
  127. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasrect.sgml +72 -0
  128. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasrectmodel.sgml +72 -0
  129. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasstyle.sgml +186 -0
  130. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvastable.sgml +158 -0
  131. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvastablemodel.sgml +158 -0
  132. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvastext.sgml +103 -0
  133. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvastextmodel.sgml +93 -0
  134. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasutils.sgml +241 -0
  135. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaswidget.sgml +73 -0
  136. metadata +218 -0
data/ChangeLog ADDED
@@ -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.
data/Rakefile ADDED
@@ -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,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,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
+ }
@@ -0,0 +1,236 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /* $Id: rbgoocanvas.c 3288 2008-09-13 10:07:44Z ktou $ */
3
+ /* GooCanvas initialization
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
+ VALUE mGoo;
24
+
25
+ #define SELF(self) RVAL2GC(self)
26
+
27
+ void
28
+ rb_goo_canvas_initialize_item_object(VALUE obj, GooCanvasItem *item)
29
+ {
30
+ g_object_ref_sink(item);
31
+ G_INITIALIZE(obj, item);
32
+ }
33
+
34
+ static VALUE
35
+ rb_goo_canvas_new(VALUE self)
36
+ {
37
+ RBGTK_INITIALIZE(self, goo_canvas_new());
38
+ return Qnil;
39
+ }
40
+
41
+ static VALUE
42
+ rb_goo_canvas_set_bounds(VALUE self, VALUE left, VALUE top,
43
+ VALUE right, VALUE bottom)
44
+ {
45
+ goo_canvas_set_bounds(SELF(self), NUM2DBL(left), NUM2DBL(top),
46
+ NUM2DBL(right), NUM2DBL(bottom));
47
+ return self;
48
+ }
49
+
50
+ static VALUE
51
+ rb_goo_canvas_get_root_item(VALUE self)
52
+ {
53
+ VALUE root;
54
+
55
+ root = GOBJ2RVAL(goo_canvas_get_root_item(SELF(self)));
56
+ G_CHILD_ADD(self, root);
57
+
58
+ return root;
59
+ }
60
+
61
+ static VALUE
62
+ rb_goo_canvas_grab_focus(int argc, VALUE *argv, VALUE self)
63
+ {
64
+ VALUE item;
65
+
66
+ if (rb_scan_args(argc, argv, "01", &item) == 1) {
67
+ goo_canvas_grab_focus(SELF(self), RVAL2GCI(item));
68
+ } else {
69
+ rb_call_super(0, 0);
70
+ }
71
+
72
+ return self;
73
+ }
74
+
75
+ static VALUE
76
+ rb_goo_canvas_pointer_grab(VALUE self, VALUE item, VALUE event_mask, VALUE cursor, VALUE etime)
77
+ {
78
+ return GENUM2RVAL(
79
+ goo_canvas_pointer_grab(SELF(self), RVAL2GCI(item),
80
+ NUM2INT(event_mask),
81
+ (GdkCursor *)RVAL2BOXED(cursor, GDK_TYPE_CURSOR),
82
+ NIL_P(etime) ? 0 : NUM2UINT(etime)),
83
+ GDK_TYPE_GRAB_STATUS);
84
+ }
85
+
86
+ static VALUE
87
+ rb_goo_canvas_pointer_ungrab(VALUE self, VALUE item, VALUE etime)
88
+ {
89
+ goo_canvas_pointer_ungrab(SELF(self), RVAL2GCI(item),
90
+ NIL_P(etime) ? 0 : NUM2UINT(etime));
91
+ return self;
92
+ }
93
+
94
+ static VALUE
95
+ rb_goo_canvas_render(VALUE self, VALUE cr, VALUE rb_bounds, VALUE scale)
96
+ {
97
+ GooCanvasBounds bounds;
98
+
99
+ goo_canvas_render(SELF(self), RVAL2CRCONTEXT(cr),
100
+ RVAL2GCBOUNDS(rb_bounds, &bounds),
101
+ NUM2DBL(scale));
102
+ return self;
103
+ }
104
+
105
+ static VALUE
106
+ rb_goo_canvas_scroll_to(VALUE self, VALUE left, VALUE top)
107
+ {
108
+ goo_canvas_scroll_to(SELF(self), NUM2DBL(left), NUM2DBL(top));
109
+ return self;
110
+ }
111
+
112
+ void
113
+ Init_goocanvas(void)
114
+ {
115
+ VALUE cGooCanvas;
116
+
117
+ mGoo = rb_define_module("Goo");
118
+ cGooCanvas = G_DEF_CLASS(GOO_TYPE_CANVAS, "Canvas", mGoo);
119
+
120
+ rb_define_method(cGooCanvas, "initialize", rb_goo_canvas_new, 0);
121
+ rb_define_method(cGooCanvas, "set_bounds", rb_goo_canvas_set_bounds, 4);
122
+ rb_define_method(cGooCanvas, "root_item", rb_goo_canvas_get_root_item, 0);
123
+ rb_define_method(cGooCanvas, "grab_focus", rb_goo_canvas_grab_focus, -1);
124
+ rb_define_method(cGooCanvas, "pointer_grab", rb_goo_canvas_pointer_grab, 4);
125
+ rb_define_method(cGooCanvas, "pointer_ungrab",
126
+ rb_goo_canvas_pointer_ungrab, 2);
127
+ rb_define_method(cGooCanvas, "render", rb_goo_canvas_render, 3);
128
+ rb_define_method(cGooCanvas, "scroll_to", rb_goo_canvas_scroll_to, 2);
129
+
130
+ Init_goocanvasitem(); /* Goo::CanvasItem */
131
+ Init_goocanvastext(); /* Goo::CanvasText */
132
+ Init_goocanvasrect(); /* Goo::CanvasRect */
133
+ Init_goocanvasellipse(); /* Goo::CanvasEllipse */
134
+ Init_goocanvaspolyline(); /* Goo::CanvasPolyline */
135
+ Init_goocanvasimage(); /* Goo::CanvasImage */
136
+ Init_goocanvastable(); /* Goo::CanvasTable */
137
+ Init_goocanvaswidget(); /* Goo::CanvasWidget */
138
+ Init_goocanvasstyle(); /* Goo::CanvasStyle */
139
+ Init_goocanvasgroup(); /* Goo::CanvasGroup */
140
+ Init_goocairo(); /* conversion from Cairo types to GooCairo types */
141
+
142
+ #if 0
143
+ GooCanvasItem* goo_canvas_get_root_item (GooCanvas *canvas);
144
+ void goo_canvas_set_root_item (GooCanvas *canvas,
145
+ GooCanvasItem *item);
146
+
147
+ GooCanvasItemModel* goo_canvas_get_root_item_model (GooCanvas *canvas);
148
+ void goo_canvas_set_root_item_model (GooCanvas *canvas,
149
+ GooCanvasItemModel *model);
150
+
151
+ GooCanvasItem* goo_canvas_get_item (GooCanvas *canvas,
152
+ GooCanvasItemModel *model);
153
+ GooCanvasItem* goo_canvas_get_item_at (GooCanvas *canvas,
154
+ gdouble x,
155
+ gdouble y,
156
+ gboolean is_pointer_event);
157
+
158
+ gdouble goo_canvas_get_scale (GooCanvas *canvas);
159
+ void goo_canvas_set_scale (GooCanvas *canvas,
160
+ gdouble scale);
161
+
162
+ void goo_canvas_get_bounds (GooCanvas *canvas,
163
+ gdouble *left,
164
+ gdouble *top,
165
+ gdouble *right,
166
+ gdouble *bottom);
167
+
168
+
169
+ void goo_canvas_grab_focus (GooCanvas *canvas,
170
+ GooCanvasItem *item);
171
+
172
+ void goo_canvas_render (GooCanvas *canvas,
173
+ cairo_t *cr,
174
+ GooCanvasBounds *bounds,
175
+ gdouble scale);
176
+
177
+ /*
178
+ * Coordinate conversion.
179
+ */
180
+ void goo_canvas_convert_to_pixels (GooCanvas *canvas,
181
+ gdouble *x,
182
+ gdouble *y);
183
+ void goo_canvas_convert_from_pixels (GooCanvas *canvas,
184
+ gdouble *x,
185
+ gdouble *y);
186
+
187
+ void goo_canvas_convert_to_item_space (GooCanvas *canvas,
188
+ GooCanvasItem *item,
189
+ gdouble *x,
190
+ gdouble *y);
191
+ void goo_canvas_convert_from_item_space (GooCanvas *canvas,
192
+ GooCanvasItem *item,
193
+ gdouble *x,
194
+ gdouble *y);
195
+
196
+
197
+ /*
198
+ * Pointer/keyboard grabbing & ungrabbing.
199
+ */
200
+ GdkGrabStatus goo_canvas_pointer_grab (GooCanvas *canvas,
201
+ GooCanvasItem *item,
202
+ GdkEventMask event_mask,
203
+ GdkCursor *cursor,
204
+ guint32 time);
205
+ void goo_canvas_pointer_ungrab (GooCanvas *canvas,
206
+ GooCanvasItem *item,
207
+ guint32 time);
208
+ GdkGrabStatus goo_canvas_keyboard_grab (GooCanvas *canvas,
209
+ GooCanvasItem *item,
210
+ gboolean owner_events,
211
+ guint32 time);
212
+ void goo_canvas_keyboard_ungrab (GooCanvas *canvas,
213
+ GooCanvasItem *item,
214
+ guint32 time);
215
+
216
+
217
+ /*
218
+ * Internal functions, mainly for canvas subclasses and item implementations.
219
+ */
220
+ GooCanvasItem* goo_canvas_create_item (GooCanvas *canvas,
221
+ GooCanvasItemModel *model);
222
+ void goo_canvas_unregister_item (GooCanvas *canvas,
223
+ GooCanvasItemModel *model);
224
+ void goo_canvas_update (GooCanvas *canvas);
225
+ void goo_canvas_request_update (GooCanvas *canvas);
226
+ void goo_canvas_request_redraw (GooCanvas *canvas,
227
+ GooCanvasBounds *bounds);
228
+ gdouble goo_canvas_get_default_line_width (GooCanvas *canvas);
229
+
230
+
231
+ void goo_canvas_register_widget_item (GooCanvas *canvas,
232
+ GooCanvasWidget *witem);
233
+ void goo_canvas_unregister_widget_item (GooCanvas *canvas,
234
+ GooCanvasWidget *witem);
235
+ #endif
236
+ }
@@ -0,0 +1,66 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /* $Id: rbgoocanvas.h 3288 2008-09-13 10:07:44Z ktou $ */
3
+ /* GooCanvas main header
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
+ #ifndef _RBGOOCANVAS_H_included
22
+ #define _RBGOOCANVAS_H_included
23
+
24
+ #include <rb_cairo.h>
25
+ #include <rbgtk.h>
26
+ #include <goocanvas.h>
27
+
28
+ #include "rbgoo_canvasversion.h"
29
+
30
+ #define RVAL2GC(obj) GOO_CANVAS(RVAL2GOBJ(obj))
31
+ #define RVAL2GCI(obj) GOO_CANVAS_ITEM(RVAL2GOBJ(obj))
32
+ #define RVAL2GCS(obj) GOO_CANVAS_STYLE(RVAL2GOBJ(obj))
33
+
34
+ #define RVAL2GCPOINTS(obj) \
35
+ ((GooCanvasPoints *)(RVAL2BOXED(obj, GOO_TYPE_CANVAS_POINTS)))
36
+
37
+ #define RVAL2GCBOUNDS(obj, bounds) \
38
+ (ruby_to_goo_canvas_bounds(obj, bounds))
39
+
40
+ #define RVAL2GTK_WIDGET(obj) GTK_WIDGET(RVAL2GOBJ(obj))
41
+
42
+ #define RVAL2GDK_PIXBUF(obj) GDK_PIXBUF(RVAL2GOBJ(obj))
43
+
44
+
45
+ #define RB_GOO_CANVAS_ITEM_INITIALIZE(obj, item) \
46
+ (rb_goo_canvas_initialize_item_object(obj, GOO_CANVAS_ITEM(item)))
47
+
48
+ void rb_goo_canvas_initialize_item_object(VALUE obj, GooCanvasItem *item);
49
+ GooCanvasBounds *ruby_to_goo_canvas_bounds(VALUE rb_bounds, GooCanvasBounds *dest_bounds);
50
+
51
+ void Init_goocanvas(void); /* Goo::Canvas */
52
+ void Init_goocanvasitem(void); /* Goo::CanvasItem */
53
+ void Init_goocanvastext(void); /* Goo::CanvasText */
54
+ void Init_goocanvasrect(void); /* Goo::CanvasRect */
55
+ void Init_goocanvasellipse(void); /* Goo::CanvasEllipse */
56
+ void Init_goocanvaspolyline(void); /* Goo::CanvasPolyline */
57
+ void Init_goocanvasimage(void); /* Goo::CanvasImage */
58
+ void Init_goocanvastable(void); /* Goo::CanvasTable */
59
+ void Init_goocanvaswidget(void); /* Goo::CanvasWidget */
60
+ void Init_goocanvasstyle(void); /* Goo::CanvasStyle */
61
+ void Init_goocanvasgroup(void); /* Goo::CanvasGroup */
62
+ void Init_goocairo(void); /* conversion from Cairo types to GooCairo types */
63
+
64
+ extern VALUE mGoo;
65
+
66
+ #endif /* ! _RBGOOCANVAS_H_included */
@@ -0,0 +1,50 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /* $Id: rbgoocanvasellipse.c 3288 2008-09-13 10:07:44Z ktou $ */
3
+ /* GooCanvasEllipse
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_goo_canvas_ellipse_new(VALUE self, VALUE parent,
25
+ VALUE center_x, VALUE center_y,
26
+ VALUE radius_x, VALUE radius_y)
27
+ {
28
+ GooCanvasItem *item;
29
+ item = goo_canvas_ellipse_new(RVAL2GCI(parent),
30
+ NUM2DBL(center_x),
31
+ NUM2DBL(center_y),
32
+ NUM2DBL(radius_x),
33
+ NUM2DBL(radius_y),
34
+ NULL);
35
+ RB_GOO_CANVAS_ITEM_INITIALIZE(self, item);
36
+ G_CHILD_ADD(parent, self);
37
+ return Qnil;
38
+ }
39
+
40
+ void
41
+ Init_goocanvasellipse(void)
42
+ {
43
+ VALUE GooCanvasEllipse;
44
+
45
+ GooCanvasEllipse = G_DEF_CLASS(GOO_TYPE_CANVAS_ELLIPSE, "CanvasEllipse",
46
+ mGoo);
47
+
48
+ rb_define_method(GooCanvasEllipse, "initialize",
49
+ rb_goo_canvas_ellipse_new, 5);
50
+ }
@@ -0,0 +1,41 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /* $Id: rbgoocanvasgroup.c 3288 2008-09-13 10:07:44Z ktou $ */
3
+ /* GooCanvasGroup
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_goo_canvas_group_new(VALUE self, VALUE parent)
25
+ {
26
+ GooCanvasItem *item;
27
+ item = goo_canvas_group_new(RVAL2GCI(parent), NULL);
28
+ RB_GOO_CANVAS_ITEM_INITIALIZE(self, item);
29
+ G_CHILD_ADD(parent, self);
30
+ return Qnil;
31
+ }
32
+
33
+ void
34
+ Init_goocanvasgroup(void)
35
+ {
36
+ VALUE GooCanvasGroup;
37
+
38
+ GooCanvasGroup = G_DEF_CLASS(GOO_TYPE_CANVAS_GROUP, "CanvasGroup", mGoo);
39
+
40
+ rb_define_method(GooCanvasGroup, "initialize", rb_goo_canvas_group_new, 1);
41
+ }