summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-07-29 11:20:34 +0530
committerJan Holesovsky <kendy@collabora.com>2017-11-15 17:07:08 +0100
commitbd54b582bb5ec491fcb67e7f7b062f8a8ac64faf (patch)
tree4caa81ac49a13545cf1912608cf3325484bfea9a /desktop
parent9b48b88e192ae1708b130da63999375e215216ff (diff)
lokdialog: Set up intial posting mouse events to dialogs
Events from the dialog in GTV are forwarded correctly, but the events are still not processed by the dialog in core. Change-Id: Ib95ac0a3cd23f6cc2763c21425a67402b15f2de2
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx46
1 files changed, 45 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 45a1527f7c37..ed891b44a32c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -563,6 +563,11 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis,
int nType,
int nCharCode,
int nKeyCode);
+static void doc_postDialogKeyEvent(LibreOfficeKitDocument* pThis,
+ const char* pDialogId,
+ int nType,
+ int nCharCode,
+ int nKeyCode);
static void doc_postMouseEvent (LibreOfficeKitDocument* pThis,
int nType,
int nX,
@@ -570,6 +575,14 @@ static void doc_postMouseEvent (LibreOfficeKitDocument* pThis,
int nCount,
int nButtons,
int nModifier);
+static void doc_postDialogMouseEvent (LibreOfficeKitDocument* pThis,
+ const char* pDialogId,
+ int nType,
+ int nX,
+ int nY,
+ int nCount,
+ int nButtons,
+ int nModifier);
static void doc_postUnoCommand(LibreOfficeKitDocument* pThis,
const char* pCommand,
const char* pArguments,
@@ -637,7 +650,9 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
m_pDocumentClass->initializeForRendering = doc_initializeForRendering;
m_pDocumentClass->registerCallback = doc_registerCallback;
m_pDocumentClass->postKeyEvent = doc_postKeyEvent;
+ m_pDocumentClass->postDialogKeyEvent = doc_postDialogKeyEvent;
m_pDocumentClass->postMouseEvent = doc_postMouseEvent;
+ m_pDocumentClass->postDialogMouseEvent = doc_postDialogMouseEvent;
m_pDocumentClass->postUnoCommand = doc_postUnoCommand;
m_pDocumentClass->setTextSelection = doc_setTextSelection;
m_pDocumentClass->getTextSelection = doc_getTextSelection;
@@ -2110,10 +2125,24 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar
gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
return;
}
-
pDoc->postKeyEvent(nType, nCharCode, nKeyCode);
}
+static void doc_postDialogKeyEvent(LibreOfficeKitDocument* pThis, const char* pDialogId, int nType, int nCharCode, int nKeyCode)
+{
+ SolarMutexGuard aGuard;
+
+ IDialogRenderable* pDoc = getDialogRenderable(pThis);
+ if (!pDoc)
+ {
+ gImpl->maLastExceptionMsg = "Document doesn't support dialog rendering";
+ return;
+ }
+
+ vcl::DialogID aDialogID = OUString::createFromAscii(pDialogId);
+ pDoc->postDialogKeyEvent(aDialogID, nType, nCharCode, nKeyCode);
+}
+
/** Class to react on finishing of a dispatched command.
This will call a LOK_COMMAND_FINISHED callback when postUnoCommand was
@@ -2265,6 +2294,21 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX,
}
}
+static void doc_postDialogMouseEvent(LibreOfficeKitDocument* pThis, const char* pDialogId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
+{
+ SolarMutexGuard aGuard;
+
+ IDialogRenderable* pDoc = getDialogRenderable(pThis);
+ if (!pDoc)
+ {
+ gImpl->maLastExceptionMsg = "Document doesn't support dialog rendering";
+ return;
+ }
+
+ vcl::DialogID aDialogID = OUString::createFromAscii(pDialogId);
+ pDoc->postDialogMouseEvent(aDialogID, nType, nX, nY, nCount, nButtons, nModifier);
+}
+
static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY)
{
SolarMutexGuard aGuard;