diff options
author | Mike Blumenkrantz <m.blumenkran@samsung.com> | 2013-10-15 12:43:51 +0100 |
---|---|---|
committer | Mike Blumenkrantz <m.blumenkran@samsung.com> | 2013-10-28 13:23:33 +0000 |
commit | a916f5484d09be441087d5a1f468dec500a5cc82 (patch) | |
tree | 37822f0e4a4a64b7a09f3f3e73ad76c7afd40931 | |
parent | 74569296b8d63a81bae43be8ee976178b43e587d (diff) | |
download | enlightenment-a916f5484d09be441087d5a1f468dec500a5cc82.tar.gz |
feature: break out e_moveresize_client_extents for calculating client step sizes
-rw-r--r-- | src/bin/e_moveresize.c | 61 | ||||
-rw-r--r-- | 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 a8dacece27..f7a0cc23ea 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 0d9364943b..11b47ae96a 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 |