diff options
Diffstat (limited to 'svx/inc/svx/sdr/overlay')
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx | 105 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlaybitmapex.hxx | 76 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlaycrosshair.hxx | 59 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayhatchrect.hxx | 81 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayhelpline.hxx | 68 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayline.hxx | 68 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlaymanager.hxx | 150 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx | 113 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayobject.hxx | 203 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayobjectcell.hxx | 70 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayobjectlist.hxx | 85 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx | 67 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx | 70 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx | 85 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlayselection.hxx | 95 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlaytools.hxx | 278 | ||||
-rw-r--r-- | svx/inc/svx/sdr/overlay/overlaytriangle.hxx | 72 |
17 files changed, 1745 insertions, 0 deletions
diff --git a/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx new file mode 100644 index 000000000000..dd22a50480de --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayanimatedbitmapex.hxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX +#define _SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/bitmapex.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayAnimatedBitmapEx : public OverlayObjectWithBasePosition + { + protected: + // the Bitmaps + BitmapEx maBitmapEx1; + BitmapEx maBitmapEx2; + + // position of the basePosition inside the Bitmaps, in pixels + sal_uInt16 mnCenterX1; + sal_uInt16 mnCenterY1; + sal_uInt16 mnCenterX2; + sal_uInt16 mnCenterY2; + + // #i53216# added CursorBlinkTime (in ms) + sal_uInt32 mnBlinkTime; + + // bitfield + // Flag to remember which state to draw. Inited with sal_False (0) + unsigned mbOverlayState : 1; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + // #i53216# check blink time value range (currently 25 < mnBlinkTime < 10000) + void impCheckBlinkTimeValueRange(); + + public: + OverlayAnimatedBitmapEx( + const basegfx::B2DPoint& rBasePos, + const BitmapEx& rBitmapEx1, + const BitmapEx& rBitmapEx2, + sal_uInt32 nBlinkTime = 500, + sal_uInt16 nCenX1 = 0, + sal_uInt16 nCenY1 = 0, + sal_uInt16 nCenX2 = 0, + sal_uInt16 nCenY2 = 0); + virtual ~OverlayAnimatedBitmapEx(); + + const BitmapEx& getBitmapEx1() const { return maBitmapEx1; } + const BitmapEx& getBitmapEx2() const { return maBitmapEx2; } + void setBitmapEx1(const BitmapEx& rNew); + void setBitmapEx2(const BitmapEx& rNew); + + sal_uInt16 getCenterX1() const { return mnCenterX1; } + sal_uInt16 getCenterY1() const { return mnCenterY1; } + sal_uInt16 getCenterX2() const { return mnCenterX2; } + sal_uInt16 getCenterY2() const { return mnCenterY2; } + void setCenterXY1(sal_uInt16 nNewX, sal_uInt16 nNewY); + void setCenterXY2(sal_uInt16 nNewX, sal_uInt16 nNewY); + + // #i53216# added CursorBlinkTime (in ms) + sal_uInt32 getBlinkTime() const { return mnBlinkTime; } + void setBlinkTime(sal_uInt32 nNew); + + // execute event from base class ::sdr::animation::Event. Default + // implementation does nothing and does not create a new event. + virtual void Trigger(sal_uInt32 nTime); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx b/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx new file mode 100644 index 000000000000..1fbf0b6add3d --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlaybitmapex.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYBITMAPEX_HXX +#define _SDR_OVERLAY_OVERLAYBITMAPEX_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/bitmapex.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayBitmapEx : public OverlayObjectWithBasePosition + { + protected: + // the Bitmap itself + BitmapEx maBitmapEx; + + // position of the basePosition inside the Bitmap, in pixels + sal_uInt16 mnCenterX; + sal_uInt16 mnCenterY; + + // optional transparency + double mfAlpha; + + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayBitmapEx( + const basegfx::B2DPoint& rBasePos, + const BitmapEx& rBitmapEx, + sal_uInt16 nCenX = 0, sal_uInt16 nCenY = 0, double fAlpha = 0.0 ); + virtual ~OverlayBitmapEx(); + + const BitmapEx& getBitmapEx() const { return maBitmapEx; } + void setBitmapEx(const BitmapEx& rNew); + + sal_uInt16 getCenterX() const { return mnCenterX; } + sal_uInt16 getCenterY() const { return mnCenterY; } + void setCenterXY(sal_uInt16 nNewX, sal_uInt16 nNewY); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYBITMAPEX_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx b/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx new file mode 100644 index 000000000000..13e45fa47baf --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlaycrosshair.hxx @@ -0,0 +1,59 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYCROSSHAIR_HXX +#define _SDR_OVERLAY_OVERLAYCROSSHAIR_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayCrosshairStriped : public OverlayObjectWithBasePosition + { + protected: + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayCrosshairStriped(const basegfx::B2DPoint& rBasePos); + virtual ~OverlayCrosshairStriped(); + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYCROSSHAIR_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx b/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx new file mode 100644 index 000000000000..ce17ef86d881 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayhatchrect.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYHATCHRECT_HXX +#define _SDR_OVERLAY_OVERLAYHATCHRECT_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/hatch.hxx> +#include <tools/gen.hxx> + +////////////////////////////////////////////////////////////////////////////// + +class PolyPolygon; + +namespace sdr +{ + namespace overlay + { + class OverlayHatchRect : public OverlayObjectWithBasePosition + { + // geometric definitions + basegfx::B2DPoint maSecondPosition; + const double mfDiscreteGrow; + const double mfDiscreteShrink; + const double mfHatchRotation; + const double mfRotation; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayHatchRect( + const basegfx::B2DPoint& rBasePosition, + const basegfx::B2DPoint& rSecondPosition, + const Color& rHatchColor, + double fDiscreteGrow, + double fDiscreteShrink, + double fHatchRotation, + double fRotation); + + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + void setSecondPosition(const basegfx::B2DPoint&); + + // data read access + double getDiscreteGrow() const { return mfDiscreteGrow; } + double getDiscreteShrink() const { return mfDiscreteShrink; } + double getHatchRotation() const { return mfHatchRotation; } + double getRotation() const { return mfRotation; } + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYHATCHRECT_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlayhelpline.hxx b/svx/inc/svx/sdr/overlay/overlayhelpline.hxx new file mode 100644 index 000000000000..c8f26639f032 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayhelpline.hxx @@ -0,0 +1,68 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYHELPLINE_HXX +#define _SDR_OVERLAY_OVERLAYHELPLINE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <svx/svdhlpln.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayHelplineStriped : public OverlayObjectWithBasePosition + { + protected: + // remember HelpLineKind + SdrHelpLineKind meKind; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayHelplineStriped( + const basegfx::B2DPoint& rBasePos, + SdrHelpLineKind eNewKind = SDRHELPLINE_POINT); + virtual ~OverlayHelplineStriped(); + + // dat read access + SdrHelpLineKind getKind() const { return meKind; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYHELPLINE_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlayline.hxx b/svx/inc/svx/sdr/overlay/overlayline.hxx new file mode 100644 index 000000000000..3df8dc0f4f05 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayline.hxx @@ -0,0 +1,68 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYLINE_HXX +#define _SDR_OVERLAY_OVERLAYLINE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayLineStriped : public OverlayObjectWithBasePosition + { + protected: + // second position in pixel + basegfx::B2DPoint maSecondPosition; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayLineStriped( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos); + virtual ~OverlayLineStriped(); + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + void setSecondPosition(const basegfx::B2DPoint& rNew); + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYLINE_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaymanager.hxx b/svx/inc/svx/sdr/overlay/overlaymanager.hxx new file mode 100644 index 000000000000..379086211cbf --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlaymanager.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYMANAGER_HXX +#define _SDR_OVERLAY_OVERLAYMANAGER_HXX + +#include <svx/sdr/animation/scheduler.hxx> +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/mapmod.hxx> +#include <tools/color.hxx> +#include "svx/svxdllapi.h" +#include <svtools/optionsdrawinglayer.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <drawinglayer/geometry/viewinformation2d.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class OutputDevice; +class Region; + +namespace sdr { namespace overlay { + class OverlayObject; +}} + +namespace basegfx { + class B2DRange; +} + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayManager : public ::sdr::animation::Scheduler + { + protected: + // the OutputDevice to work on, set on construction and not to be changed + OutputDevice& rmOutputDevice; + + // the vector of registered OverlayObjects + OverlayObjectVector maOverlayObjects; + + // Stripe support. All striped OverlayObjects use these stripe + // values. Changes change all those objects. + Color maStripeColorA; // defaults to Color(COL_BLACK) + Color maStripeColorB; // defaults to Color(COL_WHITE) + sal_uInt32 mnStripeLengthPixel; // defaults to 4L + + // hold an incarnation of Drawinglayer configuration options + SvtOptionsDrawinglayer maDrawinglayerOpt; + + // hold buffered the logic length of discrete vector (1.0, 0.0) and the + // view transformation belonging to it. Update happens in getDiscreteOne() + basegfx::B2DHomMatrix maViewTransformation; + drawinglayer::geometry::ViewInformation2D maViewInformation2D; + double mfDiscreteOne; + + // internal + void ImpDrawMembers(const basegfx::B2DRange& rRange, OutputDevice& rDestinationDevice) const; + void ImpStripeDefinitionChanged(); + void impApplyRemoveActions(OverlayObject& rTarget); + void impApplyAddActions(OverlayObject& rTarget); + + // return mfDiscreteOne to derivations, but also check for buffered local + // ViewTransformation and evtl. correct mfDiscreteOne + double getDiscreteOne() const; + + public: + // when handing over another OverlayManager at construction, the OverlayObjects + // will be taken over from it. The new one will have added all OverlayObjects + // while the handed over one will have none + OverlayManager( + OutputDevice& rOutputDevice, + OverlayManager* pOldOverlayManager = 0); + virtual ~OverlayManager(); + + // access to current ViewInformation2D; this call checks and evtl. updates ViewInformation2D + const drawinglayer::geometry::ViewInformation2D getCurrentViewInformation2D() const; + + // complete redraw + virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0) const; + + // flush. Do buffered updates. + virtual void flush(); + + // #i68597# part of content gets copied, react on it + virtual void copyArea(const Point& rDestPt, const Point& rSrcPt, const Size& rSrcSize); + + // restore part of background. Implemented form buffered versions only. + virtual void restoreBackground(const Region& rRegion) const; + + // get the OutputDevice + OutputDevice& getOutputDevice() const { return rmOutputDevice; } + + // add and remove OverlayObjects + void add(OverlayObject& rOverlayObject); + void remove(OverlayObject& rOverlayObject); + + // invalidate the given range at local OutputDevice + virtual void invalidateRange(const basegfx::B2DRange& rRange); + + // stripe support ColA + Color getStripeColorA() const { return maStripeColorA; } + void setStripeColorA(Color aNew= Color(COL_BLACK)); + + // stripe support ColB + Color getStripeColorB() const { return maStripeColorB; } + void setStripeColorB(Color aNew = Color(COL_WHITE)); + + // stripe support StripeLengthPixel + sal_uInt32 getStripeLengthPixel() const { return mnStripeLengthPixel; } + void setStripeLengthPixel(sal_uInt32 nNew = 5L); + + // access to maDrawinglayerOpt + const SvtOptionsDrawinglayer& getDrawinglayerOpt() const { return maDrawinglayerOpt; } + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYMANAGER_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx new file mode 100644 index 000000000000..fb21fa328232 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlaymanagerbuffered.hxx @@ -0,0 +1,113 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX +#define _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX + +#include <svx/sdr/overlay/overlaymanager.hxx> +#include <basegfx/range/b2irange.hxx> +#include <vcl/virdev.hxx> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class VirtualDevice; + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayManagerBuffered : public OverlayManager + { + protected: + // The VirtualDevice for draw window content buffering, this + // is the view content without overlay + VirtualDevice maBufferDevice; + + // #i73602# The VirtualDevice for OverlayPaint buffering. This + // is an extra device to avoid flickering of overlay paints + VirtualDevice maOutputBufferDevice; + + // Timer for buffering + Timer maBufferTimer; + + // Range for buffering (in pixel to be independent from mapMode) + basegfx::B2IRange maBufferRememberedRangePixel; + + // bitfield + // Flag to decide if PreRendering shall be used for overlay refreshes. + // Default is false. + unsigned mbRefreshWithPreRendering : 1; + + // link for timer + DECL_LINK(ImpBufferTimerHandler, AutoTimer*); + + // Internal methods for buffering + void ImpPrepareBufferDevice(); + void ImpRestoreBackground() const ; + void ImpRestoreBackground(const Region& rRegionPixel) const; + void ImpSaveBackground(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L); + + public: + // when handing over another OverlayManager at construction, the OverlayObjects + // will be taken over from it. The new one will have added all OverlayObjects + // while the handed over one will have none + OverlayManagerBuffered( + OutputDevice& rOutputDevice, + OverlayManager* pOldOverlayManager = 0, + bool bRefreshWithPreRendering = false); + virtual ~OverlayManagerBuffered(); + + // complete redraw + virtual void completeRedraw(const Region& rRegion, OutputDevice* pPreRenderDevice = 0L) const; + + // flush. Do buffered updates. + virtual void flush(); + + // #i68597# part of content gets copied, react on it + virtual void copyArea(const Point& rDestPt, const Point& rSrcPt, const Size& rSrcSize); + + // restore part of background. Implemented form buffered versions only. + virtual void restoreBackground(const Region& rRegion) const; + + // invalidate the given range at local OutputDevice + virtual void invalidateRange(const basegfx::B2DRange& rRange); + + // access to RefreshWithPreRendering Flag + bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering; } + void SetRefreshWithPreRendering(bool bNew); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlayobject.hxx b/svx/inc/svx/sdr/overlay/overlayobject.hxx new file mode 100644 index 000000000000..0200e859d370 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayobject.hxx @@ -0,0 +1,203 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYOBJECT_HXX +#define _SDR_OVERLAY_OVERLAYOBJECT_HXX + +#include <basegfx/point/b2dpoint.hxx> +#include <basegfx/range/b2drange.hxx> +#include <tools/color.hxx> +#include <svx/sdr/animation/scheduler.hxx> +#include "svx/svxdllapi.h" +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> + +#include <vector> + +////////////////////////////////////////////////////////////////////////////// +// predeclarations + +class OutputDevice; + +namespace sdr +{ + namespace overlay + { + class OverlayManager; + } // end of namespace overlay +} // end of namespace sdr + +namespace basegfx +{ + class B2DPolygon; + class B2DPolyPolygon; + class B2DRange; +} // end of namespace basegfx + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayObject : private ::boost::noncopyable, public ::sdr::animation::Event + { + private: + // Manager is allowed access to private Member mpOverlayManager + friend class OverlayManager; + + // pointer to OverlayManager, if object is added. Changed by + // OverlayManager, do not chnge Yourself. + OverlayManager* mpOverlayManager; + + // Primitive2DSequence of the OverlayObject + drawinglayer::primitive2d::Primitive2DSequence maPrimitive2DSequence; + + protected: + // access methods to maPrimitive2DSequence. The usage of this methods may allow + // later thread-safe stuff to be added if needed. Only to be used by getPrimitive2DSequence() + // implementations for buffering the last decomposition. + const drawinglayer::primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; } + void setPrimitive2DSequence(const drawinglayer::primitive2d::Primitive2DSequence& rNew) { maPrimitive2DSequence = rNew; } + + // the creation method for Primitive2DSequence. Called when getPrimitive2DSequence() + // sees that maPrimitive2DSequence is empty. Needs to be supported by all + // OverlayObject implementations. Default implementation will assert + // a missing implementation + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + // region in logical coordinates + basegfx::B2DRange maBaseRange; + + // base color of this OverlayObject + Color maBaseColor; + + // bitfield + // Flag for visibility + unsigned mbIsVisible : 1; + + // Flag to control hittability + unsigned mbIsHittable : 1; + + // Flag to hold info if this objects supports animation. Default is + // false. If true, the Trigger() method should be overloaded + // to implement the animation effect and to re-initiate the event. + unsigned mbAllowsAnimation : 1; + + // Flag tocontrol if this OverlayObject allows AntiAliased visualisation. + // Default is true, but e.g. for selection visualisation in SC and SW, + // it is switched to false + unsigned mbAllowsAntiAliase : 1; + + // set changed flag. Call after change, since the old range is invalidated + // and then the new one is calculated and invalidated, too. This will only + // work after the change. + virtual void objectChange(); + + // write access to AntiAliase flag. This is protected since + // only implementations are allowed to change this, preferrably in their + // constructor + void allowAntiAliase(bool bNew); + + public: + OverlayObject(Color aBaseColor); + virtual ~OverlayObject(); + + // get OverlayManager + OverlayManager* getOverlayManager() const { return mpOverlayManager; } + + // the access method for Primitive2DSequence. Will use createPrimitive2DSequence and + // setPrimitive2DSequence if needed. Overloading may be used to allow disposal of last + // created primitives to react on changed circumstances and to re-create primitives + virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const; + + // access to visibility state + bool isVisible() const { return mbIsVisible; } + void setVisible(bool bNew); + + // access to hittable flag + bool isHittable() const { return mbIsHittable; } + void setHittable(bool bNew); + + // read access to AntiAliase flag + bool allowsAntiAliase() const { return mbAllowsAntiAliase; } + + // read access to baseRange. This may trigger createBaseRange() if + // object is changed. + const basegfx::B2DRange& getBaseRange() const; + + // access to baseColor + Color getBaseColor() const { return maBaseColor; } + void setBaseColor(Color aNew); + + // execute event from base class ::sdr::animation::Event. Default + // implementation does nothing and does not create a new event. + virtual void Trigger(sal_uInt32 nTime); + + // acces to AllowsAnimation flag + bool allowsAnimation() const { return mbAllowsAnimation; } + + // stripe definition has changed. The OverlayManager does have + // support data to draw graphics in two colors striped. This + // method notifies the OverlayObject if that change takes place. + // Default implementation does nothing. + virtual void stripeDefinitionHasChanged(); + }; + + // typedefs for a vector of OverlayObjects + typedef ::std::vector< OverlayObject* > OverlayObjectVector; + + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayObjectWithBasePosition : public OverlayObject + { + protected: + // base position in logical coordinates + basegfx::B2DPoint maBasePosition; + + public: + OverlayObjectWithBasePosition(const basegfx::B2DPoint& rBasePos, Color aBaseColor); + virtual ~OverlayObjectWithBasePosition(); + + // access to basePosition + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + void setBasePosition(const basegfx::B2DPoint& rNew); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYOBJECT_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx b/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx new file mode 100644 index 000000000000..5d43983a57b0 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayobjectcell.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYOBJECTCELL_HXX +#define _SDR_OVERLAY_OVERLAYOBJECTCELL_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +#include <vector> + +////////////////////////////////////////////////////////////////////////////// + +// #114409# +namespace sdr +{ + namespace overlay + { + enum CellOverlayType { CELL_OVERLAY_INVERT, CELL_OVERLAY_TRANSPARENT }; + + // OverlayObjectCell - used for cell cursor, selection and AutoFill handle + + class SVX_DLLPUBLIC OverlayObjectCell : public OverlayObject + { + public: + typedef ::std::vector< basegfx::B2DRange > RangeVector; + + private: + CellOverlayType mePaintType; + RangeVector maRectangles; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayObjectCell( CellOverlayType eType, const Color& rColor, const RangeVector& rRects); + virtual ~OverlayObjectCell(); + }; + + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYLINE_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx b/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx new file mode 100644 index 000000000000..181ccdfb7831 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayobjectlist.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYOBJECTLIST_HXX +#define _SDR_OVERLAY_OVERLAYOBJECTLIST_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <tools/gen.hxx> +#include "svx/svxdllapi.h" + +////////////////////////////////////////////////////////////////////////////// + +#define DEFAULT_VALUE_FOR_HITTEST_PIXEL (2L) + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayObjectList + { + protected: + // the vector of OverlayObjects + OverlayObjectVector maVector; + + // default value for HiTestPixel + sal_uInt32 getDefaultValueForHitTestPixel() const { return 4L; } + + public: + OverlayObjectList() {} + ~OverlayObjectList(); + + // clear list, this includes deletion of all contained objects + void clear(); + + // append/remove objects + void append(OverlayObject& rOverlayObject) { maVector.push_back(&rOverlayObject); } + void remove(OverlayObject& rOverlayObject); + + // access to objects + sal_uInt32 count() const { return maVector.size(); } + OverlayObject& getOverlayObject(sal_uInt32 nIndex) const { return *(maVector[nIndex]); } + + // Hittest with logical coordinates + bool isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance = 0.0) const; + + // Hittest with pixel coordinates and pixel tolerance + bool isHitPixel(const Point& rDiscretePosition, sal_uInt32 fDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL) const; + + // calculate BaseRange of all included OverlayObjects and return + basegfx::B2DRange getBaseRange() const; + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYOBJECTLIST_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx b/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx new file mode 100644 index 000000000000..7107a92c286c --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlaypolypolygon.hxx @@ -0,0 +1,67 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX +#define _SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayPolyPolygonStriped : public OverlayObject + { + protected: + // geometry + basegfx::B2DPolyPolygon maPolyPolygon; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayPolyPolygonStriped(const basegfx::B2DPolyPolygon& rPolyPolygon); + virtual ~OverlayPolyPolygonStriped(); + + // change geometry + basegfx::B2DPolyPolygon getPolyPolygon() const { return maPolyPolygon; } + void setPolyPolygon(const basegfx::B2DPolyPolygon& rNew); + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx b/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx new file mode 100644 index 000000000000..049dfefe585d --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX +#define _SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class SVX_DLLPUBLIC OverlayPrimitive2DSequenceObject : public OverlayObjectWithBasePosition + { + protected: + // the sequence of primitives to show + const drawinglayer::primitive2d::Primitive2DSequence maSequence; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + private: + // internal helper to create a drawinglayer::geometry::ViewInformation2D + // using a OutputDevice and local knowledge + drawinglayer::geometry::ViewInformation2D impCreateViewInformation2D(OutputDevice& rOutputDevice) const; + + public: + OverlayPrimitive2DSequenceObject(const drawinglayer::primitive2d::Primitive2DSequence& rSequence); + + virtual ~OverlayPrimitive2DSequenceObject(); + + // data read access + const drawinglayer::primitive2d::Primitive2DSequence& getSequence() const { return maSequence; } + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx b/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx new file mode 100644 index 000000000000..0dec8ac62fd9 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayrollingrectangle.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYROOLINGRECTANGLE_HXX +#define _SDR_OVERLAY_OVERLAYROOLINGRECTANGLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayRollingRectangleStriped : public OverlayObjectWithBasePosition + { + protected: + // second position in pixel + basegfx::B2DPoint maSecondPosition; + + // bitfield + // Flag to switch on/off long lines to the OutputDevice bounds + unsigned mbExtendedLines : 1; + + // Flag to switch on/off the bounds itself + unsigned mbShowBounds : 1; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayRollingRectangleStriped( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos, + bool bExtendedLines = false, + bool bShowBounds = true); + virtual ~OverlayRollingRectangleStriped(); + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + void setSecondPosition(const basegfx::B2DPoint& rNew); + + // change extended lines + bool getExtendedLines() const { return mbExtendedLines; } + void setExtendedLines(bool bNew); + + // change show bounds + bool getShowBounds() const { return mbShowBounds; } + void setShowBounds(bool bNew); + + // react on stripe definition change + virtual void stripeDefinitionHasChanged(); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYROOLINGRECTANGLE_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlayselection.hxx b/svx/inc/svx/sdr/overlay/overlayselection.hxx new file mode 100644 index 000000000000..4372929d4317 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlayselection.hxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYSELECTION_HXX +#define _SDR_OVERLAY_OVERLAYSELECTION_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <vcl/region.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + // overlay type definition + enum OverlayType + { + OVERLAY_INVERT, + OVERLAY_SOLID, + OVERLAY_TRANSPARENT + }; + + class SVX_DLLPUBLIC OverlaySelection : public OverlayObject + { + protected: + // type of overlay + OverlayType meOverlayType; + + // geometry of overlay + std::vector< basegfx::B2DRange > maRanges; + + // Values of last primitive creation. These are checked in getOverlayObjectPrimitive2DSequence + // to evtl. get rid of last Primitive2DSequence. This ensures that these values are up-to-date + // and are usable when creating primitives + OverlayType maLastOverlayType; + sal_uInt16 mnLastTransparence; + + // bitfield + unsigned mbBorder : 1; + + // geometry creation for OverlayObject, can use local *Last* values + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlaySelection( + OverlayType eType, + const Color& rColor, + const std::vector< basegfx::B2DRange >& rRanges, + bool bBorder); + virtual ~OverlaySelection(); + + // data read access + OverlayType getOverlayType() const { return meOverlayType; } + const std::vector< basegfx::B2DRange >& getRanges() const { return maRanges; } + bool getBorder() const { return mbBorder; } + + // overloaded to check conditions for last createOverlayObjectPrimitive2DSequence + virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const; + + // data write access + void setRanges(const std::vector< basegfx::B2DRange >& rNew); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYSELECTION_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaytools.hxx b/svx/inc/svx/sdr/overlay/overlaytools.hxx new file mode 100644 index 000000000000..4142e326a910 --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlaytools.hxx @@ -0,0 +1,278 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYTOOLS_HXX +#define _SDR_OVERLAY_OVERLAYTOOLS_HXX + +#include <drawinglayer/primitive2d/primitivetools2d.hxx> +#include <vcl/bitmapex.hxx> + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class which holds a BotmapEx which is to be visualized +// at the given logic position with the Bitmap's pixel size, unscaled and +// unrotated (like a marker). The discrete pixel on the bitmap assocciated +// with the target position is given in discrete X,Y coordinates +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayBitmapExPrimitive : public DiscreteMetricDependentPrimitive2D + { + private: + // The BitmapEx to use, PixelSize is used + BitmapEx maBitmapEx; + + // The logic position + basegfx::B2DPoint maBasePosition; + + // The pixel inside the BitmapEx which is assocciated with + // the target position (offset in the bitmap) + sal_uInt16 mnCenterX; + sal_uInt16 mnCenterY; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayBitmapExPrimitive( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rBasePosition, + sal_uInt16 nCenterX, + sal_uInt16 nCenterY); + + // data access + const BitmapEx& getBitmapEx() const { return maBitmapEx; } + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + sal_uInt16 getCenterX() const { return mnCenterX; } + sal_uInt16 getCenterY() const { return mnCenterY; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for a crosshair +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayCrosshairPrimitive : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // The stripe colors and legth + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayCrosshairPrimitive( + const basegfx::B2DPoint& rBasePosition, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength); + + // data access + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDiscreteDashLength() const { return mfDiscreteDashLength; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for a hatch rectangle as used e.g. for text object +// selection hilighting +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayHatchRectanglePrimitive : public DiscreteMetricDependentPrimitive2D + { + private: + // the logic rectangle definition + basegfx::B2DRange maObjectRange; + + // the hatch definition + double mfDiscreteHatchDistance; + double mfHatchRotation; + basegfx::BColor maHatchColor; + + // the dscrete grow and shrink of the box + double mfDiscreteGrow; + double mfDiscreteShrink; + + // the rotation of the primitive itself + double mfRotation; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayHatchRectanglePrimitive( + const basegfx::B2DRange& rObjectRange, + double fDiscreteHatchDistance, + double fHatchRotation, + const basegfx::BColor& rHatchColor, + double fDiscreteGrow, + double fDiscreteShrink, + double fRotation); + + // data access + const basegfx::B2DRange& getObjectRange() const { return maObjectRange; } + double getDiscreteHatchDistance() const { return mfDiscreteHatchDistance; } + double getHatchRotation() const { return mfHatchRotation; } + const basegfx::BColor& getHatchColor() const { return maHatchColor; } + double getDiscreteGrow() const { return mfDiscreteGrow; } + double getDiscreteShrink() const { return mfDiscreteShrink; } + double getRotation() const { return mfRotation; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for a striped helpline + +namespace drawinglayer +{ + namespace primitive2d + { + enum HelplineStyle + { + HELPLINESTYLE_POINT, + HELPLINESTYLE_VERTICAL, + HELPLINESTYLE_HORIZONTAL + }; + + class OverlayHelplineStripedPrimitive : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // the style + HelplineStyle meStyle; + + // The stripe colors and legth + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayHelplineStripedPrimitive( + const basegfx::B2DPoint& rBasePosition, + HelplineStyle eStyle, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength); + + // data access + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + HelplineStyle getStyle() const { return meStyle; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDiscreteDashLength() const { return mfDiscreteDashLength; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// Overlay helper class for rolling rectangle helplines. This primitive is +// only for the extended lines to the ends of the view + +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayRollingRectanglePrimitive : public ViewportDependentPrimitive2D + { + private: + // The logic range + basegfx::B2DRange maRollingRectangle; + + // The stripe colors and legth + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + OverlayRollingRectanglePrimitive( + const basegfx::B2DRange& aRollingRectangle, + const basegfx::BColor& rRGBColorA, + const basegfx::BColor& rRGBColorB, + double fDiscreteDashLength); + + // data access + const basegfx::B2DRange& getRollingRectangle() const { return maRollingRectangle; } + const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } + const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } + double getDiscreteDashLength() const { return mfDiscreteDashLength; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; + + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYTOOLS_HXX + +// eof diff --git a/svx/inc/svx/sdr/overlay/overlaytriangle.hxx b/svx/inc/svx/sdr/overlay/overlaytriangle.hxx new file mode 100644 index 000000000000..5479f65984ea --- /dev/null +++ b/svx/inc/svx/sdr/overlay/overlaytriangle.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * 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 _SDR_OVERLAY_OVERLAYTRIANGLE_HXX +#define _SDR_OVERLAY_OVERLAYTRIANGLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +////////////////////////////////////////////////////////////////////////////// + +namespace sdr +{ + namespace overlay + { + class OverlayTriangle : public OverlayObjectWithBasePosition + { + protected: + // second and third position in pixel + basegfx::B2DPoint maSecondPosition; + basegfx::B2DPoint maThirdPosition; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + + public: + OverlayTriangle( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos, + const basegfx::B2DPoint& rThirdPos, + Color aTriangleColor); + virtual ~OverlayTriangle(); + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + void setSecondPosition(const basegfx::B2DPoint& rNew); + + // change third position + const basegfx::B2DPoint& getThirdPosition() const { return maThirdPosition; } + void setThirdPosition(const basegfx::B2DPoint& rNew); + }; + } // end of namespace overlay +} // end of namespace sdr + +////////////////////////////////////////////////////////////////////////////// + +#endif //_SDR_OVERLAY_OVERLAYTRIANGLE_HXX + +// eof |