summaryrefslogtreecommitdiffstats
path: root/drawinglayer
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2021-09-03 02:19:33 +1000
committerTomaž Vajngerl <quikee@gmail.com>2021-09-28 08:20:32 +0200
commit4dd6af856d574ad66ebb4b822a36ba70af9945e2 (patch)
treec67ddea9c5551e069cb75fe0901cdcfa3f00b054 /drawinglayer
parenttdf#143819 sw: fix undo not restoring adjusted anchor (diff)
downloadcore-4dd6af856d574ad66ebb4b822a36ba70af9945e2.tar.gz
core-4dd6af856d574ad66ebb4b822a36ba70af9945e2.zip
vcl: rename OutDevState to Stack
I have moved the header file to include/vcl/rendercontext as this will eventually be part of the RenderContext split from OutputDevice. State and associated enums have also been moved to the vcl namespace. I have also moved ComplexTextLayoutFlags into the vcl::text namespace. Change-Id: I0abbf560e75b45a272854b267e948c240cd69091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/inc/wmfemfhelper.hxx16
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx8
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx12
-rw-r--r--drawinglayer/source/tools/wmfemfhelper.cxx48
5 files changed, 45 insertions, 45 deletions
diff --git a/drawinglayer/inc/wmfemfhelper.hxx b/drawinglayer/inc/wmfemfhelper.hxx
index d24ab2fd02c7..4a6bbe81228c 100644
--- a/drawinglayer/inc/wmfemfhelper.hxx
+++ b/drawinglayer/inc/wmfemfhelper.hxx
@@ -23,7 +23,7 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <vcl/font.hxx>
#include <rtl/ref.hxx>
-#include <vcl/outdevstate.hxx>
+#include <vcl/rendercontext/State.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <memory>
@@ -100,9 +100,9 @@ namespace wmfemfhelper
/// font, etc.
vcl::Font maFont;
RasterOp maRasterOp;
- ComplexTextLayoutFlags mnLayoutMode;
+ vcl::text::ComplexTextLayoutFlags mnLayoutMode;
LanguageType maLanguageType;
- PushFlags mnPushFlags;
+ vcl::PushFlags mnPushFlags;
/// contains all active markers
bool mbLineColor : 1;
@@ -167,14 +167,14 @@ namespace wmfemfhelper
bool isRasterOpForceBlack() const { return RasterOp::N0 == maRasterOp; }
bool isRasterOpActive() const { return isRasterOpInvert() || isRasterOpForceBlack(); }
- ComplexTextLayoutFlags getLayoutMode() const { return mnLayoutMode; }
- void setLayoutMode(ComplexTextLayoutFlags nNew) { if (nNew != mnLayoutMode) mnLayoutMode = nNew; }
+ vcl::text::ComplexTextLayoutFlags getLayoutMode() const { return mnLayoutMode; }
+ void setLayoutMode(vcl::text::ComplexTextLayoutFlags nNew) { if (nNew != mnLayoutMode) mnLayoutMode = nNew; }
LanguageType getLanguageType() const { return maLanguageType; }
void setLanguageType(LanguageType aNew) { if (aNew != maLanguageType) maLanguageType = aNew; }
- PushFlags getPushFlags() const { return mnPushFlags; }
- void setPushFlags(PushFlags nNew) { if (nNew != mnPushFlags) mnPushFlags = nNew; }
+ vcl::PushFlags getPushFlags() const { return mnPushFlags; }
+ void setPushFlags(vcl::PushFlags nNew) { if (nNew != mnPushFlags) mnPushFlags = nNew; }
bool getLineOrFillActive() const { return (mbLineColor || mbFillColor); }
};
@@ -196,7 +196,7 @@ namespace wmfemfhelper
public:
PropertyHolders();
void PushDefault();
- void Push(PushFlags nPushFlags);
+ void Push(vcl::PushFlags nPushFlags);
void Pop();
PropertyHolder& Current();
~PropertyHolders();
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index d60616d5be2c..52013c1e8850 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1561,7 +1561,7 @@ void VclMetafileProcessor2D::processPolygonStrokePrimitive2D(
}
else
{
- mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+ mpOutputDevice->Push(vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR);
// support SvtGraphicStroke MetaCommentAction
std::unique_ptr<SvtGraphicStroke> pSvtGraphicStroke = impTryToCreateSvtGraphicStroke(
@@ -2011,7 +2011,7 @@ void VclMetafileProcessor2D::processPolyPolygonGradientPrimitive2D(
void VclMetafileProcessor2D::processPolyPolygonColorPrimitive2D(
const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate)
{
- mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+ mpOutputDevice->Push(vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR);
basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
@@ -2066,7 +2066,7 @@ void VclMetafileProcessor2D::processMaskPrimitive2D(
// set VCL clip region; subdivide before conversion to tools polygon. Subdivision necessary (!)
// Removed subdivision and fixed in vcl::Region::ImplPolyPolyRegionToBandRegionFunc() in VCL where
// the ClipRegion is built from the Polygon. An AdaptiveSubdivide on the source polygon was missing there
- mpOutputDevice->Push(PushFlags::CLIPREGION);
+ mpOutputDevice->Push(vcl::PushFlags::CLIPREGION);
mpOutputDevice->SetClipRegion(vcl::Region(maClipPolyPolygon));
// recursively paint content
@@ -2091,7 +2091,7 @@ void VclMetafileProcessor2D::processMaskPrimitive2D(
void VclMetafileProcessor2D::processUnifiedTransparencePrimitive2D(
const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate)
{
- mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+ mpOutputDevice->Push(vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR);
// for metafile: Need to examine what the pure vcl version is doing here actually
// - uses DrawTransparent with metafile for content and a gradient
// - uses DrawTransparent for single PolyPolygons directly. Can be detected by
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 27dbd89f1d06..967b70aa793e 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -91,7 +91,7 @@ VclPixelProcessor2D::VclPixelProcessor2D(const geometry::ViewInformation2D& rVie
maCurrentTransformation = rViewInformation.getObjectToViewTransformation();
// prepare output directly to pixels
- mpOutputDevice->Push(PushFlags::MAPMODE);
+ mpOutputDevice->Push(vcl::PushFlags::MAPMODE);
mpOutputDevice->SetMapMode();
// react on AntiAliasing settings
@@ -1234,7 +1234,7 @@ void VclPixelProcessor2D::processFillGradientPrimitive2D(
std::floor(aFullRange.getMinX()), std::floor(aFullRange.getMinY()),
std::ceil(aFullRange.getMaxX()), std::ceil(aFullRange.getMaxY()));
- mpOutputDevice->Push(PushFlags::CLIPREGION);
+ mpOutputDevice->Push(vcl::PushFlags::CLIPREGION);
mpOutputDevice->IntersectClipRegion(aOutputRectangle);
mpOutputDevice->DrawGradient(aFullRectangle, aGradient);
mpOutputDevice->Pop();
@@ -1265,7 +1265,7 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D(
// Unless smooth edges are needed, simply use clipping.
if (basegfx::utils::isRectangle(aMask) || !SvtOptionsDrawinglayer::IsAntiAliasing())
{
- mpOutputDevice->Push(PushFlags::CLIPREGION);
+ mpOutputDevice->Push(vcl::PushFlags::CLIPREGION);
mpOutputDevice->IntersectClipRegion(vcl::Region(aMask));
mpOutputDevice->DrawWallpaper(aMaskRect, Wallpaper(aTileImage));
mpOutputDevice->Pop();
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 2ad0e342a209..16bf6a78b878 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -268,14 +268,14 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
maBColorModifierStack.getModifiedColor(rTextCandidate.getFontColor()));
const basegfx::B2DPoint aPoint(aLocalTransform * basegfx::B2DPoint(0.0, 0.0));
const Point aStartPoint(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY()));
- const ComplexTextLayoutFlags nOldLayoutMode(mpOutputDevice->GetLayoutMode());
+ const vcl::text::ComplexTextLayoutFlags nOldLayoutMode(mpOutputDevice->GetLayoutMode());
if (rTextCandidate.getFontAttribute().getRTL())
{
- ComplexTextLayoutFlags nRTLLayoutMode(nOldLayoutMode
- & ~ComplexTextLayoutFlags::BiDiStrong);
- nRTLLayoutMode
- |= ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft;
+ vcl::text::ComplexTextLayoutFlags nRTLLayoutMode(
+ nOldLayoutMode & ~vcl::text::ComplexTextLayoutFlags::BiDiStrong);
+ nRTLLayoutMode |= vcl::text::ComplexTextLayoutFlags::BiDiRtl
+ | vcl::text::ComplexTextLayoutFlags::TextOriginLeft;
mpOutputDevice->SetLayoutMode(nRTLLayoutMode);
}
@@ -771,7 +771,7 @@ void VclProcessor2D::RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive
// Unless smooth edges are needed, simply use clipping.
if (basegfx::utils::isRectangle(aMask) || !SvtOptionsDrawinglayer::IsAntiAliasing())
{
- mpOutputDevice->Push(PushFlags::CLIPREGION);
+ mpOutputDevice->Push(vcl::PushFlags::CLIPREGION);
mpOutputDevice->IntersectClipRegion(vcl::Region(aMask));
process(rMaskCandidate.getChildren());
mpOutputDevice->Pop();
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index a7beae35ed83..f7c01f3330c1 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -114,9 +114,9 @@ namespace wmfemfhelper
: maMapUnit(MapUnit::Map100thMM),
maTextColor(sal_uInt32(COL_BLACK)),
maRasterOp(RasterOp::OverPaint),
- mnLayoutMode(ComplexTextLayoutFlags::Default),
+ mnLayoutMode(vcl::text::ComplexTextLayoutFlags::Default),
maLanguageType(0),
- mnPushFlags(PushFlags::NONE),
+ mnPushFlags(vcl::PushFlags::NONE),
mbLineColor(false),
mbFillColor(false),
mbTextColor(true),
@@ -150,7 +150,7 @@ namespace wmfemfhelper
maPropertyHolders.push_back(pNew);
}
- void PropertyHolders::Push(PushFlags nPushFlags)
+ void PropertyHolders::Push(vcl::PushFlags nPushFlags)
{
if (bool(nPushFlags))
{
@@ -173,56 +173,56 @@ namespace wmfemfhelper
return;
const PropertyHolder* pTip = maPropertyHolders.back();
- const PushFlags nPushFlags(pTip->getPushFlags());
+ const vcl::PushFlags nPushFlags(pTip->getPushFlags());
- if (nPushFlags != PushFlags::NONE)
+ if (nPushFlags != vcl::PushFlags::NONE)
{
if (nSize > 1)
{
// copy back content for all non-set flags
PropertyHolder* pLast = maPropertyHolders[nSize - 2];
- if (PushFlags::ALL != nPushFlags)
+ if (vcl::PushFlags::ALL != nPushFlags)
{
- if (!(nPushFlags & PushFlags::LINECOLOR))
+ if (!(nPushFlags & vcl::PushFlags::LINECOLOR))
{
pLast->setLineColor(pTip->getLineColor());
pLast->setLineColorActive(pTip->getLineColorActive());
}
- if (!(nPushFlags & PushFlags::FILLCOLOR))
+ if (!(nPushFlags & vcl::PushFlags::FILLCOLOR))
{
pLast->setFillColor(pTip->getFillColor());
pLast->setFillColorActive(pTip->getFillColorActive());
}
- if (!(nPushFlags & PushFlags::FONT))
+ if (!(nPushFlags & vcl::PushFlags::FONT))
{
pLast->setFont(pTip->getFont());
}
- if (!(nPushFlags & PushFlags::TEXTCOLOR))
+ if (!(nPushFlags & vcl::PushFlags::TEXTCOLOR))
{
pLast->setTextColor(pTip->getTextColor());
pLast->setTextColorActive(pTip->getTextColorActive());
}
- if (!(nPushFlags & PushFlags::MAPMODE))
+ if (!(nPushFlags & vcl::PushFlags::MAPMODE))
{
pLast->setTransformation(pTip->getTransformation());
pLast->setMapUnit(pTip->getMapUnit());
}
- if (!(nPushFlags & PushFlags::CLIPREGION))
+ if (!(nPushFlags & vcl::PushFlags::CLIPREGION))
{
pLast->setClipPolyPolygon(pTip->getClipPolyPolygon());
pLast->setClipPolyPolygonActive(pTip->getClipPolyPolygonActive());
}
- if (!(nPushFlags & PushFlags::RASTEROP))
+ if (!(nPushFlags & vcl::PushFlags::RASTEROP))
{
pLast->setRasterOp(pTip->getRasterOp());
}
- if (!(nPushFlags & PushFlags::TEXTFILLCOLOR))
+ if (!(nPushFlags & vcl::PushFlags::TEXTFILLCOLOR))
{
pLast->setTextFillColor(pTip->getTextFillColor());
pLast->setTextFillColorActive(pTip->getTextFillColorActive());
}
- if (!(nPushFlags & PushFlags::TEXTALIGN))
+ if (!(nPushFlags & vcl::PushFlags::TEXTALIGN))
{
if (pLast->getFont().GetAlignment() != pTip->getFont().GetAlignment())
{
@@ -231,24 +231,24 @@ namespace wmfemfhelper
pLast->setFont(aFont);
}
}
- if (!(nPushFlags & PushFlags::REFPOINT))
+ if (!(nPushFlags & vcl::PushFlags::REFPOINT))
{
// not supported
}
- if (!(nPushFlags & PushFlags::TEXTLINECOLOR))
+ if (!(nPushFlags & vcl::PushFlags::TEXTLINECOLOR))
{
pLast->setTextLineColor(pTip->getTextLineColor());
pLast->setTextLineColorActive(pTip->getTextLineColorActive());
}
- if (!(nPushFlags & PushFlags::TEXTLAYOUTMODE))
+ if (!(nPushFlags & vcl::PushFlags::TEXTLAYOUTMODE))
{
pLast->setLayoutMode(pTip->getLayoutMode());
}
- if (!(nPushFlags & PushFlags::TEXTLANGUAGE))
+ if (!(nPushFlags & vcl::PushFlags::TEXTLANGUAGE))
{
pLast->setLanguageType(pTip->getLanguageType());
}
- if (!(nPushFlags & PushFlags::OVERLINECOLOR))
+ if (!(nPushFlags & vcl::PushFlags::OVERLINECOLOR))
{
pLast->setOverlineColor(pTip->getOverlineColor());
pLast->setOverlineColorActive(pTip->getOverlineColorActive());
@@ -1061,8 +1061,8 @@ namespace wmfemfhelper
rFontAttribute = drawinglayer::primitive2d::getFontAttributeFromVclFont(
aFontScaling,
rFont,
- bool(rProperty.getLayoutMode() & ComplexTextLayoutFlags::BiDiRtl),
- bool(rProperty.getLayoutMode() & ComplexTextLayoutFlags::BiDiStrong));
+ bool(rProperty.getLayoutMode() & vcl::text::ComplexTextLayoutFlags::BiDiRtl),
+ bool(rProperty.getLayoutMode() & vcl::text::ComplexTextLayoutFlags::BiDiStrong));
// add FontScaling
rTextTransform.scale(aFontScaling.getX(), aFontScaling.getY());
@@ -2600,8 +2600,8 @@ namespace wmfemfhelper
case MetaActionType::POP :
{
/** CHECKED, WORKS WELL */
- const bool bRegionMayChange(rPropertyHolders.Current().getPushFlags() & PushFlags::CLIPREGION);
- const bool bRasterOpMayChange(rPropertyHolders.Current().getPushFlags() & PushFlags::RASTEROP);
+ const bool bRegionMayChange(rPropertyHolders.Current().getPushFlags() & vcl::PushFlags::CLIPREGION);
+ const bool bRasterOpMayChange(rPropertyHolders.Current().getPushFlags() & vcl::PushFlags::RASTEROP);
if(bRegionMayChange && rPropertyHolders.Current().getClipPolyPolygonActive())
{