Make elementary compatible with Tizen 4.0 build env #2 62/103162/10 sandbox/mzx/unification_2
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 7 Dec 2016 11:11:42 +0000 (20:11 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 19 Jan 2017 05:29:38 +0000 (14:29 +0900)
In Tizen 4.0 Unified Project, there will be no more
profile macro available.

This is to support elementary in Tizen 4.0 unified build env
while the refactoring (to make it use conf files, not
ifdefs, or different set of source files) is in progress;
I do not intend to be in the refactoring process.

After the supposed refactoring is done, this commit can be
removed as well as the previous commit.
(You may let me know when the time comes.)

Change-Id: I16c4cf3c9658c0d65e8e76d28eece6817a28408d
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
configure.ac
packaging/elementary.spec
src/lib/Makefile.am
src/lib/elm_entry.c
src/mobile_lib/elm_genlist.c
src/modules/copypasteUI_ctxpopup/Makefile.am
src/modules/copypasteUI_ctxpopup/copypaste.c

index 0accc5f217da753afae3731365ec8591921118a0..796cad1106522764cc23d2d7333c6ead05c7f0c8 100644 (file)
@@ -267,6 +267,11 @@ PKG_CHECK_MODULES([ELEMENTARY_PC], [${requirement_elm_pc_only}])
 EFL_ENABLE_EO_API_SUPPORT
 EFL_ENABLE_BETA_API_SUPPORT
 
+# To probe Tizen profile at runtime
+PKG_CHECK_MODULES(CAPI_SYSTEM_INFO, capi-system-info)
+AC_SUBST(CAPI_SYSTEM_INFO_CFLAGS)
+AC_SUBST(CAPI_SYSTEM_INFO_LIBS)
+
 
 if test "x${HAVE_CXX11}" = "x1" -a "x${want_cxx11}" = "xyes"; then
    PKG_CHECK_MODULES([ELEMENTARY_CXX],
index 1a6154cb2324b7c10a49f9ef2ac88b6d90d94b6c..13842c6c5894df32cb9617a8f3ab02bade13e41d 100644 (file)
@@ -54,6 +54,9 @@ BuildRequires:  pkgconfig(ttrace)
 #TINEN ONLY(20160425) : Support Mobile target language.
 BuildRequires:  pkgconfig(icu-i18n)
 #
+# Workaround2: Distinguish Tizen Profile at Runtime.
+BuildRequires:  pkgconfig(capi-system-info)
+# Please remove this workaround after refactoring.
 
 Recommends:     %{name}-locale = %{version}
 
index 4341d0c616cf70f6887800d2395229aeb395261b..a9f8085fba9ffceb14e0cb4e7a9a6e1c6dd78445 100644 (file)
@@ -24,6 +24,7 @@ AM_CPPFLAGS = \
 -DICON_DIR=\"$(datadir)/icons\" \
 -DELM_TOP_BUILD_DIR=\"$(top_builddir)\" \
 -DELEMENTARY_BUILD \
+@CAPI_SYSTEM_INFO_CFLAGS@ \
 @ELEMENTARY_CFLAGS@
 
 AM_CPPFLAGS += $(DEFAULT_CFLAGS) $(TTRACE_CPPFLAGS)
@@ -498,6 +499,7 @@ tizen_vector.c
 
 libelementary_la_CFLAGS = @ELEMENTARY_CFLAGS@
 libelementary_la_LIBADD = \
+@CAPI_SYSTEM_INFO_LIBS@ \
 @ELEMENTARY_LIBS@ \
 @LTLIBINTL@ \
 $(TTRACE_LIBS)
index d9d9d090e7c8f2ada6ae24f3b5d2aacfa3b413f2..c36fac506d2f691e0ad8a154095571acc9c89aaf 100644 (file)
@@ -117,9 +117,7 @@ static void _magnifier_create(void *data);
 static void _magnifier_show(void *data);
 static void _magnifier_hide(void *data);
 static void _magnifier_move(void *data, Evas_Coord x, Evas_Coord y);
-#ifndef TIZEN_PROFILE_WEARABLE
 static void _menu_call(Evas_Object *obj);
-#endif
 static void _hover_cancel_cb(void *data, Evas_Object *obj, void *event_info);
 static void _copy_cb(void *data, Evas_Object *obj, void *event_info);
 static void _cut_cb(void *data, Evas_Object *obj, void *event_info);
@@ -130,6 +128,30 @@ static Evas_Coord_Rectangle _layout_region_get(Evas_Object *obj);
 static Eina_Bool _action_activate(Evas_Object *obj, const char *params);
 //
 
+/* For Tizen Profile (wearable) Recognition */
+#include <system_info.h>
+static char tizen_profile_wearable = -1; /* Unknown */
+static char probe_tizen_profile_wearable()
+{
+   char *profileName;
+   if (tizen_profile_wearable != -1)
+     return tizen_profile_wearable;
+
+   system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+   switch (*profileName) {
+   case 'w':
+   case 'W':
+     tizen_profile_wearable = 1;
+     break;
+   default: // common or unknown ==> ALL ARE COMMON.
+     tizen_profile_wearable = 0;
+   }
+   free(profileName);
+
+   return tizen_profile_wearable;
+}
+#define TIZEN_PROFILE_WEARABLE (__builtin_expect(tizen_profile_wearable != -1, 1)?tizen_profile_wearable:probe_tizen_profile_wearable())
+
 //TIZEN ONLY (20160926): cbhm client for multi entry
 #ifdef HAVE_ELEMENTARY_WAYLAND
 static void
@@ -463,11 +485,10 @@ _cursor_handler_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EI
    sd->cursor_handler_down = EINA_FALSE;
    if (_elm_config->magnifier_enable)
      _magnifier_hide(data);
-#ifndef TIZEN_PROFILE_WEARABLE
-   if ((!_elm_config->context_menu_disabled) &&
+   if (!TIZEN_PROFILE_WEARABLE &&
+       (!_elm_config->context_menu_disabled) &&
        (!_elm_config->desktop_entry))
      _menu_call(data);
-#endif
 }
 
 static void
@@ -630,12 +651,10 @@ _select_all(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUS
         edje_object_part_text_select_extend(sd->entry_edje, "elm.text");
      }
    sd->have_selection = EINA_TRUE;
-#ifndef TIZEN_PROFILE_WEARABLE
-   _menu_call(data);
-#endif
+   if (!TIZEN_PROFILE_WEARABLE)
+     _menu_call(data);
 }
 
-#ifndef TIZEN_PROFILE_WEARABLE
 static void
 _adjust_eol_cursor(Evas_Object *obj)
 {
@@ -663,7 +682,6 @@ _adjust_eol_cursor(Evas_Object *obj)
         evas_textblock_cursor_free(cp);
      }
 }
-#endif
 
 static Eina_Bool
 _cursor_coordinate_check(Evas_Object *obj, Evas_Coord canvasx)
@@ -706,9 +724,9 @@ _cursor_down_pos_set(Evas_Object *obj)
 static void
 _select_word(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
 {
-#ifdef TIZEN_PROFILE_WEARABLE
-   return;
-#else
+   if (TIZEN_PROFILE_WEARABLE)
+     return;
+
    ELM_ENTRY_DATA_GET(data, sd);
 
    const Evas_Object *tb = NULL;
@@ -755,7 +773,6 @@ _select_word(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
    if (!_elm_config->desktop_entry)
         edje_object_part_text_select_allow_set(sd->entry_edje, "elm.text",
                                                EINA_FALSE);
-#endif
 }
 
 static void
@@ -863,7 +880,6 @@ EAPI void elm_entry_extension_module_data_get(Evas_Object *obj, Elm_Entry_Extens
 /////////////////////////////////////////////////////////////////
 
 
-#ifndef TIZEN_PROFILE_WEARABLE
 static Mod_Api *
 _module_find(Evas_Object *obj EINA_UNUSED)
 {
@@ -899,7 +915,6 @@ _module_find(Evas_Object *obj EINA_UNUSED)
 ok: // ok - return api
    return m->api;
 }
-#endif
 
 static char *
 _file_load(const char *file)
@@ -2400,7 +2415,6 @@ _hoversel_position(Evas_Object *obj)
    evas_object_resize(sd->hoversel, cw, ch);
 }
 
-#ifndef TIZEN_PROFILE_WEARABLE
 static void
 _hover_del_job(void *data)
 {
@@ -2458,7 +2472,6 @@ _hover_selected_cb(void *data,
    if (!_elm_config->desktop_entry)
      elm_widget_scroll_hold_push(data);
 }
-#endif
 
 static char *
 _item_tags_remove(const char *str)
@@ -2648,7 +2661,6 @@ _hover_cancel_cb(void *data,
    edje_object_part_text_select_none(sd->entry_edje, "elm.text");
 }
 
-#ifndef TIZEN_PROFILE_WEARABLE
 static void
 _hover_item_clicked_cb(void *data,
                        Evas_Object *obj EINA_UNUSED,
@@ -2792,7 +2804,6 @@ _menu_call(Evas_Object *obj)
           }
      }
 }
-#endif
 
 static void _magnifier_move(void *data, Evas_Coord cx, Evas_Coord cy);
 
@@ -3014,22 +3025,20 @@ _long_press_cb(void *data)
                   _select_word(data, NULL, NULL);
                   elm_widget_scroll_freeze_push(data);
                }
-#ifndef TIZEN_PROFILE_WEARABLE
-             if (!_elm_config->context_menu_disabled &&
+             if (!TIZEN_PROFILE_WEARABLE &&
+                !_elm_config->context_menu_disabled &&
                  !_elm_config->desktop_entry)
                {
                   _menu_call(data);
                }
-#endif
           }
         //
-#ifndef TIZEN_PROFILE_WEARABLE
         /* Context menu will not appear if context menu disabled is set
          * as false on a long press callback */
-        else if (!_elm_config->context_menu_disabled &&
+        else if (!TIZEN_PROFILE_WEARABLE &&
+                !_elm_config->context_menu_disabled &&
                  !_elm_config->desktop_entry)
           _menu_call(data);
-#endif
      }
 
    //sd->long_pressed = EINA_TRUE;
@@ -3051,9 +3060,7 @@ _key_down_cb(void *data,
                Evas_Object *obj EINA_UNUSED,
                void *event_info EINA_UNUSED)
 {
-#ifndef TIZEN_PROFILE_WEARABLE
    Evas_Event_Key_Down *ev = event_info;
-#endif
 
    // TIZEN ONLY (20150205): Support CopyPasteUI
    ELM_ENTRY_DATA_GET(data, sd);
@@ -3062,10 +3069,9 @@ _key_down_cb(void *data,
    //
    /* First check if context menu disabled is false or not, and
     * then check for key id */
-#ifndef TIZEN_PROFILE_WEARABLE
-   if ((!_elm_config->context_menu_disabled) && !strcmp(ev->key, "Menu"))
+   if (!TIZEN_PROFILE_WEARABLE &&
+       (!_elm_config->context_menu_disabled) && !strcmp(ev->key, "Menu"))
      _menu_call(data);
-#endif
 }
 
 static void
@@ -3097,9 +3103,8 @@ _mouse_down_cb(void *data,
         if (_elm_config->desktop_entry)
           {
              sd->use_down = 1;
-#ifndef TIZEN_PROFILE_WEARABLE
-             _menu_call(data);
-#endif
+             if (!TIZEN_PROFILE_WEARABLE)
+               _menu_call(data);
           }
      }
 }
@@ -3152,9 +3157,8 @@ _mouse_up_cb(void *data,
                _magnifier_hide(data);
         //
              // TIZEN ONLY (20150603): CopyPasteUI 2.4
-#ifndef TIZEN_PROFILE_WEARABLE
              Eina_Bool popup_showing = EINA_FALSE;
-#endif
+
              if (elm_widget_scroll_freeze_get(data))
                elm_widget_scroll_freeze_pop(data);
              if (sd->have_selection)
@@ -3164,15 +3168,15 @@ _mouse_up_cb(void *data,
                   else
                     elm_entry_select_none(data);
                }
-#ifndef TIZEN_PROFILE_WEARABLE
-             if ((sd->api) && (sd->api->obj_popup_showing_get))
-               popup_showing = sd->api->obj_popup_showing_get(data);
-             if ((!_elm_config->context_menu_disabled) &&
-                 (!popup_showing))
-               {
-                  _menu_call(data);
-               }
-#endif
+             if (!TIZEN_PROFILE_WEARABLE) {
+               if ((sd->api) && (sd->api->obj_popup_showing_get))
+                 popup_showing = sd->api->obj_popup_showing_get(data);
+               if ((!_elm_config->context_menu_disabled) &&
+                   (!popup_showing))
+                 {
+                    _menu_call(data);
+                 }
+             }
              //
           }
         else
@@ -3228,9 +3232,8 @@ _mouse_up_cb(void *data,
             (!_elm_config->desktop_entry))
      {
          sd->use_down = 1;
-#ifndef TIZEN_PROFILE_WEARABLE
-         _menu_call(data);
-#endif
+         if (!TIZEN_PROFILE_WEARABLE)
+          _menu_call(data);
      }
 }
 
@@ -4890,11 +4893,10 @@ _start_handler_mouse_up_cb(void *data,
    if ((!_elm_config->context_menu_disabled) &&
        (!_elm_config->desktop_entry) && (sd->long_pressed))
      */
-#ifndef TIZEN_PROFILE_WEARABLE
-   if ((!_elm_config->context_menu_disabled) &&
+   if (!TIZEN_PROFILE_WEARABLE &&
+       (!_elm_config->context_menu_disabled) &&
        (!_elm_config->desktop_entry))
      _menu_call(data);
-#endif
    if (!_elm_config->desktop_entry)
         edje_object_part_text_select_allow_set(sd->entry_edje, "elm.text",
                                                EINA_FALSE);
@@ -5098,11 +5100,10 @@ _end_handler_mouse_up_cb(void *data,
        (!_elm_config->desktop_entry) && (sd->long_pressed))
      _menu_call(data);
     */
-#ifndef TIZEN_PROFILE_WEARABLE
-   if ((!_elm_config->context_menu_disabled) &&
+   if (!TIZEN_PROFILE_WEARABLE &&
+       (!_elm_config->context_menu_disabled) &&
        (!_elm_config->desktop_entry))
      _menu_call(data);
-#endif
    if (!_elm_config->desktop_entry)
         edje_object_part_text_select_allow_set(sd->entry_edje, "elm.text",
                                                EINA_FALSE);
@@ -5200,11 +5201,7 @@ _elm_entry_evas_object_smart_add(Eo *obj, Elm_Entry_Data *priv)
    priv->context_menu = EINA_TRUE;
    priv->auto_save = EINA_TRUE;
    priv->editable = EINA_TRUE;
-#ifdef TIZEN_PROFILE_WEARABLE
-   priv->sel_allow = EINA_FALSE;
-#else
-   priv->sel_allow = EINA_TRUE;
-#endif
+   priv->sel_allow = (TIZEN_PROFILE_WEARABLE) ? EINA_FALSE : EINA_TRUE;
 
    priv->drop_format = ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE;
    /////////////////////////////////////////////////////////////////
@@ -5339,12 +5336,13 @@ _elm_entry_evas_object_smart_add(Eo *obj, Elm_Entry_Data *priv)
 
    entries = eina_list_prepend(entries, obj);
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   // module - find module for entry
-   priv->api = _module_find(obj);
-   // if found - hook in
-   if ((priv->api) && (priv->api->obj_hook)) priv->api->obj_hook(obj);
-#endif
+   if (!TIZEN_PROFILE_WEARABLE)
+    {
+     // module - find module for entry
+     priv->api = _module_find(obj);
+     // if found - hook in
+     if ((priv->api) && (priv->api->obj_hook)) priv->api->obj_hook(obj);
+    }
 
    _mirrored_set(obj, elm_widget_mirrored_get(obj));
 
index 78d3442be174e76ded057e50d924c5f2eefa9742..d8e1badb23209b7ebe0d0a6c4845ea61f64b2b09 100644 (file)
@@ -209,8 +209,31 @@ typedef struct _Size_Cache {
 } Size_Cache;
 
 
+/* For Tizen Profile (wearable) Recognition */
+#include <system_info.h>
+static char tizen_profile_wearable = -1; /* Unknown */
+static char probe_tizen_profile_wearable()
+{
+   char *profileName;
+   if (tizen_profile_wearable != -1)
+     return tizen_profile_wearable;
+
+   system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+   switch (*profileName) {
+   case 'w':
+   case 'W':
+     tizen_profile_wearable = 1;
+     break;
+   default: // common or unknown ==> ALL ARE COMMON.
+     tizen_profile_wearable = 0;
+   }
+   free(profileName);
+
+   return tizen_profile_wearable;
+}
+#define TIZEN_PROFILE_WEARABLE (__builtin_expect(tizen_profile_wearable != -1, 1)?tizen_profile_wearable:probe_tizen_profile_wearable())
+
 // TIZEN ONLY : for banded ux
-#ifndef TIZEN_PROFILE_WEARABLE
 static void
 _banded_item_bg_add(Elm_Gen_Item *it, Evas_Object *target)
 {
@@ -329,7 +352,6 @@ _banded_item_bg_index_color_set(Elm_Gen_Item *it_top, Evas_Coord ox, Evas_Coord
         i = i + 1;
      }
 }
-#endif
 
 static void
 _item_content_free(Evas_Object *content)
@@ -1292,15 +1314,16 @@ _item_unrealize(Elm_Gen_Item *it,
    _view_clear(VIEW(it), NULL);
 
 // TIZEN ONLY : for banded ux
-#ifndef TIZEN_PROFILE_WEARABLE
-   if (GL_IT(it)->banded_bg)
-     ELM_SAFE_FREE(GL_IT(it)->banded_bg, evas_object_del);
-   if (GL_IT(it)->wsd->banded_bg_on)
+   if (!TIZEN_PROFILE_WEARABLE)
      {
-        if (it->item->banded_anim) ecore_animator_del(it->item->banded_anim);
-        it->item->banded_anim = NULL;
+       if (GL_IT(it)->banded_bg)
+         ELM_SAFE_FREE(GL_IT(it)->banded_bg, evas_object_del);
+       if (GL_IT(it)->wsd->banded_bg_on)
+         {
+            if (it->item->banded_anim) ecore_animator_del(it->item->banded_anim);
+            it->item->banded_anim = NULL;
+         }
      }
-#endif
 
    if (GL_IT(it)->highlight_timer)
      {
@@ -1878,10 +1901,8 @@ _item_realize(Elm_Gen_Item *it,
      edje_object_signal_emit(VIEW(it), SIGNAL_ENABLED, "elm");
    if (it->selected)
      {
-#ifndef TIZEN_PROFILE_WEARABLE
-        if (sd->banded_bg_on)
+        if (!TIZEN_PROFILE_WEARABLE && sd->banded_bg_on)
           _banded_item_bg_color_change(it, EINA_TRUE);
-#endif
         edje_object_signal_emit(VIEW(it), SIGNAL_HIGHLIGHTED, "elm");
         evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, EO_OBJ(it));
      }
@@ -1934,9 +1955,7 @@ _item_realize(Elm_Gen_Item *it,
              elm_interface_atspi_accessible_children_changed_added_signal_emit(sd->obj, EO_OBJ(it));
           }
         //
-#ifndef TIZEN_PROFILE_WEARABLE
-        _banded_item_bg_add(it, VIEW(it));
-#endif
+        if (!TIZEN_PROFILE_WEARABLE) _banded_item_bg_add(it, VIEW(it));
         // Register accessibility before realized callback
         // because user can customize accessibility.
         _access_widget_item_register(it);
@@ -2091,12 +2110,11 @@ _reorder_calc(Elm_Gen_Item *it, Elm_Genlist_Data *sd)
                                                                       + REORDER_FASTER, ow, oh));
      }
 
-#ifdef TIZEN_PROFILE_WEARABLE
-     _item_all_position(it, GL_IT(it)->scrl_x - REORDERED_ITEM_OFFSET,
-                       GL_IT(it)->scrl_y - REORDERED_ITEM_OFFSET);
-#else
-     _item_all_position(it, GL_IT(it)->scrl_x, GL_IT(it)->scrl_y - REORDERED_ITEM_OFFSET);
-#endif
+     if (TIZEN_PROFILE_WEARABLE)
+       _item_all_position(it, GL_IT(it)->scrl_x - REORDERED_ITEM_OFFSET,
+                         GL_IT(it)->scrl_y - REORDERED_ITEM_OFFSET);
+     else
+       _item_all_position(it, GL_IT(it)->scrl_x, GL_IT(it)->scrl_y - REORDERED_ITEM_OFFSET);
 
    if (it->deco_all_view)
       evas_object_raise(it->deco_all_view);
@@ -2226,9 +2244,7 @@ _item_block_realize(Item_Block *itb, Eina_Bool force)
    Elm_Genlist_Data *sd = itb->sd;
    Elm_Gen_Item *it;
    Elm_Gen_Item *aligned_item = NULL;
-#ifndef TIZEN_PROFILE_WEARABLE
    Elm_Gen_Item *top_drawn_item = NULL;
-#endif
    const Eina_List *l, *ll;
    Evas_Object *content;
    Eina_Bool unrealize = EINA_TRUE;
@@ -2284,9 +2300,8 @@ _item_block_realize(Item_Block *itb, Eina_Bool force)
         GL_IT(it)->w = sd->minw;
         GL_IT(it)->h = GL_IT(it)->minh;
 
-#ifndef TIZEN_PROFILE_WEARABLE
         //Kiran only
-        if (!top_drawn_item)
+        if (!TIZEN_PROFILE_WEARABLE && !top_drawn_item)
           {
              if (GL_IT(it)->scrl_y <= oy && ELM_RECTS_INTERSECT(GL_IT(it)->scrl_x, GL_IT(it)->scrl_y,
                                                                 GL_IT(it)->w, GL_IT(it)->h, ox, oy, ow, oh))
@@ -2295,7 +2310,6 @@ _item_block_realize(Item_Block *itb, Eina_Bool force)
                   sd->top_drawn_item = top_drawn_item;
                }
           }
-#endif
         if (wsd->scroll_item_align_enable)
           {
              if (!sd->aligned_item)
@@ -2347,10 +2361,8 @@ _item_block_realize(Item_Block *itb, Eina_Bool force)
 
    itb->realized = EINA_TRUE;
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   if (sd->banded_bg_on)
+   if (!TIZEN_PROFILE_WEARABLE && sd->banded_bg_on)
      _banded_item_bg_index_color_set(sd->top_drawn_item, ox, oy, ow, oh);
-#endif
 
    if (aligned_item)
      {
@@ -2501,8 +2513,7 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj, Elm_Genlist_Pan_Data *psd)
    psd->wsd->blocks_realized = realized_new;
 
 // TIZEN_ONLY(20150701) : banded color background feature. enabled only un-scrollable
-#ifndef TIZEN_PROFILE_WEARABLE
-   if (psd->wsd->banded_bg_rect && !psd->wsd->reorder.it)
+   if (!TIZEN_PROFILE_WEARABLE && psd->wsd->banded_bg_rect && !psd->wsd->reorder.it)
      {
         Evas_Coord bg_x, bg_y, bg_w, bg_h, svy, svh;
         Elm_Gen_Item *tmp = NULL, *prev = NULL;
@@ -2591,7 +2602,6 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj, Elm_Genlist_Pan_Data *psd)
              evas_object_show(psd->wsd->banded_bg_rect);
           }
      }
