[BlackBerry] Sync up PlatformMouseEvent
authorleo.yang@torchmobile.com.cn <leo.yang@torchmobile.com.cn@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2012 03:31:45 +0000 (03:31 +0000)
committerleo.yang@torchmobile.com.cn <leo.yang@torchmobile.com.cn@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2012 03:31:45 +0000 (03:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82567

Reviewed by Rob Buis.

This patch is adding blackberry specific members to PlatformMouseEvent.
Also re-base PlatformMouseEventBlackBerry to adapt to the re-factor
of PlatformMouseEvent.

* platform/PlatformMouseEvent.h:
(PlatformMouseEvent): BlackBerry specific constructor.
(WebCore::PlatformMouseEvent::inputMethod): Input source of mouse event
for blackberry platform.
* platform/blackberry/PlatformMouseEventBlackBerry.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent): Re-base the constructor
to adapt the re-factor of PlatformMouseEvent.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112641 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/PlatformMouseEvent.h
Source/WebCore/platform/blackberry/PlatformMouseEventBlackBerry.cpp

index f4c187d..abe2332 100644 (file)
@@ -1,5 +1,24 @@
 2012-03-29  Leo Yang  <leo.yang@torchmobile.com.cn>
 
+        [BlackBerry] Sync up PlatformMouseEvent
+        https://bugs.webkit.org/show_bug.cgi?id=82567
+
+        Reviewed by Rob Buis.
+
+        This patch is adding blackberry specific members to PlatformMouseEvent.
+        Also re-base PlatformMouseEventBlackBerry to adapt to the re-factor
+        of PlatformMouseEvent.
+
+        * platform/PlatformMouseEvent.h:
+        (PlatformMouseEvent): BlackBerry specific constructor.
+        (WebCore::PlatformMouseEvent::inputMethod): Input source of mouse event
+        for blackberry platform.
+        * platform/blackberry/PlatformMouseEventBlackBerry.cpp:
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent): Re-base the constructor
+        to adapt the re-factor of PlatformMouseEvent.
+
+2012-03-29  Leo Yang  <leo.yang@torchmobile.com.cn>
+
         [BlackBerry] Turn on STORE_FONT_CUSTOM_PLATFORM_DATA in CachedFont.cpp
         https://bugs.webkit.org/show_bug.cgi?id=82573
 
index 20aecf1..44c9f5d 100644 (file)
@@ -55,6 +55,10 @@ namespace WebCore {
     
     // These button numbers match the ones used in the DOM API, 0 through 2, except for NoButton which isn't specified.
     enum MouseButton { NoButton = -1, LeftButton, MiddleButton, RightButton };
+
+#if PLATFORM(BLACKBERRY)
+    enum MouseInputMethod { PointingDevice, TouchScreen };
+#endif
     
     class PlatformMouseEvent : public PlatformEvent {
     public:
@@ -125,6 +129,10 @@ namespace WebCore {
         PlatformMouseEvent(const wxMouseEvent&, const wxPoint& globalPoint, int clickCount);
 #endif
 
+#if PLATFORM(BLACKBERRY)
+        PlatformMouseEvent(const IntPoint& eventPosition, const IntPoint& globalPosition, const PlatformEvent::Type, int clickCount, MouseButton, MouseInputMethod = PointingDevice);
+        MouseInputMethod inputMethod() const { return m_inputMethod; }
+#endif
     protected:
         IntPoint m_position;
         IntPoint m_globalPosition;
@@ -139,6 +147,8 @@ namespace WebCore {
         int m_eventNumber;
 #elif PLATFORM(WIN)
         bool m_didActivateWebView;
+#elif PLATFORM(BLACKBERRY)
+        MouseInputMethod m_inputMethod;
 #endif
     };
 
index a24a1d3..a8d9609 100644 (file)
 
 namespace WebCore {
 
-PlatformMouseEvent::PlatformMouseEvent(const IntPoint& eventPos, const IntPoint& globalPos, const MouseEventType type, int clickCount, MouseButton button, MouseInputMethod method)
-    : m_position(eventPos)
-    , m_globalPosition(globalPos)
+PlatformMouseEvent::PlatformMouseEvent(const IntPoint& eventPosition, const IntPoint& globalPosition, const PlatformEvent::Type type, int clickCount, MouseButton button, MouseInputMethod method)
+    : PlatformEvent(type, false, false, false, false, currentTime())
+    , m_position(eventPosition)
+    , m_globalPosition(globalPosition)
     , m_button(button)
-    , m_eventType(type)
     , m_clickCount(clickCount)
-    , m_shiftKey(false)
-    , m_ctrlKey(false)
-    , m_altKey(false)
-    , m_metaKey(false)
-    , m_timestamp(currentTime())
     , m_inputMethod(method)
 {
-    ASSERT(type != MouseEventScroll);
+    ASSERT(type != MouseScroll);
 }
 
 } // namespace WebCore