2 * $Id: rb_gl_x11.c 25 2004-06-26 23:07:01Z tilman $
4 * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
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
23 #include <Ecore_Evas.h>
25 #include "rb_ecore_evas_main.h"
26 #include "rb_ecore_evas.h"
28 static VALUE c_init (int argc, VALUE *argv, VALUE self)
30 VALUE disp, parent, geom[4];
31 Ecore_Evas **ee = NULL;
33 int i, igeom[4] = {0, 0, 0, 0};
35 Data_Get_Struct (self, Ecore_Evas *, ee);
37 rb_scan_args (argc, argv, "06", &disp, &parent,
38 &geom[0], &geom[1], &geom[2], &geom[3]);
41 Check_Type (disp, T_STRING);
42 cdisp = StringValuePtr (disp);
45 for (i = 0; i < 4; i++)
46 if (!NIL_P (geom[i])) {
47 Check_Type (geom[i], T_FIXNUM);
48 igeom[i] = NUM2INT (geom[i]);
51 *ee = ecore_evas_gl_x11_new (cdisp, 0,
58 static VALUE c_new (int argc, VALUE *argv, VALUE klass)
63 self = Data_Make_Struct (klass, Ecore_Evas *,
64 NULL, c_ecore_evas_free, ee);
66 rb_obj_call_init (self, argc, argv);
71 void Init_GlX11 (void)
73 VALUE cGlX11 = rb_define_class_under (mEvas, "GlX11", cEcoreEvas);
75 rb_define_singleton_method (cGlX11, "new", c_new, -1);
76 rb_define_method (cGlX11, "initialize", c_init, -1);