2010-12-24 Ryuan Choi <ryuan.choi@samsung.com>

        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Add option to enable Touch Events.
        https://bugs.webkit.org/show_bug.cgi?id=49125

        Add ENABLE_TOUCH_EVENTS option.

        * cmake/OptionsEfl.cmake:
        * cmakeconfig.h.cmake:
2010-12-24  Ryuan Choi  <ryuan.choi@samsung.com>

        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Add option to enable Touch Events.
        https://bugs.webkit.org/show_bug.cgi?id=49125

        Add files for EFL to support TOUCH_EVENTS.

        * CMakeLists.txt:
        * CMakeListsEfl.txt:
        * platform/PlatformTouchEvent.h: Add EFL related constructor.
        * platform/PlatformTouchPoint.h: ditto.
        * platform/efl/PlatformTouchEventEfl.cpp: Added.
        (WebCore::PlatformTouchEvent::PlatformTouchEvent):
        * platform/efl/PlatformTouchPointEfl.cpp: Added.
        (WebCore::PlatformTouchPoint::PlatformTouchPoint):
2010-12-24  Ryuan Choi  <ryuan.choi@samsung.com>

        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Add option to enable Touch Events.
        https://bugs.webkit.org/show_bug.cgi?id=49125

        Implement ewk_frame_feed_touch_event to feed touch events. Because EFL
        doesn't have touch events, Application should generate and pass it.

        * WebCoreSupport/ChromeClientEfl.h:
        (WebCore::ChromeClientEfl::needTouchEvents):
        * ewk/ewk_frame.cpp:
        (ewk_frame_feed_touch_event):
        * ewk/ewk_frame.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c246e4de
