Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_config.c e_config.h e_gadcon.c e_gadcon.h 


Log Message:
Clean gadgets because of current changes.
It is possible to drop gadcon clients on shelves.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.221
retrieving revision 1.222
diff -u -3 -r1.221 -r1.222
--- e_config.c  30 Dec 2006 17:54:26 -0000      1.221
+++ e_config.c  30 Dec 2006 22:31:28 -0000      1.222
@@ -1156,10 +1156,13 @@
                  1, 200, E_GADCON_ORIENT_BOTTOM,
                  1, 0, "default", 40, 0);
      }
+   IFCFGEND;
+   IFCFG(0x0107); /* the version # where this value(s) was introduced */
      {
        E_Config_Gadcon *cf_gc;
        E_Config_Gadcon_Client *cf_gcc;
 
+       e_config->gadcons = NULL;
 #define CFG_GADCON(_name, _id) \
    cf_gc = E_NEW(E_Config_Gadcon, 1);\
    cf_gc->name = evas_stringshare_add(_name); \
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -3 -r1.137 -r1.138
--- e_config.h  29 Dec 2006 02:56:26 -0000      1.137
+++ e_config.h  30 Dec 2006 22:31:28 -0000      1.138
@@ -52,7 +52,7 @@
 /* increment this whenever a new set of config values are added but the users
  * config doesn't need to be wiped - simply new values need to be put in
  */
-#define E_CONFIG_FILE_GENERATION 0x0106
+#define E_CONFIG_FILE_GENERATION 0x0107
 #define E_CONFIG_FILE_VERSION    ((E_CONFIG_FILE_EPOCH << 16) | 
E_CONFIG_FILE_GENERATION)
 
 #define E_EVAS_ENGINE_DEFAULT      0
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_gadcon.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- e_gadcon.c  30 Dec 2006 21:00:19 -0000      1.58
+++ e_gadcon.c  30 Dec 2006 22:31:28 -0000      1.59
@@ -32,6 +32,10 @@
 static void _e_gadcon_cb_signal_resize_right_stop(void *data, Evas_Object 
*obj, const char *emission, const char *source);
 static void _e_gadcon_cb_signal_resize_right_go(void *data, Evas_Object *obj, 
const char *emission, const char *source);
 static void _e_gadcon_cb_drag_finished(E_Drag *drag, int dropped);
+static void _e_gadcon_cb_dnd_enter(void *data, const char *type, void *event);
+static void _e_gadcon_cb_dnd_move(void *data, const char *type, void *event);
+static void _e_gadcon_cb_dnd_leave(void *data, const char *type, void *event);
+static void _e_gadcon_cb_drop(void *data, const char *type, void *event);
 
 static Evas_Object *e_gadcon_layout_add(Evas *evas);
 static void e_gadcon_layout_orientation_set(Evas_Object *obj, int horizontal);
@@ -249,6 +253,8 @@
 e_gadcon_swallowed_new(const char *name, char *id, Evas_Object *obj, char 
*swallow_name)
 {
    E_Gadcon    *gc;
+   Evas_Coord   x, y, w, h;
+   const char  *drop_types[] = { "enlightenment/gadcon_client" };
    
    gc = E_OBJECT_ALLOC(E_Gadcon, E_GADCON_TYPE, _e_gadcon_free);
    if (!gc) return NULL;
@@ -263,6 +269,12 @@
    gc->orient = E_GADCON_ORIENT_HORIZ;
    gc->evas = evas_object_evas_get(obj);
    gc->o_container = e_gadcon_layout_add(gc->evas);
+   evas_object_geometry_get(gc->o_container, &x, &y, &w, &h);
+   gc->drop_handler = e_drop_handler_add(E_OBJECT(gc), gc,
+                                        _e_gadcon_cb_dnd_enter, 
_e_gadcon_cb_dnd_move,
+                                        _e_gadcon_cb_dnd_leave, 
_e_gadcon_cb_drop,
+                                        drop_types, 1,
+                                        x, y, w, h);
    evas_object_smart_callback_add(gc->o_container, "size_request",
                                  _e_gadcon_cb_size_request, gc);
    evas_object_smart_callback_add(gc->o_container, "min_size_request",
@@ -1325,6 +1337,7 @@
    evas_stringshare_del(gc->id);
    evas_stringshare_del(gc->edje.swallow_name);
    if (gc->config_dialog) e_object_del(E_OBJECT(gc->config_dialog));
+   if (gc->drop_handler) e_drop_handler_del(gc->drop_handler);
    free(gc);
 }
 
@@ -1525,8 +1538,9 @@
 static void
 _e_gadcon_cb_size_request(void *data, Evas_Object *obj, void *event_info)
 {
-   E_Gadcon *gc;
-   
+   E_Gadcon   *gc;
+   Evas_Coord  x, y, w, h;
+ 
    gc = data;
    if (gc->resize_request.func)
      {
@@ -1536,6 +1550,8 @@
        
        gc->resize_request.func(gc->resize_request.data, gc, w, h);
      }
+   evas_object_geometry_get(gc->o_container, &x, &y, &w, &h);
+   e_drop_handler_geometry_set(gc->drop_handler, x, y, w, h);
 }
 
 static void
@@ -1970,6 +1986,42 @@
    e_gadcon_populate(gc);
    e_config_save_queue();
    e_gadcon_edit_begin(gc);
+}
+
+static void
+_e_gadcon_cb_dnd_enter(void *data, const char *type, void *event)
+{
+   // TODO: Need a marker to show where the drop is going to be
+}
+
+static void
+_e_gadcon_cb_dnd_move(void *data, const char *type, void *event)
+{
+   // TODO: Need a marker to show where the drop is going to be
+}
+
+static void
+_e_gadcon_cb_dnd_leave(void *data, const char *type, void *event)
+{
+   // TODO: Need a marker to show where the drop is going to be
+}
+
+static void
+_e_gadcon_cb_drop(void *data, const char *type, void *event)
+{
+   // TODO: Need to place the gadget where the user dropped it, not at the end.
+   E_Event_Dnd_Drop *ev;
+   E_Gadcon         *gc;
+   E_Gadcon_Client  *gcc;
+
+   ev = event;
+   gc = data;
+   gcc = ev->data;
+
+   e_gadcon_client_config_new(gc, gcc->name);
+   e_gadcon_unpopulate(gc);
+   e_gadcon_populate(gc);
+   e_config_save_queue();
 }
 
 /* a smart object JUST for gadcon */
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_gadcon.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- e_gadcon.h  30 Dec 2006 21:00:19 -0000      1.32
+++ e_gadcon.h  30 Dec 2006 22:31:28 -0000      1.33
@@ -81,6 +81,8 @@
    E_Config_Dialog    *config_dialog;
    unsigned char       editing : 1;
    Ecore_X_Window      dnd_win;
+
+   E_Drop_Handler *drop_handler;
 };
 
 #define GADCON_CLIENT_CLASS_VERSION 1



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to