drawinglayer/Library_drawinglayer.mk | 1 offapi/com/sun/star/rendering/XCanvas.idl | 13 +++++++--- postprocess/Rdb_services.mk | 1 sd/CppunitTest_sd_uimpress.mk | 1 sd/Library_sd.mk | 1 sd/Library_sdui.mk | 1 sd/source/ui/framework/factories/Pane.cxx | 16 +++--------- sd/source/ui/presenter/PresenterCanvas.cxx | 9 ++++++- sd/source/ui/presenter/PresenterCanvas.hxx | 5 +++ sd/source/ui/presenter/PresenterHelper.cxx | 18 +++----------- sd/source/ui/presenter/PresenterPreviewCache.cxx | 12 +++------ sd/source/ui/presenter/PresenterTextView.cxx | 22 +++++++---------- sd/source/ui/presenter/SlideRenderer.cxx | 13 +++------- sd/source/ui/slideshow/slideshowviewimpl.cxx | 29 ++++------------------- sd/source/ui/slideshow/slideshowviewimpl.hxx | 2 - 15 files changed, 56 insertions(+), 88 deletions(-)
New commits: commit 8457fe70c5706508f54663567231715f6e32d1c3 Author: Thorsten Behrens <tbehr...@suse.com> Date: Fri Oct 11 16:22:44 2013 +0200 Kill remaining linker usages of cppcanvas. Change-Id: I6b3a2de5a923abe4a49ac2bfd7610e16066d27e9 diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk index 2308200..2a72025 100644 --- a/drawinglayer/Library_drawinglayer.mk +++ b/drawinglayer/Library_drawinglayer.mk @@ -28,7 +28,6 @@ $(eval $(call gb_Library_use_libraries,drawinglayer,\ basegfx \ canvastools \ comphelper \ - cppcanvas \ cppu \ cppuhelper \ i18nlangtag \ diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk index 98bff53..aa36517 100644 --- a/postprocess/Rdb_services.mk +++ b/postprocess/Rdb_services.mk @@ -19,7 +19,6 @@ $(eval $(call gb_Rdb_add_components,services,\ canvas/source/vcl/vclcanvas \ comphelper/util/comphelp \ configmgr/source/configmgr \ - cppcanvas/source/uno/mtfrenderer \ cui/util/cui \ desktop/source/deployment/deployment \ drawinglayer/drawinglayer \ commit 97b912b1452d867cd0cf0d8b061508bc6f809608 Author: Thorsten Behrens <tbehr...@suse.com> Date: Fri Oct 11 16:19:47 2013 +0200 Cleanse sd of cppcanvas helper use. In preparation of killing that very module. Change-Id: I728e585a972eecdfb51050492b0962a140afa3ec diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk index f232a91..6c8497b 100644 --- a/sd/CppunitTest_sd_uimpress.mk +++ b/sd/CppunitTest_sd_uimpress.mk @@ -26,7 +26,6 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\ basegfx \ canvastools \ comphelper \ - cppcanvas \ cppu \ cppuhelper \ drawinglayer \ diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index be29e38..007d657 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -72,7 +72,6 @@ $(eval $(call gb_Library_use_libraries,sd,\ basegfx \ canvastools \ comphelper \ - cppcanvas \ cppu \ cppuhelper \ drawinglayer \ diff --git a/sd/Library_sdui.mk b/sd/Library_sdui.mk index 8eb3145..f25a1c4 100644 --- a/sd/Library_sdui.mk +++ b/sd/Library_sdui.mk @@ -39,7 +39,6 @@ $(eval $(call gb_Library_use_sdk_api,sdui)) $(eval $(call gb_Library_use_libraries,sdui,\ basegfx \ comphelper \ - cppcanvas \ cppu \ cppuhelper \ editeng \ diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx index 30bcaa0..44077be 100644 --- a/sd/source/ui/framework/factories/Pane.cxx +++ b/sd/source/ui/framework/factories/Pane.cxx @@ -24,9 +24,11 @@ #include <osl/mutex.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/window.hxx> -#include <cppcanvas/vclfactory.hxx> #include <comphelper/servicehelper.hxx> +#include <com/sun/star/rendering/XCanvas.hpp> +#include <com/sun/star/rendering/XSpriteCanvas.hpp> + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; @@ -226,17 +228,7 @@ sal_Int64 SAL_CALL Pane::getSomething (const Sequence<sal_Int8>& rId) Reference<rendering::XCanvas> Pane::CreateCanvas (void) throw (RuntimeException) { - Reference<rendering::XCanvas> xCanvas; - - if (mpWindow != NULL) - { - ::cppcanvas::SpriteCanvasSharedPtr pCanvas ( - ::cppcanvas::VCLFactory::getInstance().createSpriteCanvas(*mpWindow)); - if (pCanvas.get() != NULL) - xCanvas = Reference<rendering::XCanvas>(pCanvas->getUNOSpriteCanvas(), UNO_QUERY); - } - - return xCanvas; + return mpWindow->GetSpriteCanvas(); } diff --git a/sd/source/ui/presenter/PresenterCanvas.cxx b/sd/source/ui/presenter/PresenterCanvas.cxx index 415c339..8d5f355 100644 --- a/sd/source/ui/presenter/PresenterCanvas.cxx +++ b/sd/source/ui/presenter/PresenterCanvas.cxx @@ -264,7 +264,7 @@ void SAL_CALL PresenterCanvas::initialize ( //----- XCanvas --------------------------------------------------------------- -void SAL_CALL PresenterCanvas::clear (void) +void SAL_CALL PresenterCanvas::erase (void) throw (css::uno::RuntimeException) { ThrowIfDisposed(); @@ -273,6 +273,13 @@ void SAL_CALL PresenterCanvas::clear (void) } +void SAL_CALL PresenterCanvas::clear (const css::uno::Sequence<double>&) + throw (css::uno::RuntimeException) +{ + ThrowIfDisposed(); + // ToDo: Clear the area covered by the child window. A simple forward + // would clear the whole shared canvas. +} void SAL_CALL PresenterCanvas::drawPoint ( diff --git a/sd/source/ui/presenter/PresenterCanvas.hxx b/sd/source/ui/presenter/PresenterCanvas.hxx index 46d637e..c1084cf 100644 --- a/sd/source/ui/presenter/PresenterCanvas.hxx +++ b/sd/source/ui/presenter/PresenterCanvas.hxx @@ -151,7 +151,10 @@ public: // XCanvas - virtual void SAL_CALL clear (void) + virtual void SAL_CALL erase (void) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL clear (const css::uno::Sequence<double>& rColor) throw (css::uno::RuntimeException); virtual void SAL_CALL drawPoint ( diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx index d1180cc..8b1d0d5 100644 --- a/sd/source/ui/presenter/PresenterHelper.cxx +++ b/sd/source/ui/presenter/PresenterHelper.cxx @@ -24,7 +24,6 @@ #include "PresenterHelper.hxx" #include "CanvasUpdateRequester.hxx" #include "PresenterCanvas.hxx" -#include <cppcanvas/vclfactory.hxx> #include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/awt/WindowClass.hpp> #include <com/sun/star/awt/WindowDescriptor.hpp> @@ -32,6 +31,7 @@ #include <vcl/svapp.hxx> #include <vcl/window.hxx> #include <vcl/wrkwin.hxx> +#include <vcl/canvastools.hxx> #include "res_bmp.hrc" #include "sdresid.hxx" @@ -450,18 +450,10 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap ( ::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex()); - const cppcanvas::CanvasSharedPtr pCanvas ( - cppcanvas::VCLFactory::getInstance().createCanvas( - Reference<css::rendering::XBitmapCanvas>(rxCanvas,UNO_QUERY))); - - if (pCanvas.get()!=NULL) - { - BitmapEx aBitmapEx = SdResId(nid); - return cppcanvas::VCLFactory::getInstance().createBitmap( - pCanvas, aBitmapEx)->getUNOBitmap(); - } - - return NULL; + BitmapEx aBitmapEx = SdResId(nid); + return ::vcl::unotools::xBitmapFromBitmapEx( + rxCanvas->getDevice(), + aBitmapEx); } diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx b/sd/source/ui/presenter/PresenterPreviewCache.cxx index 4810151..78650ae 100644 --- a/sd/source/ui/presenter/PresenterPreviewCache.cxx +++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx @@ -23,9 +23,9 @@ #include "cache/SlsCacheContext.hxx" #include "tools/IdleDetection.hxx" #include "sdpage.hxx" -#include <cppcanvas/vclfactory.hxx> #include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/rendering/XBitmapCanvas.hpp> +#include <vcl/canvastools.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -189,10 +189,6 @@ Reference<rendering::XBitmap> SAL_CALL PresenterPreviewCache::getSlidePreview ( ThrowIfDisposed(); OSL_ASSERT(mpCacheContext.get()!=NULL); - cppcanvas::BitmapCanvasSharedPtr pCanvas ( - cppcanvas::VCLFactory::getInstance().createCanvas( - Reference<rendering::XBitmapCanvas>(rxCanvas, UNO_QUERY))); - const SdrPage* pPage = mpCacheContext->GetPage(nSlideIndex); if (pPage == NULL) throw RuntimeException(); @@ -201,9 +197,9 @@ Reference<rendering::XBitmap> SAL_CALL PresenterPreviewCache::getSlidePreview ( if (aPreview.IsEmpty()) return NULL; else - return cppcanvas::VCLFactory::getInstance().createBitmap( - pCanvas, - aPreview)->getUNOBitmap(); + return ::vcl::unotools::xBitmapFromBitmapEx( + rxCanvas->getDevice(), + aPreview); } diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index 9498212..9857f44 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -21,7 +21,6 @@ #include "PresenterTextView.hxx" #include <i18nlangtag/mslangid.hxx> -#include <cppcanvas/vclfactory.hxx> #include <svl/itempool.hxx> #include <svl/itemset.hxx> #include <unotools/linguprops.hxx> @@ -36,6 +35,7 @@ #include <vcl/bitmapex.hxx> #include <vcl/svapp.hxx> #include <vcl/virdev.hxx> +#include <vcl/canvastools.hxx> #include <com/sun/star/awt/FontDescriptor.hpp> #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/rendering/XSpriteCanvas.hpp> @@ -96,7 +96,7 @@ public: Implementation (void); ~Implementation (void); - void SetCanvas (const cppcanvas::CanvasSharedPtr& rCanvas); + void SetCanvas (const Reference<rendering::XCanvas>& rCanvas); void SetSize (const Size aSize); void SetBackgroundColor (const Color aColor); void SetTextColor (const Color aColor); @@ -110,7 +110,7 @@ public: private: Reference<rendering::XBitmap> mxBitmap; - cppcanvas::CanvasSharedPtr mpCanvas; + Reference<rendering::XCanvas> mxCanvas; VirtualDevice* mpOutputDevice; EditEngine* mpEditEngine; SfxItemPool* mpEditEngineItemPool; @@ -170,8 +170,7 @@ void SAL_CALL PresenterTextView::initialize (const Sequence<Any>& rArguments) Reference<rendering::XBitmapCanvas> xCanvas (rArguments[0], UNO_QUERY_THROW); if (xCanvas.is()) { - mpImplementation->SetCanvas( - cppcanvas::VCLFactory::getInstance().createCanvas(xCanvas)); + mpImplementation->SetCanvas( xCanvas ); } } catch (RuntimeException&) @@ -299,7 +298,7 @@ PresenterTextView::Implementation::Implementation (void) msTopRelativePropertyName("RelativeTop"), msTotalHeightPropertyName("TotalHeight"), mxBitmap(), - mpCanvas(), + mxCanvas(), mpOutputDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0)), mpEditEngine(NULL), mpEditEngineItemPool(EditEngine::CreatePool()), @@ -413,9 +412,9 @@ EditEngine* PresenterTextView::Implementation::CreateEditEngine (void) -void PresenterTextView::Implementation::SetCanvas (const cppcanvas::CanvasSharedPtr& rpCanvas) +void PresenterTextView::Implementation::SetCanvas (const Reference<rendering::XCanvas>& rCanvas) { - mpCanvas = rpCanvas; + mxCanvas = rCanvas; mxBitmap = NULL; } @@ -580,10 +579,9 @@ Reference<rendering::XBitmap> PresenterTextView::Implementation::GetBitmap (void mpEditEngine->Draw(mpOutputDevice, aWindowBox, Point(0,mnTop)); const BitmapEx aBitmap (mpOutputDevice->GetBitmapEx(Point(0,0), maSize)); - mxBitmap = cppcanvas::VCLFactory::getInstance().createBitmap( - mpCanvas, - aBitmap - )->getUNOBitmap(); + mxBitmap = ::vcl::unotools::xBitmapFromBitmapEx( + mxCanvas->getDevice(), + aBitmap); } return mxBitmap; } diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx index 9cdfcf8..a708aaa 100644 --- a/sd/source/ui/presenter/SlideRenderer.cxx +++ b/sd/source/ui/presenter/SlideRenderer.cxx @@ -24,7 +24,7 @@ #include <com/sun/star/rendering/XBitmapCanvas.hpp> #include <osl/mutex.hxx> #include <vcl/svapp.hxx> -#include <cppcanvas/vclfactory.hxx> +#include <vcl/canvastools.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -131,14 +131,9 @@ Reference<rendering::XBitmap> SlideRenderer::createPreviewForCanvas ( ThrowIfDisposed(); SolarMutexGuard aGuard; - cppcanvas::BitmapCanvasSharedPtr pCanvas (cppcanvas::VCLFactory::getInstance().createCanvas( - Reference<rendering::XBitmapCanvas>(rxCanvas, UNO_QUERY))); - if (pCanvas.get() != NULL) - return cppcanvas::VCLFactory::getInstance().createBitmap( - pCanvas, - CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor))->getUNOBitmap(); - else - return NULL; + return ::vcl::unotools::xBitmapFromBitmapEx( + rxCanvas->getDevice(), + CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor)); } diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index 45c9b2b..1cbffa5 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -27,9 +27,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> - -#include <cppcanvas/vclfactory.hxx> -#include <cppcanvas/basegfxfactory.hxx> +#include <vcl/canvastools.hxx> using ::com::sun::star::uno::UNO_QUERY; @@ -200,7 +198,7 @@ SlideShowView::SlideShowView( ShowWindow& rOutputWindow, SlideshowImpl* pSlideShow, bool bFullScreen ) : SlideShowView_Base( m_aMutex ), - mpCanvas( ::cppcanvas::VCLFactory::getInstance().createSpriteCanvas( rOutputWindow ) ), + mxSpriteCanvas( rOutputWindow.GetSpriteCanvas() ), mxWindow( VCLUnoHelper::GetInterface( &rOutputWindow ), uno::UNO_QUERY_THROW ), mxWindowPeer( mxWindow, uno::UNO_QUERY_THROW ), mxPointer(), @@ -240,7 +238,7 @@ void SAL_CALL SlideShowView::dispose() throw (RuntimeException) mxWindow->removeMouseMotionListener( this ); } - mpCanvas.reset(); + mxSpriteCanvas.clear(); mxWindow.clear(); // clear all listener containers @@ -304,7 +302,7 @@ Reference< rendering::XSpriteCanvas > SAL_CALL SlideShowView::getCanvas( ) thro { ::osl::MutexGuard aGuard( m_aMutex ); - return mpCanvas.get() ? mpCanvas->getUNOSpriteCanvas() : Reference< rendering::XSpriteCanvas >(); + return mxSpriteCanvas; } void SAL_CALL SlideShowView::clear() throw (::com::sun::star::uno::RuntimeException) @@ -313,23 +311,8 @@ void SAL_CALL SlideShowView::clear() throw (::com::sun::star::uno::RuntimeExcept ::osl::MutexGuard aGuard( m_aMutex ); SolarMutexGuard aSolarGuard; - // fill the bounds rectangle in black - // ---------------------------------- - - const Size aWindowSize( mrOutputWindow.GetSizePixel() ); - - ::basegfx::B2DPolygon aPoly( ::basegfx::tools::createPolygonFromRect( - ::basegfx::B2DRectangle(0.0,0.0, - aWindowSize.Width(), - aWindowSize.Height() ) ) ); - ::cppcanvas::PolyPolygonSharedPtr pPolyPoly( - ::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( mpCanvas, aPoly ) ); - - if( pPolyPoly.get() ) - { - pPolyPoly->setRGBAFillColor( 0x000000FFU ); - pPolyPoly->draw(); - } + // fill the whole slideshow window in black + mxSpriteCanvas->clear( vcl::unotools::colorToStdColorSpaceSequence( Color(0x000000FFU) )); } geometry::IntegerSize2D SAL_CALL SlideShowView::getTranslationOffset( ) throw (RuntimeException) diff --git a/sd/source/ui/slideshow/slideshowviewimpl.hxx b/sd/source/ui/slideshow/slideshowviewimpl.hxx index 704d53c..f710435 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.hxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.hxx @@ -249,7 +249,7 @@ private: void updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImpl* pSlideShow ); - ::cppcanvas::SpriteCanvasSharedPtr mpCanvas; + ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > mxSpriteCanvas; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > mxWindow; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > mxWindowPeer; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPointer > mxPointer; commit b03b9e3e9be255665aeface7114723d20477bf06 Author: Thorsten Behrens <tbehr...@suse.com> Date: Fri Oct 11 16:19:15 2013 +0200 WIP - needs implementation in XCanvas! - the erase/clear function Change-Id: Ibbfaf758613bec97851a63a2683b8bd91b7212b8 diff --git a/offapi/com/sun/star/rendering/XCanvas.idl b/offapi/com/sun/star/rendering/XCanvas.idl index 28e2a8f..5a97339 100644 --- a/offapi/com/sun/star/rendering/XCanvas.idl +++ b/offapi/com/sun/star/rendering/XCanvas.idl @@ -112,13 +112,20 @@ interface XTextLayout; */ interface XCanvas : ::com::sun::star::uno::XInterface { - /** Clear the whole canvas area.<p> + /** Erase the whole canvas area.<p> This method clears the whole canvas area to the device default - color (e.g. white for a printer, transparent for an + content (e.g. white for a printer, transparent for an XCustomSprite). */ - void clear(); + void erase(); + + /** Clears the whole canvas area to given color.<p> + + This method fills the whole canvas area with the given device + color. + */ + void clear( [in] sequence<ColorComponent> aColor ); /** Draw a point in device resolution on the device. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits