remove the unused code. 65/271165/1
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 16 Feb 2022 07:59:12 +0000 (16:59 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 16 Feb 2022 07:59:12 +0000 (16:59 +0900)
ivi profile is not used anymore at tizen.

Change-Id: I6dc8358cd57a9e0ea1f310d161027b51afda4d46

src/Makefile.am
src/e_mod_configured_resolution.c
src/e_mod_ivi_home.c [deleted file]
src/e_mod_ivi_home.h [deleted file]
src/e_mod_main.c
src/e_mod_main.h

index b52c5ba..bfbfe68 100644 (file)
@@ -10,11 +10,6 @@ filesdir = $(libdir)/enlightenment/modules/$(MODULE)
 pkgdir                 = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
 pkg_LTLIBRARIES        = module.la
 
-WL_SRC   =
-
-WL_SRC   += e_mod_ivi_home.c \
-           e_mod_ivi_home.h
-
 ROT_SRC  = rotation/e_mod_rotation.c \
            rotation/e_mod_rotation.h \
            rotation/e_mod_rotation_settings.c \
@@ -35,7 +30,6 @@ module_la_SOURCES      = e_mod_config.c \
                          e_mod_pol_pingpong.h \
                          e_mod_configured_resolution.c \
                          e_mod_configured_resolution.h \
-                         $(WL_SRC) \
                          $(ROT_SRC)
 
 module_la_LIBADD       =
index 333541d..22f0324 100644 (file)
@@ -1,5 +1,4 @@
 #include "e_mod_main.h"
-#include "e_mod_ivi_home.h"
 #include "e_policy_wl.h"
 #include "e_appinfo.h"
 #include <aul/aul.h>
diff --git a/src/e_mod_ivi_home.c b/src/e_mod_ivi_home.c
deleted file mode 100644 (file)
index d06e1f8..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-#include "e_mod_main.h"
-#include "e_mod_ivi_home.h"
-
-typedef enum
-{
-   IVI_HOME_SIZE_MODE_NONE,
-   IVI_HOME_SIZE_MODE_HALF,
-   IVI_HOME_SIZE_MODE_FULL,
-   IVI_HOME_SIZE_MODE_SMALL,
-} IVI_Home_Size_Mode;
-
-typedef struct
-{
-   E_Client *ec;
-   IVI_Home_Size_Mode ivi_policy_mode;
-   Eina_Bool ivi_policy_state;
-} IVI_Home_Client;
-
-typedef enum
-{
-   IVI_HOME_HINT_SIZE_MODE,
-} IVI_Home_Hint;
-
-static const char *ivi_home_hint_names[] =
-{
-   "wm.policy.ivi.win.size.mode",
-};
-
-static Eina_Hash *hash_clients = NULL;
-static Eina_List *hooks_ec = NULL;
-static E_Client *ivi_clients[2] = {NULL, NULL};
-
-static void
-_ivi_home_policy_pre(IVI_Home_Client *ic, IVI_Home_Size_Mode mode, int slot)
-{
-   E_Client *ec;
-   int zx, zy, zw, zh;
-
-   ec = ic->ec;
-
-   if (ec->desk->visible)
-     e_zone_useful_geometry_get(ec->zone, &zx, &zy, &zw, &zh);
-   else
-     {
-        zx = ec->zone->x;
-        zy = ec->zone->y;
-        zw = ec->zone->w;
-        zh = ec->zone->h;
-     }
-
-   ic->ivi_policy_mode = mode;
-   switch (mode)
-     {
-      case IVI_HOME_SIZE_MODE_FULL:
-         if (slot)
-           {
-              ec->x = ec->client.x = zx;
-              ec->y = ec->client.y = zy;
-              ec->w = ec->client.w = zw;
-              ec->h = ec->client.h = zh;
-           }
-         break;;
-      case IVI_HOME_SIZE_MODE_SMALL:
-         if (!!!slot)
-           {
-              ec->x = ec->client.x = zx;
-              ec->y = ec->client.y = zy;
-              ec->w = ec->client.w = zw;
-              ec->h = ec->client.h = zh * 9 / 10;
-           }
-         else
-           {
-              ec->x = ec->client.x = zx;
-              ec->y = ec->client.y = zh - zh / 10;
-              ec->w = ec->client.w = zw;
-              ec->h = ec->client.h = zh / 10;
-           }
-         break;
-      case IVI_HOME_SIZE_MODE_HALF:
-      case IVI_HOME_SIZE_MODE_NONE:
-      default:
-         ic->ivi_policy_mode = IVI_HOME_SIZE_MODE_HALF;
-         if (!!!slot)
-           {
-              ec->x = ec->client.x = zx;
-              ec->y = ec->client.y = zy;
-           }
-         else
-           {
-              ec->x = ec->client.x = zx;
-              ec->y = ec->client.y = zh / 2;
-           }
-         ec->w = ec->client.w = zw;
-         ec->h = ec->client.h = zh / 2;
-     }
-
-   EC_CHANGED(ec);
-}
-
-static void
-_ivi_home_policy_apply(IVI_Home_Client *ic, int slot)
-{
-   E_Client *ec;
-
-   if (!ic) return;
-   if (ic->ivi_policy_state) return;
-
-   ic->ivi_policy_state = EINA_TRUE;
-   ec = ic->ec;
-
-   ivi_clients[slot] = ec;
-
-   /* skip hooks of e_remeber for eval_pre_post_fetch and eval_post_new_client */
-   ec->internal_no_remember = 1;
-
-   if (!ec->borderless)
-     {
-        ec->borderless = 1;
-        ec->border.changed = 1;
-        EC_CHANGED(ec);
-     }
-
-   _ivi_home_policy_pre(ic, ic->ivi_policy_mode, slot);
-   evas_object_move(ec->frame, ec->x, ec->y);
-   evas_object_resize(ec->frame, ec->w, ec->h);
-   ec->placed = EINA_TRUE;
-   e_client_visibility_calculate();
-
-   /* do not allow client to change these properties */
-   ec->lock_user_location = 1;
-   ec->lock_client_location = 1;
-   ec->lock_user_size = 1;
-   ec->lock_client_size = 1;
-   ec->lock_user_shade = 1;
-   ec->lock_client_shade = 1;
-   ec->lock_user_maximize = 1;
-   ec->lock_client_maximize = 1;
-   ec->lock_user_fullscreen = 1;
-   ec->lock_client_fullscreen = 1;
-   ec->skip_fullscreen = 1;
-}
-
-static void
-_ivi_home_policy_change(IVI_Home_Client *ic, IVI_Home_Size_Mode mode, int slot)
-{
-   E_Client *ec;
-
-   if (!ic) return;
-   if (!ic->ec) return;
-   if (ic->ivi_policy_mode == mode) return;
-
-   ec = ic->ec;
-   if (!ic->ivi_policy_state)
-     {
-        _ivi_home_policy_apply(ic, slot);
-        return;
-     }
-
-   _ivi_home_policy_pre(ic, mode, slot);
-   evas_object_move(ec->frame, ec->x, ec->y);
-   evas_object_resize(ec->frame, ec->w, ec->h);
-   ec->placed = EINA_TRUE;
-   e_client_visibility_calculate();
-}
-
-static Eina_Bool
-_ivi_home_client_is_ivi_home(E_Client *ec)
-{
-   E_OBJECT_CHECK_RETURN(ec, EINA_FALSE);
-   E_OBJECT_TYPE_CHECK_RETURN(ec, E_CLIENT_TYPE, EINA_FALSE);
-
-   if (!e_util_strcmp("ivi-home", ec->icccm.window_role))
-     return EINA_TRUE;
-
-   return EINA_FALSE;
-}
-
-static Eina_Bool
-_ivi_home_client_is_ivi_navi(E_Client *ec)
-{
-   E_OBJECT_CHECK_RETURN(ec, EINA_FALSE);
-   E_OBJECT_TYPE_CHECK_RETURN(ec, E_CLIENT_TYPE, EINA_FALSE);
-
-   if (!e_util_strcmp("ivi-navi", ec->icccm.window_role))
-     return EINA_TRUE;
-
-   return EINA_FALSE;
-}
-
-static void
-_ivi_home_size_mode_set(E_Client *ec, IVI_Home_Size_Mode mode)
-{
-   IVI_Home_Client *ic;
-
-   if (!_ivi_home_client_is_ivi_home(ec)) return;
-
-   ic = eina_hash_find(hash_clients, &ec);
-   _ivi_home_policy_change(ic, mode, 1);
-
-   if (ivi_clients[0] && _ivi_home_client_is_ivi_navi(ivi_clients[0]))
-     {
-        ic = eina_hash_find(hash_clients, &ivi_clients[0]);
-        _ivi_home_policy_change(ic, mode, 0);
-     }
-}
-
-static void
-_ivi_home_cb_hook_client_new(void *d EINA_UNUSED, E_Client *ec)
-{
-   IVI_Home_Client *ic;
-
-   if (e_object_is_del(E_OBJECT(ec))) return;
-
-   ic = eina_hash_find(hash_clients, &ec);
-   if (ic) return;
-
-   ic = E_NEW(IVI_Home_Client, 1);
-   if (!ic) return;
-   ic->ec = ec;
-
-   eina_hash_add(hash_clients, &ec, ic);
-}
-
-static void
-_ivi_home_cb_hook_client_del(void *d EINA_UNUSED, E_Client *ec)
-{
-   if (ivi_clients[0] == ec)
-     ivi_clients[0] = NULL;
-   else if (ivi_clients[1] == ec)
-     ivi_clients[1] = NULL;
-
-   eina_hash_del_by_key(hash_clients, &ec);
-}
-
-static void
-_ivi_home_cb_hook_aux_hint_changed(void *d EINA_UNUSED, E_Client *ec)
-{
-   E_Comp_Wl_Client_Data *cdata;
-   Eina_List *l;
-   E_Comp_Wl_Aux_Hint *hint;
-
-   if (EINA_UNLIKELY(!ec))
-     return;
-
-   cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
-   if (cdata)
-     {
-        EINA_LIST_FOREACH(cdata->aux_hint.hints, l, hint)
-          {
-             if (!strcmp(hint->hint, ivi_home_hint_names[IVI_HOME_HINT_SIZE_MODE]))
-               {
-                  if (hint->deleted)
-                    _ivi_home_size_mode_set(ec, IVI_HOME_SIZE_MODE_NONE);
-                  else if (!strcmp(hint->val, "half"))
-                    _ivi_home_size_mode_set(ec, IVI_HOME_SIZE_MODE_HALF);
-                  else if (!strcmp(hint->val, "full"))
-                    _ivi_home_size_mode_set(ec, IVI_HOME_SIZE_MODE_FULL);
-                  else if (!strcmp(hint->val, "small"))
-                    _ivi_home_size_mode_set(ec, IVI_HOME_SIZE_MODE_SMALL);
-               }
-          }
-     }
-}
-
-static void
-_ivi_home_cb_hook_role_changed(void *d EINA_UNUSED, E_Client *ec)
-{
-   if (e_object_is_del(E_OBJECT(ec))) return;
-
-   if (_ivi_home_client_is_ivi_home(ec))
-     {
-        e_policy_allow_user_geometry_set(ec, EINA_TRUE);
-        e_client_layer_set(ec, E_LAYER_CLIENT_ABOVE);
-     }
-   else if (_ivi_home_client_is_ivi_navi(ec))
-     {
-        e_policy_allow_user_geometry_set(ec, EINA_TRUE);
-        e_client_layer_set(ec, E_LAYER_CLIENT_BELOW);
-     }
-}
-
-static void
-_ivi_home_cb_hook_eval_post_fetch(void *d EINA_UNUSED, E_Client *ec)
-{
-   IVI_Home_Client *ic;
-
-   if (e_object_is_del(E_OBJECT(ec))) return;
-   if ((ec->new_client) && (!e_pixmap_usable_get(ec->pixmap))) return;
-
-   ic = eina_hash_find(hash_clients, &ec);
-   if (!ic) return;
-
-   if (_ivi_home_client_is_ivi_home(ec))
-     {
-        _ivi_home_policy_apply(ic, 1);
-     }
-   else if (_ivi_home_client_is_ivi_navi(ec))
-     {
-        _ivi_home_policy_apply(ic, 0);
-     }
-}
-
-static void
-e_mod_ivi_home_aux_hint_init(void)
-{
-   int i, n;
-   n = (sizeof(ivi_home_hint_names) / sizeof(char *));
-
-   for (i = 0; i < n; i++)
-     {
-        e_hints_aux_hint_supported_add(ivi_home_hint_names[i]);
-     }
-}
-
-static void
-_ivi_home_cb_client_data_free(void *data)
-{
-   free(data);
-}
-
-EINTERN void
-e_mod_ivi_home_init(void)
-{
-   hash_clients = eina_hash_pointer_new(_ivi_home_cb_client_data_free);
-
-   E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_NEW_CLIENT, _ivi_home_cb_hook_client_new, NULL);
-   E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_DEL, _ivi_home_cb_hook_client_del, NULL);
-   E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_AUX_HINT_CHANGE, _ivi_home_cb_hook_aux_hint_changed, NULL);
-   E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_WINDOW_ROLE_CHANGE, _ivi_home_cb_hook_role_changed, NULL);
-   E_CLIENT_HOOK_APPEND(hooks_ec,  E_CLIENT_HOOK_EVAL_POST_FETCH,     _ivi_home_cb_hook_eval_post_fetch, NULL);
-
-   e_mod_ivi_home_aux_hint_init();
-}
-
-EINTERN void
-e_mod_ivi_home_shutdown(void)
-{
-   E_FREE_LIST(hooks_ec, e_client_hook_del);
-   E_FREE_FUNC(hash_clients, eina_hash_free);
-}
diff --git a/src/e_mod_ivi_home.h b/src/e_mod_ivi_home.h
deleted file mode 100644 (file)
index 9c4a9a8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef E_MOD_IVI_HOME_H
-#define E_MOD_IVI_HOME_H
-
-EINTERN void e_mod_ivi_home_init(void);
-EINTERN void e_mod_ivi_home_shutdown(void);
-
-#endif /* end of E_MOD_IVI_HOME_H */
index 19881e9..339d1c2 100644 (file)
@@ -1,7 +1,6 @@
 #include "e_mod_main.h"
 #include "e_mod_rotation.h"
 #include "e_mod_pol_pingpong.h"
