e_client: use e_client_cdata_get 11/247611/1
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 11 Nov 2020 00:42:43 +0000 (09:42 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 12 Nov 2020 23:17:40 +0000 (08:17 +0900)
Change-Id: I4b1bdb840b2d1a254d78c08b7616bd875f4e2a5f

src/bin/e_client.c

index 856e707bed487381f250a33c96aa4cc3cd353cb7..37ae210814adff11ebd31661981edfec650cc6d2 100644 (file)
@@ -2258,6 +2258,7 @@ static void
 _e_client_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
 {
    E_Client *ec = data;
+   E_Comp_Wl_Client_Data *child_cdata = NULL;
 
    if (e_object_is_del(data)) return;
    if (ec->layer_block) return;
@@ -2272,7 +2273,8 @@ _e_client_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
              /* Don't stack vkbd if parent is splitted */
              if (child->vkbd.vkbd && ec->layout.splited) continue;
 
-             if (child->comp_data && !child->comp_data->mapped)
+             child_cdata = e_client_cdata_get(child);
+             if (child_cdata && !child_cdata->mapped)
                {
                   ELOGF("COMP", "STACK CHANGE CHILD. BUT not mapped. skip. child(ec:%p, win:0x%08zx)", ec, child, e_client_util_win_get(child));
                   continue;
@@ -2502,7 +2504,7 @@ _e_client_aux_hint_eval(E_Client *ec)
 {
    if (!ec) return;
 
-   E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
+   E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
    Eina_List *l, *ll;
    E_Comp_Wl_Aux_Hint *hint;
 
@@ -3117,7 +3119,7 @@ _e_client_type_get(E_Client *ec)
 static void
 _e_client_transform_sub_apply(E_Client *ec, E_Client *epc, double zoom)
 {
-   E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
+   E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
    E_Comp_Wl_Subsurf_Data *sdata = cdata->sub.data;
    E_Client *subc;
    Eina_List *l;
@@ -3336,7 +3338,7 @@ _e_client_visibility_zone_calculate(E_Zone *zone)
         if (ec->visibility.skip) continue;
         if (ec->is_cursor) continue;
         /* if ec is subsurface, skip this */
-        cdata = (E_Comp_Wl_Client_Data *)ec->comp_data;
+        cdata = e_client_cdata_get(ec);
         if (cdata && cdata->sub.data) continue;
         if ((!ec->first_mapped) &&
             (e_comp_object_content_type_get(ec->frame) == E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE)) continue;
@@ -3735,15 +3737,17 @@ _e_client_transform_core_check_change(E_Client *ec)
    int w = 0;
    int h = 0;
    Eina_Bool check = EINA_FALSE;
+   E_Comp_Wl_Client_Data *cdata;
    if (!ec) return EINA_FALSE;
 
    if (ec->frame)
      evas_object_geometry_get(ec->frame, 0, 0, &w, &h);
 
+   cdata = e_client_cdata_get(ec);
    if ((ec->transform_core.transform_list) &&
-       (ec->comp_data && ec->comp_data->sub.below_obj))
+       (cdata && cdata->sub.below_obj))
      {
-        const Evas_Map *map_ = evas_object_map_get(ec->comp_data->sub.below_obj);
+        const Evas_Map *map_ = evas_object_map_get(cdata->sub.below_obj);
         if (!map_)
           check = EINA_TRUE;
      }
@@ -3802,10 +3806,8 @@ _e_client_transform_core_check_change(E_Client *ec)
      }
 
    // check parent matrix change
-   if (ec->comp_data)
+   if (cdata)
      {
-        E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
-
         if (cdata->sub.data)
           {
              E_Client *parent = cdata->sub.data->parent;
@@ -3969,9 +3971,9 @@ _e_client_transform_core_sub_update(E_Client *ec, E_Util_Transform_Rect_Vertex *
    E_Comp_Wl_Client_Data *cdata;
 
    if (!ec) return;
-   if (!ec->comp_data) return;
 
-   cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
+   cdata = e_client_cdata_get(ec);
+   if (!cdata) return;
 
    if (cdata->sub.below_obj)
      _e_client_transform_core_vertices_apply(ec, cdata->sub.below_obj, vertices, NULL);
@@ -3989,9 +3991,9 @@ _e_client_transform_core_sub_update_with_zoom(E_Client *ec, E_Util_Transform_Rec
    E_Comp_Wl_Client_Data *cdata;
 
    if (!ec) return;
-   if (!ec->comp_data) return;
 
-   cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
+   cdata = e_client_cdata_get(ec);
+   if (!cdata) return;
 
    if (cdata->sub.below_obj)
      _e_client_transform_core_vertices_apply_with_zoom(ec, cdata->sub.below_obj, vertices, NULL, zoomx, zoomy, cx, cy);
@@ -4145,7 +4147,8 @@ e_client_idler_before(void)
              // ignored client but needing eval (aux hint) such as remote surfaces
              if (ec->changed)
                {
-                  if (ec->comp_data && ec->comp_data->first_commit)
+                  E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
+                  if (cdata && cdata->first_commit)
                     _e_client_aux_hint_eval(ec);
                }
              continue;
@@ -6105,6 +6108,8 @@ e_client_iconify(E_Client *ec)
    E_OBJECT_CHECK(ec);
    E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE);
 
+   E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
+
    ELOGF("TZVIS", "ICONIFY  |iconic:%d  |argb:%d       |not_raise:%d   |by_client:%d",
          ec, ec->iconic, ec->argb, (unsigned int)ec->exp_iconify.not_raise,
          ec->exp_iconify.by_client);
@@ -6113,7 +6118,7 @@ e_client_iconify(E_Client *ec)
    if (ec->shading || ec->iconic) return;
    if (ec->exp_iconify.skip_iconify && !ec->exp_iconify.by_client) return;
    if (ec->exp_iconify.skip_by_remote) return;
-   if (!ec->comp_data || !ec->comp_data->mapped)
+   if (!cdata || !cdata->mapped)
      {
         if (!ec->exp_iconify.by_client)
           {
@@ -6164,10 +6169,12 @@ e_client_uniconify(E_Client *ec)
    E_OBJECT_CHECK(ec);
    E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE);
 
+   E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
+
    ELOGF("TZVIS", "UNICONIFY|iconic:%d  |argb:%d       |not_raise:%d  |by_client:%d  |mapped:%d",
          ec, ec->iconic, ec->argb, (unsigned int)ec->exp_iconify.not_raise,
          ec->exp_iconify.by_client,
-         ec->comp_data ? ec->comp_data->mapped : 0);
+         cdata ? cdata->mapped : 0);
 
    if (!ec->zone) return;
    if (ec->shading || (!ec->iconic)) return;
@@ -6206,7 +6213,7 @@ e_client_uniconify(E_Client *ec)
 
    if (ec->pixmap && e_pixmap_usable_get(ec->pixmap))
      {
-        if (ec->comp_data && ec->comp_data->mapped)
+        if (cdata && cdata->mapped)
           {
              ELOGF("TZVIS", "UNICONIFY|object show", ec);
              evas_object_show(ec->frame);
@@ -7068,7 +7075,7 @@ E_API void
 e_client_transform_apply(E_Client *ec, double angle, double zoom, int cx, int cy)
 {
    Evas_Map *map;
-   E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
+   E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
    E_Client *subc;
    Eina_List *l;
 
@@ -7138,7 +7145,7 @@ e_client_transform_apply(E_Client *ec, double angle, double zoom, int cx, int cy
 E_API void
 e_client_transform_clear(E_Client *ec)
 {
-   E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
+   E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
    E_Client *subc;
    Eina_List *l;
 
@@ -7663,6 +7670,7 @@ E_API Eina_Bool
 e_client_base_output_resolution_update(E_Client *ec)
 {
    E_Appinfo *eai = NULL;
+   E_Comp_Wl_Client_Data *cdata;
    int configured_width, configured_height;
    int width, height;
 
@@ -7676,7 +7684,8 @@ e_client_base_output_resolution_update(E_Client *ec)
    * Transform for subsurface will be applied when toplevel surface does by
    * implementation of e_client_transform_core.
    */
-  if (ec->comp_data->sub.data) return EINA_FALSE;
+  cdata = e_client_cdata_get(ec);
+  if (cdata && cdata->sub.data) return EINA_FALSE;
 
   configured_width = e_config->configured_output_resolution.w;
   configured_height = e_config->configured_output_resolution.h;
@@ -8226,11 +8235,12 @@ _e_client_surface_tree_foreach_helper(E_Client *ec, E_Client_Surface_Tree_Foreac
    E_Client *subc;
    Eina_List *l, *ll;
    Eina_Bool res = EINA_TRUE;
+   E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
 
-   if ((e_object_is_del(E_OBJECT(ec))) || (!ec->comp_data))
+   if ((e_object_is_del(E_OBJECT(ec))) || (!cdata))
      return res;
 
-   EINA_LIST_FOREACH_SAFE(ec->comp_data->sub.below_list, l, ll, subc)
+   EINA_LIST_FOREACH_SAFE(cdata->sub.below_list, l, ll, subc)
      {
         res = _e_client_surface_tree_foreach_helper(subc, func, data);
         if (!res)
@@ -8242,7 +8252,7 @@ _e_client_surface_tree_foreach_helper(E_Client *ec, E_Client_Surface_Tree_Foreac
         res = func(data, ec);
         if (res)
           {
-             EINA_LIST_FOREACH_SAFE(ec->comp_data->sub.list, l, ll, subc)
+             EINA_LIST_FOREACH_SAFE(cdata->sub.list, l, ll, subc)
                {
                   res = _e_client_surface_tree_foreach_helper(subc,
                                                               func,