26#include <com/sun/star/awt/Pointer.hpp>
27#include <com/sun/star/awt/XWindow.hpp>
28#include <com/sun/star/awt/XWindowPeer.hpp>
29#include <com/sun/star/beans/XPropertySet.hpp>
43using ::com::sun::star::uno::Reference;
44using ::com::sun::star::uno::WeakReference;
45using ::com::sun::star::uno::Exception;
55 [&rEvent] (
const Reference<css::awt::XMouseListener>& rListener)
59 case WrappedMouseEvent::PRESSED:
60 rListener->mousePressed( rEvent.maEvent );
63 case WrappedMouseEvent::RELEASED:
64 rListener->mouseReleased( rEvent.maEvent );
67 case WrappedMouseEvent::ENTERED:
68 rListener->mouseEntered( rEvent.maEvent );
71 case WrappedMouseEvent::EXITED:
72 rListener->mouseExited( rEvent.maEvent );
82 [&rEvent] (
const Reference< awt::XMouseMotionListener >& rListener)
86 case WrappedMouseMotionEvent::DRAGGED:
87 rListener->mouseDragged( rEvent.maEvent );
90 case WrappedMouseMotionEvent::MOVED:
91 rListener->mouseMoved( rEvent.maEvent );
104 mxWindow(
VCLUnoHelper::GetInterface( &rOutputWindow ),
uno::UNO_SET_THROW ),
105 mxWindowPeer( mxWindow,
uno::UNO_QUERY_THROW ),
106 mpSlideShow( pSlideShow ),
107 mrOutputWindow( rOutputWindow ),
109 mbIsMouseMotionListener( false ),
110 meAnimationMode( eAnimationMode ),
111 mbFirstPaint( true ),
112 mbMousePressedEaten( false )
114 mxWindow->addWindowListener(
this );
117 mxPointer = awt::Pointer::create( ::comphelper::getProcessComponentContext() );
128 Reference< beans::XPropertySet > xCanvasProps(
getCanvas(),
129 uno::UNO_QUERY_THROW );
130 xCanvasProps->setPropertyValue(
"UnsafeScrolling",
133 catch( uno::Exception& )
150 mxWindow->removeWindowListener(
this );
151 mxWindow->removeMouseListener(
this );
154 mxWindow->removeMouseMotionListener(
this );
167 std::unique_lock aGuard(
m_aMutex );
177 lang::EventObject
const evt(
static_cast<OWeakObject *
>(
this) );
182 for(
const auto& rxListener : tmp )
184 Reference< util::XModifyListener > xListener( rxListener );
186 xListener->disposing( evt );
209 std::unique_lock aGuard(
m_aMutex );
223 awt::PaintEvent
aEvent( e );
233 std::unique_lock aGuard(
m_aMutex );
235 return mpCanvas ?
mpCanvas->getUNOSpriteCanvas() : Reference< rendering::XSpriteCanvas >();
241 std::unique_lock aGuard(
m_aMutex );
251 aWindowSize.
Height() ) ) );
257 pPolyPoly->setRGBAFillColor( 0x000000FFU );
269 std::unique_lock aGuard(
m_aMutex );
276 return geometry::AffineMatrix2D (1,0,0,0,1,0);
280 Size aOutputSize( aWindowSize );
291 const double page_ratio =
static_cast<double>(aPageSize.
Width()) /
static_cast<double>(aPageSize.
Height());
292 const double output_ratio =
static_cast<double>(aOutputSize.
Width()) /
static_cast<double>(aOutputSize.
Height());
294 if( page_ratio > output_ratio )
298 else if( page_ratio < output_ratio )
303 Point aOutputOffset( ( aWindowSize.
Width() - aOutputSize.
Width() ) >> 1,
318 aOutputSize.
Width(), aOutputSize.
Height(), aOutputOffset.
X(), aOutputOffset.
Y()));
320 geometry::AffineMatrix2D aRes;
322 return ::basegfx::unotools::affineMatrixFromHomMatrix( aRes, aMatrix );
327 std::unique_lock aGuard(
m_aMutex );
331 WeakReference< util::XModifyListener > xWeak( xListener );
338 std::unique_lock aGuard(
m_aMutex );
342 WeakReference< util::XModifyListener > xWeak( xListener );
350 std::unique_lock aGuard(
m_aMutex );
358 std::unique_lock aGuard(
m_aMutex );
366 std::unique_lock aGuard(
m_aMutex );
374 std::unique_lock aGuard(
m_aMutex );
382 std::unique_lock aGuard(
m_aMutex );
392 mxWindow->addMouseMotionListener(
this );
400 std::unique_lock aGuard(
m_aMutex );
411 std::unique_lock aGuard(
m_aMutex );
423 awt::Rectangle aRectangle;
428 aRectangle.X = aRectangle.Y = aRectangle.Width = aRectangle.Height = 0;
456 std::unique_lock aGuard(
m_aMutex );
465 awt::WindowEvent
aEvent( e );
470 Reference< util::XModifyListener > xListener( *aIter );
474 xListener->modified(
aEvent );
506 std::unique_lock aGuard(
m_aMutex );
532 std::unique_lock aGuard(
m_aMutex );
557 std::unique_lock aGuard(
m_aMutex );
574 std::unique_lock aGuard(
m_aMutex );
592 std::unique_lock aGuard(
m_aMutex );
609 std::unique_lock aGuard(
m_aMutex );
rtl::Reference< PresenterCanvas > mpCanvas
constexpr tools::Long Y() const
constexpr tools::Long X() const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void forEach(std::unique_lock< std::mutex > &rGuard, FuncT const &func) const
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(std::unique_lock< std::mutex > &rGuard, void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event) const
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
sal_Int32 getLength(std::unique_lock< std::mutex > &rGuard) const
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
static PolyPolygonSharedPtr createPolyPolygon(const CanvasSharedPtr &, const ::basegfx::B2DPolygon &rPoly)
void notify(std::unique_lock< std::mutex > &rGuard, const WrappedMouseEvent &rEvent)
void notify(std::unique_lock< std::mutex > &rGuard, const WrappedMouseMotionEvent &rEvent)
void paint(const css::awt::PaintEvent &e)
virtual void SAL_CALL removeTransformationChangedListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
virtual css::geometry::IntegerSize2D SAL_CALL getTranslationOffset() override
virtual void SAL_CALL mousePressed(const css::awt::MouseEvent &e) override
css::uno::Reference< css::awt::XWindowPeer > mxWindowPeer
virtual css::awt::Rectangle SAL_CALL getCanvasArea() override
virtual void SAL_CALL removePaintListener(const css::uno::Reference< css::awt::XPaintListener > &xListener) override
virtual void SAL_CALL mouseExited(const css::awt::MouseEvent &e) override
std::vector< css::uno::WeakReference< css::util::XModifyListener > > maViewListeners
virtual void SAL_CALL mouseMoved(const css::awt::MouseEvent &e) override
SlideShowViewMouseListeners maMouseListeners
SlideShowView(ShowWindow &rOutputWindow, SdDrawDocument *pDoc, AnimationMode eAnimationMode, SlideshowImpl *pSlideShow, bool bFullScreen)
virtual void SAL_CALL removeMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener > &xListener) override
SlideShowViewPaintListeners maPaintListeners
virtual void SAL_CALL mouseReleased(const css::awt::MouseEvent &e) override
css::uno::Reference< css::awt::XPointer > mxPointer
::cppcanvas::SpriteCanvasSharedPtr mpCanvas
virtual void SAL_CALL removeMouseListener(const css::uno::Reference< css::awt::XMouseListener > &xListener) override
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &e) override
virtual css::uno::Reference< css::rendering::XSpriteCanvas > SAL_CALL getCanvas() override
virtual void SAL_CALL addPaintListener(const css::uno::Reference< css::awt::XPaintListener > &xListener) override
virtual void SAL_CALL windowHidden(const css::lang::EventObject &e) override
virtual void SAL_CALL mouseDragged(const css::awt::MouseEvent &e) override
AnimationMode meAnimationMode
virtual void SAL_CALL mouseEntered(const css::awt::MouseEvent &e) override
css::geometry::IntegerSize2D mTranslationOffset
void updateimpl(std::unique_lock< std::mutex > &rGuard, SlideshowImpl *pSlideShow)
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &e) override
virtual void SAL_CALL addMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener > &xListener) override
css::uno::Reference< css::awt::XWindow > mxWindow
virtual void SAL_CALL clear() override
virtual void SAL_CALL addMouseListener(const css::uno::Reference< css::awt::XMouseListener > &xListener) override
virtual void SAL_CALL windowShown(const css::lang::EventObject &e) override
virtual css::geometry::AffineMatrix2D SAL_CALL getTransformation() override
virtual void disposing(std::unique_lock< std::mutex > &) override
Dispose all internal references.
void disposingImpl(std::unique_lock< std::mutex > &)
SlideShowViewMouseMotionListeners maMouseMotionListeners
virtual void SAL_CALL setMouseCursor(sal_Int16 nPointerShape) override
virtual void SAL_CALL addTransformationChangedListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
SlideshowImpl * mpSlideShow
bool mbIsMouseMotionListener
ShowWindow & mrOutputWindow
void onFirstPaint()
called only by the slideshow view when the first paint event occurs.
void startUpdateTimer()
forces an async call to update in the main thread
bool isInputFreezed() const
virtual Size GetSizePixel() const
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
std::shared_ptr< PolyPolygon > PolyPolygonSharedPtr