Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_border.c e_border.h e_config.c e_config.h e_ipc_handlers.h 
        e_ipc_handlers_list.h e_place.c e_place.h 


Log Message:
- add the ability to change the initial window placement policy. currenlty
  the default smart placement and place under cursor are available.

- configurable through enlightenment_remove -window-placement-set/get

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.397
retrieving revision 1.398
diff -u -3 -r1.397 -r1.398
--- e_border.c  7 Sep 2005 15:48:48 -0000       1.397
+++ e_border.c  13 Sep 2005 05:19:25 -0000      1.398
@@ -5004,12 +5004,20 @@
                         new_y = bd->zone->y + (rand() % (bd->zone->h - bd->h));
                       else
                         new_y = bd->zone->y;
-                      
-                      skiplist = evas_list_append(skiplist, bd);
-                      e_place_zone_region_smart(bd->zone, skiplist,
-                                                bd->x, bd->y, bd->w, bd->h,
-                                                &new_x, &new_y);
-                      evas_list_free(skiplist);
+
+                      if (e_config->window_placement_policy == 
E_WINDOW_PLACEMENT_SMART)
+                        {
+                           skiplist = evas_list_append(skiplist, bd);
+                           e_place_zone_region_smart(bd->zone, skiplist,
+                                                     bd->x, bd->y, bd->w, 
bd->h,
+                                                     &new_x, &new_y);
+                           evas_list_free(skiplist);
+                        }
+                      else
+                        {
+                           e_place_zone_cursor(bd->zone, bd->x, bd->w, 
bd->client_inset.t,
+                                               &new_x, &new_y);
+                        }
                       bd->x = new_x;
                       bd->y = new_y;
                       bd->changes.pos = 1;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.h,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -3 -r1.110 -r1.111
--- e_border.h  7 Sep 2005 14:55:46 -0000       1.110
+++ e_border.h  13 Sep 2005 05:19:25 -0000      1.111
@@ -58,6 +58,11 @@
    E_FULLSCREEN_ZOOM
 } E_Fullscreen;
 
+typedef enum _E_Window_Placement
+{
+   E_WINDOW_PLACEMENT_SMART,
+   E_WINDOW_PLACEMENT_CURSOR
+} E_Window_Placement;
 
 
 typedef struct _E_Border                     E_Border;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -3 -r1.98 -r1.99
--- e_config.c  6 Sep 2005 05:19:15 -0000       1.98
+++ e_config.c  13 Sep 2005 05:19:25 -0000      1.99
@@ -255,6 +255,7 @@
    E_CONFIG_LIST(D, T, path_append_icons, _e_config_path_append_edd); /**/
    E_CONFIG_LIST(D, T, path_append_modules, _e_config_path_append_edd); /**/
    E_CONFIG_LIST(D, T, path_append_backgrounds, _e_config_path_append_edd); 
/**/
+   E_CONFIG_VAL(D, T, window_placement_policy, INT);
    E_CONFIG_VAL(D, T, focus_policy, INT); /**/
    E_CONFIG_VAL(D, T, focus_setting, INT); /**/
    E_CONFIG_VAL(D, T, pass_click_on, INT); /**/
@@ -372,6 +373,7 @@
        e_config->evas_engine_popups = E_EVAS_ENGINE_DEFAULT;
        e_config->evas_engine_drag = E_EVAS_ENGINE_DEFAULT;
        e_config->language = strdup("");
+       e_config->window_placement_policy = E_WINDOW_PLACEMENT_SMART;
        e_config->focus_policy = E_FOCUS_MOUSE;
        e_config->focus_setting = E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED;
        e_config->pass_click_on = 1;
@@ -946,6 +948,7 @@
    E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64);
    E_CONFIG_LIMIT(e_config->use_edge_flip, 0, 1);
    E_CONFIG_LIMIT(e_config->edge_flip_timeout, 0.0, 2.0);
+   E_CONFIG_LIMIT(e_config->window_placement_policy, 0, 1);
    E_CONFIG_LIMIT(e_config->focus_policy, 0, 2);
    E_CONFIG_LIMIT(e_config->focus_setting, 0, 3);
    E_CONFIG_LIMIT(e_config->pass_click_on, 0, 1);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- e_config.h  5 Sep 2005 21:46:56 -0000       1.50
