[SDL_Tizen] delete ecore_imf_callback
[platform/upstream/SDL.git] / src / video / tizen / SDL_tizenkeyboard.c
index 39da3f8..801c923 100755 (executable)
@@ -79,10 +79,10 @@ void Tizen_InitKeyboard(_THIS)
 
     const char *default_id = ecore_imf_context_default_id_get();
     if (!default_id)
-      {
-         SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Can't create ecore_imf_context\n");
-         return;
-      }
+    {
+        SDL_LogError(SDL_LOG_CATEGORY_ASSERT, "Can't create ecore_imf_context\n");
+        return;
+    }
 
     tizen_keyboard.imf_context = ecore_imf_context_add(default_id);
 
@@ -92,9 +92,7 @@ void Tizen_InitKeyboard(_THIS)
     ecore_imf_context_client_window_set(tizen_keyboard.imf_context, (void*)wind->id);
 
     ecore_imf_context_event_callback_add(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_COMMIT , _ecore_imf_event_commit_cb, NULL);
-
     ecore_imf_context_event_callback_add(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _ecore_imf_event_preedit_changed_cb, NULL);
-
     ecore_imf_context_input_panel_event_callback_add (tizen_keyboard.imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, _ecore_imf_event_state_change_cb, NULL);
 
     ecore_imf_context_cursor_position_set(tizen_keyboard.imf_context, 0);
@@ -110,6 +108,10 @@ void Tizen_FiniKeyboard(void)
     if(tizen_keyboard.imf_context == NULL)
         return;
 
+    ecore_imf_context_event_callback_del(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_COMMIT, _ecore_imf_event_commit_cb);
+    ecore_imf_context_event_callback_del(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _ecore_imf_event_preedit_changed_cb);
+    ecore_imf_context_input_panel_event_callback_del(tizen_keyboard.imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _ecore_imf_event_preedit_changed_cb);
+
     ecore_imf_context_del(tizen_keyboard.imf_context);
     tizen_keyboard.imf_context = NULL;
 
@@ -137,7 +139,6 @@ Tizen_StartTextInput(_THIS)
     Tizen_ShowScreenKeyboard(_this, window);
 }
 
-
 void
 Tizen_StopTextInput(_THIS)
 {
@@ -152,14 +153,12 @@ void Tizen_SetTextInputRect(void)
 {
 }
 
-
 SDL_bool
 Tizen_HasScreenKeyboardSupport(_THIS)
 {
     return SDL_TRUE;
 }
 
-
 void
 Tizen_ShowScreenKeyboard(_THIS, SDL_Window * window)
 {