From: Victor Cebollada Date: Sat, 18 Jun 2016 10:50:54 +0000 (+0100) Subject: IMF manager X implmentation clean. X-Git-Tag: dali_1.1.40~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F75438%2F1;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git IMF manager X implmentation clean. * Stop using SetSurroundingText() as it does nothing. * Use the returned ImfCallbackData data for all event signal emitted. Change-Id: Ib13e91b188eb6271b534f54ab0d687d88a1dca6c Signed-off-by: Victor Cebollada --- diff --git a/adaptors/x11/imf-manager-impl-x.cpp b/adaptors/x11/imf-manager-impl-x.cpp index efa6b52..5aa868f 100644 --- a/adaptors/x11/imf-manager-impl-x.cpp +++ b/adaptors/x11/imf-manager-impl-x.cpp @@ -387,15 +387,14 @@ void ImfManager::PreEditChanged( void*, Ecore_IMF_Context* imfContext, void* eve Dali::ImfManager::ImfEventData imfEventData( Dali::ImfManager::PREEDIT, preEditString, cursorPosition, 0 ); Dali::ImfManager::ImfCallbackData callbackData = mEventSignal.Emit( handle, imfEventData ); - if ( callbackData.update ) + if( callbackData.update ) { - SetCursorPosition( callbackData.cursorPosition ); - SetSurroundingText( callbackData.currentText ); + mIMFCursorPosition = static_cast( callbackData.cursorPosition ); NotifyCursorPosition(); } - if ( callbackData.preeditResetRequired ) + if( callbackData.preeditResetRequired ) { Reset(); } @@ -417,8 +416,7 @@ void ImfManager::CommitReceived( void*, Ecore_IMF_Context* imfContext, void* eve if( callbackData.update ) { - SetCursorPosition( callbackData.cursorPosition ); - SetSurroundingText( callbackData.currentText ); + mIMFCursorPosition = static_cast( callbackData.cursorPosition ); NotifyCursorPosition(); } @@ -436,16 +434,20 @@ Eina_Bool ImfManager::RetrieveSurrounding( void* data, Ecore_IMF_Context* imfCon Dali::ImfManager::ImfEventData imfData( Dali::ImfManager::GETSURROUNDING, std::string(), 0, 0 ); Dali::ImfManager handle( this ); - mEventSignal.Emit( handle, imfData ); + Dali::ImfManager::ImfCallbackData callbackData = mEventSignal.Emit( handle, imfData ); - if( text ) + if( callbackData.update ) { - *text = strdup( mSurroundingText.c_str() ); - } + if( text ) + { + *text = strdup( callbackData.currentText.c_str() ); + } - if( cursorPosition ) - { - *cursorPosition = mIMFCursorPosition; + if( cursorPosition ) + { + mIMFCursorPosition = static_cast( callbackData.cursorPosition ); + *cursorPosition = mIMFCursorPosition; + } } return EINA_TRUE; @@ -465,7 +467,14 @@ void ImfManager::DeleteSurrounding( void* data, Ecore_IMF_Context* imfContext, v Dali::ImfManager::ImfEventData imfData( Dali::ImfManager::DELETESURROUNDING, std::string(), deleteSurroundingEvent->offset, deleteSurroundingEvent->n_chars ); Dali::ImfManager handle( this ); - mEventSignal.Emit( handle, imfData ); + Dali::ImfManager::ImfCallbackData callbackData = mEventSignal.Emit( handle, imfData ); + + if( callbackData.update ) + { + mIMFCursorPosition = static_cast( callbackData.cursorPosition ); + + NotifyCursorPosition(); + } } }