diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-06-15 17:53:52 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2016-08-18 02:39:07 +0200 |
commit | 3fb0839da320bb2256b7a2dcf46363fc25bbfbc9 (patch) | |
tree | 8f31da02adb34e2cc99d49607b956e0b16ee8a96 /vcl | |
parent | eab85ed43846c7304980c098522f51de7ff11da8 (diff) |
screenshots: extend default paths where stuff gets written
Change-Id: I1886d832bb9474371ea27d4d36f0446b221246d0
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/settings.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/abstdlg.cxx | 17 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 44 | ||||
-rw-r--r-- | vcl/source/window/paint.cxx | 11 |
4 files changed, 73 insertions, 1 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 500877a2b559..c57465d04c0e 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2374,7 +2374,7 @@ ImplMiscData::ImplMiscData() static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI mbEnableLocalizedDecimalSep = (pEnv != nullptr); // Should we display any windows? - mbPseudoHeadless = getenv("VCL_HIDE_WINDOWS") || comphelper::LibreOfficeKit::isActive(); + mbPseudoHeadless = false; // getenv("VCL_HIDE_WINDOWS") || comphelper::LibreOfficeKit::isActive(); } ImplMiscData::ImplMiscData( const ImplMiscData& rData ) diff --git a/vcl/source/window/abstdlg.cxx b/vcl/source/window/abstdlg.cxx index d12d4d47d451..ebed762f3542 100644 --- a/vcl/source/window/abstdlg.cxx +++ b/vcl/source/window/abstdlg.cxx @@ -57,6 +57,23 @@ VclAbstractDialog::~VclAbstractDialog() { } +std::vector<OUString> VclAbstractDialog::getAllPageUIXMLDescriptions() const +{ + // default has no pages + return std::vector<OUString>(); +} + +void VclAbstractDialog::selectPageByUIXMLDescription(const OUString& /*rUIXMLDescription*/) +{ + // default cannot select a page +} + +Bitmap VclAbstractDialog::createScreenshot() const +{ + // default returns empty bitmap + return Bitmap(); +} + // virtual VclAbstractDialog2::~VclAbstractDialog2() { diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index ec4a3be527ef..837791ef012e 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -351,6 +351,7 @@ void Dialog::ImplInitDialogData() mbInExecute = false; mbInClose = false; mbModalMode = false; + mbPaintComplete = false; mpContentArea.clear(); mpActionArea.clear(); mnMousePositioned = 0; @@ -830,6 +831,49 @@ void Dialog::ImplEndExecuteModal() pSVData->maAppData.mnModalMode--; } +void Dialog::PrePaint(vcl::RenderContext& rRenderContext) +{ + SystemWindow::PrePaint(rRenderContext); + mbPaintComplete = false; +} + +void Dialog::PostPaint(vcl::RenderContext& rRenderContext) +{ + SystemWindow::PostPaint(rRenderContext); + mbPaintComplete = true; +} + +std::vector<OUString> Dialog::getAllPageUIXMLDescriptions() const +{ + // default has no pages + return std::vector<OUString>(); +} + +void Dialog::selectPageByUIXMLDescription(const OUString& /*rUIXMLDescription*/) +{ + // default cannot select anything +} + +Bitmap Dialog::createScreenshot() +{ + // same prerequisites as in Execute() + setDeferredProperties(); + ImplAdjustNWFSizes(); + Show(); + ToTop(); + + // ensure repaint + Invalidate(); + mbPaintComplete = false; + + while (!mbPaintComplete) + { + Application::Yield(); + } + + return GetBitmap(Point(), GetOutputSizePixel()); +} + short Dialog::Execute() { #if HAVE_FEATURE_DESKTOP diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index e927e6a86485..f85582acd7b2 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -600,6 +600,10 @@ void Window::ImplCallPaint(const vcl::Region* pRegion, sal_uInt16 nPaintFlags) Invalidate(InvalidateFlags::NoChildren | InvalidateFlags::NoErase | InvalidateFlags::NoTransparent | InvalidateFlags::NoClipChildren); else if ( pRegion ) Invalidate(*pRegion, InvalidateFlags::NoChildren | InvalidateFlags::NoErase | InvalidateFlags::NoTransparent | InvalidateFlags::NoClipChildren); + + // call PostPaint before returning + PostPaint(*this); + return; } @@ -611,6 +615,9 @@ void Window::ImplCallPaint(const vcl::Region* pRegion, sal_uInt16 nPaintFlags) aHelper.DoPaint(pRegion); else mpWindowImpl->mnPaintFlags = 0; + + // call PostPaint + PostPaint(*this); } void Window::ImplCallOverlapPaint() @@ -1011,6 +1018,10 @@ void Window::PrePaint(vcl::RenderContext& /*rRenderContext*/) { } +void Window::PostPaint(vcl::RenderContext& /*rRenderContext*/) +{ +} + void Window::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect) { CallEventListeners(VCLEVENT_WINDOW_PAINT, const_cast<Rectangle *>(&rRect)); |