diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-11-04 18:36:51 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-11-08 12:09:48 +0100 |
commit | 389c8239c93663fa5546b2f0227a118a3ad091bf (patch) | |
tree | 283ca215c088c682aeb1d492d6f5b7be21921965 /include | |
parent | 456300d4fbea0f27453973b50d148753d0315b80 (diff) |
widget theme: Gradient support when drawing widgets
Change-Id: I29239348e36e4963d9708a22ac649b2b1d68bf02
Reviewed-on: https://gerrit.libreoffice.org/82207
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/basegfx/DrawCommands.hxx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/basegfx/DrawCommands.hxx b/include/basegfx/DrawCommands.hxx index f72d17011c0b..30e7cfbf4a05 100644 --- a/include/basegfx/DrawCommands.hxx +++ b/include/basegfx/DrawCommands.hxx @@ -16,6 +16,8 @@ #include <basegfx/color/bcolor.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/range/b2drange.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/color/bcolor.hxx> namespace gfx { @@ -34,6 +36,48 @@ enum class DrawCommandType Path }; +enum class GradientType +{ + Linear +}; + +class GradientStop +{ +public: + float mfOffset; + basegfx::BColor maColor; + float mfOpacity; +}; + +class GradientInfo +{ +public: + GradientType meType; + + std::vector<GradientStop> maGradientStops; + + GradientInfo(GradientType eType) + : meType(eType) + { + } +}; + +class LinearGradientInfo : public GradientInfo +{ +public: + LinearGradientInfo() + : GradientInfo(GradientType::Linear) + { + } + + double x1; + double y1; + double x2; + double y2; + + basegfx::B2DHomMatrix maMatrix; +}; + class DrawBase : public DrawCommand { private: @@ -70,6 +114,7 @@ public: double mnOpacity; std::shared_ptr<basegfx::BColor> mpFillColor; std::shared_ptr<basegfx::BColor> mpStrokeColor; + std::shared_ptr<GradientInfo> mpFillGradient; DrawRectangle(basegfx::B2DRange const& rRectangle) : DrawBase(DrawCommandType::Rectangle) @@ -91,6 +136,7 @@ public: double mnOpacity; std::shared_ptr<basegfx::BColor> mpFillColor; std::shared_ptr<basegfx::BColor> mpStrokeColor; + std::shared_ptr<GradientInfo> mpFillGradient; DrawPath(basegfx::B2DPolyPolygon const& rPolyPolygon) : DrawBase(DrawCommandType::Path) |