Remove unused code 05/286505/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 9 Jan 2023 03:09:10 +0000 (12:09 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 10 Jan 2023 01:36:57 +0000 (10:36 +0900)
Change-Id: Ic1b3225fa47f1a84b672dfa7649ccfbc848c71af
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
configure.ac
ism/demos/Makefile.am
ism/demos/isf_layout_efl.cpp
ism/extras/efl_immodule/Makefile.am
ism/extras/efl_panel/Makefile.am
ism/extras/efl_panel/isf_panel_efl.cpp

index 5582093..27ac1fe 100644 (file)
@@ -247,15 +247,6 @@ fi
 # Check EVAS
 PKG_CHECK_MODULES(EVAS, [evas])
 
-# Check ECORE X library
-PKG_CHECK_MODULES(ECOREX, [ecore-x],
-                  [ISF_HAS_ECOREX=yes],
-                  [ISF_HAS_ECOREX=no])
-
-if test "$ISF_HAS_ECOREX" = "yes"; then
-  AC_DEFINE(HAVE_ECOREX,1,[Have ecore-x functions.])
-fi
-
 # Check XKBCOMMON library
 PKG_CHECK_MODULES(XKBCOMMON, [xkbcommon])
 
@@ -308,15 +299,6 @@ PKG_CHECK_MODULES(NOTIFICATION, [notification],
 # Check system info library
 PKG_CHECK_MODULES(SYSTEM_INFO, [capi-system-info])
 
-# Check tts library
-PKG_CHECK_MODULES(TTS, [tts],
-                  [ISF_HAS_TTS=yes],
-                  [ISF_HAS_TTS=no])
-
-if test "$ISF_HAS_TTS" = "yes"; then
-  AC_DEFINE(HAVE_TTS,1,[Have TTS functions.])
-fi
-
 # Check cynara liblaries
 PKG_CHECK_MODULES(CYNARA, [cynara-client, cynara-creds-socket, cynara-session])
 
@@ -740,9 +722,6 @@ if test "$enable_panel_gtk" != "yes"; then
   SCIM_BUILD_GTK_UTILS=0
 fi
 
-AM_CONDITIONAL(HAVE_X,
-                [test "$have_x" = "yes"])
-
 if test "$enable_lazy_launch" = "yes"; then
   AC_DEFINE(ENABLE_LAZY_LAUNCH,1,[Launch ISF when focusing in entry])
   ISF_INSTALL_SYSTEMD_SCRIPT=0
index f2c9704..bd5b2bc 100644 (file)
@@ -46,15 +46,13 @@ isf_demo_efl_SOURCES  = isf_demo_efl.cpp \
                         isf_position_set_efl.cpp \
                         isf_manual_test_efl.cpp
 
-isf_demo_efl_CXXFLAGS = @ECOREX_CFLAGS@ \
-                        @ELEMENTARY_CFLAGS@ \
+isf_demo_efl_CXXFLAGS = @ELEMENTARY_CFLAGS@ \
                         @VCONF_CFLAGS@ \
                         @EFL_EXTENSION_CFLAGS@ \
                         @DLOG_CFLAGS@ \
                         -fPIE
 
 isf_demo_efl_LDFLAGS  = @LTLIBINTL@ -rpath $(libdir) \
-                        @ECOREX_LIBS@ \
                         @ELEMENTARY_LIBS@ \
                         @VCONF_LIBS@ \
                         @EFL_EXTENSION_LIBS@ \
index c92810c..7b73b99 100644 (file)
@@ -68,15 +68,6 @@ static struct _menu_item _menu_its[] = {
     { NULL, NULL, ELM_INPUT_PANEL_LAYOUT_NORMAL, 0 }
 };
 
-#ifndef WAYLAND
-static Ecore_Event_Handler *prop_handler = NULL;
-
-static void _back_key_cb (void *data, Evas_Object *obj, void *event_info)
-{
-    ecore_x_test_fake_key_press ("XF86Back");
-}
-#endif
-
 static void _rotate_cb (void *data, Evas_Object *obj, void *event_info)
 {
     struct appdata *ad = (struct appdata *)data;
@@ -170,40 +161,6 @@ _key_up_cb (void *data, Evas *e, Evas_Object *obj, void *event_info)
     LOGD ("[evas key up] capslock : %d, num lock : %d", evas_key_lock_is_set(ev->locks, "Caps_Lock"), evas_key_lock_is_set(ev->locks, "Num_Lock"));
 }
 
-#ifndef WAYLAND
-static void
-_print_keyboard_geometry (Ecore_X_Window xwin)
-{
-    int sx, sy, sw, sh;
-    Ecore_X_Window zone;
-
-    zone = ecore_x_e_illume_zone_get (xwin);
-
-    if (!ecore_x_e_illume_keyboard_geometry_get (zone, &sx, &sy, &sw, &sh))
-        sx = sy = sw = sh = 0;
-
-    LOGD ("Keyboard geometry x : %d, y : %d, w : %d, h : %d", sx, sy, sw, sh);
-}
-
-static Eina_Bool
-_prop_change_cb (void *data, int type, void *event)
-{
-    Ecore_X_Event_Window_Property *ev;
-    ev = (Ecore_X_Event_Window_Property *)event;
-    if (!ev) return ECORE_CALLBACK_PASS_ON;
-
-    if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE) {
-        LOGD ("[ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE] ");
-        _print_keyboard_geometry (ev->win);
-    } else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY) {
-        LOGD ("[ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY] ");
-        _print_keyboard_geometry (ev->win);
-    }
-
-    return ECORE_CALLBACK_PASS_ON;
-}
-#endif
-
 static void entry_changed_cb (void *data, Evas_Object *obj, void *event_info)
 {
     LOGD ("The text within the entry was changed.");
@@ -261,17 +218,6 @@ static Evas_Object *_create_ef_layout (Evas_Object *parent, const char *label, c
     return ef;
 }
 
-#ifndef WAYLAND
-static void
-_layout_del_cb (void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
-{
-    if (prop_handler) {
-        ecore_event_handler_del (prop_handler);
-        prop_handler = NULL;
-    }
-}
-#endif
-
 static Evas_Object * create_inner_layout (void *data)
 {
     struct appdata *ad = (struct appdata *)data;
@@ -292,25 +238,12 @@ static Evas_Object * create_inner_layout (void *data)
         ++idx;
     }
 
-#ifndef WAYLAND
-    /* create back key event generation button */
-    Evas_Object *back_key_btn = create_button (parent, "Generate BACK key");
-    evas_object_smart_callback_add (back_key_btn, "clicked", _back_key_cb, (void *)ad);
-    elm_box_pack_end (bx, back_key_btn);
-    elm_object_focus_allow_set (back_key_btn, EINA_FALSE);
-#endif
-
     /* Click to rotate button */
     Evas_Object *rotate_btn = create_button (parent, "rotate");
     elm_object_focus_allow_set (rotate_btn, EINA_FALSE);
     evas_object_smart_callback_add (rotate_btn, "clicked", _rotate_cb, (void *)ad);
     elm_box_pack_end (bx, rotate_btn);
 
-#ifndef WAYLAND
-    prop_handler = ecore_event_handler_add (ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change_cb, NULL);
-    evas_object_event_callback_add (bx, EVAS_CALLBACK_DEL, _layout_del_cb, NULL);
-#endif
-
     return bx;
 }
 
index 4ff9326..62e8c5b 100644 (file)
@@ -35,7 +35,6 @@ module_la_SOURCES  = isf_imf_module.cpp \
                      isf_imf_control.cpp
 
 module_la_CXXFLAGS = @ECORE_IMF_CFLAGS@ \
-                     @ECOREX_CFLAGS@ \
                      @ECORE_EVAS_CFLAGS@ \
                      @EVAS_CFLAGS@ \
                      @VCONF_CFLAGS@ \
@@ -48,7 +47,6 @@ module_la_LDFLAGS  = -rpath $(moduledir) \
 module_la_LIBADD   = -lstdc++ \
                      $(LD_VERSION_SCRIPT_OPTION) \
                      @ECORE_IMF_LIBS@ \
-                     @ECOREX_LIBS@ \
                      @ECORE_EVAS_LIBS@ \
                      @EVAS_LIBS@ \
                      @VCONF_LIBS@ \
index f081588..50c9395 100644 (file)
@@ -39,8 +39,7 @@ isf_panel_efl_SOURCES  += websocketserver.cpp
 endif
 endif
 
-isf_panel_efl_CXXFLAGS = @ECOREX_CFLAGS@ \
-                         @ECORE_WL_CFLAGS@ \
+isf_panel_efl_CXXFLAGS = @ECORE_WL_CFLAGS@ \
                          @ECORE_CFLAGS@ \
                          @ECORE_IMF_CFLAGS@ \
                          @EINA_CFLAGS@ \
@@ -48,7 +47,6 @@ isf_panel_efl_CXXFLAGS = @ECOREX_CFLAGS@ \
                          @X_CFLAGS@ \
                          @DLOG_CFLAGS@ \
                          @NOTIFICATION_CFLAGS@ \
-                         @TTS_CFLAGS@ \
                          @LIBWEBSOCKETS_CFLAGS@ \
                          @XKBCOMMON_CFLAGS@ \
                          @APP_CONTROL_CFLAGS@ \
@@ -59,7 +57,6 @@ isf_panel_efl_CXXFLAGS = @ECOREX_CFLAGS@ \
                          -fPIE
 
 isf_panel_efl_LDFLAGS  = @LTLIBINTL@ -rpath $(libdir) \
-                         @ECOREX_LIBS@ \
                          @ECORE_WL_LIBS@ \
                          @ECORE_LIBS@ \
                          @ECORE_IMF_LIBS@ \
@@ -68,7 +65,6 @@ isf_panel_efl_LDFLAGS  = @LTLIBINTL@ -rpath $(libdir) \
                          @X_LIBS@ \
                          @DLOG_LIBS@ \
                          @NOTIFICATION_LIBS@ \
-                         @TTS_LIBS@ \
                          @LIBWEBSOCKETS_LIBS@ \
                          @XKBCOMMON_LIBS@ \
                          @APP_CONTROL_LIBS@ \
index 9456597..e3dbc83 100644 (file)
 #ifdef HAVE_ECOREWL
 #include <Ecore_Wayland.h>
 #endif /* HAVE_ECOREWL */
-#ifdef HAVE_ECOREX
-#include <Ecore_X.h>
-#endif /* HAVE_ECOREX */
-#ifdef HAVE_X
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#endif /* HAVE_X */
-#ifdef HAVE_TTS
-#include <tts.h>
-#endif /* HAVE_TTS */
 #ifdef HAVE_FEEDBACK
 #include <feedback.h>
 #endif /* HAVE_FEEDBACK */
@@ -359,8 +349,6 @@ static int                _candidate_scroll_height_max      = 190;
 
 const  int                MORE_BUTTON_INDEX                 = -1;
 const  int                CLOSE_BUTTON_INDEX                = -2;
-const  int                INVALID_TTS_FOCUS_INDEX           = -100;
-static int                _candidate_tts_focus_index        = INVALID_TTS_FOCUS_INDEX;
 static uint32             _candidate_display_number         = 0;
 static std::vector<uint32> _candidate_row_items;
 static Evas_Object       *_tts_focus_rect                   = 0;
@@ -431,9 +419,6 @@ static Ecore_Timer       *_check_size_timer                 = NULL;
 static Ecore_Timer       *_longpress_timer                  = NULL;
 static Ecore_Timer       *_destroy_timer                    = NULL;
 #endif /* CANDIDATE */
-#ifdef HAVE_ECOREX
-static Ecore_Timer       *_off_prepare_done_timer           = NULL;
-#endif
 #if ISF_BUILD_CANDIDATE_UI
 static Ecore_Timer       *_candidate_hide_timer             = NULL;
 #endif /* CANDIDATE */
@@ -483,9 +468,6 @@ static NotificationData ise_selector_module_noti            = {"Select input met
 #endif
 
 #if ISF_BUILD_CANDIDATE_UI
-#ifdef HAVE_TTS
-static tts_h              _tts                              = NULL;
-#endif
 
 #ifdef HAVE_FEEDBACK
 static bool               feedback_initialized              = false;
@@ -2420,7 +2402,6 @@ static void ui_candidate_window_rotate (int angle)
     ui_candidate_window_adjust ();
     if (_candidate_area_1_visible) {
         update_table (ISF_CANDIDATE_TABLE, g_isf_candidate_table);
-        _candidate_tts_focus_index = INVALID_TTS_FOCUS_INDEX;
         ui_tts_focus_rect_hide ();
     }
     flush_memory ();
@@ -3084,118 +3065,6 @@ static void ui_mouse_moved_cb (void *data, Evas *e, Evas_Object *button, void *e
     }
 }
 
-#ifdef HAVE_TTS
-/**
- * @brief Open TTS device.
- *
- * @return false if open is failed, otherwise return true.
- */
-static bool ui_open_tts (void)
-{
-    SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
-
-    int r = tts_create (&_tts);
-    if (TTS_ERROR_NONE != r) {
-        LOGW ("tts_create FAILED : result (%d)", r);
-        _tts = NULL;
-        return false;
-    }
-
-    r = tts_set_mode (_tts, TTS_MODE_SCREEN_READER);
-    if (TTS_ERROR_NONE != r) {
-        LOGW ("tts_set_mode FAILED : result (%d)", r);
-    }
-
-    tts_state_e current_state;
-    r = tts_get_state (_tts, &current_state);
-    if (TTS_ERROR_NONE != r) {
-        LOGW ("tts_get_state FAILED : result (%d)", r);
-    }
-
-    if (TTS_STATE_CREATED == current_state)  {
-        r = tts_prepare (_tts);
-        if (TTS_ERROR_NONE != r) {
-            LOGW ("tts_prepare FAILED : ret (%d)", r);
-        }
-    }
-    return true;
-}
-
-/**
- * @brief Close TTS device.
- */
-static void ui_close_tts (void)
-{
-    SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
-
-    if (_tts) {
-        int r = tts_unprepare (_tts);
-        if (TTS_ERROR_NONE != r) {
-            LOGW ("tts_unprepare FAILED : result (%d)", r);
-        }
-
-        r = tts_destroy (_tts);
-        if (TTS_ERROR_NONE != r) {
-            LOGW ("tts_destroy FAILED : result (%d)", r);
-        }
-    }
-}
-
-/**
- * @brief Play string by TTS.
- *
- * @param str The string for playing.
- */
-static void ui_play_tts (const char* str)
-{
-    SCIM_DEBUG_MAIN (3) << __FUNCTION__ << " str=" << str << "\n";
-
-    if (!str) return;
-
-    if (_tts == NULL) {
-        if (!ui_open_tts ())
-            return;
-    }
-
-    int r;
-    int utt_id = 0;
-    tts_state_e current_state;
-
-    r = tts_get_state (_tts, &current_state);
-    if (TTS_ERROR_NONE != r) {
-        LOGW ("Fail to get state from TTS : ret (%d)", r);
-    }
-
-    if (TTS_STATE_PLAYING == current_state)  {
-        r = tts_stop (_tts);
-        if (TTS_ERROR_NONE != r) {
-            LOGW ("Fail to stop TTS : ret (%d)", r);
-        }
-    }
-
-    /* Get ISE language */
-    String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
-    String language = String ("en_US");
-    if (default_uuid.length () > 0) {
-        language = _ime_info[get_ise_index (default_uuid)].languages;
-        if (language.length () > 0) {
-            std::vector<String> ise_langs;
-            scim_split_string_list (ise_langs, language);
-            language = ise_langs[0];
-        }
-    }
-    LOGD ("TTS language:%s, str:%s", language.c_str (), str);
-
-    r = tts_add_text (_tts, str, language.c_str (), TTS_VOICE_TYPE_AUTO, TTS_SPEED_AUTO, &utt_id);
-    if (TTS_ERROR_NONE == r) {
-        r = tts_play (_tts);
-        if (TTS_ERROR_NONE != r) {
-            LOGW ("Fail to play TTS : ret (%d)", r);
-        }
-    }
-}
-#endif /* HAVE_TTS */
-
 /**
  * @brief Show rect for candidate focus object when screen reader is enabled.
  *
@@ -3257,99 +3126,6 @@ static void ui_candidate_scroller_stop_cb (void *data, Evas_Object *obj, void *e
     _wait_stop_event = false;
 }
 
-#ifdef HAVE_ECOREX
-/**
- * @brief Mouse over (find focus object and play text by TTS) when screen reader is enabled.
- *
- * @param mouse_x Mouse X position.
- * @param mouse_y Mouse Y position.
- */
-static void ui_mouse_over (int mouse_x, int mouse_y)
-{
-    SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
-    if (_candidate_window == NULL || _candidate_state != WINDOW_STATE_SHOW)
-        return;
-
-    int x, y, width, height;
-    for (int i = 0; i < SCIM_LOOKUP_TABLE_MAX_PAGESIZE; ++i) {
-        if (_candidate_0 [i]) {
-            evas_object_geometry_get (_candidate_0 [i], &x, &y, &width, &height);
-            if (mouse_x >= x && mouse_x <= x + width && mouse_y >= y && mouse_y <= y + height) {
-                /* FIXME: Should consider emoji case */
-                String mbs = utf8_wcstombs (g_isf_candidate_table.get_candidate_in_current_page (i));
-                SCIM_DEBUG_MAIN (3) << __FUNCTION__ << " play candidate string: " << mbs << "\n";
-#ifdef HAVE_TTS
-                ui_play_tts (mbs.c_str ());
-#endif
-                _candidate_tts_focus_index = i;
-                ui_tts_focus_rect_show (x, y, width, height);
-                return;
-            }
-        }
-    }
-
-    String strTts = String ("");
-    if (_candidate_area_2_visible) {
-        evas_object_geometry_get (_close_btn, &x, &y, &width, &height);
-        if (mouse_x >= x && mouse_x <= x + width && mouse_y >= y && mouse_y <= y + height) {
-            strTts = String (_("close button"));
-            _candidate_tts_focus_index = CLOSE_BUTTON_INDEX;
-            ui_tts_focus_rect_show (x, y, width, height);
-        }
-    } else {
-        evas_object_geometry_get (_more_btn, &x, &y, &width, &height);
-        if (mouse_x >= x && mouse_x <= x + width && mouse_y >= y && mouse_y <= y + height) {
-            strTts = String (_("more button"));
-            _candidate_tts_focus_index = MORE_BUTTON_INDEX;
-            ui_tts_focus_rect_show (x, y, width, height);
-        }
-    }
-#ifdef HAVE_TTS
-    if (strTts.length () > 0)
-        ui_play_tts (strTts.c_str ());
-#endif
-}
-
-/**
- * @brief Mouse click (find focus object and do click event) when screen reader is enabled.
- *
- * @param focus_index focused candidate index.
- */
-static void ui_mouse_click (int focus_index)
-{
-    SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
-    if (_candidate_window == NULL || _candidate_state != WINDOW_STATE_SHOW || focus_index == INVALID_TTS_FOCUS_INDEX)
-        return;
-
-    if (focus_index >= 0 && focus_index < g_isf_candidate_table.get_current_page_size ()) {
-        if (_candidate_0 [focus_index]) {
-            int x, y, width, height;
-            evas_object_geometry_get (_candidate_0 [focus_index], &x, &y, &width, &height);
-            Evas_Event_Mouse_Down event_info;
-            event_info.canvas.x = x + width / 2;
-            event_info.canvas.y = y + height / 2;
-            ui_mouse_button_pressed_cb (GINT_TO_POINTER ((focus_index << 8) + ISF_EFL_CANDIDATE_0), NULL, NULL, &event_info);
-            ui_mouse_button_released_cb (GINT_TO_POINTER (focus_index), NULL, NULL, &event_info);
-        }
-        _candidate_tts_focus_index = INVALID_TTS_FOCUS_INDEX;
-        ui_tts_focus_rect_hide ();
-        return;
-    }
-
-    if (_candidate_area_2_visible) {
-        if (focus_index == CLOSE_BUTTON_INDEX) {
-            ui_candidate_window_close_button_cb (NULL, NULL, NULL, NULL);
-            _candidate_tts_focus_index = MORE_BUTTON_INDEX;
-        }
-    } else {
-        if (focus_index == MORE_BUTTON_INDEX) {
-            ui_candidate_window_more_button_cb (NULL, NULL, NULL, NULL);
-            _candidate_tts_focus_index = CLOSE_BUTTON_INDEX;
-        }
-    }
-}
-#endif /* HAVE_ECOREX */
-
 /**
  * @brief Create preedit window.
  */
@@ -5454,7 +5230,6 @@ static void slot_update_candidate_table (const LookupTable &table)
     }
 
     update_table (ISF_CANDIDATE_TABLE, table);
-    _candidate_tts_focus_index = INVALID_TTS_FOCUS_INDEX;
     ui_tts_focus_rect_hide ();
 #endif /* CANDIDATE */
 }
@@ -7351,14 +7126,9 @@ static Eina_Bool x_event_client_message_cb (void *data, int type, void *event)
                         strTts = String (_("close button"));
                         evas_object_geometry_get (_close_btn, &x, &y, &w, &h);
                     } else {
-                        LOGW ("TTS focus index = %d", _candidate_tts_focus_index);
                         ui_tts_focus_rect_hide ();
                     }
 
-#ifdef HAVE_TTS
-                    if (strTts.length () > 0)
-                        ui_play_tts (strTts.c_str ());
-#endif
                     if (w > 0 && h > 0) {
                         if (!_wait_stop_event)
                             ui_tts_focus_rect_show (x, y, w, h);
@@ -7981,12 +7751,6 @@ cleanup:
 #endif
     delete_ise_check_pid_alive_timer();
 
-#if ISF_BUILD_CANDIDATE_UI
-#ifdef HAVE_TTS
-    ui_close_tts ();
-#endif
-#endif
-
     if (_info_manager) {
         try {
             _info_manager->stop ();