22 #include <osl/thread.h>
103 static char buffer[11];
104 sprintf(buffer,
"%u", static_cast<unsigned int>(nMetaAction));
110 void ImplScalePoint( Point& rPt,
double fScaleX,
double fScaleY )
112 rPt.setX(
FRound( fScaleX * rPt.X() ) );
113 rPt.setY(
FRound( fScaleY * rPt.Y() ) );
116 void ImplScaleRect(
tools::Rectangle& rRect,
double fScaleX,
double fScaleY )
121 ImplScalePoint( aTL, fScaleX, fScaleY );
122 ImplScalePoint( aBR, fScaleX, fScaleY );
128 void ImplScalePoly(
tools::Polygon& rPoly,
double fScaleX,
double fScaleY )
131 ImplScalePoint( rPoly[ i ], fScaleX, fScaleY );
134 void ImplScaleLineInfo(
LineInfo& rLineInfo,
double fScaleX,
double fScaleY )
136 if( !rLineInfo.IsDefault() )
138 const double fScale = ( fabs(fScaleX) + fabs(fScaleY) ) * 0.5;
140 rLineInfo.SetWidth(
FRound( fScale * rLineInfo.GetWidth() ) );
141 rLineInfo.SetDashLen(
FRound( fScale * rLineInfo.GetDashLen() ) );
142 rLineInfo.SetDotLen(
FRound( fScale * rLineInfo.GetDotLen() ) );
143 rLineInfo.SetDistance(
FRound( fScale * rLineInfo.GetDistance() ) );
202 SAL_INFO(
"vcl.gdi",
"ReadMetaAction " << meta_action_name( nType ));
263 VersionCompatRead aCompat(rIStm);
269 pAction->Read( rIStm, pData );
283 rIStm.
WriteUInt32(static_cast<sal_uInt32>(aColor));
286 MetaPixelAction::MetaPixelAction() :
290 MetaPixelAction::~MetaPixelAction()
293 MetaPixelAction::MetaPixelAction(
const Point& rPt,
const Color& rColor ) :
306 return new MetaPixelAction( *
this );
311 maPt.Move( nHorzMove, nVertMove );
314 void MetaPixelAction::Scale(
double fScaleX,
double fScaleY )
316 ImplScalePoint( maPt, fScaleX, fScaleY );
322 VersionCompatWrite aCompat(rOStm, 1);
324 aSerializer.writePoint(maPt);
325 WriteColor(rOStm, maColor);
330 VersionCompatRead aCompat(rIStm);
332 aSerializer.readPoint(maPt);
333 ReadColor(rIStm, maColor);
360 maPt.Move( nHorzMove, nVertMove );
365 ImplScalePoint(
maPt, fScaleX, fScaleY );
371 VersionCompatWrite aCompat(rOStm, 1);
378 VersionCompatRead aCompat(rIStm);
392 maStartPt ( rStart ),
399 maLineInfo ( rLineInfo ),
400 maStartPt ( rStart ),
420 maEndPt.Move( nHorzMove, nVertMove );
425 ImplScalePoint(
maStartPt, fScaleX, fScaleY );
426 ImplScalePoint(
maEndPt, fScaleX, fScaleY );
427 ImplScaleLineInfo(
maLineInfo, fScaleX, fScaleY );
433 VersionCompatWrite aCompat(rOStm, 2);
445 VersionCompatRead aCompat(rIStm);
453 if( aCompat.GetVersion() >= 2 )
488 ImplScaleRect(
maRect, fScaleX, fScaleY );
494 VersionCompatWrite aCompat(rOStm, 1);
501 VersionCompatRead aCompat(rIStm);
506 MetaRoundRectAction::MetaRoundRectAction() :
512 MetaRoundRectAction::~MetaRoundRectAction()
516 sal_uInt32 nHorzRound, sal_uInt32 nVertRound ) :
519 mnHorzRound ( nHorzRound ),
520 mnVertRound ( nVertRound )
525 pOut->
DrawRect( maRect, mnHorzRound, mnVertRound );
530 return new MetaRoundRectAction( *
this );
535 maRect.Move( nHorzMove, nVertMove );
538 void MetaRoundRectAction::Scale(
double fScaleX,
double fScaleY )
540 ImplScaleRect( maRect, fScaleX, fScaleY );
541 mnHorzRound =
FRound( mnHorzRound * fabs(fScaleX) );
542 mnVertRound =
FRound( mnVertRound * fabs(fScaleY) );
548 VersionCompatWrite aCompat(rOStm, 1);
550 aSerializer.writeRectangle(maRect);
556 VersionCompatRead aCompat(rIStm);
558 aSerializer.readRectangle(maRect);
562 MetaEllipseAction::MetaEllipseAction() :
566 MetaEllipseAction::~MetaEllipseAction()
581 return new MetaEllipseAction( *
this );
586 maRect.Move( nHorzMove, nVertMove );
589 void MetaEllipseAction::Scale(
double fScaleX,
double fScaleY )
591 ImplScaleRect( maRect, fScaleX, fScaleY );
597 VersionCompatWrite aCompat(rOStm, 1);
599 aSerializer.writeRectangle(maRect);
604 VersionCompatRead aCompat(rIStm);
606 aSerializer.readRectangle(maRect);
609 MetaArcAction::MetaArcAction() :
613 MetaArcAction::~MetaArcAction()
617 const Point& rStart,
const Point& rEnd ) :
620 maStartPt ( rStart ),
626 pOut->
DrawArc( maRect, maStartPt, maEndPt );
631 return new MetaArcAction( *
this );
636 maRect.Move( nHorzMove, nVertMove );
637 maStartPt.Move( nHorzMove, nVertMove );
638 maEndPt.Move( nHorzMove, nVertMove );
641 void MetaArcAction::Scale(
double fScaleX,
double fScaleY )
643 ImplScaleRect( maRect, fScaleX, fScaleY );
644 ImplScalePoint( maStartPt, fScaleX, fScaleY );
645 ImplScalePoint( maEndPt, fScaleX, fScaleY );
651 VersionCompatWrite aCompat(rOStm, 1);
653 aSerializer.writeRectangle(maRect);
654 aSerializer.writePoint(maStartPt);
655 aSerializer.writePoint(maEndPt);
660 VersionCompatRead aCompat(rIStm);
662 aSerializer.readRectangle(maRect);
663 aSerializer.readPoint(maStartPt);
664 aSerializer.readPoint(maEndPt);
667 MetaPieAction::MetaPieAction() :
671 MetaPieAction::~MetaPieAction()
675 const Point& rStart,
const Point& rEnd ) :
678 maStartPt ( rStart ),
684 pOut->
DrawPie( maRect, maStartPt, maEndPt );
689 return new MetaPieAction( *
this );
694 maRect.Move( nHorzMove, nVertMove );
695 maStartPt.Move( nHorzMove, nVertMove );
696 maEndPt.Move( nHorzMove, nVertMove );
699 void MetaPieAction::Scale(
double fScaleX,
double fScaleY )
701 ImplScaleRect( maRect, fScaleX, fScaleY );
702 ImplScalePoint( maStartPt, fScaleX, fScaleY );
703 ImplScalePoint( maEndPt, fScaleX, fScaleY );
709 VersionCompatWrite aCompat(rOStm, 1);
711 aSerializer.writeRectangle(maRect);
712 aSerializer.writePoint(maStartPt);
713 aSerializer.writePoint(maEndPt);
718 VersionCompatRead aCompat(rIStm);
720 aSerializer.readRectangle(maRect);
721 aSerializer.readPoint(maStartPt);
722 aSerializer.readPoint(maEndPt);
725 MetaChordAction::MetaChordAction() :
729 MetaChordAction::~MetaChordAction()
733 const Point& rStart,
const Point& rEnd ) :
736 maStartPt ( rStart ),
742 pOut->
DrawChord( maRect, maStartPt, maEndPt );
747 return new MetaChordAction( *
this );
752 maRect.Move( nHorzMove, nVertMove );
753 maStartPt.Move( nHorzMove, nVertMove );
754 maEndPt.Move( nHorzMove, nVertMove );
757 void MetaChordAction::Scale(
double fScaleX,
double fScaleY )
759 ImplScaleRect( maRect, fScaleX, fScaleY );
760 ImplScalePoint( maStartPt, fScaleX, fScaleY );
761 ImplScalePoint( maEndPt, fScaleX, fScaleY );
767 VersionCompatWrite aCompat(rOStm, 1);
769 aSerializer.writeRectangle(maRect);
770 aSerializer.writePoint(maStartPt);
771 aSerializer.writePoint(maEndPt);
776 VersionCompatRead aCompat(rIStm);
778 aSerializer.readRectangle(maRect);
779 aSerializer.readPoint(maStartPt);
780 aSerializer.readPoint(maEndPt);
783 MetaPolyLineAction::MetaPolyLineAction() :
787 MetaPolyLineAction::~MetaPolyLineAction()
790 MetaPolyLineAction::MetaPolyLineAction(
const tools::Polygon& rPoly ) :
797 maLineInfo ( rLineInfo ),
803 if( maLineInfo.IsDefault() )
811 return new MetaPolyLineAction( *
this );
816 maPoly.Move( nHorzMove, nVertMove );
819 void MetaPolyLineAction::Scale(
double fScaleX,
double fScaleY )
821 ImplScalePoly( maPoly, fScaleX, fScaleY );
822 ImplScaleLineInfo( maLineInfo, fScaleX, fScaleY );
828 VersionCompatWrite aCompat(rOStm, 3);
836 bool bHasPolyFlags = maPoly.HasFlags();
839 maPoly.Write( rOStm );
844 VersionCompatRead aCompat(rIStm);
850 if( aCompat.GetVersion() >= 2 )
852 if ( aCompat.GetVersion() >= 3 )
857 maPoly.Read( rIStm );
861 MetaPolygonAction::MetaPolygonAction() :
865 MetaPolygonAction::~MetaPolygonAction()
868 MetaPolygonAction::MetaPolygonAction(
const tools::Polygon& rPoly ) :
880 return new MetaPolygonAction( *
this );
885 maPoly.Move( nHorzMove, nVertMove );
888 void MetaPolygonAction::Scale(
double fScaleX,
double fScaleY )
890 ImplScalePoly( maPoly, fScaleX, fScaleY );
896 VersionCompatWrite aCompat(rOStm, 2);
902 bool bHasPolyFlags = maPoly.HasFlags();
905 maPoly.Write( rOStm );
910 VersionCompatRead aCompat(rIStm);
914 if( aCompat.GetVersion() >= 2 )
919 maPoly.Read( rIStm );
923 MetaPolyPolygonAction::MetaPolyPolygonAction() :
927 MetaPolyPolygonAction::~MetaPolyPolygonAction()
932 maPolyPoly ( rPolyPoly )
935 void MetaPolyPolygonAction::Execute(
OutputDevice* pOut )
942 return new MetaPolyPolygonAction( *
this );
947 maPolyPoly.Move( nHorzMove, nVertMove );
950 void MetaPolyPolygonAction::Scale(
double fScaleX,
double fScaleY )
952 for( sal_uInt16 i = 0, nCount = maPolyPoly.Count();
i < nCount;
i++ )
953 ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
959 VersionCompatWrite aCompat(rOStm, 2);
961 sal_uInt16 nNumberOfComplexPolygons = 0;
962 sal_uInt16
i, nPolyCount = maPolyPoly.Count();
966 for ( i = 0; i < nPolyCount; i++ )
970 nNumberOfComplexPolygons++;
976 for ( i = 0; nNumberOfComplexPolygons && ( i < nPolyCount ); i++ )
982 rPoly.
Write( rOStm );
984 nNumberOfComplexPolygons--;
991 VersionCompatRead aCompat(rIStm);
994 if ( aCompat.GetVersion() < 2 )
997 sal_uInt16 nNumberOfComplexPolygons(0);
999 const size_t nMinRecordSize =
sizeof(sal_uInt16);
1000 const size_t nMaxRecords = rIStm.
remainingSize() / nMinRecordSize;
1001 if (nNumberOfComplexPolygons > nMaxRecords)
1003 SAL_WARN(
"vcl.gdi",
"Parsing error: " << nMaxRecords <<
1004 " max possible entries, but " << nNumberOfComplexPolygons <<
" claimed, truncating");
1005 nNumberOfComplexPolygons = nMaxRecords;
1007 for (sal_uInt16 i = 0; i < nNumberOfComplexPolygons; ++i)
1012 aPoly.
Read( rIStm );
1013 if (nIndex >= maPolyPoly.Count())
1015 SAL_WARN(
"vcl.gdi",
"svm contains polygon index " << nIndex
1016 <<
" outside possible range " << maPolyPoly.Count());
1019 maPolyPoly.Replace( aPoly, nIndex );
1033 sal_Int32 nIndex, sal_Int32 nLen ) :
1053 maPt.Move( nHorzMove, nVertMove );
1058 ImplScalePoint(
maPt, fScaleX, fScaleY );
1064 VersionCompatWrite aCompat(rOStm, 2);
1076 VersionCompatRead aCompat(rIStm);
1080 sal_uInt16 nTmpIndex(0);
1083 sal_uInt16 nTmpLen(0);
1087 if ( aCompat.GetVersion() >= 2 )
1091 MetaTextArrayAction::MetaTextArrayAction() :
1097 MetaTextArrayAction::MetaTextArrayAction(
const MetaTextArrayAction& rAction ) :
1099 maStartPt ( rAction.maStartPt ),
1100 maStr ( rAction.maStr ),
1102 mnLen ( rAction.mnLen )
1104 if( rAction.mpDXAry )
1107 memcpy( mpDXAry.get(), rAction.mpDXAry.get(), mnLen *
sizeof(
tools::Long ) );
1111 MetaTextArrayAction::MetaTextArrayAction(
const Point& rStartPt,
1112 const OUString& rStr,
1117 maStartPt ( rStartPt ),
1122 const sal_Int32 nAryLen = pDXAry ?
mnLen : 0;
1127 memcpy( mpDXAry.get(), pDXAry, nAryLen *
sizeof(
tools::Long) );
1131 MetaTextArrayAction::~MetaTextArrayAction()
1135 void MetaTextArrayAction::Execute(
OutputDevice* pOut )
1142 return new MetaTextArrayAction( *
this );
1147 maStartPt.Move( nHorzMove, nVertMove );
1150 void MetaTextArrayAction::Scale(
double fScaleX,
double fScaleY )
1152 ImplScalePoint( maStartPt, fScaleX, fScaleY );
1154 if ( mpDXAry && mnLen )
1156 for ( sal_uInt16 i = 0, nCount = mnLen; i < nCount; i++ )
1157 mpDXAry[ i ] =
FRound( mpDXAry[ i ] * fabs(fScaleX) );
1163 const sal_Int32 nAryLen = mpDXAry ? mnLen : 0;
1166 VersionCompatWrite aCompat(rOStm, 2);
1168 aSerializer.writePoint(maStartPt);
1174 for (sal_Int32 i = 0; i < nAryLen; ++i)
1184 VersionCompatRead aCompat(rIStm);
1186 aSerializer.readPoint(maStartPt);
1188 sal_uInt16 nTmpIndex(0);
1191 sal_uInt16 nTmpLen(0);
1194 sal_Int32 nAryLen(0);
1197 if (mnLen > maStr.getLength() -
mnIndex)
1207 if ( mnLen >= nAryLen )
1209 mpDXAry.reset(
new (std::nothrow)
tools::Long[ mnLen ] );
1214 for( i = 0; i < nAryLen; i++ )
1220 for( ; i < mnLen; i++ )
1233 if ( aCompat.GetVersion() >= 2 )
1237 if ( mnIndex + mnLen > maStr.getLength() )
1256 const OUString& rStr,
1257 sal_Int32 nIndex, sal_Int32 nLen ) :
1278 maPt.Move( nHorzMove, nVertMove );
1283 ImplScalePoint(
maPt, fScaleX, fScaleY );
1290 VersionCompatWrite aCompat(rOStm, 2);
1303 VersionCompatRead aCompat(rIStm);
1308 sal_uInt16 nTmpIndex(0);
1311 sal_uInt16 nTmpLen(0);
1315 if ( aCompat.GetVersion() >= 2 )
1352 ImplScaleRect(
maRect, fScaleX, fScaleY );
1358 VersionCompatWrite aCompat(rOStm, 2);
1369 VersionCompatRead aCompat(rIStm);
1377 if ( aCompat.GetVersion() >= 2 )
1399 meStrikeout ( eStrikeout ),
1400 meUnderline ( eUnderline ),
1401 meOverline ( eOverline )
1416 maPos.Move( nHorzMove, nVertMove );
1421 ImplScalePoint(
maPos, fScaleX, fScaleY );
1428 VersionCompatWrite aCompat(rOStm, 2);
1442 VersionCompatRead aCompat(rIStm);
1444 sal_Int32 nTempWidth(0);
1450 sal_uInt32 nTempStrikeout(0);
1454 sal_uInt32 nTempUnderline(0);
1458 if (aCompat.GetVersion() >= 2)
1460 sal_uInt32 nTempOverline(0);
1491 maPt.Move( nHorzMove, nVertMove );
1496 ImplScalePoint(
maPt, fScaleX, fScaleY );
1504 VersionCompatWrite aCompat(rOStm, 1);
1513 VersionCompatRead aCompat(rIStm);
1546 maPt.Move( nHorzMove, nVertMove );
1552 ImplScaleRect( aRectangle, fScaleX, fScaleY );
1562 VersionCompatWrite aCompat(rOStm, 1);
1573 VersionCompatRead aCompat(rIStm);
1580 MetaBmpScalePartAction::MetaBmpScalePartAction() :
1584 MetaBmpScalePartAction::~MetaBmpScalePartAction()
1587 MetaBmpScalePartAction::MetaBmpScalePartAction(
const Point& rDstPt,
const Size& rDstSz,
1588 const Point& rSrcPt,
const Size& rSrcSz,
1598 void MetaBmpScalePartAction::Execute(
OutputDevice* pOut )
1600 pOut->
DrawBitmap( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmp );
1605 return new MetaBmpScalePartAction( *
this );
1610 maDstPt.Move( nHorzMove, nVertMove );
1613 void MetaBmpScalePartAction::Scale(
double fScaleX,
double fScaleY )
1616 ImplScaleRect( aRectangle, fScaleX, fScaleY );
1617 maDstPt = aRectangle.TopLeft();
1618 maDstSz = aRectangle.GetSize();
1626 VersionCompatWrite aCompat(rOStm, 1);
1627 WriteDIB(maBmp, rOStm,
false,
true);
1629 aSerializer.writePoint(maDstPt);
1630 aSerializer.writeSize(maDstSz);
1631 aSerializer.writePoint(maSrcPt);
1632 aSerializer.writeSize(maSrcSz);
1639 VersionCompatRead aCompat(rIStm);
1642 aSerializer.readPoint(maDstPt);
1643 aSerializer.readSize(maDstSz);
1644 aSerializer.readPoint(maSrcPt);
1645 aSerializer.readSize(maSrcSz);
1673 maPt.Move( nHorzMove, nVertMove );
1678 ImplScalePoint(
maPt, fScaleX, fScaleY );
1686 VersionCompatWrite aCompat(rOStm, 1);
1695 VersionCompatRead aCompat(rIStm);
1728 maPt.Move( nHorzMove, nVertMove );
1734 ImplScaleRect( aRectangle, fScaleX, fScaleY );
1744 VersionCompatWrite aCompat(rOStm, 1);
1754 VersionCompatRead aCompat(rIStm);
1761 MetaBmpExScalePartAction::MetaBmpExScalePartAction() :
1765 MetaBmpExScalePartAction::~MetaBmpExScalePartAction()
1768 MetaBmpExScalePartAction::MetaBmpExScalePartAction(
const Point& rDstPt,
const Size& rDstSz,
1769 const Point& rSrcPt,
const Size& rSrcSz,
1779 void MetaBmpExScalePartAction::Execute(
OutputDevice* pOut )
1781 pOut->
DrawBitmapEx( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmpEx );
1786 return new MetaBmpExScalePartAction( *
this );
1791 maDstPt.Move( nHorzMove, nVertMove );
1794 void MetaBmpExScalePartAction::Scale(
double fScaleX,
double fScaleY )
1797 ImplScaleRect( aRectangle, fScaleX, fScaleY );
1798 maDstPt = aRectangle.TopLeft();
1799 maDstSz = aRectangle.GetSize();
1804 if( !!maBmpEx.GetBitmap() )
1807 VersionCompatWrite aCompat(rOStm, 1);
1810 aSerializer.writePoint(maDstPt);
1811 aSerializer.writeSize(maDstSz);
1812 aSerializer.writePoint(maSrcPt);
1813 aSerializer.writeSize(maSrcSz);
1819 VersionCompatRead aCompat(rIStm);
1822 aSerializer.readPoint(maDstPt);
1823 aSerializer.readSize(maDstSz);
1824 aSerializer.readPoint(maSrcPt);
1825 aSerializer.readSize(maSrcSz);
1837 const Color& rColor ) :
1856 maPt.Move( nHorzMove, nVertMove );
1861 ImplScalePoint(
maPt, fScaleX, fScaleY );
1869 VersionCompatWrite aCompat(rOStm, 1);
1878 VersionCompatRead aCompat(rIStm);
1893 const Color& rColor ) :
1913 maPt.Move( nHorzMove, nVertMove );
1919 ImplScaleRect( aRectangle, fScaleX, fScaleY );
1929 VersionCompatWrite aCompat(rOStm, 1);
1939 VersionCompatRead aCompat(rIStm);
1954 const Point& rSrcPt,
const Size& rSrcSz,
1956 const Color& rColor ) :
1978 maDstPt.Move( nHorzMove, nVertMove );
1984 ImplScaleRect( aRectangle, fScaleX, fScaleY );
1994 VersionCompatWrite aCompat(rOStm, 1);
2007 VersionCompatRead aCompat(rIStm);
2027 maGradient ( rGradient )
2047 ImplScaleRect(
maRect, fScaleX, fScaleY );
2053 VersionCompatWrite aCompat(rOStm, 1);
2061 VersionCompatRead aCompat(rIStm);
2067 MetaGradientExAction::MetaGradientExAction() :
2073 maPolyPoly ( rPolyPoly ),
2074 maGradient ( rGradient )
2077 MetaGradientExAction::~MetaGradientExAction()
2080 void MetaGradientExAction::Execute(
OutputDevice* pOut )
2090 return new MetaGradientExAction( *
this );
2095 maPolyPoly.Move( nHorzMove, nVertMove );
2098 void MetaGradientExAction::Scale(
double fScaleX,
double fScaleY )
2100 for( sal_uInt16 i = 0, nCount = maPolyPoly.Count(); i < nCount; i++ )
2101 ImplScalePoly( maPolyPoly[ i ], fScaleX, fScaleY );
2107 VersionCompatWrite aCompat(rOStm, 1);
2115 aSerializer.writeGradient(maGradient);
2120 VersionCompatRead aCompat(rIStm);
2123 aSerializer.readGradient(maGradient);
2135 maPolyPoly ( rPolyPoly ),
2157 ImplScalePoly(
maPolyPoly[ i ], fScaleX, fScaleY );
2163 VersionCompatWrite aCompat(rOStm, 1);
2175 VersionCompatRead aCompat(rIStm);
2180 MetaWallpaperAction::MetaWallpaperAction() :
2184 MetaWallpaperAction::~MetaWallpaperAction()
2191 maWallpaper ( rPaper )
2194 void MetaWallpaperAction::Execute(
OutputDevice* pOut )
2201 return new MetaWallpaperAction( *
this );
2206 maRect.Move( nHorzMove, nVertMove );
2209 void MetaWallpaperAction::Scale(
double fScaleX,
double fScaleY )
2211 ImplScaleRect( maRect, fScaleX, fScaleY );
2217 VersionCompatWrite aCompat(rOStm, 1);
2224 VersionCompatRead aCompat(rIStm);
2228 MetaClipRegionAction::MetaClipRegionAction() :
2233 MetaClipRegionAction::~MetaClipRegionAction()
2236 MetaClipRegionAction::MetaClipRegionAction(
const vcl::Region& rRegion,
bool bClip ) :
2238 maRegion ( rRegion ),
2242 void MetaClipRegionAction::Execute(
OutputDevice* pOut )
2252 return new MetaClipRegionAction( *
this );
2257 maRegion.Move( nHorzMove, nVertMove );
2260 void MetaClipRegionAction::Scale(
double fScaleX,
double fScaleY )
2262 maRegion.Scale( fScaleX, fScaleY );
2268 VersionCompatWrite aCompat(rOStm, 1);
2276 VersionCompatRead aCompat(rIStm);
2281 MetaISectRectClipRegionAction::MetaISectRectClipRegionAction() :
2285 MetaISectRectClipRegionAction::~MetaISectRectClipRegionAction()
2288 MetaISectRectClipRegionAction::MetaISectRectClipRegionAction(
const tools::Rectangle& rRect ) :
2293 void MetaISectRectClipRegionAction::Execute(
OutputDevice* pOut )
2300 return new MetaISectRectClipRegionAction( *
this );
2305 maRect.Move( nHorzMove, nVertMove );
2308 void MetaISectRectClipRegionAction::Scale(
double fScaleX,
double fScaleY )
2310 ImplScaleRect( maRect, fScaleX, fScaleY );
2316 VersionCompatWrite aCompat(rOStm, 1);
2318 aSerializer.writeRectangle(maRect);
2323 VersionCompatRead aCompat(rIStm);
2325 aSerializer.readRectangle(maRect);
2328 MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction() :
2332 MetaISectRegionClipRegionAction::~MetaISectRegionClipRegionAction()
2335 MetaISectRegionClipRegionAction::MetaISectRegionClipRegionAction(
const vcl::Region& rRegion ) :
2337 maRegion ( rRegion )
2341 void MetaISectRegionClipRegionAction::Execute(
OutputDevice* pOut )
2348 return new MetaISectRegionClipRegionAction( *
this );
2353 maRegion.Move( nHorzMove, nVertMove );
2356 void MetaISectRegionClipRegionAction::Scale(
double fScaleX,
double fScaleY )
2358 maRegion.Scale( fScaleX, fScaleY );
2364 VersionCompatWrite aCompat(rOStm, 1);
2370 VersionCompatRead aCompat(rIStm);
2374 MetaMoveClipRegionAction::MetaMoveClipRegionAction() :
2380 MetaMoveClipRegionAction::~MetaMoveClipRegionAction()
2385 mnHorzMove ( nHorzMove ),
2386 mnVertMove ( nVertMove )
2389 void MetaMoveClipRegionAction::Execute(
OutputDevice* pOut )
2396 return new MetaMoveClipRegionAction( *
this );
2399 void MetaMoveClipRegionAction::Scale(
double fScaleX,
double fScaleY )
2401 mnHorzMove =
FRound( mnHorzMove * fScaleX );
2402 mnVertMove =
FRound( mnVertMove * fScaleY );
2408 VersionCompatWrite aCompat(rOStm, 1);
2414 VersionCompatRead aCompat(rIStm);
2415 sal_Int32 nTmpHM(0), nTmpVM(0);
2417 mnHorzMove = nTmpHM;
2418 mnVertMove = nTmpVM;
2451 VersionCompatWrite aCompat(rOStm, 1);
2458 VersionCompatRead aCompat(rIStm);
2493 VersionCompatWrite aCompat(rOStm, 1);
2500 VersionCompatRead aCompat(rIStm);
2505 MetaTextColorAction::MetaTextColorAction() :
2509 MetaTextColorAction::~MetaTextColorAction()
2512 MetaTextColorAction::MetaTextColorAction(
const Color& rColor ) :
2517 void MetaTextColorAction::Execute(
OutputDevice* pOut )
2524 return new MetaTextColorAction( *
this );
2530 VersionCompatWrite aCompat(rOStm, 1);
2531 WriteColor(rOStm, maColor);
2536 VersionCompatRead aCompat(rIStm);
2537 ReadColor(rIStm, maColor);
2540 MetaTextFillColorAction::MetaTextFillColorAction() :
2545 MetaTextFillColorAction::~MetaTextFillColorAction()
2548 MetaTextFillColorAction::MetaTextFillColorAction(
const Color& rColor,
bool bSet ) :
2554 void MetaTextFillColorAction::Execute(
OutputDevice* pOut )
2564 return new MetaTextFillColorAction( *
this );
2570 VersionCompatWrite aCompat(rOStm, 1);
2571 WriteColor(rOStm, maColor);
2577 VersionCompatRead aCompat(rIStm);
2578 ReadColor(rIStm, maColor);
2582 MetaTextLineColorAction::MetaTextLineColorAction() :
2587 MetaTextLineColorAction::~MetaTextLineColorAction()
2590 MetaTextLineColorAction::MetaTextLineColorAction(
const Color& rColor,
bool bSet ) :
2596 void MetaTextLineColorAction::Execute(
OutputDevice* pOut )
2606 return new MetaTextLineColorAction( *
this );
2612 VersionCompatWrite aCompat(rOStm, 1);
2613 WriteColor(rOStm, maColor);
2619 VersionCompatRead aCompat(rIStm);
2620 ReadColor(rIStm, maColor);
2624 MetaOverlineColorAction::MetaOverlineColorAction() :
2629 MetaOverlineColorAction::~MetaOverlineColorAction()
2632 MetaOverlineColorAction::MetaOverlineColorAction(
const Color& rColor,
bool bSet ) :
2638 void MetaOverlineColorAction::Execute(
OutputDevice* pOut )
2648 return new MetaOverlineColorAction( *
this );
2654 VersionCompatWrite aCompat(rOStm, 1);
2655 WriteColor(rOStm, maColor);
2661 VersionCompatRead aCompat(rIStm);
2662 ReadColor(rIStm, maColor);
2666 MetaTextAlignAction::MetaTextAlignAction() :
2671 MetaTextAlignAction::~MetaTextAlignAction()
2674 MetaTextAlignAction::MetaTextAlignAction(
TextAlign aAlign ) :
2679 void MetaTextAlignAction::Execute(
OutputDevice* pOut )
2686 return new MetaTextAlignAction( *
this );
2692 VersionCompatWrite aCompat(rOStm, 1);
2698 sal_uInt16 nTmp16(0);
2700 VersionCompatRead aCompat(rIStm);
2704 MetaMapModeAction::MetaMapModeAction() :
2708 MetaMapModeAction::~MetaMapModeAction()
2711 MetaMapModeAction::MetaMapModeAction(
const MapMode& rMapMode ) :
2713 maMapMode ( rMapMode )
2723 return new MetaMapModeAction( *
this );
2726 void MetaMapModeAction::Scale(
double fScaleX,
double fScaleY )
2728 Point aPoint( maMapMode.GetOrigin() );
2730 ImplScalePoint( aPoint, fScaleX, fScaleY );
2731 maMapMode.SetOrigin( aPoint );
2737 VersionCompatWrite aCompat(rOStm, 1);
2743 VersionCompatRead aCompat(rIStm);
2747 MetaFontAction::MetaFontAction() :
2751 MetaFontAction::~MetaFontAction()
2754 MetaFontAction::MetaFontAction(
const vcl::Font& rFont ) :
2763 && ( maFont.GetCharSet() != RTL_TEXTENCODING_UNICODE ) )
2765 maFont.SetCharSet( RTL_TEXTENCODING_UNICODE );
2776 return new MetaFontAction( *
this );
2779 void MetaFontAction::Scale(
double fScaleX,
double fScaleY )
2782 FRound(maFont.GetFontSize().Width() * fabs(fScaleX)),
2783 FRound(maFont.GetFontSize().Height() * fabs(fScaleY)));
2784 maFont.SetFontSize( aSize );
2790 VersionCompatWrite aCompat(rOStm, 1);
2799 VersionCompatRead aCompat(rIStm);
2806 MetaPushAction::MetaPushAction() :
2811 MetaPushAction::~MetaPushAction()
2814 MetaPushAction::MetaPushAction(
PushFlags nFlags ) :
2821 pOut->
Push( mnFlags );
2826 return new MetaPushAction( *
this );
2832 VersionCompatWrite aCompat(rOStm, 1);
2833 rOStm.
WriteUInt16( static_cast<sal_uInt16>(mnFlags) );
2838 VersionCompatRead aCompat(rIStm);
2844 MetaPopAction::MetaPopAction() :
2848 MetaPopAction::~MetaPopAction()
2858 return new MetaPopAction( *
this );
2864 VersionCompatWrite aCompat(rOStm, 1);
2869 VersionCompatRead aCompat(rIStm);
2872 MetaRasterOpAction::MetaRasterOpAction() :
2877 MetaRasterOpAction::~MetaRasterOpAction()
2880 MetaRasterOpAction::MetaRasterOpAction(
RasterOp eRasterOp ) :
2882 meRasterOp ( eRasterOp )
2893 return new MetaRasterOpAction( *
this );
2899 VersionCompatWrite aCompat(rOStm, 1);
2900 rOStm.
WriteUInt16( static_cast<sal_uInt16>(meRasterOp) );
2905 sal_uInt16 nTmp16(0);
2907 VersionCompatRead aCompat(rIStm);
2913 mnTransPercent ( 0 )
2921 maPolyPoly ( rPolyPoly ),
2922 mnTransPercent ( nTransPercent )
2943 ImplScalePoly(
maPolyPoly[ i ], fScaleX, fScaleY );
2949 VersionCompatWrite aCompat(rOStm, 1);
2969 VersionCompatRead aCompat(rIStm);
2987 maGradient ( rGradient )
3002 maPoint.Move( nHorzMove, nVertMove );
3008 ImplScaleRect( aRectangle, fScaleX, fScaleY );
3016 VersionCompatWrite aCompat(rOStm, 1);
3027 VersionCompatRead aCompat(rIStm);
3045 maGfxLink ( rGfxLink ),
3063 maPoint.Move( nHorzMove, nVertMove );
3069 ImplScaleRect( aRectangle, fScaleX, fScaleY );
3077 VersionCompatWrite aCompat(rOStm, 1);
3088 VersionCompatRead aCompat(rIStm);
3096 MetaRefPointAction::MetaRefPointAction() :
3101 MetaRefPointAction::~MetaRefPointAction()
3104 MetaRefPointAction::MetaRefPointAction(
const Point& rRefPoint,
bool bSet ) :
3106 maRefPoint ( rRefPoint ),
3120 return new MetaRefPointAction( *
this );
3126 VersionCompatWrite aCompat(rOStm, 1);
3129 aSerializer.writePoint(maRefPoint);
3135 VersionCompatRead aCompat(rIStm);
3137 aSerializer.readPoint(maRefPoint);
3170 if ( nDataSize && pData )
3198 if ( !(nXMove || nYMove) )
3204 bool bPathStroke = (
maComment ==
"XPATHSTROKE_SEQ_BEGIN");
3205 if ( !(bPathStroke ||
maComment ==
"XPATHFILL_SEQ_BEGIN") )
3217 aPath.
Move( nXMove, nYMove );
3222 aStartArrow.
Move(nXMove, nYMove);
3227 aEndArrow.
Move(nXMove, nYMove);
3239 aPath.
Move( nXMove, nYMove );
3254 if (( fXScale == 1.0 ) && ( fYScale == 1.0 ))
3260 bool bPathStroke = (
maComment ==
"XPATHSTROKE_SEQ_BEGIN");
3261 if ( bPathStroke ||
maComment ==
"XPATHFILL_SEQ_BEGIN" )
3269 aStroke.
scale( fXScale, fYScale );
3278 aPath.
Scale( fXScale, fYScale );
3284 }
else if(
maComment ==
"EMF_PLUS_HEADER_INFO" ){
3288 sal_Int32 nLeft(0), nRight(0), nTop(0), nBottom(0);
3289 sal_Int32 nPixX(0), nPixY(0), nMillX(0), nMillY(0);
3290 float m11(0), m12(0), m21(0), m22(0), mdx(0), mdy(0);
3316 VersionCompatWrite aCompat(rOStm, 1);
3326 VersionCompatRead aCompat(rIStm);
3333 " available data, but " <<
mnDataSize <<
" claimed, truncating");
3348 MetaLayoutModeAction::MetaLayoutModeAction() :
3353 MetaLayoutModeAction::~MetaLayoutModeAction()
3358 mnLayoutMode( nLayoutMode )
3361 void MetaLayoutModeAction::Execute(
OutputDevice* pOut )
3368 return new MetaLayoutModeAction( *
this );
3374 VersionCompatWrite aCompat(rOStm, 1);
3375 rOStm.
WriteUInt32( static_cast<sal_uInt32>(mnLayoutMode) );
3380 VersionCompatRead aCompat(rIStm);
3386 MetaTextLanguageAction::MetaTextLanguageAction() :
3391 MetaTextLanguageAction::~MetaTextLanguageAction()
3394 MetaTextLanguageAction::MetaTextLanguageAction(
LanguageType eTextLanguage ) :
3396 meTextLanguage( eTextLanguage )
3399 void MetaTextLanguageAction::Execute(
OutputDevice* pOut )
3406 return new MetaTextLanguageAction( *
this );
3412 VersionCompatWrite aCompat(rOStm, 1);
3413 rOStm.
WriteUInt16( static_cast<sal_uInt16>(meTextLanguage) );
3418 VersionCompatRead aCompat(rIStm);
3419 sal_uInt16 nTmp = 0;
SvStream & WriteBool(bool b)
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
void SetDigitLanguage(LanguageType)
virtual ~MetaStretchTextAction() override
virtual void Read(SvStream &rIStm, ImplMetaReadData *pData) override
void setStartArrow(const tools::PolyPolygon &)
Set the polygon that is put at the start of the line.
SvStream & WriteHatch(SvStream &rOStm, const Hatch &rHatch)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteInt32(sal_Int32 nInt32)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
virtual ~MetaTextAction() override
SvStream & WriteMapMode(SvStream &rOStm, const MapMode &rMapMode)
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual rtl::Reference< MetaAction > Clone() override
virtual rtl::Reference< MetaAction > Clone() override
virtual void Scale(double fScaleX, double fScaleY) override
SvStream & WriteFont(SvStream &rOStm, const vcl::Font &rFont)
SvStream & ReadCharAsBool(bool &rBool)
void DrawPolygon(const tools::Polygon &rPoly)
Render the given polygon.
Encapsulates geometry and associated attributes of a graphical 'pen stroke'.
void DrawChord(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
void DrawPolyLine(const tools::Polygon &rPoly)
Render the given polygon as a line stroke.
virtual void Execute(OutputDevice *pOut) override
void SetLayoutMode(ComplexTextLayoutFlags nTextLayoutMode)
void IntersectClipRegion(const tools::Rectangle &rRect)
GDIMetaFile * GetConnectMetaFile() const
void DrawTextLine(const Point &rPos, tools::Long nWidth, FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline, bool bUnderlineAbove=false)
void DrawMask(const Point &rDestPt, const Bitmap &rBitmap, const Color &rMaskColor)
void writeGfxLink(const GfxLink &rGfxLink)
virtual void Execute(OutputDevice *pOut) override
void DrawTextArray(const Point &rStartPt, const OUString &rStr, const tools::Long *pDXAry, sal_Int32 nIndex=0, sal_Int32 nLen=-1, SalLayoutFlags flags=SalLayoutFlags::NONE, const SalLayoutGlyphs *pLayoutCache=nullptr)
void scale(double fScaleX, double fScaleY)
Affine scaling in both X and Y dimensions.
SvStream & WriteWallpaper(SvStream &rOStm, const Wallpaper &rWallpaper)
void DrawWallpaper(const tools::Rectangle &rRect, const Wallpaper &rWallpaper)
OString read_uInt16_lenPrefixed_uInt8s_ToOString(SvStream &rStrm)
void DrawStretchText(const Point &rStartPt, sal_uLong nWidth, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1)
SvStream & ReadWallpaper(SvStream &rIStm, Wallpaper &rWallpaper)
SvStream & WriteUniOrByteString(const OUString &rStr, rtl_TextEncoding eDestCharSet)
virtual void Read(SvStream &rIStm, ImplMetaReadData *pData) override
SvStream & WriteUInt32(sal_uInt32 nUInt32)
sal_uInt64 remainingSize()
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void DrawRect(const tools::Rectangle &rRect)
void setPath(const tools::PolyPolygon &rPath)
Set path to fill.
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
FontStrikeout meStrikeout
virtual void Execute(OutputDevice *pOut) override
SvStream & ReadLineInfo(SvStream &rIStm, LineInfo &rLineInfo)
virtual void Move(tools::Long nHorzMove, tools::Long nVertMove) override
virtual void Read(SvStream &rIStm, ImplMetaReadData *pData) override
tools::Long FRound(double fVal)
SvStream & ReadFloat(float &rFloat)
void DrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent)
void DrawArc(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
virtual void Write(SvStream &rOStm, ImplMetaWriteData *pData) override
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
std::size_t WriteBytes(const void *pData, std::size_t nSize)
virtual void Move(tools::Long nHorzMove, tools::Long nVertMove) override
void writeGradient(const Gradient &rGradient)
OUString read_uInt16_lenPrefixed_uInt16s_ToOUString(SvStream &rStrm)
void SetTextColor(const Color &rColor)
#define LANGUAGE_DONTKNOW
void getPath(tools::Polygon &) const
Query path to stroke.
virtual void Move(tools::Long nHorzMove, tools::Long nVertMove) override
virtual void Scale(double fScaleX, double fScaleY) override
SvStream & ReadUChar(unsigned char &rChar)
void MoveClipRegion(tools::Long nHorzMove, tools::Long nVertMove)
virtual void Read(SvStream &rIStm, ImplMetaReadData *pData) override
void DrawPie(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
std::size_t write_uInt16_lenPrefixed_uInt8s_FromOString(SvStream &rStrm, const OString &rStr)
virtual void Write(SvStream &rOStm, ImplMetaWriteData *pData) override
void DrawBitmap(const Point &rDestPt, const Bitmap &rBitmap)
This is an overloaded member function, provided for convenience. It differs from the above function o...
SvStream & ReadRegion(SvStream &rIStrm, vcl::Region &rRegion)
void getStartArrow(tools::PolyPolygon &) const
Get the polygon that is put at the start of the line.
void DrawPixel(const Point &rPt)
void DrawHatch(const tools::PolyPolygon &rPolyPoly, const Hatch &rHatch)
SvStream & ReadHatch(SvStream &rIStm, Hatch &rHatch)
SvStream & ReadInt32(sal_Int32 &rInt32)
std::size_t ReadBytes(void *pData, std::size_t nSize)
Bitmap GetBitmap(Color aTransparentReplaceColor) const
virtual void Execute(OutputDevice *pOut) override
virtual void Write(SvStream &rOStm, ImplMetaWriteData *pData) override
void setEndArrow(const tools::PolyPolygon &)
Set the polygon that is put at the end of the line.
virtual void Move(tools::Long nHorzMove, tools::Long nVertMove) override
SvStream & ReadFont(SvStream &rIStm, vcl::Font &rFont)
void SetFont(const vcl::Font &rNewFont)
SvStream & WriteFloat(float nFloat)
SvStream & ReadGDIMetaFile(SvStream &rIStm, GDIMetaFile &rGDIMetaFile, ImplMetaReadData *pData)
#define SAL_INFO(area, stream)
void SetRasterOp(RasterOp eRasterOp)
virtual rtl::Reference< MetaAction > Clone() override
bool DrawEPS(const Point &rPt, const Size &rSz, const GfxLink &rGfxLink, GDIMetaFile *pSubst=nullptr)
virtual rtl::Reference< MetaAction > Clone() override
void DrawPolyPolygon(const tools::PolyPolygon &rPolyPoly)
Render the given poly-polygon.
virtual void Write(SvStream &rOStm, ImplMetaWriteData *pData) override
virtual ~MetaTextLineAction() override
void setPath(const tools::Polygon &)
Set path to stroke.
void DrawEllipse(const tools::Rectangle &rRect)
#define SAL_WARN(area, stream)
void readGfxLink(GfxLink &rGfxLink)
SvStream & ReadMapMode(SvStream &rIStm, MapMode &rMapMode)
Encapsulates geometry and associated attributes of a filled area.
void getEndArrow(tools::PolyPolygon &) const
Get the polygon that is put at the end of the line.
void getPath(tools::PolyPolygon &) const
Query path to fill.
virtual ~MetaTextRectAction() override
bool IsStarSymbol(const OUString &rFontName)
void readGradient(Gradient &rGradient)
void Push(PushFlags nFlags=PushFlags::ALL)
void DrawGradient(const tools::Rectangle &rRect, const Gradient &rGradient)
SvStream & WriteLineInfo(SvStream &rOStm, const LineInfo &rLineInfo)
std::size_t write_uInt16_lenPrefixed_uInt16s_FromOUString(SvStream &rStrm, const OUString &rStr)
FontLineStyle meUnderline
virtual void Scale(double fScaleX, double fScaleY) override
void SetTextAlign(TextAlign eAlign)
virtual void Scale(double fScaleX, double fScaleY) override
SvStream & WriteRegion(SvStream &rOStrm, const vcl::Region &rRegion)
::basegfx::B2IVector maSize
OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet)