Added ecore_x bindings.
[ruby-ecore.git] / src / ecore_x / rb_ecore_x.c
diff --git a/src/ecore_x/rb_ecore_x.c b/src/ecore_x/rb_ecore_x.c
new file mode 100644 (file)
index 0000000..c23492c
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * $Id: rb_ecore_x.c 39 2004-07-25 13:13:57Z tilman $
+ *
+ * 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_X.h>
+
+#include "../ecore/rb_ecore.h"
+#include "rb_ecore_x.h"
+#include "rb_window.h"
+
+#ifdef DEBUG
+static VALUE m_init (VALUE self)
+{
+       return INT2FIX (ecore_x_init ());
+}
+
+static VALUE m_shutdown (VALUE self)
+{
+       return INT2FIX (ecore_x_shutdown ());
+}
+#endif
+
+void Init_ecore_x (void)
+{
+       rb_require ("ecore");
+
+       mX = rb_define_module_under (mEcore, "X");
+
+#ifdef DEBUG
+       rb_define_module_function (mx, "init", m_init, 0);
+       rb_define_module_function (mx, "shutdown", m_shutdown, 0);
+#endif
+
+       Init_Window ();
+}
+