diff --git a/Source/WebKit/PlatformHaiku.cmake b/Source/WebKit/PlatformHaiku.cmake index 9ca974878861..d3b175cbf5b1 100644 --- a/Source/WebKit/PlatformHaiku.cmake +++ b/Source/WebKit/PlatformHaiku.cmake @@ -28,6 +28,8 @@ list(APPEND WebKit_SOURCES Shared/haiku/WebCoreArgumentCodersHaiku.cpp Shared/haiku/WebMemorySamplerHaiku.cpp Shared/haiku/AuxiliaryProcessMainHaiku.cpp + Shared/haiku/NativeWebMouseEventHaiku.cpp + Shared/haiku/WebEventFactory.cpp UIProcess/API/C/haiku/WKView.cpp UIProcess/API/haiku/APIWebsiteDataStoreHaiku.cpp diff --git a/Source/WebKit/Shared/haiku/WebEventFactory.cpp b/Source/WebKit/Shared/haiku/WebEventFactory.cpp index ca9b550509bd..ce53843cca99 100644 --- a/Source/WebKit/Shared/haiku/WebEventFactory.cpp +++ b/Source/WebKit/Shared/haiku/WebEventFactory.cpp @@ -22,22 +22,28 @@ * 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 +#include + +#include +#include +#include enum { BUTTON_PRESS = 'btps', BUTTON_RELEASE = 'btrl', MOUSE_MOVEMENT = 'mmmv', -} +}; namespace WebKit { - static inline int clickCount(WebEvent::Type type, WebMouseEvent::Button button, const POINT& position, int64_t timeStampSeconds) + static inline int clickCount(WebEvent::Type type, WebMouseEvent::Button button, const BPoint& position, int64 timeStampSeconds) { static int gLastClickCount; - static int64_t gLastClickTime; - static POINT lastClickPosition; + static int64 gLastClickTime; + static BPoint lastClickPosition; static WebMouseEvent::Button lastClickButton = WebMouseEvent::LeftButton; bool cancelPreviousClick = 0; @@ -62,9 +68,14 @@ namespace WebKit return gLastClickCount; } + static inline OptionSet modifiersForEvent() + { + OptionSet modifier; + return modifier; + } static inline WebMouseEvent::Button buttonForEvent(const BMessage* message) { - int32_t buttonType; + int32 buttonType; unsigned button = 0; message->FindInt32("button",&buttonType); switch(buttonType) @@ -82,10 +93,10 @@ namespace WebKit return static_cast(button); } - static WebMouseEvent createWebMouseEvent(const BMessage* message) + WebMouseEvent WebEventFactory::createWebMouseEvent(const BMessage* message) { WebEvent::Type type = static_cast(0); - int32_t mouseEventType; + int32 mouseEventType; message->FindInt32("type",&mouseEventType); switch(mouseEventType) { @@ -105,13 +116,15 @@ namespace WebKit BPoint where; message->FindPoint("where",&where); - int64_t when; + int64 when; message->FindInt64("when",&when); - /*return WebMouseEvent( - type,buttonForEvent(message),0,IntPoint(where),IntPoint(where), - 0,0,0, - )*/ + WebMouseEvent::Button button = buttonForEvent(message); + + return WebMouseEvent( + type,button,0,WebCore::IntPoint(where),WebCore::IntPoint(where), + 0,0,0,clickCount(type,button,where,when),modifiersForEvent(),WTF::WallTime::now() + ); //it says some deltax delta y should it be added from be_deltax? } diff --git a/Source/WebKit/UIProcess/API/haiku/WebViewBase.cpp b/Source/WebKit/UIProcess/API/haiku/WebViewBase.cpp index e3ab5490f711..22c3643f9412 100644 --- a/Source/WebKit/UIProcess/API/haiku/WebViewBase.cpp +++ b/Source/WebKit/UIProcess/API/haiku/WebViewBase.cpp @@ -27,7 +27,11 @@ #include "DrawingAreaProxyCoordinatedGraphics.h" #include "WebProcessPool.h" #include "WebPageGroup.h" + +#include "NativeWebMouseEvent.h" + #include +#include using namespace WebKit; using namespace WebCore; @@ -93,5 +97,7 @@ void WebViewBase::Draw(BRect update) } void WebViewBase::MouseMoved(BPoint where,uint32 code,const BMessage* dragMessage) { + BMessage* mouseMessage = Looper()->DetachCurrentMessage(); + NativeWebMouseEvent mouseEvent = NativeWebMouseEvent(mouseMessage); }