[Libreoffice-commits] .: cppcanvas/inc cppcanvas/source

August Sodora augsod at kemper.freedesktop.org
Mon Dec 19 20:20:57 PST 2011


 cppcanvas/inc/cppcanvas/vclfactory.hxx  |   35 ----
 cppcanvas/source/wrapper/vclfactory.cxx |  237 --------------------------------
 2 files changed, 272 deletions(-)

New commits:
commit d498a3c2a12e03810a81937c1252dc0b16747936
Author: August Sodora <augsod at gmail.com>
Date:   Mon Dec 19 23:19:45 2011 -0500

    callcatcher: Remove unused code

diff --git a/cppcanvas/inc/cppcanvas/vclfactory.hxx b/cppcanvas/inc/cppcanvas/vclfactory.hxx
index 14d9e6c..ab84534 100644
--- a/cppcanvas/inc/cppcanvas/vclfactory.hxx
+++ b/cppcanvas/inc/cppcanvas/vclfactory.hxx
@@ -77,44 +77,17 @@ namespace cppcanvas
     public:
         static VCLFactory& getInstance();
 
-        BitmapCanvasSharedPtr   createCanvas( const ::Window& rVCLWindow );
         BitmapCanvasSharedPtr   createCanvas( const ::com::sun::star::uno::Reference<
                                                           ::com::sun::star::rendering::XBitmapCanvas >& xCanvas );
 
         SpriteCanvasSharedPtr   createSpriteCanvas( const ::Window& rVCLWindow ) const;
         SpriteCanvasSharedPtr   createSpriteCanvas( const ::com::sun::star::uno::Reference<
                                                                ::com::sun::star::rendering::XSpriteCanvas >& xCanvas ) const;
-        SpriteCanvasSharedPtr   createFullscreenSpriteCanvas( const ::Window& rVCLWindow, const Size& rFullscreenSize ) const;
-
-        /** Create a polygon from a tools::Polygon
-
-            The created polygon initially has the same size in user
-            coordinate space as the source polygon
-         */
-        PolyPolygonSharedPtr    createPolyPolygon( const CanvasSharedPtr&, const ::Polygon& rPoly ) const;
-        PolyPolygonSharedPtr    createPolyPolygon( const CanvasSharedPtr&, const ::PolyPolygon& rPoly ) const;
-
-        /** Create an uninitialized bitmap with the given size
-         */
-        BitmapSharedPtr         createBitmap( const CanvasSharedPtr&, const ::Size& rSize ) const;
-
-        /** Create an uninitialized alpha bitmap with the given size
-         */
-        BitmapSharedPtr         createAlphaBitmap( const CanvasSharedPtr&, const ::Size& rSize ) const;
 
         /** Create a bitmap from a VCL Bitmap
          */
-        BitmapSharedPtr         createBitmap( const CanvasSharedPtr&, const ::Bitmap& rBitmap ) const;
         BitmapSharedPtr         createBitmap( const CanvasSharedPtr&, const ::BitmapEx& rBmpEx ) const;
 
-        /** Create a renderer object from a Graphic
-
-            The created renderer initially draws the graphic
-            one-by-one units large, in user coordinate space
-         */
-        RendererSharedPtr       createRenderer( const CanvasSharedPtr&          rCanvas,
-                                                const ::Graphic&                rGraphic,
-                                                const Renderer::Parameters&     rParms ) const;
         /** Create a renderer object from a Metafile
 
             The created renderer initially draws the metafile
@@ -124,14 +97,6 @@ namespace cppcanvas
                                                 const ::GDIMetaFile&            rMtf,
                                                 const Renderer::Parameters&     rParms ) const;
 
-        /** Create an animated sprite from a VCL animation
-         */
-        SpriteSharedPtr         createAnimatedSprite( const SpriteCanvasSharedPtr&, const ::Animation& rAnim ) const;
-
-        /** Create a text portion with the given content string
-         */
-        TextSharedPtr           createText( const CanvasSharedPtr&, const ::rtl::OUString& ) const;
-
     private:
         friend struct InitInstance;
 
