summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-07-29 11:20:34 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-10-02 10:57:56 +0530
commit47111c3a5a732ead4039c7c78077ac12ab0238e8 (patch)
tree917b0550cd57293dec444b2169acb2f68ace1d71 /desktop
parent2508ec1041098382524eb9b06fcb249af7f7a313 (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 7abb8359b9f5..8246894e22dc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -544,6 +544,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,
@@ -551,6 +556,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,
@@ -618,7 +631,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;
@@ -2121,10 +2136,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
@@ -2276,6 +2305,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;