From 913b3a648117206d21821b0cea40ff15a0e8e5cf Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Wed, 25 Mar 2015 15:42:41 +0900 Subject: Experimental: draw handles instead of getting them from bitmap Currently object handles are defined in the bitmap which is a pain when using in HiDPI as they have to be scaled and don't look pretty. They are also hard to change and non theme-able (change of color needs a change the bitmap). This commit experimentaly enables the drawn handles (enable with environment variable SVX_DRAW_HANDLES) which currently exchanges the default some basic handles. Change-Id: If80aa7fe756a6d8d6991e9515f2951ee21b31b72 --- svx/inc/sdr/overlay/overlayhandle.hxx | 42 +++++++++++++++++++++++++++++++++++ svx/inc/sdr/overlay/overlaytools.hxx | 36 ++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 svx/inc/sdr/overlay/overlayhandle.hxx (limited to 'svx/inc') diff --git a/svx/inc/sdr/overlay/overlayhandle.hxx b/svx/inc/sdr/overlay/overlayhandle.hxx new file mode 100644 index 000000000000..60d7e54418f4 --- /dev/null +++ b/svx/inc/sdr/overlay/overlayhandle.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#ifndef INCLUDED_SVX_SDR_OVERLAY_OVERLAYHANDLE_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYHANDLE_HXX + +#include +#include + +namespace sdr { namespace overlay { + + +class SVX_DLLPUBLIC OverlayHandle : public OverlayObjectWithBasePosition +{ +protected: + basegfx::B2DSize maSize; + Color maStrokeColor; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence() SAL_OVERRIDE; + +public: + OverlayHandle(const basegfx::B2DPoint& rBasePos, + const basegfx::B2DSize& rSize, + Color& rStrokeColor, + Color& rFillColor); + + virtual ~OverlayHandle(); +}; + +}} // end of namespace sdr::overlay + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYHANDLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/overlay/overlaytools.hxx b/svx/inc/sdr/overlay/overlaytools.hxx index 095c411e1d5d..9a6f9fe31fe4 100644 --- a/svx/inc/sdr/overlay/overlaytools.hxx +++ b/svx/inc/sdr/overlay/overlaytools.hxx @@ -22,7 +22,43 @@ #include #include +#include +namespace drawinglayer { namespace primitive2d { + +class OverlayStaticRectanglePrimitive : public DiscreteMetricDependentPrimitive2D +{ +private: + basegfx::B2DPoint maPosition; + basegfx::B2DSize maSize; + + // the graphic definition + basegfx::BColor maStrokeColor; + basegfx::BColor maFillColor; + double mfTransparence; + + // the rotation of the primitive itself + double mfRotation; + +protected: + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE; + +public: + OverlayStaticRectanglePrimitive( + const basegfx::B2DPoint& rPosition, + const basegfx::B2DSize& rSize, + const basegfx::BColor& rStrokeColor, + const basegfx::BColor& rFillColor, + double fTransparence, + double fRotation); + + // compare operator + virtual bool operator==( const BasePrimitive2D& rPrimitive ) const SAL_OVERRIDE; + + DeclPrimitive2DIDBlock() +}; + +}} // end of namespace drawinglayer::primitive2d // Overlay helper class which holds a BotmapEx which is to be visualized // at the given logic position with the Bitmap's pixel size, unscaled and -- cgit