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 /include | |
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 'include')
-rw-r--r-- | include/sfx2/LokControlHandler.hxx | 2 | ||||
-rw-r--r-- | include/vcl/metaact.hxx | 20 | ||||
-rw-r--r-- | include/vcl/outdev.hxx | 12 | ||||
-rw-r--r-- | include/vcl/pdfwriter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/rendercontext/State.hxx (renamed from include/vcl/outdevstate.hxx) | 83 |
5 files changed, 71 insertions, 48 deletions
diff --git a/include/sfx2/LokControlHandler.hxx b/include/sfx2/LokControlHandler.hxx index fc0b065c8834..cb48e9eb355b 100644 --- a/include/sfx2/LokControlHandler.hxx +++ b/include/sfx2/LokControlHandler.hxx @@ -115,7 +115,7 @@ public: // Resizes the virtual device so to contain the entries context rDevice.SetOutputSizePixel(aOutputSize); - rDevice.Push(PushFlags::MAPMODE); + rDevice.Push(vcl::PushFlags::MAPMODE); MapMode aDeviceMapMode(rDevice.GetMapMode()); const Fraction scale = conversionFract(o3tl::Length::px, o3tl::Length::mm100); diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 6562e8197158..dfdabac2de24 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_VCL_METAACT_HXX #define INCLUDED_VCL_METAACT_HXX +#include <sal/config.h> + #include <config_options.h> #include <rtl/ref.hxx> @@ -27,6 +29,7 @@ #include <tools/poly.hxx> #include <vcl/dllapi.h> +#include <vcl/rendercontext/State.hxx> #include <vcl/bitmapex.hxx> #include <vcl/font.hxx> #include <vcl/gdimtf.hxx> @@ -35,7 +38,6 @@ #include <vcl/hatch.hxx> #include <vcl/lineinfo.hxx> #include <vcl/metaactiontypes.hxx> -#include <vcl/outdevstate.hxx> #include <vcl/region.hxx> #include <vcl/rendercontext/RasterOp.hxx> #include <vcl/wall.hxx> @@ -1468,7 +1470,7 @@ class VCL_DLLPUBLIC MetaPushAction final : public MetaAction { private: - PushFlags mnFlags; + vcl::PushFlags mnFlags; public: MetaPushAction(); @@ -1482,10 +1484,10 @@ public: virtual void Execute( OutputDevice* pOut ) override; virtual rtl::Reference<MetaAction> Clone() const override; - explicit MetaPushAction( PushFlags nFlags ); + explicit MetaPushAction( vcl::PushFlags nFlags ); - PushFlags GetFlags() const { return mnFlags; } - void SetPushFlags(const PushFlags nFlags) { mnFlags = nFlags; } + vcl::PushFlags GetFlags() const { return mnFlags; } + void SetPushFlags(const vcl::PushFlags nFlags) { mnFlags = nFlags; } }; class VCL_DLLPUBLIC MetaPopAction final : public MetaAction @@ -1702,7 +1704,7 @@ class VCL_DLLPUBLIC MetaLayoutModeAction final : public MetaAction { private: - ComplexTextLayoutFlags mnLayoutMode; + vcl::text::ComplexTextLayoutFlags mnLayoutMode; public: MetaLayoutModeAction(); @@ -1716,10 +1718,10 @@ public: virtual void Execute( OutputDevice* pOut ) override; virtual rtl::Reference<MetaAction> Clone() const override; - explicit MetaLayoutModeAction( ComplexTextLayoutFlags nLayoutMode ); + explicit MetaLayoutModeAction( vcl::text::ComplexTextLayoutFlags nLayoutMode ); - ComplexTextLayoutFlags GetLayoutMode() const { return mnLayoutMode; } - void SetLayoutMode(const ComplexTextLayoutFlags nLayoutMode) { mnLayoutMode = nLayoutMode; } + vcl::text::ComplexTextLayoutFlags GetLayoutMode() const { return mnLayoutMode; } + void SetLayoutMode(const vcl::text::ComplexTextLayoutFlags nLayoutMode) { mnLayoutMode = nLayoutMode; } }; class VCL_DLLPUBLIC MetaTextLanguageAction final : public MetaAction diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index e241de432077..87a69647d2ba 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -44,11 +44,11 @@ #include <vcl/rendercontext/InvertFlags.hxx> #include <vcl/rendercontext/RasterOp.hxx> #include <vcl/rendercontext/SalLayoutFlags.hxx> +#include <vcl/rendercontext/State.hxx> #include <vcl/mapmod.hxx> #include <vcl/wall.hxx> #include <vcl/metaactiontypes.hxx> #include <vcl/salnativewidgets.hxx> -#include <vcl/outdevstate.hxx> #include <vcl/vclreferencebase.hxx> #include <basegfx/numeric/ftools.hxx> @@ -185,7 +185,7 @@ private: mutable rtl::Reference<LogicalFontInstance> mpFontInstance; mutable std::unique_ptr<vcl::font::PhysicalFontFaceCollection> mpFontFaceCollection; mutable std::unique_ptr<ImplDeviceFontSizeList> mpDeviceFontSizeList; - std::vector<OutDevState> maOutDevStateStack; + std::vector<vcl::State> maOutDevStateStack; std::unique_ptr<ImplOutDevData> mpOutDevData; std::vector< VCLXGraphics* >* mpUnoGraphicsList; vcl::ExtOutDevData* mpExtOutDevData; @@ -218,7 +218,7 @@ private: mutable tools::Long mnEmphasisAscent; mutable tools::Long mnEmphasisDescent; DrawModeFlags mnDrawMode; - ComplexTextLayoutFlags mnTextLayoutMode; + vcl::text::ComplexTextLayoutFlags mnTextLayoutMode; ImplMapRes maMapRes; const OutDevType meOutDevType; OutDevViewType meOutDevViewType; @@ -469,7 +469,7 @@ private: public: - void Push( PushFlags nFlags = PushFlags::ALL ); + void Push( vcl::PushFlags nFlags = vcl::PushFlags::ALL ); void Pop(); void ClearStack(); @@ -483,8 +483,8 @@ public: void SetDrawMode( DrawModeFlags nDrawMode ); DrawModeFlags GetDrawMode() const { return mnDrawMode; } - void SetLayoutMode( ComplexTextLayoutFlags nTextLayoutMode ); - ComplexTextLayoutFlags GetLayoutMode() const { return mnTextLayoutMode; } + void SetLayoutMode( vcl::text::ComplexTextLayoutFlags nTextLayoutMode ); + vcl::text::ComplexTextLayoutFlags GetLayoutMode() const { return mnTextLayoutMode; } void SetDigitLanguage( LanguageType ); LanguageType GetDigitLanguage() const { return meTextLanguage; } diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index b473db868821..3601c88501f9 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -715,7 +715,7 @@ The following structure describes the permissions used in PDF security void IntersectClipRegion( const tools::Rectangle& rRect ); void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion ); - void SetLayoutMode( ComplexTextLayoutFlags nMode ); + void SetLayoutMode( vcl::text::ComplexTextLayoutFlags nMode ); void SetDigitLanguage( LanguageType eLang ); void SetLineColor( const Color& rColor ); diff --git a/include/vcl/outdevstate.hxx b/include/vcl/rendercontext/State.hxx index a80620f957b6..99460e390814 100644 --- a/include/vcl/outdevstate.hxx +++ b/include/vcl/rendercontext/State.hxx @@ -34,50 +34,70 @@ #include <memory> #include <optional> -// Flags for OutputDevice::Push() and OutDevState -enum class PushFlags { - NONE = 0x0000, - LINECOLOR = 0x0001, - FILLCOLOR = 0x0002, - FONT = 0x0004, - TEXTCOLOR = 0x0008, - MAPMODE = 0x0010, - CLIPREGION = 0x0020, - RASTEROP = 0x0040, - TEXTFILLCOLOR = 0x0080, - TEXTALIGN = 0x0100, - REFPOINT = 0x0200, - TEXTLINECOLOR = 0x0400, - TEXTLAYOUTMODE = 0x0800, - TEXTLANGUAGE = 0x1000, - OVERLINECOLOR = 0x2000, - ALL = 0xFFFF +namespace vcl +{ +// Flags for OutputDevice::Push() and State +enum class PushFlags +{ + NONE = 0x0000, + LINECOLOR = 0x0001, + FILLCOLOR = 0x0002, + FONT = 0x0004, + TEXTCOLOR = 0x0008, + MAPMODE = 0x0010, + CLIPREGION = 0x0020, + RASTEROP = 0x0040, + TEXTFILLCOLOR = 0x0080, + TEXTALIGN = 0x0100, + REFPOINT = 0x0200, + TEXTLINECOLOR = 0x0400, + TEXTLAYOUTMODE = 0x0800, + TEXTLANGUAGE = 0x1000, + OVERLINECOLOR = 0x2000, + ALL = 0xFFFF }; +} namespace o3tl { - template<> struct typed_flags<PushFlags> : is_typed_flags<PushFlags, 0xFFFF> {}; +template <> struct typed_flags<vcl::PushFlags> : is_typed_flags<vcl::PushFlags, 0xFFFF> +{ +}; } -#define PUSH_ALLFONT (PushFlags::TEXTCOLOR | PushFlags::TEXTFILLCOLOR | PushFlags::TEXTLINECOLOR | PushFlags::OVERLINECOLOR | PushFlags::TEXTALIGN | PushFlags::TEXTLAYOUTMODE | PushFlags::TEXTLANGUAGE | PushFlags::FONT) +#define PUSH_ALLFONT \ + (vcl::PushFlags::TEXTCOLOR | vcl::PushFlags::TEXTFILLCOLOR | vcl::PushFlags::TEXTLINECOLOR \ + | vcl::PushFlags::OVERLINECOLOR | vcl::PushFlags::TEXTALIGN | vcl::PushFlags::TEXTLAYOUTMODE \ + | vcl::PushFlags::TEXTLANGUAGE | vcl::PushFlags::FONT) +namespace vcl::text +{ // Layout flags for Complex Text Layout // These are flag values, i.e they can be combined enum class ComplexTextLayoutFlags { - Default = 0x0000, - BiDiRtl = 0x0001, - BiDiStrong = 0x0002, - TextOriginLeft = 0x0004, - TextOriginRight = 0x0008 + Default = 0x0000, + BiDiRtl = 0x0001, + BiDiStrong = 0x0002, + TextOriginLeft = 0x0004, + TextOriginRight = 0x0008 +}; +} + +namespace o3tl +{ +template <> +struct typed_flags<vcl::text::ComplexTextLayoutFlags> + : is_typed_flags<vcl::text::ComplexTextLayoutFlags, 0x000f> +{ }; -namespace o3tl { - template<> struct typed_flags<ComplexTextLayoutFlags> : is_typed_flags<ComplexTextLayoutFlags, 0x000f> {}; } -struct OutDevState +namespace vcl +{ +struct State { - OutDevState() = default; - OutDevState(OutDevState&&) = default; + State() = default; + State(State&&) = default; std::unique_ptr<vcl::Region> mpClipRegion; std::optional<MapMode> mpMapMode; @@ -91,10 +111,11 @@ struct OutDevState std::optional<Color> mpOverlineColor; TextAlign meTextAlign = ALIGN_TOP; RasterOp meRasterOp = RasterOp::OverPaint; - ComplexTextLayoutFlags mnTextLayoutMode = ComplexTextLayoutFlags::Default; + text::ComplexTextLayoutFlags mnTextLayoutMode = text::ComplexTextLayoutFlags::Default; LanguageType meTextLanguage = LANGUAGE_SYSTEM; PushFlags mnFlags = PushFlags::NONE; bool mbMapActive = false; }; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |