diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/drawinglayer/attribute/sdrglowattribute.hxx | 54 | ||||
-rw-r--r-- | include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx | 1 | ||||
-rw-r--r-- | include/drawinglayer/primitive2d/glowprimitive2d.hxx | 71 | ||||
-rw-r--r-- | include/oox/export/drawingml.hxx | 2 | ||||
-rw-r--r-- | include/svx/sdglowmetricitem.hxx | 37 | ||||
-rw-r--r-- | include/svx/strings.hrc | 3 | ||||
-rw-r--r-- | include/svx/svddef.hxx | 9 | ||||
-rw-r--r-- | include/svx/unoshprp.hxx | 5 | ||||
-rw-r--r-- | include/vcl/BitmapFilterStackBlur.hxx | 34 | ||||
-rw-r--r-- | include/xmloff/xmltoken.hxx | 3 |
10 files changed, 217 insertions, 2 deletions
diff --git a/include/drawinglayer/attribute/sdrglowattribute.hxx b/include/drawinglayer/attribute/sdrglowattribute.hxx new file mode 100644 index 000000000000..f5120c1a2044 --- /dev/null +++ b/include/drawinglayer/attribute/sdrglowattribute.hxx @@ -0,0 +1,54 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRGLOWATTRIBUTE_HXX +#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRGLOWATTRIBUTE_HXX + +#include <drawinglayer/drawinglayerdllapi.h> +#include <o3tl/cow_wrapper.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/color/bcolor.hxx> +#include <basegfx/range/b2drange.hxx> + +#include <optional> + +namespace drawinglayer +{ +namespace attribute +{ +class DRAWINGLAYER_DLLPUBLIC SdrGlowAttribute +{ +private: + sal_Int32 m_nRadius = 0; + mutable std::optional<basegfx::B2DHomMatrix> m_oTransfCache; + basegfx::BColor m_color; + +public: + SdrGlowAttribute(sal_Int32 nRadius, const basegfx::BColor& rColor); + SdrGlowAttribute(); + SdrGlowAttribute(const SdrGlowAttribute&); + SdrGlowAttribute(SdrGlowAttribute&&); + ~SdrGlowAttribute(); + bool operator==(const SdrGlowAttribute& rCandidate) const; + + SdrGlowAttribute& operator=(const SdrGlowAttribute&); + SdrGlowAttribute& operator=(SdrGlowAttribute&&); + + // data access + const basegfx::B2DHomMatrix& GetTransfMatrix(basegfx::B2DRange nCenter) const; + const basegfx::BColor& getColor() const { return m_color; }; + sal_Int32 getRadius() const { return m_nRadius; }; + bool isDefault() const { return m_nRadius == 0; }; +}; +} // end of namespace attribute +} // end of namespace drawinglayer + +#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRGLOWATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index 1cc379d3e521..0c9aa3c0b4ba 100644 --- a/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -102,6 +102,7 @@ #define PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 68) #define PRIMITIVE2D_ID_POLYPOLYGONSELECTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 69) #define PRIMITIVE2D_ID_PAGEHIERARCHYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 70) +#define PRIMITIVE2D_ID_GLOWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 71) // When you add a new primitive, please update the drawinglayer::primitive2d::idToString() function // in drawinglayer/source/primitive2d/baseprimitive2d.cxx. diff --git a/include/drawinglayer/primitive2d/glowprimitive2d.hxx b/include/drawinglayer/primitive2d/glowprimitive2d.hxx new file mode 100644 index 000000000000..0c77a9a94a6c --- /dev/null +++ b/include/drawinglayer/primitive2d/glowprimitive2d.hxx @@ -0,0 +1,71 @@ +/* -*- 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 . + */ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GLOWPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GLOWPRIMITIVE2D_HXX + +#include <drawinglayer/drawinglayerdllapi.h> + +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/color/bcolor.hxx> + +namespace drawinglayer +{ +namespace primitive2d +{ +class DRAWINGLAYER_DLLPUBLIC GlowPrimitive2D final : public GroupPrimitive2D +{ +private: + /// the Glow transformation, normally just an offset + basegfx::B2DHomMatrix maGlowTransform; + + /// the Glow color to which all geometry is to be forced + basegfx::BColor maGlowColor; + +public: + /// constructor + GlowPrimitive2D(const basegfx::B2DHomMatrix& rGlowTransform, const basegfx::BColor& rGlowColor, + const Primitive2DContainer& rChildren); + + /// data read access + const basegfx::B2DHomMatrix& getGlowTransform() const { return maGlowTransform; } + const basegfx::BColor& getGlowColor() const { return maGlowColor; } + + /// compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + /// get range + virtual basegfx::B2DRange + getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override; + + /// create decomposition + virtual void + get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, + const geometry::ViewInformation2D& rViewInformation) const override; + + /// provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; +}; +} // end of namespace primitive2d +} // end of namespace drawinglayer + +#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_GLOWPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index a3da6a3cb442..ce5c6e9668e2 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -167,6 +167,8 @@ protected: static bool EqualGradients( css::awt::Gradient aGradient1, css::awt::Gradient aGradient2 ); + void WriteGlowEffect(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet); + public: DrawingML( ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB, DocumentType eDocumentType = DOCUMENT_PPTX, DMLTextExport* pTextExport = nullptr ) : meDocumentType( eDocumentType ), mpTextExport(pTextExport), mpFS( pFS ), mpFB( pFB ), mbIsBackgroundDark( false ) {} diff --git a/include/svx/sdglowmetricitem.hxx b/include/svx/sdglowmetricitem.hxx new file mode 100644 index 000000000000..4a78cdedc19c --- /dev/null +++ b/include/svx/sdglowmetricitem.hxx @@ -0,0 +1,37 @@ +/* -*- 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/. + */ +#ifndef INCLUDED_SVX_SDGLOWMETRICITEM_HXX +#define INCLUDED_SVX_SDGLOWMETRICITEM_HXX + +#include <svx/svddef.hxx> +#include <svl/poolitem.hxx> +#include <svx/svxdllapi.h> + +#include <com/sun/star/table/GlowFormat.hpp> +#include <drawinglayer/attribute/sdrglowattribute.hxx> + +class SVX_DLLPUBLIC SdrGlowItem : public SfxPoolItem +{ +private: + css::uno::Reference<css::table::GlowFormat> m_xGlow; + +public: + SdrGlowItem(); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, + MapUnit ePresMetric, OUString& rText, + const IntlWrapper&) const override; + virtual bool operator==(const SfxPoolItem&) const override; + virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; + virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override; + virtual SdrGlowItem* Clone(SfxItemPool* pPool = nullptr) const override; + + drawinglayer::attribute::SdrGlowAttribute GetGlowAttr() const; +}; + +#endif diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index 0c4d78465364..b208d88605a4 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -512,6 +512,9 @@ #define SIP_SA_GRAFINVERT NC_("SIP_SA_GRAFINVERT", "Invert") #define SIP_SA_GRAFMODE NC_("SIP_SA_GRAFMODE", "Image mode") #define SIP_SA_GRAFCROP NC_("SIP_SA_GRAFCROP", "Crop") +#define SIP_SA_GLOW NC_("SIP_SA_GRAD", "Glow effect") +#define SIP_SA_GLOW_RAD NC_("SIP_SA_GLOW_RAD", "Radius of glow effect") +#define SIP_SA_GLOW_COLOR NC_("SIP_SA_GLOW_COLOR", "Color of glow effect") #define STR_ObjNameSingulMEDIA NC_("STR_ObjNameSingulMEDIA", "Media object") #define STR_ObjNamePluralMEDIA NC_("STR_ObjNamePluralMEDIA", "Media objects") // drawing layer table strings diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx index a8696559c4fd..10713f61188b 100644 --- a/include/svx/svddef.hxx +++ b/include/svx/svddef.hxx @@ -401,10 +401,15 @@ class SdrTextHorzAdjustItem; #define SDRATTR_TABLE_BORDER_TLBR TypedWhichId<SvxLineItem>(SDRATTR_TABLE_FIRST+2) #define SDRATTR_TABLE_BORDER_BLTR TypedWhichId<SvxLineItem>(SDRATTR_TABLE_FIRST+3) #define SDRATTR_TABLE_TEXT_ROTATION TypedWhichId<SvxTextRotateItem>(SDRATTR_TABLE_FIRST+4) - #define SDRATTR_TABLE_LAST (SDRATTR_TABLE_TEXT_ROTATION) -#define SDRATTR_END SDRATTR_TABLE_LAST /* 1357 */ /* 1333 V4+++*/ /* 1243 V4+++*/ /*1213*/ /*1085*/ /*1040*/ /*Pool V2: 1123,V1: 1065 */ +#define SDRATTR_GLOW_FIRST (SDRATTR_TABLE_LAST+1) +#define SDRATTR_GLOW TypedWhichId<SdrOnOffItem>(SDRATTR_GLOW_FIRST+0) +#define SDRATTR_GLOW_RAD TypedWhichId<SdrMetricItem>(SDRATTR_GLOW_FIRST+1) +#define SDRATTR_GLOW_COLOR TypedWhichId<XColorItem>(SDRATTR_GLOW_FIRST+2) +#define SDRATTR_GLOW_LAST (SDRATTR_GLOW_COLOR) + +#define SDRATTR_END SDRATTR_GLOW_LAST /* 1357 */ /* 1333 V4+++*/ /* 1243 V4+++*/ /*1213*/ /*1085*/ /*1040*/ /*Pool V2: 1123,V1: 1065 */ #endif // INCLUDED_SVX_SVDDEF_HXX diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx index 0861844be16d..fd70a04035fe 100644 --- a/include/svx/unoshprp.hxx +++ b/include/svx/unoshprp.hxx @@ -209,6 +209,11 @@ { OUString("FontWorkHideForm"), XATTR_FORMTXTHIDEFORM, cppu::UnoType<bool>::get(), 0, 0}, \ { OUString("FontWorkShadowTransparence"),XATTR_FORMTXTSHDWTRANSP, ::cppu::UnoType<sal_Int16>::get(), 0, 0}, +#define GLOW_PROPERTIES \ + { OUString("GlowEffect"), SDRATTR_GLOW, cppu::UnoType<bool>::get(), 0, 0}, \ + { OUString{"GlowEffectRad"}, SDRATTR_GLOW_RAD, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString{"GlowEffectColor"}, SDRATTR_GLOW_COLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0}, + #define SHADOW_PROPERTIES \ { OUString(UNO_NAME_SHADOW), SDRATTR_SHADOW, cppu::UnoType<bool>::get(), 0, 0}, \ { OUString(UNO_NAME_SHADOWCOLOR), SDRATTR_SHADOWCOLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0}, \ diff --git a/include/vcl/BitmapFilterStackBlur.hxx b/include/vcl/BitmapFilterStackBlur.hxx new file mode 100644 index 000000000000..425420ded3c2 --- /dev/null +++ b/include/vcl/BitmapFilterStackBlur.hxx @@ -0,0 +1,34 @@ +/* -*- 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/. + * + */ + +#ifndef INCLUDED_VCL_BITMAPFILTERSTACKBLUR_HXX +#define INCLUDED_VCL_BITMAPFILTERSTACKBLUR_HXX + +#include <vcl/bitmap.hxx> +#include <vcl/bitmapex.hxx> +#include <vcl/BitmapFilter.hxx> + +class VCL_DLLPUBLIC BitmapFilterStackBlur : public BitmapFilter +{ + sal_Int32 mnRadius; + bool mbExtend; + +public: + BitmapFilterStackBlur(sal_Int32 nRadius, bool bExtend = true); + virtual ~BitmapFilterStackBlur(); + + virtual BitmapEx execute(BitmapEx const& rBitmap) const override; + + Bitmap filter(Bitmap const& rBitmap) const; +}; + +#endif // INCLUDED_VCL_BITMAPFILTERSTACKBLUR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 7289d72e5e61..ba4a588d85eb 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -925,6 +925,9 @@ namespace xmloff { namespace token { XML_GCD, XML_GENERATOR, XML_GEQ, + XML_GLOW, + XML_GLOW_RADIUS, + XML_GLOW_COLOR, XML_GOURAUD, XML_GRADIENT, XML_GRADIENT_ANGLE, |