projects
/
ruby-ecore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Raise errors in EventHandler#initialize rather than returning nil.
[ruby-ecore.git]
/
src
/
ecore_evas
/
rb_buffer.c
diff --git
a/src/ecore_evas/rb_buffer.c
b/src/ecore_evas/rb_buffer.c
index db316cc1737881cf16938c5109bab40899aacfeb..9526f963cf182bc255af0a8e3eacc9209b40535a 100644
(file)
--- a/
src/ecore_evas/rb_buffer.c
+++ b/
src/ecore_evas/rb_buffer.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: rb_buffer.c
174 2005-01-19 21:31:04
Z tilman $
+ * $Id: rb_buffer.c
351 2006-02-10 15:25:40
Z tilman $
*
* Copyright (C) 2004-2005 ruby-ecore team (see AUTHORS)
*
*
* Copyright (C) 2004-2005 ruby-ecore team (see AUTHORS)
*
@@
-32,20
+32,29
@@
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::Buffer.new([w, h]) => buffer
*
* Creates an Ecore::Evas::Buffer object.
*/
/*
* call-seq:
* Ecore::Evas::Buffer.new([w, h]) => buffer
*
* Creates an Ecore::Evas::Buffer object.
*/
-static VALUE c_
new (int argc, VALUE *argv, VALUE klass
)
+static VALUE c_
init (int argc, VALUE *argv, VALUE self
)
{
{
- VALUE self, w, h;
- RbEcoreEvas *ee = NULL;
+ VALUE w, h;
int iw = 0, ih = 0;
int 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, "02", &w, &h);
rb_scan_args (argc, argv, "02", &w, &h);
@@
-59,12
+68,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_buffer_new (iw, ih);
ee->real = ecore_evas_buffer_new (iw, ih);
- rb_
obj_call_init (self, 0, NULL
);
+ rb_
call_super (argc, argv
);
return self;
}
return self;
}
@@
-89,6
+95,7
@@
void Init_Buffer (void)
{
VALUE c = rb_define_class_under (mEvas, "Buffer", cEcoreEvas);
{
VALUE c = rb_define_class_under (mEvas, "Buffer", 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);
rb_define_method (c, "pixels", c_pixels_get, 0);
}
rb_define_method (c, "pixels", c_pixels_get, 0);
}