Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_border.c e_config.c e_config.h e_gadman.c e_moveresize.c 
        e_moveresize.h 


Log Message:


allow move resize box to follow the object its moving/resizing

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.319
retrieving revision 1.320
diff -u -3 -r1.319 -r1.320
--- e_border.c  9 Jul 2005 14:55:40 -0000       1.319
+++ e_border.c  9 Jul 2005 15:37:28 -0000       1.320
@@ -6286,6 +6286,10 @@
        bd->client.netwm.sync.wait = 0;
        bd->client.netwm.sync.send_time = ecore_time_get();
      }
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(bd->x, bd->y, bd->w, bd->h); 
+   else
+     e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, 
bd->zone->h);
    e_resize_begin(bd->zone, w, h);
    resize = bd;
    return 1;
@@ -6328,6 +6332,10 @@
        w = (bd->client.w - bd->client.icccm.min_w) / bd->client.icccm.step_w;
        h = (bd->client.h - bd->client.icccm.min_h) / bd->client.icccm.step_h;
      }
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(bd->x, bd->y, bd->w, bd->h);
+   else
+     e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, 
bd->zone->h);
    e_resize_update(w, h);
 }
 
@@ -6350,6 +6358,10 @@
        bd->client.netwm.sync.time = ecore_time_get();
      }
 #endif
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(bd->x, bd->y, bd->w, bd->h); 
+   else
+     e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, 
bd->zone->h);
    e_move_begin(bd->zone, bd->x, bd->y);
    move = bd;
    return 1;
@@ -6382,6 +6394,10 @@
 static void
 _e_border_move_update(E_Border *bd)
 {
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(bd->x, bd->y, bd->w, bd->h); 
+   else
+     e_move_resize_object_coords_set(bd->zone->x, bd->zone->y, bd->zone->w, 
bd->zone->h);
    e_move_update(bd->x, bd->y);
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- e_config.c  9 Jul 2005 14:55:40 -0000       1.77
+++ e_config.c  9 Jul 2005 15:37:28 -0000       1.78
@@ -249,6 +249,8 @@
    E_CONFIG_VAL(D, T, transition_desk, STR); /**/
    E_CONFIG_VAL(D, T, transition_change, STR); /**/
    E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
+   E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
+   E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
    
    e_config = e_config_domain_load("e", _e_config_edd);
    if (e_config)
@@ -349,7 +351,8 @@
        e_config->transition_start = strdup("");
        e_config->transition_desk = strdup("vswipe");
        e_config->transition_change = strdup("crossfade");
-       
+       e_config->move_info_follows = 1;
+       e_config->resize_info_follows = 1;
          {
             E_Config_Module *em;
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- e_config.h  7 Jul 2005 09:27:04 -0000       1.39
+++ e_config.h  9 Jul 2005 15:37:28 -0000       1.40
@@ -47,7 +47,7 @@
  * defaults for e to work - started at 100 when we introduced this config
  * versioning feature
  */
-#define E_CONFIG_FILE_VERSION 117
+#define E_CONFIG_FILE_VERSION 118
 
 #define E_EVAS_ENGINE_DEFAULT      0
 #define E_EVAS_ENGINE_SOFTWARE_X11 1
@@ -135,6 +135,8 @@
    char       *transition_desk;
    char       *transition_change;
    Evas_List  *remembers;
+   int         move_info_follows;
+   int         resize_info_follows;
 };
 
 struct _E_Config_Module
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_gadman.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- e_gadman.c  8 Jul 2005 09:45:53 -0000       1.38
+++ e_gadman.c  9 Jul 2005 15:37:28 -0000       1.39
@@ -1121,6 +1121,10 @@
    evas_object_raise(gmc->event_object);
    _e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_RAISE);
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_move_begin(gmc->zone, gmc->x, gmc->y);
 }
 
@@ -1295,6 +1299,10 @@
      _e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
    e_object_unref(E_OBJECT(gmc));
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_move_update(gmc->x, gmc->y);
 }
 
@@ -1309,6 +1317,10 @@
    gmc->use_autow = 0;
    gmc->resizing_l = 1;
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_resize_begin(gmc->zone, gmc->w, gmc->h);
 }
 
@@ -1378,6 +1390,10 @@
    _e_gadman_client_geometry_apply(gmc);
    _e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_resize_update(gmc->w, gmc->h);
 }
 
