ecore_imf: deprecate ambigous or unused APIs 42/209742/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 10 Jul 2019 11:01:47 +0000 (20:01 +0900)
committerHermet Park <chuneon.park@samsung.com>
Wed, 10 Jul 2019 11:45:47 +0000 (11:45 +0000)
ecore_imf_context_show
ecore_imf_context_hide
ecore_imf_context_control_panel_show
ecore_imf_context_control_panel_hide
ecore_imf_context_preedit_start_event_add
ecore_imf_context_preedit_end_event_add
ecore_imf_context_preedit_changed_event_add
ecore_imf_context_commit_event_add
ecore_imf_context_delete_surrounding_event_add

Change-Id: Ibdf98e4b40b0fa402abeb428fac6c295f74a73cb
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/lib/ecore_imf/Ecore_IMF.h
src/modules/ecore_imf/ibus/ibus_imcontext.c
src/modules/ecore_imf/scim/scim_imcontext.cpp
src/modules/ecore_imf/xim/ecore_imf_xim.c

index 98ecd59..5494c0b 100644 (file)
@@ -1041,16 +1041,20 @@ EAPI void                         *ecore_imf_context_client_canvas_get(Ecore_IMF
  * @brief Asks the Input Method Context to show itself.
  *
  * @param ctx An #Ecore_IMF_Context.
+ *
+ * @deprecated use ecore_imf_context_input_panel_show() instead.
  */
-EAPI void                          ecore_imf_context_show(Ecore_IMF_Context *ctx);
+EINA_DEPRECATED EAPI void          ecore_imf_context_show(Ecore_IMF_Context *ctx);
 
 /**
  * @ingroup Ecore_IMF_Context_Group
  * @brief Asks the Input Method Context to hide itself.
  *
  * @param ctx An #Ecore_IMF_Context.
+ *
+ * @deprecated use ecore_imf_context_input_panel_hide() instead.
  */
-EAPI void                          ecore_imf_context_hide(Ecore_IMF_Context *ctx);
+EINA_DEPRECATED EAPI void          ecore_imf_context_hide(Ecore_IMF_Context *ctx);
 
 /**
  * @ingroup Ecore_IMF_Context_Group
@@ -1432,8 +1436,10 @@ EAPI Eina_Bool                     ecore_imf_context_selection_get(Ecore_IMF_Con
  * ecore_imf_context_event_callback_call() can be used as synchronous method.
  *
  * @param ctx An #Ecore_IMF_Context.
+ *
+ * @deprecated use ecore_imf_context_event_callback_call() instead.
  */
-EAPI void                          ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);
+EINA_DEPRECATED EAPI void          ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);
 
 /**
  * @ingroup Ecore_IMF_Context_Module_Group
@@ -1444,8 +1450,10 @@ EAPI void                          ecore_imf_context_preedit_start_event_add(Eco
  * ecore_imf_context_event_callback_call() can be used as synchronous method.
  *
  * @param ctx An #Ecore_IMF_Context.
+ *
+ * @deprecated use ecore_imf_context_event_callback_call() instead.
  */
-EAPI void                          ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);
+EINA_DEPRECATED EAPI void          ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);
 
 /**
  * @ingroup Ecore_IMF_Context_Module_Group
@@ -1455,8 +1463,10 @@ EAPI void                          ecore_imf_context_preedit_end_event_add(Ecore
  * ecore_imf_context_event_callback_call() can be used as synchronous method.
  *
  * @param ctx An #Ecore_IMF_Context.
+ *
+ * @deprecated use ecore_imf_context_event_callback_call() instead.
  */
-EAPI void                          ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
+EINA_DEPRECATED EAPI void          ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
 
 /**
  * @ingroup Ecore_IMF_Context_Module_Group
@@ -1467,8 +1477,10 @@ EAPI void                          ecore_imf_context_preedit_changed_event_add(E
  *
  * @param ctx An #Ecore_IMF_Context.
  * @param str The committed string.
+ *
+ * @deprecated use ecore_imf_context_event_callback_call() instead.
  */
