projects
/
ruby-esmart.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hack: raise the ecore_evas on mouse up.
[ruby-esmart.git]
/
src
/
esmart_draggies
/
rb_esmart_draggies.c
diff --git
a/src/esmart_draggies/rb_esmart_draggies.c
b/src/esmart_draggies/rb_esmart_draggies.c
index c67dd7b76745d8e16eca5fe3fd42adfd45237e65..c422af512e30ad2d7d97afcbc11d90cab75660c2 100644
(file)
--- a/
src/esmart_draggies/rb_esmart_draggies.c
+++ b/
src/esmart_draggies/rb_esmart_draggies.c
@@
-1,5
+1,5
@@
/*
/*
- * $Id: rb_esmart_draggies.c 3
6 2004-07-25 10:45:47
Z tilman $
+ * $Id: rb_esmart_draggies.c 3
16 2005-04-24 20:07:36
Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
@@
-21,24
+21,34
@@
#include <ruby.h>
#include <Esmart/Esmart_Draggies.h>
#include <ruby.h>
#include <Esmart/Esmart_Draggies.h>
-#include <rb_evas.h>
-#include <rb_evas_object.h>
-#include <rb_ecore_evas.h>
+#include <
evas/
rb_evas.h>
+#include <
evas/
rb_evas_object.h>
+#include <
ecore/
rb_ecore_evas.h>
#include "../rb_esmart.h"
#include "../rb_esmart.h"
+static void on_mouse_up (void *data, Evas *e, Evas_Object *o, void *ev)
+{
+ ecore_evas_raise (data);
+}
+
+static void c_free (RbEvasObject *e)
+{
+ c_evas_object_free (e, true);
+}
+
static VALUE c_new (VALUE klass, VALUE ecore_evas)
{
VALUE self, argv[1];
static ID evas;
static VALUE c_new (VALUE klass, VALUE ecore_evas)
{
VALUE self, argv[1];
static ID evas;
-
Evas_Object *
*draggies;
+
RbEvasObject
*draggies;
CHECK_CLASS (ecore_evas, cEcoreEvas);
CHECK_CLASS (ecore_evas, cEcoreEvas);
- GET_OBJ (ecore_evas,
Ecore_Evas *
, ee);
+ GET_OBJ (ecore_evas,
RbEcoreEvas
, ee);
- self = Data_Make_Struct (klass,
Evas_Object *
, c_evas_object_mark,
- c_
evas_object_
free, draggies);
-
*draggies = esmart_draggies_new (*ee
);
+ self = Data_Make_Struct (klass,
RbEvasObject
, c_evas_object_mark,
+ c_free, draggies);
+
draggies->real = esmart_draggies_new (ee->real
);
if (!evas)
evas = rb_intern ("evas");
if (!evas)
evas = rb_intern ("evas");
@@
-46,16
+56,20
@@
static VALUE c_new (VALUE klass, VALUE ecore_evas)
argv[0] = rb_funcall (ecore_evas, evas, 0);
rb_obj_call_init (self, 1, argv);
argv[0] = rb_funcall (ecore_evas, evas, 0);
rb_obj_call_init (self, 1, argv);
+ esmart_draggies_event_callback_add (draggies->real,
+ EVAS_CALLBACK_MOUSE_UP,
+ on_mouse_up, ee->real);
+
return self;
}
static VALUE c_button_set (VALUE self, VALUE val)
{
return self;
}
static VALUE c_button_set (VALUE self, VALUE val)
{
- GET_OBJ (self,
Evas_Object *
, e);
+ GET_OBJ (self,
RbEvasObject
, e);
Check_Type (val, T_FIXNUM);
Check_Type (val, T_FIXNUM);
- esmart_draggies_button_set (
*e
, FIX2INT (val));
+ esmart_draggies_button_set (
e->real
, FIX2INT (val));
return Qnil;
}
return Qnil;
}