summaryrefslogtreecommitdiff
path: root/svx/inc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-03-25 15:42:41 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-03-27 10:45:15 +0900
commit913b3a648117206d21821b0cea40ff15a0e8e5cf (patch)
tree83c28ebde2e2d9dda7227c26e05d0a0d89f652d8 /svx/inc
parent33094a542fbcdcdaf14d5d7304e79f2e5b8cd4de (diff)
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
Diffstat (limited to 'svx/inc')
-rw-r--r--svx/inc/sdr/overlay/overlayhandle.hxx42
-rw-r--r--svx/inc/sdr/overlay/overlaytools.hxx36
2 files changed, 78 insertions, 0 deletions
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 <svx/sdr/overlay/overlayobject.hxx>
+#include <basegfx/vector/b2dsize.hxx>
+
+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 <drawinglayer/primitive2d/primitivetools2d.hxx>
#include <vcl/bitmapex.hxx>
+#include <basegfx/vector/b2dsize.hxx>
+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