goocanvas 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #ifndef __RBGOOCANVASCONVERSIONS_H__
22
+ #define __RBGOOCANVASCONVERSIONS_H__
23
+
24
+ #define RVAL2GOOCANVAS(o) (GOO_CANVAS(RVAL2GOBJ(o)))
25
+ #define RVAL2GOOCANVASITEM(o) (GOO_CANVAS_ITEM(RVAL2GOBJ(o)))
26
+ #define RVAL2GOOCANVASSTYLE(o) (GOO_CANVAS_STYLE(RVAL2GOBJ(o)))
27
+
28
+ #define RVAL2GOOCANVASPOINTS(o) ((GooCanvasPoints*)RVAL2BOXED(o, GOO_TYPE_CANVAS_POINTS))
29
+ #define GOOCANVASPOINTS2RVAL(o) (BOXED2RVAL(o, GOO_TYPE_CANVAS_POINTS))
30
+
31
+ #endif /* __RBGOOCANVASCONVERSIONS_H__ */
@@ -1,32 +1,35 @@
1
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>
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2007 Vincent Isambart <vincent.isambart@gmail.com>
5
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.
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
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.
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
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
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., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
19
20
  */
20
21
 
21
- #include "rbgoocanvas.h"
22
+ #include "rbgoocanvasprivate.h"
23
+
24
+ #define RG_TARGET_NAMESPACE cCanvasEllipse
22
25
 
23
26
  static VALUE
