rename extremely frustratingly-named E_Screen_Limits enum and members
authorMike Blumenkrantz <zmike@osg.samsung.com>
Wed, 18 Feb 2015 23:34:29 +0000 (18:34 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Wed, 18 Feb 2015 23:34:29 +0000 (18:34 -0500)
this came in a patch that I take full responsibility for not adequately reviewing at the time.
the names are confusing and counterintuitive, and it does not properly include the client namespace.

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_x.c
src/bin/e_int_menus.c
src/modules/conf_window_manipulation/e_int_config_window_display.c

index d4577af4a37584d830d9041f5a4ca66e38dff7df..016cc3eaaf92b65b051ef49838bfa888b7bea882 100644 (file)
@@ -961,7 +961,7 @@ _e_client_resize_handle(E_Client *ec)
 
    w = new_w;
    h = new_h;
-   if (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN)
+   if (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE)
      {
         w = MIN(w, ec->zone->w);
         h = MIN(h, ec->zone->h);
@@ -1064,7 +1064,7 @@ _e_client_resize_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev
    else if ((strncmp(ev->key, "Control", sizeof("Control") - 1) != 0) &&
             (strncmp(ev->key, "Alt", sizeof("Alt") - 1) != 0))
      goto stop;
-   if (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN)
+   if (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE)
      {
         w = MIN(w, action_client->zone->w);
         h = MIN(h, action_client->zone->h);
@@ -1692,7 +1692,7 @@ _e_client_eval(E_Client *ec)
 
         e_zone_useful_geometry_get(ec->zone, &zx, &zy, &zw, &zh);
         /* enforce wm size hints for initial sizing */
-        if (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN)
+        if (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE)
           {
              ec->w = MIN(ec->w, ec->zone->w);
              ec->h = MIN(ec->h, ec->zone->h);
@@ -2316,7 +2316,7 @@ e_client_idler_before(void)
             (!E_INSIDE(ec->x, ec->y, 0 - ec->w + 5, 0 - ec->h + 5, ec->comp->man->w - 5, ec->comp->man->h - 5))
             )
           {
-             if (e_config->screen_limits != E_SCREEN_LIMITS_COMPLETELY)
+             if (e_config->screen_limits != E_CLIENT_OFFSCREEN_LIMIT_ALLOW_FULL)
                _e_client_move_lost_window_to_center(ec);
           }
      }
@@ -2873,7 +2873,7 @@ e_client_mouse_move(E_Client *ec, Evas_Point *output)
                                  &new_x, &new_y, &new_w, &new_h);
         eina_list_free(skiplist);
 
-        if (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN)
+        if (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE)
           _e_client_stay_within_canvas(ec, x, y, &new_x, &new_y);
 
         ec->shelf_fix.x = 0;
index a918cc6291b98fcf9f648c64309d067a57164724..40d75855febb83da93f8be9847b844e3a6193d95 100644 (file)
@@ -1,10 +1,10 @@
 #ifdef E_TYPEDEFS
-typedef enum _E_Screen_Limits
+typedef enum _E_Client_Screen_Limit
 {
-    E_SCREEN_LIMITS_PARTLY = 0,
-    E_SCREEN_LIMITS_COMPLETELY = 1,
-    E_SCREEN_LIMITS_WITHIN = 2
-} E_Screen_Limits;
+    E_CLIENT_OFFSCREEN_LIMIT_ALLOW_PARTIAL = 0,
+    E_CLIENT_OFFSCREEN_LIMIT_ALLOW_FULL = 1,
+    E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE = 2
+} E_Client_Screen_Limit;
 
 typedef enum _E_Icon_Preference
 {
index aec754fc81b3ea2781f9ba72b735959a62616eec..454c64f84df84b24d2029e3e9eb71dc51f366fbd 100644 (file)
@@ -1437,7 +1437,7 @@ _e_comp_x_configure_request(void *data  EINA_UNUSED, int type EINA_UNUSED, Ecore
         if (ev->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_X)
           {
              ec->comp_data->initial_attributes.x = ev->x;
-             if (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN)
+             if (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE)
                x = E_CLAMP(ev->x, zx, zx + zw - ec->w);
              else
                x = ev->x;
@@ -1445,7 +1445,7 @@ _e_comp_x_configure_request(void *data  EINA_UNUSED, int type EINA_UNUSED, Ecore
         if (ev->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_Y)
           {
              ec->comp_data->initial_attributes.y = ev->y;
-             if (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN)
+             if (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE)
                y = E_CLAMP(ev->y, zy, zy + zh - ec->h);
              else
                y = ev->y;
@@ -1486,13 +1486,13 @@ _e_comp_x_configure_request(void *data  EINA_UNUSED, int type EINA_UNUSED, Ecore
           {
              /* client is completely outside the screen, policy does not allow */
              if (((!E_INTERSECTS(x, y, ec->w, ec->h, ec->comp->man->x, ec->comp->man->y, ec->comp->man->w - 5, ec->comp->man->h - 5)) &&
-                 (e_config->screen_limits != E_SCREEN_LIMITS_COMPLETELY)) ||
+                 (e_config->screen_limits != E_CLIENT_OFFSCREEN_LIMIT_ALLOW_FULL)) ||
                  /* client is partly outside the zone, policy does not allow */
                  (((!E_INSIDE(x, y, ec->comp->man->x, ec->comp->man->y, ec->comp->man->w - 5, ec->comp->man->h - 5)) &&
                   (!E_INSIDE(x + ec->w, y, ec->comp->man->x, ec->comp->man->y, ec->comp->man->w - 5, ec->comp->man->h - 5)) &&
                   (!E_INSIDE(x, y + ec->h, ec->comp->man->x, ec->comp->man->y, ec->comp->man->w - 5, ec->comp->man->h - 5)) &&
                   (!E_INSIDE(x + ec->w, y + ec->h, ec->comp->man->x, ec->comp->man->y, ec->comp->man->w - 5, ec->comp->man->h - 5))) &&
-                  (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN))
+                  (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE))
                 )
                e_comp_object_util_center(ec->frame);
              else
index 717b8c1956cada89f5ab63aa9c16577c0c109803..18c0ebab8659b5eb00172b3f37270937b1722622 100644 (file)
@@ -1476,7 +1476,7 @@ _e_int_menus_clients_pre_cb(void *data __UNUSED__, E_Menu *m)
    e_util_menu_item_theme_icon_set(mi, "preferences-system-windows");
    e_menu_item_callback_set(mi, _e_int_menus_clients_cleanup_cb, zone);
 
-   if ((dat) && (e_config->screen_limits == E_SCREEN_LIMITS_COMPLETELY))
+   if ((dat) && (e_config->screen_limits == E_CLIENT_OFFSCREEN_LIMIT_ALLOW_FULL))
      {
         mi = e_menu_item_new(m);
         e_menu_item_separator_set(mi, 1);
index 311008781e8a3c2b304369632b22531b10a7a584..0e3e52d08113f6607c1192c8daaa53f7411e3edd 100644 (file)
@@ -243,13 +243,13 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
 
    rg = e_widget_radio_group_new(&(cfdata->screen_limits));
 
-   ow = e_widget_radio_add(evas, _("Keep windows within the visual screen limits"), E_SCREEN_LIMITS_WITHIN, rg);
+   ow = e_widget_radio_add(evas, _("Keep windows within the visual screen limits"), E_CLIENT_OFFSCREEN_LIMIT_ALLOW_NONE, rg);
    e_widget_list_object_append(ol, ow, 1, 1, 0.5);
 
-   ow = e_widget_radio_add(evas, _("Allow windows partly out of the visual screen limits"), E_SCREEN_LIMITS_PARTLY, rg);
+   ow = e_widget_radio_add(evas, _("Allow windows partly out of the visual screen limits"), E_CLIENT_OFFSCREEN_LIMIT_ALLOW_PARTIAL, rg);
    e_widget_list_object_append(ol, ow, 1, 1, 0.5);
 
-   ow = e_widget_radio_add(evas, _("Allow windows completely out of visual screen limits"), E_SCREEN_LIMITS_COMPLETELY, rg);
+   ow = e_widget_radio_add(evas, _("Allow windows completely out of visual screen limits"), E_CLIENT_OFFSCREEN_LIMIT_ALLOW_FULL, rg);
    e_widget_list_object_append(ol, ow, 1, 1, 0.5);
 
    e_widget_toolbook_page_append(otb, NULL, _("Screen Limits"), ol,