projects
/
ruby-ecore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use RDoc for README.
[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 8192169278ec4ff6e4f409276e7cb3a27b113828..236713ff155fd2df2b2948a3bfb601dfb29a314e 100644
(file)
--- a/
src/ecore_evas/rb_fb.c
+++ b/
src/ecore_evas/rb_fb.c
@@
-1,6
+1,4
@@
/*
/*
- * $Id: rb_fb.c 77 2004-08-19 17:39:29Z tilman $
- *
* Copyright (C) 2004 ruby-ecore team (see AUTHORS)
*
* This library is free software; you can redistribute it and/or
* Copyright (C) 2004 ruby-ecore team (see AUTHORS)
*
* This library is free software; you can redistribute it and/or
@@
-23,6
+21,7
@@
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
+#include "../ecore/rb_ecore.h"
#include "rb_ecore_evas_main.h"
#include "rb_ecore_evas.h"
#include "rb_ecore_evas_main.h"
#include "rb_ecore_evas.h"
@@
-31,21
+30,30
@@
static void c_free (RbEcoreEvas *ee)
c_ecore_evas_free (ee, true);
}
c_ecore_evas_free (ee, true);
}
+static VALUE c_alloc (VALUE klass)
+{
+ RbEcoreEvas *ee = NULL;
+
+ ecore_init ();
+ ecore_evas_init ();
+
+ return Data_Make_Struct (klass, RbEcoreEvas,
+ c_ecore_evas_mark, c_free, ee);
+}
+
/*
* call-seq:
* Ecore::Evas::Fb.new([display, rotation, w, h]) => fb
*
* Creates an Ecore::Evas::Fb object.
*/
/*
* call-seq:
* Ecore::Evas::Fb.new([display, rotation, w, h]) => fb
*
* Creates an Ecore::Evas::Fb object.
*/
-static VALUE c_
new (int argc, VALUE *argv, VALUE klass
)
+static VALUE c_
init (int argc, VALUE *argv, VALUE self
)
{
{
- VALUE self, disp, rot, w, h;
- RbEcoreEvas *ee = NULL;
+ VALUE disp, rot, w, h;
char *cdisp = NULL;
int irot = 0, iw = 0, ih = 0;
char *cdisp = NULL;
int irot = 0, iw = 0, ih = 0;
- self = Data_Make_Struct (klass, RbEcoreEvas,
- c_ecore_evas_mark, c_free, ee);
+ GET_OBJ (self, RbEcoreEvas, ee);
rb_scan_args (argc, argv, "04", &disp, &rot, &w, &h);
rb_scan_args (argc, argv, "04", &disp, &rot, &w, &h);
@@
-69,12
+77,9
@@
static VALUE c_new (int argc, VALUE *argv, VALUE klass)
ih = FIX2INT (h);
}
ih = FIX2INT (h);
}
- ecore_init ();
- ecore_evas_init ();
-
ee->real = ecore_evas_fb_new (cdisp, irot, iw, ih);
ee->real = ecore_evas_fb_new (cdisp, irot, iw, ih);
- rb_
obj_call_init (self, 0, NULL
);
+ rb_
call_super (argc, argv
);
return self;
}
return self;
}
@@
-83,5
+88,6
@@
void Init_Fb (void)
{
VALUE c = rb_define_class_under (mEvas, "Fb", cEcoreEvas);
{
VALUE c = rb_define_class_under (mEvas, "Fb", cEcoreEvas);
- rb_define_singleton_method (c, "new", c_new, -1);
+ rb_define_alloc_func (c, c_alloc);
+ rb_define_method (c, "initialize", c_init, -1);
}
}