2 * $Id: rb_fb.c 351 2006-02-10 15:25:40Z tilman $
4 * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
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.
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.
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
24 #include <Ecore_Evas.h>
26 #include "../ecore/rb_ecore.h"
27 #include "rb_ecore_evas_main.h"
28 #include "rb_ecore_evas.h"
30 static void c_free (RbEcoreEvas *ee)
32 c_ecore_evas_free (ee, true);
35 static VALUE c_alloc (VALUE klass)
37 RbEcoreEvas *ee = NULL;
42 return Data_Make_Struct (klass, RbEcoreEvas,
43 c_ecore_evas_mark, c_free, ee);
48 * Ecore::Evas::Fb.new([display, rotation, w, h]) => fb
50 * Creates an Ecore::Evas::Fb object.
52 static VALUE c_init (int argc, VALUE *argv, VALUE self)
54 VALUE disp, rot, w, h;
56 int irot = 0, iw = 0, ih = 0;
58 GET_OBJ (self, RbEcoreEvas, ee);
60 rb_scan_args (argc, argv, "04", &disp, &rot, &w, &h);
63 Check_Type (disp, T_STRING);
64 cdisp = StringValuePtr (disp);
68 Check_Type (rot, T_FIXNUM);
73 Check_Type (w, T_FIXNUM);
78 Check_Type (h, T_FIXNUM);
82 ee->real = ecore_evas_fb_new (cdisp, irot, iw, ih);
84 rb_call_super (argc, argv);
91 VALUE c = rb_define_class_under (mEvas, "Fb", cEcoreEvas);
93 rb_define_alloc_func (c, c_alloc);
94 rb_define_method (c, "initialize", c_init, -1);