1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
22 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
24 #include <drawinglayer/drawinglayerdllapi.h>
26 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
27 #include <basegfx/color/bcolormodifier.hxx>
30 namespace drawinglayer
34 /** ModifiedColorPrimitive2D class
36 This primitive is a grouping primitive and allows to define
37 how the colors of its child content shall be modified for
38 visualisation. This can be (and is) used e.g. for generic shadow
39 visualisation by forcing all color usages of the contained
40 sub-content to the shadow color.
42 For the possibilities of color modifications, please refer
43 to the basegfx::BColorModifier definitions in basegfx. For
44 processing there is tooling in basegfx to build a stack of
45 BColorModifierSharedPtrs to always be able to process the correct
48 If a renderer does not handle this primitive, the content will
49 be visualized unchanged.
51 class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive2D
: public GroupPrimitive2D
54 /// The ColorModifier to use
55 basegfx::BColorModifierSharedPtr maColorModifier
;
59 ModifiedColorPrimitive2D(
60 const Primitive2DContainer
& rChildren
,
61 const basegfx::BColorModifierSharedPtr
& rColorModifier
);
64 const basegfx::BColorModifierSharedPtr
& getColorModifier() const { return maColorModifier
; }
67 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const override
;
70 DeclPrimitive2DIDBlock()
72 } // end of namespace primitive2d
73 } // end of namespace drawinglayer
76 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */