diff options
Diffstat (limited to 'drawinglayer/inc')
23 files changed, 302 insertions, 376 deletions
diff --git a/drawinglayer/inc/converters.hxx b/drawinglayer/inc/converters.hxx deleted file mode 100644 index 4f585d5d08db..000000000000 --- a/drawinglayer/inc/converters.hxx +++ /dev/null @@ -1,36 +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/. - * - * 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 . - */ - -#pragma once - -#include <vcl/bitmapex.hxx> -#include <drawinglayer/primitive2d/baseprimitive2d.hxx> - -namespace drawinglayer -{ - BitmapEx convertToBitmapEx( - const drawinglayer::primitive2d::Primitive2DContainer& rSeq, - const geometry::ViewInformation2D& rViewInformation2D, - sal_uInt32 nDiscreteWidth, - sal_uInt32 nDiscreteHeight, - sal_uInt32 nMaxQuadratPixels); - -} // end of namespace drawinglayer - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx index b8c4aadb7dab..fc6371906615 100644 --- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx +++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx @@ -13,26 +13,30 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-07-09 17:06:23 using: + Generated on 2021-12-23 08:55:28 using: ./bin/update_pch drawinglayer drawinglayer --cutoff=4 --exclude:system --exclude:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: ./bin/update_pch_bisect ./drawinglayer/inc/pch/precompiled_drawinglayer.hxx "make drawinglayer.build" --find-conflicts */ +#include <sal/config.h> #if PCH_LEVEL >= 1 #include <algorithm> #include <cassert> +#include <cmath> #include <cstddef> -#include <cstring> +#include <cstdlib> #include <deque> #include <limits.h> #include <limits> #include <memory> #include <new> +#include <optional> #include <ostream> #include <string.h> #include <string_view> +#include <type_traits> #include <utility> #include <vector> #endif // PCH_LEVEL >= 1 @@ -43,15 +47,14 @@ #include <rtl/instance.hxx> #include <rtl/math.hxx> #include <rtl/ref.hxx> -#include <rtl/strbuf.h> #include <rtl/string.h> #include <rtl/string.hxx> #include <rtl/stringconcat.hxx> #include <rtl/stringutils.hxx> #include <rtl/textenc.h> +#include <rtl/ustrbuf.hxx> #include <rtl/ustring.h> #include <rtl/ustring.hxx> -#include <sal/config.h> #include <sal/detail/log.h> #include <sal/log.hxx> #include <sal/types.h> @@ -68,7 +71,6 @@ #if PCH_LEVEL >= 3 #include <basegfx/basegfxdllapi.h> #include <basegfx/color/bcolor.hxx> -#include <basegfx/color/bcolormodifier.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/matrix/b3dhommatrix.hxx> @@ -90,7 +92,6 @@ #include <basegfx/range/basicrange.hxx> #include <basegfx/tuple/b2dtuple.hxx> #include <basegfx/tuple/b3dtuple.hxx> -#include <basegfx/utils/canvastools.hxx> #include <basegfx/vector/b2dvector.hxx> #include <basegfx/vector/b2enums.hxx> #include <basegfx/vector/b2ivector.hxx> @@ -102,7 +103,7 @@ #include <com/sun/star/drawing/TextureMode.hpp> #include <com/sun/star/drawing/TextureProjectionMode.hpp> #include <com/sun/star/graphic/XPrimitive3D.hpp> -#include <com/sun/star/util/XAccounting.hpp> +#include <com/sun/star/uno/Sequence.h> #include <comphelper/comphelperdllapi.h> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> @@ -113,22 +114,28 @@ #include <o3tl/cow_wrapper.hxx> #include <o3tl/strong_int.hxx> #include <o3tl/typed_flags_set.hxx> +#include <o3tl/unit_conversion.hxx> #include <salhelper/simplereferenceobject.hxx> +#include <svtools/optionsdrawinglayer.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/color.hxx> +#include <tools/degree.hxx> #include <tools/fontenum.hxx> #include <tools/gen.hxx> -#include <tools/link.hxx> +#include <tools/long.hxx> #include <tools/stream.hxx> #include <tools/toolsdllapi.h> #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 #include <drawinglayer/attribute/fillgradientattribute.hxx> +#include <drawinglayer/attribute/fillgraphicattribute.hxx> #include <drawinglayer/attribute/fontattribute.hxx> #include <drawinglayer/attribute/lineattribute.hxx> #include <drawinglayer/attribute/materialattribute3d.hxx> #include <drawinglayer/attribute/sdrallattribute3d.hxx> #include <drawinglayer/attribute/sdrfillattribute.hxx> +#include <drawinglayer/attribute/sdrfillgraphicattribute.hxx> +#include <drawinglayer/attribute/sdrlightattribute3d.hxx> #include <drawinglayer/attribute/sdrlineattribute.hxx> #include <drawinglayer/attribute/sdrlinestartendattribute.hxx> #include <drawinglayer/attribute/sdrobjectattribute3d.hxx> @@ -136,17 +143,18 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/geometry/viewinformation2d.hxx> #include <drawinglayer/geometry/viewinformation3d.hxx> -#include <drawinglayer/primitive2d/CommonTypes.hxx> +#include <drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonGradientPrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonGraphicPrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonHairlinePrimitive2D.hxx> -#include <drawinglayer/primitive2d/PolyPolygonHatchPrimitive2D.hxx> -#include <drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx> +#include <drawinglayer/primitive2d/PolygonHairlinePrimitive2D.hxx> +#include <drawinglayer/primitive2d/PolygonMarkerPrimitive2D.hxx> +#include <drawinglayer/primitive2d/PolygonStrokeArrowPrimitive2D.hxx> +#include <drawinglayer/primitive2d/PolygonWavePrimitive2D.hxx> #include <drawinglayer/primitive2d/Primitive2DContainer.hxx> #include <drawinglayer/primitive2d/Primitive2DVisitor.hxx> -#include <drawinglayer/primitive2d/Tools.hxx> #include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> @@ -163,8 +171,8 @@ #include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx> #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx> #include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx> -#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/primitivetools2d.hxx> +#include <drawinglayer/primitive2d/sceneprimitive2d.hxx> #include <drawinglayer/primitive2d/shadowprimitive2d.hxx> #include <drawinglayer/primitive2d/svggradientprimitive2d.hxx> #include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx> diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx new file mode 100644 index 000000000000..4a8c23ea8e65 --- /dev/null +++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx @@ -0,0 +1,12 @@ +/* -*- 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 "precompiled_drawinglayercore.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx new file mode 100644 index 000000000000..9912df042380 --- /dev/null +++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx @@ -0,0 +1,52 @@ +/* -*- 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 has been autogenerated by update_pch.sh. It is possible to edit it + manually (such as when an include file has been moved/renamed/removed). All such + manual changes will be rewritten by the next run of update_pch.sh (which presumably + also fixes all possible problems, so it's usually better to use it). + + Generated on 2021-12-23 08:57:20 using: + ./bin/update_pch drawinglayer drawinglayercore --cutoff=3 --exclude:system --exclude:module --exclude:local + + If after updating build fails, use the following command to locate conflicting headers: + ./bin/update_pch_bisect ./drawinglayer/inc/pch/precompiled_drawinglayercore.hxx "make drawinglayer.build" --find-conflicts +*/ + +#include <sal/config.h> +#if PCH_LEVEL >= 1 +#include <deque> +#include <ostream> +#include <vector> +#endif // PCH_LEVEL >= 1 +#if PCH_LEVEL >= 2 +#include <osl/diagnose.h> +#include <osl/interlck.h> +#include <sal/types.h> +#endif // PCH_LEVEL >= 2 +#if PCH_LEVEL >= 3 +#include <basegfx/basegfxdllapi.h> +#include <basegfx/point/b2dpoint.hxx> +#include <basegfx/range/b2drange.hxx> +#include <basegfx/range/basicrange.hxx> +#include <basegfx/tuple/b2dtuple.hxx> +#include <basegfx/utils/canvastools.hxx> +#include <basegfx/vector/b2dvector.hxx> +#endif // PCH_LEVEL >= 3 +#if PCH_LEVEL >= 4 +#include <drawinglayer/drawinglayerdllapi.h> +#include <drawinglayer/geometry/viewinformation2d.hxx> +#include <drawinglayer/primitive2d/CommonTypes.hxx> +#include <drawinglayer/primitive2d/Primitive2DContainer.hxx> +#include <drawinglayer/primitive2d/Primitive2DVisitor.hxx> +#include <drawinglayer/primitive2d/Tools.hxx> +#endif // PCH_LEVEL >= 4 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx index ba427eb6fba6..e1c66cffab27 100644 --- a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx +++ b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx @@ -19,14 +19,11 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/primitive2d/groupprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> -namespace drawinglayer -{ - namespace primitive2d +namespace drawinglayer::primitive2d { /** CropPrimitive2D class @@ -67,8 +64,8 @@ namespace drawinglayer public: /// constructor CropPrimitive2D( - const Primitive2DContainer& rChildren, - const basegfx::B2DHomMatrix& rTransformation, + Primitive2DContainer&& aChildren, + basegfx::B2DHomMatrix aTransformation, double fCropLeft, double fCropTop, double fCropRight, @@ -90,7 +87,7 @@ namespace drawinglayer /// provide unique ID virtual sal_uInt32 getPrimitive2DID() const override; }; - } // end of namespace primitive2d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive2d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx b/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx index fb1431152b16..cecb1d8f1564 100644 --- a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx +++ b/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx @@ -19,8 +19,8 @@ #pragma once -#include <drawinglayer/primitive2d/baseprimitive2d.hxx> -#include <vcl/GraphicObject.hxx> +#include <drawinglayer/primitive2d/Primitive2DContainer.hxx> +#include <vcl/GraphicAttributes.hxx> class Graphic; @@ -44,7 +44,7 @@ namespace drawinglayer::primitive2d applied. */ Primitive2DContainer create2DColorModifierEmbeddingsAsNeeded( - const Primitive2DContainer& rChildren, + Primitive2DContainer&& rChildren, GraphicDrawMode aGraphicDrawMode, double fLuminance = 0.0, // [-1.0 .. 1.0] double fContrast = 0.0, // [-1.0 .. 1.0] diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx index a39256453f17..8512f64114af 100644 --- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx +++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx @@ -19,82 +19,77 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - -#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> - -namespace drawinglayer +namespace drawinglayer::primitive2d { - namespace primitive2d - { - /** TextEffectStyle2D definition */ - enum class TextEffectStyle2D - { - ReliefEmbossedDefault, - ReliefEngravedDefault, - ReliefEmbossed, - ReliefEngraved, - Outline - }; - - /** TextEffectPrimitive2D class - - This primitive embeds text primitives (normally, as can be seen can - also be used for any other primitives) which have some TextEffect applied - and create the needed geometry and embedding on decomposition. - */ - class TextEffectPrimitive2D final : public BufferedDecompositionPrimitive2D - { - private: - /// the text (or other) content - Primitive2DContainer maTextContent; - - /// the style to apply, the direction and the rotation center - const basegfx::B2DPoint maRotationCenter; - double mfDirection; - TextEffectStyle2D meTextEffectStyle2D; - - /** the last used object to view transformtion used from getDecomposition - for decide buffering - */ - basegfx::B2DHomMatrix maLastObjectToViewTransformation; - - /// create local decomposition - virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; - - public: - /// constructor - TextEffectPrimitive2D( - const Primitive2DContainer& rTextContent, - const basegfx::B2DPoint& rRotationCenter, - double fDirection, - TextEffectStyle2D eTextEffectStyle2D); - - /// data read access - const Primitive2DContainer& getTextContent() const { return maTextContent; } - const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; } - double getDirection() const { return mfDirection; } - TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; } - - /// compare operator - virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; - - /** own get range implementation to solve more effective. Content is by definition displaced - by a fixed discrete unit, thus the contained geometry needs only once be asked for its - own basegfx::B2DRange - */ - virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; - - /// provide unique ID - virtual sal_uInt32 getPrimitive2DID() const override; - - /// Override standard getDecomposition to be view-dependent here - virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override; - }; - } // end of namespace primitive2d -} // end of namespace drawinglayer - +/** TextEffectStyle2D definition */ +enum class TextEffectStyle2D +{ + ReliefEmbossedDefault, + ReliefEngravedDefault, + ReliefEmbossed, + Outline +}; + +/** TextEffectPrimitive2D class + + This primitive embeds text primitives (normally, as can be seen can + also be used for any other primitives) which have some TextEffect applied + and create the needed geometry and embedding on decomposition. +*/ +class TextEffectPrimitive2D final : public BufferedDecompositionPrimitive2D +{ +private: + /// the text (or other) content + Primitive2DContainer maTextContent; + + /// the style to apply, the direction and the rotation center + const basegfx::B2DPoint maRotationCenter; + double mfDirection; + TextEffectStyle2D meTextEffectStyle2D; + + /** the last used object to view transformtion used from getDecomposition + for decide buffering + */ + basegfx::B2DHomMatrix maLastObjectToViewTransformation; + + /// create local decomposition + virtual Primitive2DReference + create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override; + +public: + /// constructor + TextEffectPrimitive2D(Primitive2DContainer&& rTextContent, + const basegfx::B2DPoint& rRotationCenter, double fDirection, + TextEffectStyle2D eTextEffectStyle2D); + + /// data read access + const Primitive2DContainer& getTextContent() const { return maTextContent; } + const basegfx::B2DPoint& getRotationCenter() const { return maRotationCenter; } + double getDirection() const { return mfDirection; } + TextEffectStyle2D getTextEffectStyle2D() const { return meTextEffectStyle2D; } + + /// compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + /** own get range implementation to solve more effective. Content is by definition displaced + by a fixed discrete unit, thus the contained geometry needs only once be asked for its + own basegfx::B2DRange + */ + virtual basegfx::B2DRange + getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; + + /// provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + + /// Override standard getDecomposition to be view-dependent here + virtual void + get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, + const geometry::ViewInformation2D& rViewInformation) const override; +}; + +} // end of namespace primitive2d::drawinglayer /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx index 059c69bd7ca3..904ee38e31c6 100644 --- a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx +++ b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx @@ -19,17 +19,13 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - -#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx> #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/color/bcolor.hxx> -namespace drawinglayer -{ - namespace primitive2d +namespace drawinglayer::primitive2d { class TextLinePrimitive2D final : public BufferedDecompositionPrimitive2D { @@ -45,12 +41,12 @@ namespace drawinglayer basegfx::BColor maLineColor; /// local decomposition. - virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual Primitive2DReference create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override; public: /// constructor TextLinePrimitive2D( - const basegfx::B2DHomMatrix& rObjectTransformation, + basegfx::B2DHomMatrix aObjectTransformation, double fWidth, double fOffset, double fHeight, @@ -71,8 +67,8 @@ namespace drawinglayer /// provide unique ID virtual sal_uInt32 getPrimitive2DID() const override; }; - } // end of namespace primitive2d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive2d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx index 1e1e75f7ced1..ffb8c144e77f 100644 --- a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx +++ b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx @@ -19,9 +19,7 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - -#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx> #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/color/bcolor.hxx> @@ -29,9 +27,7 @@ #include <com/sun/star/lang/Locale.hpp> -namespace drawinglayer -{ - namespace primitive2d +namespace drawinglayer::primitive2d { class BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D { @@ -46,7 +42,7 @@ namespace drawinglayer public: /// constructor BaseTextStrikeoutPrimitive2D( - const basegfx::B2DHomMatrix& rObjectTransformation, + basegfx::B2DHomMatrix aObjectTransformation, double fWidth, const basegfx::BColor& rFontColor); @@ -58,13 +54,11 @@ namespace drawinglayer /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; }; - } // end of namespace primitive2d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive2d -namespace drawinglayer -{ - namespace primitive2d +namespace drawinglayer::primitive2d { class TextCharacterStrikeoutPrimitive2D final : public BaseTextStrikeoutPrimitive2D { @@ -74,7 +68,7 @@ namespace drawinglayer css::lang::Locale maLocale; /// local decomposition. - virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual Primitive2DReference create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override; public: /// constructor @@ -83,8 +77,8 @@ namespace drawinglayer double fWidth, const basegfx::BColor& rFontColor, sal_Unicode aStrikeoutChar, - const attribute::FontAttribute& rFontAttribute, - const css::lang::Locale& rLocale); + attribute::FontAttribute aFontAttribute, + css::lang::Locale aLocale); /// data read access sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; } @@ -97,13 +91,11 @@ namespace drawinglayer /// provide unique ID virtual sal_uInt32 getPrimitive2DID() const override; }; - } // end of namespace primitive2d -} // end of namespace drawinglayer +} // end of namespace drawinglayer::primitive2d -namespace drawinglayer -{ - namespace primitive2d + +namespace drawinglayer::primitive2d { class TextGeometryStrikeoutPrimitive2D final : public BaseTextStrikeoutPrimitive2D { @@ -113,7 +105,7 @@ namespace drawinglayer TextStrikeout meTextStrikeout; /// local decomposition. - virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual Primitive2DReference create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override; public: /// constructor @@ -136,8 +128,8 @@ namespace drawinglayer /// provide unique ID virtual sal_uInt32 getPrimitive2DID() const override; }; - } // end of namespace primitive2d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive2d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive2d/wallpaperprimitive2d.hxx b/drawinglayer/inc/primitive2d/wallpaperprimitive2d.hxx index a8e4b158f30e..cf9a1ea49320 100644 --- a/drawinglayer/inc/primitive2d/wallpaperprimitive2d.hxx +++ b/drawinglayer/inc/primitive2d/wallpaperprimitive2d.hxx @@ -19,16 +19,12 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <drawinglayer/primitive2d/primitivetools2d.hxx> #include <vcl/bitmapex.hxx> #include <vcl/wall.hxx> -namespace drawinglayer -{ - namespace primitive2d +namespace drawinglayer::primitive2d { /** WallpaperBitmapPrimitive2D class @@ -51,7 +47,7 @@ namespace drawinglayer WallpaperStyle meWallpaperStyle; /// create local decomposition - virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + virtual Primitive2DReference create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override; public: /// constructor @@ -74,7 +70,7 @@ namespace drawinglayer /// provide unique ID virtual sal_uInt32 getPrimitive2DID() const override; }; - } // end of namespace primitive2d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive2d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive3d/hatchtextureprimitive3d.hxx b/drawinglayer/inc/primitive3d/hatchtextureprimitive3d.hxx index 1329bf70647f..a60c4da9d0a8 100644 --- a/drawinglayer/inc/primitive3d/hatchtextureprimitive3d.hxx +++ b/drawinglayer/inc/primitive3d/hatchtextureprimitive3d.hxx @@ -19,15 +19,11 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <primitive3d/textureprimitive3d.hxx> #include <drawinglayer/attribute/fillhatchattribute.hxx> -namespace drawinglayer -{ - namespace primitive3d +namespace drawinglayer::primitive3d { /** HatchTexturePrimitive3D class @@ -53,7 +49,7 @@ namespace drawinglayer public: /// constructor HatchTexturePrimitive3D( - const attribute::FillHatchAttribute& rHatch, + attribute::FillHatchAttribute aHatch, const Primitive3DContainer& rChildren, const basegfx::B2DVector& rTextureSize, bool bModulate, @@ -71,8 +67,8 @@ namespace drawinglayer /// provide unique ID DeclPrimitive3DIDBlock() }; - } // end of namespace primitive3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive3d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive3d/hiddengeometryprimitive3d.hxx b/drawinglayer/inc/primitive3d/hiddengeometryprimitive3d.hxx index 246abe38a664..45de83380bf5 100644 --- a/drawinglayer/inc/primitive3d/hiddengeometryprimitive3d.hxx +++ b/drawinglayer/inc/primitive3d/hiddengeometryprimitive3d.hxx @@ -19,14 +19,10 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <drawinglayer/primitive3d/groupprimitive3d.hxx> -namespace drawinglayer -{ - namespace primitive3d +namespace drawinglayer::primitive3d { // This primitive is used to represent geometry for non-visible objects, // e.g. a 3D cube without fill attributes. To still be able to use @@ -54,8 +50,8 @@ namespace drawinglayer // provide unique ID DeclPrimitive3DIDBlock() }; - } // end of namespace primitive3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive3d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive3d/polygontubeprimitive3d.hxx b/drawinglayer/inc/primitive3d/polygontubeprimitive3d.hxx index e27201ad6a12..38372977e1c4 100644 --- a/drawinglayer/inc/primitive3d/polygontubeprimitive3d.hxx +++ b/drawinglayer/inc/primitive3d/polygontubeprimitive3d.hxx @@ -19,14 +19,10 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <drawinglayer/primitive3d/polygonprimitive3d.hxx> -namespace drawinglayer -{ - namespace primitive3d +namespace drawinglayer::primitive3d { /** PolygonStrokePrimitive3D class @@ -85,8 +81,8 @@ namespace drawinglayer /// provide unique ID DeclPrimitive3DIDBlock() }; - } // end of namespace primitive3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive3d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive3d/sdrdecompositiontools3d.hxx b/drawinglayer/inc/primitive3d/sdrdecompositiontools3d.hxx index 9a4d62cbc24f..6e549289b24c 100644 --- a/drawinglayer/inc/primitive3d/sdrdecompositiontools3d.hxx +++ b/drawinglayer/inc/primitive3d/sdrdecompositiontools3d.hxx @@ -19,8 +19,6 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <drawinglayer/primitive3d/baseprimitive3d.hxx> #include <com/sun/star/drawing/TextureProjectionMode.hpp> #include <vector> @@ -43,9 +41,7 @@ namespace drawinglayer::attribute { } -namespace drawinglayer -{ - namespace primitive3d +namespace drawinglayer::primitive3d { // #i98295# basegfx::B3DRange getRangeFrom3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill); @@ -85,8 +81,7 @@ namespace drawinglayer const basegfx::B2DVector& rTextureSize, const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute); - } // end of namespace primitive3d -} // end of namespace drawinglayer +} // end of namespace drawinglayer::primitive3d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive3d/shadowprimitive3d.hxx b/drawinglayer/inc/primitive3d/shadowprimitive3d.hxx index 60ec61fe7dff..06d4e9f49d77 100644 --- a/drawinglayer/inc/primitive3d/shadowprimitive3d.hxx +++ b/drawinglayer/inc/primitive3d/shadowprimitive3d.hxx @@ -19,16 +19,12 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <drawinglayer/primitive3d/groupprimitive3d.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/color/bcolor.hxx> -namespace drawinglayer -{ - namespace primitive3d +namespace drawinglayer::primitive3d { /** ShadowPrimitive3D class @@ -52,7 +48,7 @@ namespace drawinglayer public: /// constructor ShadowPrimitive3D( - const basegfx::B2DHomMatrix& rShadowTransform, + basegfx::B2DHomMatrix aShadowTransform, const basegfx::BColor& rShadowColor, double fShadowTransparence, bool bShadow3D, @@ -70,8 +66,8 @@ namespace drawinglayer /// provide unique ID DeclPrimitive3DIDBlock() }; - } // end of namespace primitive3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive3d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/primitive3d/textureprimitive3d.hxx b/drawinglayer/inc/primitive3d/textureprimitive3d.hxx index 0dc3ed4d3b19..56586217bdff 100644 --- a/drawinglayer/inc/primitive3d/textureprimitive3d.hxx +++ b/drawinglayer/inc/primitive3d/textureprimitive3d.hxx @@ -19,17 +19,13 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <drawinglayer/primitive3d/groupprimitive3d.hxx> #include <drawinglayer/attribute/fillgraphicattribute.hxx> #include <basegfx/vector/b2dvector.hxx> #include <drawinglayer/attribute/fillgradientattribute.hxx> -namespace drawinglayer -{ - namespace primitive3d +namespace drawinglayer::primitive3d { /** TexturePrimitive3D class @@ -65,13 +61,11 @@ namespace drawinglayer /// compare operator virtual bool operator==(const BasePrimitive3D& rPrimitive) const override; }; - } // end of namespace primitive3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive3d -namespace drawinglayer -{ - namespace primitive3d +namespace drawinglayer::primitive3d { /** UnifiedTransparenceTexturePrimitive3D class @@ -106,13 +100,11 @@ namespace drawinglayer /// provide unique ID DeclPrimitive3DIDBlock() }; - } // end of namespace primitive3d -} // end of namespace drawinglayer +} // end of namespace drawinglayer::primitive3d -namespace drawinglayer -{ - namespace primitive3d + +namespace drawinglayer::primitive3d { /** GradientTexturePrimitive3D class @@ -129,7 +121,7 @@ namespace drawinglayer public: /// constructor GradientTexturePrimitive3D( - const attribute::FillGradientAttribute& rGradient, + attribute::FillGradientAttribute aGradient, const Primitive3DContainer& rChildren, const basegfx::B2DVector& rTextureSize, bool bModulate, @@ -144,13 +136,11 @@ namespace drawinglayer /// provide unique ID DeclPrimitive3DIDBlock() }; - } // end of namespace primitive3d -} // end of namespace drawinglayer +} // end of namespace drawinglayer::primitive3d -namespace drawinglayer -{ - namespace primitive3d + +namespace drawinglayer::primitive3d { /** BitmapTexturePrimitive3D class @@ -182,13 +172,11 @@ namespace drawinglayer /// provide unique ID DeclPrimitive3DIDBlock() }; - } // end of namespace primitive3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive3d -namespace drawinglayer -{ - namespace primitive3d +namespace drawinglayer::primitive3d { /** TransparenceTexturePrimitive3D class @@ -212,8 +200,8 @@ namespace drawinglayer /// provide unique ID DeclPrimitive3DIDBlock() }; - } // end of namespace primitive3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::primitive3d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/processor3d/defaultprocessor3d.hxx b/drawinglayer/inc/processor3d/defaultprocessor3d.hxx index f23a826a669e..aace2ef87742 100644 --- a/drawinglayer/inc/processor3d/defaultprocessor3d.hxx +++ b/drawinglayer/inc/processor3d/defaultprocessor3d.hxx @@ -22,7 +22,6 @@ #include <drawinglayer/processor3d/baseprocessor3d.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/color/bcolormodifier.hxx> -#include <svtools/optionsdrawinglayer.hxx> // predefines @@ -52,9 +51,7 @@ namespace drawinglayer::texture { } -namespace drawinglayer -{ - namespace processor3d +namespace drawinglayer::processor3d { /** DefaultProcessor3D class @@ -85,9 +82,6 @@ namespace drawinglayer /// the current active transparence texture std::shared_ptr< texture::GeoTexSvx > mpTransparenceGeoTexSvx; - /// SvtOptionsDrawinglayer incarnation to react on diverse settings - const SvtOptionsDrawinglayer maDrawinglayerOpt; - /// counter for entered transparence textures sal_uInt32 mnTransparenceCounter; @@ -135,12 +129,9 @@ namespace drawinglayer bool getModulate() const { return mbModulate; } bool getFilter() const { return mbFilter; } bool getSimpleTextureActive() const { return mbSimpleTextureActive; } - - /// access to Drawinglayer configuration options - const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; } }; - } // end of namespace processor3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::processor3d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/processor3d/geometry2dextractor.hxx b/drawinglayer/inc/processor3d/geometry2dextractor.hxx index ae3050fb2850..8d78110c8dcf 100644 --- a/drawinglayer/inc/processor3d/geometry2dextractor.hxx +++ b/drawinglayer/inc/processor3d/geometry2dextractor.hxx @@ -19,17 +19,13 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <drawinglayer/processor3d/baseprocessor3d.hxx> -#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/primitive2d/Primitive2DContainer.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/color/bcolormodifier.hxx> -namespace drawinglayer -{ - namespace processor3d +namespace drawinglayer::processor3d { /** Geometry2DExtractingProcessor class @@ -57,14 +53,14 @@ namespace drawinglayer public: Geometry2DExtractingProcessor( const geometry::ViewInformation3D& rViewInformation, - const basegfx::B2DHomMatrix& rObjectTransformation); + basegfx::B2DHomMatrix aObjectTransformation); // data read access const primitive2d::Primitive2DContainer& getPrimitive2DSequence() const { return maPrimitive2DSequence; } const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } }; - } // end of namespace processor3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::processor3d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/processor3d/shadow3dextractor.hxx b/drawinglayer/inc/processor3d/shadow3dextractor.hxx index 37c1c0f0e6fc..64890b7a630a 100644 --- a/drawinglayer/inc/processor3d/shadow3dextractor.hxx +++ b/drawinglayer/inc/processor3d/shadow3dextractor.hxx @@ -19,10 +19,8 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <drawinglayer/processor3d/baseprocessor3d.hxx> -#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/primitive2d/Primitive2DContainer.hxx> #include <basegfx/matrix/b3dhommatrix.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> @@ -32,9 +30,7 @@ namespace basegfx { class B3DPolyPolygon; } namespace basegfx { class B3DPolygon; } -namespace drawinglayer -{ - namespace processor3d +namespace drawinglayer::processor3d { /** Shadow3DExtractingProcessor class @@ -82,7 +78,7 @@ namespace drawinglayer public: Shadow3DExtractingProcessor( const geometry::ViewInformation3D& rViewInformation, - const basegfx::B2DHomMatrix& rObjectTransformation, + basegfx::B2DHomMatrix aObjectTransformation, const basegfx::B3DVector& rLightNormal, double fShadowSlant, const basegfx::B3DRange& rContained3DRange); @@ -93,7 +89,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } const basegfx::B3DHomMatrix& getWorldToEye() const { return maWorldToEye; } }; - } // end of namespace processor3d -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::processor3d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx b/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx index 9a0b422ac380..4207a6fcd474 100644 --- a/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx +++ b/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx @@ -27,20 +27,17 @@ namespace basegfx { class BZPixelRaster; } -namespace drawinglayer { - namespace attribute { +namespace drawinglayer::attribute { class SdrSceneAttribute; class SdrLightingAttribute; class MaterialAttribute3D; - } } + class ZBufferRasterConverter3D; class RasterPrimitive3D; -namespace drawinglayer -{ - namespace processor3d +namespace drawinglayer::processor3d { /** This 3D renderer derived from DefaultProcessor3D renders all fed primitives to a 2D @@ -64,7 +61,7 @@ namespace drawinglayer /* remembered RasterPrimitive3D's which need to be painted back to front for transparent 3D parts */ - std::unique_ptr<std::vector< RasterPrimitive3D >> mpRasterPrimitive3Ds; + mutable std::vector< RasterPrimitive3D > maRasterPrimitive3Ds; sal_uInt32 mnStartLine; sal_uInt32 mnStopLine; @@ -90,7 +87,7 @@ namespace drawinglayer void finish(); }; - } + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/texture/texture.hxx b/drawinglayer/inc/texture/texture.hxx index 24e23a4b241c..5128a30cf2a8 100644 --- a/drawinglayer/inc/texture/texture.hxx +++ b/drawinglayer/inc/texture/texture.hxx @@ -19,8 +19,6 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/color/bcolor.hxx> @@ -45,28 +43,24 @@ namespace drawinglayer::texture virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const; }; - /// helper class for processing equal number of matrices and colors - /// for texture processing - struct B2DHomMatrixAndBColor - { - basegfx::B2DHomMatrix maB2DHomMatrix; - basegfx::BColor maBColor; - }; - class GeoTexSvxGradient : public GeoTexSvx { protected: basegfx::ODFGradientInfo maGradientInfo; basegfx::B2DRange maDefinitionRange; - basegfx::BColor maStart; - basegfx::BColor maEnd; + sal_uInt32 mnRequestedSteps; + basegfx::BColorStops mnColorStops; double mfBorder; + // provide a single buffer entry used for gradient texture + // mapping, see ::modifyBColor implementations + mutable basegfx::BColorStops::BColorStopRange maLastColorStopRange; + public: GeoTexSvxGradient( const basegfx::B2DRange& rDefinitionRange, - const basegfx::BColor& rStart, - const basegfx::BColor& rEnd, + sal_uInt32 nRequestedSteps, + const basegfx::BColorStops& rColorStops, double fBorder); virtual ~GeoTexSvxGradient() override; @@ -75,8 +69,7 @@ namespace drawinglayer::texture // virtual base methods virtual void appendTransformationsAndColors( - std::vector< B2DHomMatrixAndBColor >& rEntries, - basegfx::BColor& rOuterColor) = 0; + std::function<void(const basegfx::B2DHomMatrix& rMatrix, const basegfx::BColor& rColor)> aCallback) = 0; }; class GeoTexSvxGradientLinear final : public GeoTexSvxGradient @@ -89,16 +82,14 @@ namespace drawinglayer::texture GeoTexSvxGradientLinear( const basegfx::B2DRange& rDefinitionRange, const basegfx::B2DRange& rOutputRange, - const basegfx::BColor& rStart, - const basegfx::BColor& rEnd, - sal_uInt32 nSteps, + sal_uInt32 nRequestedSteps, + const basegfx::BColorStops& rColorStops, double fBorder, double fAngle); virtual ~GeoTexSvxGradientLinear() override; virtual void appendTransformationsAndColors( - std::vector< B2DHomMatrixAndBColor >& rEntries, - basegfx::BColor& rOuterColor) override; + std::function<void(const basegfx::B2DHomMatrix& rMatrix, const basegfx::BColor& rColor)> aCallback) override; virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; }; @@ -111,16 +102,14 @@ namespace drawinglayer::texture GeoTexSvxGradientAxial( const basegfx::B2DRange& rDefinitionRange, const basegfx::B2DRange& rOutputRange, - const basegfx::BColor& rStart, - const basegfx::BColor& rEnd, - sal_uInt32 nSteps, + sal_uInt32 nRequestedSteps, + const basegfx::BColorStops& rColorStops, double fBorder, double fAngle); virtual ~GeoTexSvxGradientAxial() override; virtual void appendTransformationsAndColors( - std::vector< B2DHomMatrixAndBColor >& rEntries, - basegfx::BColor& rOuterColor) override; + std::function<void(const basegfx::B2DHomMatrix& rMatrix, const basegfx::BColor& rColor)> aCallback) override; virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; }; @@ -129,17 +118,15 @@ namespace drawinglayer::texture public: GeoTexSvxGradientRadial( const basegfx::B2DRange& rDefinitionRange, - const basegfx::BColor& rStart, - const basegfx::BColor& rEnd, - sal_uInt32 nSteps, + sal_uInt32 nRequestedSteps, + const basegfx::BColorStops& rColorStops, double fBorder, double fOffsetX, double fOffsetY); virtual ~GeoTexSvxGradientRadial() override; virtual void appendTransformationsAndColors( - std::vector< B2DHomMatrixAndBColor >& rEntries, - basegfx::BColor& rOuterColor) override; + std::function<void(const basegfx::B2DHomMatrix& rMatrix, const basegfx::BColor& rColor)> aCallback) override; virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; }; @@ -148,9 +135,8 @@ namespace drawinglayer::texture public: GeoTexSvxGradientElliptical( const basegfx::B2DRange& rDefinitionRange, - const basegfx::BColor& rStart, - const basegfx::BColor& rEnd, - sal_uInt32 nSteps, + sal_uInt32 nRequestedSteps, + const basegfx::BColorStops& rColorStops, double fBorder, double fOffsetX, double fOffsetY, @@ -158,8 +144,7 @@ namespace drawinglayer::texture virtual ~GeoTexSvxGradientElliptical() override; virtual void appendTransformationsAndColors( - std::vector< B2DHomMatrixAndBColor >& rEntries, - basegfx::BColor& rOuterColor) override; + std::function<void(const basegfx::B2DHomMatrix& rMatrix, const basegfx::BColor& rColor)> aCallback) override; virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; }; @@ -168,9 +153,8 @@ namespace drawinglayer::texture public: GeoTexSvxGradientSquare( const basegfx::B2DRange& rDefinitionRange, - const basegfx::BColor& rStart, - const basegfx::BColor& rEnd, - sal_uInt32 nSteps, + sal_uInt32 nRequestedSteps, + const basegfx::BColorStops& rColorStops, double fBorder, double fOffsetX, double fOffsetY, @@ -178,8 +162,7 @@ namespace drawinglayer::texture virtual ~GeoTexSvxGradientSquare() override; virtual void appendTransformationsAndColors( - std::vector< B2DHomMatrixAndBColor >& rEntries, - basegfx::BColor& rOuterColor) override; + std::function<void(const basegfx::B2DHomMatrix& rMatrix, const basegfx::BColor& rColor)> aCallback) override; virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; }; @@ -188,9 +171,8 @@ namespace drawinglayer::texture public: GeoTexSvxGradientRect( const basegfx::B2DRange& rDefinitionRange, - const basegfx::BColor& rStart, - const basegfx::BColor& rEnd, - sal_uInt32 nSteps, + sal_uInt32 nRequestedSteps, + const basegfx::BColorStops& rColorStops, double fBorder, double fOffsetX, double fOffsetY, @@ -198,8 +180,7 @@ namespace drawinglayer::texture virtual ~GeoTexSvxGradientRect() override; virtual void appendTransformationsAndColors( - std::vector< B2DHomMatrixAndBColor >& rEntries, - basegfx::BColor& rOuterColor) override; + std::function<void(const basegfx::B2DHomMatrix& rMatrix, const basegfx::BColor& rColor)> aCallback) override; virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; }; diff --git a/drawinglayer/inc/texture/texture3d.hxx b/drawinglayer/inc/texture/texture3d.hxx index 47ef9ff450a1..1ec4df70734c 100644 --- a/drawinglayer/inc/texture/texture3d.hxx +++ b/drawinglayer/inc/texture/texture3d.hxx @@ -19,18 +19,15 @@ #pragma once -#include <drawinglayer/drawinglayerdllapi.h> - #include <texture/texture.hxx> #include <vcl/bitmapex.hxx> +#include <vcl/BitmapReadAccess.hxx> namespace drawinglayer::primitive3d { class HatchTexturePrimitive3D; } -namespace drawinglayer -{ - namespace texture +namespace drawinglayer::texture { class GeoTexSvxMono final : public GeoTexSvx { @@ -47,32 +44,29 @@ namespace drawinglayer virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const override; }; - } // end of namespace texture -} // end of namespace drawinglayer -namespace drawinglayer -{ - namespace texture +} // end of namespace drawinglayer::texture + +namespace drawinglayer::texture { class GeoTexSvxBitmapEx : public GeoTexSvx { protected: BitmapEx maBitmapEx; Bitmap maBitmap; // Bitmap held within maBitmapEx, to exist during mpReadBitmap scope - Bitmap::ScopedReadAccess mpReadBitmap; + BitmapScopedReadAccess mpReadBitmap; Bitmap maTransparence; - Bitmap::ScopedReadAccess mpReadTransparence; + BitmapScopedReadAccess mpReadTransparence; basegfx::B2DPoint maTopLeft; basegfx::B2DVector maSize; double mfMulX; double mfMulY; bool mbIsAlpha : 1; - bool mbIsTransparent : 1; // helpers bool impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const; - sal_uInt8 impGetTransparence(sal_Int32 rX, sal_Int32 rY) const; + sal_uInt8 impGetAlpha(sal_Int32 rX, sal_Int32 rY) const; public: GeoTexSvxBitmapEx( @@ -83,12 +77,10 @@ namespace drawinglayer virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const override; }; - } // end of namespace texture -} // end of namespace drawinglayer -namespace drawinglayer -{ - namespace texture +} // end of namespace drawinglayer::texture + +namespace drawinglayer::texture { class GeoTexSvxBitmapExTiled final : public GeoTexSvxBitmapEx { @@ -111,12 +103,10 @@ namespace drawinglayer virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const override; }; - } // end of namespace texture -} // end of namespace drawinglayer -namespace drawinglayer -{ - namespace texture +} // end of namespace drawinglayer::texture + +namespace drawinglayer::texture { class GeoTexSvxMultiHatch final : public GeoTexSvx { @@ -137,7 +127,7 @@ namespace drawinglayer virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override; virtual void modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const override; }; - } // end of namespace texture -} // end of namespace drawinglayer + +} // end of namespace drawinglayer::texture /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/inc/wmfemfhelper.hxx b/drawinglayer/inc/wmfemfhelper.hxx index 214d2a5d785c..f085065c1ea6 100644 --- a/drawinglayer/inc/wmfemfhelper.hxx +++ b/drawinglayer/inc/wmfemfhelper.hxx @@ -22,10 +22,10 @@ #include <sal/config.h> #include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <vcl/font.hxx> -#include <vcl/outdevstate.hxx> +#include <rtl/ref.hxx> +#include <vcl/rendercontext/State.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> -#include <memory> // predefines namespace drawinglayer::geometry { class ViewInformation2D; } @@ -43,19 +43,24 @@ namespace wmfemfhelper class TargetHolder { private: - std::vector< std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> > aTargets; + drawinglayer::primitive2d::Primitive2DContainer aTargets; public: TargetHolder(); ~TargetHolder(); sal_uInt32 size() const; - void append(std::unique_ptr<drawinglayer::primitive2d::BasePrimitive2D> pCandidate); + void append(const rtl::Reference<drawinglayer::primitive2d::BasePrimitive2D> & pCandidate) + { + append(pCandidate.get()); + } + void append(drawinglayer::primitive2d::Primitive2DContainer xCandidate) + { + aTargets.append(std::move(xCandidate)); + } + void append(drawinglayer::primitive2d::BasePrimitive2D* pCandidate); drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequence(const PropertyHolder& rPropertyHolder); }; -} -namespace wmfemfhelper -{ /** Helper class which builds a stack on the TargetHolder class */ class TargetHolders { @@ -70,10 +75,7 @@ namespace wmfemfhelper TargetHolder& Current(); ~TargetHolders(); }; -} -namespace wmfemfhelper -{ /** helper class for graphic context This class allows to hold a complete representation of classic @@ -96,14 +98,14 @@ namespace wmfemfhelper basegfx::BColor maOverlineColor; /// clipping - basegfx::B2DPolyPolygon maClipPolyPoygon; + basegfx::B2DPolyPolygon maClipPolyPolygon; /// font, etc. vcl::Font maFont; RasterOp maRasterOp; - ComplexTextLayoutFlags mnLayoutMode; + vcl::text::ComplexTextLayoutFlags mnLayoutMode; LanguageType maLanguageType; - PushFlags mnPushFlags; + vcl::PushFlags mnPushFlags; /// contains all active markers bool mbLineColor : 1; @@ -154,8 +156,8 @@ namespace wmfemfhelper bool getOverlineColorActive() const { return mbOverlineColor; } void setOverlineColorActive(bool bNew) { if (bNew != mbOverlineColor) mbOverlineColor = bNew; } - const basegfx::B2DPolyPolygon& getClipPolyPolygon() const { return maClipPolyPoygon; } - void setClipPolyPolygon(const basegfx::B2DPolyPolygon& rNew) { if (rNew != maClipPolyPoygon) maClipPolyPoygon = rNew; } + const basegfx::B2DPolyPolygon& getClipPolyPolygon() const { return maClipPolyPolygon; } + void setClipPolyPolygon(const basegfx::B2DPolyPolygon& rNew) { if (rNew != maClipPolyPolygon) maClipPolyPolygon = rNew; } bool getClipPolyPolygonActive() const { return mbClipPolyPolygonActive; } void setClipPolyPolygonActive(bool bNew) { if (bNew != mbClipPolyPolygonActive) mbClipPolyPolygonActive = bNew; } @@ -168,21 +170,18 @@ namespace wmfemfhelper bool isRasterOpForceBlack() const { return RasterOp::N0 == maRasterOp; } bool isRasterOpActive() const { return isRasterOpInvert() || isRasterOpForceBlack(); } - ComplexTextLayoutFlags getLayoutMode() const { return mnLayoutMode; } - void setLayoutMode(ComplexTextLayoutFlags nNew) { if (nNew != mnLayoutMode) mnLayoutMode = nNew; } + vcl::text::ComplexTextLayoutFlags getLayoutMode() const { return mnLayoutMode; } + void setLayoutMode(vcl::text::ComplexTextLayoutFlags nNew) { if (nNew != mnLayoutMode) mnLayoutMode = nNew; } LanguageType getLanguageType() const { return maLanguageType; } void setLanguageType(LanguageType aNew) { if (aNew != maLanguageType) maLanguageType = aNew; } - PushFlags getPushFlags() const { return mnPushFlags; } - void setPushFlags(PushFlags nNew) { if (nNew != mnPushFlags) mnPushFlags = nNew; } + vcl::PushFlags getPushFlags() const { return mnPushFlags; } + void setPushFlags(vcl::PushFlags nNew) { if (nNew != mnPushFlags) mnPushFlags = nNew; } bool getLineOrFillActive() const { return (mbLineColor || mbFillColor); } }; -} -namespace wmfemfhelper -{ /** stack for properties This class builds a stack based on the PropertyHolder @@ -200,15 +199,12 @@ namespace wmfemfhelper public: PropertyHolders(); void PushDefault(); - void Push(PushFlags nPushFlags); + void Push(vcl::PushFlags nPushFlags); void Pop(); PropertyHolder& Current(); ~PropertyHolders(); }; -} -namespace wmfemfhelper -{ drawinglayer::primitive2d::Primitive2DContainer interpretMetafile( const GDIMetaFile& rMetaFile, const drawinglayer::geometry::ViewInformation2D& rViewInformation); |