-#endif
 // TIZEN_ONLY
 
    if (psd->wsd->comp_y)
@@ -2893,7 +2903,6 @@ static void _item_focused(Elm_Gen_Item *it, Elm_Genlist_Item_Scrollto_Type type)
      elm_interface_atspi_accessible_active_descendant_changed_signal_emit(WIDGET(it), EO_OBJ(it));
 }
 
-#ifndef TIZEN_PROFILE_WEARABLE
 static Eina_Bool
 _banded_item_highlight_anim(void *data, double pos)
 {
@@ -2922,7 +2931,6 @@ _banded_item_highlight_anim(void *data, double pos)
 
    return EINA_TRUE;
 }
-#endif
 
 static void
 _item_highlight(Elm_Gen_Item *it)
@@ -2952,13 +2960,11 @@ _item_highlight(Elm_Gen_Item *it)
 
    if (!it->realized) goto end;
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   if (sd->banded_bg_on)
+   if (!TIZEN_PROFILE_WEARABLE && sd->banded_bg_on)
      {
         if (it->item->banded_anim) ecore_animator_del(it->item->banded_anim);
         it->item->banded_anim = ecore_animator_timeline_add(ELM_ITEM_HIGHLIGHT_TIMER, _banded_item_highlight_anim, it);
      }
