Added framebuffer support.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sat, 26 Jun 2004 16:43:41 +0000 (16:43 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sat, 26 Jun 2004 16:43:41 +0000 (16:43 +0000)
src/ecore_evas/Makefile.am
src/ecore_evas/rb_ecore_evas_main.c
src/ecore_evas/rb_fb.c [new file with mode: 0644]
src/ecore_evas/rb_fb.h [new file with mode: 0644]

index 70718a148757838d51beddf276c5ecb99e764912..f9687ae40ff04de07e5427c0b9928b04ade25f53 100644 (file)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am 10 2004-06-19 19:57:02Z tilman $
+## $Id: Makefile.am 22 2004-06-26 16:43:41Z tilman $
 
 AM_CFLAGS = $(ECORE_CFLAGS) $(EVAS_CFLAGS)
 INCLUDES = -I$(RUBYDIR) -I$(RUBYSITEDIR)
@@ -9,7 +9,8 @@ extdir = $(RUBYSITEDIR)
 ecore_evas_la_SOURCES = rb_ecore_evas_main.c rb_ecore_evas_main.h \
                         rb_ecore_evas.c rb_ecore_evas.h \
                         rb_software_x11.c rb_software_x11.h \
-                        rb_gl_x11.c rb_gl_x11.h
+                        rb_gl_x11.c rb_gl_x11.h \
+                        rb_fb.c rb_fb.h
 
 ecore_evas_la_LIBADD = -lruby $(ECORE_LIBS) $(EVAS_LIBS)
 ecore_evas_la_LDFLAGS = -module -avoid-version
index 3e00f81cb04effc5ac4142b4cbdf17f92472b781..d3487dfa55cfe41278e895926867aee11f335dff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_ecore_evas_main.c 16 2004-06-20 14:28:44Z tilman $
+ * $Id: rb_ecore_evas_main.c 22 2004-06-26 16:43:41Z tilman $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -27,6 +27,7 @@
 #include "rb_ecore_evas.h"
 #include "rb_software_x11.h"
 #include "rb_gl_x11.h"
+#include "rb_fb.h"
 
 static VALUE m_init (VALUE self)
 {
@@ -51,6 +52,6 @@ void Init_ecore_evas (void)
        Init_EcoreEvas ();
        Init_SoftwareX11 ();
        Init_GlX11 ();
-       /*Init_FrameBuffer ();*/
+       Init_Fb ();
 }
 
diff --git a/src/ecore_evas/rb_fb.c b/src/ecore_evas/rb_fb.c
new file mode 100644 (file)
index 0000000..86b12c2
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <ruby.h>
+
+#include <Ecore_Evas.h>
+
+#include "rb_ecore_evas_main.h"
+#include "rb_ecore_evas.h"
+
+VALUE cFb;
+
+static VALUE c_init (int argc, VALUE *argv, VALUE self)
+{
+       VALUE disp, rot, w, h;
+       Ecore_Evas **ee = NULL;
+       char *cdisp = NULL;
+       int irot = 0, iw = 0, ih = 0;
+
+       Data_Get_Struct (self, Ecore_Evas *, ee);
+
+       rb_scan_args (argc, argv, "04", &disp, &rot, &w, &h);
+
+       if (!NIL_P (disp)) {
+               Check_Type (disp, T_STRING);
+               cdisp = StringValuePtr (disp);
+       }
+
+       if (!NIL_P (rot)) {
+               Check_Type (rot, T_FIXNUM);
+               irot = NUM2INT (rot);
+       }
+
+       if (!NIL_P (w)) {
+               Check_Type (w, T_FIXNUM);
+               iw = NUM2INT (w);
+       }
+
+       if (!NIL_P (h)) {
+               Check_Type (h, T_FIXNUM);
+               ih = NUM2INT (h);
+       }
+
+       *ee = ecore_evas_fb_new (cdisp, irot, iw, ih);
+
+       return self;
+}
+
+static VALUE c_new (int argc, VALUE *argv, VALUE klass)
+{
+       VALUE self;
+       Ecore_Evas **ee;
+
+       self = Data_Make_Struct (klass, Ecore_Evas *,
+                                NULL, c_ecore_evas_free, ee);
+
+       rb_obj_call_init (self, argc, argv);
+
+       return self;
+}
+
+void Init_Fb (void)
+{
+       cFb = rb_define_class_under (mEvas, "Fb", cEcoreEvas);
+
+       rb_define_singleton_method (cFb, "new", c_new, -1);
+       rb_define_method (cFb, "initialize", c_init, -1);
+}
+
diff --git a/src/ecore_evas/rb_fb.h b/src/ecore_evas/rb_fb.h
new file mode 100644 (file)
index 0000000..ffdffbe
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __RB_FB_H
+#define __RB_FB_H
+
+void Init_Fb (void);
+
+#endif