discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=b3ea9e9e9de47eb9ee6e9087a6449cbf715df720

commit b3ea9e9e9de47eb9ee6e9087a6449cbf715df720
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Tue Oct 15 12:43:51 2013 +0100

    feature: break out e_moveresize_client_extents for calculating client step 
sizes
    
    if using an external moveresize implementation, this function is very handy
---
 src/bin/e_moveresize.c | 61 +++++++++++++++++++++++++-------------------------
 src/bin/e_moveresize.h |  1 +
 2 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/src/bin/e_moveresize.c b/src/bin/e_moveresize.c
index a8dacec..f7a0cc2 100644
--- a/src/bin/e_moveresize.c
+++ b/src/bin/e_moveresize.c
@@ -3,7 +3,6 @@
 static void _e_resize_begin(void *data, E_Client *ec);
 static void _e_resize_update(void *data, E_Client *ec);
 static void _e_resize_end(void *data, E_Client *ec);
-static void _e_resize_client_extents(E_Client *ec, int *w, int *h);
 static void _e_move_begin(void *data, E_Client *ec);
 static void _e_move_update(void *data, E_Client *ec);
 static void _e_move_end(void *data, E_Client *ec);
@@ -55,6 +54,34 @@ e_moveresize_replace(Eina_Bool enable)
    _e_moveresize_enabled = !enable;
 }
 
+EAPI void
+e_moveresize_client_extents(const E_Client *ec, int *w, int *h)
+{
+   if ((ec->icccm.base_w >= 0) &&
+       (ec->icccm.base_h >= 0))
+     {
+        if (ec->icccm.step_w > 0)
+          *w = (ec->client.w - ec->icccm.base_w) / ec->icccm.step_w;
+        else
+          *w = ec->client.w;
+        if (ec->icccm.step_h > 0)
+          *h = (ec->client.h - ec->icccm.base_h) / ec->icccm.step_h;
+        else
+          *h = ec->client.h;
+     }
+   else
+     {
+        if (ec->icccm.step_w > 0)
+          *w = (ec->client.w - ec->icccm.min_w) / ec->icccm.step_w;
+        else
+          *w = ec->client.w;
+        if (ec->icccm.step_h > 0)
+          *h = (ec->client.h - ec->icccm.min_h) / ec->icccm.step_h;
+        else
+          *h = ec->client.h;
+     }
+}
+
 static void
 _e_resize_begin(void *data __UNUSED__, E_Client *ec)
 {
@@ -69,7 +96,7 @@ _e_resize_begin(void *data __UNUSED__, E_Client *ec)
    if ((!e_config->resize_info_visible) || (!_e_moveresize_enabled))
      return;
 
-   _e_resize_client_extents(ec, &w, &h);
+   e_moveresize_client_extents(ec, &w, &h);
 
    _disp_content = o = edje_object_add(e_comp_get(ec)->evas);
    evas_object_name_set(o, "resizeinfo->_disp_content");
@@ -122,7 +149,7 @@ _e_resize_update(void *data __UNUSED__, E_Client *ec)
    if (e_config->resize_info_follows)
      e_comp_object_util_center_on(_disp_obj, ec->frame);
 
-   _e_resize_client_extents(ec, &w, &h);
+   e_moveresize_client_extents(ec, &w, &h);
 
    if (!visible)
      {
@@ -134,34 +161,6 @@ _e_resize_update(void *data __UNUSED__, E_Client *ec)
 }
 
 static void
-_e_resize_client_extents(E_Client *ec, int *w, int *h)
-{
-   if ((ec->icccm.base_w >= 0) &&
-       (ec->icccm.base_h >= 0))
-     {
-        if (ec->icccm.step_w > 0)
-          *w = (ec->client.w - ec->icccm.base_w) / ec->icccm.step_w;
-        else
-          *w = ec->client.w;
-        if (ec->icccm.step_h > 0)
-          *h = (ec->client.h - ec->icccm.base_h) / ec->icccm.step_h;
-        else
-          *h = ec->client.h;
-     }
-   else
-     {
-        if (ec->icccm.step_w > 0)
-          *w = (ec->client.w - ec->icccm.min_w) / ec->icccm.step_w;
-        else
-          *w = ec->client.w;
-        if (ec->icccm.step_h > 0)
-          *h = (ec->client.h - ec->icccm.min_h) / ec->icccm.step_h;
-        else
-          *h = ec->client.h;
-     }
-}
-
-static void
 _e_move_begin(void *data __UNUSED__, E_Client *ec)
 {
    Evas_Object *o;
diff --git a/src/bin/e_moveresize.h b/src/bin/e_moveresize.h
index 0d93649..11b47ae 100644
--- a/src/bin/e_moveresize.h
+++ b/src/bin/e_moveresize.h
@@ -7,5 +7,6 @@
 EINTERN int e_moveresize_init(void);
 EINTERN int e_moveresize_shutdown(void);
 EAPI void e_moveresize_replace(Eina_Bool enable);
+EAPI void e_moveresize_client_extents(const E_Client *ec, int *w, int *h);
 #endif
 #endif

-- 


Reply via email to