[Libreoffice-commits] .: Branch 'feature/rb7' - vcl/inc vcl/Library_vcl.mk vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 1 05:11:54 PDT 2012


 vcl/Library_vcl.mk         |    1 
 vcl/inc/vcl/metaact.hxx    |   39 +++++++++++++++++++++
 vcl/inc/vcl/outdev.hxx     |    4 ++
 vcl/source/gdi/metaact.cxx |   81 +++++++++++++++++++++++++++++++++++++++++++++
 vcl/source/gdi/outdev6.cxx |   24 +++++++++++++
 5 files changed, 149 insertions(+)

New commits:
commit d13d231730d895156e83ee626122ffacf79ec3ae
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu Nov 1 13:11:21 2012 +0100

    Fix vcl build with svgread.cxx file
    
    Change-Id: I74252483d6423c581901a00372c5ef0578fa515f

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 8178683..51e4c3a 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -226,6 +226,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/gdi/salmisc \
     vcl/source/gdi/salnativewidgets-none \
     vcl/source/gdi/svgdata \
+    vcl/source/gdi/svgread \
     vcl/source/gdi/temporaryfonts \
     vcl/source/gdi/textlayout \
     vcl/source/gdi/virdev \
diff --git a/vcl/inc/vcl/metaact.hxx b/vcl/inc/vcl/metaact.hxx
index e52d184..ae9d343 100644
--- a/vcl/inc/vcl/metaact.hxx
+++ b/vcl/inc/vcl/metaact.hxx
@@ -34,6 +34,7 @@
 #include <vcl/gdimtf.hxx>
 #include <vcl/gfxlink.hxx>
 #include <vcl/lineinfo.hxx>
+#include <vcl/rendergraphic.hxx>
 
 class SvStream;
 
@@ -94,6 +95,7 @@ class SvStream;
 #define META_LAYOUTMODE_ACTION              (149)
 #define META_TEXTLANGUAGE_ACTION            (150)
 #define META_OVERLINECOLOR_ACTION           (151)
+#define META_RENDERGRAPHIC_ACTION           (152)
 
 #define META_COMMENT_ACTION                 (512)
 
@@ -1540,6 +1542,43 @@ public:
     LanguageType        GetTextLanguage() const { return meTextLanguage; }
 };
 
+// ---------------------------
+// - MetaRenderGraphicAction -
+// ---------------------------
+
+class VCL_DLLPUBLIC MetaRenderGraphicAction : public MetaAction
+{
+private:
+
+    ::vcl::RenderGraphic        maRenderGraphic;
+    Point                       maPoint;
+    Size                        maSize;
+    double                      mfRotateAngle;
+    double                      mfShearAngleX;
+    double                      mfShearAngleY;
+
+    virtual sal_Bool            Compare( const MetaAction& ) const;
+
+public:
+                                DECL_META_ACTION( RenderGraphic, META_RENDERGRAPHIC_ACTION )
+
+                                MetaRenderGraphicAction( const Point& rPoint, const Size& rSize,
+                                                         const vcl::RenderGraphic& rRenderData,
+                                                         double fRotateAngle = 0.0,
+                                                         double fShearAngleX = 0.0,
+                                                         double fShearAngleY = 0.0 );
+
+    virtual void                Move( long nHorzMove, long nVertMove );
+    virtual void                Scale( double fScaleX, double fScaleY );
+
+    const ::vcl::RenderGraphic& GetRenderGraphic() const { return maRenderGraphic; }
+    const Point&                GetPoint() const { return maPoint; }
+    const Size&                 GetSize() const { return maSize; }
+    double                      GetRotateAngle() const { return mfRotateAngle; }
+    double                      GetShearAngleX() const { return mfShearAngleX; }
+    double                      GetShearAngleY() const { return mfShearAngleY; }
+};
+
 #endif // _SV_METAACT_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 90bfd06..df9840a 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -28,6 +28,7 @@
 #include <tools/color.hxx>
 #include <vcl/font.hxx>
 #include <vcl/region.hxx>
+#include <vcl/rendergraphic.hxx>
 #include <vcl/mapmod.hxx>
 #include <vcl/wall.hxx>
 #include <vcl/settings.hxx>
@@ -798,6 +799,9 @@ public:
     bool                DrawEPS( const Point& rPt, const Size& rSz,
                                  const GfxLink& rGfxLink, GDIMetaFile* pSubst = NULL );
 
+    void                DrawRenderGraphic( const Point& rPt, const Size& rSz,
+                                           const ::vcl::RenderGraphic& rRenderGraphic );
+
     Color               GetPixel( const Point& rPt ) const;
 
     Bitmap              GetBitmap( const Point& rSrcPt, const Size& rSize ) const;
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index b1bc2bc..58e528d 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -212,6 +212,7 @@ MetaAction* MetaAction::ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData
         case( META_COMMENT_ACTION ): pAction = new MetaCommentAction; break;
         case( META_LAYOUTMODE_ACTION ): pAction = new MetaLayoutModeAction; break;
         case( META_TEXTLANGUAGE_ACTION ): pAction = new MetaTextLanguageAction; break;
+        case( META_RENDERGRAPHIC_ACTION ): pAction = new MetaRenderGraphicAction; break;
 
         default:
         {
@@ -4258,4 +4259,84 @@ void MetaTextLanguageAction::Read( SvStream& rIStm, ImplMetaReadData* )
     rIStm >> meTextLanguage;
 }
 
+// ========================================================================
+
+IMPL_META_ACTION( RenderGraphic, META_RENDERGRAPHIC_ACTION )
+
+// ------------------------------------------------------------------------
+
+MetaRenderGraphicAction::MetaRenderGraphicAction( const Point& rPoint, const Size& rSize,
+                                                  const vcl::RenderGraphic& rRenderGraphic,
+                                                  double fRotateAngle, double fShearAngleX, double fShearAngleY ) :
+    MetaAction( META_RENDERGRAPHIC_ACTION ),
+    maRenderGraphic( rRenderGraphic ),
+    maPoint( rPoint ),
+    maSize( rSize ),
+    mfRotateAngle( fRotateAngle ),
+    mfShearAngleX( fShearAngleX ),
+    mfShearAngleY( fShearAngleY )
+{
+}
+
+// ------------------------------------------------------------------------
+
+void MetaRenderGraphicAction::Execute( OutputDevice* pOut )
+{
+    pOut->DrawRenderGraphic( maPoint, maSize, maRenderGraphic );
+}
+
+// ------------------------------------------------------------------------
+
+MetaAction* MetaRenderGraphicAction::Clone()
+{
+    MetaAction* pClone = (MetaAction*) new MetaRenderGraphicAction( *this );
+    pClone->ResetRefCount();
+    return pClone;
+}
+
+// ------------------------------------------------------------------------
+
+void MetaRenderGraphicAction::Move( long nHorzMove, long nVertMove )
+{
+    maPoint.Move( nHorzMove, nVertMove );
+}
+
+// ------------------------------------------------------------------------
+
+void MetaRenderGraphicAction::Scale( double fScaleX, double fScaleY )
+{
+    Rectangle aRectangle( maPoint, maSize );
+    ImplScaleRect( aRectangle, fScaleX, fScaleY );
+    maPoint = aRectangle.TopLeft();
+    maSize = aRectangle.GetSize();
+}
+
+// ------------------------------------------------------------------------
+
+sal_Bool MetaRenderGraphicAction::Compare( const MetaAction& rMetaAction ) const
+{
+    return ( maRenderGraphic.IsEqual( ( (MetaRenderGraphicAction&) rMetaAction).maRenderGraphic ) &&
+           ( maPoint == ( (MetaRenderGraphicAction&) rMetaAction).maPoint ) &&
+           ( maSize == ( (MetaRenderGraphicAction&) rMetaAction).maSize ) &&
+           ( mfRotateAngle == ( (MetaRenderGraphicAction&) rMetaAction).mfRotateAngle ) &&
+           ( mfShearAngleX == ( (MetaRenderGraphicAction&) rMetaAction).mfShearAngleX ) &&
+           ( mfShearAngleY == ( (MetaRenderGraphicAction&) rMetaAction).mfShearAngleY ) );
+}
+
+// ------------------------------------------------------------------------
+
+void MetaRenderGraphicAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
+{
+    WRITE_BASE_COMPAT( rOStm, 1, pData );
+    rOStm << maRenderGraphic << maPoint << maSize << mfRotateAngle << mfShearAngleX << mfShearAngleY;
+}
+
+// ------------------------------------------------------------------------
+
+void MetaRenderGraphicAction::Read( SvStream& rIStm, ImplMetaReadData* )
+{
+    COMPAT( rIStm );
+    rIStm >> maRenderGraphic >> maPoint >> maSize >> mfRotateAngle >> mfShearAngleX >> mfShearAngleY;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index 5efd7b6..745f0bf 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -26,6 +26,7 @@
 #include <vcl/svapp.hxx>
 #include <vcl/wrkwin.hxx>
 #include <vcl/graph.hxx>
+#include <vcl/rendergraphicrasterizer.hxx>
 
 #include <wall2.hxx>
 #include <salgdi.hxx>
@@ -1206,4 +1207,27 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
     return bDrawn;
 }
 
+// ------------------------------------------------------------------
+
+void OutputDevice::DrawRenderGraphic( const Point& rPoint, const Size& rSize,
+                                      const ::vcl::RenderGraphic& rRenderGraphic )
+{
+    OSL_TRACE( "OutputDevice::DrawRenderGraphic()" );
+
+    if( mpMetaFile )
+        mpMetaFile->AddAction( new MetaRenderGraphicAction( rPoint, rSize, rRenderGraphic ) );
+
+    if( !rRenderGraphic.IsEmpty() )
+    {
+        ::vcl::RenderGraphicRasterizer  aRasterizer( rRenderGraphic );
+        BitmapEx                        aBmpEx;
+        const Size                      aSizePixel( LogicToPixel( rSize ) );
+        GDIMetaFile*                    pOldMetaFile = mpMetaFile;
+
+        mpMetaFile = NULL;
+        DrawBitmapEx( rPoint, rSize, aRasterizer.Rasterize( aSizePixel ) );
+        mpMetaFile = pOldMetaFile;
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list