+++ e_config.h  13 Sep 2005 05:19:25 -0000      1.51
@@ -99,6 +99,7 @@
    Evas_List  *path_append_icons;
    Evas_List  *path_append_modules;
    Evas_List  *path_append_backgrounds;
+   int         window_placement_policy;
    int         focus_policy;
    int         focus_setting;
    int         pass_click_on;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- e_ipc_handlers.h    5 Sep 2005 21:46:56 -0000       1.70
+++ e_ipc_handlers.h    13 Sep 2005 05:19:25 -0000      1.71
@@ -5015,3 +5015,57 @@
    END_INT;
 #endif
 #undef HDL
+
+
+/****************************************************************************/
+#define HDL E_IPC_OP_WINDOW_PLACEMENT_POLICY_SET
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-window-placement-policy-set", 1, "Set the window placement policy. 
OPT1 = SMART or CURSOR", 0, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+   REQ_INT_START(HDL)
+   int value = 0;
+   if (!strcmp(params[0], "SMART")) value = E_WINDOW_PLACEMENT_SMART;
+   else if (!strcmp(params[0], "CURSOR")) value = E_WINDOW_PLACEMENT_CURSOR;
+   else
+     {
+        printf("window placement policy must be SMART or CURSOR\n");
+        exit(-1);
+     }
+   REQ_INT_END(value, HDL);
+#elif (TYPE == E_WM_IN)
+   START_INT(value, HDL);
+   e_config->window_placement_policy = value;
+   E_CONFIG_LIMIT(e_config->window_placement_policy, 0, 1);
+   SAVE;
+   END_INT
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_WINDOW_PLACEMENT_POLICY_GET
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-window-placement-policy-get", 0, "Get window placement policy", 1, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+   REQ_NULL(HDL);
+#elif (TYPE == E_WM_IN)
+   SEND_INT(e_config->window_placement_policy, 
E_IPC_OP_WINDOW_PLACEMENT_POLICY_GET_REPLY, HDL);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_WINDOW_PLACEMENT_POLICY_GET_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+   START_INT(policy, HDL);
+   if (policy == E_WINDOW_PLACEMENT_SMART)
+     printf("REPLY: SMART\n");
+   else if (policy == E_WINDOW_PLACEMENT_CURSOR)
+     printf("REPLY: CURSOR\n");
+   END_INT
+#endif
+#undef HDL
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers_list.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- e_ipc_handlers_list.h       5 Sep 2005 21:46:56 -0000       1.19
+++ e_ipc_handlers_list.h       13 Sep 2005 05:19:25 -0000      1.20
@@ -257,3 +257,8 @@
 #define E_IPC_OP_MODAL_WINDOWS_SET 255
 #define E_IPC_OP_MODAL_WINDOWS_GET 256
 #define E_IPC_OP_MODAL_WINDOWS_GET_REPLY 257
+
+#define E_IPC_OP_WINDOW_PLACEMENT_POLICY_SET 258
+#define E_IPC_OP_WINDOW_PLACEMENT_POLICY_GET 259
+#define E_IPC_OP_WINDOW_PLACEMENT_POLICY_GET_REPLY 260
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_place.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- e_place.c   31 Jul 2005 06:22:31 -0000      1.9
+++ e_place.c   13 Sep 2005 05:19:25 -0000      1.10
@@ -449,3 +449,19 @@
    *ry += zone->y;
    return 1;
 }
+
+int
+e_place_zone_cursor(E_Zone *zone, int x, int w, int it, int *rx, int *ry)
+{
+   int cursor_x = 0, cursor_y = 0;
+
+   E_OBJECT_CHECK(zone);
+
+   ecore_x_pointer_xy_get(zone->container->win, &cursor_x, &cursor_y);
+   *rx = cursor_x - ((w - x) >> 1);
+   *ry = cursor_y - (it >> 1);
+   return 1;
+}
+
+
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_place.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_place.h   13 May 2005 04:05:43 -0000      1.6
+++ e_place.h   13 Sep 2005 05:19:25 -0000      1.7
@@ -8,6 +8,7 @@
 
 EAPI void e_place_zone_region_smart_cleanup(E_Zone *zone);
 EAPI int e_place_zone_region_smart(E_Zone *zone, Evas_List *skiplist, int x, 
int y, int w, int h, int *rx, int *ry);
+EAPI int e_place_zone_cursor(E_Zone *zone, int x, int w, int it, int *rx, int 
*ry);
     
 #endif
 #endif




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to