diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-05-08 16:39:25 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-05-08 18:34:32 +0200 |
commit | 05c141bc3ab264c8e1f4fba57c4a82fa93e91261 (patch) | |
tree | 0e5dee5d9f261b675b79aa34e32ad32b20fbd61b /slideshow | |
parent | 3a61db17545e0cee9eccaf02a3372068bb0768d4 (diff) |
DX canvas: provide a OutputDevice pointer as a device handler instead of HDC
With it all canvas can be handled on the same way.
avmedia/source/win/window.cxx: always comes a HWND
Change-Id: Id6b8e6d52b8a136143f724daf8feff5c85cf5804
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/shapes/viewmediashape.cxx | 76 | ||||
-rw-r--r-- | slideshow/source/engine/shapes/viewmediashape.hxx | 5 |
2 files changed, 3 insertions, 78 deletions
diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index 25226c1c802b..77b6443fb686 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -334,21 +334,7 @@ namespace slideshow if( ::canvas::tools::getDeviceInfo( xCanvas, aDeviceParams ).getLength() > 1 ) { - OUString aImplName; - - aDeviceParams[ 0 ] >>= aImplName; - - if( aImplName.endsWithIgnoreAsciiCase( "VCL" ) || - aImplName.endsWithIgnoreAsciiCase( "Cairo" ) || - avmedia::IsModel(sMimeType)) - { - implInitializeVCLBasedPlayerWindow( rBounds, aDeviceParams, sMimeType ); - } - else if( aImplName.endsWithIgnoreAsciiCase("DX") || - aImplName.endsWithIgnoreAsciiCase("DX9") ) - { - implInitializeDXBasedPlayerWindow( rBounds, aDeviceParams ); - } + implInitializePlayerWindow( rBounds, aDeviceParams, sMimeType ); } // set player properties @@ -444,7 +430,7 @@ namespace slideshow - bool ViewMediaShape::implInitializeVCLBasedPlayerWindow( const ::basegfx::B2DRectangle& rBounds, + bool ViewMediaShape::implInitializePlayerWindow( const ::basegfx::B2DRectangle& rBounds, const uno::Sequence< uno::Any >& rVCLDeviceParams, const OUString& rMimeType ) { @@ -536,64 +522,6 @@ namespace slideshow return mxPlayerWindow.is(); } - - - - bool ViewMediaShape::implInitializeDXBasedPlayerWindow( const ::basegfx::B2DRectangle& rBounds, - const uno::Sequence< uno::Any >& rDXDeviceParams ) - { - if( !mxPlayerWindow.is() ) - { - try - { - if( rDXDeviceParams.getLength() == 2 ) - { - sal_Int64 aWNDVal=0; - - rDXDeviceParams[ 1 ] >>= aWNDVal; - - if( aWNDVal ) - { - ::basegfx::B2DRange aTmpRange; - ::canvas::tools::calcTransformedRectBounds( aTmpRange, - rBounds, - mpViewLayer->getTransformation() ); - const ::basegfx::B2IRange& rRangePix( - ::basegfx::unotools::b2ISurroundingRangeFromB2DRange( aTmpRange )); - - if( !rRangePix.isEmpty() ) - { - uno::Sequence< uno::Any > aArgs( 2 ); - awt::Rectangle aAWTRect( rRangePix.getMinX() + maWindowOffset.X, - rRangePix.getMinY() + maWindowOffset.Y, - rRangePix.getMaxX() - rRangePix.getMinX(), - rRangePix.getMaxY() - rRangePix.getMinY() ); - - if( mxPlayer.is() ) - { - aArgs[ 0 ] = uno::makeAny( sal::static_int_cast< sal_Int32 >( aWNDVal) ); - aArgs[ 1 ] = uno::makeAny( aAWTRect ); - - mxPlayerWindow.set( mxPlayer->createPlayerWindow( aArgs ) ); - } - } - } - } - } - catch( uno::RuntimeException& ) - { - throw; - } - catch( uno::Exception& ) - { - OSL_FAIL( OUStringToOString( - comphelper::anyToString( cppu::getCaughtException() ), - RTL_TEXTENCODING_UTF8 ).getStr() ); - } - } - - return mxPlayerWindow.is(); - } } } diff --git a/slideshow/source/engine/shapes/viewmediashape.hxx b/slideshow/source/engine/shapes/viewmediashape.hxx index 4a373445aac9..609c36ef9366 100644 --- a/slideshow/source/engine/shapes/viewmediashape.hxx +++ b/slideshow/source/engine/shapes/viewmediashape.hxx @@ -141,12 +141,9 @@ namespace slideshow bool implInitialize( const ::basegfx::B2DRectangle& rBounds ); void implSetMediaProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rxProps ); void implInitializeMediaPlayer( const OUString& rMediaURL, const OUString& rMimeType ); - bool implInitializeVCLBasedPlayerWindow( const ::basegfx::B2DRectangle& rBounds, + bool implInitializePlayerWindow( const ::basegfx::B2DRectangle& rBounds, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rVCLDeviceParams, const OUString& rMimeType ); - bool implInitializeDXBasedPlayerWindow( const ::basegfx::B2DRectangle& rBounds, - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rDXDeviceParams ); - ViewLayerSharedPtr mpViewLayer; ::std::auto_ptr< SystemChildWindow > mpMediaWindow; mutable ::com::sun::star::awt::Point maWindowOffset; |