diff options
Diffstat (limited to 'sd/source/ui/inc')
-rw-r--r-- | sd/source/ui/inc/SlideSorter.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/SlideshowLayerRenderer.hxx | 86 | ||||
-rw-r--r-- | sd/source/ui/inc/ViewShellManager.hxx | 5 | ||||
-rw-r--r-- | sd/source/ui/inc/annotationmanager.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/inc/optsitem.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/inc/unomodel.hxx | 2 |
6 files changed, 54 insertions, 47 deletions
diff --git a/sd/source/ui/inc/SlideSorter.hxx b/sd/source/ui/inc/SlideSorter.hxx index cbd15bd6ac11..8049be043899 100644 --- a/sd/source/ui/inc/SlideSorter.hxx +++ b/sd/source/ui/inc/SlideSorter.hxx @@ -28,6 +28,8 @@ namespace vcl { class Window; } namespace com::sun::star::frame { class XController; } namespace rtl { template <class reference_type> class Reference; } +#define MAX_PAGES_PER_ROW 15 + namespace sd { class ViewShell; class ViewShellBase; diff --git a/sd/source/ui/inc/SlideshowLayerRenderer.hxx b/sd/source/ui/inc/SlideshowLayerRenderer.hxx index 5cd590e920e7..858ab08178b8 100644 --- a/sd/source/ui/inc/SlideshowLayerRenderer.hxx +++ b/sd/source/ui/inc/SlideshowLayerRenderer.hxx @@ -16,16 +16,24 @@ #include <tools/gen.hxx> #include <tools/helpers.hxx> +#include <CustomAnimationEffect.hxx> + #include <deque> -#include <map> +#include <vector> +#include <optional> +#include <unordered_map> #include <unordered_set> class SdrPage; class SdrModel; class SdrObject; - class Size; +namespace com::sun::star::animations +{ +class XAnimate; +} + namespace sd { struct RenderContext; @@ -39,6 +47,19 @@ enum class RenderStage Count }; +struct AnimationLayerInfo +{ + OString msHash; + std::optional<bool> moInitiallyVisible; +}; + +struct AnimationRenderInfo +{ + std::optional<AnimationLayerInfo> moObjectInfo; + std::vector<sal_Int32> maParagraphs; + std::unordered_map<sal_Int32, AnimationLayerInfo> maParagraphInfos; +}; + /** Holds rendering state, properties and switches through all rendering passes */ struct RenderState { @@ -47,18 +68,21 @@ struct RenderState bool mbStopRenderingWhenField = true; std::unordered_set<SdrObject*> maObjectsDone; - std::unordered_set<SdrObject*> maInAnimation; - std::map<SdrObject*, OString> maAnimationTargetHash; - std::map<SdrObject*, bool> maInitiallyVisible; + + std::unordered_map<SdrObject*, AnimationRenderInfo> maAnimationRenderInfoList; + sal_Int32 mnIndex[static_cast<unsigned>(RenderStage::Count)] = { 0, 0, 0, 0 }; SdrObject* mpCurrentTarget = nullptr; + sal_Int32 mnCurrentTargetParagraph = -1; + + sal_Int32 mnRenderedObjectsInPass = 0; - bool mbFirstObjectInPass = true; - bool mbPassHasOutput = false; bool mbSkipAllInThisPass = false; sal_Int32 mnCurrentPass = 0; + std::deque<sal_Int32> maParagraphsToRender; + /// increments index depending on the current render stage void incrementIndex() { mnIndex[static_cast<unsigned>(meStage)]++; } @@ -80,20 +104,28 @@ struct RenderState /// returns the current target element for which layer is created if any SdrObject* currentTarget() const { return mpCurrentTarget; } + /// returns the current target paragraph index or -1 if paragraph is not relevant + sal_Int32 currentTargetParagraph() const { return mnCurrentTargetParagraph; } + /// resets properties that are valid for one pass void resetPass() { - mbFirstObjectInPass = true; - mbPassHasOutput = false; + mnRenderedObjectsInPass = 0; mbSkipAllInThisPass = false; mpCurrentTarget = nullptr; + mnCurrentTargetParagraph = -1; } + bool hasPassAnyRenderedOutput() const { return mnRenderedObjectsInPass > 0; } + + /// is first rendered object in pass + bool isFirstObjectInPass() const { return mnRenderedObjectsInPass == 0; } + /// return if there was no rendering output in the pass bool noMoreOutput() const { - // no output and we don't skip anything - return !mbPassHasOutput && !mbSkipAllInThisPass; + // no output and we didn't skip anything and nothing was rendered + return !hasPassAnyRenderedOutput() && !mbSkipAllInThisPass; } /// should include background in rendering @@ -103,34 +135,6 @@ struct RenderState { return maObjectsDone.find(pObject) != maObjectsDone.end(); } - - bool isObjectInAnimation(SdrObject* pObject) const - { - return maInAnimation.find(pObject) != maInAnimation.end(); - } - - bool isObjectInitiallyVisible(SdrObject* pObject) const - { - bool bInitiallyVisible = true; - if (maInitiallyVisible.contains(pObject)) - bInitiallyVisible = maInitiallyVisible.at(pObject); - return bInitiallyVisible; - } - - static std::string getObjectHash(SdrObject* pObject) - { - css::uno::Reference<css::drawing::XShape> xShape = GetXShapeForSdrObject(pObject); - if (xShape.is()) - { - css::uno::Reference<css::uno::XInterface> xRef; - css::uno::Any(xShape) >>= xRef; - if (xRef.is()) - return GetInterfaceHash(xRef); - } - - SAL_WARN("sd", "RenderState::getObjectHash: failed"); - return std::string(); - } }; /** Renders a slide */ @@ -144,7 +148,9 @@ private: void createViewAndDraw(RenderContext& rRenderContext); void writeJSON(OString& rJsonMsg); + void setupAnimations(); + void resolveEffect(CustomAnimationEffectPtr const& rEffect); public: SlideshowLayerRenderer(SdrPage& rPage); @@ -164,7 +170,7 @@ public: * The properties of the layer are written to the input string in JSON format. * * @returns false, if nothing was rendered and rendering is done */ - bool render(unsigned char* pBuffer, OString& rJsonMsg); + bool render(unsigned char* pBuffer, double& scale, OString& rJsonMsg); }; } // end of namespace sd diff --git a/sd/source/ui/inc/ViewShellManager.hxx b/sd/source/ui/inc/ViewShellManager.hxx index 929877ad1484..68672781761b 100644 --- a/sd/source/ui/inc/ViewShellManager.hxx +++ b/sd/source/ui/inc/ViewShellManager.hxx @@ -83,11 +83,6 @@ public: void SetOverridingMainShell(const std::shared_ptr<ViewShell>& pViewShell); std::shared_ptr<ViewShell> GetOverridingMainShell(); - /** Activate the given shell which is not a view shell. For view shells - use the ActivateViewShell() method. - */ - void ActivateShell(SfxShell* pShell); - /** Activate the given shell, putting it at the bottom of the stack instead of the top. */ diff --git a/sd/source/ui/inc/annotationmanager.hxx b/sd/source/ui/inc/annotationmanager.hxx index 25bf5503384e..b9af2ecca1b3 100644 --- a/sd/source/ui/inc/annotationmanager.hxx +++ b/sd/source/ui/inc/annotationmanager.hxx @@ -42,7 +42,8 @@ public: void ExecuteAnnotation(SfxRequest const& rRequest); void GetAnnotationState(SfxItemSet& rItemSet); - void SelectAnnotation(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation); + void SelectAnnotation(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation, + bool bEdit = false); private: ::rtl::Reference<AnnotationManagerImpl> mxImpl; diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx index 65bca1991090..21ad5153b528 100644 --- a/sd/source/ui/inc/optsitem.hxx +++ b/sd/source/ui/inc/optsitem.hxx @@ -240,6 +240,7 @@ class SD_DLLPUBLIC SdOptionsMiscItem final : public SfxPoolItem { public: + DECLARE_ITEM_TYPE_FUNCTION(SdOptionsMiscItem) explicit SdOptionsMiscItem(); SdOptionsMiscItem( SdOptions const * pOpts, ::sd::FrameView const * pView ); @@ -292,6 +293,7 @@ class SdOptionsGridItem final : public SvxGridItem { public: + DECLARE_ITEM_TYPE_FUNCTION(SdOptionsGridItem) explicit SdOptionsGridItem( SdOptions const * pOpts ); void SetOptions( SdOptions* pOpts ) const; @@ -384,6 +386,7 @@ class SD_DLLPUBLIC SdOptionsPrintItem final : public SfxPoolItem { public: + DECLARE_ITEM_TYPE_FUNCTION(SdOptionsPrintItem) explicit SdOptionsPrintItem(); explicit SdOptionsPrintItem( SdOptions const * pOpts ); diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 4e4019db3147..7a299c54c280 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -308,7 +308,7 @@ public: /// @see vcl::ITiledRenderable::postSlideshowCleanup(). SD_DLLPUBLIC void postSlideshowCleanup() override; /// @see vcl::ITiledRenderable::renderNextSlideLayer(). - SD_DLLPUBLIC bool renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, OUString& rJsonMsg) override; + SD_DLLPUBLIC bool renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, double& rScale, OUString& rJsonMsg) override; rtl::Reference< SdDrawPagesAccess > getSdDrawPages(); |