Ardour  9.0-pre0-582-g084a23a80d
canvas/canvas/arrow.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2013-2014 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
25 #ifndef __CANVAS_ARROW_H__
26 #define __CANVAS_ARROW_H__
27 
28 #include "canvas/visibility.h"
29 #include "canvas/container.h"
30 
31 namespace ArdourCanvas {
32 
33 class Canvas;
34 class Line;
35 class Polygon;
36 
49 {
50 public:
52  Arrow (Item*);
53 
54  void compute_bounding_box () const;
55 
56  void set_show_head (int, bool);
57  void set_head_outward (int, bool);
59  void set_head_width (int, Distance);
62 
63  Coord x () const;
64  Coord y1 () const;
65 
66  void set_x (Coord);
67  void set_y0 (Coord);
68  void set_y1 (Coord);
69 
70  bool covers (Duple const &) const;
71 
72 private:
73  void setup_polygon (int);
74  void setup ();
75 
77  struct Head {
79  bool outward;
82  };
83 
87  Head _heads[2];
88 
91 };
92 
93 }
94 
95 #endif
#define LIBCANVAS_API
Coord y1() const
void set_head_width(int, Distance)
void set_outline_width(Distance)
Coord x() const
bool covers(Duple const &) const
void set_show_head(int, bool)
void set_head_height(int, Distance)
void set_head_outward(int, bool)
void set_y0(Coord)
void setup_polygon(int)
void set_y1(Coord)
void compute_bounding_box() const
void set_color(Gtkmm2ext::Color)
uint32_t Color
Definition: colors.h:33
Distance width
the maximum width of the head
Distance height
the height of the head
bool outward
true if this head points out from the line
Polygon * polygon
the polygon which represents its shape