Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_shelf.c e_shelf.h
Log Message:
start code on moving shelves... need to complete this with resizing too...
and do it all properly
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- e_shelf.c 2 Mar 2006 12:03:48 -0000 1.8
+++ e_shelf.c 26 Mar 2006 06:06:57 -0000 1.9
@@ -5,6 +5,10 @@
static void _e_shelf_free(E_Shelf *es);
static void _e_shelf_config_port(E_Config_Shelf_Config *cf1,
E_Config_Shelf_Config *cf2);
+static void _e_shelf_cb_signal_all(void *data, Evas_Object *obj, const char
*emission, const char *source);
+static void _e_shelf_cb_signal_move_start(void *data, Evas_Object *obj, const
char *emission, const char *source);
+static void _e_shelf_cb_signal_move_go(void *data, Evas_Object *obj, const
char *emission, const char *source);
+static void _e_shelf_cb_signal_move_stop(void *data, Evas_Object *obj, const
char *emission, const char *source);
static Evas_List *shelves = NULL;
static int shelf_id = 0;
@@ -150,6 +154,16 @@
evas_object_move(es->o_base, es->zone->x + es->x, es->zone->y + es->y);
evas_object_layer_set(es->o_base, layer);
}
+
+ edje_object_signal_callback_add(es->o_base, "*", "*",
+ _e_shelf_cb_signal_all, es);
+ edje_object_signal_callback_add(es->o_base, "mouse,down,1", "drag*",
+ _e_shelf_cb_signal_move_start, es);
+ edje_object_signal_callback_add(es->o_base, "mouse,move", "drag*",
+ _e_shelf_cb_signal_move_go, es);
+ edje_object_signal_callback_add(es->o_base, "mouse,up,1", "drag*",
+ _e_shelf_cb_signal_move_stop, es);
+
snprintf(buf, sizeof(buf), "%i", shelf_id);
shelf_id++;
@@ -402,4 +416,63 @@
cf2->y = py[0];
cf2->w = px[3] - px[0] + 1;
cf2->h = py[3] = py[0] + 1;
+}
+
+static void
+_e_shelf_cb_signal_all(void *data, Evas_Object *obj, const char *emission,
const char *source)
+{
+ E_Shelf *es;
+
+ es = data;
+ printf("SIG: %s %s\n", emission, source);
+}
+
+static void
+_e_shelf_cb_signal_move_start(void *data, Evas_Object *obj, const char
*emission, const char *source)
+{
+ E_Shelf *es;
+
+ es = data;
+ printf("MV start\n");
+ es->moveresize.pos.x = es->x;
+ es->moveresize.pos.y = es->y;
+ es->moveresize.move = 1;
+ ecore_x_pointer_last_xy_get(&(es->moveresize.x), &(es->moveresize.y));
+}
+
+static void
+_e_shelf_cb_signal_move_go(void *data, Evas_Object *obj, const char *emission,
const char *source)
+{
+ E_Shelf *es;
+ int x, y;
+
+ es = data;
+ if (es->moveresize.move)
+ {
+ int x, y, nx, ny, nw, nh;
+
+ printf("MV go\n");
+ ecore_x_pointer_last_xy_get(&x, &y);
+ nx = x = es->moveresize.pos.x + (x - es->moveresize.x);
+ ny = y = es->moveresize.pos.y + (y - es->moveresize.y);
+ e_resist_container_border_position(es->zone->container,
+ NULL,
+ es->x, es->y, es->w, es->h,
+ x, y, es->w, es->h,
+ &nx, &ny, &nw, &nh);
+ e_shelf_move(es, nx, ny);
+ }
+}
+
+static void
+_e_shelf_cb_signal_move_stop(void *data, Evas_Object *obj, const char
*emission, const char *source)
+{
+ E_Shelf *es;
+
+ es = data;
+ if (es->moveresize.move)
+ {
+ printf("MV stop\n");
+ es->moveresize.move = 0;
+ }
}
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_shelf.h 2 Mar 2006 12:03:48 -0000 1.6
+++ e_shelf.h 26 Mar 2006 06:06:57 -0000 1.7
@@ -25,6 +25,14 @@
const char *name;
const char *style;
E_Config_Shelf *cfg;
+ struct {
+ int x, y;
+ struct {
+ int x, y;
+ } pos;
+ int move;
+ int resize;
+ } moveresize;
};
EAPI int e_shelf_init(void);
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs