input panel event callback is moved into ecore_imf
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 22 Feb 2013 13:08:26 +0000 (22:08 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 25 Feb 2013 00:40:52 +0000 (09:40 +0900)
Change-Id: Ieb1a032010bb7016cd42cf11afeb0fb4afb2e7f7

configure.ac
ism/extras/efl_immodule/isf_imf_control_ui.cpp
ism/extras/efl_immodule/isf_imf_control_ui.h
ism/extras/efl_immodule/isf_imf_module.cpp
packaging/isf.spec
releasenote.txt

index 8604291..d62de43 100755 (executable)
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script
 #AC_INIT(scim, 1.4.7, suzhe@tsinghua.org.cn)
-AC_INIT(isf, 2.4.6221, isf@samsung.com)
+AC_INIT(isf, 2.4.6222, isf@samsung.com)
 AC_CONFIG_SRCDIR([ism/src/scim.h])
 m4_pattern_allow([^AS_])
 
@@ -11,7 +11,7 @@ m4_pattern_allow([^AS_])
 # ISF version
 ISF_MAJOR_VERSION=2
 ISF_MINOR_VERSION=4
-ISF_MICRO_VERSION=6221
+ISF_MICRO_VERSION=6222
 
 ISF_VERSION=$ISF_MAJOR_VERSION.$ISF_MINOR_VERSION.$ISF_MICRO_VERSION
 
index 799b782..001670e 100644 (file)
 
 using namespace scim;
 
-typedef struct {
-    void (*func)(void *data, Ecore_IMF_Context *ctx, int value);
-    void *data;
-    Ecore_IMF_Input_Panel_Event type;
-    Ecore_IMF_Context *imf_context;
-} EventCallbackNode;
-
 /* IM control related variables */
 static Ise_Context        iseContext;
 static bool               IfInitContext     = false;
-static Eina_List         *EventCallbackList = NULL;
 static Ecore_IMF_Context *show_req_ic       = NULL;
 static Ecore_IMF_Context *hide_req_ic       = NULL;
 static Ecore_Event_Handler *_prop_change_handler = NULL;
@@ -173,9 +165,6 @@ static void _save_current_xid (Ecore_IMF_Context *ctx)
 
 static void _event_callback_call (Ecore_IMF_Input_Panel_Event type, int value)
 {
-    void *list_data = NULL;
-    EventCallbackNode *fn = NULL;
-    Eina_List *l = NULL;
     Ecore_IMF_Context *using_ic = NULL;
 
     if (show_req_ic)
@@ -190,51 +179,49 @@ static void _event_callback_call (Ecore_IMF_Input_Panel_Event type, int value)
         }
     }
 
