diff options
author | Armin Le Grand <armin.le.grand@me.com> | 2020-04-10 18:07:41 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-04-10 20:37:52 +0200 |
commit | ae743c6fae4543282f8930dc78175cc510fabbb3 (patch) | |
tree | eb44065aece45c9fd86b50df495c3746192fb0be /include | |
parent | 25468bba15a149edc1e53a7518070c64d4c967e9 (diff) |
Make BitmapPrimitive2D vcl-independent
as preparation to have drawinglayer module
independent from vcl in the future
Change-Id: Iaa01370f27b51cba5114a54f37d1ec73d0719918
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92048
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/drawinglayer/primitive2d/bitmapprimitive2d.hxx | 31 | ||||
-rw-r--r-- | include/toolkit/helper/vclunohelper.hxx | 1 |
2 files changed, 24 insertions, 8 deletions
diff --git a/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx index d35a2699b0af..4d84a02f8e06 100644 --- a/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx @@ -23,23 +23,37 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/primitive2d/baseprimitive2d.hxx> -#include <vcl/bitmapex.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +namespace com +{ +namespace sun +{ +namespace star +{ +namespace awt +{ +class XBitmap; +} +} +} +} + namespace drawinglayer::primitive2d { /** BitmapPrimitive2D class This class is the central primitive for Bitmap-based primitives. - It provides RGBA-based bitmaps, currently using a BitmapEx from VCL. - This may change in the future to any other, maybe more general base - class providing 24bit RGBA. + To keep it independent of Bitmap implementations, use UNO API + XBitmap object as wrapper due to formally used class Bitmap being + vcl-dependent and requiring linking against it. Use VCLUnoHelper + to convert awt::XBitmap <-> Bitmap */ class DRAWINGLAYER_DLLPUBLIC BitmapPrimitive2D final : public BasePrimitive2D { private: - /// the RGBA Bitmap-data - BitmapEx maBitmapEx; + /// the Bitmap-data + css::uno::Reference<css::awt::XBitmap> maXBitmap; /** the object transformation from unit coordinates, defining size, shear, rotate and position @@ -48,10 +62,11 @@ private: public: /// constructor - BitmapPrimitive2D(const BitmapEx& rBitmapEx, const basegfx::B2DHomMatrix& rTransform); + BitmapPrimitive2D(const css::uno::Reference<css::awt::XBitmap>& rXBitmap, + const basegfx::B2DHomMatrix& rTransform); /// data read access - const BitmapEx& getBitmapEx() const { return maBitmapEx; } + const css::uno::Reference<css::awt::XBitmap>& getXBitmap() const { return maXBitmap; } const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } /// compare operator diff --git a/include/toolkit/helper/vclunohelper.hxx b/include/toolkit/helper/vclunohelper.hxx index 8589ff9e7bd5..b0804b3d4657 100644 --- a/include/toolkit/helper/vclunohelper.hxx +++ b/include/toolkit/helper/vclunohelper.hxx @@ -76,6 +76,7 @@ public: // Bitmap static BitmapEx GetBitmap( const css::uno::Reference< css::awt::XBitmap>& rxBitmap ); static css::uno::Reference< css::awt::XBitmap> CreateBitmap( const BitmapEx& rBitmap ); + static css::uno::Reference< css::awt::XBitmap> CreateVCLXBitmap( const BitmapEx& rBitmap ); // Window static VclPtr< vcl::Window > GetWindow( const css::uno::Reference< css::awt::XWindow>& rxWindow ); |