From eceecd4a3806f64c2e8fb0a3bcdcc43e1384779f Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Fri, 4 May 2012 14:16:22 +0000 Subject: Related: #i119125# corrected gradient rendering and added stuff to add Title and Description to primitives for later usage Conflicts: drawinglayer/Library_drawinglayer.mk drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx svgio/Package_inc.mk svx/source/sdr/contact/viewcontactofsdrobj.cxx Change-Id: I301c9f5f4ae0efc02d937cd3f56018e27c94a630 --- .../primitive2d/drawinglayer_primitivetypes2d.hxx | 1 + .../primitive2d/objectinfoprimitive2d.hxx | 73 ++++++++++++++++++++++ .../primitive2d/svggradientprimitive2d.hxx | 5 +- 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 drawinglayer/inc/drawinglayer/primitive2d/objectinfoprimitive2d.hxx (limited to 'drawinglayer/inc') diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index e44a8ebc1f23..cb8ff0efd0ff 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -100,6 +100,7 @@ #define PRIMITIVE2D_ID_SVGRADIALATOMPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 65) #define PRIMITIVE2D_ID_CROPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 66) #define PRIMITIVE2D_ID_PATTERNFILLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 67) +#define PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 68) #define PRIMITIVE2D_ID_CLIPPEDBORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 68) diff --git a/drawinglayer/inc/drawinglayer/primitive2d/objectinfoprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/objectinfoprimitive2d.hxx new file mode 100644 index 000000000000..230a7399ff1d --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/objectinfoprimitive2d.hxx @@ -0,0 +1,73 @@ +/* + * 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 . + */ +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INFOHIERARCHYPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INFOHIERARCHYPRIMITIVE2D_HXX + +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + /** ObjectInfoPrimitive2D class + + Info hierarchy helper class to hold contents like Name, Title and + Description which are valid for the child content, e.g. created for + primitives based on DrawingLayer objects or SVG parts. It decomposes + to it's content, so all direct renderers may ignore it. May e.g. + be used when re-creating graphical content from a sequence of primitives + */ + class DRAWINGLAYER_DLLPUBLIC ObjectInfoPrimitive2D : public GroupPrimitive2D + { + private: + rtl::OUString maName; + rtl::OUString maTitle; + rtl::OUString maDesc; + + public: + /// constructor + ObjectInfoPrimitive2D( + const Primitive2DSequence& rChildren, + const rtl::OUString& rName, + const rtl::OUString& rTitle, + const rtl::OUString& rDesc); + + /// data read access + const rtl::OUString& getName() const { return maName; } + const rtl::OUString& getTitle() const { return maTitle; } + const rtl::OUString& getDesc() const { return maDesc; } + + /// compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_INFOHIERARCHYPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx index 2c9e34fe96e1..0e7dab93ff14 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx @@ -203,7 +203,7 @@ namespace drawinglayer const basegfx::B2DPoint& rEnd, bool bUseUnitCoordinates, SpreadMethod aSpreadMethod = Spread_pad); - virtual ~SvgLinearGradientPrimitive2D() {} + virtual ~SvgLinearGradientPrimitive2D(); /// data read access const basegfx::B2DPoint& getEnd() const { return maEnd; } @@ -217,7 +217,7 @@ namespace drawinglayer /// provide unique ID DeclPrimitrive2DIDBlock() }; -} // end of namespace primitive2d + } // end of namespace primitive2d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// @@ -272,6 +272,7 @@ namespace drawinglayer bool bUseUnitCoordinates, SpreadMethod aSpreadMethod = Spread_pad, const basegfx::B2DPoint* pFocal = 0); + virtual ~SvgRadialGradientPrimitive2D(); /// data read access double getRadius() const { return mfRadius; } -- cgit