Enabled to swallow indicator object into cw->shobj 41/114641/1
authorMinJeong Kim <minjjj.kim@samsung.com>
Tue, 14 Feb 2017 09:12:30 +0000 (18:12 +0900)
committerMinJeong Kim <minjjj.kim@samsung.com>
Tue, 14 Feb 2017 09:12:30 +0000 (18:12 +0900)
Change-Id: I3d9a318b201b13ea63261c716d3c615e72782c7a
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/e_comp_object.c
src/bin/e_comp_object.h
src/bin/e_policy_wl.c

index 2dee43758c020f0341e4aa95a89dc408722b9e97..cbc341baf2c334c8608e2c4006a453b91a8026b4 100644 (file)
@@ -137,6 +137,12 @@ typedef struct _E_Comp_Object
    Eina_Bool            dim_enable : 1;
    Eina_Bool            user_alpha_set : 1;
    Eina_Bool            user_alpha : 1;
+
+   struct
+     {
+        Evas_Object         *obj;
+        int                  w, h;
+     } indicator; //indicator object for internal client
 } E_Comp_Object;
 
 typedef struct _E_Input_Rect_Data
@@ -841,6 +847,18 @@ _e_comp_object_shadow_setup(E_Comp_Object *cw)
                }
           }
      }
+   if (cw->indicator.obj)
+     {
+        Evas_Object *indicator;
+        indicator = edje_object_part_swallow_get(cw->shobj, "e.swallow.indicator");
+        if (indicator != cw->indicator.obj)
+          {
+             edje_object_part_unswallow(cw->shobj, indicator);
+             edje_object_part_swallow(cw->shobj, "e.swallow.indicator", cw->indicator.obj);
+             e_comp_object_indicator_size_set(cw->smart_obj, cw->indicator.w, cw->indicator.h);
+          }
+     }
+
    evas_object_pass_events_set(cw->obj, pass_event_flag);
 #ifdef BORDER_ZOOMAPS
    e_zoomap_child_edje_solid_setup(cw->zoomobj);
@@ -5148,3 +5166,43 @@ e_comp_object_effect_object_part_swallow(Evas_Object *obj, const char *part_name
    API_ENTRY;
    edje_object_part_swallow(cw->effect_obj, part_name, swallow_obj);
 }
+
+E_API void
+e_comp_object_indicator_swallow(Evas_Object *obj, Evas_Object *indicator)
+{
+   API_ENTRY;
+   if (cw->indicator.obj != indicator)
+     edje_object_part_unswallow(cw->shobj, cw->indicator.obj);
+   cw->indicator.obj = indicator;
+   edje_object_part_swallow(cw->shobj, "e.swallow.indicator", indicator);
+}
+
+E_API void
+e_comp_object_indicator_unswallow(Evas_Object *obj, Evas_Object *indicator)
+{
+   API_ENTRY;
+   if (cw->indicator.obj != indicator) return;
+   cw->indicator.obj = NULL;
+   edje_object_part_unswallow(cw->shobj, indicator);
+}
+
+E_API void
+e_comp_object_indicator_size_set(Evas_Object *obj, int w, int h)
+{
+   API_ENTRY;
+   Edje_Message_Int_Set *msg;
+
+   if (!cw->indicator.obj) return;
+
+   cw->indicator.w = w;
+   cw->indicator.h = h;
+
+   if (!cw->shobj) return;
+
+   msg = alloca(sizeof(Edje_Message_Int_Set) + (sizeof(int)));
+   msg->count = 2;
+   msg->val[0] = w;
+   msg->val[1] = h;
+   edje_object_message_send(cw->shobj, EDJE_MESSAGE_INT_SET, 0, msg);
+   edje_object_message_signal_process(cw->shobj);
+}
index 01ccb2860920d4854cc89272c502fae9fca45fc1..c5a1ba6f01886b2a577e394346de952ef37a7e94 100644 (file)
@@ -149,6 +149,10 @@ E_API void e_comp_object_hwc_update_set(Evas_Object *obj, Eina_Bool set);
 
 E_API void e_comp_object_effect_object_part_swallow(Evas_Object *obj, const char *part_name, Evas_Object *swallow_obj);
 
+E_API void e_comp_object_indicator_swallow(Evas_Object *obj, Evas_Object *indicator);
+E_API void e_comp_object_indicator_unswallow(Evas_Object *obj, Evas_Object *indicator);
+E_API void e_comp_object_indicator_size_set(Evas_Object *obj, int w, int h);
+
 #endif
 #endif
 
index 922debdef3d5cd875f62b0458484f5a20bd80743..c7349cc1f3fca1b49fb5beaa83ce266b342f24f9 100644 (file)
@@ -4501,14 +4501,21 @@ static void
 _launchscreen_img_cb_indicator_resized(Ecore_Evas *ee)
 {
    Evas_Coord_Size size = {0, 0};
-   Evas_Object *indicator = ecore_evas_data_get(ee, "indicator");
+   Evas_Object *indicator_obj;
+   E_Policy_Wl_Tzlaunch_Img *tzlaunch_img;
 
-   if (!indicator) return;
+  tzlaunch_img = ecore_evas_data_get(ee, "tzlaunch_img");
+  if (!tzlaunch_img) return;
 
-   ecore_evas_geometry_get(ee, NULL, NULL, &(size.w), &(size.h));
+  indicator_obj = tzlaunch_img->indicator_obj;
 
-   evas_object_move(indicator, 0, 0);
-   evas_object_resize(indicator, size.w, size.h);
+  ecore_evas_geometry_get(ee, NULL, NULL, &(size.w), &(size.h));
+  ELOGF("TZPOL", "Launchscreen indicator_obj resized(%d x %d)",
+        NULL, NULL,
+        size.w, size.h);
+  evas_object_size_hint_min_set(indicator_obj, size.w, size.h);
+  evas_object_size_hint_max_set(indicator_obj, size.w, size.h);
+  e_comp_object_indicator_size_set(tzlaunch_img->ec->frame, size.w, size.h);
 }
 
 static void
@@ -4553,7 +4560,9 @@ _launchscreen_img_off(E_Policy_Wl_Tzlaunch_Img *tzlaunch_img)
 
    if (tzlaunch_img->indicator_obj)
      {
+        e_comp_object_indicator_unswallow(ec->frame, tzlaunch_img->indicator_obj);
         evas_object_del(tzlaunch_img->indicator_obj);
+        evas_object_unref(tzlaunch_img->indicator_obj);
         tzlaunch_img->indicator_obj = NULL;
      }
 
@@ -4737,13 +4746,11 @@ _tzlaunch_img_iface_cb_launch(struct wl_client *client EINA_UNUSED, struct wl_re
                        Ecore_Evas *ee;
 
                        ee = ecore_evas_object_ecore_evas_get(indicator_obj);
-                       ecore_evas_data_set(ee, "indicator", indicator_obj);
+                       ecore_evas_data_set(ee, "tzlaunch_img", tzlaunch_img);
                        ecore_evas_callback_resize_set(ee,
                                                       _launchscreen_img_cb_indicator_resized);
-
-                       evas_object_layer_set(indicator_obj, ec->layer);
-                       evas_object_stack_above(indicator_obj, ec->frame);
-                       evas_object_show(indicator_obj);
+                       e_comp_object_indicator_swallow(ec->frame, indicator_obj);
+                       evas_object_ref(indicator_obj);
                        ELOGF("TZPOL",
                              "Launchscreen launch | Succeeded to add indicator object plug_name(%s) indicator_obj(%p)",
                              ec->pixmap, ec, e_config->indicator_plug_name, indicator_obj);
@@ -4863,6 +4870,14 @@ _tzlaunch_img_iface_cb_owner(struct wl_client *client EINA_UNUSED, struct wl_res
                    new_ec->pixmap, new_ec,
                    old_ec, new_ec, tzlaunch_img->obj);
 
+             if (tzlaunch_img->indicator_obj)
+               {
+                  e_mod_indicator_owner_set(new_ec);
+                  e_tzsh_indicator_srv_property_update(new_ec);
+                  e_comp_object_indicator_unswallow(old_ec->frame, tzlaunch_img->indicator_obj);
+                  e_comp_object_indicator_swallow(new_ec->frame, tzlaunch_img->indicator_obj);
+               }
+
              /* delete ec was created for launchscreen */
              if (old_ec->visible)
                {
@@ -4876,13 +4891,6 @@ _tzlaunch_img_iface_cb_owner(struct wl_client *client EINA_UNUSED, struct wl_res
              e_object_del(E_OBJECT(old_ec));
              tzlaunch_img->ep = NULL;
 
-             if (tzlaunch_img->indicator_obj)
-               {
-                  e_mod_indicator_owner_set(new_ec);
-                  e_tzsh_indicator_srv_property_update(new_ec);
-                  evas_object_stack_above(tzlaunch_img->indicator_obj, new_ec->frame);
-               }
-
              e_client_visibility_calculate();
           }
         else