-EAPI void                          ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
+EINA_DEPRECATED EAPI void          ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
 
 /**
  * @ingroup Ecore_IMF_Context_Module_Group
@@ -1484,8 +1496,10 @@ EAPI void                          ecore_imf_context_commit_event_add(Ecore_IMF_
  * @param ctx An #Ecore_IMF_Context.
  * @param offset The start offset of surrounding to be deleted.
  * @param n_chars The number of characters to be deleted.
+ *
+ * @deprecated use ecore_imf_context_event_callback_call() instead.
  */
-EAPI void                          ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
+EINA_DEPRECATED EAPI void          ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
 
 /**
  * @ingroup Ecore_IMF_Context_Group
@@ -1659,7 +1673,7 @@ EAPI Ecore_IMF_Input_Hints         ecore_imf_context_input_hint_get(Ecore_IMF_Co
  * @param ctx An #Ecore_IMF_Context.
  * @since 1.1.0
  */
-EAPI void                          ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
+EINA_DEPRECATED EAPI void          ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
 
 /**
  * @ingroup Ecore_IMF_Context_Group
@@ -1668,7 +1682,7 @@ EAPI void                          ecore_imf_context_control_panel_show(Ecore_IM
  * @param ctx An #Ecore_IMF_Context.
  * @since 1.1.0
  */
-EAPI void                          ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
+EINA_DEPRECATED EAPI void          ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
 
 /**
  * @ingroup Ecore_IMF_Context_Group
index 4521e52..56815a8 100644 (file)
@@ -729,7 +729,6 @@ _ecore_imf_context_ibus_commit_text_cb(IBusInputContext *ibuscontext EINA_UNUSED
 
    if (ibusimcontext->ctx)
      {
-        ecore_imf_context_commit_event_add(ibusimcontext->ctx, text->text);
         ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                               ECORE_IMF_CALLBACK_COMMIT,
                                               (void *)commit_str);
@@ -803,7 +802,6 @@ _ecore_imf_context_ibus_delete_surrounding_text_cb(IBusInputContext *ibuscontext
    ev.ctx = _focus_im_context;
    ev.n_chars = nchars;
    ev.offset = offset_from_cursor;
-   ecore_imf_context_delete_surrounding_event_add(_focus_im_context, offset_from_cursor, nchars);
    ecore_imf_context_event_callback_call(_focus_im_context,
                                          ECORE_IMF_CALLBACK_DELETE_SURROUNDING,
                                          &ev);
@@ -928,13 +926,11 @@ _ecore_imf_context_ibus_update_preedit_text_cb(IBusInputContext  *ibuscontext EI
      {
         if (flag)
           {
-             ecore_imf_context_preedit_start_event_add(ibusimcontext->ctx);
              ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                                    ECORE_IMF_CALLBACK_PREEDIT_START,
                                                    NULL);
           }
 
-        ecore_imf_context_preedit_changed_event_add(ibusimcontext->ctx);
         ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                               ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
                                               NULL);
@@ -943,13 +939,11 @@ _ecore_imf_context_ibus_update_preedit_text_cb(IBusInputContext  *ibuscontext EI
      {
         if (flag)
           {
-             ecore_imf_context_preedit_changed_event_add(ibusimcontext->ctx);
              ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                                    ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
                                                    NULL);
           }
 
-        ecore_imf_context_preedit_end_event_add(ibusimcontext->ctx);
         ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                               ECORE_IMF_CALLBACK_PREEDIT_END,
                                               NULL);
@@ -969,13 +963,11 @@ _ecore_imf_context_ibus_show_preedit_text_cb(IBusInputContext *ibuscontext EINA_
    ibusimcontext->preedit_visible = EINA_TRUE;
 
    // call preedit start
-   ecore_imf_context_preedit_start_event_add(ibusimcontext->ctx);
    ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                          ECORE_IMF_CALLBACK_PREEDIT_START,
                                          NULL);
 
    // call preedit changed
-   ecore_imf_context_preedit_changed_event_add(ibusimcontext->ctx);
    ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                          ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
                                          NULL);
@@ -996,13 +988,11 @@ _ecore_imf_context_ibus_hide_preedit_text_cb(IBusInputContext *ibuscontext EINA_
    ibusimcontext->preedit_visible = EINA_FALSE;
 
    // call preedit changed
-   ecore_imf_context_preedit_changed_event_add(ibusimcontext->ctx);
    ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                          ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
                                          NULL);
 
    // call preedit end
-   ecore_imf_context_preedit_end_event_add(ibusimcontext->ctx);
    ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                          ECORE_IMF_CALLBACK_PREEDIT_END,
                                          NULL);
@@ -1025,13 +1015,11 @@ _ecore_imf_context_ibus_destroy_cb(IBusInputContext *ibuscontext EINA_UNUSED,
    ibusimcontext->preedit_string = NULL;
 
    // call preedit changed
-   ecore_imf_context_preedit_changed_event_add(ibusimcontext->ctx);
    ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                          ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
                                          NULL);
 
    // call preedit end
-   ecore_imf_context_preedit_end_event_add(ibusimcontext->ctx);
    ecore_imf_context_event_callback_call(ibusimcontext->ctx,
                                          ECORE_IMF_CALLBACK_PREEDIT_END,
                                          NULL);
index 993a7d8..54249dc 100644 (file)
@@ -1491,7 +1491,6 @@ panel_slot_commit_string(int context, const WideString &wstr)
    if (_focused_ic != ic)
      return;
 
-   ecore_imf_context_commit_event_add(ic->ctx, utf8_wcstombs(wstr).c_str());
    ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(wstr).c_str());
 }
 
@@ -1796,9 +1795,7 @@ turn_on_ic(EcoreIMFContextISF *ic)
 
         if (ic->impl->use_preedit && ic->impl->preedit_string.length())
           {
-             ecore_imf_context_preedit_start_event_add(ic->ctx);
              ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
-             ecore_imf_context_preedit_changed_event_add(ic->ctx);
              ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
              ic->impl->preedit_started = true;
           }
@@ -1831,9 +1828,7 @@ turn_off_ic(EcoreIMFContextISF *ic)
 
         if (ic->impl->use_preedit && ic->impl->preedit_string.length())
           {
-             ecore_imf_context_preedit_changed_event_add(ic->ctx);
              ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
-             ecore_imf_context_preedit_end_event_add(ic->ctx);
              ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL);
              ic->impl->preedit_started = false;
           }
@@ -2166,9 +2161,7 @@ open_specific_factory(EcoreIMFContextISF *ic,
 
              if (ic->impl->use_preedit && ic->impl->preedit_string.length())
                {
-                  ecore_imf_context_preedit_changed_event_add(ic->ctx);
                   ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
-                  ecore_imf_context_preedit_end_event_add(ic->ctx);
                   ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL);
                   ic->impl->preedit_started = false;
                }
@@ -2430,7 +2423,6 @@ slot_show_preedit_string(IMEngineInstanceBase *si)
      {
         if (!ic->impl->preedit_started)
           {
-             ecore_imf_context_preedit_start_event_add(_focused_ic->ctx);
              ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
              ic->impl->preedit_started = true;
           }
@@ -2487,12 +2479,10 @@ slot_hide_preedit_string(IMEngineInstanceBase *si)
      {
         if (emit)
           {
-             ecore_imf_context_preedit_changed_event_add(ic->ctx);
              ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
           }
         if (ic->impl->preedit_started)
           {
-             ecore_imf_context_preedit_end_event_add(ic->ctx);
              ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL);
              ic->impl->preedit_started = false;
           }
@@ -2541,11 +2531,9 @@ slot_update_preedit_caret(IMEngineInstanceBase *si, int caret)
           {
              if (!ic->impl->preedit_started)
                {
-                  ecore_imf_context_preedit_start_event_add(ic->ctx);
                   ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
                   ic->impl->preedit_started = true;
                }
-             ecore_imf_context_preedit_changed_event_add(ic->ctx);
              ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
           }
         else
@@ -2572,13 +2560,11 @@ slot_update_preedit_string(IMEngineInstanceBase *si,
           {
              if (!ic->impl->preedit_started)
                {
-                  ecore_imf_context_preedit_start_event_add(_focused_ic->ctx);
                   ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
                   ic->impl->preedit_started = true;
                }
              ic->impl->preedit_caret    = str.length();
              ic->impl->preedit_updating = true;
-             ecore_imf_context_preedit_changed_event_add(ic->ctx);
              ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
              ic->impl->preedit_updating = false;
           }
@@ -2613,7 +2599,6 @@ slot_commit_string(IMEngineInstanceBase *si,
    EINA_SAFETY_ON_NULL_RETURN(ic);
    EINA_SAFETY_ON_NULL_RETURN(ic->ctx);
 
-   ecore_imf_context_commit_event_add(ic->ctx, utf8_wcstombs(str).c_str());
    ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(str).c_str());
 }
 
@@ -2797,7 +2782,6 @@ slot_delete_surrounding_text(IMEngineInstanceBase *si,
    ev.ctx = _focused_ic->ctx;
    ev.n_chars = len;
    ev.offset = offset;
-   ecore_imf_context_delete_surrounding_event_add(_focused_ic->ctx, offset, len);
    ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, &ev);
 
    return true;
@@ -2840,7 +2824,6 @@ fallback_commit_string_cb(IMEngineInstanceBase  *si EINA_UNUSED,
 
    if (_focused_ic)
      {
-        ecore_imf_context_commit_event_add(_focused_ic->ctx, utf8_wcstombs(str).c_str());
         ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(str).c_str());
      }
 }
index a4d567c..5bb8c4a 100644 (file)
@@ -383,7 +383,6 @@ _ecore_imf_context_xim_reset(Ecore_IMF_Context *ctx)
         free(imf_context_data->preedit_chars);
         imf_context_data->preedit_chars = NULL;
 
-        ecore_imf_context_preedit_changed_event_add(ctx);
         ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
      }
 
@@ -392,7 +391,6 @@ _ecore_imf_context_xim_reset(Ecore_IMF_Context *ctx)
         char *result_utf8 = strdup(result);
         if (result_utf8)
           {
-             ecore_imf_context_commit_event_add(ctx, result_utf8);
              ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_COMMIT, result_utf8);
              free(result_utf8);
           }
@@ -695,7 +693,6 @@ _ecore_imf_context_xim_filter_event(Ecore_IMF_Context *ctx,
              if (!unicode) abort();
              if (unicode[0] >= 0x20 && unicode[0] != 0x7f)
                {
-                  ecore_imf_context_commit_event_add(ctx, compose);
                   ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_COMMIT, compose);
                   result = EINA_TRUE;
                }
@@ -882,10 +879,7 @@ _ecore_imf_xim_preedit_start_call(XIC xic EINA_UNUSED,
    EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
 
    if (imf_context_data->finalizing == EINA_FALSE)
-     {
-        ecore_imf_context_preedit_start_event_add(ctx);
-        ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
-     }
+     ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_START, NULL);
 }
 
 static void
@@ -904,15 +898,11 @@ _ecore_imf_xim_preedit_done_call(XIC xic EINA_UNUSED,
         imf_context_data->preedit_length = 0;
         free(imf_context_data->preedit_chars);
         imf_context_data->preedit_chars = NULL;
-        ecore_imf_context_preedit_changed_event_add(ctx);
         ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
      }
 
    if (imf_context_data->finalizing == EINA_FALSE)
-     {
-        ecore_imf_context_preedit_end_event_add(ctx);
-        ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL);
-     }
+     ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL);
 }
 
 /* FIXME */
@@ -1049,7 +1039,6 @@ done:
                }
           }
 
-        ecore_imf_context_preedit_changed_event_add(ctx);
         ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
      }
 
@@ -1072,10 +1061,7 @@ _ecore_imf_xim_preedit_caret_call(XIC xic EINA_UNUSED,
      {
         imf_context_data->preedit_cursor = call_data->position;
         if (imf_context_data->finalizing == EINA_FALSE)
-          {
-             ecore_imf_context_preedit_changed_event_add(ctx);
-             ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
-          }
+          ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
      }
 }
 
@@ -1257,7 +1243,6 @@ _ecore_imf_xim_ic_reinitialize(Ecore_IMF_Context *ctx)
              imf_context_data->preedit_length = 0;
              free(imf_context_data->preedit_chars);
              imf_context_data->preedit_chars = NULL;
-             ecore_imf_context_preedit_changed_event_add(ctx);
              ecore_imf_context_event_callback_call(ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
           }
      }