bool SendTouchEvent(const TouchEvent& touch)
{
- Ewk_Touch_Event_Type type = EWK_TOUCH_START;
- Evas_Touch_Point_State state = EVAS_TOUCH_POINT_DOWN;
+ Ewk_Mouse_Button_Type type = (Ewk_Mouse_Button_Type)0;
+ switch (touch.GetMouseButton(0))
+ {
+ case MouseButton::PRIMARY:
+ {
+ type = EWK_Mouse_Button_Left;
+ break;
+ }
+ case MouseButton::TERTIARY:
+ {
+ type = EWK_Mouse_Button_Middle;
+ break;
+ }
+ case MouseButton::SECONDARY:
+ {
+ type = EWK_Mouse_Button_Right;
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
switch (touch.GetState(0))
{
case PointState::DOWN:
{
- type = EWK_TOUCH_START;
- state = EVAS_TOUCH_POINT_DOWN;
+ float x = touch.GetScreenPosition(0).x;
+ float y = touch.GetScreenPosition(0).y;
+ ewk_view_feed_mouse_down(mWebView, type, x, y);
break;
}
case PointState::UP:
{
- type = EWK_TOUCH_END;
- state = EVAS_TOUCH_POINT_UP;
+ float x = touch.GetScreenPosition(0).x;
+ float y = touch.GetScreenPosition(0).y;
+ ewk_view_feed_mouse_up(mWebView, type, x, y);
break;
}
case PointState::MOTION:
{
- type = EWK_TOUCH_MOVE;
- state = EVAS_TOUCH_POINT_MOVE;
- break;
- }
- case PointState::INTERRUPTED:
- {
- type = EWK_TOUCH_CANCEL;
- state = EVAS_TOUCH_POINT_CANCEL;
+ float x = touch.GetScreenPosition(0).x;
+ float y = touch.GetScreenPosition(0).y;
+ ewk_view_feed_mouse_move(mWebView, x, y);
break;
}
default:
break;
}
}
-
- Eina_List* pointList = 0;
- Ewk_Touch_Point* point = new Ewk_Touch_Point;
- point->id = 0;
- point->x = touch.GetScreenPosition(0).x;
- point->y = touch.GetScreenPosition(0).y;
- point->state = state;
- pointList = eina_list_append(pointList, point);
-
- ewk_view_feed_touch_event(mWebView, type, pointList, 0);
- eina_list_free(pointList);
return false;
}
return false;
}
+ bool SendWheelEvent(const WheelEvent& wheel)
+ {
+ Eina_Bool direction = wheel.GetDirection() ? false : true;
+ int step = wheel.GetDelta();
+ float x = wheel.GetPoint().x;
+ float y = wheel.GetPoint().y;
+ ewk_view_feed_mouse_wheel(mWebView, direction, step, x, y);
+ return false;
+ }
+
+ bool SendHoverEvent(const HoverEvent& hover)
+ {
+ return false;
+ }
+
void SetFocus(bool focused)
{
ecore_evas_focus_set(WebEngineManager::Get().GetWindow(), focused);
ecore_wl2_window_alpha_set(win, !enabled);
}
- bool SendHoverEvent(const HoverEvent& hover)
- {
- //TODO...left/right/middle of mouse could not be acquired now.
- Ewk_Mouse_Button_Type type = EWK_Mouse_Button_Left;
- switch (hover.GetState(0))
- {
- case PointState::DOWN:
- {
- float x = hover.GetScreenPosition(0).x;
- float y = hover.GetScreenPosition(0).y;
- ewk_view_feed_mouse_down(mWebView, type, x, y);
- break;
- }
- case PointState::UP:
- {
- float x = hover.GetScreenPosition(0).x;
- float y = hover.GetScreenPosition(0).y;
- ewk_view_feed_mouse_up(mWebView, type, x, y);
- break;
- }
- case PointState::MOTION:
- {
- float x = hover.GetScreenPosition(0).x;
- float y = hover.GetScreenPosition(0).y;
- ewk_view_feed_mouse_move(mWebView, x, y);
- break;
- }
- default:
- {
- break;
- }
- }
- return false;
- }
-
- bool SendWheelEvent(const WheelEvent& wheel)
- {
- Eina_Bool direction = wheel.GetDirection() ? true : false;
- int step = wheel.GetDelta();
- float x = wheel.GetPoint().x;
- float y = wheel.GetPoint().y;
-
- ewk_view_feed_mouse_wheel(mWebView, direction, step, x, y);
- return false;
- }
-
private:
static Dali::PixelData ConvertImageColorSpace(Evas_Object *image)
{