summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2023-02-05 17:47:34 +0100
committerTomaž Vajngerl <quikee@gmail.com>2023-02-07 07:29:38 +0000
commit4855dbf52bc3f371beef41561d271a9da362171b (patch)
tree29303673d582a089d0a02c7b13ffa7705f534c98 /vcl/source/window
parent28b55ce5943712ffa17f5e9a35d5945765fc71fe (diff)
lok: form controls: rendering and mouse event forwarding
What we got - Most controls rendered on Writer and Impress (on Calc already implemented by Tomaž Vajngerl) - Text labels rendered correctly - Mouse events forwarded to controls - Control state changed on click for Writer and Calc - Control invalidation for all apps - Fixed broken LOK_CALLBACK_MOUSE_POINTER msg - Correct pointer style when mouse is hovering over a control Need to be improved - in impress click method for a control is not executed even if the mouse event is forwarded correctly - avoid not needed control invalidations (as the one occurring on document autosaving) Change-Id: I4d5012af7f90a2c726b6b6b5b068e2be1ed5568a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146569 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/DocWindow.cxx40
-rw-r--r--vcl/source/window/mouse.cxx24
2 files changed, 40 insertions, 24 deletions
diff --git a/vcl/source/window/DocWindow.cxx b/vcl/source/window/DocWindow.cxx
new file mode 100644
index 000000000000..92c6f9f9ecad
--- /dev/null
+++ b/vcl/source/window/DocWindow.cxx
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
+#include <sal/log.hxx>
+#include <vcl/DocWindow.hxx>
+#include <vcl/ITiledRenderable.hxx>
+
+
+namespace vcl
+{
+void DocWindow::SetPointer( PointerStyle nPointer )
+{
+ Window::SetPointer(nPointer);
+
+ VclPtr<vcl::Window> pWin = GetParentWithLOKNotifier();
+ if (!pWin)
+ return;
+
+ PointerStyle aPointer = GetPointer();
+ // We don't map all possible pointers hence we need a default
+ OString aPointerString = "default";
+ auto aIt = vcl::gaLOKPointerMap.find(aPointer);
+ if (aIt != vcl::gaLOKPointerMap.end())
+ {
+ aPointerString = aIt->second;
+ }
+
+ pWin->GetLOKNotifier()->libreOfficeKitViewCallback(LOK_CALLBACK_MOUSE_POINTER, aPointerString.getStr());
+}
+} // namespace vcl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index c77391f8393a..ae58d7eb63f1 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -492,30 +492,6 @@ void Window::SetPointer( PointerStyle nPointer )
// possibly immediately move pointer
if ( !mpWindowImpl->mpFrameData->mbInMouseMove && ImplTestMousePointerSet() )
mpWindowImpl->mpFrame->SetPointer( ImplGetMousePointer() );
-
- VclPtr<vcl::Window> pWin = GetParentWithLOKNotifier();
- if (!pWin)
- return;
-
- PointerStyle aPointer = GetPointer();
- // We don't map all possible pointers hence we need a default
- OString aPointerString = "default";
- auto aIt = vcl::gaLOKPointerMap.find(aPointer);
- if (aIt != vcl::gaLOKPointerMap.end())
- {
- aPointerString = aIt->second;
- }
-
- // issue mouse pointer events only for document windows
- // Doc windows' immediate parent SfxFrameViewWindow_Impl is the one with
- // parent notifier set during initialization
- if ((ImplGetFrameData()->mbDragging &&
- ImplGetFrameData()->mpMouseDownWin == this) ||
- (GetParent()->ImplGetWindowImpl()->mbLOKParentNotifier &&
- GetParent()->ImplGetWindowImpl()->mnLOKWindowId == 0))
- {
- pWin->GetLOKNotifier()->libreOfficeKitViewCallback(LOK_CALLBACK_MOUSE_POINTER, aPointerString.getStr());
- }
}
void Window::EnableChildPointerOverwrite( bool bOverwrite )