Diff
Modified: trunk/Source/WebKit2/ChangeLog (89210 => 89211)
--- trunk/Source/WebKit2/ChangeLog 2011-06-19 03:42:48 UTC (rev 89210)
+++ trunk/Source/WebKit2/ChangeLog 2011-06-19 03:44:03 UTC (rev 89211)
@@ -2,6 +2,36 @@
Reviewed by Sam Weinig.
+ [EFL][WK2] add WebKit2 EFL port's NativeWebMouseEvent, NativeWebWheelEvent and NativeWebKeyboardEvent
+ https://bugs.webkit.org/show_bug.cgi?id=61993
+
+ Add native mouse and keyboard event classes to convert EFL's events to NativeWebEvent.
+
+ * Shared/NativeWebKeyboardEvent.h:
+ (WebKit::NativeWebKeyboardEvent::nativeEvent):
+ * Shared/NativeWebMouseEvent.h:
+ (WebKit::NativeWebMouseEvent::nativeEvent):
+ * Shared/NativeWebWheelEvent.h:
+ (WebKit::NativeWebWheelEvent::nativeEvent):
+ * Shared/efl/NativeWebKeyboardEventEfl.cpp: Added.
+ (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
+ * Shared/efl/NativeWebMouseEventEfl.cpp: Added.
+ (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
+ * Shared/efl/NativeWebWheelEventEfl.cpp: Added.
+ (WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
+ * Shared/efl/WebEventFactory.cpp: Added.
+ (WebKit::modifiersForEvent):
+ (WebKit::buttonForEvent):
+ (WebKit::clickCountForEvent):
+ (WebKit::WebEventFactory::createWebMouseEvent):
+ (WebKit::WebEventFactory::createWebWheelEvent):
+ (WebKit::WebEventFactory::createWebKeyboardEvent):
+ * Shared/efl/WebEventFactory.h: Added.
+
+2011-06-18 Eunmi Lee <[email protected]>
+
+ Reviewed by Sam Weinig.
+
[EFL][WK2] Add missing functions of EFL port's PageClientImpl
https://bugs.webkit.org/show_bug.cgi?id=62711
Modified: trunk/Source/WebKit2/Shared/NativeWebKeyboardEvent.h (89210 => 89211)
--- trunk/Source/WebKit2/Shared/NativeWebKeyboardEvent.h 2011-06-19 03:42:48 UTC (rev 89210)
+++ trunk/Source/WebKit2/Shared/NativeWebKeyboardEvent.h 2011-06-19 03:44:03 UTC (rev 89211)
@@ -38,6 +38,8 @@
#elif PLATFORM(GTK)
#include <GOwnPtrGtk.h>
typedef union _GdkEvent GdkEvent;
+#elif PLATFORM(EFL)
+#include <Evas.h>
#endif
namespace WebKit {
@@ -53,6 +55,9 @@
#elif PLATFORM(GTK)
NativeWebKeyboardEvent(const NativeWebKeyboardEvent&);
NativeWebKeyboardEvent(GdkEvent*);
+#elif PLATFORM(EFL)
+ NativeWebKeyboardEvent(const Evas_Event_Key_Down*);
+ NativeWebKeyboardEvent(const Evas_Event_Key_Up*);
#endif
#if PLATFORM(MAC)
@@ -63,6 +68,8 @@
const QKeyEvent* nativeEvent() const { return &m_nativeEvent; }
#elif PLATFORM(GTK)
const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
+#elif PLATFORM(EFL)
+ const void* nativeEvent() const { return m_nativeEvent; }
#endif
private:
@@ -74,6 +81,8 @@
QKeyEvent m_nativeEvent;
#elif PLATFORM(GTK)
GOwnPtr<GdkEvent> m_nativeEvent;
+#elif PLATFORM(EFL)
+ const void* m_nativeEvent;
#endif
};
Modified: trunk/Source/WebKit2/Shared/NativeWebMouseEvent.h (89210 => 89211)
--- trunk/Source/WebKit2/Shared/NativeWebMouseEvent.h 2011-06-19 03:42:48 UTC (rev 89210)
+++ trunk/Source/WebKit2/Shared/NativeWebMouseEvent.h 2011-06-19 03:44:03 UTC (rev 89211)
@@ -36,6 +36,8 @@
#elif PLATFORM(GTK)
#include <GOwnPtrGtk.h>
typedef union _GdkEvent GdkEvent;
+#elif PLATFORM(EFL)
+#include <Evas.h>
#endif
namespace WebKit {
@@ -51,6 +53,10 @@
#elif PLATFORM(GTK)
NativeWebMouseEvent(const NativeWebMouseEvent&);
NativeWebMouseEvent(GdkEvent*, int);
+#elif PLATFORM(EFL)
+ NativeWebMouseEvent(const Evas_Event_Mouse_Down*, const Evas_Point*);
+ NativeWebMouseEvent(const Evas_Event_Mouse_Up*, const Evas_Point*);
+ NativeWebMouseEvent(const Evas_Event_Mouse_Move*, const Evas_Point*);
#endif
#if PLATFORM(MAC)
@@ -61,6 +67,8 @@
const QGraphicsSceneMouseEvent* nativeEvent() const { return m_nativeEvent; }
#elif PLATFORM(GTK)
const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
+#elif PLATFORM(EFL)
+ const void* nativeEvent() const { return m_nativeEvent; }
#endif
private:
@@ -72,6 +80,8 @@
QGraphicsSceneMouseEvent* m_nativeEvent;
#elif PLATFORM(GTK)
GOwnPtr<GdkEvent> m_nativeEvent;
+#elif PLATFORM(EFL)
+ const void* m_nativeEvent;
#endif
};
Modified: trunk/Source/WebKit2/Shared/NativeWebWheelEvent.h (89210 => 89211)
--- trunk/Source/WebKit2/Shared/NativeWebWheelEvent.h 2011-06-19 03:42:48 UTC (rev 89210)
+++ trunk/Source/WebKit2/Shared/NativeWebWheelEvent.h 2011-06-19 03:44:03 UTC (rev 89211)
@@ -36,6 +36,8 @@
#elif PLATFORM(GTK)
#include <GOwnPtrGtk.h>
typedef union _GdkEvent GdkEvent;
+#elif PLATFORM(EFL)
+#include <Evas.h>
#endif
namespace WebKit {
@@ -51,6 +53,8 @@
#elif PLATFORM(GTK)
NativeWebWheelEvent(const NativeWebWheelEvent&);
NativeWebWheelEvent(GdkEvent*);
+#elif PLATFORM(EFL)
+ NativeWebWheelEvent(const Evas_Event_Mouse_Wheel*, const Evas_Point*);
#endif
#if PLATFORM(MAC)
@@ -61,6 +65,8 @@
const QGraphicsSceneWheelEvent* nativeEvent() const { return m_nativeEvent; }
#elif PLATFORM(GTK)
const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
+#elif PLATFORM(EFL)
+ const Evas_Event_Mouse_Wheel* nativeEvent() const { return m_nativeEvent; }
#endif
private:
@@ -72,6 +78,8 @@
QGraphicsSceneWheelEvent* m_nativeEvent;
#elif PLATFORM(GTK)
GOwnPtr<GdkEvent> m_nativeEvent;
+#elif PLATFORM(EFL)
+ const Evas_Event_Mouse_Wheel* m_nativeEvent;
#endif
};
Added: trunk/Source/WebKit2/Shared/efl/NativeWebKeyboardEventEfl.cpp (0 => 89211)
--- trunk/Source/WebKit2/Shared/efl/NativeWebKeyboardEventEfl.cpp (rev 0)
+++ trunk/Source/WebKit2/Shared/efl/NativeWebKeyboardEventEfl.cpp 2011-06-19 03:44:03 UTC (rev 89211)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "NativeWebKeyboardEvent.h"
+
+#include "WebEventFactory.h"
+
+namespace WebKit {
+
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(const Evas_Event_Key_Down* event)
+ : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event))
+ , m_nativeEvent(event)
+{
+}
+
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(const Evas_Event_Key_Up* event)
+ : WebKeyboardEvent(WebEventFactory::createWebKeyboardEvent(event))
+ , m_nativeEvent(event)
+{
+}
+
+} // namespace WebKit
Added: trunk/Source/WebKit2/Shared/efl/NativeWebMouseEventEfl.cpp (0 => 89211)
--- trunk/Source/WebKit2/Shared/efl/NativeWebMouseEventEfl.cpp (rev 0)
+++ trunk/Source/WebKit2/Shared/efl/NativeWebMouseEventEfl.cpp 2011-06-19 03:44:03 UTC (rev 89211)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "NativeWebMouseEvent.h"
+
+#include "WebEventFactory.h"
+
+namespace WebKit {
+
+NativeWebMouseEvent::NativeWebMouseEvent(const Evas_Event_Mouse_Down* event, const Evas_Point* position)
+ : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, position))
+ , m_nativeEvent(event)
+{
+}
+
+NativeWebMouseEvent::NativeWebMouseEvent(const Evas_Event_Mouse_Up* event, const Evas_Point* position)
+ : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, position))
+ , m_nativeEvent(event)
+{
+}
+
+NativeWebMouseEvent::NativeWebMouseEvent(const Evas_Event_Mouse_Move* event, const Evas_Point* position)
+ : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, position))
+ , m_nativeEvent(event)
+{
+}
+
+} // namespace WebKit
Added: trunk/Source/WebKit2/Shared/efl/NativeWebWheelEventEfl.cpp (0 => 89211)
--- trunk/Source/WebKit2/Shared/efl/NativeWebWheelEventEfl.cpp (rev 0)
+++ trunk/Source/WebKit2/Shared/efl/NativeWebWheelEventEfl.cpp 2011-06-19 03:44:03 UTC (rev 89211)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "NativeWebWheelEvent.h"
+
+#include "WebEventFactory.h"
+
+namespace WebKit {
+
+NativeWebWheelEvent::NativeWebWheelEvent(const Evas_Event_Mouse_Wheel* event, const Evas_Point* position)
+ : WebWheelEvent(WebEventFactory::createWebWheelEvent(event, position))
+ , m_nativeEvent(event)
+{
+}
+
+} // namespace WebKit
Added: trunk/Source/WebKit2/Shared/efl/WebEventFactory.cpp (0 => 89211)
--- trunk/Source/WebKit2/Shared/efl/WebEventFactory.cpp (rev 0)
+++ trunk/Source/WebKit2/Shared/efl/WebEventFactory.cpp 2011-06-19 03:44:03 UTC (rev 89211)
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "WebEventFactory.h"
+
+#include <WebCore/NotImplemented.h>
+#include <WebCore/PlatformKeyboardEvent.h>
+#include <WebCore/Scrollbar.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+enum {
+ VerticalScrollDirection = 0,
+ HorizontalScrollDirection = 1
+};
+
+enum {
+ LeftButton = 1,
+ MiddleButton = 2,
+ RightButton = 3
+};
+
+static inline WebEvent::Modifiers modifiersForEvent(const Evas_Modifier* modifiers)
+{
+ unsigned result = 0;
+
+ if (evas_key_modifier_is_set(modifiers, "Shift"))
+ result |= WebEvent::ShiftKey;
+ if (evas_key_modifier_is_set(modifiers, "Control"))
+ result |= WebEvent::ControlKey;
+ if (evas_key_modifier_is_set(modifiers, "Alt"))
+ result |= WebEvent::AltKey;
+ if (evas_key_modifier_is_set(modifiers, "Meta"))
+ result |= WebEvent::MetaKey;
+
+ return static_cast<WebEvent::Modifiers>(result);
+}
+
+static inline WebMouseEvent::Button buttonForEvent(int button)
+{
+ if (button == LeftButton)
+ return WebMouseEvent::LeftButton;
+ if (button == MiddleButton)
+ return WebMouseEvent::MiddleButton;
+ if (button == RightButton)
+ return WebMouseEvent::RightButton;
+
+ return WebMouseEvent::NoButton;
+}
+
+static inline int clickCountForEvent(const Evas_Button_Flags flags)
+{
+ if (flags & EVAS_BUTTON_TRIPLE_CLICK)
+ return 3;
+ if (flags & EVAS_BUTTON_DOUBLE_CLICK)
+ return 2;
+
+ return 1;
+}
+
+WebMouseEvent WebEventFactory::createWebMouseEvent(const Evas_Event_Mouse_Down* event, const Evas_Point* position)
+{
+ return WebMouseEvent(WebEvent::MouseDown,
+ buttonForEvent(event->button),
+ IntPoint(event->canvas.x - position->x, event->canvas.y - position->y),
+ IntPoint(event->canvas.x, event->canvas.y),
+ 0 /* deltaX */,
+ 0 /* deltaY */,
+ 0 /* deltaZ */,
+ clickCountForEvent(event->flags),
+ modifiersForEvent(event->modifiers),
+ event->timestamp);
+}
+
+WebMouseEvent WebEventFactory::createWebMouseEvent(const Evas_Event_Mouse_Up* event, const Evas_Point* position)
+{
+ return WebMouseEvent(WebEvent::MouseUp,
+ buttonForEvent(event->button),
+ IntPoint(event->canvas.x - position->x, event->canvas.y - position->y),
+ IntPoint(event->canvas.x, event->canvas.y),
+ 0 /* deltaX */,
+ 0 /* deltaY */,
+ 0 /* deltaZ */,
+ clickCountForEvent(event->flags),
+ modifiersForEvent(event->modifiers),
+ event->timestamp);
+}
+
+WebMouseEvent WebEventFactory::createWebMouseEvent(const Evas_Event_Mouse_Move* event, const Evas_Point* position)
+{
+ return WebMouseEvent(WebEvent::MouseMove,
+ buttonForEvent(event->buttons),
+ IntPoint(event->cur.canvas.x - position->x, event->cur.canvas.y - position->y),
+ IntPoint(event->cur.canvas.x, event->cur.canvas.y),
+ 0 /* deltaX */,
+ 0 /* deltaY */,
+ 0 /* deltaZ */,
+ 0 /* clickCount */,
+ modifiersForEvent(event->modifiers),
+ event->timestamp);
+}
+
+WebWheelEvent WebEventFactory::createWebWheelEvent(const Evas_Event_Mouse_Wheel* event, const Evas_Point* position)
+{
+ float deltaX = 0;
+ float deltaY = 0;
+ float wheelTicksX = 0;
+ float wheelTicksY = 0;
+
+ // A negative z value means (in EFL) that we are scrolling down, so we need
+ // to invert the value.
+ if (event->direction == VerticalScrollDirection) {
+ deltaX = 0;
+ deltaY = - event->z;
+ } else if (event->direction == HorizontalScrollDirection) {
+ deltaX = - event->z;
+ deltaY = 0;
+ }
+
+ wheelTicksX = deltaX;
+ wheelTicksY = deltaY;
+ deltaX *= static_cast<float>(Scrollbar::pixelsPerLineStep());
+ deltaY *= static_cast<float>(Scrollbar::pixelsPerLineStep());
+
+ return WebWheelEvent(WebEvent::Wheel,
+ IntPoint(event->canvas.x - position->x, event->canvas.y - position->y),
+ IntPoint(event->canvas.x, event->canvas.y),
+ FloatSize(deltaX, deltaY),
+ FloatSize(wheelTicksX, wheelTicksY),
+ WebWheelEvent::ScrollByPixelWheelEvent,
+ modifiersForEvent(event->modifiers),
+ event->timestamp);
+}
+
+WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(const Evas_Event_Key_Down* event)
+{
+ String keyName = String(event->key);
+ return WebKeyboardEvent(WebEvent::KeyDown,
+ String::fromUTF8(event->string),
+ String::fromUTF8(event->string),
+ PlatformKeyboardEvent::keyIdentifierForEvasKeyName(keyName),
+ PlatformKeyboardEvent::windowsKeyCodeForEvasKeyName(keyName),
+ 0 /* FIXME: nativeVirtualKeyCode */,
+ 0 /* macCharCode */,
+ false /* FIXME: isAutoRepeat */,
+ false /* FIXME: isKeypad */,
+ false /* isSystemKey */,
+ modifiersForEvent(event->modifiers),
+ event->timestamp);
+}
+
+WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(const Evas_Event_Key_Up* event)
+{
+ String keyName = String(event->key);
+ return WebKeyboardEvent(WebEvent::KeyUp,
+ String::fromUTF8(event->string),
+ String::fromUTF8(event->string),
+ PlatformKeyboardEvent::keyIdentifierForEvasKeyName(keyName),
+ PlatformKeyboardEvent::windowsKeyCodeForEvasKeyName(keyName),
+ 0 /* FIXME: nativeVirtualKeyCode */,
+ 0 /* macCharCode */,
+ false /* FIXME: isAutoRepeat */,
+ false /* FIXME: isKeypad */,
+ false /* isSystemKey */,
+ modifiersForEvent(event->modifiers),
+ event->timestamp);
+}
+
+} // namespace WebKit
Copied: trunk/Source/WebKit2/Shared/efl/WebEventFactory.h (from rev 89210, trunk/Source/WebKit2/Shared/NativeWebWheelEvent.h) (0 => 89211)
--- trunk/Source/WebKit2/Shared/efl/WebEventFactory.h (rev 0)
+++ trunk/Source/WebKit2/Shared/efl/WebEventFactory.h 2011-06-19 03:44:03 UTC (rev 89211)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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.
+ */
+
+#ifndef WebEventFactory_h
+#define WebEventFactory_h
+
+#include "WebEvent.h"
+#include <Evas.h>
+
+namespace WebKit {
+
+class WebEventFactory {
+public:
+ static WebMouseEvent createWebMouseEvent(const Evas_Event_Mouse_Down*, const Evas_Point*);
+ static WebMouseEvent createWebMouseEvent(const Evas_Event_Mouse_Up*, const Evas_Point*);
+ static WebMouseEvent createWebMouseEvent(const Evas_Event_Mouse_Move*, const Evas_Point*);
+ static WebWheelEvent createWebWheelEvent(const Evas_Event_Mouse_Wheel*, const Evas_Point*);
+ static WebKeyboardEvent createWebKeyboardEvent(const Evas_Event_Key_Down*);
+ static WebKeyboardEvent createWebKeyboardEvent(const Evas_Event_Key_Up*);
+};
+
+} // namespace WebKit
+
+#endif // WebEventFactory_h