rotation: Packing effect objects to the desk's smart object. 57/101557/3
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 1 Dec 2016 11:34:45 +0000 (20:34 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Fri, 2 Dec 2016 08:21:26 +0000 (00:21 -0800)
Change-Id: I1be989aabe951a0d53f5704a154ceb20aa0a527c

src/e_mod_effect_rotation.c

index b3bd57b..12c5056 100644 (file)
@@ -145,7 +145,7 @@ no_hint:
 }
 
 static Eina_List *
-_rotation_effect_targets_get(Rotation_Effect *effect)
+_rotation_effect_targets_get(Rotation_Effect *effect, E_Desk *desk)
 {
    Evas_Object *o;
    Eina_Tiler *t;
@@ -181,6 +181,7 @@ _rotation_effect_targets_get(Rotation_Effect *effect)
         ec = evas_object_data_get(o, "E_Client");
         if (ec)
           {
+             if (ec->desk != desk) continue;
              if (e_object_is_del(E_OBJECT(ec))) continue;
              if (!E_INTERSECTS(ec->x, ec->y, ec->w, ec->h, ec->zone->x, ec->zone->y, ec->zone->w, ec->zone->h))
                continue;
@@ -402,7 +403,7 @@ fail:
 }
 
 static Rotation_Effect_Begin_Context *
-_rotation_effect_begin_create(Rotation_Effect *effect, Eina_List *targets)
+_rotation_effect_begin_create(Rotation_Effect *effect, Eina_List *targets, E_Desk *desk)
 {
    Rotation_Effect_Begin_Context *ctx_begin = NULL;
    Rotation_Effect_Object *eobj = NULL;
@@ -446,6 +447,8 @@ _rotation_effect_begin_create(Rotation_Effect *effect, Eina_List *targets)
         return NULL;
      }
 
+   e_desk_smart_member_add(desk, ctx_begin->layout);
+
    EFFINF("Rotation Begin Created", NULL, NULL);
 
    int diff = effect->zone->rot.prev - effect->zone->rot.curr;
@@ -459,7 +462,7 @@ _rotation_effect_begin_create(Rotation_Effect *effect, Eina_List *targets)
 
 
 static Rotation_Effect_End_Context *
-_rotation_effect_end_create(Rotation_Effect *effect, Eina_List *targets)
+_rotation_effect_end_create(Rotation_Effect *effect, Eina_List *targets, E_Desk *desk)
 {
    Rotation_Effect_End_Context *ctx_end = NULL;
    Rotation_Effect_Object *eobj = NULL;
@@ -501,6 +504,8 @@ _rotation_effect_end_create(Rotation_Effect *effect, Eina_List *targets)
         return NULL;
      }
 
+   e_desk_smart_member_add(desk, ctx_end->layout);
+
    EFFINF("Rotation End Created", NULL, NULL);
 
    int diff = _rotation_zone->curr_angle - _rotation_zone->prev_angle;
@@ -688,16 +693,16 @@ _rotation_effect_start(Rotation_Effect *effect)
 }
 
 static void
-_rotation_effect_animator_begin_prepare(Rotation_Effect *effect)
+_rotation_effect_animator_begin_prepare(Rotation_Effect *effect, E_Desk *desk)
 {
    if (!effect) return;
 
    _rotation_effect_clear(effect);
 
-   effect->targets = _rotation_effect_targets_get(effect);
+   effect->targets = _rotation_effect_targets_get(effect, desk);
    if (!effect->targets) return;
 
-   effect->ctx_begin = _rotation_effect_begin_create(effect, effect->targets);
+   effect->ctx_begin = _rotation_effect_begin_create(effect, effect->targets, desk);
    if (!effect->ctx_begin)
      {
         _rotation_effect_clear(effect);
@@ -711,7 +716,7 @@ _rotation_effect_animator_begin_prepare(Rotation_Effect *effect)
 }
 
 static void
-_rotation_effect_animator_end_prepare(Rotation_Effect *effect)
+_rotation_effect_animator_end_prepare(Rotation_Effect *effect, E_Desk *desk)
 {
    if (!effect) return;
    if (!effect->targets) return;
@@ -722,7 +727,7 @@ _rotation_effect_animator_end_prepare(Rotation_Effect *effect)
      _rotation_effect_animator_end_context_free(effect->ctx_end);
    effect->ctx_end = NULL;
 
-   effect->ctx_end = _rotation_effect_end_create(effect, effect->targets);
+   effect->ctx_end = _rotation_effect_end_create(effect, effect->targets, desk);
    if (!effect->ctx_end) return;
 
    EFFINF("Rotation End Prepared", NULL, NULL);
@@ -736,6 +741,7 @@ _rotation_effect_cb_zone_rotation_begin(void *data, int type, void *event)
    Rotation_Effect *effect;
    E_Event_Zone_Rotation_Change_Begin *ev = event;
    E_Zone *zone;
+   E_Desk *desk;
 
    effect = (Rotation_Effect *)data;
    if (!effect) return ECORE_CALLBACK_PASS_ON;
@@ -752,7 +758,8 @@ _rotation_effect_cb_zone_rotation_begin(void *data, int type, void *event)
    _rotation_zone->curr_angle = zone->rot.curr;
    _rotation_zone->prev_angle = zone->rot.prev;
 
-   _rotation_effect_animator_begin_prepare(effect);
+   desk = e_desk_current_get(zone);
+   _rotation_effect_animator_begin_prepare(effect, desk);
 
    if (effect->targets)
      _rotation_effect_ready_send(zone);
@@ -766,6 +773,7 @@ _rotation_effect_cb_zone_rotation_end(void *data, int type, void *event)
    Rotation_Effect *effect;
    E_Event_Zone_Rotation_Change_End *ev = event;
    E_Zone *zone;
+   E_Desk *desk;
 
    effect = (Rotation_Effect *)data;
    if (!effect) return ECORE_CALLBACK_PASS_ON;
@@ -785,7 +793,8 @@ _rotation_effect_cb_zone_rotation_end(void *data, int type, void *event)
 
    if (!effect->ctx_end)
      {
-        _rotation_effect_animator_end_prepare(effect);
+        desk = e_desk_current_get(zone);
+        _rotation_effect_animator_end_prepare(effect, desk);
 
         if (!effect->ctx_end)
           _rotation_effect_clear(effect);
@@ -822,6 +831,7 @@ _rotation_effect_cb_buffer_change(void *data, int ev_type, void *event)
 {
    E_Event_Client *ev = event;
    E_Client *ec;
+   E_Desk *desk;
    Rotation_Effect *effect;
 
    ec = ev->ec;
@@ -837,7 +847,11 @@ _rotation_effect_cb_buffer_change(void *data, int ev_type, void *event)
 
    if (!effect->wait_for_buffer) return ECORE_CALLBACK_PASS_ON;
 
-   if (!effect->ctx_end) _rotation_effect_animator_end_prepare(effect);
+   if (!effect->ctx_end)
+     {
+        desk = e_desk_current_get(ec->zone);
+        _rotation_effect_animator_end_prepare(effect, desk);
+     }
    if (effect->ctx_end) _rotation_effect_start(effect);
 
    return ECORE_CALLBACK_PASS_ON;