From 4d8f12f57b0f02d3610269eae7b5981010dc7e98 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 18 Oct 2013 18:45:13 +0300 Subject: More text selection WIP hacking Change-Id: Ia29725295613faf875a688b3917b144a5f05bbe3 --- vcl/ios/iosinst.cxx | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'vcl/ios') diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx index b4e7257b317a..2416bf6c97d5 100644 --- a/vcl/ios/iosinst.cxx +++ b/vcl/ios/iosinst.cxx @@ -413,48 +413,52 @@ void touch_lo_render_windows(void *context, int minX, int minY, int width, int h extern "C" void touch_lo_tap(int x, int y) { - SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); - if (pFocus) { - MouseEvent aEvent; - sal_uLong nEvent; - - aEvent = MouseEvent(Point(x, y), 1, MOUSE_SIMPLECLICK, MOUSE_LEFT); - nEvent = VCLEVENT_WINDOW_MOUSEBUTTONDOWN; - Application::PostMouseEvent(nEvent, pFocus->GetWindow(), &aEvent); - - nEvent = VCLEVENT_WINDOW_MOUSEBUTTONUP; - Application::PostMouseEvent(nEvent, pFocus->GetWindow(), &aEvent); - } + touch_lo_mouse(x, y, DOWN, NONE); + touch_lo_mouse(x, y, UP, NONE); } extern "C" -void touch_lo_mouse_drag(int x, int y, MLOMouseButtonState state) +void touch_lo_mouse(int x, int y, MLOMouseButtonState state, MLOModifierMask modifiers) { SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); if (pFocus) { MouseEvent aEvent; sal_uLong nEvent; + sal_uInt16 nModifiers = 0; + + if (modifiers & SHIFT) + nModifiers |= KEY_SHIFT; + + if (modifiers & META) + nModifiers |= KEY_MOD1; - switch(state) { + switch (state) { case DOWN: - aEvent = MouseEvent(Point(x, y), 1, MOUSE_SIMPLECLICK, MOUSE_LEFT); + aEvent = MouseEvent(Point(x, y), 1, MOUSE_SIMPLECLICK, MOUSE_LEFT, nModifiers); nEvent = VCLEVENT_WINDOW_MOUSEBUTTONDOWN; break; case MOVE: - aEvent = MouseEvent(Point(x, y), 1, MOUSE_SIMPLEMOVE, MOUSE_LEFT); + aEvent = MouseEvent(Point(x, y), 1, MOUSE_SIMPLEMOVE, MOUSE_LEFT, nModifiers); nEvent = VCLEVENT_WINDOW_MOUSEMOVE; break; case UP: - aEvent = MouseEvent(Point(x, y), 1, MOUSE_SIMPLECLICK, MOUSE_LEFT); + aEvent = MouseEvent(Point(x, y), 1, MOUSE_SIMPLECLICK, MOUSE_LEFT, nModifiers); nEvent = VCLEVENT_WINDOW_MOUSEBUTTONUP; break; + default: + assert(false); } - Application::PostMouseEvent(nEvent, pFocus->GetWindow(), &aEvent); } } +extern "C" +void touch_lo_mouse_drag(int x, int y, MLOMouseButtonState state) +{ + touch_lo_mouse(x, y, state, NONE); +} + extern "C" void touch_lo_pan(int deltaX, int deltaY) { -- cgit