More event work.
authorTilman Sauerbeck <tilman@code-monkey.de>
Tue, 15 Mar 2005 18:00:50 +0000 (18:00 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Tue, 15 Mar 2005 18:00:50 +0000 (18:00 +0000)
src/rb_evas_object_events.c

index 71c087af82aa497f119cb395ded65167bf5454ee..becdee9895798fe06a5aa523de7b2e961dc8fe36 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_evas_object_events.c 282 2005-03-14 21:54:32Z tilman $
+ * $Id: rb_evas_object_events.c 285 2005-03-15 18:00:50Z tilman $
  *
  * Copyright (C) 2005 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -67,8 +67,16 @@ static VALUE event_classes, cPos;
 
 static VALUE c_ev_mouse_down_init (VALUE self, VALUE ev)
 {
+       VALUE argv[4];
        Evas_Event_Mouse_Down *e = (Evas_Event_Mouse_Down *) ev;
 
+       argv[0] = INT2FIX ((int) e->output.x);
+       argv[1] = INT2FIX ((int) e->output.y);
+       argv[2] = INT2FIX ((int) e->canvas.x);
+       argv[3] = INT2FIX ((int) e->canvas.y);
+
+       rb_iv_set (self, "@position",
+                  rb_class_new_instance (4, argv, cPos));
        rb_iv_set (self, "@button", INT2FIX (e->button));
 
        return self;
@@ -76,8 +84,16 @@ static VALUE c_ev_mouse_down_init (VALUE self, VALUE ev)
 
 static VALUE c_ev_mouse_up_init (VALUE self, VALUE ev)
 {
+       VALUE argv[4];
        Evas_Event_Mouse_Up *e = (Evas_Event_Mouse_Up *) ev;
 
+       argv[0] = INT2FIX ((int) e->output.x);
+       argv[1] = INT2FIX ((int) e->output.y);
+       argv[2] = INT2FIX ((int) e->canvas.x);
+       argv[3] = INT2FIX ((int) e->canvas.y);
+
+       rb_iv_set (self, "@position",
+                  rb_class_new_instance (4, argv, cPos));
        rb_iv_set (self, "@button", INT2FIX (e->button));
 
        return self;