projects
/
ruby-ecore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
We now use real structs to wrap objects.
[ruby-ecore.git]
/
src
/
ecore_evas
/
rb_fb.c
diff --git
a/src/ecore_evas/rb_fb.c
b/src/ecore_evas/rb_fb.c
index 00635defd22d1f6071db46ddd317e814db4a0884..42412ee25740371595059069315794036f9911e4 100644
(file)
--- a/
src/ecore_evas/rb_fb.c
+++ b/
src/ecore_evas/rb_fb.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: rb_fb.c
25 2004-06-26 23:07:01
Z tilman $
+ * $Id: rb_fb.c
50 2004-08-01 10:18:39
Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
@@
-20,19
+20,26
@@
#include <ruby.h>
#include <ruby.h>
+#include <Ecore.h>
#include <Ecore_Evas.h>
#include "rb_ecore_evas_main.h"
#include "rb_ecore_evas.h"
#include <Ecore_Evas.h>
#include "rb_ecore_evas_main.h"
#include "rb_ecore_evas.h"
-static
VALUE c_init (int argc, VALUE *argv, VALUE self
)
+static
void c_free (RbEcoreEvas *ee
)
{
{
- VALUE disp, rot, w, h;
- Ecore_Evas **ee = NULL;
+ c_ecore_evas_free (ee, true);
+}
+
+static VALUE c_new (int argc, VALUE *argv, VALUE klass)
+{
+ VALUE self, disp, rot, w, h;
+ RbEcoreEvas *ee = NULL;
char *cdisp = NULL;
int irot = 0, iw = 0, ih = 0;
char *cdisp = NULL;
int irot = 0, iw = 0, ih = 0;
- Data_Get_Struct (self, Ecore_Evas *, ee);
+ self = Data_Make_Struct (klass, RbEcoreEvas,
+ c_ecore_evas_mark, c_free, ee);
rb_scan_args (argc, argv, "04", &disp, &rot, &w, &h);
rb_scan_args (argc, argv, "04", &disp, &rot, &w, &h);
@@
-43,42
+50,32
@@
static VALUE c_init (int argc, VALUE *argv, VALUE self)
if (!NIL_P (rot)) {
Check_Type (rot, T_FIXNUM);
if (!NIL_P (rot)) {
Check_Type (rot, T_FIXNUM);
- irot =
NUM
2INT (rot);
+ irot =
FIX
2INT (rot);
}
if (!NIL_P (w)) {
Check_Type (w, T_FIXNUM);
}
if (!NIL_P (w)) {
Check_Type (w, T_FIXNUM);
- iw =
NUM
2INT (w);
+ iw =
FIX
2INT (w);
}
if (!NIL_P (h)) {
Check_Type (h, T_FIXNUM);
}
if (!NIL_P (h)) {
Check_Type (h, T_FIXNUM);
- ih =
NUM
2INT (h);
+ ih =
FIX
2INT (h);
}
}
- *ee = ecore_evas_fb_new (cdisp, irot, iw, ih);
+ ecore_init ();
+ ecore_evas_init ();
- return self;
-}
+ ee->real = ecore_evas_fb_new (cdisp, irot, iw, ih);
-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);
+ rb_obj_call_init (self, 0, NULL);
return self;
}
void Init_Fb (void)
{
return self;
}
void Init_Fb (void)
{
- VALUE c
Fb
= rb_define_class_under (mEvas, "Fb", cEcoreEvas);
+ VALUE c = rb_define_class_under (mEvas, "Fb", cEcoreEvas);
- rb_define_singleton_method (cFb, "new", c_new, -1);
- rb_define_method (cFb, "initialize", c_init, -1);
+ rb_define_singleton_method (c, "new", c_new, -1);
}
}
-