-#endif
    if (it->deco_all_view)
      {
         edje_object_signal_emit(it->deco_all_view, SIGNAL_HIGHLIGHTED, "elm");
@@ -3007,18 +3013,19 @@ _item_unhighlight(Elm_Gen_Item *it, Eina_Bool effect EINA_UNUSED)
 
    if (!it->realized) goto end;
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   if (GL_IT(it)->wsd->banded_bg_on && effect)
-     {
-        if (it->item->banded_anim) ecore_animator_del(it->item->banded_anim);
-        it->item->banded_anim = ecore_animator_timeline_add(ELM_ITEM_HIGHLIGHT_TIMER, _banded_item_highlight_anim, it);
-     }
-   else
-     {
-        if (it->item->banded_anim) ELM_SAFE_FREE(it->item->banded_anim, ecore_animator_del);
-        _banded_item_bg_color_change(it, EINA_FALSE);
-     }
-#endif
+   if (!TIZEN_PROFILE_WEARABLE)
+    {
+     if (GL_IT(it)->wsd->banded_bg_on && effect)
+       {
+          if (it->item->banded_anim) ecore_animator_del(it->item->banded_anim);
+          it->item->banded_anim = ecore_animator_timeline_add(ELM_ITEM_HIGHLIGHT_TIMER, _banded_item_highlight_anim, it);
+       }
+     else
+       {
+          if (it->item->banded_anim) ELM_SAFE_FREE(it->item->banded_anim, ecore_animator_del);
+          _banded_item_bg_color_change(it, EINA_FALSE);
+       }
+    }
    if (it->deco_all_view)
      edje_object_signal_emit(it->deco_all_view, SIGNAL_UNHIGHLIGHTED, "elm");
    edje_object_signal_emit(VIEW(it), SIGNAL_UNHIGHLIGHTED, "elm");
@@ -4130,9 +4137,7 @@ _elm_genlist_elm_widget_theme_apply(Eo *obj, Elm_Genlist_Data *sd)
    eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
    if (!int_ret) return ELM_THEME_APPLY_FAILED;
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   _banded_bg_state_check(obj, sd);
-#endif
+   if (!TIZEN_PROFILE_WEARABLE) _banded_bg_state_check(obj, sd);
 
    EINA_INLIST_FOREACH(sd->blocks, itb)
      {
@@ -4532,9 +4537,7 @@ _long_press_cb(void *data)
         eo_do(sd->obj, elm_interface_scrollable_bounce_allow_set
                     (EINA_FALSE, EINA_FALSE));
 
-#ifdef TIZEN_PROFILE_WEARABLE
-        if (sd->decorate_all_mode)
-#endif
+        if (!TIZEN_PROFILE_WEARABLE || sd->decorate_all_mode)
           edje_object_signal_emit(VIEW(it), SIGNAL_REORDER_ENABLED, "elm");
 
         sd->reorder.it = it;
@@ -5306,7 +5309,8 @@ _item_mouse_up_cb(void *data,
      }
    else if (sd->reorder.it == it)
      {
-#ifdef TIZEN_PROFILE_WEARABLE
+      if (TIZEN_PROFILE_WEARABLE)
+       {
         Elm_Gen_Item *it2, *it_max = NULL, *it_min = NULL;
         Evas_Coord r_y_scrl, it_y_max = -99999999, it_y_min = 99999999;
 
@@ -5347,7 +5351,7 @@ _item_mouse_up_cb(void *data,
              _item_move_before(it, it_min);
              evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, EO_OBJ(it));
           }
-#else
+       } else {
 //Kiran only
         Elm_Gen_Item *moved_it = NULL;
         Elm_Gen_Item *ptr_it = sd->top_drawn_item;
@@ -5409,7 +5413,7 @@ _item_mouse_up_cb(void *data,
              _item_move_before(it, moved_it);
              evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, EO_OBJ(it));
           }
-#endif
+       }
         sd->reorder.it = NULL;
         sd->reorder.dir = 0;
         if (sd->reorder.anim)
@@ -5478,9 +5482,7 @@ _item_update(Elm_Gen_Item *it)
    else if (GL_IT(it)->deco_it_view)
      _view_inflate(GL_IT(it)->deco_it_view, it, &(GL_IT(it)->deco_it_contents));
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   _banded_item_bg_add(it, VIEW(it));
-#endif
+   if (!TIZEN_PROFILE_WEARABLE) _banded_item_bg_add(it, VIEW(it));
    if (it->selected)
       evas_object_smart_callback_call(WIDGET(it), SIG_HIGHLIGHTED, EO_OBJ(it));
 
@@ -5933,17 +5935,17 @@ _elm_genlist_evas_object_smart_del(Eo *obj, Elm_Genlist_Data *sd)
 EOLIAN static void
 _elm_genlist_evas_object_smart_move(Eo *obj, Elm_Genlist_Data *sd, Evas_Coord x, Evas_Coord y)
 {
-#ifndef TIZEN_PROFILE_WEARABLE
    Evas_Coord ox, oy, bg_x, bg_y;
-   evas_object_geometry_get(obj, &ox, &oy, NULL, NULL);
-   evas_object_geometry_get(sd->banded_bg_rect, &bg_x, &bg_y, NULL, NULL);
-#endif
+   if (!TIZEN_PROFILE_WEARABLE)
+    {
+     evas_object_geometry_get(obj, &ox, &oy, NULL, NULL);
+     evas_object_geometry_get(sd->banded_bg_rect, &bg_x, &bg_y, NULL, NULL);
+    }
    eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
    evas_object_move(sd->hit_rect, x, y);
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   evas_object_move(sd->banded_bg_rect, (bg_x + x - ox), (bg_y + y - oy));
-#endif
+   if (!TIZEN_PROFILE_WEARABLE)
+     evas_object_move(sd->banded_bg_rect, (bg_x + x - ox), (bg_y + y - oy));
 }
 
 EOLIAN static void
@@ -6020,9 +6022,7 @@ _elm_genlist_evas_object_smart_add(Eo *obj, Elm_Genlist_Data *priv)
 
    elm_layout_theme_set(obj, "genlist", "base", elm_widget_style_get(obj));
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   _banded_bg_state_check(obj, priv);
-#endif
+   if (!TIZEN_PROFILE_WEARABLE) _banded_bg_state_check(obj, priv);
 
    /* interface's add() routine issued AFTER the object's smart_add() */
    eo_do(obj, elm_interface_scrollable_objects_set(wd->resize_obj, priv->hit_rect));
@@ -6057,10 +6057,8 @@ _elm_genlist_evas_object_smart_add(Eo *obj, Elm_Genlist_Data *priv)
    priv->highlight = EINA_TRUE;
    priv->fx_mode = EINA_FALSE;
    priv->on_hold = EINA_FALSE;
-#ifndef TIZEN_PROFILE_WEARABLE
    //Kiran only
    priv->top_drawn_item = NULL;
-#endif
    priv->pan_obj = eo_add(MY_PAN_CLASS, evas_object_evas_get(obj));
    pan_data = eo_data_scope_get(priv->pan_obj, MY_PAN_CLASS);
    eo_data_ref(obj, NULL);
@@ -6419,9 +6417,7 @@ failed:
 end:
    if (it == sd->key_down_item) sd->key_down_item = NULL;
    if (it == sd->highlighted_item) sd->highlighted_item = NULL;
-#ifndef TIZEN_PROFILE_WEARABLE
-   if (it == sd->top_drawn_item) sd->top_drawn_item = NULL;
-#endif
+   if (!TIZEN_PROFILE_WEARABLE && it == sd->top_drawn_item) sd->top_drawn_item = NULL;
 
    _item_unrealize(it, EINA_FALSE);
 
@@ -6456,13 +6452,11 @@ end:
    eo_del(EO_OBJ(it));
 
 // TIZEN_ONLY(20150703) : banded color background feature. enabled only un-scrollable
-#ifndef TIZEN_PROFILE_WEARABLE
-   if (sd->banded_bg_rect && !sd->items)
+   if (!TIZEN_PROFILE_WEARABLE && sd->banded_bg_rect && !sd->items)
      {
         evas_object_smart_member_del(sd->banded_bg_rect);
         ELM_SAFE_FREE(sd->banded_bg_rect, evas_object_del);
      }
-#endif
 
    _changed(sd->pan_obj);
 }
@@ -7053,13 +7047,11 @@ _elm_genlist_clear(Eo *obj, Elm_Genlist_Data *sd)
    if (sd->g_item) sd->g_item = NULL;
    if (sd->g_type) sd->g_type = NULL;
 
-#ifndef TIZEN_PROFILE_WEARABLE
-   if (sd->banded_bg_rect)
+   if (!TIZEN_PROFILE_WEARABLE && sd->banded_bg_rect)
      {
         evas_object_smart_member_del(sd->banded_bg_rect);
         ELM_SAFE_FREE(sd->banded_bg_rect, evas_object_del);
      }
-#endif
 }
 
 EOLIAN static void
@@ -8680,24 +8672,27 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
         evas_object_geometry_get(WIDGET(it), NULL, &wy, NULL, &wh);
         evas_object_geometry_get(VIEW(it), NULL, &y, NULL, &h);
         //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
-#ifndef TIZEN_PROFILE_WEARABLE
-        int res = _is_item_in_viewport(wy, wh, y, h);
+               if (!TIZEN_PROFILE_WEARABLE)
+                 {
+               int res = _is_item_in_viewport(wy, wh, y, h);
 
-        if (res > 0)
-          {
-             // new item is above current
-             elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
-          }
-        else if (res < 0)
-          {
-             // new item is below current
-             elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
-          }
-        else
-          elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
-#else
-        elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
-#endif
+               if (res > 0)
+            {
+               // new item is above current
+               elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
+            }
+          else if (res < 0)
+            {
+               // new item is below current
+               elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+            }
+          else
+            elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
+                 }
+               else
+                 {
+            elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+                 }
         //
       }
    else // if item is not realized we should search if we are over or below viewport
@@ -8705,24 +8700,27 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
         Eina_List *realized = elm_genlist_realized_items_get(WIDGET(it));
         if (realized)
           {
-#ifndef TIZEN_PROFILE_WEARABLE
-             int idx, top, bottom;
-
-             // index of realized element on top of viewport
-             eo_do(eina_list_nth(realized, 0), top = elm_obj_genlist_item_index_get());
-             // index of realized element on bottom of viewport
-             eo_do(eina_list_last_data_get(realized), bottom = elm_obj_genlist_item_index_get());
-             eo_do(eo_it, idx = elm_obj_genlist_item_index_get());
-             //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
-             if (idx < top)
-               elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
-             else if (idx > bottom)
-               elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+             if (!TIZEN_PROFILE_WEARABLE)
+               {
+                 int idx, top, bottom;
+
+                 // index of realized element on top of viewport
+                 eo_do(eina_list_nth(realized, 0), top = elm_obj_genlist_item_index_get());
+                 // index of realized element on bottom of viewport
+                 eo_do(eina_list_last_data_get(realized), bottom = elm_obj_genlist_item_index_get());
+                 eo_do(eo_it, idx = elm_obj_genlist_item_index_get());
+                 //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
+                 if (idx < top)
+                   elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
+                 else if (idx > bottom)
+                   elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+                 else
+                   elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
+               }
              else
-               elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_IN);
-#else
-             elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
-#endif
+               {
+                 elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+               }
              eina_list_free(realized);
           }
      }
index 379930a5dca486c697359421812aff0630247092..39b3d6341cda833001062605cdf67e26c8384d45 100644 (file)
@@ -11,6 +11,7 @@ AM_CPPFLAGS = \
 -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \
 -DPACKAGE_LIB_DIR=\"$(libdir)\" \
 -DELEMENTARY_BUILD \
+@CAPI_SYSTEM_INFO_CFLAGS@ \
 @ELEMENTARY_CFLAGS@
 
 pkgdir = $(pkglibdir)/modules/copypasteUI_ctxpopup/$(MODULE_ARCH)
@@ -19,6 +20,6 @@ pkg_LTLIBRARIES = module.la
 module_la_SOURCES = copypaste.c \
                     cbhm_helper.c
 
-module_la_LIBADD = @ELEMENTARY_LIBS@ $(top_builddir)/src/lib/libelementary.la
+module_la_LIBADD = @CAPI_SYSTEM_INFO_LIBS@ @ELEMENTARY_LIBS@ $(top_builddir)/src/lib/libelementary.la
 module_la_LDFLAGS = -no-undefined -module -avoid-version
 module_la_LIBTOOLFLAGS = --tag=disable-static
index 0fda844e34826092c511efa3cacb250544ade87e..fa69048e48bce19e3f834371fed9285cfd866ca2 100644 (file)
 #define LOG(x...) do { } while (0)
 #endif
 
