summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-10-22 01:06:56 +0300
committerTor Lillqvist <tml@collabora.com>2013-10-22 01:10:41 +0300
commit657a3a81828216240b6ff31377d62ca17e656368 (patch)
tree5729af9bbbd63c5d729ad183b14d52065d70fffa /vcl
parent36fb29338bbe2f3013ccedd244043e510b9ba0c1 (diff)
Try to handle selection resizing in a more "correct" way
Faking mouse clicks is a stupid way to do it of course. Try to do it "right". For now just worked on moving the end handle, but once that works, similar code should be used for the start handle, too. Does not work yet. It is hard to extract out from SwEditWin::MouseButtonDown() exactly what all is relevant, and what isn't, for this use case. Change-Id: I76a226f787facbac645aaff8b4852d693bcf4ccb
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/ios/iosinst.hxx7
-rw-r--r--vcl/ios/iosinst.cxx27
2 files changed, 34 insertions, 0 deletions
diff --git a/vcl/inc/ios/iosinst.hxx b/vcl/inc/ios/iosinst.hxx
index 2ff9e5784f14..0dfa7eb2f750 100644
--- a/vcl/inc/ios/iosinst.hxx
+++ b/vcl/inc/ios/iosinst.hxx
@@ -52,6 +52,7 @@ public:
void damaged( IosSalFrame *frame,
const basegfx::B2IBox& rDamageRect);
+ // Functions scheduled to be run as "user events" in the LO thread
typedef struct {
bool done;
CGContextRef context;
@@ -61,6 +62,12 @@ public:
DECL_LINK( DisplayConfigurationChanged, void* );
+ typedef struct {
+ const void *documentHandle;
+ int x, y;
+ } SelectionEndMoveArg;
+ DECL_LINK( SelectionEndMove, SelectionEndMoveArg* );
+
pthread_mutex_t m_aRenderMutex;
pthread_cond_t m_aRenderCond;
};
diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx
index 2416bf6c97d5..50716f030dfc 100644
--- a/vcl/ios/iosinst.cxx
+++ b/vcl/ios/iosinst.cxx
@@ -24,6 +24,7 @@
#include <basebmp/scanlineformats.hxx>
#include <vcl/msgbox.hxx>
#include <touch/touch.h>
+#include <touch/touch-impl.h>
#include "ios/iosinst.hxx"
#include "headless/svpdummies.hxx"
@@ -507,6 +508,32 @@ void touch_lo_keyboard_did_hide()
}
}
+IMPL_LINK( IosSalInstance, SelectionEndMove, SelectionEndMoveArg*, pArg )
+{
+ touch_lo_selection_end_move_impl(pArg->documentHandle, pArg->x, pArg->y);
+
+ delete pArg;
+
+ return 0;
+}
+
+extern "C"
+void touch_lo_selection_end_move(const void *documentHandle,
+ int x,
+ int y)
+{
+ IosSalInstance *pInstance = IosSalInstance::getInstance();
+
+ if ( pInstance == NULL )
+ return;
+
+ IosSalInstance::SelectionEndMoveArg *pArg = new IosSalInstance::SelectionEndMoveArg;
+ pArg->documentHandle = documentHandle;
+ pArg->x = x;
+ pArg->y = y;
+ Application::PostUserEvent( LINK( pInstance, IosSalInstance, SelectionEndMove), pArg );
+}
+
extern "C"
void touch_lo_draw_tile(void * /*context*/, int /*contextWidth*/, int /*contextHeight*/, int /*tilePosX*/, int /*tilePosY*/, int /*tileWidth*/, int /*tileHeight*/)
{