Enlightenment CVS committal Author : metrics Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_box.c e_box.h e_dnd.c e_gadcon.c e_gadcon.h Log Message: Start of fix for drag and drop to autoscrolling ibar/ibox. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_box.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- e_box.c 8 Nov 2006 10:36:34 -0000 1.17 +++ e_box.c 12 Nov 2006 11:32:43 -0000 1.18 @@ -323,6 +323,20 @@ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); } +/* + * Returns the number of pixels that are hidden on the left/top side. + */ +EAPI void +e_box_align_pixel_offset_get(Evas_Object *obj, int *x, int *y) +{ + E_Smart_Data *sd; + + sd = evas_object_smart_data_get(obj); + if (!sd) return; + if (x) *x = (sd->min.w - sd->w) * (1.0 - sd->align.x); + if (y) *y = (sd->min.h - sd->h) * (1.0 - sd->align.y); +} + /* local subsystem functions */ static E_Box_Item * _e_box_smart_adopt(E_Smart_Data *sd, Evas_Object *obj) =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_box.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- e_box.h 16 Feb 2005 11:21:07 -0000 1.5 +++ e_box.h 12 Nov 2006 11:32:43 -0000 1.6 @@ -26,6 +26,7 @@ EAPI void e_box_max_size_get (Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh); EAPI void e_box_align_get (Evas_Object *obj, double *ax, double *ay); EAPI void e_box_align_set (Evas_Object *obj, double ax, double ay); +EAPI void e_box_align_pixel_offset_get (Evas_Object *obj, int *x, int *y); #endif #endif =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_dnd.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- e_dnd.c 16 Oct 2006 10:40:10 -0000 1.51 +++ e_dnd.c 12 Nov 2006 11:32:43 -0000 1.52 @@ -506,6 +506,9 @@ case E_GADCON_TYPE: e_gadcon_canvas_zone_geometry_get((E_Gadcon *)(h->obj), &px, &py, NULL, NULL); break; + case E_GADCON_CLIENT_TYPE: + evas_object_geometry_get(((E_Gadcon_Client *)(h->obj))->o_box, dx, dy, dw, dh); + break; case E_WIN_TYPE: px = ((E_Win *)(h->obj))->x; py = ((E_Win *)(h->obj))->y; @@ -518,7 +521,7 @@ px = ((E_Popup *)(h->obj))->x; py = ((E_Popup *)(h->obj))->y; break; - /* FIXME: add mroe types as needed */ + /* FIXME: add more types as needed */ default: break; } @@ -539,6 +542,9 @@ case E_GADCON_TYPE: hwin = e_gadcon_dnd_window_get((E_Gadcon *)(h->obj)); break; + case E_GADCON_CLIENT_TYPE: + hwin = e_gadcon_dnd_window_get(((E_Gadcon_Client *)(h->obj))->gadcon); + break; case E_WIN_TYPE: hwin = ((E_Win *)(h->obj))->evas_win; break; @@ -548,7 +554,7 @@ case E_POPUP_TYPE: hwin = ((E_Popup *)(h->obj))->evas_win; break; - /* FIXME: add mroe types as needed */ + /* FIXME: add more types as needed */ default: break; } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_gadcon.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -3 -r1.49 -r1.50 --- e_gadcon.c 16 Oct 2006 10:40:10 -0000 1.49 +++ e_gadcon.c 12 Nov 2006 11:32:43 -0000 1.50 @@ -1348,6 +1348,7 @@ gcc->scroll_animator = NULL; return 0; } + return 1; } @@ -1356,17 +1357,26 @@ { Evas_Event_Mouse_Move *ev; E_Gadcon_Client *gcc; - Evas_Coord x, y, w, h; + Evas_Coord x, y; ev = event_info; gcc = data; + evas_object_geometry_get(gcc->o_box, &x, &y, NULL, NULL); + e_gadcon_client_autoscroll_update(gcc, ev->cur.output.x - x, ev->cur.output.y - y); +} + +/* + * NOTE: x & y are relative to the o_box of the gadcon. + */ +EAPI void +e_gadcon_client_autoscroll_update(E_Gadcon_Client *gcc, Evas_Coord x, Evas_Coord y) +{ if (gcc->autoscroll) { + Evas_Coord w, h; double d; - evas_object_geometry_get(gcc->o_box, &x, &y, &w, &h); - x = ev->cur.output.x - x; - y = ev->cur.output.y - y; + evas_object_geometry_get(gcc->o_box, NULL, NULL, &w, &h); if (e_box_orientation_get(gcc->o_box)) { if (w > 1) d = (double)x / (double)(w - 1); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_gadcon.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- e_gadcon.h 16 Oct 2006 10:40:10 -0000 1.27 +++ e_gadcon.h 12 Nov 2006 11:32:43 -0000 1.28 @@ -175,6 +175,7 @@ EAPI void e_gadcon_client_min_size_set(E_Gadcon_Client *gcc, Evas_Coord w, Evas_Coord h); EAPI void e_gadcon_client_aspect_set(E_Gadcon_Client *gcc, int w, int h); EAPI void e_gadcon_client_autoscroll_set(E_Gadcon_Client *gcc, int autoscroll); +EAPI void e_gadcon_client_autoscroll_update(E_Gadcon_Client *gcc, int mx, int my); EAPI void e_gadcon_client_resizable_set(E_Gadcon_Client *gcc, int resizable); EAPI void e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu, int flags); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs