diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-11-24 18:50:05 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-28 19:49:18 +0100 |
commit | 80d9696eb76e69101996c7a35ffec4c247e079d8 (patch) | |
tree | 2594fea36623214f7be95ada417e2813bbc9a8ed /vcl | |
parent | 42777e61a4060b7b78795a5bb89e3155327a2555 (diff) |
lokdialog: Move the painting down to Window, and enable Calc and Impress.
Tested with .uno:FormatCellDialog in Calc, Impress not tested.
Change-Id: I6d911c29616988db0625be9e2a63cf2172c69ee8
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/Library_vcl.mk | 1 | ||||
-rw-r--r-- | vcl/source/app/IDialogRenderable.cxx | 22 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 116 | ||||
-rw-r--r-- | vcl/source/window/floatwin.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 118 |
5 files changed, 123 insertions, 136 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 701eb5c78abe..61e854a674b6 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -341,7 +341,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/app/IconThemeScanner \ vcl/source/app/IconThemeSelector \ vcl/source/app/ITiledRenderable \ - vcl/source/app/IDialogRenderable \ vcl/source/app/sound \ vcl/source/app/stdtext \ vcl/source/app/svapp \ diff --git a/vcl/source/app/IDialogRenderable.cxx b/vcl/source/app/IDialogRenderable.cxx deleted file mode 100644 index 58ec05265101..000000000000 --- a/vcl/source/app/IDialogRenderable.cxx +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- 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 <vcl/IDialogRenderable.hxx> - -namespace vcl -{ - -IDialogRenderable::~IDialogRenderable() -{ -} - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 6eab80b0c2f6..c1265b69e1b9 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -884,75 +884,16 @@ void Dialog::paintDialog(VirtualDevice& rDevice) PaintToDevice(&rDevice, Point(0, 0), Size()); } -Size Dialog::PaintActiveFloatingWindow(VirtualDevice& rDevice) -{ - Size aRet; - ImplSVData* pSVData = ImplGetSVData(); - FloatingWindow* pFirstFloat = pSVData->maWinData.mpFirstFloat; - if (pFirstFloat) - { - // TODO:: run a while loop here and check all the active floating - // windows ( chained together, cf. pFirstFloat->mpNextFloat ) - // For now just assume that the active floating window is the one we - // want to render - if (pFirstFloat->GetParentDialog() == this) - { - pFirstFloat->PaintToDevice(&rDevice, Point(0, 0), Size()); - aRet = ::isLayoutEnabled(pFirstFloat) ? pFirstFloat->get_preferred_size() : pFirstFloat->GetSizePixel(); - } - - pFirstFloat = nullptr; - } - - return aRet; -} - -void Dialog::LogicMouseButtonDownChild(const MouseEvent& rMouseEvent) -{ - assert(comphelper::LibreOfficeKit::isActive()); - - ImplSVData* pSVData = ImplGetSVData(); - FloatingWindow* pFirstFloat = pSVData->maWinData.mpFirstFloat; - if (pFirstFloat && pFirstFloat->GetParentDialog() == this) - { - ImplWindowFrameProc(pFirstFloat->ImplGetBorderWindow(), SalEvent::ExternalMouseButtonDown, &rMouseEvent); - } -} - -void Dialog::LogicMouseButtonUpChild(const MouseEvent& rMouseEvent) -{ - assert(comphelper::LibreOfficeKit::isActive()); - - ImplSVData* pSVData = ImplGetSVData(); - FloatingWindow* pFirstFloat = pSVData->maWinData.mpFirstFloat; - if (pFirstFloat && pFirstFloat->GetParentDialog() == this) - { - ImplWindowFrameProc(pFirstFloat->ImplGetBorderWindow(), SalEvent::ExternalMouseButtonUp, &rMouseEvent); - } -} - -void Dialog::LogicMouseMoveChild(const MouseEvent& rMouseEvent) -{ - assert(comphelper::LibreOfficeKit::isActive()); - - ImplSVData* pSVData = ImplGetSVData(); - FloatingWindow* pFirstFloat = pSVData->maWinData.mpFirstFloat; - if (pFirstFloat && pFirstFloat->GetParentDialog() == this) - { - ImplWindowFrameProc(pFirstFloat->ImplGetBorderWindow(), SalEvent::ExternalMouseMove, &rMouseEvent); - } -} - void Dialog::InvalidateFloatingWindow(const Point& rPos) { if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - pNotifier->notifyDialogChild(GetLOKWindowId(), "invalidate", rPos); + pNotifier->notifyWindowChild(GetLOKWindowId(), "invalidate", rPos); } void Dialog::CloseFloatingWindow() { if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - pNotifier->notifyDialogChild(GetLOKWindowId(), "close", Point(0, 0)); + pNotifier->notifyWindowChild(GetLOKWindowId(), "close", Point(0, 0)); } void Dialog::LogicInvalidate(const Rectangle* pRectangle) @@ -966,59 +907,10 @@ void Dialog::LogicInvalidate(const Rectangle* pRectangle) if (pRectangle) aPayload.push_back(std::make_pair(OString("rectangle"), pRectangle->toString())); - pNotifier->notifyDialog(GetLOKWindowId(), "invalidate", aPayload); + pNotifier->notifyWindow(GetLOKWindowId(), "invalidate", aPayload); } } -void Dialog::LogicMouseButtonDown(const MouseEvent& rMouseEvent) -{ - // When we're not doing tiled rendering, then positions must be passed as pixels. - assert(comphelper::LibreOfficeKit::isActive()); - - ImplWindowFrameProc(this, SalEvent::ExternalMouseButtonDown, &rMouseEvent); -} - -void Dialog::LogicMouseButtonUp(const MouseEvent& rMouseEvent) -{ - // When we're not doing tiled rendering, then positions must be passed as pixels. - assert(comphelper::LibreOfficeKit::isActive()); - - ImplWindowFrameProc(this, SalEvent::ExternalMouseButtonUp, &rMouseEvent); -} - -void Dialog::LogicMouseMove(const MouseEvent& rMouseEvent) -{ - // When we're not doing tiled rendering, then positions must be passed as pixels. - assert(comphelper::LibreOfficeKit::isActive()); - - ImplWindowFrameProc(this, SalEvent::ExternalMouseMove, &rMouseEvent); -} - -void Dialog::LOKKeyInput(const KeyEvent& rKeyEvent) -{ - assert(comphelper::LibreOfficeKit::isActive()); - - ImplWindowFrameProc(this, SalEvent::ExternalKeyInput, &rKeyEvent); -} - -void Dialog::LOKKeyUp(const KeyEvent& rKeyEvent) -{ - assert(comphelper::LibreOfficeKit::isActive()); - - ImplWindowFrameProc(this, SalEvent::ExternalKeyUp, &rKeyEvent); -} - -void Dialog::LOKCursor(const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload) -{ - assert(comphelper::LibreOfficeKit::isActive()); - - if (comphelper::LibreOfficeKit::isDialogPainting()) - return; - - if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - pNotifier->notifyDialog(GetLOKWindowId(), rAction, rPayload); -} - void Dialog::ensureRepaint() { // ensure repaint @@ -1350,7 +1242,7 @@ void Dialog::Resize() // inform LOK clients if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) - pNotifier->notifyDialog(GetLOKWindowId(), "invalidate"); + pNotifier->notifyWindow(GetLOKWindowId(), "invalidate"); } bool Dialog::set_property(const OString &rKey, const OString &rValue) diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 9ce9cd378b59..6a3385360ed7 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -734,7 +734,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags { std::vector<vcl::LOKPayloadItem> aItems; aItems.emplace_back(std::make_pair("size", rRect.GetSize().toString())); - pNotifier->notifyDialog(GetLOKWindowId(), "created", aItems); + pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems); } } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 7ba762908114..b0d87fdef301 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -65,6 +65,7 @@ #include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp> #include <com/sun/star/rendering/CanvasFactory.hpp> #include <com/sun/star/rendering/XSpriteCanvas.hpp> +#include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <unotools/configmgr.hxx> @@ -3214,6 +3215,123 @@ vcl::LOKWindowId Window::GetLOKWindowId() const return mpWindowImpl->mnLOKWindowId; } +void Window::paintDialog(VirtualDevice& rDevice) +{ + // FIXME are these two necessary? + Show(); + ToTop(); + + PaintToDevice(&rDevice, Point(0, 0), Size()); +} + +Size Window::PaintActiveFloatingWindow(VirtualDevice& rDevice) const +{ + Size aRet; + ImplSVData* pSVData = ImplGetSVData(); + FloatingWindow* pFirstFloat = pSVData->maWinData.mpFirstFloat; + if (pFirstFloat) + { + // TODO:: run a while loop here and check all the active floating + // windows ( chained together, cf. pFirstFloat->mpNextFloat ) + // For now just assume that the active floating window is the one we + // want to render + if (pFirstFloat->GetParentDialog() == this) + { + pFirstFloat->PaintToDevice(&rDevice, Point(0, 0), Size()); + aRet = pFirstFloat->GetSizePixel(); + } + + pFirstFloat = nullptr; + } + + return aRet; +} + +void Window::LogicMouseButtonDown(const MouseEvent& rMouseEvent) +{ + // When we're not doing tiled rendering, then positions must be passed as pixels. + assert(comphelper::LibreOfficeKit::isActive()); + + ImplWindowFrameProc(this, SalEvent::ExternalMouseButtonDown, &rMouseEvent); +} + +void Window::LogicMouseButtonUp(const MouseEvent& rMouseEvent) +{ + // When we're not doing tiled rendering, then positions must be passed as pixels. + assert(comphelper::LibreOfficeKit::isActive()); + + ImplWindowFrameProc(this, SalEvent::ExternalMouseButtonUp, &rMouseEvent); +} + +void Window::LogicMouseMove(const MouseEvent& rMouseEvent) +{ + // When we're not doing tiled rendering, then positions must be passed as pixels. + assert(comphelper::LibreOfficeKit::isActive()); + + ImplWindowFrameProc(this, SalEvent::ExternalMouseMove, &rMouseEvent); +} + +void Window::LogicMouseButtonDownChild(const MouseEvent& rMouseEvent) +{ + assert(comphelper::LibreOfficeKit::isActive()); + + ImplSVData* pSVData = ImplGetSVData(); + FloatingWindow* pFirstFloat = pSVData->maWinData.mpFirstFloat; + if (pFirstFloat && pFirstFloat->GetParentDialog() == this) + { + ImplWindowFrameProc(pFirstFloat->ImplGetBorderWindow(), SalEvent::ExternalMouseButtonDown, &rMouseEvent); + } +} + +void Window::LogicMouseButtonUpChild(const MouseEvent& rMouseEvent) +{ + assert(comphelper::LibreOfficeKit::isActive()); + + ImplSVData* pSVData = ImplGetSVData(); + FloatingWindow* pFirstFloat = pSVData->maWinData.mpFirstFloat; + if (pFirstFloat && pFirstFloat->GetParentDialog() == this) + { + ImplWindowFrameProc(pFirstFloat->ImplGetBorderWindow(), SalEvent::ExternalMouseButtonUp, &rMouseEvent); + } +} + +void Window::LogicMouseMoveChild(const MouseEvent& rMouseEvent) +{ + assert(comphelper::LibreOfficeKit::isActive()); + + ImplSVData* pSVData = ImplGetSVData(); + FloatingWindow* pFirstFloat = pSVData->maWinData.mpFirstFloat; + if (pFirstFloat && pFirstFloat->GetParentDialog() == this) + { + ImplWindowFrameProc(pFirstFloat->ImplGetBorderWindow(), SalEvent::ExternalMouseMove, &rMouseEvent); + } +} + +void Window::LOKKeyInput(const KeyEvent& rKeyEvent) +{ + assert(comphelper::LibreOfficeKit::isActive()); + + ImplWindowFrameProc(this, SalEvent::ExternalKeyInput, &rKeyEvent); +} + +void Window::LOKKeyUp(const KeyEvent& rKeyEvent) +{ + assert(comphelper::LibreOfficeKit::isActive()); + + ImplWindowFrameProc(this, SalEvent::ExternalKeyUp, &rKeyEvent); +} + +void Window::LOKCursor(const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload) +{ + assert(comphelper::LibreOfficeKit::isActive()); + + if (comphelper::LibreOfficeKit::isDialogPainting()) + return; + + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + pNotifier->notifyWindow(GetLOKWindowId(), rAction, rPayload); +} + void Window::ImplCallDeactivateListeners( vcl::Window *pNew ) { // no deactivation if the newly activated window is my child |