_Control*
_ControlManager::GetTopmostTouchedControl(const Point& point)
{
-#ifdef BUILD_BREAK
_Control* pControl = null;
_Window* pTopWindow = null;
if (pControl != null)
{
- return pControl;
- }
+ return pControl;
+ }
}
int count = GetWindowCount();
continue;
}
- _EflLayer* pLayer = static_cast<_EflLayer*>(pRootVE->GetNativeLayer());
+ Rectangle winDeviceBounds(0, 0, 0, 0);
- Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas();
- Ecore_X_Window win = (Ecore_X_Window)ecore_evas_window_get(pEcoreEvas);
+ int rootW = 0, rootH = 0;
+ int rotation = 0;
- Rectangle winDeviceBounds(0, 0, 0, 0);
- ecore_x_window_geometry_get(win, &winDeviceBounds.x, &winDeviceBounds.y, &winDeviceBounds.width, &winDeviceBounds.height);
+#ifdef ENABLE_VE_EFL
+ if (pWindow->GetWindowType() == _WINDOW_TYPE_EFL)
+ {
+ _EflLayer* pLayer = static_cast<_EflLayer*>(pRootVE->GetNativeLayer());
+
+ Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas();
+ Ecore_X_Window win = (Ecore_X_Window)ecore_evas_window_get(pEcoreEvas);
+
+ ecore_x_window_geometry_get(win, &winDeviceBounds.x, &winDeviceBounds.y, &winDeviceBounds.width, &winDeviceBounds.height);
+
+ ecore_x_window_size_get(ecore_x_window_root_get(win), &rootW, &rootH);
+
+ rotation = ecore_evas_rotation_get(pEcoreEvas);
+ }
+ else
+#endif
+ {
+ _GlLayer* pLayer = static_cast<_GlLayer*>(pRootVE->GetNativeLayer());
+ FloatRectangle layerBounds = pLayer->GetBounds();
+ winDeviceBounds.x = layerBounds.x;
+ winDeviceBounds.y = layerBounds.y;
+ winDeviceBounds.width = layerBounds.width;
+ winDeviceBounds.height = layerBounds.height;
+
+ rootW = 720;
+ rootH = 1280; //need to get root window size! & rotation value
+ }
Point winDevicePoint = _CoordinateSystemUtils::Transform(pWindow->GetPosition());
int x = devicePoint.x;
int y = devicePoint.y;
- int rootW = 0;
- int rootH = 0;
- ecore_x_window_size_get(ecore_x_window_root_get(win), &rootW, &rootH);
-
- int rotation = ecore_evas_rotation_get(pEcoreEvas);
switch (rotation)
{
case 270:
}
}
}
-#endif
+
return null;
}
#ifdef KEY_CAMERA
#undef KEY_CAMERA
#endif
+
#include <X11/Xlib.h>
#include <FBaseColIEnumeratorT.h>
#include <FBaseSysLog.h>
SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
Tizen::Graphics::Rectangle winBounds = pWindow->GetBounds();
- ptf.x = static_cast<float>(x - winBounds.x);
- ptf.y = static_cast<float>(y - winBounds.y);
-
- _Window* pTouchedWindow = pControlManager->GetTopVisibleWindowAt(Point(x, y));
- SysTryReturn(NID_UI, pTouchedWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-
- pRootControlElement = dynamic_cast <_ControlVisualElement*>(pTouchedWindow->GetVisualElement());
+ pRootControlElement = dynamic_cast <_ControlVisualElement*>(pWindow->GetVisualElement());
}
SysTryReturn(NID_UI, pRootControlElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-// _ControlVisualElement* pControlVisualElement = pRootControlElement->GetControlChildAtPoint(ptf);
_RootVisualElement* pRootVisualElement = pRootControlElement->GetRoot();
_ControlVisualElement* pControlVisualElement = null;
if(pRootVisualElement)
{
pControlVisualElement = pRootVisualElement->GetControlVisualElementFromScreen(*pRootControlElement, ptf, null);
}
+
SysTryReturn(NID_UI, pControlVisualElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
pControl = static_cast <_Control*>(pControlVisualElement->GetUserData());
int rotation = ecore_evas_rotation_get(pEE);
#else
- const int PORTRAIT = 0;
- const int LANDSCAPE = 270;
- const int PORTRAIT_REVERSE = 180;
- const int LANDSCAPE_REVERSE = 90;
+ const int PORTRAIT = 0;
+ const int LANDSCAPE = 270;
+ const int PORTRAIT_REVERSE = 180;
+ const int LANDSCAPE_REVERSE = 90;
int rotation = PORTRAIT;
#endif
{
case _RawEvent::RAWEVENT_TOUCHPRESS:
{
-
PRINT("RAWEVENT_TOUCHPRESS(%d,%d) \n", rawEvent.data.touchPress.x,rawEvent.data.touchPress.y);
_TouchEvent event(0, _TOUCH_PRESSED, rawEvent.data.touchPress.x, rawEvent.data.touchPress.y, rawEvent.timeStamp, null);
}
};
+Eina_Bool
+OnNotified(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
+{
+ if (pEventInfo)
+ {
+ _UiEvent* pUiEvent = static_cast <_UiEvent*>(pEventInfo);
+ SysTryReturn(NID_UI, pUiEvent, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+
+ _UiEventManager* pEventManager = _UiEventManager::GetInstance();
+ SysTryReturn(NID_UI, pEventManager, ECORE_CALLBACK_PASS_ON, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ result r = pEventManager->SendEvent(*pUiEvent);
+ SysTryReturn(NID_UI, r == E_SUCCESS, ECORE_CALLBACK_PASS_ON, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ }
+
+ SetLastResult(E_SUCCESS);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+void
+FreeEvent(void* pData __UNUSED__, void* pEventInfo)
+{
+ _UiEvent* pUiEvent = static_cast <_UiEvent*>(pEventInfo);
+ if (pUiEvent)
+ {
+ delete pUiEvent;
+ }
+}
_XUiEventManager::_XUiEventManager(void)
: __notificaitonEventType(-1)
{
-
__pEventHandler = new _XRawEventHandler;
_Looper::GetInstance()->AddRawEventHandler(__pEventHandler);
+ __notificaitonEventType = ecore_event_type_new();
+ SysTryReturnVoidResult(NID_UI, __notificaitonEventType >= 1, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ __pEcoreEventHandler = ecore_event_handler_add(__notificaitonEventType, OnNotified, null);
+ SysTryReturnVoidResult(NID_UI, __pEcoreEventHandler, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
PRINT("_XUiEventManager:construct\n");
// keyboardExist = XInternAtom(static_cast<Display*>(ecore_x_display_get()), "X External Keyboard Exist", 0);
_XUiEventManager::~_XUiEventManager(void)
{
-
PRINT("_XUiEventManager:destruct\n");
- _Looper::GetInstance()->RemoveRawEventHandler(__pEventHandler);
+ _Looper::GetInstance()->RemoveRawEventHandler(__pEventHandler);
delete __pEventHandler;
+
+ ecore_event_handler_del(__pEcoreEventHandler);
}
result
PRINT("_XUiEventManager:PostEvent \n");
-// _UiEvent* pEvent = event.CloneN();
-// SysTryReturn(NID_UI, pEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ _UiEvent* pEvent = event.CloneN();
+ SysTryReturn(NID_UI, pEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-// Ecore_Event* pEcoreEvent = ecore_event_add(__notificaitonEventType, pEvent, FreeEvent, null);
-// SysTryReturn(NID_UI, pEcoreEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ Ecore_Event* pEcoreEvent = ecore_event_add(__notificaitonEventType, pEvent, FreeEvent, null);
+ SysTryReturn(NID_UI, pEcoreEvent, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
return r;
}
}
-
-
}} // Tizen::Ui