diff --git a/cppcanvas/source/wrapper/vclfactory.cxx b/cppcanvas/source/wrapper/vclfactory.cxx
index a66ab33..0513969 100644
--- a/cppcanvas/source/wrapper/vclfactory.cxx
+++ b/cppcanvas/source/wrapper/vclfactory.cxx
@@ -45,7 +45,6 @@
 #include <impltext.hxx>
 #include <implsprite.hxx>
 
-
 using namespace ::com::sun::star;
 
 namespace cppcanvas
@@ -74,15 +73,6 @@ namespace cppcanvas
     {
     }
 
-    BitmapCanvasSharedPtr VCLFactory::createCanvas( const ::Window& rVCLWindow )
-    {
-        return BitmapCanvasSharedPtr(
-            new internal::ImplBitmapCanvas(
-                uno::Reference< rendering::XBitmapCanvas >(
-                    rVCLWindow.GetCanvas(),
-                    uno::UNO_QUERY) ) );
-    }
-
     BitmapCanvasSharedPtr VCLFactory::createCanvas( const uno::Reference< rendering::XBitmapCanvas >& xCanvas )
     {
         return BitmapCanvasSharedPtr(
@@ -104,118 +94,6 @@ namespace cppcanvas
             new internal::ImplSpriteCanvas( xCanvas ) );
     }
 
