Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <svx/sdr/overlay/overlayhelpline.hxx>
21 : #include <vcl/outdev.hxx>
22 : #include <basegfx/vector/b2dvector.hxx>
23 : #include <svx/sdr/overlay/overlaytools.hxx>
24 : #include <svx/sdr/overlay/overlaymanager.hxx>
25 :
26 :
27 :
28 : namespace sdr
29 : {
30 : namespace overlay
31 : {
32 0 : drawinglayer::primitive2d::Primitive2DSequence OverlayHelplineStriped::createOverlayObjectPrimitive2DSequence()
33 : {
34 0 : drawinglayer::primitive2d::Primitive2DSequence aRetval;
35 :
36 0 : if(getOverlayManager())
37 : {
38 0 : const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor());
39 0 : const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor());
40 0 : const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel());
41 : const drawinglayer::primitive2d::HelplineStyle aStyle(
42 0 : SDRHELPLINE_POINT == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_POINT :
43 0 : SDRHELPLINE_VERTICAL == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_VERTICAL :
44 0 : drawinglayer::primitive2d::HELPLINESTYLE_HORIZONTAL);
45 :
46 : const drawinglayer::primitive2d::Primitive2DReference aReference(
47 : new drawinglayer::primitive2d::OverlayHelplineStripedPrimitive(
48 0 : getBasePosition(),
49 : aStyle,
50 : aRGBColorA,
51 : aRGBColorB,
52 0 : fStripeLengthPixel));
53 :
54 0 : aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1);
55 : }
56 :
57 0 : return aRetval;
58 : }
59 :
60 0 : void OverlayHelplineStriped::stripeDefinitionHasChanged()
61 : {
62 : // react on OverlayManager's stripe definition change
63 0 : objectChange();
64 0 : }
65 :
66 0 : OverlayHelplineStriped::OverlayHelplineStriped(
67 : const basegfx::B2DPoint& rBasePos,
68 : SdrHelpLineKind eNewKind)
69 : : OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)),
70 0 : meKind(eNewKind)
71 : {
72 0 : }
73 :
74 0 : OverlayHelplineStriped::~OverlayHelplineStriped()
75 : {
76 0 : }
77 : } // end of namespace overlay
78 : } // end of namespace sdr
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|