X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Finput%2Ftizen-wayland%2Finput-method-context-impl-ecore-wl.cpp;h=b4f71ea87b3d0c553ff64049b060515af37f7f8c;hb=refs%2Fchanges%2F22%2F179422%2F1;hp=212c0c928ee3b438a0af41ea02b615cffa05dba4;hpb=44ac6b074a4d7d2f9474331a364e4629c0bce11a;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp index 212c0c9..b4f71ea 100755 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp @@ -23,14 +23,8 @@ #include // EXTERNAL INCLUDES +#include #include - -#ifdef ECORE_WAYLAND2 -#include -#else -#include -#endif - #include #include #include @@ -277,11 +271,15 @@ InputMethodContextPtr InputMethodContextEcoreWl::New() Adaptor &adaptorImpl(Adaptor::GetImplementation(Adaptor::Get())); Any nativeWindow = adaptorImpl.GetNativeWindowHandle(); - // The window needs to use the InputMethodContext. - // Only when the render surface is window, we can get the window. - if( !nativeWindow.Empty() ) + // The Ecore_Wl_Window needs to use the InputMethodContext. + // Only when the render surface is window, we can get the Ecore_Wl_Window. + Ecore_Wl_Window *ecoreWwin(AnyCast(nativeWindow)); + if (ecoreWwin) { - inputMethodContext = new InputMethodContextEcoreWl(); + // If we fail to get Ecore_Wl_Window, we can't use the InputMethodContext correctly. + // Thus you have to call "ecore_imf_context_client_window_set" somewhere. + // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent(). + inputMethodContext = new InputMethodContextEcoreWl(ecoreWwin); } else { @@ -299,8 +297,9 @@ void InputMethodContextEcoreWl::Finalize() DeleteContext(); } -InputMethodContextEcoreWl::InputMethodContextEcoreWl() +InputMethodContextEcoreWl::InputMethodContextEcoreWl( Ecore_Wl_Window *ecoreWlwin ) : mIMFContext(), + mEcoreWlwin( ecoreWlwin ), mIMFCursorPosition( 0 ), mSurroundingText(), mRestoreAfterFocusLost( false ), @@ -317,11 +316,11 @@ InputMethodContextEcoreWl::~InputMethodContextEcoreWl() void InputMethodContextEcoreWl::Initialize() { - CreateContext(); + CreateContext( mEcoreWlwin ); ConnectCallbacks(); } -void InputMethodContextEcoreWl::CreateContext() +void InputMethodContextEcoreWl::CreateContext( Ecore_Wl_Window *ecoreWlwin ) { DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContext::CreateContext\n" ); @@ -332,22 +331,10 @@ void InputMethodContextEcoreWl::CreateContext() if( mIMFContext ) { - // If we fail to get Ecore_Wl_Window, we can't use the InputMethodContext correctly. - // Thus you have to call "ecore_imf_context_client_window_set" somewhere. - // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent(). - Adaptor& adaptorImpl( Adaptor::GetImplementation( Adaptor::Get() ) ); - Any nativeWindow = adaptorImpl.GetNativeWindowHandle(); - -#ifdef ECORE_WAYLAND2 - Ecore_Wl2_Window* ecoreWlwin( AnyCast< Ecore_Wl2_Window* >( nativeWindow ) ); - int windowId = ecore_wl2_window_id_get( ecoreWlwin ); -#else - Ecore_Wl_Window* ecoreWlwin( AnyCast< Ecore_Wl_Window* >( nativeWindow ) ); - int windowId = ecore_wl_window_id_get( ecoreWlwin ); -#endif if( ecoreWlwin ) { - ecore_imf_context_client_window_set( mIMFContext, reinterpret_cast< void* >( windowId ) ); + ecore_imf_context_client_window_set( mIMFContext, + reinterpret_cast( ecore_wl_window_id_get(ecoreWlwin)) ); } } else