-#include "e_mod_ivi_home.h"
 #include "e_mod_configured_resolution.h"
 #include <stdlib.h>
 #include <system_info.h>
@@ -10,49 +9,6 @@ E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Policy-Mobile" };
 
 Mod *_pol_mod = NULL;
 
-static Tz_Profile_Type
-_tz_profile_type_get(void)
-{
-   static Tz_Profile_Type p = TZ_PROFILE_TYPE_UNKNOWN;
-   char *name = NULL;
-
-   if (EINA_LIKELY(p != TZ_PROFILE_TYPE_UNKNOWN))
-     {
-        return p;
-     }
-
-   system_info_get_platform_string("http://tizen.org/feature/profile",
-                                   &name);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(name, p);
-
-   switch (*name)
-     {
-      case 'm':
-      case 'M':
-         p = TZ_PROFILE_TYPE_MOBILE;
-         break;
-      case 'w':
-      case 'W':
-         p = TZ_PROFILE_TYPE_WEARABLE;
-         break;
-      case 't':
-      case 'T':
-         p = TZ_PROFILE_TYPE_TV;
-         break;
-      case 'i':
-      case 'I':
-         p = TZ_PROFILE_TYPE_IVI;
-         break;
-      default: // common or unknown ==> ALL ARE COMMON.
-         p = TZ_PROFILE_TYPE_COMMON;
-         break;
-     }
-
-   free(name);
-
-   return p;
-}
-
 static void
 _e_mod_pol_rotation_init(void)
 {
@@ -80,8 +36,6 @@ e_modapi_init(E_Module *m)
    _e_mod_pol_rotation_init();
    e_mod_pol_pingpong_init();
    e_mod_configured_resolution_init();
-   if (_tz_profile_type_get() == TZ_PROFILE_TYPE_IVI)
-     e_mod_ivi_home_init();
 
    return mod;
 }
@@ -95,8 +49,6 @@ e_modapi_shutdown(E_Module *m)
    e_mod_pol_pingpong_shutdown();
    e_mod_pol_rotation_shutdown();
    e_mod_pol_conf_shutdown(mod);
-   if (_tz_profile_type_get() == TZ_PROFILE_TYPE_IVI)
-     e_mod_ivi_home_shutdown();
    E_FREE(mod);
    _pol_mod = NULL;
    return 1;
index 006815b..06ecfbe 100644 (file)
@@ -26,16 +26,6 @@ struct _Mod
    Config          *conf;
 };
 
-typedef enum
-{
-   TZ_PROFILE_TYPE_UNKNOWN  = 0,
-   TZ_PROFILE_TYPE_MOBILE   = 0x1,
-   TZ_PROFILE_TYPE_WEARABLE = 0x2,
-   TZ_PROFILE_TYPE_TV       = 0x4,
-   TZ_PROFILE_TYPE_IVI      = 0x8,
-   TZ_PROFILE_TYPE_COMMON   = 0x10,
-} Tz_Profile_Type;
-
 #undef E_CLIENT_HOOK_APPEND
 #define E_CLIENT_HOOK_APPEND(l, t, cb, d) \
   do                                      \