14f506f19SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 34f506f19SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 44f506f19SAndrew Rist * or more contributor license agreements. See the NOTICE file 54f506f19SAndrew Rist * distributed with this work for additional information 64f506f19SAndrew Rist * regarding copyright ownership. The ASF licenses this file 74f506f19SAndrew Rist * to you under the Apache License, Version 2.0 (the 84f506f19SAndrew Rist * "License"); you may not use this file except in compliance 94f506f19SAndrew Rist * with the License. You may obtain a copy of the License at 104f506f19SAndrew Rist * 114f506f19SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 124f506f19SAndrew Rist * 134f506f19SAndrew Rist * Unless required by applicable law or agreed to in writing, 144f506f19SAndrew Rist * software distributed under the License is distributed on an 154f506f19SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 164f506f19SAndrew Rist * KIND, either express or implied. See the License for the 174f506f19SAndrew Rist * specific language governing permissions and limitations 184f506f19SAndrew Rist * under the License. 194f506f19SAndrew Rist * 204f506f19SAndrew Rist *************************************************************/ 214f506f19SAndrew Rist 22cdf0e10cSrcweir #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX 23cdf0e10cSrcweir #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX 24cdf0e10cSrcweir 25090f0eb8SEike Rathke #include <drawinglayer/drawinglayerdllapi.h> 26cdf0e10cSrcweir #include <drawinglayer/primitive2d/groupprimitive2d.hxx> 27cdf0e10cSrcweir #include <basegfx/color/bcolormodifier.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 30cdf0e10cSrcweir 31cdf0e10cSrcweir namespace drawinglayer 32cdf0e10cSrcweir { 33*49c58f9bSArmin Le Grand namespace primitive2d 34*49c58f9bSArmin Le Grand { 35cdf0e10cSrcweir /** ModifiedColorPrimitive2D class 36cdf0e10cSrcweir 37cdf0e10cSrcweir This primitive is a grouping primitive and allows to define 38cdf0e10cSrcweir how the colors of it's child content shall be modified for 39cdf0e10cSrcweir visualisation. This can be (and is) used e.g. for generic shadow 40cdf0e10cSrcweir visualisation by forcing all color usages of the contained 41cdf0e10cSrcweir sub-content to the shadow color. 42cdf0e10cSrcweir 43cdf0e10cSrcweir For the possibilities of color modifications, please refer 44cdf0e10cSrcweir to the basegfx::BColorModifier definitions in basegfx. For 45cdf0e10cSrcweir processing there is tooling in basegfx to build a stack of 46*49c58f9bSArmin Le Grand BColorModifierSharedPtrs to always be able to proccess the correct 47cdf0e10cSrcweir colors. 48cdf0e10cSrcweir 49cdf0e10cSrcweir If a renderer does not handle this primitive, the content will 50cdf0e10cSrcweir be visualized unchanged. 51cdf0e10cSrcweir */ 52*49c58f9bSArmin Le Grand class DRAWINGLAYER_DLLPUBLIC ModifiedColorPrimitive2D : public GroupPrimitive2D 53*49c58f9bSArmin Le Grand { 54*49c58f9bSArmin Le Grand private: 55cdf0e10cSrcweir /// The ColorModifier to use 56*49c58f9bSArmin Le Grand basegfx::BColorModifierSharedPtr maColorModifier; 57cdf0e10cSrcweir 58*49c58f9bSArmin Le Grand public: 59cdf0e10cSrcweir /// constructor 60*49c58f9bSArmin Le Grand ModifiedColorPrimitive2D( 61*49c58f9bSArmin Le Grand const Primitive2DSequence& rChildren, 62*49c58f9bSArmin Le Grand const basegfx::BColorModifierSharedPtr& rColorModifier); 63cdf0e10cSrcweir 64*49c58f9bSArmin Le Grand /// data read access getColorModifier() const65*49c58f9bSArmin Le Grand const basegfx::BColorModifierSharedPtr& getColorModifier() const { return maColorModifier; } 66cdf0e10cSrcweir 67*49c58f9bSArmin Le Grand /// compare operator 68*49c58f9bSArmin Le Grand virtual bool operator==(const BasePrimitive2D& rPrimitive) const; 69cdf0e10cSrcweir 70*49c58f9bSArmin Le Grand /// provide unique ID 71*49c58f9bSArmin Le Grand DeclPrimitrive2DIDBlock() 72*49c58f9bSArmin Le Grand }; 73*49c58f9bSArmin Le Grand } // end of namespace primitive2d 74cdf0e10cSrcweir } // end of namespace drawinglayer 75cdf0e10cSrcweir 76cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 77cdf0e10cSrcweir 78cdf0e10cSrcweir #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX 79cdf0e10cSrcweir 80cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 81cdf0e10cSrcweir // eof 82