merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0373-gstreamer-slideshow.diff
blob3766ee82ae7429cda5a0514a7c39a3cb17048a19
1 --- slideshow/source/engine/shapes/viewmediashape.cxx.old 2009-04-02 10:36:30.000000000 +0000
2 +++ slideshow/source/engine/shapes/viewmediashape.cxx 2009-04-06 16:42:09.000000000 +0000
3 @@ -44,6 +44,9 @@
4 #include <vcl/window.hxx>
5 #include <vcl/javachild.hxx>
6 #include <vcl/salbtype.hxx>
7 +#ifdef GSTREAMER
8 +#include <vcl/sysdata.hxx>
9 +#endif
11 #include <basegfx/tools/canvastools.hxx>
12 #include <basegfx/numeric/ftools.hxx>
13 @@ -148,7 +151,11 @@ namespace slideshow
14 mxPlayerWindow.clear();
17 +#ifdef GSTREAMER
18 + mpMediaWindow = ::std::auto_ptr< SystemChildWindow >();
19 +#else
20 mpMediaWindow = ::std::auto_ptr< JavaChildWindow >();
21 +#endif
23 // shutdown player
24 if( mxPlayer.is() )
25 @@ -299,7 +306,8 @@ namespace slideshow
26 aDeviceParams[ 0 ] >>= aImplName;
28 if( aImplName.endsWithIgnoreAsciiCaseAsciiL(
29 - RTL_CONSTASCII_STRINGPARAM("VCL") ))
30 + RTL_CONSTASCII_STRINGPARAM("VCL") ) || aImplName.endsWithIgnoreAsciiCaseAsciiL(
31 + RTL_CONSTASCII_STRINGPARAM("Cairo") ) )
33 implInitializeVCLBasedPlayerWindow( rBounds, aDeviceParams );
35 @@ -405,6 +413,7 @@ namespace slideshow
36 bool ViewMediaShape::implInitializeVCLBasedPlayerWindow( const ::basegfx::B2DRectangle& rBounds,
37 const uno::Sequence< uno::Any >& rVCLDeviceParams)
39 + OSL_TRACE( "ViewMediaShape::implInitializeVCLBasedPlayerWindow" );
40 if( !mpMediaWindow.get() && !rBounds.isEmpty() )
42 try
43 @@ -426,28 +435,46 @@ namespace slideshow
45 if( !rRangePix.isEmpty() )
47 - uno::Sequence< uno::Any > aArgs( 2 );
48 + uno::Sequence< uno::Any > aArgs( 3 );
49 awt::Rectangle aAWTRect( rRangePix.getMinX(),
50 rRangePix.getMinY(),
51 rRangePix.getMaxX() - rRangePix.getMinX(),
52 rRangePix.getMaxY() - rRangePix.getMinY() );
54 +#ifdef GSTREAMER
55 + OSL_TRACE( "created sys child window for viewmediashape" );
56 + mpMediaWindow = ::std::auto_ptr< SystemChildWindow >( new SystemChildWindow( pWindow, WB_CLIPCHILDREN ) );
57 +#else
58 mpMediaWindow = ::std::auto_ptr< JavaChildWindow >( new JavaChildWindow( pWindow, WB_CLIPCHILDREN ) );
59 +#endif
60 mpMediaWindow->SetBackground( Color( COL_BLACK ) );
61 mpMediaWindow->SetPosSizePixel( Point( aAWTRect.X,
62 aAWTRect.Y ),
63 Size( aAWTRect.Width,
64 aAWTRect.Height ));
65 + mpMediaWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP );
66 + mpMediaWindow->EnableEraseBackground( FALSE );
67 + mpMediaWindow->EnablePaint( FALSE );
68 + mpMediaWindow->SetForwardKey( TRUE );
69 + mpMediaWindow->SetMouseTransparent( TRUE );
70 mpMediaWindow->Show();
72 if( mxPlayer.is() )
74 +#ifndef GSTREAMER
75 aArgs[ 0 ] = uno::makeAny(
76 sal::static_int_cast<sal_IntPtr>(
77 mpMediaWindow->getParentWindowHandleForJava()) );
79 +#else
80 + aArgs[ 0 ] = uno::makeAny ( (sal_Int32) 0 );
81 +#endif
82 aAWTRect.X = aAWTRect.Y = 0;
83 aArgs[ 1 ] = uno::makeAny( aAWTRect );
84 +#ifdef GSTREAMER
85 + const SystemEnvData *pSystemData = mpMediaWindow->GetSystemData();
86 + OSL_TRACE( "xwindow id: %ld", pSystemData->aWindow );
87 + aArgs[ 2 ] = uno::makeAny( pSystemData->aWindow );
88 +#endif
90 mxPlayerWindow.set( mxPlayer->createPlayerWindow( aArgs ) );
92 --- slideshow/source/engine/shapes/viewmediashape.hxx.old 2009-04-02 10:36:30.000000000 +0000
93 +++ slideshow/source/engine/shapes/viewmediashape.hxx 2009-04-06 16:42:09.000000000 +0000
94 @@ -40,6 +40,7 @@
95 #include "viewlayer.hxx"
97 class JavaChildWindow;
98 +class SystemChildWindow;
100 namespace com { namespace sun { namespace star { namespace drawing {
101 class XShape;
102 @@ -158,7 +159,11 @@ namespace slideshow
103 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rDXDeviceParams );
105 ViewLayerSharedPtr mpViewLayer;
106 +#ifdef GSTREAMER
107 + ::std::auto_ptr< SystemChildWindow > mpMediaWindow;
108 +#else
109 ::std::auto_ptr< JavaChildWindow > mpMediaWindow;
110 +#endif
111 mutable ::com::sun::star::awt::Point maWindowOffset;
112 mutable ::basegfx::B2DRectangle maBounds;