diff options
Diffstat (limited to 'svx/inc/sdr/overlay')
-rw-r--r-- | svx/inc/sdr/overlay/overlaycrosshair.hxx | 48 | ||||
-rw-r--r-- | svx/inc/sdr/overlay/overlayhandle.hxx | 41 | ||||
-rw-r--r-- | svx/inc/sdr/overlay/overlayhelpline.hxx | 57 | ||||
-rw-r--r-- | svx/inc/sdr/overlay/overlayline.hxx | 56 | ||||
-rw-r--r-- | svx/inc/sdr/overlay/overlaymanagerbuffered.hxx | 79 | ||||
-rw-r--r-- | svx/inc/sdr/overlay/overlayobjectcell.hxx | 53 | ||||
-rw-r--r-- | svx/inc/sdr/overlay/overlayrectangle.hxx | 68 | ||||
-rw-r--r-- | svx/inc/sdr/overlay/overlayrollingrectangle.hxx | 65 | ||||
-rw-r--r-- | svx/inc/sdr/overlay/overlaytools.hxx | 304 | ||||
-rw-r--r-- | svx/inc/sdr/overlay/overlaytriangle.hxx | 48 |
10 files changed, 819 insertions, 0 deletions
diff --git a/svx/inc/sdr/overlay/overlaycrosshair.hxx b/svx/inc/sdr/overlay/overlaycrosshair.hxx new file mode 100644 index 000000000..e297f4a4f --- /dev/null +++ b/svx/inc/sdr/overlay/overlaycrosshair.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYCROSSHAIR_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYCROSSHAIR_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayCrosshairStriped final : public OverlayObjectWithBasePosition + { + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + explicit OverlayCrosshairStriped(const basegfx::B2DPoint& rBasePos); + virtual ~OverlayCrosshairStriped() override; + + // react on stripe definition change + virtual void stripeDefinitionHasChanged() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYCROSSHAIR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayhandle.hxx b/svx/inc/sdr/overlay/overlayhandle.hxx new file mode 100644 index 000000000..882fb702c --- /dev/null +++ b/svx/inc/sdr/overlay/overlayhandle.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#ifndef INCLUDED_SVX_SDR_OVERLAY_OVERLAYHANDLE_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYHANDLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <basegfx/vector/b2dsize.hxx> + +namespace sdr::overlay { + + +class OverlayHandle final : public OverlayObjectWithBasePosition +{ + basegfx::B2DSize maSize; + Color maStrokeColor; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + +public: + OverlayHandle(const basegfx::B2DPoint& rBasePos, + const basegfx::B2DSize& rSize, + Color const & rStrokeColor, + Color const & rFillColor); + + virtual ~OverlayHandle() override; +}; + +} // end of namespace sdr::overlay + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYHANDLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayhelpline.hxx b/svx/inc/sdr/overlay/overlayhelpline.hxx new file mode 100644 index 000000000..84077f103 --- /dev/null +++ b/svx/inc/sdr/overlay/overlayhelpline.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYHELPLINE_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYHELPLINE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> +#include <svx/svdhlpln.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayHelplineStriped final : public OverlayObjectWithBasePosition + { + // remember HelpLineKind + SdrHelpLineKind meKind; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + explicit OverlayHelplineStriped( + const basegfx::B2DPoint& rBasePos, + SdrHelpLineKind eNewKind); + virtual ~OverlayHelplineStriped() override; + + // dat read access + SdrHelpLineKind getKind() const { return meKind; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYHELPLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayline.hxx b/svx/inc/sdr/overlay/overlayline.hxx new file mode 100644 index 000000000..33ec22c0e --- /dev/null +++ b/svx/inc/sdr/overlay/overlayline.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYLINE_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYLINE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayLineStriped final : public OverlayObjectWithBasePosition + { + // second position in pixel + basegfx::B2DPoint maSecondPosition; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayLineStriped( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos); + virtual ~OverlayLineStriped() override; + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx b/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx new file mode 100644 index 000000000..1970131c7 --- /dev/null +++ b/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX + +#include <svx/sdr/overlay/overlaymanager.hxx> +#include <basegfx/range/b2irange.hxx> +#include <vcl/virdev.hxx> +#include <vcl/idle.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayManagerBuffered final : public OverlayManager + { + // The VirtualDevice for draw window content buffering, this + // is the view content without overlay + ScopedVclPtr<VirtualDevice> mpBufferDevice; + + // #i73602# The VirtualDevice for OverlayPaint buffering. This + // is an extra device to avoid flickering of overlay paints + ScopedVclPtr<VirtualDevice> mpOutputBufferDevice; + + // Idle for buffering + Idle maBufferIdle; + + // Range for buffering (in pixel to be independent from mapMode) + basegfx::B2IRange maBufferRememberedRangePixel; + + // link for timer + DECL_LINK(ImpBufferTimerHandler, Timer*, void); + + // Internal methods for buffering + void ImpPrepareBufferDevice(); + void ImpRestoreBackground() const ; + void ImpRestoreBackground(const vcl::Region& rRegionPixel) const; + void ImpSaveBackground(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice); + + OverlayManagerBuffered(OutputDevice& rOutputDevice); + virtual ~OverlayManagerBuffered() override; + + public: + static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice); + + // complete redraw + virtual void completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice = nullptr) const override; + + // flush. Do buffered updates. + virtual void flush() override; + + // invalidate the given range at local OutputDevice + virtual void invalidateRange(const basegfx::B2DRange& rRange) override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayobjectcell.hxx b/svx/inc/sdr/overlay/overlayobjectcell.hxx new file mode 100644 index 000000000..63669ba06 --- /dev/null +++ b/svx/inc/sdr/overlay/overlayobjectcell.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <svx/sdr/overlay/overlayobject.hxx> + +#include <vector> + + +namespace sdr +{ + namespace overlay + { + // OverlayObjectCell - used for cell cursor, selection and AutoFill handle + + class OverlayObjectCell final : public OverlayObject + { + public: + typedef ::std::vector< basegfx::B2DRange > RangeVector; + + private: + RangeVector maRectangles; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayObjectCell( const Color& rColor, const RangeVector& rRects); + virtual ~OverlayObjectCell() override; + }; + + } // end of namespace overlay +} // end of namespace sdr + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayrectangle.hxx b/svx/inc/sdr/overlay/overlayrectangle.hxx new file mode 100644 index 000000000..7f4dfd895 --- /dev/null +++ b/svx/inc/sdr/overlay/overlayrectangle.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYRECTANGLE_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYRECTANGLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + +namespace tools { class PolyPolygon; } + +namespace sdr +{ + namespace overlay + { + class OverlayRectangle final : public OverlayObjectWithBasePosition + { + // geometric definitions + basegfx::B2DPoint maSecondPosition; + const double mfTransparence; + const double mfDiscreteGrow; + const double mfDiscreteShrink; + const double mfRotation; + + // #i53216# added CursorBlinkTime (in ms) + sal_uInt32 mnBlinkTime; + + // Flag to remember which state to draw. Inited with false (0) + bool mbOverlayState : 1; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayRectangle( + const basegfx::B2DPoint& rBasePosition, + const basegfx::B2DPoint& rSecondPosition, + const Color& rHatchColor, + double fTransparence, + double fDiscreteGrow, + double fDiscreteShrink, + double fRotation, + bool bAnimate); + + // 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) override; + }; + } // end of namespace overlay +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYRECTANGLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlayrollingrectangle.hxx b/svx/inc/sdr/overlay/overlayrollingrectangle.hxx new file mode 100644 index 000000000..7a18f1cb4 --- /dev/null +++ b/svx/inc/sdr/overlay/overlayrollingrectangle.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYROLLINGRECTANGLE_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYROLLINGRECTANGLE_HXX + +#include <svx/sdr/overlay/overlayobject.hxx> + + +namespace sdr +{ + namespace overlay + { + class OverlayRollingRectangleStriped final : public OverlayObjectWithBasePosition + { + // second position in pixel + basegfx::B2DPoint maSecondPosition; + + // Flag to switch on/off long lines to the OutputDevice bounds + bool mbExtendedLines : 1; + + // Flag to switch on/off the bounds itself + bool mbShowBounds : 1; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayRollingRectangleStriped( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos, + bool bExtendedLines, + bool bShowBounds = true); + virtual ~OverlayRollingRectangleStriped() override; + + // change second position + const basegfx::B2DPoint& getSecondPosition() const { return maSecondPosition; } + void setSecondPosition(const basegfx::B2DPoint& rNew); + + // react on stripe definition change + virtual void stripeDefinitionHasChanged() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYROLLINGRECTANGLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlaytools.hxx b/svx/inc/sdr/overlay/overlaytools.hxx new file mode 100644 index 000000000..c5df8fe09 --- /dev/null +++ b/svx/inc/sdr/overlay/overlaytools.hxx @@ -0,0 +1,304 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYTOOLS_HXX +#define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYTOOLS_HXX + +#include <drawinglayer/primitive2d/primitivetools2d.hxx> +#include <vcl/bitmapex.hxx> +#include <basegfx/vector/b2dsize.hxx> + +namespace drawinglayer::primitive2d { + +class OverlayStaticRectanglePrimitive final : public DiscreteMetricDependentPrimitive2D +{ +private: + basegfx::B2DPoint maPosition; + basegfx::B2DSize maSize; + + // the graphic definition + basegfx::BColor maStrokeColor; + basegfx::BColor maFillColor; + double mfTransparence; + + // the rotation of the primitive itself + double mfRotation; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + +public: + OverlayStaticRectanglePrimitive( + const basegfx::B2DPoint& rPosition, + const basegfx::B2DSize& rSize, + const basegfx::BColor& rStrokeColor, + const basegfx::BColor& rFillColor, + double fTransparence, + double fRotation); + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; + + virtual sal_uInt32 getPrimitive2DID() const override; +}; + +} // end of namespace drawinglayer::primitive2d + +// 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 final : 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; + + // evtl. rotation and shear around center + double mfShearX; + double mfRotation; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + public: + OverlayBitmapExPrimitive( + const BitmapEx& rBitmapEx, + const basegfx::B2DPoint& rBasePosition, + sal_uInt16 nCenterX, + sal_uInt16 nCenterY, + double fShearX, + double fRotation); + + // 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; } + double getShearX() const { return mfShearX; } + double getRotation() const { return mfRotation; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +// Overlay helper class for a crosshair +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayCrosshairPrimitive final : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // The stripe colors and length + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + 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 override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +// Overlay helper class for a hatch rectangle as used e.g. for text object +// selection highlighting +namespace drawinglayer +{ + namespace primitive2d + { + class OverlayRectanglePrimitive final : public DiscreteMetricDependentPrimitive2D + { + private: + // the logic rectangle definition + basegfx::B2DRange maObjectRange; + + // the graphic definition + basegfx::BColor maColor; + double mfTransparence; + + // the discrete grow and shrink of the box + double mfDiscreteGrow; + double mfDiscreteShrink; + + // the rotation of the primitive itself + double mfRotation; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + public: + OverlayRectanglePrimitive( + const basegfx::B2DRange& rObjectRange, + const basegfx::BColor& rColor, + double fTransparence, + double fDiscreteGrow, + double fDiscreteShrink, + double fRotation); + + // data access + const basegfx::B2DRange& getObjectRange() const { return maObjectRange; } + const basegfx::BColor& getColor() const { return maColor; } + double getTransparence() const { return mfTransparence; } + double getDiscreteGrow() const { return mfDiscreteGrow; } + double getDiscreteShrink() const { return mfDiscreteShrink; } + double getRotation() const { return mfRotation; } + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // 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 final : public ViewportDependentPrimitive2D + { + private: + // The logic position + basegfx::B2DPoint maBasePosition; + + // the style + HelplineStyle meStyle; + + // The stripe colors and length + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + 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 override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // 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 final : public ViewportDependentPrimitive2D + { + private: + // The logic range + basegfx::B2DRange maRollingRectangle; + + // The stripe colors and length + basegfx::BColor maRGBColorA; + basegfx::BColor maRGBColorB; + double mfDiscreteDashLength; + + virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override; + + 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 override; + + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYTOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlaytriangle.hxx b/svx/inc/sdr/overlay/overlaytriangle.hxx new file mode 100644 index 000000000..76e481e64 --- /dev/null +++ b/svx/inc/sdr/overlay/overlaytriangle.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <svx/sdr/overlay/overlayobject.hxx> + +namespace sdr +{ + namespace overlay + { + class OverlayTriangle final : public OverlayObjectWithBasePosition + { + // second and third position in pixel + basegfx::B2DPoint maSecondPosition; + basegfx::B2DPoint maThirdPosition; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayTriangle( + const basegfx::B2DPoint& rBasePos, + const basegfx::B2DPoint& rSecondPos, + const basegfx::B2DPoint& rThirdPos, + Color aTriangleColor); + virtual ~OverlayTriangle() override; + }; + } // end of namespace overlay +} // end of namespace sdr + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |