struct _Policy_Ext_Rotation
{
- E_Pixmap *ep;
+ E_Client *ec;
uint32_t available_angles, preferred_angle;
enum tizen_rotation_angle cur_angle, prev_angle;
Eina_List *rotation_list;
static Ecore_Idle_Enterer *rot_idle_enterer = NULL;
/* local subsystem functions */
-static Policy_Ext_Rotation* _policy_ext_rotation_get(E_Pixmap *ep);
+static Policy_Ext_Rotation* _policy_ext_rotation_get(E_Client *ec);
/* local subsystem wayland rotation protocol related functions */
static void _e_tizen_rotation_destroy_cb(struct wl_client *client, struct wl_resource *resource);
/* local subsystem functions */
static Policy_Ext_Rotation*
-_policy_ext_rotation_get(E_Pixmap *ep)
+_policy_ext_rotation_get(E_Client *ec)
{
Policy_Ext_Rotation *rot;
EINA_SAFETY_ON_NULL_RETURN_VAL(hash_policy_ext_rotation, NULL);
- rot = eina_hash_find(hash_policy_ext_rotation, &ep);
+ rot = eina_hash_find(hash_policy_ext_rotation, &ec);
if (!rot)
{
rot = E_NEW(Policy_Ext_Rotation, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(rot, NULL);
- rot->ep = ep;
- eina_hash_add(hash_policy_ext_rotation, &ep, rot);
+ rot->ec = ec;
+ eina_hash_add(hash_policy_ext_rotation, &ec, rot);
}
return rot;
E_Client *ec;
Policy_Ext_Rotation *rot;
- ec = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(ec);
-
- rot = _policy_ext_rotation_get(ec->pixmap);
+ rot = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(rot);
+ ec = rot->ec;
+ if (!ec)
+ return;
+
rot->available_angles = angles;
ec->e.fetch.rot.available_rots = 1;
Policy_Ext_Rotation *rot;
E_Client *ec;
- ec = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(ec);
-
- rot = _policy_ext_rotation_get(ec->pixmap);
+ rot = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(rot);
+ ec = rot->ec;
+ if (!ec)
+ return;
+
rot->preferred_angle = angle;
ec->e.fetch.rot.preferred_rot = 1;
E_Client *ec;
Policy_Ext_Rotation *rot;
- ec = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(ec);
-
- rot = _policy_ext_rotation_get(ec->pixmap);
+ rot = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(rot);
+ ec = rot->ec;
+ if (!ec)
+ return;
+
if (rot->serial == serial) // rotation success
{
ec->e.state.rot.ang.prev = ec->e.state.rot.ang.curr;
E_Client *ec;
Policy_Ext_Rotation *rot;
- ec = wl_resource_get_user_data(resource);
- EINA_SAFETY_ON_NULL_RETURN(ec);
-
- rot = _policy_ext_rotation_get(ec->pixmap);
+ rot = wl_resource_get_user_data(resource);
EINA_SAFETY_ON_NULL_RETURN(rot);
rot->rotation_list = eina_list_remove(rot->rotation_list, resource);
EINA_SAFETY_ON_NULL_RETURN(ec);
// Add rotation info
- rot = _policy_ext_rotation_get(ec->pixmap);
+ rot = _policy_ext_rotation_get(ec);
EINA_SAFETY_ON_NULL_RETURN(rot);
res = wl_resource_create(client, &tizen_rotation_interface, version, id);
rot->rotation_list = eina_list_append(rot->rotation_list, res);
wl_resource_set_implementation(res, &_e_tizen_rotation_interface,
- ec, _e_tizen_rotation_destroy);
+ rot, _e_tizen_rotation_destroy);
ec->e.fetch.rot.support = 1;
EC_CHANGED(ec);
enum tizen_rotation_angle tz_angle = TIZEN_ROTATION_ANGLE_0;
EINA_SAFETY_ON_NULL_RETURN(ec);
- EINA_SAFETY_ON_NULL_RETURN(ec->pixmap);
EINA_SAFETY_ON_NULL_RETURN(hash_policy_ext_rotation);
- rot = eina_hash_find(hash_policy_ext_rotation, &ec->pixmap);
+ rot = eina_hash_find(hash_policy_ext_rotation, &ec);
if (!rot) return;
switch (angle)
ec->e.state.rot.ang.curr = 0;
ec->e.state.rot.ang.prev = 0;
- EINA_SAFETY_ON_NULL_RETURN(ec->pixmap);
EINA_SAFETY_ON_NULL_RETURN(hash_policy_ext_rotation);
- rot = eina_hash_find(hash_policy_ext_rotation, &ec->pixmap);
+ rot = eina_hash_find(hash_policy_ext_rotation, &ec);
if (!rot) return;
ec->e.fetch.rot.support = 1;
_rot_hook_client_del(void *d EINA_UNUSED, E_Client *ec)
{
Policy_Ext_Rotation *ext_rot;
+ struct wl_resource *res;
_e_client_rotation_list_remove(ec);
if (rot.async_list) rot.async_list = eina_list_remove(rot.async_list, ec);
if (ec->e.state.rot.available_rots)
E_FREE(ec->e.state.rot.available_rots);
- ext_rot = _policy_ext_rotation_get(ec->pixmap);
+ ext_rot = _policy_ext_rotation_get(ec);
if (ext_rot)
- E_FREE_LIST(ext_rot->rotation_list, wl_resource_destroy);
+ {
+ EINA_LIST_FREE(ext_rot->rotation_list, res)
+ wl_resource_set_user_data(res, NULL);
+
+ eina_hash_del_by_key(hash_policy_ext_rotation, &ec);
+ }
}
static void
Policy_Ext_Rotation *rot;
if (!ec) return;
- if (!ec->pixmap) return;
- rot = eina_hash_find(hash_policy_ext_rotation, &ec->pixmap);
+ rot = eina_hash_find(hash_policy_ext_rotation, &ec);
if (!rot) return;
if(ec->e.fetch.rot.support)