diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-10-18 18:45:13 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-10-18 18:48:03 +0300 |
commit | 4d8f12f57b0f02d3610269eae7b5981010dc7e98 (patch) | |
tree | f770f738cbbe0e24253cc829c1f587a195ac3265 /vcl/ios | |
parent | 5732ff540edbaa4ad5d92177c48e0a79e385b5cb (diff) |
More text selection WIP hacking
Change-Id: Ia29725295613faf875a688b3917b144a5f05bbe3
Diffstat (limited to 'vcl/ios')
-rw-r--r-- | vcl/ios/iosinst.cxx | 40 |
1 files changed, 22 insertions, 18 deletions
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,49 +413,53 @@ 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) { SalFrame *pFocus = IosSalInstance::getInstance()->getFocusFrame(); |