+/* For Tizen Profile (wearable) Recognition */
+#include <system_info.h>
+static char tizen_profile_wearable = -1; /* Unknown */
+static char probe_tizen_profile_wearable()
+{
+   char *profileName;
+   if (tizen_profile_wearable != -1)
+     return tizen_profile_wearable;
+
+   system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+   switch (*profileName) {
+   case 'w':
+   case 'W':
+     tizen_profile_wearable = 1;
+     break;
+   default: // common or unknown ==> ALL ARE COMMON.
+     tizen_profile_wearable = 0;
+   }
+   free(profileName);
+
+   return tizen_profile_wearable;
+}
+#define TIZEN_PROFILE_WEARABLE (__builtin_expect(tizen_profile_wearable != -1, 1)?tizen_profile_wearable:probe_tizen_profile_wearable())
+
 Elm_Entry_Extension_data *ext_mod;
 static int _mod_hook_count = 0;
 static Evas_Coord _previous_pressed_point_x = -1;
@@ -851,7 +875,6 @@ _select_all(void *data, Evas_Object *obj, void *event_info)
    ext_mod->selectall(data, obj, event_info);
 }
 
-#ifndef TIZEN_PROFILE_WEARABLE
 static void
 _select(void *data, Evas_Object *obj, void *event_info)
 {
@@ -860,7 +883,6 @@ _select(void *data, Evas_Object *obj, void *event_info)
    _ctxpopup_hide(obj);
    ext_mod->select(data, obj, event_info);
 }
-#endif
 
 static void
 _paste(void *data, Evas_Object *obj, void *event_info)
@@ -1340,21 +1362,23 @@ obj_longpress(Evas_Object *obj)
                {
                  if (!ext_mod->password)
                   {
-#ifndef TIZEN_PROFILE_WEARABLE
-                   CP_ICON_ADD(icon, "select");
-                   added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT, icon, _select, obj);
-                   ACCESS_FOCUS_ENABLE();
-#endif
+                   if (!TIZEN_PROFILE_WEARABLE)
+                    {
+                     CP_ICON_ADD(icon, "select");
+                     added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT, icon, _select, obj);
+                     ACCESS_FOCUS_ENABLE();
+                    }
                    }
 
                    CP_ICON_ADD(icon, "select_all");
-#ifdef TIZEN_PROFILE_WEARABLE
-                   added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                          icon, _select_all, obj);
-#else
-                   added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT_ALL,
-                                                          icon, _select_all, obj);
-#endif
+                   if (TIZEN_PROFILE_WEARABLE)
+                    {
+                     added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                            icon, _select_all, obj);
+                    } else {
+                     added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT_ALL,
+                                                            icon, _select_all, obj);
+                    }
                    ACCESS_FOCUS_ENABLE();
                 }
 
@@ -1378,13 +1402,14 @@ obj_longpress(Evas_Object *obj)
 #endif
                          {
                             CP_ICON_ADD(icon, "paste");
-#ifdef TIZEN_PROFILE_WEARABLE
-                            added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                                  icon, _paste, obj);
-#else
-                            added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
-                                                                  icon, _paste, obj);
-#endif
+                            if (TIZEN_PROFILE_WEARABLE)
+                             {
+                              added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                                    icon, _paste, obj);
+                             } else {
+                              added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
+                                                                    icon, _paste, obj);
+                             }
                             ACCESS_FOCUS_ENABLE();
                          }
                     }
@@ -1393,13 +1418,14 @@ obj_longpress(Evas_Object *obj)
                        if (ext_mod->editable)
                          {
                             CP_ICON_ADD(icon, "paste");
-#ifdef TIZEN_PROFILE_WEARABLE
-                            added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                                  icon, _paste, obj);
-#else
-                            added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
-                                                                  icon, _paste, obj);
-#endif
+                            if (TIZEN_PROFILE_WEARABLE)
+                             {
+                              added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                                    icon, _paste, obj);
+                             } else {
+                              added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
+                                                                    icon, _paste, obj);
+                             }
                             ACCESS_FOCUS_ENABLE();
                          }
                     }
@@ -1413,13 +1439,14 @@ obj_longpress(Evas_Object *obj)
 #endif
                {
                   CP_ICON_ADD(icon, "clipboard");
-#ifdef TIZEN_PROFILE_WEARABLE
-                  added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                        icon, _clipboard_menu, obj);  // Clipboard
-#else
-                  added_item = elm_ctxpopup_item_append(ext_mod->popup, S_CLIPBOARD,
-                                                        icon, _clipboard_menu, obj);   // Clipboard
-#endif
+                  if (TIZEN_PROFILE_WEARABLE)
+                   {
+                    added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                          icon, _clipboard_menu, obj);  // Clipboard
+                   } else {
+                    added_item = elm_ctxpopup_item_append(ext_mod->popup, S_CLIPBOARD,
+                                                          icon, _clipboard_menu, obj);        // Clipboard
+                   }
                   ACCESS_FOCUS_ENABLE();
                }
              // end for cbhm
@@ -1444,37 +1471,40 @@ obj_longpress(Evas_Object *obj)
                    if (selected_all == EINA_FALSE)
                      {
                         CP_ICON_ADD(icon, "select_all");
-#ifdef TIZEN_PROFILE_WEARABLE
-                        added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                              icon, _select_all, obj);
-#else
-                        added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT_ALL,
-                                                              icon, _select_all, obj);
-#endif
+                        if (TIZEN_PROFILE_WEARABLE)
+                         {
+                          added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                                icon, _select_all, obj);
+                         } else {
+                          added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT_ALL,
+                                                                icon, _select_all, obj);
+                         }
                         ACCESS_FOCUS_ENABLE();
                      }
 
                    if (!ext_mod->password)
                      {
                         CP_ICON_ADD(icon, "copy");
-#ifdef TIZEN_PROFILE_WEARABLE
-                        added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                         icon, _copy, obj);
-#else
-                        added_item = elm_ctxpopup_item_append(ext_mod->popup, S_COPY,
-                                                         icon, _copy, obj);
-#endif
+                        if (TIZEN_PROFILE_WEARABLE)
+                         {
+                          added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                           icon, _copy, obj);
+                         } else {
+                          added_item = elm_ctxpopup_item_append(ext_mod->popup, S_COPY,
+                                                           icon, _copy, obj);
+                         }
                         ACCESS_FOCUS_ENABLE();
                         if (ext_mod->editable)
                           {
                              CP_ICON_ADD(icon, "cut");
-#ifdef TIZEN_PROFILE_WEARABLE
-                             added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                              icon, _cut, obj);
-#else
-                             added_item = elm_ctxpopup_item_append(ext_mod->popup, S_CUT,
-                                                              icon, _cut, obj);
-#endif
+                             if (TIZEN_PROFILE_WEARABLE)
+                              {
+                               added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                                icon, _cut, obj);
+                              } else {
+                               added_item = elm_ctxpopup_item_append(ext_mod->popup, S_CUT,
+                                                                icon, _cut, obj);
+                              }
                              ACCESS_FOCUS_ENABLE();
                           }
                      }
