/* -*- 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/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
//rhbz#1007697 do this in two loops, one to collect the candidates //and another to update them because updating a candidate can //trigger the candidate to be deleted, so asking for its //sibling after that is going to fail hard class CandidateMgr
{
std::vector<VclPtr<vcl::Window> > m_aCandidates;
std::set<VclPtr<vcl::Window> > m_aDeletedCandidates;
DECL_LINK(WindowEventListener, VclWindowEvent&, void); public: void PaintTransparentChildren(vcl::Window const & rWindow, tools::Rectangle const& rPixelRect);
~CandidateMgr();
};
for (constauto& rpCandidate : m_aCandidates)
{
pCandidate = rpCandidate.get(); if (m_aDeletedCandidates.find(pCandidate) != m_aDeletedCandidates.end()) continue; //rhbz#1007697 this can cause the window itself to be //deleted. So we are listening to see if that happens //and if so, then skip the update
pCandidate->Invalidate(InvalidateFlags::NoTransparent|InvalidateFlags::Children); // important: actually paint the child here! if (m_aDeletedCandidates.find(pCandidate) != m_aDeletedCandidates.end()) continue;
pCandidate->PaintImmediately();
}
}
void SdrPreRenderDevice::PreparePreRenderDevice()
{ // compare size of mpPreRenderDevice with size of visible area if(mpPreRenderDevice->GetOutputSizePixel() != mpOutputDevice->GetOutputSizePixel())
{
mpPreRenderDevice->SetOutputSizePixel(mpOutputDevice->GetOutputSizePixel());
}
// Also compare the MapModes for zoom/scroll changes if(mpPreRenderDevice->GetMapMode() != mpOutputDevice->GetMapMode())
{
mpPreRenderDevice->SetMapMode(mpOutputDevice->GetMapMode());
}
void SdrPaintView::InitOverlayManager(const rtl::Reference<sdr::overlay::OverlayManager> & xOverlayManager)
{
Color aColA(SvtOptionsDrawinglayer::GetStripeColorA());
Color aColB(SvtOptionsDrawinglayer::GetStripeColorB());
if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
aColA = aColB = Application::GetSettings().GetStyleSettings().GetHighlightColor();
aColB.Invert();
}
rtl::Reference<sdr::overlay::OverlayManager> SdrPaintView::CreateOverlayManager(OutputDevice& rOutputDevice) const
{
rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager; // is it a window? if (OUTDEV_WINDOW == rOutputDevice.GetOutDevType())
{
vcl::Window* pWindow = rOutputDevice.GetOwnerWindow(); // decide which OverlayManager to use if (IsBufferedOverlayAllowed() && !pWindow->SupportsDoubleBuffering())
{ // buffered OverlayManager, buffers its background and refreshes from there // for pure overlay changes (no system redraw). The 3rd parameter specifies // whether that refresh itself will use a 2nd vdev to avoid flickering. // Also hand over the old OverlayManager if existent; this means to take over // the registered OverlayObjects from it
xOverlayManager = sdr::overlay::OverlayManagerBuffered::create(rOutputDevice);
} else
{ // unbuffered OverlayManager, just invalidates places where changes // take place // Also hand over the old OverlayManager if existent; this means to take over // the registered OverlayObjects from it
xOverlayManager = sdr::overlay::OverlayManager::create(rOutputDevice);
}
OSL_ENSURE(xOverlayManager.is(), "SdrPaintWindow::SdrPaintWindow: Could not allocate an overlayManager (!)");
// Request a repaint so that the buffered overlay manager fills // its buffer properly. This is a workaround for missing buffer // updates. if (!comphelper::LibreOfficeKit::isActive())
{
pWindow->Invalidate();
}
// #i73602# add flag if buffer shall be used void SdrPaintWindow::DrawOverlay(const vcl::Region& rRegion)
{ // ## force creation of OverlayManager since the first repaint needs to // save the background to get a controlled start into overlay mechanism
impCreateOverlayManager();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.