24
- rb_goo_canvas_ellipse_new(VALUE self, VALUE parent,
27
+ rg_initialize(VALUE self, VALUE parent,
25
28
  VALUE center_x, VALUE center_y,
26
29
  VALUE radius_x, VALUE radius_y)
27
30
  {
28
31
  GooCanvasItem *item;
29
- item = goo_canvas_ellipse_new(RVAL2GCI(parent),
32
+ item = goo_canvas_ellipse_new(RVAL2GOOCANVASITEM(parent),
30
33
  NUM2DBL(center_x),
31
34
  NUM2DBL(center_y),
32
35
  NUM2DBL(radius_x),
@@ -38,13 +41,12 @@ rb_goo_canvas_ellipse_new(VALUE self, VALUE parent,
38
41
  }
39
42
 
40
43
  void
41
- Init_goocanvasellipse(void)
44
+ Init_goocanvasellipse(VALUE mGoo)
42
45
  {
43
- VALUE GooCanvasEllipse;
46
+ VALUE RG_TARGET_NAMESPACE;
44
47
 
45
- GooCanvasEllipse = G_DEF_CLASS(GOO_TYPE_CANVAS_ELLIPSE, "CanvasEllipse",
48
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(GOO_TYPE_CANVAS_ELLIPSE, "CanvasEllipse",
46
49
  mGoo);
47
50
 
48
- rb_define_method(GooCanvasEllipse, "initialize",
49
- rb_goo_canvas_ellipse_new, 5);
51
+ RG_DEF_METHOD(initialize, 5);
50
52
  }
@@ -1,41 +1,44 @@
1
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>
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2007 Vincent Isambart <vincent.isambart@gmail.com>
5
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.
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
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.
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
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
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., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
19
20
  */
20
21
 
21
- #include "rbgoocanvas.h"
22
+ #include "rbgoocanvasprivate.h"
23
+
24
+ #define RG_TARGET_NAMESPACE cCanvasGroup
22
25
 
23
26
  static VALUE
24
- rb_goo_canvas_group_new(VALUE self, VALUE parent)
27
+ rg_initialize(VALUE self, VALUE parent)
25
28
  {
26
29
  GooCanvasItem *item;
27
- item = goo_canvas_group_new(RVAL2GCI(parent), NULL);
30
+ item = goo_canvas_group_new(RVAL2GOOCANVASITEM(parent), NULL);
28
31
  RB_GOO_CANVAS_ITEM_INITIALIZE(self, item);
29
32
  G_CHILD_ADD(parent, self);
30
33
  return Qnil;
31
34
  }
32
35
 
33
36
  void
34
- Init_goocanvasgroup(void)
37
+ Init_goocanvasgroup(VALUE mGoo)
35
38
  {
36
- VALUE GooCanvasGroup;
39
+ VALUE RG_TARGET_NAMESPACE;
37
40
 
38
- GooCanvasGroup = G_DEF_CLASS(GOO_TYPE_CANVAS_GROUP, "CanvasGroup", mGoo);
41
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(GOO_TYPE_CANVAS_GROUP, "CanvasGroup", mGoo);
39
42
 
40
- rb_define_method(GooCanvasGroup, "initialize", rb_goo_canvas_group_new, 1);
43
+ RG_DEF_METHOD(initialize, 1);
41
44
  }
@@ -1,32 +1,35 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /* $Id: rbgoocanvasimage.c 3288 2008-09-13 10:07:44Z ktou $ */
3
- /* GooCanvasImage
4
- * Copyright (C) 2007 Vincent Isambart <vincent.isambart@gmail.com>
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2007 Vincent Isambart <vincent.isambart@gmail.com>
5
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.
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
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.
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
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
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., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
19
20
  */
20
21
 
21
- #include "rbgoocanvas.h"
22
+ #include "rbgoocanvasprivate.h"
23
+
24
+ #define RG_TARGET_NAMESPACE cCanvasImage
22
25
 
23
26
  static VALUE
24
- rb_goo_canvas_image_new(VALUE self, VALUE parent, VALUE pixbuf,
27
+ rg_initialize(VALUE self, VALUE parent, VALUE pixbuf,
25
28
  VALUE x, VALUE y)
26
29
  {
27
30
  GooCanvasItem *item;
28
- item = goo_canvas_image_new(RVAL2GCI(parent),
29
- RVAL2GDK_PIXBUF(pixbuf),
31
+ item = goo_canvas_image_new(RVAL2GOOCANVASITEM(parent),
32
+ RVAL2GDKPIXBUF(pixbuf),
30
33
  NUM2DBL(x),
31
34
  NUM2DBL(y),
32
35
  NULL);
@@ -36,10 +39,10 @@ rb_goo_canvas_image_new(VALUE self, VALUE parent, VALUE pixbuf,
36
39
  }
37
40
 
38
41
  void
39
- Init_goocanvasimage(void)
42
+ Init_goocanvasimage(VALUE mGoo)
40
43
  {
41
- VALUE GooCanvasImage;
44
+ VALUE RG_TARGET_NAMESPACE;
42
45
 
43
- GooCanvasImage = G_DEF_CLASS(GOO_TYPE_CANVAS_IMAGE, "CanvasImage", mGoo);
44
- rb_define_method(GooCanvasImage, "initialize", rb_goo_canvas_image_new, 4);
46
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(GOO_TYPE_CANVAS_IMAGE, "CanvasImage", mGoo);
47
+ RG_DEF_METHOD(initialize, 4);
45
48
  }
@@ -1,29 +1,31 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /* $Id: rbgoocanvasitem.c 3288 2008-09-13 10:07:44Z ktou $ */
3
- /* GooCanvasItem
4
- * Copyright (C) 2007 Vincent Isambart <vincent.isambart@gmail.com>
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2007 Vincent Isambart <vincent.isambart@gmail.com>
5
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.
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
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.
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
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
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., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
19
20
  */
20
21
 
21
- #include "rbgoocanvas.h"
22
+ #include "rbgoocanvasprivate.h"
22
23
 
23
- #define SELF(self) RVAL2GCI(self)
24
+ #define RG_TARGET_NAMESPACE cCanvasItem
25
+ #define SELF(self) RVAL2GOOCANVASITEM(self)
24
26
 
25
27
  static VALUE
26
- rb_goo_canvas_item_rotate(VALUE self, VALUE degrees, VALUE cx, VALUE cy)
28
+ rg_rotate(VALUE self, VALUE degrees, VALUE cx, VALUE cy)
27
29
  {
28
30
  goo_canvas_item_rotate(SELF(self), NUM2DBL(degrees),
29
31
  NUM2DBL(cx), NUM2DBL(cy));
@@ -31,35 +33,35 @@ rb_goo_canvas_item_rotate(VALUE self, VALUE degrees, VALUE cx, VALUE cy)
31
33
  }
32
34
 
33
35
  static VALUE
34
- rb_goo_canvas_item_translate(VALUE self, VALUE tx, VALUE ty)
36
+ rg_translate(VALUE self, VALUE tx, VALUE ty)
35
37
  {
36
38
  goo_canvas_item_translate(SELF(self), NUM2DBL(tx), NUM2DBL(ty));
37
39
  return self;
38
40
  }
39
41
 
40
42
  static VALUE
41
- rb_goo_canvas_item_lower(VALUE self, VALUE below)
43
+ rg_lower(VALUE self, VALUE below)
42
44
  {
43
45
  goo_canvas_item_lower(SELF(self), SELF(below));
44
46
  return self;
45
47
  }
46
48
 
47
49
  static VALUE
48
- rb_goo_canvas_item_raise(VALUE self, VALUE above)
50
+ rg_raise(VALUE self, VALUE above)
49
51
  {
50
52
  goo_canvas_item_raise(SELF(self), SELF(above));
51
53
  return self;
52
54
  }
53
55
 
54
56
  static VALUE
55
- rb_goo_canvas_item_scale(VALUE self, VALUE sx, VALUE sy)
57
+ rg_scale(VALUE self, VALUE sx, VALUE sy)
56
58
  {
57
59
  goo_canvas_item_scale(SELF(self), NUM2DBL(sx), NUM2DBL(sy));
58
60
  return self;
59
61
  }
60
62
 
61
63
  static VALUE
62
- rb_goo_canvas_bounds_x1(VALUE self)
64
+ rg_x1(VALUE self)
63
65
  {
64
66
  GooCanvasBounds bounds;
65
67
  goo_canvas_item_get_bounds(SELF(self), &bounds);
@@ -67,7 +69,7 @@ rb_goo_canvas_bounds_x1(VALUE self)
67
69
  }
68
70
 
69
71
  static VALUE
70
- rb_goo_canvas_bounds_x2(VALUE self)
72
+ rg_x2(VALUE self)
71
73
  {
72
74
  GooCanvasBounds bounds;
73
75
  goo_canvas_item_get_bounds(SELF(self), &bounds);
@@ -75,7 +77,7 @@ rb_goo_canvas_bounds_x2(VALUE self)
75
77
  }
76
78
 
77
79
  static VALUE
78
- rb_goo_canvas_bounds_y1(VALUE self)
80
+ rg_y1(VALUE self)
79
81
  {
80
82
  GooCanvasBounds bounds;
81
83
  goo_canvas_item_get_bounds(SELF(self), &bounds);
@@ -83,7 +85,7 @@ rb_goo_canvas_bounds_y1(VALUE self)
83
85
  }
84
86
 
85
87
  static VALUE
86
- rb_goo_canvas_bounds_y2(VALUE self)
88
+ rg_y2(VALUE self)
87
89
  {
88
90
  GooCanvasBounds bounds;
89
91
  goo_canvas_item_get_bounds(SELF(self), &bounds);
@@ -91,7 +93,7 @@ rb_goo_canvas_bounds_y2(VALUE self)
91
93
  }
92
94
 
93
95
  static VALUE
94
- rb_goo_canvas_item_skew_x(VALUE self, VALUE degrees, VALUE cx, VALUE cy)
96
+ rg_skew_x(VALUE self, VALUE degrees, VALUE cx, VALUE cy)
95
97
  {
96
98
  goo_canvas_item_skew_x(SELF(self), NUM2DBL(degrees),
97
99
  NUM2DBL(cx), NUM2DBL(cy));
@@ -99,7 +101,7 @@ rb_goo_canvas_item_skew_x(VALUE self, VALUE degrees, VALUE cx, VALUE cy)
99
101
  }
100
102
 
101
103
  static VALUE
102
- rb_goo_canvas_item_skew_y(VALUE self, VALUE degrees, VALUE cx, VALUE cy)
104
+ rg_skew_y(VALUE self, VALUE degrees, VALUE cx, VALUE cy)
103
105
  {
104
106
  goo_canvas_item_skew_y(SELF(self), NUM2DBL(degrees),
105
107
  NUM2DBL(cx), NUM2DBL(cy));
@@ -107,7 +109,7 @@ rb_goo_canvas_item_skew_y(VALUE self, VALUE degrees, VALUE cx, VALUE cy)
107
109
  }
108
110
 
109
111
  static VALUE
110
- rb_goo_canvas_item_set_simple_transform(VALUE self, VALUE x, VALUE y,
112
+ rg_set_simple_transform(VALUE self, VALUE x, VALUE y,
111
113
  VALUE scale, VALUE rotation)
112
114
  {
113
115
  goo_canvas_item_set_simple_transform(SELF(self), NUM2DBL(x), NUM2DBL(y),
@@ -116,7 +118,7 @@ rb_goo_canvas_item_set_simple_transform(VALUE self, VALUE x, VALUE y,
116
118
  }
117
119
 
118
120
  static VALUE
119
- rb_goo_canvas_item_animate(VALUE self, VALUE x, VALUE y, VALUE scale,
121
+ rg_animate(VALUE self, VALUE x, VALUE y, VALUE scale,
120
122
  VALUE degrees, VALUE absolute, VALUE duration,
121
123
  VALUE step_time, VALUE type)
122
124
  {
@@ -133,21 +135,21 @@ rb_goo_canvas_item_animate(VALUE self, VALUE x, VALUE y, VALUE scale,
133
135
  }
134
136
 
135
137
  static VALUE
136
- rb_goo_canvas_item_stop_animation(VALUE self)
138
+ rg_stop_animation(VALUE self)
137
139
  {
138
140
  goo_canvas_item_stop_animation(SELF(self));
139
141
  return self;
140
142
  }
141
143
 
142
144
  static VALUE
143
- rb_goo_canvas_item_set_style(VALUE self, VALUE style)
145
+ rg_set_style(VALUE self, VALUE style)
144
146
  {
145
- goo_canvas_item_set_style(SELF(self), RVAL2GCS(style));
147
+ goo_canvas_item_set_style(SELF(self), RVAL2GOOCANVASSTYLE(style));
146
148
  return self;
147
149
  }
148
150
 
149
151
  static VALUE
150
- rb_goo_canvas_item_set_child_property(VALUE self, VALUE child,
152
+ rg_set_child_property(VALUE self, VALUE child,
151
153
  VALUE prop_name, VALUE val)
152
154
  {
153
155
  GParamSpec* pspec;
@@ -204,13 +206,13 @@ rb_goo_canvas_item_set_child_property(VALUE self, VALUE child,
204
206
  }
205
207
 
206
208
  static VALUE
207
- rb_goo_canvas_item_get_canvas(VALUE self, VALUE tx, VALUE ty)
209
+ rg_canvas(VALUE self, VALUE tx, VALUE ty)
208
210
  {
209
211
  return GOBJ2RVAL(goo_canvas_item_get_canvas(SELF(self)));
210
212
  }
211
213
 
212
214
  static VALUE
213
- rb_goo_canvas_item_remove_child(VALUE self, VALUE child)
215
+ rg_remove_child(VALUE self, VALUE child)
214
216
  {
215
217
  gint child_num;
216
218
 
@@ -222,137 +224,44 @@ rb_goo_canvas_item_remove_child(VALUE self, VALUE child)
222
224
  }
223
225
 
224
226
  void
225
- Init_goocanvasitem(void)
227
+ Init_goocanvasitem(VALUE mGoo)
226
228
  {
227
- VALUE GooCanvasItem;
229
+ VALUE RG_TARGET_NAMESPACE;
228
230
 
229
- GooCanvasItem = G_DEF_CLASS(GOO_TYPE_CANVAS_ITEM, "CanvasItem", mGoo);
231
+ RG_TARGET_NAMESPACE = G_DEF_CLASS(GOO_TYPE_CANVAS_ITEM, "CanvasItem", mGoo);
230
232
 
231
- rb_define_method(GooCanvasItem, "rotate", rb_goo_canvas_item_rotate, 3);
232
- rb_define_method(GooCanvasItem, "translate", rb_goo_canvas_item_translate, 2);
233
- rb_define_method(GooCanvasItem, "lower", rb_goo_canvas_item_lower, 1);
234
- rb_define_method(GooCanvasItem, "raise", rb_goo_canvas_item_raise, 1);
235
- rb_define_method(GooCanvasItem, "scale", rb_goo_canvas_item_scale, 2);
236
- rb_define_method(GooCanvasItem, "skew_x", rb_goo_canvas_item_skew_x, 3);
237
- rb_define_method(GooCanvasItem, "skew_y", rb_goo_canvas_item_skew_y, 3);
238
- rb_define_method(GooCanvasItem, "set_simple_transform", rb_goo_canvas_item_set_simple_transform, 4);
239
- rb_define_method(GooCanvasItem, "animate", rb_goo_canvas_item_animate, 8);
240
- rb_define_method(GooCanvasItem, "stop_animation", rb_goo_canvas_item_stop_animation, 0);
233
+ RG_DEF_METHOD(rotate, 3);
234
+ RG_DEF_METHOD(translate, 2);
235
+ RG_DEF_METHOD(lower, 1);
236
+ RG_DEF_METHOD(raise, 1);
237
+ RG_DEF_METHOD(scale, 2);
238
+ RG_DEF_METHOD(skew_x, 3);
239
+ RG_DEF_METHOD(skew_y, 3);
240
+ RG_DEF_METHOD(set_simple_transform, 4);
241
+ RG_DEF_METHOD(animate, 8);
242
+ RG_DEF_METHOD(stop_animation, 0);
241
243
 
242
- rb_define_method(GooCanvasItem, "set_style", rb_goo_canvas_item_set_style, 1);
244
+ RG_DEF_METHOD(set_style, 1);
243
245
 
244
- rb_define_method(GooCanvasItem, "set_child_property", rb_goo_canvas_item_set_child_property, 3);
246
+ RG_DEF_METHOD(set_child_property, 3);
245
247
 
246
- rb_define_method(GooCanvasItem, "canvas", rb_goo_canvas_item_get_canvas, 0);
248
+ RG_DEF_METHOD(canvas, 0);
247
249
 
248
- rb_define_method(GooCanvasItem, "remove_child", rb_goo_canvas_item_remove_child, 1);
250
+ RG_DEF_METHOD(remove_child, 1);
249
251
 
250
- rb_define_method(GooCanvasItem, "x1", rb_goo_canvas_bounds_x1, 0);
251
- rb_define_method(GooCanvasItem, "x2", rb_goo_canvas_bounds_x2, 0);
252
- rb_define_method(GooCanvasItem, "y1", rb_goo_canvas_bounds_y1, 0);
253
- rb_define_method(GooCanvasItem, "y2", rb_goo_canvas_bounds_y2, 0);
252
+ RG_DEF_METHOD(x1, 0);
253
+ RG_DEF_METHOD(x2, 0);
254
+ RG_DEF_METHOD(y1, 0);
255
+ RG_DEF_METHOD(y2, 0);
254
256
 
255
257
  /* Enums */
256
- G_DEF_CLASS(GOO_TYPE_CANVAS_ITEM_VISIBILITY, "Visibility", GooCanvasItem);
257
- G_DEF_CONSTANTS(GooCanvasItem, GOO_TYPE_CANVAS_ITEM_VISIBILITY, "GOO_CANVAS_ITEM_");
258
- G_DEF_CLASS(GOO_TYPE_CANVAS_ANIMATE_TYPE, "AnimateType", GooCanvasItem);
259
- G_DEF_CONSTANTS(GooCanvasItem, GOO_TYPE_CANVAS_ANIMATE_TYPE, "GOO_CANVAS_");
260
-
261
-
262
- G_DEF_CLASS(GOO_TYPE_CANVAS_POINTER_EVENTS, "PointerEvents",GooCanvasItem);
263
- G_DEF_CONSTANTS(GooCanvasItem, GOO_TYPE_CANVAS_POINTER_EVENTS,"GOO_CANVAS_");
264
-
265
- #if 0
266
- gint goo_canvas_item_get_n_children (GooCanvasItem *item);
267
- GooCanvasItem* goo_canvas_item_get_child (GooCanvasItem *item,
268
- gint child_num);
269
- gint goo_canvas_item_find_child (GooCanvasItem *item,
270
- GooCanvasItem *child);
271
- void goo_canvas_item_add_child (GooCanvasItem *item,
272
- GooCanvasItem *child,
273
- gint position);
274
- void goo_canvas_item_move_child (GooCanvasItem *item,
275
- gint old_position,
276
- gint new_position);
277
- void goo_canvas_item_remove_child (GooCanvasItem *item,
278
- gint child_num);
279
-
280
- void goo_canvas_item_get_child_properties (GooCanvasItem *item,
281
- GooCanvasItem *child,
282
- ...) G_GNUC_NULL_TERMINATED;
283
- void goo_canvas_item_set_child_properties (GooCanvasItem *item,
284
- GooCanvasItem *child,
285
- ...) G_GNUC_NULL_TERMINATED;
286
- void goo_canvas_item_get_child_properties_valist (GooCanvasItem *item,
287
- GooCanvasItem *child,
288
- va_list var_args);
289
- void goo_canvas_item_set_child_properties_valist (GooCanvasItem *item,
290
- GooCanvasItem *child,
291
- va_list var_args);
292
-
293
- gboolean goo_canvas_item_get_transform_for_child (GooCanvasItem *item,
294
- GooCanvasItem *child,
295
- cairo_matrix_t *transform);
296
-
297
-
298
- /*
299
- * Item functions - these are safe to call on all items.
300
- */
301
- GooCanvas* goo_canvas_item_get_canvas (GooCanvasItem *item);
302
- void goo_canvas_item_set_canvas (GooCanvasItem *item,
303
- GooCanvas *canvas);
304
- GooCanvasItem* goo_canvas_item_get_parent (GooCanvasItem *item);
305
- void goo_canvas_item_set_parent (GooCanvasItem *item,
306
- GooCanvasItem *parent);
307
- gboolean goo_canvas_item_is_container (GooCanvasItem *item);
308
-
309
- cairo_matrix_t* goo_canvas_item_get_transform (GooCanvasItem *item);
310
- void goo_canvas_item_set_transform (GooCanvasItem *item,
311
- cairo_matrix_t *matrix);
312
- void goo_canvas_item_set_simple_transform (GooCanvasItem *item,
313
- gdouble x,
314
- gdouble y,
315
- gdouble scale,
316
- gdouble rotation);
317
-
318
- GooCanvasStyle* goo_canvas_item_get_style (GooCanvasItem *item);
319
-
320
-
321
- void goo_canvas_item_get_bounds (GooCanvasItem *item,
322
- GooCanvasBounds *bounds);
323
- GooCanvasItem* goo_canvas_item_get_item_at (GooCanvasItem *item,
324
- gdouble x,
325
- gdouble y,
326
- cairo_t *cr,
327
- gboolean is_pointer_event,
328
- gboolean parent_is_visible);
329
- gboolean goo_canvas_item_is_visible (GooCanvasItem *item);
330
-
331
- GooCanvasItemModel* goo_canvas_item_get_model (GooCanvasItem *item);
332
- void goo_canvas_item_set_model (GooCanvasItem *item,
333
- GooCanvasItemModel *model);
334
-
335
- void goo_canvas_item_request_update (GooCanvasItem *item);
336
- void goo_canvas_item_ensure_updated (GooCanvasItem *item);
337
- void goo_canvas_item_update (GooCanvasItem *item,
338
- gboolean entire_tree,
339
- cairo_t *cr,
340
- GooCanvasBounds *bounds);
341
- void goo_canvas_item_paint (GooCanvasItem *item,
342
- cairo_t *cr,
343
- GooCanvasBounds *bounds,
344
- gdouble scale);
345
-
346
- gboolean goo_canvas_item_get_requested_area (GooCanvasItem *item,
347
- cairo_t *cr,
348
- GooCanvasBounds *requested_area);
349
- void goo_canvas_item_allocate_area (GooCanvasItem *item,
350
- cairo_t *cr,
351
- GooCanvasBounds *requested_area,
352
- GooCanvasBounds *allocated_area,
353
- gdouble x_offset,
354
- gdouble y_offset);
355
- #endif
356
-
357
- G_DEF_SETTERS(GooCanvasItem);
258
+ G_DEF_CLASS(GOO_TYPE_CANVAS_ITEM_VISIBILITY, "Visibility", RG_TARGET_NAMESPACE);
259
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GOO_TYPE_CANVAS_ITEM_VISIBILITY, "GOO_CANVAS_ITEM_");
260
+ G_DEF_CLASS(GOO_TYPE_CANVAS_ANIMATE_TYPE, "AnimateType", RG_TARGET_NAMESPACE);
261
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GOO_TYPE_CANVAS_ANIMATE_TYPE, "GOO_CANVAS_");
262
+
263
+ G_DEF_CLASS(GOO_TYPE_CANVAS_POINTER_EVENTS, "PointerEvents",RG_TARGET_NAMESPACE);
264
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GOO_TYPE_CANVAS_POINTER_EVENTS,"GOO_CANVAS_");
265
+
266
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
358
267
  }