projects
/
ruby-ecore.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
98ce45a
)
Macro updates.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Sat, 10 Jul 2004 14:05:30 +0000
(14:05 +0000)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Sat, 10 Jul 2004 14:05:30 +0000
(14:05 +0000)
src/ecore_evas/rb_ecore_evas.c
patch
|
blob
|
history
diff --git
a/src/ecore_evas/rb_ecore_evas.c
b/src/ecore_evas/rb_ecore_evas.c
index b508339bf44cb1bf988ac743c9df18e5af197e95..7c78a267426b68de74a7acb0f45120703d923c6a 100644
(file)
--- a/
src/ecore_evas/rb_ecore_evas.c
+++ b/
src/ecore_evas/rb_ecore_evas.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: rb_ecore_evas.c
27 2004-07-08 18:25:05
Z tilman $
+ * $Id: rb_ecore_evas.c
30 2004-07-10 14:05:30
Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
@@
-27,13
+27,15
@@
#include "rb_ecore_evas_main.h"
#include "rb_ecore_evas.h"
#include "rb_ecore_evas_main.h"
#include "rb_ecore_evas.h"
-#define GET_OBJ(obj, type, o
, desc
) \
+#define GET_OBJ(obj, type, o) \
type **(o) = NULL; \
\
Data_Get_Struct ((obj), type *, (o)); \
\
if (!*(o)) { \
type **(o) = NULL; \
\
Data_Get_Struct ((obj), type *, (o)); \
\
if (!*(o)) { \
- rb_raise (rb_eException, desc " destroyed already"); \
+ rb_raise (rb_eException, \
+ "%s destroyed already", \
+ rb_obj_classname ((obj))); \
return Qnil; \
}
return Qnil; \
}
@@
-45,6
+47,17
@@
return Qnil; \
}
return Qnil; \
}
+#define INSPECT(obj, type) \
+ char buf[128]; \
+\
+ GET_OBJ (obj, type, o); \
+\
+ snprintf (buf, sizeof (buf), \
+ "#<%s:%p ptr=%p>", rb_obj_classname ((obj)), \
+ (void *) obj, *o); \
+\
+ return rb_str_new2 (buf);
+
static VALUE evases;
/* called by the child classes */
static VALUE evases;
/* called by the child classes */
@@
-63,19
+76,12
@@
void c_ecore_evas_free (Ecore_Evas **ee)
static VALUE c_inspect (VALUE self)
{
static VALUE c_inspect (VALUE self)
{
- char buf[128];
-
- GET_OBJ (self, Ecore_Evas, ee, "EcoreEvas");
-
- snprintf (buf, sizeof (buf), "#<Ecore::Evas::EcoreEvas:%p ptr=%p>",
- (void *) self, *ee);
-
- return rb_str_new2 (buf);
+ INSPECT (self, Ecore_Evas);
}
static VALUE c_show (VALUE self)
{
}
static VALUE c_show (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
ecore_evas_show (*ee);
ecore_evas_show (*ee);
@@
-84,7
+90,7
@@
static VALUE c_show (VALUE self)
static VALUE c_hide (VALUE self)
{
static VALUE c_hide (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
ecore_evas_hide (*ee);
ecore_evas_hide (*ee);
@@
-93,14
+99,14
@@
static VALUE c_hide (VALUE self)
static VALUE c_visible_get (VALUE self)
{
static VALUE c_visible_get (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
return ecore_evas_visibility_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_raise (VALUE self)
{
return ecore_evas_visibility_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_raise (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
ecore_evas_raise (*ee);
ecore_evas_raise (*ee);
@@
-109,7
+115,7
@@
static VALUE c_raise (VALUE self)
static VALUE c_lower (VALUE self)
{
static VALUE c_lower (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
ecore_evas_lower (*ee);
ecore_evas_lower (*ee);
@@
-118,14
+124,14
@@
static VALUE c_lower (VALUE self)
static VALUE c_layer_get (VALUE self)
{
static VALUE c_layer_get (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
return INT2FIX (ecore_evas_layer_get (*ee));
}
static VALUE c_layer_set (VALUE self, VALUE val)
{
return INT2FIX (ecore_evas_layer_get (*ee));
}
static VALUE c_layer_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
Check_Type (val, T_FIXNUM);
Check_Type (val, T_FIXNUM);
@@
-138,7
+144,7
@@
static VALUE c_evas (VALUE self)
{
VALUE evas;
{
VALUE evas;
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
if (NIL_P (evas = rb_hash_aref (evases, INT2NUM ((long) (ee))))) {
evas = TO_EVAS (self, ecore_evas_get (*ee));
if (NIL_P (evas = rb_hash_aref (evases, INT2NUM ((long) (ee))))) {
evas = TO_EVAS (self, ecore_evas_get (*ee));
@@
-152,7
+158,7
@@
static VALUE c_get_size_min (VALUE self)
{
int w = 0, h = 0;
{
int w = 0, h = 0;
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
ecore_evas_size_min_get (*ee, &w, &h);
ecore_evas_size_min_get (*ee, &w, &h);
@@
-161,7
+167,7
@@
static VALUE c_get_size_min (VALUE self)
static VALUE c_set_size_min (VALUE self, VALUE w, VALUE h)
{
static VALUE c_set_size_min (VALUE self, VALUE w, VALUE h)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
Check_Type (w, T_FIXNUM);
Check_Type (h, T_FIXNUM);
Check_Type (w, T_FIXNUM);
Check_Type (h, T_FIXNUM);
@@
-175,7
+181,7
@@
static VALUE c_get_size_max (VALUE self)
{
int w = 0, h = 0;
{
int w = 0, h = 0;
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
ecore_evas_size_max_get (*ee, &w, &h);
ecore_evas_size_max_get (*ee, &w, &h);
@@
-184,7
+190,7
@@
static VALUE c_get_size_max (VALUE self)
static VALUE c_set_size_max (VALUE self, VALUE w, VALUE h)
{
static VALUE c_set_size_max (VALUE self, VALUE w, VALUE h)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
Check_Type (w, T_FIXNUM);
Check_Type (h, T_FIXNUM);
Check_Type (w, T_FIXNUM);
Check_Type (h, T_FIXNUM);
@@
-196,7
+202,7
@@
static VALUE c_set_size_max (VALUE self, VALUE w, VALUE h)
static VALUE c_move (VALUE self, VALUE x, VALUE y)
{
static VALUE c_move (VALUE self, VALUE x, VALUE y)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
Check_Type (x, T_FIXNUM);
Check_Type (y, T_FIXNUM);
Check_Type (x, T_FIXNUM);
Check_Type (y, T_FIXNUM);
@@
-208,7
+214,7
@@
static VALUE c_move (VALUE self, VALUE x, VALUE y)
static VALUE c_resize (VALUE self, VALUE w, VALUE h)
{
static VALUE c_resize (VALUE self, VALUE w, VALUE h)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
Check_Type (w, T_FIXNUM);
Check_Type (h, T_FIXNUM);
Check_Type (w, T_FIXNUM);
Check_Type (h, T_FIXNUM);
@@
-222,7
+228,7
@@
static VALUE c_title_get (VALUE self)
{
const char *tmp;
{
const char *tmp;
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
if (!(tmp = ecore_evas_title_get (*ee)))
return Qnil;
if (!(tmp = ecore_evas_title_get (*ee)))
return Qnil;
@@
-232,7
+238,7
@@
static VALUE c_title_get (VALUE self)
static VALUE c_title_set (VALUE self, VALUE val)
{
static VALUE c_title_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
Check_Type (val, T_STRING);
Check_Type (val, T_STRING);
@@
-243,14
+249,14
@@
static VALUE c_title_set (VALUE self, VALUE val)
static VALUE c_borderless_get (VALUE self)
{
static VALUE c_borderless_get (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
return ecore_evas_borderless_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_borderless_set (VALUE self, VALUE val)
{
return ecore_evas_borderless_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_borderless_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
CHECK_BOOL (val);
CHECK_BOOL (val);
@@
-261,14
+267,14
@@
static VALUE c_borderless_set (VALUE self, VALUE val)
static VALUE c_shaped_get (VALUE self)
{
static VALUE c_shaped_get (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
return ecore_evas_shaped_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_shaped_set (VALUE self, VALUE val)
{
return ecore_evas_shaped_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_shaped_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
CHECK_BOOL (val);
CHECK_BOOL (val);
@@
-279,14
+285,14
@@
static VALUE c_shaped_set (VALUE self, VALUE val)
static VALUE c_sticky_get (VALUE self)
{
static VALUE c_sticky_get (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
return ecore_evas_sticky_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_sticky_set (VALUE self, VALUE val)
{
return ecore_evas_sticky_get (*ee) ? Qtrue : Qfalse;
}
static VALUE c_sticky_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
CHECK_BOOL (val);
CHECK_BOOL (val);
@@
-297,14
+303,14
@@
static VALUE c_sticky_set (VALUE self, VALUE val)
static VALUE c_rotation_get (VALUE self)
{
static VALUE c_rotation_get (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
return INT2FIX (ecore_evas_rotation_get (*ee));
}
static VALUE c_rotation_set (VALUE self, VALUE val)
{
return INT2FIX (ecore_evas_rotation_get (*ee));
}
static VALUE c_rotation_set (VALUE self, VALUE val)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
Check_Type (val, T_FIXNUM);
Check_Type (val, T_FIXNUM);
@@
-315,7
+321,7
@@
static VALUE c_rotation_set (VALUE self, VALUE val)
static VALUE c_delete (VALUE self)
{
static VALUE c_delete (VALUE self)
{
- GET_OBJ (self, Ecore_Evas, ee
, "EcoreEvas"
);
+ GET_OBJ (self, Ecore_Evas, ee);
/* reap our children */
rb_gc_start ();
/* reap our children */
rb_gc_start ();