ka102: SVG import implementation
This commit is contained in:
parent
99ff7a9fb5
commit
d1da85e8f5
@ -82,6 +82,7 @@
|
||||
#include <lineaction.hxx>
|
||||
#include <pointaction.hxx>
|
||||
#include <polypolyaction.hxx>
|
||||
#include <rendergraphicaction.hxx>
|
||||
#include <textaction.hxx>
|
||||
#include <transparencygroupaction.hxx>
|
||||
#include <vector>
|
||||
@ -2646,6 +2647,32 @@ namespace cppcanvas
|
||||
}
|
||||
break;
|
||||
|
||||
case META_RENDERGRAPHIC_ACTION:
|
||||
{
|
||||
MetaRenderGraphicAction* pAct = static_cast<MetaRenderGraphicAction*>(pCurrAct);
|
||||
|
||||
ActionSharedPtr pRenderGraphicAction(
|
||||
internal::RenderGraphicActionFactory::createRenderGraphicAction(
|
||||
pAct->GetRenderGraphic(),
|
||||
getState( rStates ).mapModeTransform *
|
||||
::vcl::unotools::b2DPointFromPoint( pAct->GetPoint() ),
|
||||
getState( rStates ).mapModeTransform *
|
||||
::vcl::unotools::b2DSizeFromSize( pAct->GetSize() ),
|
||||
rCanvas,
|
||||
getState( rStates ) ) );
|
||||
|
||||
if( pRenderGraphicAction )
|
||||
{
|
||||
maActions.push_back(
|
||||
MtfAction(
|
||||
pRenderGraphicAction,
|
||||
io_rCurrActionIndex ) );
|
||||
|
||||
io_rCurrActionIndex += pRenderGraphicAction->getActionCount()-1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
OSL_ENSURE( false,
|
||||
"Unknown meta action type encountered" );
|
||||
|
@ -1,7 +1,7 @@
|
||||
#*************************************************************************
|
||||
#
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
#
|
||||
# Copyright 2000, 2010 Oracle and/or its affiliates.
|
||||
#
|
||||
# OpenOffice.org - a multi-platform office productivity suite
|
||||
@ -48,6 +48,7 @@ SLOFILES = $(SLO)$/cachedprimitivebase.obj \
|
||||
$(SLO)$/lineaction.obj \
|
||||
$(SLO)$/pointaction.obj \
|
||||
$(SLO)$/polypolyaction.obj \
|
||||
$(SLO)$/rendergraphicaction.obj \
|
||||
$(SLO)$/textaction.obj \
|
||||
$(SLO)$/transparencygroupaction.obj \
|
||||
$(SLO)$/mtftools.obj
|
||||
|
@ -391,6 +391,7 @@ namespace cppcanvas
|
||||
case META_TEXTLINE_ACTION:
|
||||
case META_TEXTRECT_ACTION:
|
||||
case META_STRETCHTEXT_ACTION:
|
||||
case META_RENDERGRAPHIC_ACTION:
|
||||
// output-generating action - only
|
||||
// copy, if we're within the
|
||||
// requested subset
|
||||
|
@ -60,7 +60,7 @@ $(eval $(call gb_SrsTarget_add_files,svt/res,\
|
||||
svtools/source/dialogs/prnsetup.src \
|
||||
svtools/source/dialogs/so3res.src \
|
||||
svtools/source/dialogs/wizardmachine.src \
|
||||
svtools/source/filter.vcl/filter/exportdialog.src \
|
||||
svtools/source/filter/exportdialog.src \
|
||||
svtools/source/java/javaerror.src \
|
||||
svtools/source/misc/ehdl.src \
|
||||
svtools/source/misc/helpagent.src \
|
||||
|
@ -177,27 +177,27 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
|
||||
svtools/source/edit/textwindowpeer \
|
||||
svtools/source/edit/txtattr \
|
||||
svtools/source/edit/xtextedt \
|
||||
svtools/source/filter.vcl/filter/FilterConfigCache \
|
||||
svtools/source/filter.vcl/filter/FilterConfigItem \
|
||||
svtools/source/filter.vcl/filter/SvFilterOptionsDialog \
|
||||
svtools/source/filter.vcl/filter/exportdialog \
|
||||
svtools/source/filter.vcl/filter/filter \
|
||||
svtools/source/filter.vcl/filter/filter2 \
|
||||
svtools/source/filter.vcl/filter/sgfbram \
|
||||
svtools/source/filter.vcl/filter/sgvmain \
|
||||
svtools/source/filter.vcl/filter/sgvspln \
|
||||
svtools/source/filter.vcl/filter/sgvtext \
|
||||
svtools/source/filter.vcl/igif/decode \
|
||||
svtools/source/filter.vcl/igif/gifread \
|
||||
svtools/source/filter.vcl/ixbm/xbmread \
|
||||
svtools/source/filter.vcl/ixpm/xpmread \
|
||||
svtools/source/filter.vcl/jpeg/jpeg \
|
||||
svtools/source/filter.vcl/wmf/emfwr \
|
||||
svtools/source/filter.vcl/wmf/enhwmf \
|
||||
svtools/source/filter.vcl/wmf/winmtf \
|
||||
svtools/source/filter.vcl/wmf/winwmf \
|
||||
svtools/source/filter.vcl/wmf/wmf \
|
||||
svtools/source/filter.vcl/wmf/wmfwr \
|
||||
svtools/source/filter/FilterConfigCache \
|
||||
svtools/source/filter/FilterConfigItem \
|
||||
svtools/source/filter/SvFilterOptionsDialog \
|
||||
svtools/source/filter/exportdialog \
|
||||
svtools/source/filter/filter \
|
||||
svtools/source/filter/filter2 \
|
||||
svtools/source/filter/sgfbram \
|
||||
svtools/source/filter/sgvmain \
|
||||
svtools/source/filter/sgvspln \
|
||||
svtools/source/filter/sgvtext \
|
||||
svtools/source/filter/igif/decode \
|
||||
svtools/source/filter/igif/gifread \
|
||||
svtools/source/filter/ixbm/xbmread \
|
||||
svtools/source/filter/ixpm/xpmread \
|
||||
svtools/source/filter/jpeg/jpeg \
|
||||
svtools/source/filter/wmf/emfwr \
|
||||
svtools/source/filter/wmf/enhwmf \
|
||||
svtools/source/filter/wmf/winmtf \
|
||||
svtools/source/filter/wmf/winwmf \
|
||||
svtools/source/filter/wmf/wmf \
|
||||
svtools/source/filter/wmf/wmfwr \
|
||||
svtools/source/graphic/descriptor \
|
||||
svtools/source/graphic/graphic \
|
||||
svtools/source/graphic/graphicunofactory \
|
||||
@ -287,7 +287,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
|
||||
))
|
||||
|
||||
$(eval $(call gb_Library_add_cobjects,svt,\
|
||||
svtools/source/filter.vcl/jpeg/jpegc \
|
||||
svtools/source/filter/jpeg/jpegc \
|
||||
))
|
||||
|
||||
ifeq ($(OS),LINUX)
|
||||
|
@ -83,6 +83,7 @@ class Graphic;
|
||||
#define IMP_JPEG "SVIJPEG"
|
||||
#define IMP_XBM "SVIXBM"
|
||||
#define IMP_XPM "SVIXPM"
|
||||
#define IMP_SVG "SVISVG"
|
||||
#define EXP_BMP "SVBMP"
|
||||
#define EXP_SVMETAFILE "SVMETAFILE"
|
||||
#define EXP_WMF "SVWMF"
|
||||
@ -101,6 +102,7 @@ class Graphic;
|
||||
#define TIF_SHORTNAME "TIF"
|
||||
#define WMF_SHORTNAME "WMF"
|
||||
#define EMF_SHORTNAME "EMF"
|
||||
#define SVG_SHORTNAME "SVG"
|
||||
|
||||
// ------------------------------------
|
||||
// - Info-Klasse fuer alle von uns
|
||||
@ -132,6 +134,7 @@ class Graphic;
|
||||
#define GFF_WMF ( (USHORT)0x00f6 )
|
||||
#define GFF_SGV ( (USHORT)0x00f7 )
|
||||
#define GFF_EMF ( (USHORT)0x00f8 )
|
||||
#define GFF_SVG ( (USHORT)0x00f9 )
|
||||
#define GFF_XXX ( (USHORT)0xffff )
|
||||
|
||||
// ---------------------
|
||||
@ -177,6 +180,7 @@ class SVT_DLLPUBLIC GraphicDescriptor
|
||||
BOOL ImpDetectWMF( SvStream& rStm, BOOL bExtendedInfo );
|
||||
BOOL ImpDetectSGV( SvStream& rStm, BOOL bExtendedInfo );
|
||||
BOOL ImpDetectEMF( SvStream& rStm, BOOL bExtendedInfo );
|
||||
BOOL ImpDetectSVG( SvStream& rStm, BOOL bExtendedInfo );
|
||||
|
||||
GraphicDescriptor( const GraphicDescriptor& );
|
||||
GraphicDescriptor& operator=( const GraphicDescriptor& );
|
||||
|
@ -213,14 +213,15 @@ private:
|
||||
ULONG mnAnimationLoopCount;
|
||||
void* mpDummy1;
|
||||
void* mpDummy2;
|
||||
BOOL mbAutoSwapped : 1;
|
||||
BOOL mbTransparent : 1;
|
||||
BOOL mbAnimated : 1;
|
||||
BOOL mbEPS : 1;
|
||||
BOOL mbIsInSwapIn : 1;
|
||||
BOOL mbIsInSwapOut : 1;
|
||||
BOOL mbAlpha : 1;
|
||||
BOOL mbDummyFlag8 : 1;
|
||||
BOOL mbAutoSwapped : 1;
|
||||
BOOL mbTransparent : 1;
|
||||
BOOL mbAnimated : 1;
|
||||
BOOL mbEPS : 1;
|
||||
BOOL mbIsInSwapIn : 1;
|
||||
BOOL mbIsInSwapOut : 1;
|
||||
BOOL mbAlpha : 1;
|
||||
BOOL mbIsRenderGraphic : 1;
|
||||
BOOL mbHasRenderGraphic : 1;
|
||||
|
||||
void SVT_DLLPRIVATE ImplConstruct();
|
||||
void SVT_DLLPRIVATE ImplAssignGraphicData();
|
||||
@ -402,6 +403,8 @@ public:
|
||||
BOOL IsAlpha() const { return mbAlpha; }
|
||||
BOOL IsAnimated() const { return mbAnimated; }
|
||||
BOOL IsEPS() const { return mbEPS; }
|
||||
BOOL IsRenderGraphic() const { return mbIsRenderGraphic; }
|
||||
BOOL HasRenderGraphic() const { return mbHasRenderGraphic; }
|
||||
|
||||
void ResetAnimationLoopCount();
|
||||
List* GetAnimationInfoList() const;
|
||||
@ -568,4 +571,3 @@ public:
|
||||
};
|
||||
|
||||
#endif // _GRFMGR_HXX
|
||||
|
||||
|
@ -169,6 +169,7 @@ void GraphicDescriptor::implCreate( SvStream& rIStm, const ::rtl::OUString* pURL
|
||||
case( GFF_WMF ): pMimeType = MIMETYPE_WMF; cType = graphic::GraphicType::VECTOR; break;
|
||||
case( GFF_SGV ): pMimeType = MIMETYPE_SGV; cType = graphic::GraphicType::VECTOR; break;
|
||||
case( GFF_EMF ): pMimeType = MIMETYPE_EMF; cType = graphic::GraphicType::VECTOR; break;
|
||||
case( GFF_SVG ): pMimeType = MIMETYPE_SVG; cType = graphic::GraphicType::VECTOR; break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -123,7 +123,7 @@ private:
|
||||
::rtl::OUString maMimeType;
|
||||
Size maSizePixel;
|
||||
Size maSize100thMM;
|
||||
USHORT mnBitsPerPixel;
|
||||
USHORT mnBitsPerPixel;
|
||||
bool mbTransparent;
|
||||
bool mbAlpha;
|
||||
bool mbAnimated;
|
||||
|
@ -190,15 +190,10 @@ void GraphicObject::ImplAssignGraphicData()
|
||||
mbTransparent = maGraphic.IsTransparent();
|
||||
mbAlpha = maGraphic.IsAlpha();
|
||||
mbAnimated = maGraphic.IsAnimated();
|
||||
mbEPS = maGraphic.IsEPS();
|
||||
mbIsRenderGraphic = maGraphic.IsRenderGraphic();
|
||||
mbHasRenderGraphic = maGraphic.HasRenderGraphic();
|
||||
mnAnimationLoopCount = ( mbAnimated ? maGraphic.GetAnimationLoopCount() : 0 );
|
||||
|
||||
if( maGraphic.GetType() == GRAPHIC_GDIMETAFILE )
|
||||
{
|
||||
const GDIMetaFile& rMtf = GetGraphic().GetGDIMetaFile();
|
||||
mbEPS = ( rMtf.GetActionCount() >= 1 ) && ( META_EPS_ACTION == rMtf.GetAction( 0 )->GetType() );
|
||||
}
|
||||
else
|
||||
mbEPS = FALSE;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -447,7 +442,7 @@ void GraphicObject::Assign( const SvDataCopyStream& rCopyStream )
|
||||
|
||||
ByteString GraphicObject::GetUniqueID() const
|
||||
{
|
||||
if ( !IsInSwapIn() && IsEPS() )
|
||||
if ( !IsInSwapIn() && ( IsEPS() || IsRenderGraphic() ) )
|
||||
const_cast<GraphicObject*>(this)->FireSwapInRequest();
|
||||
|
||||
ByteString aRet;
|
||||
@ -1379,4 +1374,3 @@ GraphicObject GraphicObject::CreateGraphicObjectFromURL( const ::rtl::OUString &
|
||||
return GraphicObject( aGraphic );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -869,6 +869,8 @@ BOOL GraphicManager::ImplCreateOutput( OutputDevice* pOut,
|
||||
// FALLTHROUGH intended
|
||||
case META_GRADIENTEX_ACTION:
|
||||
// FALLTHROUGH intended
|
||||
case META_RENDERGRAPHIC_ACTION:
|
||||
// FALLTHROUGH intended
|
||||
|
||||
// OutDev state changes that _do_ affect bitmap
|
||||
// output
|
||||
|
@ -68,6 +68,15 @@ class Gradient;
|
||||
#define MTF_MIRROR_HORZ 0x00000001UL
|
||||
#define MTF_MIRROR_VERT 0x00000002UL
|
||||
|
||||
// -----------------------------
|
||||
// - Write flags for streaming -
|
||||
// -----------------------------
|
||||
|
||||
#define GDIMETAFILE_WRITE_DEFAULT 0x00000000
|
||||
#define GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC 0x00000001
|
||||
|
||||
typedef sal_uInt32 GDIMetaFileWriteFlags;
|
||||
|
||||
// ---------
|
||||
// - Enums -
|
||||
// ---------
|
||||
@ -237,7 +246,7 @@ public:
|
||||
// Methoden zum Lesen und Schreiben des neuen Formats;
|
||||
// die Read-Methode kann auch das alte Format lesen
|
||||
SvStream& Read( SvStream& rIStm );
|
||||
SvStream& Write( SvStream& rOStm );
|
||||
SvStream& Write( SvStream& rOStm, GDIMetaFileWriteFlags = GDIMETAFILE_WRITE_DEFAULT );
|
||||
|
||||
// Stream-Operatoren schreiben das alte Format (noch)
|
||||
// und lesen sowohl das alte wie auch das neue Format
|
||||
@ -248,4 +257,3 @@ public:
|
||||
};
|
||||
|
||||
#endif // _SV_GDIMTF_HXX
|
||||
|
||||
|
@ -109,11 +109,12 @@ enum GfxLinkType
|
||||
GFX_LINK_TYPE_NATIVE_WMF = 6, // Don't forget to update the following defines
|
||||
GFX_LINK_TYPE_NATIVE_MET = 7, // Don't forget to update the following defines
|
||||
GFX_LINK_TYPE_NATIVE_PCT = 8, // Don't forget to update the following defines
|
||||
GFX_LINK_TYPE_NATIVE_SVG = 9, // Don't forget to update the following defines
|
||||
GFX_LINK_TYPE_USER = 0xffff
|
||||
};
|
||||
|
||||
#define GFX_LINK_FIRST_NATIVE_ID GFX_LINK_TYPE_NATIVE_GIF
|
||||
#define GFX_LINK_LAST_NATIVE_ID GFX_LINK_TYPE_NATIVE_PCT
|
||||
#define GFX_LINK_LAST_NATIVE_ID GFX_LINK_TYPE_NATIVE_SVG
|
||||
|
||||
// -----------
|
||||
// - GfxLink -
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <vcl/bitmapex.hxx>
|
||||
#include <vcl/animate.hxx>
|
||||
#include <vcl/gdimtf.hxx>
|
||||
#include <vcl/rendergraphic.hxx>
|
||||
#include <vcl/graph.h>
|
||||
#include <vcl/gfxlink.hxx>
|
||||
#include <com/sun/star/uno/Reference.hxx>
|
||||
@ -122,6 +123,9 @@ public:
|
||||
BOOL IsTransparent() const;
|
||||
BOOL IsAlpha() const;
|
||||
BOOL IsAnimated() const;
|
||||
BOOL IsEPS() const;
|
||||
BOOL IsRenderGraphic() const;
|
||||
BOOL HasRenderGraphic() const;
|
||||
|
||||
// #i102089# Access of Bitmap potentially will have to rasterconvert the Graphic
|
||||
// if it is a MetaFile. To be able to control this conversion it is necessary to
|
||||
@ -131,8 +135,9 @@ public:
|
||||
Bitmap GetBitmap(const GraphicConversionParameters& rParameters = GraphicConversionParameters()) const;
|
||||
BitmapEx GetBitmapEx(const GraphicConversionParameters& rParameters = GraphicConversionParameters()) const;
|
||||
|
||||
Animation GetAnimation() const;
|
||||
const GDIMetaFile& GetGDIMetaFile() const;
|
||||
Animation GetAnimation() const;
|
||||
const GDIMetaFile& GetGDIMetaFile() const;
|
||||
::vcl::RenderGraphic GetRenderGraphic() const;
|
||||
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > GetXGraphic() const;
|
||||
|
||||
@ -219,4 +224,3 @@ public:
|
||||
};
|
||||
|
||||
#endif // _SV_GRAPH_HXX
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <vcl/bitmapex.hxx>
|
||||
#include <vcl/animate.hxx>
|
||||
#include <vcl/gdimtf.hxx>
|
||||
#include <vcl/rendergraphic.hxx>
|
||||
#include <vcl/graph.h>
|
||||
|
||||
// ---------------
|
||||
@ -99,11 +100,16 @@ private:
|
||||
BOOL ImplIsTransparent() const;
|
||||
BOOL ImplIsAlpha() const;
|
||||
BOOL ImplIsAnimated() const;
|
||||
BOOL ImplIsEPS() const;
|
||||
BOOL ImplIsRenderGraphic() const;
|
||||
BOOL ImplHasRenderGraphic() const;
|
||||
|
||||
Bitmap ImplGetBitmap(const GraphicConversionParameters& rParameters) const;
|
||||
BitmapEx ImplGetBitmapEx(const GraphicConversionParameters& rParameters) const;
|
||||
Animation ImplGetAnimation() const;
|
||||
const GDIMetaFile& ImplGetGDIMetaFile() const;
|
||||
::vcl::RenderGraphic ImplGetRenderGraphic() const;
|
||||
|
||||
Bitmap ImplGetBitmap(const GraphicConversionParameters& rParameters) const;
|
||||
BitmapEx ImplGetBitmapEx(const GraphicConversionParameters& rParameters) const;
|
||||
Animation ImplGetAnimation() const;
|
||||
const GDIMetaFile& ImplGetGDIMetaFile() const;
|
||||
|
||||
Size ImplGetPrefSize() const;
|
||||
void ImplSetPrefSize( const Size& rPrefSize );
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <vcl/gdimtf.hxx>
|
||||
#include <vcl/gfxlink.hxx>
|
||||
#include <vcl/lineinfo.hxx>
|
||||
#include <vcl/rendergraphic.hxx>
|
||||
|
||||
class SvStream;
|
||||
|
||||
@ -102,6 +103,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)
|
||||
|
||||
@ -110,6 +112,11 @@ class SvStream;
|
||||
struct ImplMetaReadData
|
||||
{
|
||||
rtl_TextEncoding meActualCharSet;
|
||||
|
||||
ImplMetaReadData() :
|
||||
meActualCharSet( RTL_TEXTENCODING_ASCII_US )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@ -117,6 +124,13 @@ struct ImplMetaReadData
|
||||
struct ImplMetaWriteData
|
||||
{
|
||||
rtl_TextEncoding meActualCharSet;
|
||||
GDIMetaFileWriteFlags mnWriteFlags;
|
||||
|
||||
ImplMetaWriteData() :
|
||||
meActualCharSet( RTL_TEXTENCODING_ASCII_US ),
|
||||
mnWriteFlags( GDIMETAFILE_WRITE_DEFAULT )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@ -1543,4 +1557,41 @@ 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
|
||||
|
@ -108,6 +108,7 @@ namespace vcl
|
||||
class PDFWriterImpl;
|
||||
class ExtOutDevData;
|
||||
class ITextLayout;
|
||||
class RenderGraphic;
|
||||
}
|
||||
|
||||
#define OUTDEV_BUFFER_SIZE 128
|
||||
@ -809,7 +810,19 @@ public:
|
||||
|
||||
void DrawTransparent( const PolyPolygon& rPolyPoly, USHORT nTransparencePercent );
|
||||
void DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, double fTransparency);
|
||||
void DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, const Size& rSize, const Gradient& rTransparenceGradient );
|
||||
void DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, const Size& rSize,
|
||||
const Gradient& rTransparenceGradient );
|
||||
|
||||
/** Added return value to see if EPS could be painted directly.
|
||||
Theoreticaly, handing over a matrix would be needed to handle
|
||||
painting rotated EPS files (e.g. contained in Metafiles). This
|
||||
would then need to be supported for Mac and PS printers, but
|
||||
that's too much for now, wrote #i107046# for this */
|
||||
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;
|
||||
Color* GetPixel( const Polygon& rPts ) const;
|
||||
@ -1115,14 +1128,6 @@ public:
|
||||
*/
|
||||
BOOL HasAlpha();
|
||||
|
||||
/** Added return value to see if EPS could be painted directly.
|
||||
Theoreticaly, handing over a matrix would be needed to handle
|
||||
painting rotated EPS files (e.g. contained in Metafiles). This
|
||||
would then need to be supported for Mac and PS printers, but
|
||||
that's too much for now, wrote #i107046# for this */
|
||||
bool DrawEPS( const Point& rPt, const Size& rSz,
|
||||
const GfxLink& rGfxLink, GDIMetaFile* pSubst = NULL );
|
||||
|
||||
/// request XCanvas render interface for this OutputDevice
|
||||
::com::sun::star::uno::Reference<
|
||||
::com::sun::star::rendering::XCanvas > GetCanvas() const;
|
||||
|
@ -48,6 +48,7 @@
|
||||
#define CVT_TIF (0x00000008UL)
|
||||
#define CVT_WMF (0x00000009UL)
|
||||
#define CVT_EMF (0x0000000aUL)
|
||||
#define CVT_SVG (0x0000000bUL)
|
||||
|
||||
// ---------------
|
||||
// - ConvertData -
|
||||
|
@ -89,6 +89,8 @@ mkdir: %_DEST%\inc%_EXT%\vcl
|
||||
..\inc\vcl\ptrstyle.hxx %_DEST%\inc%_EXT%\vcl\ptrstyle.hxx
|
||||
..\inc\vcl\regband.hxx %_DEST%\inc%_EXT%\vcl\regband.hxx
|
||||
..\inc\vcl\region.hxx %_DEST%\inc%_EXT%\vcl\region.hxx
|
||||
..\inc\vcl\rendergraphic.hxx %_DEST%\inc%_EXT%\vcl\rendergraphic.hxx
|
||||
..\inc\vcl\rendergraphicrasterizer.hxx %_DEST%\inc%_EXT%\vcl\rendergraphicrasterizer.hxx
|
||||
..\inc\vcl\salbtype.hxx %_DEST%\inc%_EXT%\vcl\salbtype.hxx
|
||||
..\inc\vcl\salctype.hxx %_DEST%\inc%_EXT%\vcl\salctype.hxx
|
||||
..\inc\vcl\salgtype.hxx %_DEST%\inc%_EXT%\vcl\salgtype.hxx
|
||||
@ -151,6 +153,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl
|
||||
..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx
|
||||
..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx
|
||||
..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx
|
||||
..\inc\vcl\svgread.hxx %_DEST%\inc%_EXT%\vcl\svgread.hxx
|
||||
..\inc\vcl\arrange.hxx %_DEST%\inc%_EXT%\vcl\arrange.hxx
|
||||
..\inc\vcl\wpropset.hxx %_DEST%\inc%_EXT%\vcl\wpropset.hxx
|
||||
..\%__SRC%\misc\vcl.component %_DEST%\xml%_EXT%\vcl.component
|
||||
|
@ -45,9 +45,7 @@ using ::rtl::OUStringBuffer;
|
||||
using namespace com::sun::star::uno;
|
||||
using namespace com::sun::star::lang;
|
||||
|
||||
|
||||
// service implementation
|
||||
|
||||
extern Sequence< OUString > SAL_CALL vcl_session_getSupportedServiceNames();
|
||||
extern OUString SAL_CALL vcl_session_getImplementationName();
|
||||
extern Reference< XInterface > SAL_CALL vcl_session_createInstance( const Reference< XMultiServiceFactory > & );
|
||||
@ -77,6 +75,13 @@ extern Reference< XInterface > SAL_CALL DragSource_createInstance( const Referen
|
||||
extern Sequence< OUString > SAL_CALL DropTarget_getSupportedServiceNames();
|
||||
extern OUString SAL_CALL DropTarget_getImplementationName();
|
||||
extern Reference< XInterface > SAL_CALL DropTarget_createInstance( const Reference< XMultiServiceFactory > & );
|
||||
|
||||
namespace rsvg
|
||||
{
|
||||
extern Sequence< OUString > SAL_CALL Rasterizer_getSupportedServiceNames();
|
||||
extern OUString SAL_CALL Rasterizer_getImplementationName();
|
||||
extern Reference< XInterface > SAL_CALL Rasterizer_createInstance( const Reference< XMultiServiceFactory > & );
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
@ -142,6 +147,12 @@ extern "C" {
|
||||
xMgr, vcl::DropTarget_getImplementationName(), vcl::DropTarget_createInstance,
|
||||
vcl::DropTarget_getSupportedServiceNames() );
|
||||
}
|
||||
else if( vcl::rsvg::Rasterizer_getImplementationName().equalsAscii( pImplementationName ) )
|
||||
{
|
||||
xFactory = ::cppu::createSingleFactory(
|
||||
xMgr, vcl::rsvg::Rasterizer_getImplementationName(), vcl::rsvg::Rasterizer_createInstance,
|
||||
vcl::rsvg::Rasterizer_getSupportedServiceNames() );
|
||||
}
|
||||
if( xFactory.is() )
|
||||
{
|
||||
xFactory->acquire();
|
||||
|
@ -33,20 +33,23 @@ ENABLE_EXCEPTIONS=TRUE
|
||||
|
||||
# --- Settings -----------------------------------------------------
|
||||
|
||||
.INCLUDE : $(PRJ)$/util$/makefile.pmk
|
||||
.INCLUDE : settings.mk
|
||||
.INCLUDE : $(PRJ)$/util$/makefile.pmk
|
||||
.INCLUDE : settings.mk
|
||||
.INCLUDE : $(PRJ)$/util$/makefile2.pmk
|
||||
|
||||
# --- Files --------------------------------------------------------
|
||||
|
||||
SLOFILES= $(SLO)$/display.obj \
|
||||
$(SLO)$/dtranscomp.obj \
|
||||
$(SLO)$/fontident.obj \
|
||||
$(SLO)$/stringmirror.obj \
|
||||
SLOFILES= $(SLO)$/display.obj \
|
||||
$(SLO)$/dtranscomp.obj \
|
||||
$(SLO)$/fontident.obj \
|
||||
$(SLO)$/stringmirror.obj \
|
||||
$(SLO)$/rasterizer_rsvg.obj \
|
||||
$(SLO)$/factory.obj
|
||||
|
||||
EXCEPTIONSFILES= $(SLO)$/rasterizer_rsvg.obj
|
||||
|
||||
|
||||
# --- Targets ------------------------------------------------------
|
||||
|
||||
.INCLUDE : target.mk
|
||||
.INCLUDE : $(PRJ)$/util$/target.pmk
|
||||
|
||||
.INCLUDE : target.mk
|
||||
.INCLUDE : $(PRJ)$/util$/target.pmk
|
||||
|
@ -1449,6 +1449,15 @@ void GDIMetaFile::Rotate( long nAngle10 )
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_RENDERGRAPHIC_ACTION ):
|
||||
{
|
||||
OSL_TRACE( "Rotate not supported for RenderGraphic MetaActions yet" );
|
||||
|
||||
pAction->Duplicate();
|
||||
aMtf.AddAction( pAction );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
pAction->Execute( &aMapVDev );
|
||||
@ -1513,363 +1522,371 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference )
|
||||
switch( nActionType )
|
||||
{
|
||||
case( META_PIXEL_ACTION ):
|
||||
{
|
||||
MetaPixelAction* pAct = (MetaPixelAction*) pAction;
|
||||
ImplActionBounds( aBound,
|
||||
Rectangle( aMapVDev.LogicToLogic( pAct->GetPoint(), aMapVDev.GetMapMode(), GetPrefMapMode() ),
|
||||
aMapVDev.PixelToLogic( Size( 1, 1 ), GetPrefMapMode() ) ),
|
||||
aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaPixelAction* pAct = (MetaPixelAction*) pAction;
|
||||
ImplActionBounds( aBound,
|
||||
Rectangle( aMapVDev.LogicToLogic( pAct->GetPoint(), aMapVDev.GetMapMode(), GetPrefMapMode() ),
|
||||
aMapVDev.PixelToLogic( Size( 1, 1 ), GetPrefMapMode() ) ),
|
||||
aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_POINT_ACTION ):
|
||||
{
|
||||
MetaPointAction* pAct = (MetaPointAction*) pAction;
|
||||
ImplActionBounds( aBound,
|
||||
Rectangle( aMapVDev.LogicToLogic( pAct->GetPoint(), aMapVDev.GetMapMode(), GetPrefMapMode() ),
|
||||
aMapVDev.PixelToLogic( Size( 1, 1 ), GetPrefMapMode() ) ),
|
||||
aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaPointAction* pAct = (MetaPointAction*) pAction;
|
||||
ImplActionBounds( aBound,
|
||||
Rectangle( aMapVDev.LogicToLogic( pAct->GetPoint(), aMapVDev.GetMapMode(), GetPrefMapMode() ),
|
||||
aMapVDev.PixelToLogic( Size( 1, 1 ), GetPrefMapMode() ) ),
|
||||
aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_LINE_ACTION ):
|
||||
{
|
||||
MetaLineAction* pAct = (MetaLineAction*) pAction;
|
||||
Point aP1( pAct->GetStartPoint() ), aP2( pAct->GetEndPoint() );
|
||||
Rectangle aRect( aP1, aP2 );
|
||||
aRect.Justify();
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaLineAction* pAct = (MetaLineAction*) pAction;
|
||||
Point aP1( pAct->GetStartPoint() ), aP2( pAct->GetEndPoint() );
|
||||
Rectangle aRect( aP1, aP2 );
|
||||
aRect.Justify();
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_RECT_ACTION ):
|
||||
{
|
||||
MetaRectAction* pAct = (MetaRectAction*) pAction;
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaRectAction* pAct = (MetaRectAction*) pAction;
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_ROUNDRECT_ACTION ):
|
||||
{
|
||||
MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction;
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaRoundRectAction* pAct = (MetaRoundRectAction*) pAction;
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_ELLIPSE_ACTION ):
|
||||
{
|
||||
MetaEllipseAction* pAct = (MetaEllipseAction*) pAction;
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaEllipseAction* pAct = (MetaEllipseAction*) pAction;
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_ARC_ACTION ):
|
||||
{
|
||||
MetaArcAction* pAct = (MetaArcAction*) pAction;
|
||||
// FIXME: this is imprecise
|
||||
// e.g. for small arcs the whole rectangle is WAY too large
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaArcAction* pAct = (MetaArcAction*) pAction;
|
||||
// FIXME: this is imprecise
|
||||
// e.g. for small arcs the whole rectangle is WAY too large
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_PIE_ACTION ):
|
||||
{
|
||||
MetaPieAction* pAct = (MetaPieAction*) pAction;
|
||||
// FIXME: this is imprecise
|
||||
// e.g. for small arcs the whole rectangle is WAY too large
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaPieAction* pAct = (MetaPieAction*) pAction;
|
||||
// FIXME: this is imprecise
|
||||
// e.g. for small arcs the whole rectangle is WAY too large
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_CHORD_ACTION ):
|
||||
{
|
||||
MetaChordAction* pAct = (MetaChordAction*) pAction;
|
||||
// FIXME: this is imprecise
|
||||
// e.g. for small arcs the whole rectangle is WAY too large
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaChordAction* pAct = (MetaChordAction*) pAction;
|
||||
// FIXME: this is imprecise
|
||||
// e.g. for small arcs the whole rectangle is WAY too large
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_POLYLINE_ACTION ):
|
||||
{
|
||||
MetaPolyLineAction* pAct = (MetaPolyLineAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaPolyLineAction* pAct = (MetaPolyLineAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_POLYGON_ACTION ):
|
||||
{
|
||||
MetaPolygonAction* pAct = (MetaPolygonAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaPolygonAction* pAct = (MetaPolygonAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_POLYPOLYGON_ACTION ):
|
||||
{
|
||||
MetaPolyPolygonAction* pAct = (MetaPolyPolygonAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaPolyPolygonAction* pAct = (MetaPolyPolygonAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_TEXT_ACTION ):
|
||||
{
|
||||
MetaTextAction* pAct = (MetaTextAction*) pAction;
|
||||
Rectangle aRect;
|
||||
// hdu said base = index
|
||||
aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen() );
|
||||
Point aPt( pAct->GetPoint() );
|
||||
aRect.Move( aPt.X(), aPt.Y() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaTextAction* pAct = (MetaTextAction*) pAction;
|
||||
Rectangle aRect;
|
||||
// hdu said base = index
|
||||
aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen() );
|
||||
Point aPt( pAct->GetPoint() );
|
||||
aRect.Move( aPt.X(), aPt.Y() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_TEXTARRAY_ACTION ):
|
||||
{
|
||||
MetaTextArrayAction* pAct = (MetaTextArrayAction*) pAction;
|
||||
Rectangle aRect;
|
||||
// hdu said base = index
|
||||
aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen(),
|
||||
0, pAct->GetDXArray() );
|
||||
Point aPt( pAct->GetPoint() );
|
||||
aRect.Move( aPt.X(), aPt.Y() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaTextArrayAction* pAct = (MetaTextArrayAction*) pAction;
|
||||
Rectangle aRect;
|
||||
// hdu said base = index
|
||||
aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen(),
|
||||
0, pAct->GetDXArray() );
|
||||
Point aPt( pAct->GetPoint() );
|
||||
aRect.Move( aPt.X(), aPt.Y() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_STRETCHTEXT_ACTION ):
|
||||
{
|
||||
MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
|
||||
Rectangle aRect;
|
||||
// hdu said base = index
|
||||
aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen(),
|
||||
pAct->GetWidth(), NULL );
|
||||
Point aPt( pAct->GetPoint() );
|
||||
aRect.Move( aPt.X(), aPt.Y() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaStretchTextAction* pAct = (MetaStretchTextAction*) pAction;
|
||||
Rectangle aRect;
|
||||
// hdu said base = index
|
||||
aMapVDev.GetTextBoundRect( aRect, pAct->GetText(), pAct->GetIndex(), pAct->GetIndex(), pAct->GetLen(),
|
||||
pAct->GetWidth(), NULL );
|
||||
Point aPt( pAct->GetPoint() );
|
||||
aRect.Move( aPt.X(), aPt.Y() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_TEXTLINE_ACTION ):
|
||||
{
|
||||
MetaTextLineAction* pAct = (MetaTextLineAction*) pAction;
|
||||
// measure a test string to get ascend and descent right
|
||||
static const sal_Unicode pStr[] = { 0xc4, 0x67, 0 };
|
||||
String aStr( pStr );
|
||||
{
|
||||
MetaTextLineAction* pAct = (MetaTextLineAction*) pAction;
|
||||
// measure a test string to get ascend and descent right
|
||||
static const sal_Unicode pStr[] = { 0xc4, 0x67, 0 };
|
||||
String aStr( pStr );
|
||||
|
||||
Rectangle aRect;
|
||||
aMapVDev.GetTextBoundRect( aRect, aStr, 0, 0, aStr.Len(), 0, NULL );
|
||||
Point aPt( pAct->GetStartPoint() );
|
||||
aRect.Move( aPt.X(), aPt.Y() );
|
||||
aRect.Right() = aRect.Left() + pAct->GetWidth();
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
Rectangle aRect;
|
||||
aMapVDev.GetTextBoundRect( aRect, aStr, 0, 0, aStr.Len(), 0, NULL );
|
||||
Point aPt( pAct->GetStartPoint() );
|
||||
aRect.Move( aPt.X(), aPt.Y() );
|
||||
aRect.Right() = aRect.Left() + pAct->GetWidth();
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_BMPSCALE_ACTION ):
|
||||
{
|
||||
MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), pAct->GetSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaBmpScaleAction* pAct = (MetaBmpScaleAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), pAct->GetSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_BMPSCALEPART_ACTION ):
|
||||
{
|
||||
MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction;
|
||||
Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaBmpScalePartAction* pAct = (MetaBmpScalePartAction*) pAction;
|
||||
Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_BMPEXSCALE_ACTION ):
|
||||
{
|
||||
MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), pAct->GetSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaBmpExScaleAction* pAct = (MetaBmpExScaleAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), pAct->GetSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_BMPEXSCALEPART_ACTION ):
|
||||
{
|
||||
MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction;
|
||||
Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaBmpExScalePartAction* pAct = (MetaBmpExScalePartAction*) pAction;
|
||||
Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_GRADIENT_ACTION ):
|
||||
{
|
||||
MetaGradientAction* pAct = (MetaGradientAction*) pAction;
|
||||
Rectangle aRect( pAct->GetRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaGradientAction* pAct = (MetaGradientAction*) pAction;
|
||||
Rectangle aRect( pAct->GetRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_GRADIENTEX_ACTION ):
|
||||
{
|
||||
MetaGradientExAction* pAct = (MetaGradientExAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaGradientExAction* pAct = (MetaGradientExAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_COMMENT_ACTION ):
|
||||
{
|
||||
// nothing to do
|
||||
};
|
||||
break;
|
||||
{
|
||||
// nothing to do
|
||||
};
|
||||
break;
|
||||
|
||||
case( META_HATCH_ACTION ):
|
||||
{
|
||||
MetaHatchAction* pAct = (MetaHatchAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaHatchAction* pAct = (MetaHatchAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_TRANSPARENT_ACTION ):
|
||||
{
|
||||
MetaTransparentAction* pAct = (MetaTransparentAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaTransparentAction* pAct = (MetaTransparentAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPolyPolygon().GetBoundRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_FLOATTRANSPARENT_ACTION ):
|
||||
{
|
||||
MetaFloatTransparentAction* pAct = (MetaFloatTransparentAction*) pAction;
|
||||
GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() );
|
||||
// get the bound rect of the contained metafile
|
||||
Rectangle aRect( aTransMtf.GetBoundRect( i_rReference ) );
|
||||
// scale the rect now on the assumption that the correct top left of the metafile
|
||||
// (not its bounds !) is (0,0)
|
||||
Size aPSize( aTransMtf.GetPrefSize() );
|
||||
aPSize = aMapVDev.LogicToLogic( aPSize, aTransMtf.GetPrefMapMode(), aMapVDev.GetMapMode() );
|
||||
Size aActSize( pAct->GetSize() );
|
||||
double fX = double(aActSize.Width())/double(aPSize.Width());
|
||||
double fY = double(aActSize.Height())/double(aPSize.Height());
|
||||
aRect.Left() = long(double(aRect.Left())*fX);
|
||||
aRect.Right() = long(double(aRect.Right())*fX);
|
||||
aRect.Top() = long(double(aRect.Top())*fY);
|
||||
aRect.Bottom() = long(double(aRect.Bottom())*fY);
|
||||
{
|
||||
MetaFloatTransparentAction* pAct = (MetaFloatTransparentAction*) pAction;
|
||||
GDIMetaFile aTransMtf( pAct->GetGDIMetaFile() );
|
||||
// get the bound rect of the contained metafile
|
||||
Rectangle aRect( aTransMtf.GetBoundRect( i_rReference ) );
|
||||
// scale the rect now on the assumption that the correct top left of the metafile
|
||||
// (not its bounds !) is (0,0)
|
||||
Size aPSize( aTransMtf.GetPrefSize() );
|
||||
aPSize = aMapVDev.LogicToLogic( aPSize, aTransMtf.GetPrefMapMode(), aMapVDev.GetMapMode() );
|
||||
Size aActSize( pAct->GetSize() );
|
||||
double fX = double(aActSize.Width())/double(aPSize.Width());
|
||||
double fY = double(aActSize.Height())/double(aPSize.Height());
|
||||
aRect.Left() = long(double(aRect.Left())*fX);
|
||||
aRect.Right() = long(double(aRect.Right())*fX);
|
||||
aRect.Top() = long(double(aRect.Top())*fY);
|
||||
aRect.Bottom() = long(double(aRect.Bottom())*fY);
|
||||
|
||||
// transform the rect to current VDev state
|
||||
aRect = aMapVDev.LogicToLogic( aRect, aTransMtf.GetPrefMapMode(), aMapVDev.GetMapMode() );
|
||||
// transform the rect to current VDev state
|
||||
aRect = aMapVDev.LogicToLogic( aRect, aTransMtf.GetPrefMapMode(), aMapVDev.GetMapMode() );
|
||||
|
||||
ImplActionBounds( aBound, aRect, aClipStack );
|
||||
}
|
||||
break;
|
||||
ImplActionBounds( aBound, aRect, aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_EPS_ACTION ):
|
||||
{
|
||||
MetaEPSAction* pAct = (MetaEPSAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), pAct->GetSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaEPSAction* pAct = (MetaEPSAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), pAct->GetSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_CLIPREGION_ACTION ):
|
||||
{
|
||||
MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction;
|
||||
if( pAct->IsClipping() )
|
||||
aClipStack.back() = aMapVDev.LogicToLogic( pAct->GetRegion().GetBoundRect(), aMapVDev.GetMapMode(), GetPrefMapMode() );
|
||||
else
|
||||
aClipStack.back() = Rectangle();
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaClipRegionAction* pAct = (MetaClipRegionAction*) pAction;
|
||||
if( pAct->IsClipping() )
|
||||
aClipStack.back() = aMapVDev.LogicToLogic( pAct->GetRegion().GetBoundRect(), aMapVDev.GetMapMode(), GetPrefMapMode() );
|
||||
else
|
||||
aClipStack.back() = Rectangle();
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_ISECTRECTCLIPREGION_ACTION ):
|
||||
{
|
||||
MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction;
|
||||
Rectangle aRect( aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ) );
|
||||
if( aClipStack.back().IsEmpty() )
|
||||
aClipStack.back() = aRect;
|
||||
else
|
||||
aClipStack.back().Intersection( aRect );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction;
|
||||
Rectangle aRect( aMapVDev.LogicToLogic( pAct->GetRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ) );
|
||||
if( aClipStack.back().IsEmpty() )
|
||||
aClipStack.back() = aRect;
|
||||
else
|
||||
aClipStack.back().Intersection( aRect );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_ISECTREGIONCLIPREGION_ACTION ):
|
||||
{
|
||||
MetaISectRegionClipRegionAction* pAct = (MetaISectRegionClipRegionAction*) pAction;
|
||||
Rectangle aRect( aMapVDev.LogicToLogic( pAct->GetRegion().GetBoundRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ) );
|
||||
if( aClipStack.back().IsEmpty() )
|
||||
aClipStack.back() = aRect;
|
||||
else
|
||||
aClipStack.back().Intersection( aRect );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaISectRegionClipRegionAction* pAct = (MetaISectRegionClipRegionAction*) pAction;
|
||||
Rectangle aRect( aMapVDev.LogicToLogic( pAct->GetRegion().GetBoundRect(), aMapVDev.GetMapMode(), GetPrefMapMode() ) );
|
||||
if( aClipStack.back().IsEmpty() )
|
||||
aClipStack.back() = aRect;
|
||||
else
|
||||
aClipStack.back().Intersection( aRect );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_BMP_ACTION ):
|
||||
{
|
||||
MetaBmpAction* pAct = (MetaBmpAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), aMapVDev.PixelToLogic( pAct->GetBitmap().GetSizePixel() ) );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaBmpAction* pAct = (MetaBmpAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), aMapVDev.PixelToLogic( pAct->GetBitmap().GetSizePixel() ) );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_BMPEX_ACTION ):
|
||||
{
|
||||
MetaBmpExAction* pAct = (MetaBmpExAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), aMapVDev.PixelToLogic( pAct->GetBitmapEx().GetSizePixel() ) );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaBmpExAction* pAct = (MetaBmpExAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), aMapVDev.PixelToLogic( pAct->GetBitmapEx().GetSizePixel() ) );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_MASK_ACTION ):
|
||||
{
|
||||
MetaMaskAction* pAct = (MetaMaskAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), aMapVDev.PixelToLogic( pAct->GetBitmap().GetSizePixel() ) );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaMaskAction* pAct = (MetaMaskAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), aMapVDev.PixelToLogic( pAct->GetBitmap().GetSizePixel() ) );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_MASKSCALE_ACTION ):
|
||||
{
|
||||
MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction;
|
||||
Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction;
|
||||
Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_MASKSCALEPART_ACTION ):
|
||||
{
|
||||
MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction;
|
||||
Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaMaskScalePartAction* pAct = (MetaMaskScalePartAction*) pAction;
|
||||
Rectangle aRect( pAct->GetDestPoint(), pAct->GetDestSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_WALLPAPER_ACTION ):
|
||||
{
|
||||
MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction;
|
||||
Rectangle aRect( pAct->GetRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaWallpaperAction* pAct = (MetaWallpaperAction*) pAction;
|
||||
Rectangle aRect( pAct->GetRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_TEXTRECT_ACTION ):
|
||||
{
|
||||
MetaTextRectAction* pAct = (MetaTextRectAction*) pAction;
|
||||
Rectangle aRect( pAct->GetRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
{
|
||||
MetaTextRectAction* pAct = (MetaTextRectAction*) pAction;
|
||||
Rectangle aRect( pAct->GetRect() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_MOVECLIPREGION_ACTION ):
|
||||
{
|
||||
MetaMoveClipRegionAction* pAct = (MetaMoveClipRegionAction*) pAction;
|
||||
if( ! aClipStack.back().IsEmpty() )
|
||||
{
|
||||
MetaMoveClipRegionAction* pAct = (MetaMoveClipRegionAction*) pAction;
|
||||
if( ! aClipStack.back().IsEmpty() )
|
||||
{
|
||||
Size aDelta( pAct->GetHorzMove(), pAct->GetVertMove() );
|
||||
aDelta = aMapVDev.LogicToLogic( aDelta, aMapVDev.GetMapMode(), GetPrefMapMode() );
|
||||
aClipStack.back().Move( aDelta.Width(), aDelta.Width() );
|
||||
}
|
||||
Size aDelta( pAct->GetHorzMove(), pAct->GetVertMove() );
|
||||
aDelta = aMapVDev.LogicToLogic( aDelta, aMapVDev.GetMapMode(), GetPrefMapMode() );
|
||||
aClipStack.back().Move( aDelta.Width(), aDelta.Width() );
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_RENDERGRAPHIC_ACTION ):
|
||||
{
|
||||
MetaRenderGraphicAction* pAct = (MetaRenderGraphicAction*) pAction;
|
||||
Rectangle aRect( pAct->GetPoint(), pAct->GetSize() );
|
||||
ImplActionBounds( aBound, aMapVDev.LogicToLogic( aRect, aMapVDev.GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
@ -2269,6 +2286,15 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_RENDERGRAPHIC_ACTION ):
|
||||
{
|
||||
OSL_TRACE( "ExchangeColors not supported for RenderGraphic MetaActions yet" );
|
||||
|
||||
pAction->Duplicate();
|
||||
aMtf.Insert( pAction, LIST_APPEND );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
pAction->Duplicate();
|
||||
@ -2454,11 +2480,13 @@ ULONG GDIMetaFile::GetChecksum() const
|
||||
{
|
||||
GDIMetaFile aMtf;
|
||||
SvMemoryStream aMemStm( 65535, 65535 );
|
||||
ImplMetaWriteData aWriteData; aWriteData.meActualCharSet = aMemStm.GetStreamCharSet();
|
||||
ImplMetaWriteData aWriteData;
|
||||
SVBT16 aBT16;
|
||||
SVBT32 aBT32;
|
||||
ULONG nCrc = 0;
|
||||
|
||||
aWriteData.meActualCharSet = aMemStm.GetStreamCharSet();
|
||||
|
||||
for( ULONG i = 0, nObjCount = GetActionCount(); i < nObjCount; i++ )
|
||||
{
|
||||
MetaAction* pAction = GetAction( i );
|
||||
@ -2715,6 +2743,30 @@ ULONG GDIMetaFile::GetChecksum() const
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_RENDERGRAPHIC_ACTION ):
|
||||
{
|
||||
MetaRenderGraphicAction* pAct = (MetaRenderGraphicAction*) pAction;
|
||||
const ::vcl::RenderGraphic& rRenderGraphic = pAct->GetRenderGraphic();
|
||||
|
||||
ShortToSVBT16( pAct->GetType(), aBT16 );
|
||||
nCrc = rtl_crc32( nCrc, aBT16, 2 );
|
||||
|
||||
nCrc = rtl_crc32( nCrc, rRenderGraphic.GetGraphicData().get(), rRenderGraphic.GetGraphicDataLength() );
|
||||
|
||||
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
|
||||
nCrc = rtl_crc32( nCrc, aBT32, 4 );
|
||||
|
||||
UInt32ToSVBT32( pAct->GetPoint().Y(), aBT32 );
|
||||
nCrc = rtl_crc32( nCrc, aBT32, 4 );
|
||||
|
||||
UInt32ToSVBT32( pAct->GetSize().Width(), aBT32 );
|
||||
nCrc = rtl_crc32( nCrc, aBT32, 4 );
|
||||
|
||||
UInt32ToSVBT32( pAct->GetSize().Height(), aBT32 );
|
||||
nCrc = rtl_crc32( nCrc, aBT32, 4 );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
pAction->Write( aMemStm, &aWriteData );
|
||||
@ -2781,8 +2833,7 @@ ULONG GDIMetaFile::GetSizeBytes() const
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
case( META_RENDERGRAPHIC_ACTION ): nSizeBytes += ( ( (MetaRenderGraphicAction*) pAction )->GetRenderGraphic() ).GetGraphicDataLength(); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2812,25 +2863,61 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
|
||||
MetaAction* pAction;
|
||||
UINT32 nStmCompressMode = 0;
|
||||
UINT32 nCount = 0;
|
||||
sal_uInt8 bRenderGraphicReplacements = 0;
|
||||
|
||||
pCompat = new VersionCompat( rIStm, STREAM_READ );
|
||||
{
|
||||
// version 1
|
||||
rIStm >> nStmCompressMode;
|
||||
rIStm >> rGDIMetaFile.aPrefMapMode;
|
||||
rIStm >> rGDIMetaFile.aPrefSize;
|
||||
rIStm >> nCount;
|
||||
|
||||
rIStm >> nStmCompressMode;
|
||||
rIStm >> rGDIMetaFile.aPrefMapMode;
|
||||
rIStm >> rGDIMetaFile.aPrefSize;
|
||||
rIStm >> nCount;
|
||||
if( pCompat->GetVersion() >= 2 )
|
||||
{
|
||||
// version 2
|
||||
// =========
|
||||
// contains an additional flag to indicate that RenderGraphic
|
||||
// actions are immediately followed by a replacement image, that
|
||||
// needs to be skipped in case the flag is set (KA 01/2011)
|
||||
|
||||
rIStm >> bRenderGraphicReplacements;
|
||||
}
|
||||
}
|
||||
delete pCompat;
|
||||
|
||||
ImplMetaReadData aReadData;
|
||||
aReadData.meActualCharSet = rIStm.GetStreamCharSet();
|
||||
|
||||
for( UINT32 nAction = 0UL; ( nAction < nCount ) && !rIStm.IsEof(); nAction++ )
|
||||
for( UINT32 nAction = 0UL; ( nAction < nCount ) && !rIStm.IsEof(); ++nAction )
|
||||
{
|
||||
pAction = MetaAction::ReadMetaAction( rIStm, &aReadData );
|
||||
|
||||
if( pAction )
|
||||
{
|
||||
rGDIMetaFile.AddAction( pAction );
|
||||
|
||||
// if the MetaFile was written in RenderGraphics replacement mode
|
||||
// and we just read a RenderGraphic action, skip the following
|
||||
// META_BMPEXSCALE_ACTION, since this is the replacement image,
|
||||
// just needed for old implementations; don't forget to increment
|
||||
// the action read counter! (KA 01/2011)
|
||||
if( bRenderGraphicReplacements &&
|
||||
( META_RENDERGRAPHIC_ACTION == pAction->GetType() ) &&
|
||||
( ++nAction < nCount ) && !rIStm.IsEof() )
|
||||
{
|
||||
UINT16 nFollowingType;
|
||||
|
||||
// dummy read of the next following META_BMPEXSCALE_ACTION
|
||||
// RenderGraphic replacement action (KA 01/2011)
|
||||
rIStm >> nFollowingType;
|
||||
delete ( new VersionCompat( rIStm, STREAM_READ ) );
|
||||
|
||||
OSL_ENSURE( META_BMPEXSCALE_ACTION == nFollowingType, \
|
||||
"META_RENDERGRAPHIC_ACTION read in RenderGraphic replacement mode \
|
||||
without following META_BMPEXSCALE_ACTION replacement" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2859,10 +2946,27 @@ SvStream& operator<<( SvStream& rOStm, const GDIMetaFile& rGDIMetaFile )
|
||||
{
|
||||
if( !rOStm.GetError() )
|
||||
{
|
||||
if( rOStm.GetVersion() >= SOFFICE_FILEFORMAT_50 )
|
||||
((GDIMetaFile&) rGDIMetaFile ).Write( rOStm );
|
||||
static const char* pEnableSVM1 = getenv( "SAL_ENABLE_SVM1" );
|
||||
static const bool bNoSVM1 = (NULL == pEnableSVM1 ) || ( '0' == *pEnableSVM1 );
|
||||
|
||||
if( bNoSVM1 || rOStm.GetVersion() >= SOFFICE_FILEFORMAT_50 )
|
||||
{
|
||||
const_cast< GDIMetaFile& >( rGDIMetaFile ).Write( rOStm );
|
||||
}
|
||||
else
|
||||
delete( new SVMConverter( rOStm, (GDIMetaFile&) rGDIMetaFile, CONVERT_TO_SVM1 ) );
|
||||
{
|
||||
delete( new SVMConverter( rOStm, const_cast< GDIMetaFile& >( rGDIMetaFile ), CONVERT_TO_SVM1 ) );
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if( !bNoSVM1 && rOStm.GetVersion() < SOFFICE_FILEFORMAT_50 )
|
||||
{
|
||||
OSL_TRACE( \
|
||||
"GDIMetaFile would normally be written in old SVM1 format by this call. \
|
||||
The current implementation always writes in VCLMTF format. \
|
||||
Please set environment variable SAL_ENABLE_SVM1 to '1' to reenable old behavior" );
|
||||
}
|
||||
#endif // DEBUG
|
||||
}
|
||||
|
||||
return rOStm;
|
||||
@ -2880,32 +2984,90 @@ SvStream& GDIMetaFile::Read( SvStream& rIStm )
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
SvStream& GDIMetaFile::Write( SvStream& rOStm )
|
||||
SvStream& GDIMetaFile::Write( SvStream& rOStm, GDIMetaFileWriteFlags nWriteFlags )
|
||||
{
|
||||
VersionCompat* pCompat;
|
||||
const UINT32 nStmCompressMode = rOStm.GetCompressMode();
|
||||
USHORT nOldFormat = rOStm.GetNumberFormatInt();
|
||||
const sal_uInt8 bRenderGraphicReplacements =
|
||||
( ( ( GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC & nWriteFlags ) != 0 ) ? 1 : 0 );
|
||||
|
||||
// With the introduction of the META_RENDERGRAPHIC_ACTION, it is neccessary
|
||||
// to provide some kind of document backward compatibility:
|
||||
//
|
||||
// If the flag GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC is set in
|
||||
// parameter nWriteFlags, each META_RENDERGRAPHIC_ACTION is followed by
|
||||
// an additional META_BMPEXSCALE_ACTION, that contains a replacement
|
||||
// image for the new RenderGraphic action.
|
||||
//
|
||||
// Old implementations, not knowing anything about META_RENDERGRAPHIC_ACTION,
|
||||
// will skip this new action and read the META_BMPEXSCALE_ACTION instead
|
||||
//
|
||||
// Since the current implementation is able to handle the new action, the
|
||||
// then following image replacement action needs to be skipped by this
|
||||
// implementation, if the metafile was written in the RenderGraphic
|
||||
// replacement mode.
|
||||
//
|
||||
// To be able to detect this compatibility mode, the header needs to
|
||||
// be extended by a corresponding flag, resulting in version 2 of
|
||||
// the header. The surrounding VersionCompat of the header
|
||||
// allows to add such new data without any problems (KA 01/2011)
|
||||
|
||||
rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
|
||||
rOStm.Write( "VCLMTF", 6 );
|
||||
|
||||
pCompat = new VersionCompat( rOStm, STREAM_WRITE, 1 );
|
||||
pCompat = new VersionCompat( rOStm, STREAM_WRITE, 2 );
|
||||
|
||||
rOStm << nStmCompressMode;
|
||||
rOStm << aPrefMapMode;
|
||||
rOStm << aPrefSize;
|
||||
rOStm << (UINT32) GetActionCount();
|
||||
{
|
||||
// version 1
|
||||
UINT32 nActionCount = 0;
|
||||
|
||||
// calculate correct action count and watch for
|
||||
// additional RenderGraphic replacement actions, if the
|
||||
// GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC is set
|
||||
// and META_RENDERGRAPHIC_ACTION are encountered (KA 01/2011)
|
||||
for( MetaAction* pAct = static_cast< MetaAction* >( First() ); pAct; pAct = static_cast< MetaAction* >( Next() ) )
|
||||
{
|
||||
nActionCount += ( bRenderGraphicReplacements && ( META_RENDERGRAPHIC_ACTION == pAct->GetType() ) ? 2 : 1 );
|
||||
}
|
||||
|
||||
rOStm << nStmCompressMode << aPrefMapMode << aPrefSize << nActionCount;
|
||||
|
||||
{
|
||||
// version 2
|
||||
// =========
|
||||
// since version 2, a GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC flag
|
||||
// is written, to indicate that each META_BMPEXSCALE_ACTION following
|
||||
// a META_RENDERGRAPHIC_ACTION needs to be skipped, in case the flag is
|
||||
// set (KA 01/2011)
|
||||
rOStm << bRenderGraphicReplacements;
|
||||
}
|
||||
}
|
||||
|
||||
delete pCompat;
|
||||
|
||||
ImplMetaWriteData aWriteData;
|
||||
aWriteData.meActualCharSet = rOStm.GetStreamCharSet();
|
||||
|
||||
MetaAction* pAct = (MetaAction*)First();
|
||||
while ( pAct )
|
||||
aWriteData.meActualCharSet = rOStm.GetStreamCharSet();
|
||||
aWriteData.mnWriteFlags = nWriteFlags;
|
||||
|
||||
for( MetaAction* pAct = static_cast< MetaAction* >( First() ); pAct; pAct = static_cast< MetaAction* >( Next() ) )
|
||||
{
|
||||
pAct->Write( rOStm, &aWriteData );
|
||||
pAct = (MetaAction*)Next();
|
||||
|
||||
// write the RenderGraphic replacement image, if the
|
||||
// GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC flag is set
|
||||
// and if a META_RENDERGRAPHIC_ACTION is encountered (KA 01/2011)
|
||||
if( bRenderGraphicReplacements && ( META_RENDERGRAPHIC_ACTION == pAct->GetType() ) )
|
||||
{
|
||||
MetaRenderGraphicAction* pRenderAction = static_cast< MetaRenderGraphicAction* >( pAct );
|
||||
MetaBmpExScaleAction* pBmpExScaleAction = new MetaBmpExScaleAction(
|
||||
pRenderAction->GetPoint(), pRenderAction->GetSize(),
|
||||
pRenderAction->GetRenderGraphic().GetReplacement() );
|
||||
|
||||
pBmpExScaleAction->Write( rOStm, &aWriteData );
|
||||
pBmpExScaleAction->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
rOStm.SetNumberFormatInt( nOldFormat );
|
||||
|
@ -258,6 +258,7 @@ BOOL GfxLink::LoadNative( Graphic& rGraphic )
|
||||
case( GFX_LINK_TYPE_NATIVE_WMF ): nCvtType = CVT_WMF; break;
|
||||
case( GFX_LINK_TYPE_NATIVE_MET ): nCvtType = CVT_MET; break;
|
||||
case( GFX_LINK_TYPE_NATIVE_PCT ): nCvtType = CVT_PCT; break;
|
||||
case( GFX_LINK_TYPE_NATIVE_SVG ): nCvtType = CVT_SVG; break;
|
||||
|
||||
default: nCvtType = CVT_UNKNOWN; break;
|
||||
}
|
||||
|
@ -427,6 +427,27 @@ BOOL Graphic::IsAnimated() const
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
BOOL Graphic::IsEPS() const
|
||||
{
|
||||
return mpImpGraphic->ImplIsEPS();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
BOOL Graphic::IsRenderGraphic() const
|
||||
{
|
||||
return mpImpGraphic->ImplIsRenderGraphic();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
BOOL Graphic::HasRenderGraphic() const
|
||||
{
|
||||
return mpImpGraphic->ImplHasRenderGraphic();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Bitmap Graphic::GetBitmap(const GraphicConversionParameters& rParameters) const
|
||||
{
|
||||
return mpImpGraphic->ImplGetBitmap(rParameters);
|
||||
@ -455,6 +476,13 @@ const GDIMetaFile& Graphic::GetGDIMetaFile() const
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
::vcl::RenderGraphic Graphic::GetRenderGraphic() const
|
||||
{
|
||||
return mpImpGraphic->ImplGetRenderGraphic();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
uno::Reference< graphic::XGraphic > Graphic::GetXGraphic() const
|
||||
{
|
||||
uno::Reference< graphic::XGraphic > xRet;
|
||||
|
@ -480,6 +480,48 @@ BOOL ImpGraphic::ImplIsAnimated() const
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
BOOL ImpGraphic::ImplIsEPS() const
|
||||
{
|
||||
return( ( meType == GRAPHIC_GDIMETAFILE ) &&
|
||||
( maMetaFile.GetActionCount() > 0 ) &&
|
||||
( maMetaFile.GetAction( 0 )->GetType() == META_EPS_ACTION ) );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
BOOL ImpGraphic::ImplIsRenderGraphic() const
|
||||
{
|
||||
return( ( GRAPHIC_GDIMETAFILE == meType ) &&
|
||||
( 1 == maMetaFile.GetActionCount() ) &&
|
||||
( META_RENDERGRAPHIC_ACTION == maMetaFile.GetAction( 0 )->GetType() ) );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
BOOL ImpGraphic::ImplHasRenderGraphic() const
|
||||
{
|
||||
BOOL bRet = FALSE;
|
||||
|
||||
if( GRAPHIC_GDIMETAFILE == meType )
|
||||
{
|
||||
GDIMetaFile& rMtf = const_cast< ImpGraphic* >( this )->maMetaFile;
|
||||
|
||||
for( MetaAction* pAct = rMtf.FirstAction(); pAct && !bRet; pAct = rMtf.NextAction() )
|
||||
{
|
||||
if( META_RENDERGRAPHIC_ACTION == pAct->GetType() )
|
||||
{
|
||||
bRet = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
rMtf.WindStart();
|
||||
}
|
||||
|
||||
return( bRet );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters) const
|
||||
{
|
||||
Bitmap aRetBmp;
|
||||
@ -592,6 +634,18 @@ Animation ImpGraphic::ImplGetAnimation() const
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
::vcl::RenderGraphic ImpGraphic::ImplGetRenderGraphic() const
|
||||
{
|
||||
::vcl::RenderGraphic aRet;
|
||||
|
||||
if( ImplIsRenderGraphic() )
|
||||
aRet = static_cast< MetaRenderGraphicAction* >( maMetaFile.GetAction( 0 ) )->GetRenderGraphic();
|
||||
|
||||
return( aRet );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const
|
||||
{
|
||||
return maMetaFile;
|
||||
|
@ -47,75 +47,77 @@ CDEFS+=-DENABLE_GRAPHITE
|
||||
|
||||
# --- Files --------------------------------------------------------
|
||||
|
||||
EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
|
||||
$(SLO)$/outdev.obj \
|
||||
$(SLO)$/outdev3.obj \
|
||||
$(SLO)$/outdevnative.obj \
|
||||
$(SLO)$/gfxlink.obj \
|
||||
$(SLO)$/print.obj \
|
||||
$(SLO)$/print2.obj \
|
||||
$(SLO)$/print3.obj \
|
||||
$(SLO)$/oldprintadaptor.obj \
|
||||
$(SLO)$/configsettings.obj \
|
||||
$(SLO)$/sallayout.obj \
|
||||
$(SLO)$/image.obj \
|
||||
$(SLO)$/impimage.obj \
|
||||
$(SLO)$/impgraph.obj \
|
||||
$(SLO)$/metric.obj \
|
||||
$(SLO)$/pdfwriter_impl.obj \
|
||||
$(SLO)$/pdfwriter_impl2.obj \
|
||||
$(SLO)$/pdffontcache.obj\
|
||||
$(SLO)$/bmpconv.obj \
|
||||
$(SLO)$/pdfextoutdevdata.obj \
|
||||
$(SLO)$/jobset.obj \
|
||||
$(SLO)$/impimagetree.obj \
|
||||
$(SLO)$/pngread.obj \
|
||||
$(SLO)$/pngwrite.obj \
|
||||
$(SLO)$/virdev.obj \
|
||||
$(SLO)$/gdimtf.obj \
|
||||
$(SLO)$/graphictools.obj \
|
||||
$(SLO)$/textlayout.obj \
|
||||
$(SLO)$/lineinfo.obj
|
||||
EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
|
||||
$(SLO)$/outdev.obj \
|
||||
$(SLO)$/outdev3.obj \
|
||||
$(SLO)$/outdevnative.obj \
|
||||
$(SLO)$/gfxlink.obj \
|
||||
$(SLO)$/print.obj \
|
||||
$(SLO)$/print2.obj \
|
||||
$(SLO)$/print3.obj \
|
||||
$(SLO)$/oldprintadaptor.obj \
|
||||
$(SLO)$/configsettings.obj \
|
||||
$(SLO)$/sallayout.obj \
|
||||
$(SLO)$/image.obj \
|
||||
$(SLO)$/impimage.obj \
|
||||
$(SLO)$/impgraph.obj \
|
||||
$(SLO)$/metric.obj \
|
||||
$(SLO)$/pdfwriter_impl.obj \
|
||||
$(SLO)$/pdfwriter_impl2.obj \
|
||||
$(SLO)$/pdffontcache.obj \
|
||||
$(SLO)$/bmpconv.obj \
|
||||
$(SLO)$/pdfextoutdevdata.obj \
|
||||
$(SLO)$/jobset.obj \
|
||||
$(SLO)$/impimagetree.obj \
|
||||
$(SLO)$/pngread.obj \
|
||||
$(SLO)$/pngwrite.obj \
|
||||
$(SLO)$/virdev.obj \
|
||||
$(SLO)$/gdimtf.obj \
|
||||
$(SLO)$/graphictools.obj \
|
||||
$(SLO)$/textlayout.obj \
|
||||
$(SLO)$/lineinfo.obj \
|
||||
$(SLO)$/svgread.obj \
|
||||
$(SLO)$/rendergraphic.obj \
|
||||
$(SLO)$/rendergraphicrasterizer.obj
|
||||
|
||||
SLOFILES= $(EXCEPTIONSFILES) \
|
||||
SLOFILES= $(EXCEPTIONSFILES) \
|
||||
$(SLO)$/animate.obj \
|
||||
$(SLO)$/impanmvw.obj \
|
||||
$(SLO)$/bitmap.obj \
|
||||
$(SLO)$/bitmap.obj \
|
||||
$(SLO)$/bitmap2.obj \
|
||||
$(SLO)$/bitmap3.obj \
|
||||
$(SLO)$/bitmap4.obj \
|
||||
$(SLO)$/alpha.obj \
|
||||
$(SLO)$/alpha.obj \
|
||||
$(SLO)$/bitmapex.obj \
|
||||
$(SLO)$/bmpacc.obj \
|
||||
$(SLO)$/bmpacc2.obj \
|
||||
$(SLO)$/bmpacc3.obj \
|
||||
$(SLO)$/bmpfast.obj \
|
||||
$(SLO)$/cvtsvm.obj \
|
||||
$(SLO)$/cvtgrf.obj \
|
||||
$(SLO)$/font.obj \
|
||||
$(SLO)$/cvtsvm.obj \
|
||||
$(SLO)$/cvtgrf.obj \
|
||||
$(SLO)$/font.obj \
|
||||
$(SLO)$/gradient.obj \
|
||||
$(SLO)$/hatch.obj \
|
||||
$(SLO)$/graph.obj \
|
||||
$(SLO)$/impbmp.obj \
|
||||
$(SLO)$/hatch.obj \
|
||||
$(SLO)$/graph.obj \
|
||||
$(SLO)$/impbmp.obj \
|
||||
$(SLO)$/imagerepository.obj \
|
||||
$(SLO)$/impvect.obj \
|
||||
$(SLO)$/mapmod.obj \
|
||||
$(SLO)$/mapmod.obj \
|
||||
$(SLO)$/metaact.obj \
|
||||
$(SLO)$/octree.obj \
|
||||
$(SLO)$/outmap.obj \
|
||||
$(SLO)$/octree.obj \
|
||||
$(SLO)$/outmap.obj \
|
||||
$(SLO)$/outdev2.obj \
|
||||
$(SLO)$/outdev4.obj \
|
||||
$(SLO)$/outdev5.obj \
|
||||
$(SLO)$/outdev6.obj \
|
||||
$(SLO)$/regband.obj \
|
||||
$(SLO)$/region.obj \
|
||||
$(SLO)$/wall.obj \
|
||||
$(SLO)$/base14.obj \
|
||||
$(SLO)$/region.obj \
|
||||
$(SLO)$/wall.obj \
|
||||
$(SLO)$/base14.obj \
|
||||
$(SLO)$/pdfwriter.obj \
|
||||
$(SLO)$/salgdilayout.obj \
|
||||
$(SLO)$/extoutdevdata.obj \
|
||||
$(SLO)$/salnativewidgets-none.obj
|
||||
|
||||
$(SLO)$/salnativewidgets-none.obj
|
||||
|
||||
# --- Targets ------------------------------------------------------
|
||||
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <vcl/salbtype.hxx>
|
||||
#include <vcl/metaact.hxx>
|
||||
#include <vcl/graphictools.hxx>
|
||||
#include <vcl/rendergraphicrasterizer.hxx>
|
||||
|
||||
// ========================================================================
|
||||
|
||||
@ -235,6 +236,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:
|
||||
{
|
||||
@ -2565,7 +2567,10 @@ MetaGradientExAction::~MetaGradientExAction()
|
||||
void MetaGradientExAction::Execute( OutputDevice* pOut )
|
||||
{
|
||||
if( pOut->GetConnectMetaFile() )
|
||||
pOut->GetConnectMetaFile()->AddAction( Clone() );
|
||||
{
|
||||
Duplicate();
|
||||
pOut->GetConnectMetaFile()->AddAction( this );
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@ -4059,7 +4064,10 @@ void MetaCommentAction::ImplInitDynamicData( const BYTE* pData, sal_uInt32 nData
|
||||
void MetaCommentAction::Execute( OutputDevice* pOut )
|
||||
{
|
||||
if ( pOut->GetConnectMetaFile() )
|
||||
pOut->GetConnectMetaFile()->AddAction( Clone() );
|
||||
{
|
||||
Duplicate();
|
||||
pOut->GetConnectMetaFile()->AddAction( this );
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@ -4294,3 +4302,81 @@ void MetaTextLanguageAction::Read( SvStream& rIStm, ImplMetaReadData* )
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <vcl/wrkwin.hxx>
|
||||
#include <vcl/graph.hxx>
|
||||
#include <vcl/wall2.hxx>
|
||||
#include <vcl/rendergraphicrasterizer.hxx>
|
||||
#include <com/sun/star/uno/Sequence.hxx>
|
||||
|
||||
#include <basegfx/vector/b2dvector.hxx>
|
||||
@ -1193,6 +1194,8 @@ void OutputDevice::ImplDraw2ColorFrame( const Rectangle& rRect,
|
||||
bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
|
||||
const GfxLink& rGfxLink, GDIMetaFile* pSubst )
|
||||
{
|
||||
DBG_TRACE( "OutputDevice::DrawEPS()" );
|
||||
|
||||
bool bDrawn(true);
|
||||
|
||||
if ( mpMetaFile )
|
||||
@ -1211,7 +1214,7 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
|
||||
if( mbOutputClipped )
|
||||
return bDrawn;
|
||||
|
||||
Rectangle aRect( ImplLogicToDevicePixel( Rectangle( rPoint, rSize ) ) );
|
||||
Rectangle aRect( ImplLogicToDevicePixel( Rectangle( rPoint, rSize ) ) );
|
||||
|
||||
if( !aRect.IsEmpty() )
|
||||
{
|
||||
@ -1245,3 +1248,26 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
|
||||
|
||||
return bDrawn;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void OutputDevice::DrawRenderGraphic( const Point& rPoint, const Size& rSize,
|
||||
const ::vcl::RenderGraphic& rRenderGraphic )
|
||||
{
|
||||
DBG_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;
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "vcl/metaact.hxx"
|
||||
#include "vcl/graph.hxx"
|
||||
#include "vcl/svdata.hxx"
|
||||
#include "vcl/rendergraphicrasterizer.hxx"
|
||||
#include "unotools/streamwrap.hxx"
|
||||
#include "unotools/processfactory.hxx"
|
||||
#include "comphelper/processfactory.hxx"
|
||||
@ -1019,6 +1020,17 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
|
||||
}
|
||||
break;
|
||||
|
||||
case( META_RENDERGRAPHIC_ACTION ):
|
||||
{
|
||||
const MetaRenderGraphicAction* pA = static_cast< const MetaRenderGraphicAction* >( pAction );
|
||||
const ::vcl::RenderGraphicRasterizer aRasterizer( pA->GetRenderGraphic() );
|
||||
|
||||
implWriteBitmapEx( pA->GetPoint(), pA->GetSize(),
|
||||
aRasterizer.Rasterize( pDummyVDev->LogicToPixel( pA->GetSize() ) ),
|
||||
pDummyVDev, i_rContext );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// #i24604# Made assertion fire only once per
|
||||
// metafile. The asserted actions here are all
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <vcl/sallayout.hxx>
|
||||
#include <vcl/bmpacc.hxx>
|
||||
#include <vcl/rendergraphicrasterizer.hxx>
|
||||
|
||||
#include "pdfwriter_impl.hxx"
|
||||
|
||||
@ -111,6 +112,9 @@ static bool ImplIsActionSpecial( const MetaAction& rAct )
|
||||
case META_BMPEXSCALEPART_ACTION:
|
||||
return static_cast<const MetaBmpExScalePartAction&>(rAct).GetBitmapEx().IsTransparent();
|
||||
|
||||
case META_RENDERGRAPHIC_ACTION:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -198,6 +202,16 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
|
||||
aBmpEx = static_cast<const MetaBmpExScaleAction&>(rAct).GetBitmapEx();
|
||||
break;
|
||||
|
||||
case META_RENDERGRAPHIC_ACTION:
|
||||
{
|
||||
const ::vcl::RenderGraphicRasterizer aRasterizer( static_cast<const MetaRenderGraphicAction&>(rAct).
|
||||
GetRenderGraphic() );
|
||||
|
||||
aBmpEx = aRasterizer.Rasterize( rStateOutDev.LogicToPixel(
|
||||
static_cast<const MetaRenderGraphicAction&>(rAct).GetSize() ) );
|
||||
break;
|
||||
}
|
||||
|
||||
case META_TRANSPARENT_ACTION:
|
||||
|
||||
default:
|
||||
@ -265,6 +279,11 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
|
||||
static_cast<const MetaBmpExScalePartAction&>(rAct).GetSrcSize(),
|
||||
aBmp ));
|
||||
break;
|
||||
case META_RENDERGRAPHIC_ACTION:
|
||||
o_rMtf.AddAction( new MetaBmpScaleAction(
|
||||
static_cast<const MetaRenderGraphicAction&>(rAct).GetPoint(),
|
||||
static_cast<const MetaRenderGraphicAction&>(rAct).GetSize(),
|
||||
aBmp ));
|
||||
default:
|
||||
DBG_ERROR("Unexpected case");
|
||||
break;
|
||||
@ -377,6 +396,7 @@ static bool ImplIsNotTransparent( const MetaAction& rAct, const OutputDevice& rO
|
||||
case META_TEXTRECT_ACTION:
|
||||
case META_STRETCHTEXT_ACTION:
|
||||
case META_TEXTLINE_ACTION:
|
||||
case META_RENDERGRAPHIC_ACTION:
|
||||
// all other actions: generate non-transparent output
|
||||
bRet = true;
|
||||
break;
|
||||
@ -629,7 +649,14 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
|
||||
|
||||
case META_TEXTLINE_ACTION:
|
||||
DBG_ERROR("META_TEXTLINE_ACTION not supported");
|
||||
break;
|
||||
break;
|
||||
|
||||
case( META_RENDERGRAPHIC_ACTION ):
|
||||
{
|
||||
const MetaRenderGraphicAction& rRenderAct = static_cast<const MetaRenderGraphicAction&>(rAct);
|
||||
aActionBounds = Rectangle( rRenderAct.GetPoint(), rRenderAct.GetSize() );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
@ -656,6 +683,7 @@ static bool ImplIsActionHandlingTransparency( const MetaAction& rAct )
|
||||
case META_BMPEX_ACTION:
|
||||
case META_BMPEXSCALE_ACTION:
|
||||
case META_BMPEXSCALEPART_ACTION:
|
||||
case META_RENDERGRAPHIC_ACTION:
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
@ -99,6 +99,8 @@ HXXDEPNLST= $(INC)$/vcl$/accel.hxx \
|
||||
$(INC)$/vcl$/print.hxx \
|
||||
$(INC)$/vcl$/prndlg.hxx \
|
||||
$(INC)$/vcl$/region.hxx \
|
||||
$(INC)$/vcl$/rendergraphic.hxx \
|
||||
$(INC)$/vcl$/rendergraphicrasterizer.hxx \
|
||||
$(INC)$/vcl$/salbtype.hxx \
|
||||
$(INC)$/vcl$/scrbar.hxx \
|
||||
$(INC)$/vcl$/slider.hxx \
|
||||
|
@ -46,4 +46,7 @@
|
||||
<implementation name="vcl::FontIdentificator">
|
||||
<service name="com.sun.star.awt.FontIdentificator"/>
|
||||
</implementation>
|
||||
<implementation name="vcl::rsvg::Rasterizer">
|
||||
<service name="com.sun.star.graphic.GraphicRasterizer_RSVG"/>
|
||||
</implementation>
|
||||
</component>
|
||||
|
Loading…
x
Reference in New Issue
Block a user