-    EINA_LIST_FOREACH(EventCallbackList, l, list_data) {
-        fn = (EventCallbackNode *)list_data;
-
-        if ((fn) && (fn->imf_context == using_ic) &&
-            (fn->type == type) && (fn->func)) {
-            switch (type) {
-                case ECORE_IMF_INPUT_PANEL_STATE_EVENT:
-                    switch (value) {
-                        case ECORE_IMF_INPUT_PANEL_STATE_HIDE:
-                            LOGD ("[input panel has been hidden] ctx : %p\n", fn->imf_context);
-                            if (hide_req_ic == show_req_ic)
-                                show_req_ic = NULL;
-
-                            hide_req_ic = NULL;
-                            break;
-                        case ECORE_IMF_INPUT_PANEL_STATE_SHOW:
-                            LOGD ("[input panel has been shown] ctx : %p\n", fn->imf_context);
-                            break;
-                        case ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW:
-                            LOGD ("[input panel will be shown] ctx : %p\n", fn->imf_context);
-                            isf_imf_context_input_panel_send_will_show_ack ();
-                            break;
-                    }
-                    break;
-                case ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT:
-                    LOGD ("[language is changed] ctx : %p\n", fn->imf_context);
-                    break;
-                case ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT:
-                    LOGD ("[shift mode is changed] ctx : %p\n", fn->imf_context);
-                    break;
-                case ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT:
-                    LOGD ("[input panel geometry is changed] ctx : %p\n", fn->imf_context);
-                    break;
-                case ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT:
-                    LOGD ("[candidate state is changed] ctx : %p\n", fn->imf_context);
+    switch (type) {
+        case ECORE_IMF_INPUT_PANEL_STATE_EVENT:
+            switch (value) {
+                case ECORE_IMF_INPUT_PANEL_STATE_HIDE:
+                    LOGD ("[input panel has been hidden] ctx : %p\n", using_ic);
+                    if (hide_req_ic == show_req_ic)
+                        show_req_ic = NULL;
+
+                    hide_req_ic = NULL;
                     break;
-                case ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT:
-                    LOGD ("[candidate geometry is changed] ctx : %p\n", fn->imf_context);
+                case ECORE_IMF_INPUT_PANEL_STATE_SHOW:
+                    LOGD ("[input panel has been shown] ctx : %p\n", using_ic);
                     break;
-                default:
+                case ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW:
+                    LOGD ("[input panel will be shown] ctx : %p\n", using_ic);
                     break;
             }
+            break;
+        case ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT:
+            LOGD ("[language is changed] ctx : %p\n", using_ic);
+            break;
+        case ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT:
+            LOGD ("[shift mode is changed] ctx : %p\n", using_ic);
+            break;
+        case ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT:
+            LOGD ("[input panel geometry is changed] ctx : %p\n", using_ic);
+            break;
+        case ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT:
+            LOGD ("[candidate state is changed] ctx : %p\n", using_ic);
+            break;
+        case ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT:
+            LOGD ("[candidate geometry is changed] ctx : %p\n", using_ic);
+            break;
+        default:
+            break;
+    }
 
-            fn->func (fn->data, fn->imf_context, value);
-        }
+    if (using_ic)
+        ecore_imf_context_input_panel_event_callback_call (using_ic, type, value);
+
+    if (type == ECORE_IMF_INPUT_PANEL_STATE_EVENT &&
+        value == ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW) {
+        isf_imf_context_input_panel_send_will_show_ack ();
     }
 }
 
@@ -785,62 +772,9 @@ EAPI Ecore_IMF_Input_Panel_State isf_imf_context_input_panel_state_get (Ecore_IM
     return input_panel_state;
 }
 
-EAPI void isf_imf_context_input_panel_event_callback_add (Ecore_IMF_Context *ctx,
-                                                          Ecore_IMF_Input_Panel_Event type,
-                                                          void (*func) (void *data, Ecore_IMF_Context *ctx, int value),
-                                                          void *data)
-{
-    EventCallbackNode *fn = (EventCallbackNode *)calloc (1, sizeof (EventCallbackNode));
-    if (!fn)
-        return;
-
-    LOGD ("ctx : %p, type : %d, func : %p\n", ctx, type, func);
-
-    fn->func = func;
-    fn->data = data;
-    fn->type = type;
-    fn->imf_context = ctx;
-
-    EventCallbackList = eina_list_append (EventCallbackList, fn);
-}
-
-EAPI void isf_imf_context_input_panel_event_callback_del (Ecore_IMF_Context *ctx,
-                                                          Ecore_IMF_Input_Panel_Event type,
-                                                          void (*func) (void *data, Ecore_IMF_Context *ctx, int value))
-{
-    Eina_List *l = NULL;
-    EventCallbackNode *fn = NULL;
-
-    LOGD ("ctx : %p, type : %d, func : %p\n", ctx, type, func);
-
-    for (l = EventCallbackList; l;) {
-        fn = (EventCallbackNode *)l->data;
-
-        if ((fn) && (fn->func == func) && (fn->type == type) && (fn->imf_context == ctx)) {
-            EventCallbackList = eina_list_remove (EventCallbackList, fn);
-            free (fn);
-            break;
-        }
-        l = l->next;
-    }
-}
-
 EAPI void isf_imf_context_input_panel_event_callback_clear (Ecore_IMF_Context *ctx)
 {
-    Eina_List *l;
-    EventCallbackNode *fn;
-
-    LOGD ("ctx : %p\n", ctx);
-
-    for (l = EventCallbackList; l;) {
-        fn = (EventCallbackNode *)l->data;
-
-        if ((fn) && (fn->imf_context == ctx)) {
-            EventCallbackList = eina_list_remove (EventCallbackList, fn);
-            free (fn);
-        }
-        l = l->next;
-    }
+    ecore_imf_context_input_panel_event_callback_clear (ctx);
 
     if (hide_req_ic == ctx)
         hide_req_ic = NULL;
index 9d2d902..426af3c 100644 (file)
@@ -50,8 +50,6 @@ extern "C"
     Ecore_IMF_Input_Panel_Layout isf_imf_context_input_panel_layout_get (Ecore_IMF_Context *ctx);
     Ecore_IMF_Input_Panel_State isf_imf_context_input_panel_state_get (Ecore_IMF_Context *ctx);
     void isf_imf_context_input_panel_caps_mode_set (Ecore_IMF_Context *ctx, unsigned int mode);
-    void isf_imf_context_input_panel_event_callback_add (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), void *data);
-    void isf_imf_context_input_panel_event_callback_del (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));
     void isf_imf_context_input_panel_event_callback_clear (Ecore_IMF_Context *ctx);
 
     void isf_imf_context_input_panel_return_key_type_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type type);
index 29149f6..fb67dd9 100644 (file)
@@ -71,8 +71,8 @@ extern "C"
         isf_imf_context_input_panel_caps_lock_mode_set,
         isf_imf_context_input_panel_geometry_get,
         isf_imf_context_input_panel_state_get,
-        isf_imf_context_input_panel_event_callback_add,
-        isf_imf_context_input_panel_event_callback_del,
+        NULL, /* input_panel_event_callback_add */
+        NULL, /* input_panel_event_callback_del */
         isf_imf_context_input_panel_language_locale_get,
         isf_imf_context_candidate_window_geometry_get
     };
index 1ad1b50..a5da50a 100755 (executable)
@@ -3,7 +3,7 @@
 
 Name:       isf
 Summary:    Input Service Framework
-Version:    2.4.6221
+Version:    2.4.6222
 Release:    1
 Group:      System Environment/Libraries
 License:    LGPL
index 05a8a14..17f186a 100644 (file)
@@ -1,6 +1,12 @@
+ISF 2.4.6222 :
+ 1. [demo] IME will be hidden when back key in naviframe is pressed
+ 2. add smack rule for shared library
+ 3. [immodule] input panel event callback is moved into ecore_imf
+
+
 ISF 2.4.6221 :
  1. fix: "onoff" style genlist item, drag the check button to enable/disable
- 2. IME will be hidden when END_KEY is released.
+ 2. [immodule] IME will be hidden when END_KEY is released.
 
 
 ISF 2.4.6218 :