From: Taejun Date: Tue, 22 Oct 2013 08:19:35 +0000 (+0900) Subject: Change the keypad bounds query api for logical geometry(N_SE-55612) X-Git-Tag: submit/tizen_2.2/20131107.062147~108^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69090c9b954c25054ec251783d446de8532ec9a1;p=framework%2Fosp%2Fuifw.git Change the keypad bounds query api for logical geometry(N_SE-55612) Change-Id: I4a0adbd5046f01a6e714d22349ffe0320809a359 --- diff --git a/src/ui/FUi_InputConnectionImpl.cpp b/src/ui/FUi_InputConnectionImpl.cpp index 70d5ffd..5a20b89 100644 --- a/src/ui/FUi_InputConnectionImpl.cpp +++ b/src/ui/FUi_InputConnectionImpl.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include "FUi_BidiUtils.h" @@ -910,13 +911,20 @@ _InputConnectionImpl::GetInputPanelBounds(void) const SysAssertf(__pContext != null, "Not yet constructed. Construct() should be called before use."); - int x = 0; - int y = 0; - int w = 0; - int h = 0; + Rectangle inputPanelPhysicalRect; + Rectangle inputPanelLogicalRect; - ecore_imf_context_input_panel_geometry_get(__pContext, &x, &y, &w, &h); - return Rectangle(x, y, w, h); + ecore_imf_context_input_panel_geometry_get(__pContext, &inputPanelPhysicalRect.x, &inputPanelPhysicalRect.y, &inputPanelPhysicalRect.width, &inputPanelPhysicalRect.height); + + _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance(); + SysTryReturn(NID_UI, pCoordSystem != null, Rectangle(0,0,0,0), E_SYSTEM, "Coordinate system load failed."); + + _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetInverseTransformer(); + SysTryReturn(NID_UI, pXformer, Rectangle(0,0,0,0), E_SYSTEM, "Coordinate system load failed."); + + inputPanelLogicalRect = pXformer->Transform(inputPanelPhysicalRect); + + return inputPanelLogicalRect; } FloatRectangle @@ -932,13 +940,24 @@ _InputConnectionImpl::GetInputPanelBoundsF(void) const int h = 0; ecore_imf_context_input_panel_geometry_get(__pContext, &x, &y, &w, &h); - FloatRectangle inputPanelFloatRect; - inputPanelFloatRect.x = _CoordinateSystemUtils::ConvertToFloat(x); - inputPanelFloatRect.y = _CoordinateSystemUtils::ConvertToFloat(y); - inputPanelFloatRect.width = _CoordinateSystemUtils::ConvertToFloat(w); - inputPanelFloatRect.height = _CoordinateSystemUtils::ConvertToFloat(h); - return inputPanelFloatRect; + FloatRectangle inputPanelPhysicalFloatRect; + FloatRectangle inputPanelLogicalFloatRect; + + inputPanelPhysicalFloatRect.x = _CoordinateSystemUtils::ConvertToFloat(x); + inputPanelPhysicalFloatRect.y = _CoordinateSystemUtils::ConvertToFloat(y); + inputPanelPhysicalFloatRect.width = _CoordinateSystemUtils::ConvertToFloat(w); + inputPanelPhysicalFloatRect.height = _CoordinateSystemUtils::ConvertToFloat(h); + + _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance(); + SysTryReturn(NID_UI, pCoordSystem != null, FloatRectangle(0.0f,0.0f,0.0f,0.0f), E_SYSTEM, "Coordinate system load failed."); + + _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetInverseTransformer(); + SysTryReturn(NID_UI, pXformer, FloatRectangle(0.0f,0.0f,0.0f,0.0f), E_SYSTEM, "Coordinate system load failed."); + + inputPanelLogicalFloatRect = pXformer->Transform(inputPanelPhysicalFloatRect); + + return inputPanelLogicalFloatRect; } Rectangle @@ -948,13 +967,20 @@ _InputConnectionImpl::GetPredictionBounds(void) const SysAssertf(__pContext != null, "Not yet constructed. Construct() should be called before use."); - int x = 0; - int y = 0; - int w = 0; - int h = 0; + Rectangle predictionPhysicalRect; + Rectangle predictionLogicalRect; - ecore_imf_context_candidate_panel_geometry_get(__pContext, &x, &y, &w, &h); - return Rectangle(x, y, w, h); + ecore_imf_context_candidate_panel_geometry_get(__pContext, &predictionPhysicalRect.x, &predictionPhysicalRect.y, &predictionPhysicalRect.width, &predictionPhysicalRect.height); + + _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance(); + SysTryReturn(NID_UI, pCoordSystem != null, Rectangle(0,0,0,0), E_SYSTEM, "Coordinate system load failed."); + + _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetInverseTransformer(); + SysTryReturn(NID_UI, pXformer, Rectangle(0,0,0,0), E_SYSTEM, "Coordinate system load failed."); + + predictionLogicalRect = pXformer->Transform(predictionPhysicalRect); + + return predictionLogicalRect; } FloatRectangle @@ -970,13 +996,24 @@ _InputConnectionImpl::GetPredictionBoundsF(void) const int h = 0; ecore_imf_context_candidate_panel_geometry_get(__pContext, &x, &y, &w, &h); - FloatRectangle inputPredictionFloatRect; - inputPredictionFloatRect.x = _CoordinateSystemUtils::ConvertToFloat(x); - inputPredictionFloatRect.y = _CoordinateSystemUtils::ConvertToFloat(y); - inputPredictionFloatRect.width = _CoordinateSystemUtils::ConvertToFloat(w); - inputPredictionFloatRect.height = _CoordinateSystemUtils::ConvertToFloat(h); - return inputPredictionFloatRect; + FloatRectangle predictionPhysicalFloatRect; + FloatRectangle predictionLogicalFloatRect; + + predictionPhysicalFloatRect.x = _CoordinateSystemUtils::ConvertToFloat(x); + predictionPhysicalFloatRect.y = _CoordinateSystemUtils::ConvertToFloat(y); + predictionPhysicalFloatRect.width = _CoordinateSystemUtils::ConvertToFloat(w); + predictionPhysicalFloatRect.height = _CoordinateSystemUtils::ConvertToFloat(h); + + _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance(); + SysTryReturn(NID_UI, pCoordSystem != null, FloatRectangle(0.0f,0.0f,0.0f,0.0f), E_SYSTEM, "Coordinate system load failed."); + + _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetInverseTransformer(); + SysTryReturn(NID_UI, pXformer, FloatRectangle(0.0f,0.0f,0.0f,0.0f), E_SYSTEM, "Coordinate system load failed."); + + predictionLogicalFloatRect = pXformer->Transform(predictionPhysicalFloatRect); + + return predictionLogicalFloatRect; } result diff --git a/src/ui/controls/FUiCtrl_EditPresenter.cpp b/src/ui/controls/FUiCtrl_EditPresenter.cpp index 4540c9f..206f2bd 100755 --- a/src/ui/controls/FUiCtrl_EditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditPresenter.cpp @@ -7736,13 +7736,6 @@ _EditPresenter::GetKeypadBounds(FloatRectangle& bounds) bounds = __pInputConnection->GetInputPanelBoundsF(); - _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance(); - SysTryReturnResult(NID_UI_CTRL, pCoordSystem, E_SYSTEM, "Coordinate system load failed."); - - _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetInverseTransformer(); - SysTryReturnResult(NID_UI_CTRL, pXformer, E_SYSTEM, "Coordinate system load failed."); - - bounds = pXformer->Transform(bounds); __keypadBounds = bounds; return E_SUCCESS;