From 1f0fd06bc0cfe5036661ce2c23911f34eccf678a Mon Sep 17 00:00:00 2001 From: Marco Cecchetti Date: Mon, 24 Jun 2024 15:26:18 +0900 Subject: sd: slideshow render interface and implementation Interface and implementation to expose the ability to render the slide's layers to a bitmap. Change-Id: I3da48585e498354592e163d84bd29659b233c255 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170214 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- sd/source/ui/view/drviewsk.cxx | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'sd/source/ui/view/drviewsk.cxx') diff --git a/sd/source/ui/view/drviewsk.cxx b/sd/source/ui/view/drviewsk.cxx index bdbb821e96b3..cb40d8398f04 100644 --- a/sd/source/ui/view/drviewsk.cxx +++ b/sd/source/ui/view/drviewsk.cxx @@ -11,12 +11,18 @@ #include #include +#include + #include +#include +#include #include #include #include #include +using namespace css; + namespace sd { void DrawViewShell::ConfigurationChanged( utl::ConfigurationBroadcaster* pCb, ConfigurationHints ) @@ -57,6 +63,42 @@ void DrawViewShell::ConfigureAppBackgroundColor( svtools::ColorConfig *pColorCon maViewOptions.mnAppBackgroundColor = aFillColor; } +void DrawViewShell::destroyXSlideShowInstance() +{ + if (!mxSlideShow.is()) + return; + + try + { + uno::Reference xComponent(mxSlideShow, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->dispose(); + } + catch (uno::Exception&) + { + TOOLS_WARN_EXCEPTION( "sd", "DrawViewShell::destroyXSlideShowInstance dispose"); + } + + mxSlideShow.clear(); +} + +uno::Reference DrawViewShell::getXSlideShowInstance() +{ + if (!mxSlideShow.is()) + { + try + { + auto xContext = ::comphelper::getProcessComponentContext(); + mxSlideShow.set(presentation::SlideShow::create(xContext), uno::UNO_SET_THROW); + } + catch (uno::Exception&) + { + TOOLS_WARN_EXCEPTION("sd", "DrawViewShell::createXSlideShowInstance()"); + } + } + return mxSlideShow; +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit