diff options
Diffstat (limited to 'include/drawinglayer')
-rw-r--r-- | include/drawinglayer/primitive2d/BufferedDecompositionGroupPrimitive2D.hxx | 24 | ||||
-rw-r--r-- | include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx | 27 |
2 files changed, 34 insertions, 17 deletions
diff --git a/include/drawinglayer/primitive2d/BufferedDecompositionGroupPrimitive2D.hxx b/include/drawinglayer/primitive2d/BufferedDecompositionGroupPrimitive2D.hxx index a1cfee38798f..c3bc54e5fca3 100644 --- a/include/drawinglayer/primitive2d/BufferedDecompositionGroupPrimitive2D.hxx +++ b/include/drawinglayer/primitive2d/BufferedDecompositionGroupPrimitive2D.hxx @@ -21,6 +21,7 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#include <salhelper/timer.hxx> namespace drawinglayer::primitive2d { @@ -35,25 +36,32 @@ namespace drawinglayer::primitive2d class DRAWINGLAYER_DLLPUBLIC BufferedDecompositionGroupPrimitive2D : public GroupPrimitive2D { private: + // exclusive helper for Primitive2DFlusher + friend void flushBufferedDecomposition(BufferedDecompositionGroupPrimitive2D&); + /// a sequence used for buffering the last create2DDecomposition() result Primitive2DContainer maBuffered2DDecomposition; + /// offer callback mechanism to flush buffered content timer-based + ::rtl::Reference<::salhelper::Timer> maCallbackTimer; + sal_uInt16 maCallbackSeconds; + protected: /// identical to BufferedDecompositionPrimitive2D, see there please - const Primitive2DContainer& getBuffered2DDecomposition() const - { - return maBuffered2DDecomposition; - } - void setBuffered2DDecomposition(Primitive2DContainer&& rNew) - { - maBuffered2DDecomposition = std::move(rNew); - } + const Primitive2DContainer& getBuffered2DDecomposition() const; + void setBuffered2DDecomposition(Primitive2DContainer&& rNew); /// method which is to be used to implement the local decomposition of a 2D group primitive. virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const = 0; + // when changing from null (which is inactive) to a count of seconds, the + // callback mechanism to flush buffered content timer-based will be activated. + // it is protected since the idea is that this gets called in the constructor + // of derived classes. + void setCallbackSeconds(sal_uInt16 nNew) { maCallbackSeconds = nNew; } + public: /// constructor/destructor. For GroupPrimitive2D we need the child parameter, too. BufferedDecompositionGroupPrimitive2D(Primitive2DContainer&& aChildren); diff --git a/include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx b/include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx index 8087a6544dc0..68d40e006a6f 100644 --- a/include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx +++ b/include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx @@ -22,6 +22,7 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/primitive2d/Primitive2DContainer.hxx> #include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <salhelper/timer.hxx> namespace drawinglayer::geometry { @@ -62,35 +63,43 @@ namespace drawinglayer::primitive2d class DRAWINGLAYERCORE_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D { private: + // exclusive helper for Primitive2DFlusher + friend void flushBufferedDecomposition(BufferedDecompositionPrimitive2D&); + /// a sequence used for buffering the last create2DDecomposition() result Primitive2DContainer maBuffered2DDecomposition; + /// offer callback mechanism to flush buffered content timer-based + ::rtl::Reference<::salhelper::Timer> maCallbackTimer; + sal_uInt16 maCallbackSeconds; + /// When a shadow wraps a list of primitives, this primitive wants to influence the transparency /// of the shadow. - sal_uInt16 mnTransparenceForShadow = 0; + sal_uInt16 mnTransparenceForShadow; protected: /** access methods to maBuffered2DDecomposition. The usage of this methods may allow later thread-safe stuff to be added if needed. Only to be used by getDecomposition() implementations for buffering the last decomposition. */ - const Primitive2DContainer& getBuffered2DDecomposition() const - { - return maBuffered2DDecomposition; - } - void setBuffered2DDecomposition(Primitive2DContainer&& rNew) - { - maBuffered2DDecomposition = std::move(rNew); - } + const Primitive2DContainer& getBuffered2DDecomposition() const; + void setBuffered2DDecomposition(Primitive2DContainer&& rNew); /** method which is to be used to implement the local decomposition of a 2D primitive. */ virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const = 0; + // when changing from null (which is inactive) to a count of seconds, the + // callback mechanism to flush buffered content timer-based will be activated. + // it is protected since the idea is that this gets called in the constructor + // of derived classes. + void setCallbackSeconds(sal_uInt16 nNew) { maCallbackSeconds = nNew; } + public: // constructor/destructor BufferedDecompositionPrimitive2D(); + virtual ~BufferedDecompositionPrimitive2D(); /** The getDecomposition default implementation will on demand use create2DDecomposition() if maBuffered2DDecomposition is empty. It will set maBuffered2DDecomposition to this obtained decomposition |