@@ -1495,26 +1525,28 @@ obj_longpress(Evas_Object *obj)
 #endif
                                {
                                   CP_ICON_ADD(icon, "paste");
-#ifdef TIZEN_PROFILE_WEARABLE
-                                  added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                                        icon, _paste, obj);
-#else
-                                  added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
-                                                                        icon, _paste, obj);
-#endif
+                                  if (TIZEN_PROFILE_WEARABLE)
+                                   {
+                                    added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                                          icon, _paste, obj);
+                                   } else {
+                                    added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
+                                                                          icon, _paste, obj);
+                                   }
                                   ACCESS_FOCUS_ENABLE();
                                }
                           }
                         else
                           {
                              CP_ICON_ADD(icon, "paste");
-#ifdef TIZEN_PROFILE_WEARABLE
-                             added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                                   icon, _paste, obj);
-#else
-                             added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
-                                                                   icon, _paste, obj);
-#endif
+                             if (TIZEN_PROFILE_WEARABLE)
+                              {
+                               added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                                     icon, _paste, obj);
+                              } else {
+                               added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
+                                                                     icon, _paste, obj);
+                              }
                              ACCESS_FOCUS_ENABLE();
                           }
                      }
@@ -1526,22 +1558,22 @@ obj_longpress(Evas_Object *obj)
                      {
                        if (!ext_mod->password)
                          {
-#ifndef TIZEN_PROFILE_WEARABLE
-                            CP_ICON_ADD(icon, "select");
-                            added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT,
-                                                              icon, _select, obj);
-                            ACCESS_FOCUS_ENABLE();
-#endif
-                          }
+                            if (!TIZEN_PROFILE_WEARABLE)
+                             {
+                              CP_ICON_ADD(icon, "select");
+                              added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT,
+                                                                icon, _select, obj);
+                              ACCESS_FOCUS_ENABLE();
+                             }
+                         }
 
                         CP_ICON_ADD(icon, "select_all");
-#ifdef TIZEN_PROFILE_WEARABLE
-                        added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                              icon, _select_all, obj);
-#else
-                        added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT_ALL,
-                                                              icon, _select_all, obj);
-#endif
+                        if (TIZEN_PROFILE_WEARABLE)
+                          added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                                icon, _select_all, obj);
+                        else
+                          added_item = elm_ctxpopup_item_append(ext_mod->popup, S_SELECT_ALL,
+                                                                icon, _select_all, obj);
                         ACCESS_FOCUS_ENABLE();
                      }
 #ifdef HAVE_ELEMENTARY_X
@@ -1565,26 +1597,24 @@ obj_longpress(Evas_Object *obj)
 #endif
                                     {
                                        CP_ICON_ADD(icon, "paste");
-#ifdef TIZEN_PROFILE_WEARABLE
-                                       added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                                             icon, _paste, obj);
-#else
-                                       added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
-                                                                             icon, _paste, obj);
-#endif
+                                       if (TIZEN_PROFILE_WEARABLE)
+                                         added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                                               icon, _paste, obj);
+                                       else
+                                         added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
+                                                                               icon, _paste, obj);
                                        ACCESS_FOCUS_ENABLE();
                                     }
                                 }
                                else
                                 {
                                     CP_ICON_ADD(icon, "paste");
-#ifdef TIZEN_PROFILE_WEARABLE
-                                    added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                                          icon, _paste, obj);
-#else
-                                    added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
-                                                                          icon, _paste, obj);
-#endif
+                                    if (TIZEN_PROFILE_WEARABLE)
+                                      added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                                            icon, _paste, obj);
+                                    else
+                                      added_item = elm_ctxpopup_item_append(ext_mod->popup, S_PASTE,
+                                                                            icon, _paste, obj);
                                     ACCESS_FOCUS_ENABLE();
                                 }
                          }
@@ -1599,13 +1629,12 @@ obj_longpress(Evas_Object *obj)
 #endif
                     {
                        CP_ICON_ADD(icon, "clipboard");
-#ifdef TIZEN_PROFILE_WEARABLE
-                       added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                             icon, _clipboard_menu, obj);
-#else
-                       added_item = elm_ctxpopup_item_append(ext_mod->popup, S_CLIPBOARD,
-                                                             icon, _clipboard_menu, obj);
-#endif
+                       if (TIZEN_PROFILE_WEARABLE)
+                         added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                               icon, _clipboard_menu, obj);
+                       else
+                         added_item = elm_ctxpopup_item_append(ext_mod->popup, S_CLIPBOARD,
+                                                               icon, _clipboard_menu, obj);
                        ACCESS_FOCUS_ENABLE();
                     }
                   // end for cbhm
@@ -1635,13 +1664,12 @@ obj_longpress(Evas_Object *obj)
                        else if (it->icon_type == ELM_ICON_STANDARD)
                          elm_icon_standard_set(ic, it->icon_file);
                     }
-#ifdef TIZEN_PROFILE_WEARABLE
-                  added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
-                                                        ic, _item_clicked, it );
-#else
-                  added_item = elm_ctxpopup_item_append(ext_mod->popup, it->label,
-                                                        ic, _item_clicked, it );
-#endif
+                  if (TIZEN_PROFILE_WEARABLE)
+                    added_item = elm_ctxpopup_item_append(ext_mod->popup, NULL,
+                                                          ic, _item_clicked, it );
+                  else
+                    added_item = elm_ctxpopup_item_append(ext_mod->popup, it->label,
+                                                          ic, _item_clicked, it );
                   ACCESS_FOCUS_ENABLE();
                }
           }