diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-08-26 09:15:18 +0200 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-08-26 09:15:18 +0200 |
commit | 1e37c007736fb550b3e43a5aada15220263f7376 (patch) | |
tree | 187e06dd582774519213f1f41c150ba7e005826c | |
parent | a65ca79f2a3b044f8e920c191445f010e6da255d (diff) | |
parent | b8d78852acfa632daa32d5827d0ee64fd6102c80 (diff) |
CWS-TOOLING: integrate CWS renaissance1
-rw-r--r-- | drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx | 128 | ||||
-rw-r--r-- | drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx | 18 | ||||
-rw-r--r-- | drawinglayer/prj/d.lst | 2 | ||||
-rw-r--r-- | drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx | 339 | ||||
-rw-r--r-- | drawinglayer/source/primitive2d/makefile.mk | 1 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/vclhelperbitmaprender.cxx | 36 | ||||
-rw-r--r-- | sfx2/inc/sfx2/titledockwin.hxx | 10 | ||||
-rw-r--r-- | sfx2/source/dialog/titledockwin.cxx | 24 | ||||
-rw-r--r-- | svx/inc/svdstr.hrc | 1 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewcontactofsdrpage.cxx | 81 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdstr.src | 5 |
12 files changed, 591 insertions, 60 deletions
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx new file mode 100644 index 000000000000..c30bff545ddb --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx @@ -0,0 +1,128 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX + +#include <drawinglayer/primitive2d/primitivetools2d.hxx> +#include <vcl/bitmapex.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> + +////////////////////////////////////////////////////////////////////////////// +// DiscreteShadowPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + /** DiscreteShadow data class + + */ + class DiscreteShadow + { + private: + /// the original shadow BitmapEx in a special form + BitmapEx maBitmapEx; + + /// buffered extracted parts of CombinedShadow for easier usage + BitmapEx maTopLeft; + BitmapEx maTop; + BitmapEx maTopRight; + BitmapEx maRight; + BitmapEx maBottomRight; + BitmapEx maBottom; + BitmapEx maBottomLeft; + BitmapEx maLeft; + + public: + /// constructor + DiscreteShadow(const BitmapEx& rBitmapEx); + + /// data read access + const BitmapEx& getBitmapEx() const { return maBitmapEx; } + + /// compare operator + bool operator==(const DiscreteShadow& rCompare) const + { + return getBitmapEx() == rCompare.getBitmapEx(); + } + + /// helper accesses which create on-demand needed segments + const BitmapEx& getTopLeft() const; + const BitmapEx& getTop() const; + const BitmapEx& getTopRight() const; + const BitmapEx& getRight() const; + const BitmapEx& getBottomRight() const; + const BitmapEx& getBottom() const; + const BitmapEx& getBottomLeft() const; + const BitmapEx& getLeft() const; + }; + + /** DiscreteShadowPrimitive2D class + + */ + class DiscreteShadowPrimitive2D : public DiscreteMetricDependentPrimitive2D + { + private: + // the object transformation of the rectangular object + basegfx::B2DHomMatrix maTransform; + + // the bitmap shadow data + DiscreteShadow maDiscreteShadow; + + protected: + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + /// constructor + DiscreteShadowPrimitive2D( + const basegfx::B2DHomMatrix& rTransform, + const DiscreteShadow& rDiscreteShadow); + + /// data read access + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const DiscreteShadow& getDiscreteShadow() const { return maDiscreteShadow; } + + /// compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + /// get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index c60257551c28..87aae8cb768f 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -93,14 +93,16 @@ #define PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50) #define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51) #define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52) -#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53) -#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54) -#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55) -#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56) -#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57) -#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58) -#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59) -#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60) +#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53) +#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54) +#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55) +#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56) +#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57) +#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58) +#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59) +#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60) +#define PRIMITIVE2D_ID_DISCRETESHADOWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 61) +#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 62) ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst index e863e47a3b18..54f087d317e4 100644 --- a/drawinglayer/prj/d.lst +++ b/drawinglayer/prj/d.lst @@ -16,6 +16,8 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d ..\inc\drawinglayer\primitive2d\borderlineprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\borderlineprimitive2d.hxx ..\inc\drawinglayer\primitive2d\chartprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\chartprimitive2d.hxx ..\inc\drawinglayer\primitive2d\controlprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\controlprimitive2d.hxx +..\inc\drawinglayer\primitive2d\discretebitmapprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\discretebitmapprimitive2d.hxx +..\inc\drawinglayer\primitive2d\discreteshadowprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\discreteshadowprimitive2d.hxx ..\inc\drawinglayer\primitive2d\embedded3dprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\embedded3dprimitive2d.hxx ..\inc\drawinglayer\primitive2d\fillbitmapprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\fillbitmapprimitive2d.hxx ..\inc\drawinglayer\primitive2d\fillgradientprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\fillgradientprimitive2d.hxx diff --git a/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx new file mode 100644 index 000000000000..a4afd501728b --- /dev/null +++ b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx @@ -0,0 +1,339 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx> +#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> +#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <drawinglayer/primitive2d/transformprimitive2d.hxx> +#include <drawinglayer/geometry/viewinformation2d.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + DiscreteShadow::DiscreteShadow(const BitmapEx& rBitmapEx) + : maBitmapEx(rBitmapEx), + maTopLeft(), + maTop(), + maTopRight(), + maRight(), + maBottomRight(), + maBottom(), + maBottomLeft(), + maLeft() + { + const Size& rBitmapSize = getBitmapEx().GetSizePixel(); + + if(rBitmapSize.Width() != rBitmapSize.Height() || rBitmapSize.Width() < 7) + { + OSL_ENSURE(false, "DiscreteShadowPrimitive2D: wrong bitmap format (!)"); + maBitmapEx = BitmapEx(); + } + } + + const BitmapEx& DiscreteShadow::getTopLeft() const + { + if(maTopLeft.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maTopLeft = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maTopLeft.Crop( + Rectangle(Point(0,0),Size(nQuarter*2+1,nQuarter*2+1))); + } + + return maTopLeft; + } + + const BitmapEx& DiscreteShadow::getTop() const + { + if(maTop.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maTop = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maTop.Crop( + Rectangle(Point(nQuarter*2+1,0),Size(1,nQuarter+1))); + } + + return maTop; + } + + const BitmapEx& DiscreteShadow::getTopRight() const + { + if(maTopRight.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maTopRight = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maTopRight.Crop( + Rectangle(Point(nQuarter*2+2,0),Size(nQuarter*2+1,nQuarter*2+1))); + } + + return maTopRight; + } + + const BitmapEx& DiscreteShadow::getRight() const + { + if(maRight.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maRight = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maRight.Crop( + Rectangle(Point(nQuarter*3+2,nQuarter*2+1),Size(nQuarter+1,1))); + } + + return maRight; + } + + const BitmapEx& DiscreteShadow::getBottomRight() const + { + if(maBottomRight.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maBottomRight = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maBottomRight.Crop( + Rectangle(Point(nQuarter*2+2,nQuarter*2+2),Size(nQuarter*2+1,nQuarter*2+1))); + } + + return maBottomRight; + } + + const BitmapEx& DiscreteShadow::getBottom() const + { + if(maBottom.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maBottom = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maBottom.Crop( + Rectangle(Point(nQuarter*2+1,nQuarter*3+2),Size(1,nQuarter+1))); + } + + return maBottom; + } + + const BitmapEx& DiscreteShadow::getBottomLeft() const + { + if(maBottomLeft.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maBottomLeft = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maBottomLeft.Crop( + Rectangle(Point(0,nQuarter*2+2),Size(nQuarter*2+1,nQuarter*2+1))); + } + + return maBottomLeft; + } + + const BitmapEx& DiscreteShadow::getLeft() const + { + if(maLeft.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maLeft = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maLeft.Crop( + Rectangle(Point(0,nQuarter*2+1),Size(nQuarter+1,1))); + } + + return maLeft; + } + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence DiscreteShadowPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + Primitive2DSequence xRetval; + + if(!getDiscreteShadow().getBitmapEx().IsEmpty()) + { + const sal_Int32 nQuarter((getDiscreteShadow().getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const basegfx::B2DVector aScale(getTransform() * basegfx::B2DVector(1.0, 1.0)); + const double fSingleX(getDiscreteUnit() / aScale.getX()); + const double fSingleY(getDiscreteUnit() / aScale.getY()); + const double fBorderX(fSingleX * nQuarter); + const double fBorderY(fSingleY * nQuarter); + const double fBigLenX((fBorderX * 2.0) + fSingleX); + const double fBigLenY((fBorderY * 2.0) + fSingleY); + + xRetval.realloc(8); + + // TopLeft + xRetval[0] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getTopLeft(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBigLenX, + fBigLenY, + -fBorderX, + -fBorderY))); + + // Top + xRetval[1] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getTop(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + 1.0 - (2.0 * fBorderX) - fSingleX, + fBorderY + fSingleY, + fBorderX + fSingleX, + -fBorderY))); + + // TopRight + xRetval[2] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getTopRight(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBigLenX, + fBigLenY, + 1.0 - fBorderX, + -fBorderY))); + + // Right + xRetval[3] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getRight(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBorderX + fSingleX, + 1.0 - (2.0 * fBorderY) - fSingleY, + 1.0, + fBorderY + fSingleY))); + + // BottomRight + xRetval[4] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getBottomRight(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBigLenX, + fBigLenY, + 1.0 - fBorderX, + 1.0 - fBorderY))); + + // Bottom + xRetval[5] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getBottom(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + 1.0 - (2.0 * fBorderX) - fSingleX, + fBorderY + fSingleY, + fBorderX + fSingleX, + 1.0))); + + // BottomLeft + xRetval[6] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getBottomLeft(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBigLenX, + fBigLenY, + -fBorderX, + 1.0 - fBorderY))); + + // Left + xRetval[7] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getLeft(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBorderX + fSingleX, + 1.0 - (2.0 * fBorderY) - fSingleY, + -fBorderX, + fBorderY + fSingleY))); + + // put all in object transformation to get to target positions + const Primitive2DReference xTransformed( + new TransformPrimitive2D( + getTransform(), + xRetval)); + + xRetval = Primitive2DSequence(&xTransformed, 1); + } + + return xRetval; + } + + DiscreteShadowPrimitive2D::DiscreteShadowPrimitive2D( + const basegfx::B2DHomMatrix& rTransform, + const DiscreteShadow& rDiscreteShadow) + : DiscreteMetricDependentPrimitive2D(), + maTransform(rTransform), + maDiscreteShadow(rDiscreteShadow) + { + } + + bool DiscreteShadowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive)) + { + const DiscreteShadowPrimitive2D& rCompare = (DiscreteShadowPrimitive2D&)rPrimitive; + + return (getTransform() == rCompare.getTransform() + && getDiscreteShadow() == rCompare.getDiscreteShadow()); + } + + return false; + } + + basegfx::B2DRange DiscreteShadowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const + { + if(getDiscreteShadow().getBitmapEx().IsEmpty()) + { + // no graphics without valid bitmap definition + return basegfx::B2DRange(); + } + else + { + // prepare normal objectrange + basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0); + aRetval.transform(getTransform()); + + // extract discrete shadow size and grow + const basegfx::B2DVector aScale(rViewInformation.getViewTransformation() * basegfx::B2DVector(1.0, 1.0)); + const sal_Int32 nQuarter((getDiscreteShadow().getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const double fGrowX((1.0 / aScale.getX()) * nQuarter); + const double fGrowY((1.0 / aScale.getY()) * nQuarter); + aRetval.grow(std::max(fGrowX, fGrowY)); + + return aRetval; + } + } + + // provide unique ID + ImplPrimitrive2DIDBlock(DiscreteShadowPrimitive2D, PRIMITIVE2D_ID_DISCRETESHADOWPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk index bca5805ae6eb..720769a0efd5 100644 --- a/drawinglayer/source/primitive2d/makefile.mk +++ b/drawinglayer/source/primitive2d/makefile.mk @@ -46,6 +46,7 @@ SLOFILES= \ $(SLO)$/chartprimitive2d.obj \ $(SLO)$/controlprimitive2d.obj \ $(SLO)$/discretebitmapprimitive2d.obj \ + $(SLO)$/discreteshadowprimitive2d.obj \ $(SLO)$/embedded3dprimitive2d.obj \ $(SLO)$/epsprimitive2d.obj \ $(SLO)$/fillbitmapprimitive2d.obj \ diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx index db61e0721ef0..80e34ba27701 100644 --- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx +++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx @@ -85,9 +85,13 @@ namespace drawinglayer } // prepare dest coor + const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX())); + const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY())); const Rectangle aDestRectPixel( - basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()), - basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY())); + basegfx::fround(aOutlineRange.getMinX()), + basegfx::fround(aOutlineRange.getMinY()), + nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0, + nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0); // paint it using GraphicManager Graphic aGraphic(rBitmapEx); @@ -106,9 +110,13 @@ namespace drawinglayer // prepare dest coor. Necessary to expand since vcl's DrawBitmapEx draws one pix less basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0); aOutlineRange.transform(rTransform); + const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX())); + const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY())); const Rectangle aDestRectPixel( - basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()), - basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY())); + basegfx::fround(aOutlineRange.getMinX()), + basegfx::fround(aOutlineRange.getMinY()), + nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0, + nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0); // decompose matrix to check for shear, rotate and mirroring basegfx::B2DVector aScale, aTranslate; @@ -145,9 +153,13 @@ namespace drawinglayer // process self with free transformation (containing shear and rotate). Get dest rect in pixels. basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0); aOutlineRange.transform(rTransform); + const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX())); + const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY())); const Rectangle aDestRectLogic( - basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()), - basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY())); + basegfx::fround(aOutlineRange.getMinX()), + basegfx::fround(aOutlineRange.getMinY()), + nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0, + nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0); const Rectangle aDestRectPixel(rOutDev.LogicToPixel(aDestRectLogic)); // #i96708# check if Metafile is recorded @@ -161,18 +173,19 @@ namespace drawinglayer if(!aCroppedRectPixel.IsEmpty()) { - // as maximum for destination, orientate at SourceSizePixel, but + // as maximum for destination, orientate at aOutputRectPixel, but // take a rotation of 45 degrees (sqrt(2)) as maximum expansion into account const Size aSourceSizePixel(rBitmapEx.GetSizePixel()); const double fMaximumArea( - (double)aSourceSizePixel.getWidth() * - (double)aSourceSizePixel.getHeight() * + (double)aOutputRectPixel.getWidth() * + (double)aOutputRectPixel.getHeight() * 1.4142136); // 1.4142136 taken as sqrt(2.0) // test if discrete view size (pixel) maybe too big and limit it const double fArea(aCroppedRectPixel.getWidth() * aCroppedRectPixel.getHeight()); const bool bNeedToReduce(fArea > fMaximumArea); double fReduceFactor(1.0); + const Size aDestSizePixel(aCroppedRectPixel.GetSize()); if(bNeedToReduce) { @@ -219,11 +232,6 @@ namespace drawinglayer if(bNeedToReduce) { // paint in target size - const double fFactor(1.0 / fReduceFactor); - const Size aDestSizePixel( - basegfx::fround(aCroppedRectPixel.getWidth() * fFactor), - basegfx::fround(aCroppedRectPixel.getHeight() * fFactor)); - if(bRecordToMetaFile) { rOutDev.DrawBitmapEx( diff --git a/sfx2/inc/sfx2/titledockwin.hxx b/sfx2/inc/sfx2/titledockwin.hxx index ebb4497a0ba2..2728cc621138 100644 --- a/sfx2/inc/sfx2/titledockwin.hxx +++ b/sfx2/inc/sfx2/titledockwin.hxx @@ -100,6 +100,11 @@ namespace sfx2 ToolBox& GetToolBox() { return m_aToolbox; } const ToolBox& GetToolBox() const { return m_aToolbox; } + /** Return the border that is painted around the inner window as + decoration. + */ + SvBorder GetDecorationBorder (void) const { return m_aBorder; } + protected: // Window overridables virtual void Paint( const Rectangle& i_rArea ); @@ -153,6 +158,11 @@ namespace sfx2 since the last Paint(). */ bool m_bLayoutPending; + + /** Height of the title bar. Calculated in impl_layout(). + */ + int m_nTitleBarHeight; + }; //...................................................................................................................... diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx index 58a61d66ba8b..4be0948d8047 100644 --- a/sfx2/source/dialog/titledockwin.cxx +++ b/sfx2/source/dialog/titledockwin.cxx @@ -51,6 +51,7 @@ namespace sfx2 ,m_aContentWindow( this, WB_DIALOGCONTROL ) ,m_aBorder( 3, 1, 3, 3 ) ,m_bLayoutPending( false ) + ,m_nTitleBarHeight(0) { impl_construct(); } @@ -139,23 +140,23 @@ namespace sfx2 Size aWindowSize( GetOutputSizePixel() ); // position the tool box - int nTitleBarHeight( GetSettings().GetStyleSettings().GetTitleHeight() ); - if ( aToolBoxSize.Height() > nTitleBarHeight ) - nTitleBarHeight = aToolBoxSize.Height(); + m_nTitleBarHeight = GetSettings().GetStyleSettings().GetTitleHeight(); + if ( aToolBoxSize.Height() > m_nTitleBarHeight ) + m_nTitleBarHeight = aToolBoxSize.Height(); m_aToolbox.SetPosSizePixel( Point( aWindowSize.Width() - aToolBoxSize.Width(), - ( nTitleBarHeight - aToolBoxSize.Height() ) / 2 + ( m_nTitleBarHeight - aToolBoxSize.Height() ) / 2 ), aToolBoxSize ); // Place the content window. - if ( nTitleBarHeight < aToolBoxSize.Height() ) - nTitleBarHeight = aToolBoxSize.Height(); - aWindowSize.Height() -= nTitleBarHeight; + if ( m_nTitleBarHeight < aToolBoxSize.Height() ) + m_nTitleBarHeight = aToolBoxSize.Height(); + aWindowSize.Height() -= m_nTitleBarHeight; m_aContentWindow.SetPosSizePixel( - Point( m_aBorder.Left(), nTitleBarHeight + m_aBorder.Top() ), + Point( m_aBorder.Left(), m_nTitleBarHeight + m_aBorder.Top() ), Size( aWindowSize.Width() - m_aBorder.Left() - m_aBorder.Right(), aWindowSize.Height() - m_aBorder.Top() - m_aBorder.Bottom() @@ -175,11 +176,6 @@ namespace sfx2 Push( PUSH_FONT | PUSH_FILLCOLOR | PUSH_LINECOLOR ); - int nTitleBarHeight( GetSettings().GetStyleSettings().GetTitleHeight() ); - const Size aToolBoxSize = m_aToolbox.CalcWindowSizePixel(); - if ( aToolBoxSize.Height() > nTitleBarHeight ) - nTitleBarHeight = aToolBoxSize.Height(); - SetFillColor( GetSettings().GetStyleSettings().GetDialogColor() ); SetLineColor(); @@ -194,7 +190,7 @@ namespace sfx2 int nInnerLeft = nOuterLeft + m_aBorder.Left() - 1; int nOuterRight = aWindowSize.Width() - 1; int nInnerRight = nOuterRight - m_aBorder.Right() + 1; - int nInnerTop = nTitleBarHeight + m_aBorder.Top() - 1; + int nInnerTop = m_nTitleBarHeight + m_aBorder.Top() - 1; int nOuterBottom = aWindowSize.Height() - 1; int nInnerBottom = nOuterBottom - m_aBorder.Bottom() + 1; diff --git a/svx/inc/svdstr.hrc b/svx/inc/svdstr.hrc index f1bc8cfdae19..d778bf40326b 100644 --- a/svx/inc/svdstr.hrc +++ b/svx/inc/svdstr.hrc @@ -756,6 +756,7 @@ //BFS01#define SIP_SDRATTRSET_GRAF (SIP_Begin + 258) #define SIP_SA_MARKERS (SIP_Begin + 258) +#define SIP_SA_PAGESHADOW35X35 (SIP_Begin + 259) #define SIP_SA_FINE_MARKERS (SIP_Begin + 260) // #100499# diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index b80b6fcbba88..ad65b647001e 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -44,6 +44,10 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <svx/sdr/primitive2d/sdrattributecreator.hxx> #include <svx/sdr/primitive2d/sdrdecompositiontools.hxx> +#include <vcl/lazydelete.hxx> +#include "svdstr.hrc" +#include "svdglob.hxx" +#include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx> #include <drawinglayer/attribute/sdrfillattribute.hxx> ////////////////////////////////////////////////////////////////////////////// @@ -131,31 +135,54 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence() const { + static bool bUseOldPageShadow(false); const SdrPage& rPage = getPage(); basegfx::B2DHomMatrix aPageMatrix; aPageMatrix.set(0, 0, (double)rPage.GetWdt()); aPageMatrix.set(1, 1, (double)rPage.GetHgt()); - // create page shadow polygon - const double fPageBorderFactor(1.0 / 256.0); - basegfx::B2DPolygon aPageShadowPolygon; - aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0)); - aPageShadowPolygon.setClosed(true); - aPageShadowPolygon.transform(aPageMatrix); - - // We have only the page information, not the view information. Use the - // svtools::FONTCOLOR color for initialisation - const svtools::ColorConfig aColorConfig; - const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPageShadowPolygon), aRGBShadowColor)); + if(bUseOldPageShadow) + { + // create page shadow polygon + const double fPageBorderFactor(1.0 / 256.0); + basegfx::B2DPolygon aPageShadowPolygon; + aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0)); + aPageShadowPolygon.setClosed(true); + aPageShadowPolygon.transform(aPageMatrix); + + // We have only the page information, not the view information. Use the + // svtools::FONTCOLOR color for initialisation + const svtools::ColorConfig aColorConfig; + const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); + const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aPageShadowPolygon), + aRGBShadowColor)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + else + { + static vcl::DeleteOnDeinit<drawinglayer::primitive2d::DiscreteShadow> + aDiscreteShadow(new drawinglayer::primitive2d::DiscreteShadow( + BitmapEx(ResId(SIP_SA_PAGESHADOW35X35, *ImpGetResMgr())))); + if (aDiscreteShadow.get() != NULL) + { + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::DiscreteShadowPrimitive2D( + aPageMatrix, + *aDiscreteShadow.get())); - return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + return drawinglayer::primitive2d::Primitive2DSequence(); + } } ViewContactOfPageShadow::ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage) @@ -313,11 +340,17 @@ namespace sdr const SdrPage& rPage = getPage(); const basegfx::B2DRange aPageBorderRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt()); - // We have only the page information, not the view information. Use the - // svtools::FONTCOLOR color for initialisation - const svtools::ColorConfig aColorConfig; - const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - const basegfx::BColor aRGBBorderColor(aBorderColor.getBColor()); + // Changed to 0x949599 for renaissance, before svtools::FONTCOLOR was used. + // Added old case as fallback for HighContrast. + basegfx::BColor aRGBBorderColor(0x94 / (double)0xff, 0x95 / (double)0xff, 0x99 / (double)0xff); + + if(Application::GetSettings().GetStyleSettings().GetHighContrastMode()) + { + const svtools::ColorConfig aColorConfig; + const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); + + aRGBBorderColor = aBorderColor.getBColor(); + } if(rPage.getPageBorderOnlyLeftRight()) { diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx index c751ba2ada76..f7145dcd9d73 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx @@ -320,6 +320,12 @@ namespace sdr return false; } + // no page shadow for high contrast mode + if(GetObjectContact().isDrawModeHighContrast()) + { + return false; + } + return true; } } // end of namespace contact diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src index 1317a0e1328d..000e20cf24d4 100644 --- a/svx/source/svdraw/svdstr.src +++ b/svx/source/svdraw/svdstr.src @@ -2746,6 +2746,11 @@ String SIP_SA_GRAFRESERVE4 { Text = "" ; }; String SIP_SA_GRAFRESERVE5 { Text = "" ; }; String SIP_SA_GRAFRESERVE6 { Text = "" ; }; +Bitmap SIP_SA_PAGESHADOW35X35 +{ + File = "pageshadow35x35.png"; +}; + Bitmap SIP_SA_MARKERS { File = "markers.bmp"; |