-    SpriteCanvasSharedPtr VCLFactory::createFullscreenSpriteCanvas( const ::Window& rVCLWindow,
-                                                                    const Size&     rFullscreenSize ) const
-    {
-        return SpriteCanvasSharedPtr(
-            new internal::ImplSpriteCanvas(
-                uno::Reference< rendering::XSpriteCanvas >(
-                    rVCLWindow.GetFullscreenSpriteCanvas( rFullscreenSize ),
-                    uno::UNO_QUERY) ) );
-    }
-
-    PolyPolygonSharedPtr VCLFactory::createPolyPolygon( const CanvasSharedPtr&  rCanvas,
-                                                        const ::Polygon&        rPoly ) const
-    {
-        OSL_ENSURE( rCanvas.get() != NULL &&
-                    rCanvas->getUNOCanvas().is(),
-                    "VCLFactory::createPolyPolygon(): Invalid canvas" );
-
-        if( rCanvas.get() == NULL )
-            return PolyPolygonSharedPtr();
-
-        uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
-        if( !xCanvas.is() )
-            return PolyPolygonSharedPtr();
-
-        return PolyPolygonSharedPtr(
-            new internal::ImplPolyPolygon( rCanvas,
-                                           ::vcl::unotools::xPolyPolygonFromPolygon(
-                                               xCanvas->getDevice(),
-                                               rPoly) ) );
-    }
-
-    PolyPolygonSharedPtr VCLFactory::createPolyPolygon( const CanvasSharedPtr&  rCanvas,
-                                                        const ::PolyPolygon&    rPolyPoly ) const
-    {
-        OSL_ENSURE( rCanvas.get() != NULL &&
-                    rCanvas->getUNOCanvas().is(),
-                    "VCLFactory::createPolyPolygon(): Invalid canvas" );
-
-        if( rCanvas.get() == NULL )
-            return PolyPolygonSharedPtr();
-
-        uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
-        if( !xCanvas.is() )
-            return PolyPolygonSharedPtr();
-
-        return PolyPolygonSharedPtr(
-            new internal::ImplPolyPolygon( rCanvas,
-                                           ::vcl::unotools::xPolyPolygonFromPolyPolygon(
-                                               xCanvas->getDevice(),
-                                               rPolyPoly) ) );
-    }
-
-    BitmapSharedPtr VCLFactory::createBitmap( const CanvasSharedPtr&    rCanvas,
-                                              const ::Size&             rSize ) const
-    {
-        OSL_ENSURE( rCanvas.get() != NULL &&
-                    rCanvas->getUNOCanvas().is(),
-                    "VCLFactory::createBitmap(): Invalid canvas" );
-
-        if( rCanvas.get() == NULL )
-            return BitmapSharedPtr();
-
-        uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
-        if( !xCanvas.is() )
-            return BitmapSharedPtr();
-
-        return BitmapSharedPtr(
-            new internal::ImplBitmap( rCanvas,
-                                      xCanvas->getDevice()->createCompatibleBitmap(
-                                          ::vcl::unotools::integerSize2DFromSize(rSize) ) ) );
-    }
-
-    BitmapSharedPtr VCLFactory::createAlphaBitmap( const CanvasSharedPtr&   rCanvas,
-                                                   const ::Size&            rSize ) const
-    {
-        OSL_ENSURE( rCanvas.get() != NULL &&
-                    rCanvas->getUNOCanvas().is(),
-                    "VCLFactory::createBitmap(): Invalid canvas" );
-
-        if( rCanvas.get() == NULL )
-            return BitmapSharedPtr();
-
-        uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
-        if( !xCanvas.is() )
-            return BitmapSharedPtr();
-
-        return BitmapSharedPtr(
-            new internal::ImplBitmap( rCanvas,
-                                      xCanvas->getDevice()->createCompatibleAlphaBitmap(
-                                          ::vcl::unotools::integerSize2DFromSize(rSize) ) ) );
-    }
-
-    BitmapSharedPtr VCLFactory::createBitmap( const CanvasSharedPtr&    rCanvas,
-                                              const ::Bitmap&           rBitmap ) const
-    {
-        OSL_ENSURE( rCanvas.get() != NULL &&
-                    rCanvas->getUNOCanvas().is(),
-                    "VCLFactory::createBitmap(): Invalid canvas" );
-
-        if( rCanvas.get() == NULL )
-            return BitmapSharedPtr();
-
-        uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
-        if( !xCanvas.is() )
-            return BitmapSharedPtr();
-
-        return BitmapSharedPtr( new internal::ImplBitmap( rCanvas,
-                                                          ::vcl::unotools::xBitmapFromBitmap(
-                                                              xCanvas->getDevice(),
-                                                              rBitmap) ) );
-    }
-
     BitmapSharedPtr VCLFactory::createBitmap( const CanvasSharedPtr&    rCanvas,
                                               const ::BitmapEx&         rBmpEx ) const
     {
@@ -237,31 +115,6 @@ namespace cppcanvas
     }
 
     RendererSharedPtr VCLFactory::createRenderer( const CanvasSharedPtr&        rCanvas,
-                                                  const ::Graphic&              rGraphic,
-                                                  const Renderer::Parameters&   rParms ) const
-    {
-        OSL_ENSURE( rCanvas.get() != NULL &&
-                    rCanvas->getUNOCanvas().is(),
-                    "VCLFactory::createRenderer(): Invalid canvas" );
-
-        if( rCanvas.get() == NULL )
-            return RendererSharedPtr();
-
-        uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
-        if( !xCanvas.is() )
-            return RendererSharedPtr();
-
-        if( rGraphic.GetType() == GRAPHIC_GDIMETAFILE )
-            return RendererSharedPtr( new internal::ImplRenderer( rCanvas,
-                                                                  rGraphic.GetGDIMetaFile(),
-                                                                  rParms ) );
-        else
-            return RendererSharedPtr( new internal::ImplRenderer( rCanvas,
-                                                                  rGraphic.GetBitmapEx(),
-                                                                  rParms ) );
-    }
-
-    RendererSharedPtr VCLFactory::createRenderer( const CanvasSharedPtr&        rCanvas,
                                                   const ::GDIMetaFile&          rMtf,
                                                   const Renderer::Parameters&   rParms ) const
     {
@@ -269,96 +122,6 @@ namespace cppcanvas
                                                               rMtf,
                                                               rParms ) );
     }
