27#include <com/sun/star/awt/InvalidateStyle.hpp>
28#include <com/sun/star/awt/PosSize.hpp>
29#include <com/sun/star/awt/Pointer.hpp>
30#include <com/sun/star/awt/Toolkit.hpp>
31#include <com/sun/star/awt/WindowAttribute.hpp>
32#include <com/sun/star/awt/XWindow.hpp>
33#include <com/sun/star/awt/XWindowPeer.hpp>
34#include <com/sun/star/drawing/XPresenterHelper.hpp>
35#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
36#include <com/sun/star/rendering/CompositeOperation.hpp>
37#include <com/sun/star/rendering/TextDirection.hpp>
38#include <com/sun/star/rendering/TexturingMode.hpp>
39#include <osl/mutex.hxx>
51 css::uno::Reference<css::uno::XComponentContext> xContext,
52 css::uno::Reference<css::drawing::framework::XResourceId> xViewId,
58 mxViewId(
std::move(xViewId)),
59 mxController(rxController),
62 mnPageAspectRatio(28.0/21.0),
64 mbIsForcedPaintPending(false),
65 mbIsPaintPending(true),
66 mbIsEndSlideVisible(false)
78 Reference<lang::XComponent> xSlideShowComponent (
mxSlideShow, UNO_QUERY);
79 xSlideShowComponent->addEventListener(
static_cast<awt::XWindowListener*
>(
this));
81 Reference<lang::XMultiComponentFactory>
xFactory (
84 "com.sun.star.comp.Draw.PresenterHelper",
90 Reference<XConfigurationController> xCC (
mxController->getConfigurationController());
96 Reference<XPane> xPane (xCC->getResource(
mxViewId->getAnchor()), UNO_QUERY_THROW);
109 Reference<awt::XWindowPeer> xPeer (
mxWindow, UNO_QUERY);
111 xPeer->setBackground(util::Color(0xff000000));
147 "Presenter/Views/CurrentSlidePreview/"
148 "Strings/ClickToExitPresentationText/String")
151 "Presenter/Views/CurrentSlidePreview/"
152 "Strings/ClickToExitPresentationTitle/String")
164 aEvent.Source =
static_cast<XWeak*
>(
this);
168 if (pIterator !=
nullptr)
176 mxWindow->removePaintListener(
this);
177 mxWindow->removeMouseListener(
this);
178 mxWindow->removeMouseMotionListener(
this);
179 mxWindow->removeWindowListener(
this);
186 Reference<XComponent> xComponent (
mxViewCanvas, UNO_QUERY);
189 xComponent->dispose();
196 xComponent->dispose();
200 Reference<XComponent> xComponent (
mxPointer, UNO_QUERY);
203 xComponent->dispose();
210 xComponent->dispose();
217 xComponent->dispose();
235 const css::uno::Reference<css::drawing::XDrawPage>& rxSlide)
244 Reference<awt::XWindowPeer> xPeer (
mxViewWindow, UNO_QUERY);
246 xPeer->invalidate(awt::InvalidateStyle::NOTRANSPARENT);
270 pDescriptor->msTitle.clear();
298 return Reference<rendering::XSpriteCanvas>(
mxViewCanvas, UNO_QUERY);
311 awt::Rectangle aViewWindowBox (
mxViewWindow->getPosSize());
313 awt::Rectangle(0,0, aViewWindowBox.Width,aViewWindowBox.Height),
316 rendering::ViewState aViewState (
317 geometry::AffineMatrix2D(1,0,0, 0,1,0),
319 double const aColor[4] = {0,0,0,0};
320 rendering::RenderState aRenderState(
321 geometry::AffineMatrix2D(1,0,0, 0,1,0),
323 Sequence<double>(aColor,4),
324 rendering::CompositeOperation::SOURCE);
325 mxViewCanvas->fillPolyPolygon(xPolygon, aViewState, aRenderState);
343 const awt::Rectangle aWindowBox =
mxViewWindow->getPosSize();
344 return geometry::AffineMatrix2D(
345 aWindowBox.Width-1, 0, 0,
346 0, aWindowBox.Height-1, 0);
350 return geometry::AffineMatrix2D(1,0,0, 0,1,0);
357 return geometry::IntegerSize2D(0,0);
361 const Reference<util::XModifyListener>& rxListener)
370 const Reference<util::XModifyListener>& rxListener)
379 const Reference<awt::XPaintListener>& rxListener)
388 const Reference<awt::XPaintListener>& rxListener)
397 const Reference<awt::XMouseListener>& rxListener)
406 const Reference<awt::XMouseListener>& rxListener)
415 const Reference<awt::XMouseMotionListener>& rxListener)
424 const Reference<awt::XMouseMotionListener>& rxListener)
444 Reference<awt::XWindowPeer> xPeer (
mxViewWindow, UNO_QUERY);
457 awt::Rectangle aRectangle;
459 aRectangle.X = aRectangle.Y = aRectangle.Width = aRectangle.Height = 0;
479 if ( ! mbIsPresenterViewActive)
482 awt::Rectangle aViewWindowBox (
mxViewWindow->getPosSize());
483 if (aViewWindowBox.Width <= 0 || aViewWindowBox.Height <= 0)
498 awt::MouseEvent
aEvent (rEvent);
499 aEvent.Source =
static_cast<XWeak*
>(
this);
502 if (pIterator !=
nullptr)
517 awt::MouseEvent
aEvent (rEvent);
518 aEvent.Source =
static_cast<XWeak*
>(
this);
521 if (pIterator !=
nullptr)
529 awt::MouseEvent
aEvent (rEvent);
530 aEvent.Source =
static_cast<XWeak*
>(
this);
533 if (pIterator !=
nullptr)
541 awt::MouseEvent
aEvent (rEvent);
542 aEvent.Source =
static_cast<XWeak*
>(
this);
545 if (pIterator !=
nullptr)
555 awt::MouseEvent
aEvent (rEvent);
556 aEvent.Source =
static_cast<XWeak*
>(
this);
559 if (pIterator !=
nullptr)
567 awt::MouseEvent
aEvent (rEvent);
568 aEvent.Source =
static_cast<XWeak*
>(
this);
571 if (pIterator !=
nullptr)
582 ::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
641 const rendering::ViewState aViewState(
642 geometry::AffineMatrix2D(1,0,0, 0,1,0),
645 rendering::RenderState aRenderState (
646 geometry::AffineMatrix2D(1,0,0, 0,1,0),
649 rendering::CompositeOperation::SOURCE);
651 Reference<rendering::XBitmap> xBackgroundBitmap (
mpBackground->GetNormalBitmap());
652 if (xBackgroundBitmap.is())
654 const geometry::IntegerSize2D aBitmapSize(xBackgroundBitmap->getSize());
655 Sequence<rendering::Texture> aTextures
658 geometry::AffineMatrix2D( aBitmapSize.Width,0,0, 0,aBitmapSize.Height,0),
664 rendering::StrokeAttributes(),
665 rendering::TexturingMode::REPEAT,
666 rendering::TexturingMode::REPEAT
699 const rendering::ViewState aViewState(
700 geometry::AffineMatrix2D(1,0,0, 0,1,0),
703 rendering::RenderState aRenderState (
704 geometry::AffineMatrix2D(1,0,0, 0,1,0),
707 rendering::CompositeOperation::SOURCE);
719 if (pTheme ==
nullptr)
722 const OUString sViewStyle (pTheme->GetStyleName(
mxViewId->getResourceURL()));
729 aRenderState.AffineTransform.m02 = 20;
730 aRenderState.AffineTransform.m12 = 40;
731 const rendering::StringContext aContext (
734 const Reference<rendering::XTextLayout> xLayout (
735 pFont->mxFont->createTextLayout(aContext,rendering::TextDirection::WEAK_LEFT_TO_RIGHT,0));
745 Reference<rendering::XSpriteCanvas> xSpriteCanvas (
mxCanvas, UNO_QUERY);
746 if (xSpriteCanvas.is())
747 xSpriteCanvas->updateScreen(
true);
753 awt::PaintEvent
aEvent (rEvent);
754 aEvent.Source =
static_cast<XWeak*
>(
this);
757 if (pIterator !=
nullptr)
774 Reference<rendering::XSpriteCanvas> xSpriteCanvas (
mxCanvas, UNO_QUERY);
775 if (xSpriteCanvas.is())
776 xSpriteCanvas->updateScreen(
true);
780 const Reference<awt::XWindow>& rxParentWindow)
const
782 Reference<awt::XWindow> xViewWindow;
790 awt::WindowDescriptor aWindowDescriptor (
791 awt::WindowClass_CONTAINER,
793 Reference<awt::XWindowPeer>(rxParentWindow,UNO_QUERY_THROW),
795 awt::Rectangle(0,0,10,10),
796 awt::WindowAttribute::SIZEABLE
797 | awt::WindowAttribute::MOVEABLE
798 | awt::WindowAttribute::NODECORATION);
799 xViewWindow.set( xToolkit->createWindow(aWindowDescriptor),UNO_QUERY_THROW);
802 Reference<awt::XWindowPeer> xPeer (xViewWindow, UNO_QUERY_THROW);
803 xPeer->setBackground(0xff000000);
805 xViewWindow->setVisible(
true);
814 const Reference<awt::XWindow>& rxViewWindow)
const
818 Reference<rendering::XSpriteCanvas>(
mxTopPane->getCanvas(), UNO_QUERY),
830 const awt::Rectangle aWindowBox (
mxWindow->getPosSize());
831 if (aWindowBox.Height > 0)
833 awt::Rectangle aViewWindowBox;
834 const double nWindowAspectRatio (
835 double(aWindowBox.Width) /
double(aWindowBox.Height));
840 aViewWindowBox.Height = aWindowBox.Height;
841 aViewWindowBox.X = (aWindowBox.Width - aViewWindowBox.Width) / 2;
842 aViewWindowBox.Y = 0;
847 aViewWindowBox.Width = aWindowBox.Width;
849 aViewWindowBox.X = 0;
850 aViewWindowBox.Y = (aWindowBox.Height - aViewWindowBox.Height) / 2;
855 aViewWindowBox.Width,
856 aViewWindowBox.Height,
857 awt::PosSize::POSSIZE);
866 lang::EventObject
aEvent (
static_cast<XWeak*
>(
this));
869 if (pIterator !=
nullptr)
883 const awt::Rectangle aWindowBox (
mxWindow->getPosSize());
884 const awt::Rectangle aViewWindowBox (
mxViewWindow->getPosSize());
885 if (aWindowBox.Height == aViewWindowBox.Height && aWindowBox.Width == aViewWindowBox.Width)
890 else if (aWindowBox.Height == aViewWindowBox.Height)
902 aViewWindowBox.X + aViewWindowBox.Width,
904 aWindowBox.Width - aViewWindowBox.X - aViewWindowBox.Width,
921 aViewWindowBox.Y + aViewWindowBox.Height,
923 aWindowBox.Height - aViewWindowBox.Y - aViewWindowBox.Height),
930 if (rBHelper.bDisposed || rBHelper.bInDispose)
932 throw lang::DisposedException (
933 "PresenterSlideShowView object has already been disposed",
934 static_cast<uno::XWeak*
>(
this));
940 Reference<presentation::XSlideShowView> xView (
this);
944 beans::PropertyValue aProperty;
945 aProperty.Name =
"IsSoundEnabled";
946 Sequence<Any> aValues{
Any(xView),
Any(
false) };
947 aProperty.Value <<= aValues;
rtl::Reference< PresenterController > mpPresenterController
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
void SAL_CALL disposeAndClear(const css::lang::EventObject &rEvt)
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
static void SetDeviceColor(css::rendering::RenderState &rRenderState, const css::util::Color aColor)
This class gives access to the configuration.
css::uno::Any GetConfigurationNode(const OUString &rsPathToNode)
Return a configuration node below the root of the called object.
static constexpr OUStringLiteral msPresenterScreenRootName
static css::uno::Reference< css::rendering::XPolyPolygon2D > CreatePolygon(const css::awt::Rectangle &rBox, const css::uno::Reference< css::rendering::XGraphicDevice > &rxDevice)
std::shared_ptr< PaneDescriptor > SharedPaneDescriptor
virtual sal_Bool SAL_CALL isAnchorOnly() override
void PaintInnerWindow(const css::awt::PaintEvent &rEvent)
virtual void SAL_CALL mouseEntered(const css::awt::MouseEvent &rEvent) override
OUString msClickToExitPresentationTitle
virtual void SAL_CALL addPaintListener(const css::uno::Reference< css::awt::XPaintListener > &xListener) override
bool mbIsForcedPaintPending
virtual void ReleaseView() override
SharedBitmapDescriptor mpBackground
virtual css::geometry::AffineMatrix2D SAL_CALL getTransformation() override
css::uno::Reference< css::awt::XWindow > mxWindow
virtual void SAL_CALL mouseExited(const css::awt::MouseEvent &rEvent) override
void PaintEndSlide(const css::awt::Rectangle &rRepaintBox)
virtual css::uno::Reference< css::rendering::XSpriteCanvas > SAL_CALL getCanvas() override
virtual void SAL_CALL mouseReleased(const css::awt::MouseEvent &rEvent) override
css::uno::Reference< css::presentation::XSlideShow > mxSlideShow
::rtl::Reference< PresenterController > mpPresenterController
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getCurrentPage() override
virtual void DeactivatePresenterView() override
css::uno::Reference< css::drawing::XPresenterHelper > mxPresenterHelper
virtual void SAL_CALL removeTransformationChangedListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
void impl_addAndConfigureView()
virtual void SAL_CALL removeMouseListener(const css::uno::Reference< css::awt::XMouseListener > &xListener) override
css::uno::Reference< css::rendering::XPolyPolygon2D > mxBackgroundPolygon1
css::uno::Reference< css::rendering::XCanvas > mxViewCanvas
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &rEvent) override
virtual void SAL_CALL setCurrentPage(const css::uno::Reference< css::drawing::XDrawPage > &rxSlide) override
rtl::Reference<::sd::DrawController > mxController
virtual void SAL_CALL windowPaint(const css::awt::PaintEvent &rEvent) override
css::uno::Reference< css::drawing::XDrawPage > mxCurrentSlide
css::uno::Reference< css::drawing::framework::XResourceId > mxViewId
css::uno::Reference< css::presentation::XSlideShowController > mxSlideShowController
virtual void SAL_CALL mouseDragged(const css::awt::MouseEvent &rEvent) override
virtual void SAL_CALL removePaintListener(const css::uno::Reference< css::awt::XPaintListener > &xListener) override
css::uno::Reference< css::rendering::XCanvas > CreateViewCanvas(const css::uno::Reference< css::awt::XWindow > &rxWindow) const
virtual void SAL_CALL addMouseListener(const css::uno::Reference< css::awt::XMouseListener > &xListener) override
void PaintOuterWindow(const css::awt::Rectangle &rRepaintBox)
virtual void SAL_CALL disposing() override
virtual ~PresenterSlideShowView() override
virtual void SAL_CALL windowHidden(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL mouseMoved(const css::awt::MouseEvent &rEvent) override
::cppu::OBroadcastHelper maBroadcaster
This broadcast helper is used to notify listeners registered to a SlideShowView object.
virtual void SAL_CALL removeMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener > &xListener) override
virtual void SAL_CALL mousePressed(const css::awt::MouseEvent &rEvent) override
virtual css::uno::Reference< css::drawing::framework::XResourceId > SAL_CALL getResourceId() override
virtual void SAL_CALL addTransformationChangedListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
virtual void ActivatePresenterView() override
OUString msClickToExitPresentationText
virtual css::awt::Rectangle SAL_CALL getCanvasArea() override
css::uno::Reference< css::awt::XWindow > CreateViewWindow(const css::uno::Reference< css::awt::XWindow > &rxParentWindow) const
Create the window into which the slide show will render its content.
double mnPageAspectRatio
Aspect ratio of the current slide.
virtual void SAL_CALL setMouseCursor(::sal_Int16 nPointerShape) override
css::uno::Reference< css::drawing::framework::XPane > mxTopPane
css::uno::Reference< css::rendering::XCanvas > mxCanvas
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &rEvent) override
virtual css::geometry::IntegerSize2D SAL_CALL getTranslationOffset() override
virtual void SAL_CALL windowShown(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL clear() override
virtual void SAL_CALL addMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener > &xListener) override
css::uno::Reference< css::awt::XPointer > mxPointer
css::uno::Reference< css::awt::XWindow > mxViewWindow
css::uno::Reference< css::rendering::XPolyPolygon2D > mxBackgroundPolygon2
void CreateBackgroundPolygons()
PresenterSlideShowView(css::uno::Reference< css::uno::XComponentContext > xContext, css::uno::Reference< css::drawing::framework::XResourceId > xViewId, const rtl::Reference<::sd::DrawController > &rxController, ::rtl::Reference< PresenterController > xPresenterController)
std::shared_ptr< FontDescriptor > SharedFontDescriptor
Reference< XSingleServiceFactory > xFactory
css::uno::Reference< css::presentation::XSlideShowController > GetSlideShowController(const css::uno::Reference< css::frame::XController > &rxController)
Return the slide show controller of a running presentation that has the same document as the given fr...
cppu::WeakComponentImplHelper< css::presentation::XSlideShowView, css::awt::XPaintListener, css::awt::XMouseListener, css::awt::XMouseMotionListener, css::awt::XWindowListener, css::drawing::framework::XView, css::drawing::XDrawView > PresenterSlideShowViewInterfaceBase
void addListener(const keyType &key, const css::uno::Reference< css::uno::XInterface > &r)
void removeListener(const keyType &key, const css::uno::Reference< css::uno::XInterface > &r)
OInterfaceContainerHelper *SAL_CALL getContainer(const keyType &key) const