diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2021-09-03 02:19:33 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-09-28 08:20:32 +0200 |
commit | 4dd6af856d574ad66ebb4b822a36ba70af9945e2 (patch) | |
tree | c67ddea9c5551e069cb75fe0901cdcfa3f00b054 /cppcanvas | |
parent | 1734e97222324c137ecd084ad2464abdff2698d1 (diff) |
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 'cppcanvas')
-rw-r--r-- | cppcanvas/source/inc/implrenderer.hxx | 2 | ||||
-rw-r--r-- | cppcanvas/source/inc/outdevstate.hxx | 7 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 54 |
3 files changed, 31 insertions, 32 deletions
diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx index 4b432f898260..93b68f9410ad 100644 --- a/cppcanvas/source/inc/implrenderer.hxx +++ b/cppcanvas/source/inc/implrenderer.hxx @@ -63,7 +63,7 @@ namespace cppcanvas::internal public: OutDevState& getState(); const OutDevState& getState() const; - void pushState(PushFlags nFlags); + void pushState(vcl::PushFlags nFlags); void popState(); void clearStateStack(); private: diff --git a/cppcanvas/source/inc/outdevstate.hxx b/cppcanvas/source/inc/outdevstate.hxx index 16cc3c4ff25a..275b7b4314de 100644 --- a/cppcanvas/source/inc/outdevstate.hxx +++ b/cppcanvas/source/inc/outdevstate.hxx @@ -30,8 +30,7 @@ #include <tools/fontenum.hxx> #include <tools/gen.hxx> #include <vcl/fntstyle.hxx> -#include <vcl/outdevstate.hxx> - +#include <vcl/rendercontext/State.hxx> namespace cppcanvas::internal { @@ -55,7 +54,7 @@ namespace cppcanvas::internal fontRotation(0.0), textEmphasisMark(FontEmphasisMark::NONE), - pushFlags(PushFlags::ALL), + pushFlags(vcl::PushFlags::ALL), textDirection(css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT), textAlignment(0), // TODO(Q2): Synchronize with implrenderer // and possibly new rendering::TextAlignment @@ -99,7 +98,7 @@ namespace cppcanvas::internal double fontRotation; FontEmphasisMark textEmphasisMark; - PushFlags pushFlags; + vcl::PushFlags pushFlags; sal_Int8 textDirection; sal_Int8 textAlignment; FontRelief textReliefStyle; diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 64ac3a164c86..14ecdebdaddd 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -250,7 +250,7 @@ namespace cppcanvas::internal return m_aStates.back(); } - void VectorOfOutDevStates::pushState(PushFlags nFlags) + void VectorOfOutDevStates::pushState(vcl::PushFlags nFlags) { m_aStates.push_back( getState() ); getState().pushFlags = nFlags; @@ -258,7 +258,7 @@ namespace cppcanvas::internal void VectorOfOutDevStates::popState() { - if( getState().pushFlags != PushFlags::ALL ) + if( getState().pushFlags != vcl::PushFlags::ALL ) { // a state is pushed which is incomplete, i.e. does not // restore everything to the previous stack level when @@ -277,19 +277,19 @@ namespace cppcanvas::internal const OutDevState& rNewState( getState() ); - if( aCalculatedNewState.pushFlags & PushFlags::LINECOLOR ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::LINECOLOR ) { aCalculatedNewState.lineColor = rNewState.lineColor; aCalculatedNewState.isLineColorSet = rNewState.isLineColorSet; } - if( aCalculatedNewState.pushFlags & PushFlags::FILLCOLOR ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::FILLCOLOR ) { aCalculatedNewState.fillColor = rNewState.fillColor; aCalculatedNewState.isFillColorSet = rNewState.isFillColorSet; } - if( aCalculatedNewState.pushFlags & PushFlags::FONT ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::FONT ) { aCalculatedNewState.xFont = rNewState.xFont; aCalculatedNewState.fontRotation = rNewState.fontRotation; @@ -303,17 +303,17 @@ namespace cppcanvas::internal aCalculatedNewState.isTextOutlineModeSet = rNewState.isTextOutlineModeSet; } - if( aCalculatedNewState.pushFlags & PushFlags::TEXTCOLOR ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::TEXTCOLOR ) { aCalculatedNewState.textColor = rNewState.textColor; } - if( aCalculatedNewState.pushFlags & PushFlags::MAPMODE ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::MAPMODE ) { aCalculatedNewState.mapModeTransform = rNewState.mapModeTransform; } - if( aCalculatedNewState.pushFlags & PushFlags::CLIPREGION ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::CLIPREGION ) { aCalculatedNewState.clip = rNewState.clip; aCalculatedNewState.clipRect = rNewState.clipRect; @@ -321,46 +321,46 @@ namespace cppcanvas::internal } // TODO(F2): Raster ops NYI - // if( (aCalculatedNewState.pushFlags & PushFlags::RASTEROP) ) + // if( (aCalculatedNewState.pushFlags & vcl::PushFlags::RASTEROP) ) // { // } - if( aCalculatedNewState.pushFlags & PushFlags::TEXTFILLCOLOR ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::TEXTFILLCOLOR ) { aCalculatedNewState.textFillColor = rNewState.textFillColor; aCalculatedNewState.isTextFillColorSet = rNewState.isTextFillColorSet; } - if( aCalculatedNewState.pushFlags & PushFlags::TEXTALIGN ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::TEXTALIGN ) { aCalculatedNewState.textReferencePoint = rNewState.textReferencePoint; } // TODO(F1): Refpoint handling NYI - // if( (aCalculatedNewState.pushFlags & PushFlags::REFPOINT) ) + // if( (aCalculatedNewState.pushFlags & vcl::PushFlags::REFPOINT) ) // { // } - if( aCalculatedNewState.pushFlags & PushFlags::TEXTLINECOLOR ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::TEXTLINECOLOR ) { aCalculatedNewState.textLineColor = rNewState.textLineColor; aCalculatedNewState.isTextLineColorSet = rNewState.isTextLineColorSet; } - if( aCalculatedNewState.pushFlags & PushFlags::OVERLINECOLOR ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::OVERLINECOLOR ) { aCalculatedNewState.textOverlineColor = rNewState.textOverlineColor; aCalculatedNewState.isTextOverlineColorSet = rNewState.isTextOverlineColorSet; } - if( aCalculatedNewState.pushFlags & PushFlags::TEXTLAYOUTMODE ) + if( aCalculatedNewState.pushFlags & vcl::PushFlags::TEXTLAYOUTMODE ) { aCalculatedNewState.textAlignment = rNewState.textAlignment; aCalculatedNewState.textDirection = rNewState.textDirection; } // TODO(F2): Text language handling NYI - // if( (aCalculatedNewState.pushFlags & PushFlags::TEXTLANGUAGE) ) + // if( (aCalculatedNewState.pushFlags & vcl::PushFlags::TEXTLANGUAGE) ) // { // } @@ -715,7 +715,7 @@ namespace cppcanvas::internal // cannot currently use native canvas gradients, as a // finite step size is given (this funny feature is not // supported by the XCanvas API) - rParms.mrStates.pushState(PushFlags::ALL); + rParms.mrStates.pushState(vcl::PushFlags::ALL); if( !bIsPolygonRectangle ) { @@ -1521,22 +1521,22 @@ namespace cppcanvas::internal case MetaActionType::LAYOUTMODE: { // TODO(F2): A lot is missing here - ComplexTextLayoutFlags nLayoutMode = static_cast<MetaLayoutModeAction*>(pCurrAct)->GetLayoutMode(); + vcl::text::ComplexTextLayoutFlags nLayoutMode = static_cast<MetaLayoutModeAction*>(pCurrAct)->GetLayoutMode(); ::cppcanvas::internal::OutDevState& rState = rStates.getState(); - ComplexTextLayoutFlags nBidiLayoutMode = nLayoutMode & (ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::BiDiStrong); - if( nBidiLayoutMode == ComplexTextLayoutFlags::Default) + vcl::text::ComplexTextLayoutFlags nBidiLayoutMode = nLayoutMode & (vcl::text::ComplexTextLayoutFlags::BiDiRtl|vcl::text::ComplexTextLayoutFlags::BiDiStrong); + if( nBidiLayoutMode == vcl::text::ComplexTextLayoutFlags::Default) rState.textDirection = rendering::TextDirection::WEAK_LEFT_TO_RIGHT; - else if( nBidiLayoutMode == ComplexTextLayoutFlags::BiDiStrong) + else if( nBidiLayoutMode == vcl::text::ComplexTextLayoutFlags::BiDiStrong) rState.textDirection = rendering::TextDirection::STRONG_LEFT_TO_RIGHT; - else if( nBidiLayoutMode == ComplexTextLayoutFlags::BiDiRtl) + else if( nBidiLayoutMode == vcl::text::ComplexTextLayoutFlags::BiDiRtl) rState.textDirection = rendering::TextDirection::WEAK_RIGHT_TO_LEFT; - else if( nBidiLayoutMode == (ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::BiDiStrong)) + else if( nBidiLayoutMode == (vcl::text::ComplexTextLayoutFlags::BiDiRtl | vcl::text::ComplexTextLayoutFlags::BiDiStrong)) rState.textDirection = rendering::TextDirection::STRONG_RIGHT_TO_LEFT; rState.textAlignment = 0; // TODO(F2): rendering::TextAlignment::LEFT_ALIGNED; - if( (nLayoutMode & (ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginRight) ) - && !(nLayoutMode & ComplexTextLayoutFlags::TextOriginLeft ) ) + if( (nLayoutMode & (vcl::text::ComplexTextLayoutFlags::BiDiRtl | vcl::text::ComplexTextLayoutFlags::TextOriginRight) ) + && !(nLayoutMode & vcl::text::ComplexTextLayoutFlags::TextOriginLeft ) ) { rState.textAlignment = 1; // TODO(F2): rendering::TextAlignment::RIGHT_ALIGNED; } @@ -1595,7 +1595,7 @@ namespace cppcanvas::internal // Setup local transform, such that the // metafile renders itself into the given // output rectangle - rStates.pushState(PushFlags::ALL); + rStates.pushState(vcl::PushFlags::ALL); rVDev.Push(); rVDev.SetMapMode( rSubstitute.GetPrefMapMode() ); @@ -2529,7 +2529,7 @@ namespace cppcanvas::internal { MetaTextRectAction* pAct = static_cast<MetaTextRectAction*>(pCurrAct); - rStates.pushState(PushFlags::ALL); + rStates.pushState(vcl::PushFlags::ALL); // use the VDev to break up the text rect // action into readily formatted lines |