-
-    SpriteSharedPtr VCLFactory::createAnimatedSprite( const SpriteCanvasSharedPtr& rCanvas, const ::Animation& rAnim ) const
-    {
-        OSL_ENSURE( rCanvas.get() != NULL &&
-                    rCanvas->getUNOCanvas().is(),
-                    "VCLFactory::createAnimatedSprite(): Invalid canvas" );
-
-        if( rCanvas.get() == NULL )
-            return SpriteSharedPtr();
-
-        uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
-        if( !xCanvas.is() )
-            return SpriteSharedPtr();
-
-        uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas( rCanvas->getUNOSpriteCanvas() );
-        if( !xSpriteCanvas.is() )
-            return SpriteSharedPtr();
-
-        if( rAnim.IsEmpty() )
-            return SpriteSharedPtr();
-
-        internal::ImplSpriteCanvas* pSpriteCanvas = dynamic_cast< internal::ImplSpriteCanvas* >( rCanvas.get() );
-        if( !pSpriteCanvas )
-            return SpriteSharedPtr();
-
-        const sal_uInt16 nBitmaps( rAnim.Count() );
-        uno::Sequence< uno::Reference< rendering::XBitmap > > aBitmapSequence( nBitmaps );
-        uno::Reference< rendering::XBitmap >* pBitmaps = aBitmapSequence.getArray();
-
-        unsigned int i;
-        BitmapEx aBmpEx;
-        BitmapEx aRestoreBuffer;
-        aBmpEx.SetSizePixel( rAnim.GetDisplaySizePixel() );
-        aRestoreBuffer.SetSizePixel( rAnim.GetDisplaySizePixel() );
-        aBmpEx.Erase( ::Color( 255, 0,0,0 ) ); // clear alpha channel
-        aRestoreBuffer = aBmpEx;
-        const Point aEmptyPoint;
-
-        for( i=0; i<nBitmaps; ++i )
-        {
-            const AnimationBitmap& rAnimBmp( rAnim.Get((sal_uInt16)i) );
-
-            // Handle dispose according to GIF spec: a
-            // DISPOSE_PREVIOUS does _not_ mean to revert to the
-            // previous frame, but to revert to the last frame with
-            // DISPOSE_NOT
-
-            // dispose previous
-            if( rAnimBmp.eDisposal == DISPOSE_BACK )
-            {
-                // simply clear bitmap to transparent
-                aBmpEx.Erase( ::Color( 255, 0,0,0 ) );
-            }
-            else if( rAnimBmp.eDisposal == DISPOSE_PREVIOUS )
-            {
-                // copy in last known full frame
-                aBmpEx = aRestoreBuffer;
-            }
-            // I have exactly _no_ idea what DISPOSE_FULL is supposed
-            // to do. It's apparently not set anywhere in our code
-            OSL_ENSURE( rAnimBmp.eDisposal!=DISPOSE_FULL,
-                        "VCLFactory::createAnimatedSprite(): Somebody set the deprecated DISPOSE_FULL at the Animation" );
-
-            // update display
-            aBmpEx.CopyPixel( Rectangle( rAnimBmp.aPosPix,
-                                         rAnimBmp.aSizePix ),
-                              Rectangle( aEmptyPoint,
-                                         rAnimBmp.aSizePix ),
-                              &rAnimBmp.aBmpEx );
-
-            // store last DISPOSE_NOT frame, for later
-            // DISPOSE_PREVIOUS updates
-            if( rAnimBmp.eDisposal == DISPOSE_NOT )
-                aRestoreBuffer = aBmpEx;
-
-            pBitmaps[i] = ::vcl::unotools::xBitmapFromBitmapEx(
-                xCanvas->getDevice(),
-                aBmpEx);
-        }
-
-        return pSpriteCanvas->createSpriteFromBitmaps( aBitmapSequence,
-                                                       rendering::InterpolationMode::NEAREST_NEIGHBOR );
-    }
-
-    TextSharedPtr VCLFactory::createText( const CanvasSharedPtr& rCanvas, const ::rtl::OUString& rText ) const
-    {
-        return TextSharedPtr( new internal::ImplText( rCanvas,
-                                                      rText ) );
-    }
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list