Ardour  8.7-15-gadf511264b
fill.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 
21 #ifndef __CANVAS_FILL_H__
22 #define __CANVAS_FILL_H__
23 
24 #include <vector>
25 #include <stdint.h>
26 
27 #include <boost/noncopyable.hpp>
28 
29 #include "canvas/visibility.h"
30 #include "canvas/types.h"
31 
32 namespace ArdourCanvas {
33 
34 class Item;
35 
36 class LIBCANVAS_API Fill : public boost::noncopyable
37 {
38 public:
39  Fill (Item& self);
40  virtual ~Fill() {}
41 
43  virtual void set_fill (bool);
44 
46  return _fill_color;
47  }
48 
49  bool fill () const {
50  return _fill;
51  }
52 
53  typedef std::vector<std::pair<double,Gtkmm2ext::Color> > StopList;
54 
55  void set_gradient (StopList const & stops, bool is_vertical);
56 
57  void set_pattern (Cairo::RefPtr<Cairo::Pattern>);
58 
59 protected:
60  void setup_fill_context (Cairo::RefPtr<Cairo::Context>) const;
61  void setup_gradient_context (Cairo::RefPtr<Cairo::Context>, Rect const &, Duple const &) const;
62 
65  bool _fill;
69  Cairo::RefPtr<Cairo::Pattern> _pattern;
70 
71 };
72 
73 }
74 
75 #endif
#define LIBCANVAS_API
Cairo::RefPtr< Cairo::Pattern > _pattern
Definition: fill.h:69
virtual void set_fill(bool)
Gtkmm2ext::Color _fill_color
Definition: fill.h:64
void set_pattern(Cairo::RefPtr< Cairo::Pattern >)
void setup_fill_context(Cairo::RefPtr< Cairo::Context >) const
bool _vertical_gradient
Definition: fill.h:68
std::vector< std::pair< double, Gtkmm2ext::Color > > StopList
Definition: fill.h:53
virtual ~Fill()
Definition: fill.h:40
StopList _stops
Definition: fill.h:67
virtual void set_fill_color(Gtkmm2ext::Color)
void setup_gradient_context(Cairo::RefPtr< Cairo::Context >, Rect const &, Duple const &) const
Fill(Item &self)
bool fill() const
Definition: fill.h:49
Item & _self
Definition: fill.h:63
Gtkmm2ext::Color fill_color() const
Definition: fill.h:45
bool _transparent
Definition: fill.h:66
void set_gradient(StopList const &stops, bool is_vertical)
uint32_t Color
Definition: colors.h:33