Ardour  9.0-pre0-427-gd2a3450e2f
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 "canvas/visibility.h"
28 #include "canvas/types.h"
29 
30 namespace ArdourCanvas {
31 
32 class Item;
33 
35 {
36 public:
37  Fill (Item& self);
38  Fill (const Fill&) = delete;
39  Fill& operator= (const Fill&) = delete;
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
Fill(const Fill &)=delete
bool _transparent
Definition: fill.h:66
void set_gradient(StopList const &stops, bool is_vertical)
uint32_t Color
Definition: colors.h:33