2010-12-24 Ryuan Choi <ryuan.choi@samsung.com>
Reviewed by Kenneth Rohde Christiansen.
[EFL] Add option to enable Touch Events.
https://bugs.webkit.org/show_bug.cgi?id=49125
Add ENABLE_TOUCH_EVENTS option.
* cmake/OptionsEfl.cmake:
* cmakeconfig.h.cmake:
2010-12-23 Adam Barth <abarth@webkit.org>
Rubber-stamped by Eric Seidel.
......
......@@ -898,6 +898,9 @@ SET(WebCore_SOURCES
dom/TagNodeList.cpp
dom/Text.cpp
dom/TextEvent.cpp
dom/Touch.cpp
dom/TouchEvent.cpp
dom/TouchList.cpp
dom/TransformSourceLibxslt.cpp
dom/Traversal.cpp
dom/TreeWalker.cpp
......
......@@ -39,6 +39,8 @@ LIST(APPEND WebCore_SOURCES
platform/efl/PlatformKeyboardEventEfl.cpp
platform/efl/PlatformMouseEventEfl.cpp
platform/efl/PlatformScreenEfl.cpp
platform/efl/PlatformTouchEventEfl.cpp
platform/efl/PlatformTouchPointEfl.cpp
platform/efl/PlatformWheelEventEfl.cpp
platform/efl/PopupMenuEfl.cpp
platform/efl/RenderThemeEfl.cpp
......
2010-12-24 Ryuan Choi <ryuan.choi@samsung.com>
Reviewed by Kenneth Rohde Christiansen.
[EFL] Add option to enable Touch Events.
https://bugs.webkit.org/show_bug.cgi?id=49125
Add files for EFL to support TOUCH_EVENTS.
* CMakeLists.txt:
* CMakeListsEfl.txt:
* platform/PlatformTouchEvent.h: Add EFL related constructor.
* platform/PlatformTouchPoint.h: ditto.
* platform/efl/PlatformTouchEventEfl.cpp: Added.
(WebCore::PlatformTouchEvent::PlatformTouchEvent):
* platform/efl/PlatformTouchPointEfl.cpp: Added.
(WebCore::PlatformTouchPoint::PlatformTouchPoint):
2010-12-24 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Reviewed by Kenneth Rohde Christiansen.
......
......@@ -41,6 +41,10 @@ typedef unsigned long int uint32;
#define AEEEvent uint16
#endif
#if PLATFORM(EFL)
typedef struct _Eina_List Eina_List;
#endif
namespace WebCore {
enum TouchEventType {
......@@ -65,6 +69,8 @@ public:
PlatformTouchEvent(const Vector<IntPoint>&, TouchEventType, PlatformTouchPoint::State, int metaState);
#elif PLATFORM(BREWMP)
PlatformTouchEvent(AEEEvent, uint16 wParam, uint32 dwParam);
#elif PLATFORM(EFL)
PlatformTouchEvent(Eina_List*, const IntPoint, TouchEventType, int metaState);
#endif
TouchEventType type() const { return m_type; }
......
......@@ -51,6 +51,8 @@ public:
PlatformTouchPoint(unsigned id, const IntPoint& windowPos, State);
#elif PLATFORM(BREWMP)
PlatformTouchPoint(int id, const IntPoint& windowPos, State);
#elif PLATFORM(EFL)
PlatformTouchPoint(unsigned id, const IntPoint& windowPos, State);
#endif
unsigned id() const { return m_id; }
......
/*
* Copyright (C) 2009-2010 Samsung Electronics
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "PlatformTouchEvent.h"
#include "ewk_frame.h"
#if ENABLE(TOUCH_EVENTS)
namespace WebCore {
PlatformTouchEvent::PlatformTouchEvent(Eina_List* points, const IntPoint pos, TouchEventType type, int metaState)
: m_type(type)
, m_ctrlKey(false)
, m_altKey(false)
, m_shiftKey(false)
, m_metaKey(false)
{
void* point;
EINA_LIST_FREE(points, point) {
Ewk_Touch_Point* p = static_cast<Ewk_Touch_Point*>(point);
IntPoint pnt = IntPoint(p->x - pos.x(), p->y - pos.y());
PlatformTouchPoint::State state = PlatformTouchPoint::TouchPressed;
switch (p->state) {
case EWK_TOUCH_POINT_PRESSED:
state = PlatformTouchPoint::TouchPressed;
break;
case EWK_TOUCH_POINT_RELEASED:
state = PlatformTouchPoint::TouchReleased;
break;
case EWK_TOUCH_POINT_MOVED:
state = PlatformTouchPoint::TouchMoved;
break;
case EWK_TOUCH_POINT_CANCELLED:
state = PlatformTouchPoint::TouchCancelled;
break;
}
m_touchPoints.append(PlatformTouchPoint(p->id, pnt, state));
}
// FIXME: We don't support metaState for now.
}
}
#endif
/*
* Copyright (C) 2009-2010 Samsung Electronics
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "PlatformTouchPoint.h"
#if ENABLE(TOUCH_EVENTS)
namespace WebCore {
PlatformTouchPoint::PlatformTouchPoint(unsigned id, const IntPoint& windowPos, State state)
: m_id(id)
, m_state(state)
, m_screenPos(windowPos)
, m_pos(windowPos) { }
}
#endif
2010-12-24 Ryuan Choi <ryuan.choi@samsung.com>
Reviewed by Kenneth Rohde Christiansen.
[EFL] Add option to enable Touch Events.
https://bugs.webkit.org/show_bug.cgi?id=49125
Implement ewk_frame_feed_touch_event to feed touch events. Because EFL
doesn't have touch events, Application should generate and pass it.
* WebCoreSupport/ChromeClientEfl.h:
(WebCore::ChromeClientEfl::needTouchEvents):
* ewk/ewk_frame.cpp:
(ewk_frame_feed_touch_event):
* ewk/ewk_frame.h:
2010-12-22 Sam Weinig <sam@webkit.org>
Reviewed by Darin Adler.
......
......@@ -120,6 +120,10 @@ public:
virtual void showContextMenu() { }
#endif
#if ENABLE(TOUCH_EVENTS)
virtual void needTouchEvents(bool) { }
#endif
virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
virtual void chooseIconForFiles(const Vector<String>&, FileChooser*);
virtual void formStateDidChange(const Node*);
......
......@@ -36,6 +36,7 @@
#include "KURL.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformMouseEvent.h"
#include "PlatformTouchEvent.h"
#include "PlatformWheelEvent.h"
#include "ProgressTracker.h"
#include "RefPtr.h"
......@@ -1474,6 +1475,42 @@ Eina_Bool ewk_frame_feed_mouse_move(Evas_Object* o, const Evas_Event_Mouse_Move*
return sd->frame->eventHandler()->mouseMoved(event);
}
Eina_Bool ewk_frame_feed_touch_event(Evas_Object* o, Ewk_Touch_Event_Type action, Eina_List* points, int metaState)
{
Eina_Bool ret = EINA_FALSE;
#if ENABLE(TOUCH_EVENTS)
EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(points, EINA_FALSE);
Evas_Coord x, y;
evas_object_geometry_get(sd->view, &x, &y, 0, 0);
WebCore::TouchEventType type = WebCore::TouchStart;
switch (action) {
case EWK_TOUCH_START:
type = WebCore::TouchStart;
break;
case EWK_TOUCH_END:
type = WebCore::TouchEnd;
break;
case EWK_TOUCH_MOVE:
type = WebCore::TouchMove;
break;
case EWK_TOUCH_CANCEL:
type = WebCore::TouchCancel;
break;
default:
return EINA_FALSE;
}
WebCore::PlatformTouchEvent te(points, WebCore::IntPoint(x, y), type, metaState);
ret = sd->frame->eventHandler()->handleTouchEvent(te);
#endif
return ret;
}
static inline Eina_Bool _ewk_frame_handle_key_scrolling(WebCore::Frame* frame, const WebCore::PlatformKeyboardEvent &event)
{
WebCore::ScrollDirection direction;
......
......@@ -130,6 +130,26 @@ struct _Ewk_Hit_Test {
} flags;
};
typedef enum {
EWK_TOUCH_START,
EWK_TOUCH_END,
EWK_TOUCH_MOVE,
EWK_TOUCH_CANCEL
} Ewk_Touch_Event_Type;
typedef enum {
EWK_TOUCH_POINT_PRESSED,
EWK_TOUCH_POINT_RELEASED,
EWK_TOUCH_POINT_MOVED,
EWK_TOUCH_POINT_CANCELLED
} Ewk_Touch_Point_Type;
typedef struct _Ewk_Touch_Point Ewk_Touch_Point;
struct _Ewk_Touch_Point {
unsigned int id;
int x, y;
Ewk_Touch_Point_Type state;
};
EAPI Evas_Object *ewk_frame_view_get(const Evas_Object *o);
EAPI void ewk_frame_theme_set(Evas_Object *o, const char *path);
......@@ -200,6 +220,7 @@ EAPI Eina_Bool ewk_frame_feed_mouse_wheel(Evas_Object *o, const Evas_Event_Mo
EAPI Eina_Bool ewk_frame_feed_mouse_down(Evas_Object *o, const Evas_Event_Mouse_Down *ev);
EAPI Eina_Bool ewk_frame_feed_mouse_up(Evas_Object *o, const Evas_Event_Mouse_Up *ev);
EAPI Eina_Bool ewk_frame_feed_mouse_move(Evas_Object *o, const Evas_Event_Mouse_Move *ev);
EAPI Eina_Bool ewk_frame_feed_touch_event(Evas_Object* o, Ewk_Touch_Event_Type action, Eina_List* points, int metaState);
EAPI Eina_Bool ewk_frame_feed_key_down(Evas_Object *o, const Evas_Event_Key_Down *ev);
EAPI Eina_Bool ewk_frame_feed_key_up(Evas_Object *o, const Evas_Event_Key_Up *ev);
......
......@@ -90,6 +90,7 @@ WEBKIT_FEATURE(ENABLE_SVG_ANIMATION "Enable SVG animation" DEFAULT ON SVG)
WEBKIT_FEATURE(ENABLE_SVG_FONTS "Enable SVG fonts" DEFAULT ON SVG)
WEBKIT_FEATURE(ENABLE_SVG_FOREIGN_OBJECT "Enable SVG foreign object" DEFAULT ON SVG)
WEBKIT_FEATURE(ENABLE_SVG_USE "Enable SVG use" DEFAULT ON SVG)
WEBKIT_FEATURE(ENABLE_TOUCH_EVENTS "Enable Touch Events" DEFAULT OFF)
WEBKIT_FEATURE(ENABLE_VIDEO "Enable video" DEFAULT ON HTML)
WEBKIT_FEATURE(ENABLE_WEB_SOCKETS "Enable web sockets" DEFAULT OFF)
WEBKIT_FEATURE(ENABLE_WML "Enable WML" DEFAULT OFF)
......
......@@ -33,6 +33,7 @@
#define ENABLE_SVG_FONTS @ENABLE_SVG_FONTS_VALUE@
#define ENABLE_SVG_FOREIGN_OBJECT @ENABLE_SVG_FOREIGN_OBJECT_VALUE@
#define ENABLE_SVG_USE @ENABLE_SVG_USE_VALUE@
#define ENABLE_TOUCH_EVENTS @ENABLE_TOUCH_EVENTS_VALUE@
#define ENABLE_VIDEO @ENABLE_VIDEO_VALUE@
#define ENABLE_WEB_SOCKETS @ENABLE_WEB_SOCKETS_VALUE@
#define ENABLE_WML @ENABLE_WML_VALUE@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment