Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_border.c e_dnd.c e_dnd.h 


Log Message:
Let the user decide the object for a drag.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -3 -r1.187 -r1.188
--- e_border.c  10 May 2005 22:05:01 -0000      1.187
+++ e_border.c  11 May 2005 06:30:56 -0000      1.188
@@ -2490,12 +2490,15 @@
                            if (a)
                              {
                                 E_Drag *drag;
+                                Evas_Object *o;
                                 Evas_Coord w, h;
                                 
                                 drag = e_drag_new(bd->zone->container,
-                                                  "enlightenment/border", bd,
-                                                  NULL,
-                                                  a->path, "icon");
+                                                  "enlightenment/border", bd, 
NULL);
+                                o = edje_object_add(drag->evas);
+                                edje_object_file_set(o, a->path, "icon");
+                                e_drag_object_set(drag, o);
+
                                 edje_object_part_geometry_get(bd->bg_object, 
"icon",
                                                               NULL, NULL, &w, 
&h);
                                 e_drag_resize(drag, w, h);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dnd.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- e_dnd.c     10 May 2005 22:05:01 -0000      1.21
+++ e_dnd.c     11 May 2005 06:30:56 -0000      1.22
@@ -117,8 +117,7 @@
 E_Drag*
 e_drag_new(E_Container *container,
           const char *type, void *data,
-          void (*finished_cb)(E_Drag *drag, int dropped),
-          const char *icon_path, const char *icon)
+          void (*finished_cb)(E_Drag *drag, int dropped))
 {
    E_Drag *drag;
 
@@ -164,8 +163,8 @@
 
    ecore_evas_shaped_set(drag->ecore_evas, 1);
 
-   drag->object = edje_object_add(drag->evas);
-   edje_object_file_set(drag->object, icon_path, icon);
+   drag->object = evas_object_rectangle_add(drag->evas);
+   evas_object_color_set(drag->object, 255, 0, 0, 255);
    evas_object_show(drag->object);
 
    evas_object_move(drag->object, 0, 0);
@@ -179,6 +178,19 @@
    return drag;
 }
 
+Evas *
+e_drag_evas_get(E_Drag *drag)
+{
+   return drag->evas;
+}
+
+void
+e_drag_object_set(E_Drag *drag, Evas_Object *object)
+{
+   if (drag->object) evas_object_del(drag->object);
+   drag->object = object;
+}
+
 void
 e_drag_show(E_Drag *drag)
 {
@@ -204,15 +216,15 @@
    drag->x = x;
    drag->y = y;
    ecore_evas_move(drag->ecore_evas,
-                  drag->x, 
-                  drag->y);
+                  drag->x - (drag->w / 2), 
+                  drag->y - (drag->h / 2));
    e_container_shape_move(drag->shape,
-                         drag->x, 
-                         drag->y);
+                         drag->x - (drag->w / 2), 
+                         drag->y - (drag->h / 2));
 }
 
 void
-e_drag_resize(E_Drag *drag, unsigned int w, unsigned int h)
+e_drag_resize(E_Drag *drag, int w, int h)
 {
    if ((drag->w == w) && (drag->h == h)) return;
    drag->h = h;
@@ -385,6 +397,15 @@
 }
 
 void
+e_drop_handler_geometry_set(E_Drop_Handler *handler, int x, int y, int w, int 
h)
+{
+   handler->x = x;
+   handler->y = y;
+   handler->w = w;
+   handler->h = h;
+}
+
+void
 e_drop_handler_del(E_Drop_Handler *handler)
 {
    free(handler->type);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dnd.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- e_dnd.h     10 May 2005 22:05:02 -0000      1.15
+++ e_dnd.h     11 May 2005 06:30:56 -0000      1.16
@@ -33,15 +33,10 @@
    E_Container_Shape *shape;
    Evas_Object       *object;
 
-   int          x, y;
-   unsigned int w, h;
+   int x, y, w, h;
 
    unsigned int   layer;
    unsigned char  visible : 1;
-   /*
-   unsigned char  shaped : 1;
-   unsigned char  need_shape_export : 1; 
-   */
 };
 
 struct _E_Drop_Handler
@@ -86,12 +81,13 @@
 EAPI int  e_dnd_active(void);
 
 EAPI E_Drag* e_drag_new(E_Container *container, const char *type, void *data,
-                       void (*finished_cb)(E_Drag *drag, int dropped),
-                       const char *icon_path, const char *icon);
+                       void (*finished_cb)(E_Drag *drag, int dropped));
+EAPI Evas   *e_drag_evas_get(E_Drag *drag);
+EAPI void    e_drag_object_set(E_Drag *drag, Evas_Object *object);
 EAPI void    e_drag_show(E_Drag *drag);
 EAPI void    e_drag_hide(E_Drag *drag);
 EAPI void    e_drag_move(E_Drag *drag, int x, int y);
-EAPI void    e_drag_resize(E_Drag *drag, unsigned int w, unsigned int h);
+EAPI void    e_drag_resize(E_Drag *drag, int w, int h);
 
 EAPI void e_drag_start(E_Drag *drag);
 EAPI void e_drag_update(int x, int y);
@@ -103,6 +99,7 @@
                                        void (*leave_cb)(void *data, const char 
*type, void *event),
                                        void (*drop_cb)(void *data, const char 
*type, void *event),
                                        const char *type, int x, int y, int w, 
int h);
+EAPI void e_drop_handler_geometry_set(E_Drop_Handler *handler, int x, int y, 
int w, int h);
 EAPI void e_drop_handler_del(E_Drop_Handler *handler);
 
 #endif




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to