@@ -1392,6 +1408,10 @@
    gmc->use_autow = 0;
    gmc->resizing_r = 1;
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_resize_begin(gmc->zone, gmc->w, gmc->h);
 }
 
@@ -1457,6 +1477,10 @@
    _e_gadman_client_geometry_apply(gmc);
    _e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_resize_update(gmc->w, gmc->h);
 }
 
@@ -1471,6 +1495,10 @@
    gmc->use_autoh = 0;
    gmc->resizing_u = 1;
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_resize_begin(gmc->zone, gmc->w, gmc->h);
 }
 
@@ -1540,6 +1568,10 @@
    _e_gadman_client_geometry_apply(gmc);
    _e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_resize_update(gmc->w, gmc->h);
 }
 
@@ -1554,6 +1586,10 @@
    gmc->use_autoh = 0;
    gmc->resizing_d = 1;
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_resize_begin(gmc->zone, gmc->w, gmc->h);
 }
 
@@ -1619,6 +1655,10 @@
    _e_gadman_client_geometry_apply(gmc);
    _e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
 
+   if (e_config->move_info_follows)
+     e_move_resize_object_coords_set(gmc->x, gmc->y, gmc->w, gmc->h);
+   else
+     e_move_resize_object_coords_set(gmc->zone->x, gmc->zone->y, gmc->zone->w, 
gmc->zone->h);
    e_resize_update(gmc->w, gmc->h);
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_moveresize.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- e_moveresize.c      7 Jun 2005 13:53:27 -0000       1.11
+++ e_moveresize.c      9 Jul 2005 15:37:28 -0000       1.12
@@ -7,6 +7,10 @@
 static Evas_Object *_obj = NULL;
 
 static int visible = 0;
+static int obj_x = 0;
+static int obj_y = 0;
+static int obj_w = 0;
+static int obj_h = 0;
 
 void
 e_resize_begin(E_Zone *zone, int w, int h)
@@ -33,8 +37,10 @@
    e_resize_update(w, h);
 
    e_popup_move_resize(_disp_pop,
-                      (_disp_pop->zone->w - ew) / 2,
-                      (_disp_pop->zone->h - eh) / 2,
+                      (obj_x - _disp_pop->zone->x) +
+                      ((obj_w - ew) / 2),
+                      (obj_y - _disp_pop->zone->y) +
+                      ((obj_h - eh) / 2),
                       ew, eh);
    e_popup_show(_disp_pop);
    visible = 1;
@@ -95,8 +101,10 @@
 //   e_move_update(x, y);
    
    e_popup_move_resize(_disp_pop,
-                      (_disp_pop->zone->w - ew) / 2,
-                      (_disp_pop->zone->h - eh) / 2,
+                      (obj_x - _disp_pop->zone->x) +
+                      ((obj_w - ew) / 2),
+                      (obj_y - _disp_pop->zone->y) +
+                      ((obj_h - eh) / 2),
                       ew, eh);
 //   e_popup_show(_disp_pop);
 //   visible = 1;
@@ -133,3 +141,21 @@
    snprintf(buf, sizeof(buf), "%i %i", x, y);
    edje_object_part_text_set(_obj, "text", buf);
 }
+
+void
+e_move_resize_object_coords_set(int x, int y, int w, int h)
+{
+   obj_x = x;
+   obj_y = y;
+   obj_w = w;
+   obj_h = h;
+   if (visible)
+     {
+       e_popup_move(_disp_pop,
+                    (obj_x - _disp_pop->zone->x) +
+                    ((obj_w - _disp_pop->w) / 2),
+                    (obj_y - _disp_pop->zone->y) +
+                    ((obj_h - _disp_pop->h) / 2)
+                    );
+     }
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_moveresize.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_moveresize.h      28 Apr 2005 09:55:41 -0000      1.2
+++ e_moveresize.h      9 Jul 2005 15:37:28 -0000       1.3
@@ -1,6 +1,11 @@
 /*
  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
  */
+#ifdef E_TYPEDEFS
+
+#else
+#ifndef E_MOVERESIZE_H
+#define E_MOVERESIZE_H
 
 EAPI void e_resize_begin(E_Zone *zone, int w, int h);
 EAPI void e_resize_end(void);
@@ -9,3 +14,8 @@
 EAPI void e_move_begin(E_Zone *zone, int x, int y);
 EAPI void e_move_end(void);
 EAPI void e_move_update(int x, int y);
+
+EAPI void e_move_resize_object_coords_set(int x, int y, int w, int h);
+
+#endif
+#endif




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to