goocanvas 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,45 +0,0 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
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., 51 Franklin Street, Fifth Floor, Boston,
19
- * MA 02110-1301 USA
20
- */
21
-
22
- #include "rbgoocanvasprivate.h"
23
-
24
- GooCanvasBounds *
25
- ruby_to_goo_canvas_bounds(VALUE rb_bounds, GooCanvasBounds *dest_bounds)
26
- {
27
- if (rb_bounds == Qnil)
28
- return NULL;
29
-
30
- if (TYPE(rb_bounds) != T_ARRAY) {
31
- VALUE rb_array;
32
- rb_array = rb_funcall(rb_bounds, rb_intern("to_a"), 0);
33
- return ruby_to_goo_canvas_bounds(rb_array, dest_bounds);
34
- }
35
-
36
- if (RARRAY_LEN(rb_bounds) != 4)
37
- rb_raise(rb_eRuntimeError, "Bounds must be arrays of length 4");
38
-
39
- dest_bounds->x1 = NUM2DBL(RARRAY_PTR(rb_bounds)[0]);
40
- dest_bounds->y1 = NUM2DBL(RARRAY_PTR(rb_bounds)[1]);
41
- dest_bounds->x2 = NUM2DBL(RARRAY_PTR(rb_bounds)[2]);
42
- dest_bounds->y2 = NUM2DBL(RARRAY_PTR(rb_bounds)[3]);
43
-
44
- return dest_bounds;
45
- }