LibreOffice Module emfio (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
emfio::WmfReader Class Reference

#include <wmfreader.hxx>

Inheritance diagram for emfio::WmfReader:
[legend]
Collaboration diagram for emfio::WmfReader:
[legend]

Public Member Functions

 WmfReader (SvStream &rStreamWMF, GDIMetaFile &rGDIMetaFile, const WmfExternal *pExternalHeader)
 
void ReadWMF ()
 
void SetEnableEMFPlus (bool bEnableEMFPlus)
 
- Public Member Functions inherited from emfio::MtfTools
void SetDevByWin ()
 
void SetDevOrg (const Point &rPoint)
 
void SetDevOrgOffset (sal_Int32 nXAdd, sal_Int32 nYAdd)
 
void SetDevExt (const Size &rSize, bool regular=true)
 
void ScaleDevExt (double fX, double fY)
 
void SetWinOrg (const Point &rPoint, bool bIsEMF=false)
 
Point GetWinOrg ()
 
void SetWinOrgOffset (sal_Int32 nX, sal_Int32 nY)
 
void SetWinExt (const Size &rSize, bool bIsEMF=false)
 
void ScaleWinExt (double fX, double fY)
 
void SetrclBounds (const tools::Rectangle &rRect)
 
void SetrclFrame (const tools::Rectangle &rRect)
 
void SetRefPix (const Size &rSize)
 
void SetRefMill (const Size &rSize)
 
void SetMapMode (MappingMode mnMapMode)
 
void SetWorldTransform (const XForm &rXForm)
 
void ModifyWorldTransform (const XForm &rXForm, ModifyWorldTransformMode nMode)
 
void Push ()
 
void Pop (const sal_Int32 nSavedDC=-1)
 
WMFRasterOp SetRasterOp (WMFRasterOp nRasterOp)
 
void StrokeAndFillPath (bool bStroke, bool bFill)
 
void SetArcDirection (bool bCounterClockWise)
 
bool IsArcDirectionClockWise ()
 
void SetGfxMode (GraphicsMode nGfxMode)
 
GraphicsMode GetGfxMode () const
 
void SetBkMode (BackgroundMode nMode)
 
void SetBkColor (const Color &rColor)
 
void SetTextColor (const Color &rColor)
 
void SetTextAlign (sal_uInt32 nAlign)
 
void CreateObject (std::unique_ptr< GDIObj > pObject)
 
void CreateObjectIndexed (sal_uInt32 nIndex, std::unique_ptr< GDIObj > pObject)
 
void CreateObject ()
 
void DeleteObject (sal_uInt32 nIndex)
 
void SelectObject (sal_uInt32 nIndex)
 
rtl_TextEncoding GetCharSet () const
 
const vcl::FontGetFont () const
 
void SetTextLayoutMode (vcl::text::ComplexTextLayoutFlags nLayoutMode)
 
void ClearPath ()
 
void ClosePath ()
 
const tools::PolyPolygonGetPathObj () const
 
void MoveTo (const Point &rPoint, bool bRecordPath=false)
 
void LineTo (const Point &rPoint, bool bRecordPath=false)
 
void DrawPixel (const Point &rSource, const Color &rColor)
 
void DrawRect (const tools::Rectangle &rRect, bool bEdge=true)
 
void DrawRectWithBGColor (const tools::Rectangle &rRect)
 
void DrawRoundRect (const tools::Rectangle &rRect, const Size &rSize)
 
void DrawEllipse (const tools::Rectangle &rRect)
 
void DrawArc (const tools::Rectangle &rRect, const Point &rStartAngle, const Point &rEndAngle, bool bDrawTo=false)
 
void DrawPie (const tools::Rectangle &rRect, const Point &rStartAngle, const Point &rEndAngle)
 
void DrawChord (const tools::Rectangle &rRect, const Point &rStartAngle, const Point &rEndAngle)
 
void DrawPolygon (tools::Polygon rPolygon, bool bRecordPath)
 
void DrawPolyPolygon (tools::PolyPolygon &rPolyPolygon, bool bRecordPath=false)
 
void DrawPolyLine (tools::Polygon rPolygon, bool bDrawTo=false, bool bRecordPath=false)
 
void DrawPolyBezier (tools::Polygon rPolygon, bool bDrawTo, bool bRecordPath)
 
void DrawText (Point &rPosition, OUString const &rString, KernArray *pDXArry=nullptr, tools::Long *pDYArry=nullptr, bool bRecordPath=false, GraphicsMode nGraphicsMode=GraphicsMode::GM_COMPATIBLE)
 
void ResolveBitmapActions (std::vector< BSaveStruct > &rSaveList)
 
void IntersectClipRect (const tools::Rectangle &rRect)
 
void ExcludeClipRect (const tools::Rectangle &rRect)
 
void MoveClipRegion (const Size &rSize)
 
void SetClipPath (const tools::PolyPolygon &rPolyPoly, RegionMode nClippingMode, bool bIsMapped)
 
void SetDefaultClipPath ()
 
void UpdateClipRegion ()
 
void AddFromGDIMetaFile (GDIMetaFile &rGDIMetaFile)
 
void PassEMFPlus (void const *pBuffer, sal_uInt32 nLength)
 
void PassEMFPlusHeaderInfo ()
 
Color ReadColor ()
 
 MtfTools (GDIMetaFile &rGDIMetaFile, SvStream &rStreamWMF)
 
 ~MtfTools () COVERITY_NOEXCEPT_FALSE
 

Private Member Functions

bool ReadHeader ()
 
void ReadRecordParams (sal_uInt32 nRecordSize, sal_uInt16 nFunction)
 
Point ReadPoint ()
 
Point ReadYX ()
 
tools::Rectangle ReadRectangle ()
 
Size ReadYXExt ()
 
void GetPlaceableBound (tools::Rectangle &rSize, SvStream *pStrm)
 

Private Attributes

sal_uInt16 mnUnitsPerInch
 
sal_uInt32 mnRecSize
 
bool mbPlaceable
 
std::optional< std::vector< sal_uInt8 > > mpEMFStream
 
sal_uInt32 mnEMFRecCount
 
sal_uInt32 mnEMFRec
 
sal_uInt32 mnEMFSize
 
sal_uInt32 mnSkipActions
 
const WmfExternalmpExternalHeader
 
bool mbEnableEMFPlus = true
 

Additional Inherited Members

- Protected Member Functions inherited from emfio::MtfTools
void UpdateLineStyle ()
 
void UpdateFillStyle ()
 
Point ImplMap (const Point &rPt)
 
Point ImplScale (const Point &rPt)
 
Size ImplMap (const Size &rSize, bool bDoWorldTransform=true)
 
tools::Rectangle ImplMap (const tools::Rectangle &rRectangle)
 
void ImplMap (vcl::Font &rFont)
 
tools::PolygonImplMap (tools::Polygon &rPolygon)
 
tools::PolyPolygonImplMap (tools::PolyPolygon &rPolyPolygon)
 
void ImplScale (tools::Polygon &rPolygon)
 
tools::PolyPolygonImplScale (tools::PolyPolygon &rPolyPolygon)
 
void ImplResizeObjectArry (sal_uInt32 nNewEntry)
 
void ImplSetNonPersistentLineColorTransparenz ()
 
void ImplDrawClippedPolyPolygon (const tools::PolyPolygon &rPolyPoly)
 
void ImplDrawBitmap (const Point &rPos, const Size &rSize, const BitmapEx &rBitmap)
 
- Protected Attributes inherited from emfio::MtfTools
WinMtfPathObj maPathObj
 
WinMtfClipPath maClipPath
 
WinMtfLineStyle maLatestLineStyle
 
WinMtfLineStyle maLineStyle
 
WinMtfLineStyle maNopLineStyle
 
WinMtfFillStyle maLatestFillStyle
 
WinMtfFillStyle maFillStyle
 
WinMtfFillStyle maNopFillStyle
 
WinMtfPalette maPalette
 
vcl::Font maLatestFont
 
vcl::Font maFont
 
sal_uInt32 mnLatestTextAlign
 
sal_uInt32 mnTextAlign
 
Color maLatestTextColor
 
Color maTextColor
 
Color maLatestBkColor
 
Color maBkColor
 
vcl::text::ComplexTextLayoutFlags mnLatestTextLayoutMode
 
vcl::text::ComplexTextLayoutFlags mnTextLayoutMode
 
BackgroundMode mnLatestBkMode
 
BackgroundMode mnBkMode
 
RasterOp meLatestRasterOp
 
RasterOp meRasterOp
 
std::vector< std::unique_ptr< GDIObj > > mvGDIObj
 
Point maActPos
 
WMFRasterOp mnRop
 
std::vector< std::shared_ptr< SaveStruct > > mvSaveStack
 
GraphicsMode meGfxMode
 
MappingMode meMapMode
 
XForm maXForm
 
sal_Int32 mnDevOrgX
 
sal_Int32 mnDevOrgY
 
sal_Int32 mnDevWidth
 
sal_Int32 mnDevHeight
 
sal_Int32 mnWinOrgX
 
sal_Int32 mnWinOrgY
 
sal_Int32 mnWinExtX
 
sal_Int32 mnWinExtY
 
sal_Int32 mnPixX
 
sal_Int32 mnPixY
 
sal_Int32 mnMillX
 
sal_Int32 mnMillY
 
tools::Rectangle mrclFrame
 
tools::Rectangle mrclBounds
 
GDIMetaFilempGDIMetaFile
 
SvStreammpInputStream
 
sal_uInt32 mnStartPos
 
sal_uInt32 mnEndPos
 
std::vector< BSaveStructmaBmpSaveList
 
ScaledFontDetectCorrectHelper maScaledFontHelper
 
bool mbNopMode: 1
 
bool mbClockWiseArcDirection: 1
 
bool mbFillStyleSelected: 1
 
bool mbClipNeedsUpdate: 1
 
bool mbComplexClip: 1
 
bool mbIsMapWinSet: 1
 
bool mbIsMapDevSet: 1
 

Detailed Description

Definition at line 30 of file wmfreader.hxx.

Constructor & Destructor Documentation

◆ WmfReader()

emfio::WmfReader::WmfReader ( SvStream rStreamWMF,
GDIMetaFile rGDIMetaFile,
const WmfExternal pExternalHeader 
)

Definition at line 2002 of file wmfreader.cxx.

Member Function Documentation

◆ GetPlaceableBound()

void emfio::WmfReader::GetPlaceableBound ( tools::Rectangle rSize,
SvStream pStrm 
)
private

◆ ReadHeader()

bool emfio::WmfReader::ReadHeader ( )
private

◆ ReadPoint()

Point emfio::WmfReader::ReadPoint ( )
inlineprivate

Definition at line 251 of file wmfreader.cxx.

References emfio::MtfTools::mpInputStream, and SvStream::ReadInt16().

Referenced by GetPlaceableBound(), and ReadRecordParams().

◆ ReadRecordParams()

void emfio::WmfReader::ReadRecordParams ( sal_uInt32  nRecordSize,
sal_uInt16  nFunction 
)
private

Definition at line 287 of file wmfreader.cxx.

References a, aBuf, emfio::LOGFONTW::alfFaceName, emfio::ScaledFontDetectCorrectHelper::applyAlternativeFontScale(), vcl::text::BiDiRtl, emfio::BS_NULL, emfio::BS_PATTERN, emfio::BS_SOLID, COL_WHITE(), vcl::bitmap::CreateFromData(), emfio::MtfTools::CreateObject(), Bitmap::Crop(), BitmapEx::Crop(), vcl::text::Default, emfio::DEFAULT_CHARSET, emfio::MtfTools::DeleteObject(), emfio::MtfTools::DrawArc(), emfio::MtfTools::DrawChord(), emfio::MtfTools::DrawEllipse(), emfio::MtfTools::DrawPie(), emfio::MtfTools::DrawPixel(), emfio::MtfTools::DrawPolygon(), emfio::MtfTools::DrawPolyLine(), emfio::MtfTools::DrawPolyPolygon(), emfio::MtfTools::DrawRect(), emfio::MtfTools::DrawRectWithBGColor(), emfio::MtfTools::DrawRoundRect(), emfio::MtfTools::DrawText(), KernArray::empty(), emfio::ETO_CLIPPED, emfio::ETO_GLYPH_INDEX, emfio::ETO_OPAQUE, emfio::ETO_PDY, emfio::ETO_RTLREADING, emfio::MtfTools::ExcludeClipRect(), KernArray::get(), emfio::MtfTools::GetCharSet(), Application::GetDefaultDevice(), emfio::MtfTools::GetFont(), Bitmap::GetSizePixel(), Point::getX(), Point::getY(), SvStream::good(), Size::Height(), i, tools::PolyPolygon::Insert(), emfio::MtfTools::IntersectClipRect(), Bitmap::IsEmpty(), emfio::LF_FACESIZE, emfio::LOGFONTW::lfCharSet, emfio::LOGFONTW::lfClipPrecision, emfio::LOGFONTW::lfEscapement, emfio::LOGFONTW::lfHeight, emfio::LOGFONTW::lfItalic, emfio::LOGFONTW::lfOrientation, emfio::LOGFONTW::lfOutPrecision, emfio::LOGFONTW::lfPitchAndFamily, emfio::LOGFONTW::lfQuality, emfio::LOGFONTW::lfStrikeOut, emfio::LOGFONTW::lfUnderline, emfio::LOGFONTW::lfWeight, emfio::LOGFONTW::lfWidth, emfio::MtfTools::LineTo(), emfio::MtfTools::maBmpSaveList, o3tl::make_unsigned(), emfio::MtfTools::maScaledFontHelper, mnEMFRec, mnEMFRecCount, mnEMFSize, emfio::MtfTools::mnEndPos, mnRecSize, mnSkipActions, emfio::MtfTools::MoveClipRegion(), emfio::MtfTools::MoveTo(), mpEMFStream, emfio::MtfTools::mpInputStream, nBitCount, nCount, nIndex, nLength, tools::Rectangle::Normalize(), nVersion, emfio::OEM_CHARSET, pChar, pData, emfio::MtfTools::Pop(), emfio::PRIVATE_ESCAPE_UNICODE, emfio::MtfTools::Push(), read_uInt16s_ToOUString(), SvStream::ReadBytes(), emfio::MtfTools::ReadColor(), ReadDIB(), SvStream::ReadInt16(), SvStream::ReadInt32(), ReadPoint(), ReadRectangle(), SvStream::ReadUChar(), SvStream::ReadUInt16(), SvStream::ReadUInt32(), ReadYX(), ReadYXExt(), SvStream::remainingSize(), KernArray::resize(), emfio::RGN_COPY, SAL_INFO, SAL_MAX_UINT16, SAL_WARN, SAL_WARN_IF, emfio::MtfTools::ScaleDevExt(), emfio::MtfTools::ScaleWinExt(), SvStream::Seek(), SvStream::SeekRel(), emfio::MtfTools::SelectObject(), KernArray::set(), emfio::MtfTools::SetBkColor(), emfio::MtfTools::SetBkMode(), emfio::MtfTools::SetClipPath(), emfio::MtfTools::SetDevOrgOffset(), SvStream::SetError(), emfio::MtfTools::SetMapMode(), emfio::MtfTools::SetRasterOp(), emfio::MtfTools::SetTextAlign(), emfio::MtfTools::SetTextColor(), emfio::MtfTools::SetTextLayoutMode(), emfio::MtfTools::SetWinExt(), emfio::MtfTools::SetWinOrg(), emfio::MtfTools::SetWinOrgOffset(), Point::setX(), Point::setY(), STREAM_SEEK_TO_BEGIN, SVSTREAM_FILEFORMAT_ERROR, SvStream::Tell(), vcl::text::TextOriginLeft, W_META_ARC, W_META_CHORD, W_META_CREATEBRUSHINDIRECT, W_META_CREATEFONTINDIRECT, W_META_CREATEPENINDIRECT, W_META_DELETEOBJECT, W_META_ELLIPSE, W_META_ESCAPE, W_META_EXTTEXTOUT, W_META_INTERSECTCLIPRECT, W_META_LINETO, W_META_MOVETO, W_META_PIE, W_META_POLYGON, W_META_POLYLINE, W_META_POLYPOLYGON, W_META_RECTANGLE, W_META_RESTOREDC, W_META_ROUNDRECT, W_META_SAVEDC, W_META_SELECTOBJECT, W_META_SETBKMODE, W_META_SETPIXEL, W_META_SETROP2, W_META_SETSTRETCHBLTMODE, W_META_SETTEXTALIGN, W_META_SETTEXTCOLOR, W_META_SETWINDOWEXT, W_META_SETWINDOWORG, W_META_STRETCHDIB, W_META_TEXTOUT, emfio::W_MFCOMMENT, Size::Width(), SvStream::WriteBytes(), x, and y.

Referenced by ReadWMF().

◆ ReadRectangle()

tools::Rectangle emfio::WmfReader::ReadRectangle ( )
private

◆ ReadWMF()

void emfio::WmfReader::ReadWMF ( )

◆ ReadYX()

Point emfio::WmfReader::ReadYX ( )
inlineprivate

◆ ReadYXExt()

Size emfio::WmfReader::ReadYXExt ( )
private

Definition at line 280 of file wmfreader.cxx.

References emfio::MtfTools::mpInputStream, and SvStream::ReadInt16().

Referenced by GetPlaceableBound(), and ReadRecordParams().

◆ SetEnableEMFPlus()

void emfio::WmfReader::SetEnableEMFPlus ( bool  bEnableEMFPlus)
inline

Definition at line 75 of file wmfreader.hxx.

References mbEnableEMFPlus.

Member Data Documentation

◆ mbEnableEMFPlus

bool emfio::WmfReader::mbEnableEMFPlus = true
private

Definition at line 54 of file wmfreader.hxx.

Referenced by ReadWMF(), and SetEnableEMFPlus().

◆ mbPlaceable

bool emfio::WmfReader::mbPlaceable
private

Definition at line 35 of file wmfreader.hxx.

Referenced by GetPlaceableBound(), and ReadHeader().

◆ mnEMFRec

sal_uInt32 emfio::WmfReader::mnEMFRec
private

Definition at line 44 of file wmfreader.hxx.

Referenced by ReadRecordParams(), and ReadWMF().

◆ mnEMFRecCount

sal_uInt32 emfio::WmfReader::mnEMFRecCount
private

Definition at line 41 of file wmfreader.hxx.

Referenced by ReadRecordParams(), and ReadWMF().

◆ mnEMFSize

sal_uInt32 emfio::WmfReader::mnEMFSize
private

Definition at line 47 of file wmfreader.hxx.

Referenced by ReadRecordParams(), and ReadWMF().

◆ mnRecSize

sal_uInt32 emfio::WmfReader::mnRecSize
private

Definition at line 34 of file wmfreader.hxx.

Referenced by ReadRecordParams(), and ReadWMF().

◆ mnSkipActions

sal_uInt32 emfio::WmfReader::mnSkipActions
private

Definition at line 49 of file wmfreader.hxx.

Referenced by ReadRecordParams(), and ReadWMF().

◆ mnUnitsPerInch

sal_uInt16 emfio::WmfReader::mnUnitsPerInch
private

Definition at line 33 of file wmfreader.hxx.

Referenced by GetPlaceableBound(), and ReadHeader().

◆ mpEMFStream

std::optional<std::vector<sal_uInt8> > emfio::WmfReader::mpEMFStream
private

Definition at line 38 of file wmfreader.hxx.

Referenced by ReadRecordParams(), and ReadWMF().

◆ mpExternalHeader

const WmfExternal* emfio::WmfReader::mpExternalHeader
private

Definition at line 52 of file wmfreader.hxx.

Referenced by ReadHeader().


The documentation for this class was generated from the following files: