Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
21 : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
22 :
23 : #include <drawinglayer/drawinglayerdllapi.h>
24 :
25 : #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
26 : #include <basegfx/color/bcolormodifier.hxx>
27 :
28 : //////////////////////////////////////////////////////////////////////////////
29 :
30 : namespace drawinglayer
31 : {
32 : namespace primitive2d
33 : {
34 : /** ModifiedColorPrimitive2D class
35 :
36 : This primitive is a grouping primitive and allows to define
37 : how the colors of it's 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.
41 :
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 : BColorModifiers to always be able to proccess the correct
46 : colors.
47 :
48 : If a renderer does not handle this primitive, the content will
49 : be visualized unchanged.
50 : */
51 0 : class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive2D : public GroupPrimitive2D
52 : {
53 : private:
54 : /// The ColorModifier to use
55 : basegfx::BColorModifier maColorModifier;
56 :
57 : public:
58 : /// constructor
59 : ModifiedColorPrimitive2D(
60 : const Primitive2DSequence& rChildren,
61 : const basegfx::BColorModifier& rColorModifier);
62 :
63 : /// data read access
64 0 : const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
65 :
66 : /// compare operator
67 : virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
68 :
69 : /// provide unique ID
70 : DeclPrimitrive2DIDBlock()
71 : };
72 : } // end of namespace primitive2d
73 : } // end of namespace drawinglayer
74 :
75 : //////////////////////////////////////////////////////////////////////////////
76 :
77 : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
78 :
79 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|