2 * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <Ecore_Evas.h>
24 #include "../ecore/rb_ecore.h"
25 #include "rb_ecore_evas_main.h"
26 #include "rb_ecore_evas.h"
28 static void c_free (RbEcoreEvas *ee)
30 c_ecore_evas_free (ee, true);
33 static VALUE c_alloc (VALUE klass)
35 RbEcoreEvas *ee = NULL;
40 return Data_Make_Struct (klass, RbEcoreEvas,
41 c_ecore_evas_mark, c_free, ee);
46 * Ecore::Evas::Fb.new([display, rotation, w, h]) => fb
48 * Creates an Ecore::Evas::Fb object.
50 static VALUE c_init (int argc, VALUE *argv, VALUE self)
52 VALUE disp, rot, w, h;
54 int irot = 0, iw = 0, ih = 0;
56 GET_OBJ (self, RbEcoreEvas, ee);
58 rb_scan_args (argc, argv, "04", &disp, &rot, &w, &h);
61 Check_Type (disp, T_STRING);
62 cdisp = StringValuePtr (disp);
66 Check_Type (rot, T_FIXNUM);
71 Check_Type (w, T_FIXNUM);
76 Check_Type (h, T_FIXNUM);
80 ee->real = ecore_evas_fb_new (cdisp, irot, iw, ih);
82 rb_call_super (argc, argv);
89 VALUE c = rb_define_class_under (mEvas, "Fb", cEcoreEvas);
91 rb_define_alloc_func (c, c_alloc);
92 rb_define_method (c, "initialize", c_init, -1);