Update to m13
[ooovba.git] / applied_patches / 0554-transogl-fix-presenter-view.diff
blobccc4ada80f454ffede6946c83237cac12284ff25
1 diff -rup offapi.orig/com/sun/star/presentation/XSlideShowView.idl offapi/com/sun/star/presentation/XSlideShowView.idl
2 --- offapi.orig/com/sun/star/presentation/XSlideShowView.idl 2008-09-09 11:40:58.000000000 +0200
3 +++ offapi/com/sun/star/presentation/XSlideShowView.idl 2008-09-09 12:11:40.000000000 +0200
4 @@ -37,9 +37,6 @@
5 #ifndef __com_sun_star_rendering_XSpriteCanvas_idl__
6 #include <com/sun/star/rendering/XSpriteCanvas.idl>
7 #endif
8 -#ifndef __com_sun_star_geometry_RealRectangle2D_idl__
9 -#include <com/sun/star/geometry/RealRectangle2D.idl>
10 -#endif
11 #ifndef __com_sun_star_util_XModifyListener_idl__
12 #include <com/sun/star/util/XModifyListener.idl>
13 #endif
14 @@ -52,6 +49,9 @@
15 #ifndef __com_sun_star_awt_XMouseMotionListener_idl__
16 #include <com/sun/star/awt/XMouseMotionListener.idl>
17 #endif
18 +#ifndef __com_sun_star_awt_Rectangle_idl__
19 +#include <com/sun/star/awt/Rectangle.idl>
20 +#endif
22 module com { module sun { module star { module presentation {
24 @@ -179,6 +179,10 @@ interface XSlideShowView : ::com::sun::s
26 void setMouseCursor( [in] short nPointerShape );
28 + /** Get rectangle defining area inside of canvas device which
29 + this slideshow view uses.
30 + */
31 + ::com::sun::star::awt::Rectangle getCanvasArea();
34 }; }; }; };
35 diff -rup sd.orig/source/ui/slideshow/slideshowviewimpl.cxx sd/source/ui/slideshow/slideshowviewimpl.cxx
36 --- sd.orig/source/ui/slideshow/slideshowviewimpl.cxx 2008-09-09 11:50:57.000000000 +0200
37 +++ sd/source/ui/slideshow/slideshowviewimpl.cxx 2008-09-09 12:12:55.000000000 +0200
38 @@ -57,7 +57,6 @@ using ::comphelper::ImplementationRefere
40 using ::rtl::OUString;
41 using namespace ::com::sun::star;
42 -using namespace ::com::sun::star;
44 namespace sd
46 @@ -489,6 +488,18 @@ void SAL_CALL SlideShowView::setMouseCur
47 mxWindowPeer->setPointer( mxPointer );
50 +awt::Rectangle SAL_CALL SlideShowView::getCanvasArea( ) throw (RuntimeException)
52 + awt::Rectangle aRectangle;
54 + if( mxWindow.is() )
55 + return mxWindow->getPosSize();
57 + aRectangle.X = aRectangle.Y = aRectangle.Width = aRectangle.Height = 0;
59 + return aRectangle;
62 void SlideShowView::updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImpl* pSlideShow )
64 if( pSlideShow )
65 diff -rup sd.orig/source/ui/slideshow/slideshowviewimpl.hxx sd/source/ui/slideshow/slideshowviewimpl.hxx
66 --- sd.orig/source/ui/slideshow/slideshowviewimpl.hxx 2008-09-09 11:50:57.000000000 +0200
67 +++ sd/source/ui/slideshow/slideshowviewimpl.hxx 2008-09-09 12:11:30.000000000 +0200
68 @@ -236,6 +236,7 @@ public:
69 virtual void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
70 virtual void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
71 virtual void SAL_CALL setMouseCursor( sal_Int16 nPointerShape ) throw (::com::sun::star::uno::RuntimeException);
72 + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCanvasArea( ) throw (::com::sun::star::uno::RuntimeException);
74 // XWindowListener methods
75 virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
76 diff -rup sdext.orig/source/presenter/PresenterSlideShowView.cxx sdext/source/presenter/PresenterSlideShowView.cxx
77 --- sdext.orig/source/presenter/PresenterSlideShowView.cxx 2008-09-09 11:41:38.000000000 +0200
78 +++ sdext/source/presenter/PresenterSlideShowView.cxx 2008-09-09 15:13:32.000000000 +0200
79 @@ -82,6 +82,8 @@ PresenterSlideShowView::PresenterSlideSh
80 mxPointer(),
81 mxWindow(),
82 mxViewWindow(),
83 + mxTopPane(),
84 + mxPresenterHelper(),
85 mxBackgroundPolygon1(),
86 mxBackgroundPolygon2(),
87 mbIsViewAdded(false),
88 @@ -114,6 +116,13 @@ void PresenterSlideShowView::LateInit (v
89 if (xSlideShowComponent.is())
90 xSlideShowComponent->addEventListener(static_cast<awt::XWindowListener*>(this));
92 + Reference<lang::XMultiComponentFactory> xFactory (
93 + mxComponentContext->getServiceManager(), UNO_QUERY_THROW);
94 + mxPresenterHelper.set (xFactory->createInstanceWithContext(
95 + OUString::createFromAscii("com.sun.star.comp.Draw.PresenterHelper"),
96 + mxComponentContext),
97 + UNO_QUERY_THROW);
99 // Use view id and controller to retrieve window and canvas from
100 // configuration controller.
101 Reference<XControllerManager> xCM (mxController, UNO_QUERY_THROW);
102 @@ -121,6 +130,8 @@ void PresenterSlideShowView::LateInit (v
104 if (xCC.is())
106 + mxTopPane.set(xCC->getResource(mxViewId->getAnchor()->getAnchor()), UNO_QUERY);
108 Reference<XPane> xPane (xCC->getResource(mxViewId->getAnchor()), UNO_QUERY_THROW);
110 mxWindow = xPane->getWindow();
111 @@ -142,8 +153,8 @@ void PresenterSlideShowView::LateInit (v
112 // Create a window for the actual slide show view. It is places
113 // centered and with maximal size inside the pane.
114 mxViewWindow = CreateViewWindow(mxWindow);
115 - mxViewCanvas = CreateViewCanvas(mxViewWindow,
116 - Reference<XPane>(xCC->getResource(mxViewId->getAnchor()->getAnchor()), UNO_QUERY));
118 + mxViewCanvas = CreateViewCanvas(mxViewWindow);
120 if (mxViewWindow.is())
122 @@ -543,6 +554,19 @@ void SAL_CALL PresenterSlideShowView::se
126 +awt::Rectangle SAL_CALL PresenterSlideShowView::getCanvasArea( ) throw (RuntimeException)
128 + if( mxViewWindow.is() && mxTopPane.is() )
129 + return mxPresenterHelper->getWindowExtentsRelative( mxViewWindow, mxTopPane->getWindow() );
131 + awt::Rectangle aRectangle;
133 + aRectangle.X = aRectangle.Y = aRectangle.Width = aRectangle.Height = 0;
135 + return aRectangle;
140 //----- lang::XEventListener --------------------------------------------------
142 @@ -976,22 +1000,14 @@ Reference<awt::XWindow> PresenterSlideSh
145 Reference<rendering::XCanvas> PresenterSlideShowView::CreateViewCanvas (
146 - const Reference<awt::XWindow>& rxViewWindow,
147 - const Reference<XPane>& rxParentPane) const
148 + const Reference<awt::XWindow>& rxViewWindow) const
150 // Create a canvas for the view window.
151 - Reference<lang::XMultiComponentFactory> xFactory (
152 - mxComponentContext->getServiceManager(), UNO_QUERY_THROW);
153 - Reference<drawing::XPresenterHelper> xPresenterHelper(
154 - xFactory->createInstanceWithContext(
155 - OUString::createFromAscii("com.sun.star.comp.Draw.PresenterHelper"),
156 - mxComponentContext),
157 - UNO_QUERY_THROW);
158 - return xPresenterHelper->createSharedCanvas(
159 - Reference<rendering::XSpriteCanvas>(rxParentPane->getCanvas(), UNO_QUERY),
160 - rxParentPane->getWindow(),
161 - rxParentPane->getCanvas(),
162 - rxParentPane->getWindow(),
163 + return mxPresenterHelper->createSharedCanvas(
164 + Reference<rendering::XSpriteCanvas>(mxTopPane->getCanvas(), UNO_QUERY),
165 + mxTopPane->getWindow(),
166 + mxTopPane->getCanvas(),
167 + mxTopPane->getWindow(),
168 rxViewWindow);
171 diff -rup sdext.orig/source/presenter/PresenterSlideShowView.hxx sdext/source/presenter/PresenterSlideShowView.hxx
172 --- sdext.orig/source/presenter/PresenterSlideShowView.hxx 2008-09-09 11:41:38.000000000 +0200
173 +++ sdext/source/presenter/PresenterSlideShowView.hxx 2008-09-09 14:29:00.000000000 +0200
174 @@ -149,6 +149,8 @@ public:
175 virtual void SAL_CALL setMouseCursor(::sal_Int16 nPointerShape)
176 throw (css::uno::RuntimeException);
178 + virtual ::com::sun::star::awt::Rectangle SAL_CALL getCanvasArea( )
179 + throw (::com::sun::star::uno::RuntimeException);
181 // lang::XEventListener
182 virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent)
183 @@ -236,6 +238,8 @@ private:
184 css::uno::Reference<css::awt::XPointer> mxPointer;
185 css::uno::Reference<css::awt::XWindow> mxWindow;
186 css::uno::Reference<css::awt::XWindow> mxViewWindow;
187 + css::uno::Reference<css::drawing::framework::XPane> mxTopPane;
188 + css::uno::Reference<css::drawing::XPresenterHelper> mxPresenterHelper;
189 css::uno::Reference<css::rendering::XPolyPolygon2D> mxBackgroundPolygon1;
190 css::uno::Reference<css::rendering::XPolyPolygon2D> mxBackgroundPolygon2;
191 bool mbIsViewAdded;
192 @@ -267,8 +271,7 @@ private:
193 css::uno::Reference<css::awt::XWindow> CreateViewWindow (
194 const css::uno::Reference<css::awt::XWindow>& rxParentWindow) const;
195 css::uno::Reference<css::rendering::XCanvas> CreateViewCanvas (
196 - const css::uno::Reference<css::awt::XWindow>& rxWindow,
197 - const css::uno::Reference<css::drawing::framework::XPane>& rxParentPane) const;
198 + const css::uno::Reference<css::awt::XWindow>& rxWindow) const;
200 void Resize (void);
202 diff -rup slideshow.orig/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx
203 --- slideshow.orig/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx 2008-09-09 11:41:47.000000000 +0200
204 +++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx 2008-09-09 15:04:49.000000000 +0200
205 @@ -539,6 +539,11 @@ bool OGLTransitionerImpl::initWindowFrom
206 if( !createWindow( reinterpret_cast< Window* >( aVal ) ) )
207 return false;
209 + awt::Rectangle aCanvasArea = xView->getCanvasArea();
210 + pWindow->SetPosSizePixel(aCanvasArea.X, aCanvasArea.Y, aCanvasArea.Width, aCanvasArea.Height);
211 + GLWin.Width = aCanvasArea.Width;
212 + GLWin.Height = aCanvasArea.Height;
214 #if defined( WNT )
215 GLWin.hDC = GetDC(GLWin.hWnd);
216 #elif defined( UNX )