/* -*- 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 .
*/
const AntialiasingFlags nOriginalAA(rDestinationDevice.GetAntialiasing()); constbool bIsAntiAliasing(getCurrentViewInformation2D().getUseAntiAliasing()); // tdf#150622 for High Contrast we typically force colors to a single pair Fore/Back, // but it seems reasonable to allow overlays to use the selection color // taken from the system High Contrast settings const DrawModeFlags nOriginalDrawMode(rDestinationDevice.GetDrawMode());
OverlayManager::OverlayManager(OutputDevice& rOutputDevice)
: mrOutputDevice(rOutputDevice),
maStripeColorA(COL_BLACK),
maStripeColorB(COL_WHITE),
mnStripeLengthPixel(5),
mfDiscreteOne(0.0)
{ // Set Property 'ReducedDisplayQuality' to true to allow simpler interaction // visualisations. Note: Currently will use reduced quality for 3d scene soft renderer
uno::Sequence< beans::PropertyValue > xProperties{
comphelper::makePropertyValue(u"ReducedDisplayQuality"_ustr, true)
};
maViewInformation2D = drawinglayer::geometry::createViewInformation2D(xProperties);
}
// only set when we *have* an output size, else let aViewRange // stay on empty if(aOutputSizePixel.Width() && aOutputSizePixel.Height())
{
aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
aViewRange.transform(getOutputDevice().GetInverseViewTransformation());
}
}
void OverlayManager::impApplyAddActions(OverlayObject& rTarget)
{ // set manager
rTarget.mpOverlayManager = this;
// make visible
invalidateRange(rTarget.getBaseRange());
// handle evtl. animation if(rTarget.allowsAnimation())
{ // Trigger at current time to get alive. This will do the // object-specific next time calculation and hand over adding // again to the scheduler to the animated object, too. This works for // a paused or non-paused animator.
rTarget.Trigger(GetTime());
}
}
OverlayManager::~OverlayManager()
{ // The OverlayManager is not the owner of the OverlayObjects // and thus will not delete them, but remove them. Profit here // from knowing that all will be removed const sal_uInt32 nSize(maOverlayObjects.size());
void OverlayManager::add(OverlayObject& rOverlayObject)
{
OSL_ENSURE(nullptr == rOverlayObject.mpOverlayManager, "OverlayObject is added twice to an OverlayManager (!)");
// add to the end of chain to preserve display order in paint
maOverlayObjects.push_back(&rOverlayObject);
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.