20 #ifndef __gtkmm2ext_fastmeter_h__
21 #define __gtkmm2ext_fastmeter_h__
24 #include <boost/tuple/tuple.hpp>
25 #include <boost/tuple/tuple_comparison.hpp>
26 #include <cairomm/pattern.h>
40 FastMeter (
long hold_cnt,
unsigned long width, Orientation,
int len=0,
41 int clr0=0x008800ff,
int clr1=0x008800ff,
42 int clr2=0x00ff00ff,
int clr3=0x00ff00ff,
43 int clr4=0xffaa00ff,
int clr5=0xffaa00ff,
44 int clr6=0xffff00ff,
int clr7=0xffff00ff,
45 int clr8=0xff0000ff,
int clr9=0xff0000ff,
46 int bgc0=0x333333ff,
int bgc1=0x444444ff,
47 int bgh0=0x991122ff,
int bgh1=0x551111ff,
55 static void flush_pattern_cache();
57 void set (
float level,
float peak = -1);
65 void set_hold_count (
long);
66 void set_highlight (
bool);
70 void render (cairo_t *, cairo_rectangle_t*);
71 void on_size_request (GtkRequisition*);
72 void on_size_allocate (Gtk::Allocation&);
99 void vertical_expose (cairo_t*, cairo_rectangle_t*);
100 void vertical_size_request (GtkRequisition*);
101 void vertical_size_allocate (Gtk::Allocation&);
102 void queue_vertical_redraw (
const Glib::RefPtr<Gdk::Window>&,
float);
104 void horizontal_expose (cairo_t*, cairo_rectangle_t*);
105 void horizontal_size_request (GtkRequisition*);
106 void horizontal_size_allocate (Gtk::Allocation&);
107 void queue_horizontal_redraw (
const Glib::RefPtr<Gdk::Window>&,
float);
111 static Cairo::RefPtr<Cairo::Pattern> generate_meter_pattern (
112 int,
int,
int *,
float *,
int,
bool);
113 static Cairo::RefPtr<Cairo::Pattern> request_vertical_meter (
114 int,
int,
int *,
float *,
int);
115 static Cairo::RefPtr<Cairo::Pattern> request_horizontal_meter (
116 int,
int,
int *,
float *,
int);
118 static Cairo::RefPtr<Cairo::Pattern> generate_meter_background (
119 int,
int,
int *,
bool,
bool);
120 static Cairo::RefPtr<Cairo::Pattern> request_vertical_background (
121 int,
int,
int *,
bool);
122 static Cairo::RefPtr<Cairo::Pattern> request_horizontal_background (
123 int,
int,
int *,
bool);
128 float stp0,
float stp1,
float stp2,
float stp3,
129 int c0,
int c1,
int c2,
int c3,
130 int c4,
int c5,
int c6,
int c7,
131 int c8,
int c9,
int st
134 , stp(stp0, stp1, stp2, stp3)
135 , cols(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9)
139 return (dim < rhs.
dim)
140 || (dim == rhs.
dim && stp < rhs.
stp)
141 || (dim == rhs.
dim && stp == rhs.
stp && cols < rhs.
cols)
142 || (dim == rhs.
dim && stp == rhs.
stp && cols == rhs.
cols && style < rhs.
style);
144 boost::tuple<int, int>
dim;
145 boost::tuple<float, float, float, float>
stp;
146 boost::tuple<int, int, int, int, int, int, int, int, int, int>
cols;
149 typedef std::map<Pattern10MapKey, Cairo::RefPtr<Cairo::Pattern> >
Pattern10Map;
158 return (dim < rhs.
dim) || (dim == rhs.
dim && cols < rhs.
cols) || (dim == rhs.
dim && cols == rhs.
cols && (sh && !rhs.
sh));
160 boost::tuple<int, int>
dim;
164 typedef std::map<PatternBgMapKey, Cairo::RefPtr<Cairo::Pattern> >
PatternBgMap;
bool operator<(const PatternBgMapKey &rhs) const
std::map< Pattern10MapKey, Cairo::RefPtr< Cairo::Pattern > > Pattern10Map
std::map< PatternBgMapKey, Cairo::RefPtr< Cairo::Pattern > > PatternBgMap
PatternBgMapKey(int w, int h, int c0, int c1, bool shade)
static Pattern10Map hm_pattern_cache
Cairo::RefPtr< Cairo::Pattern > bgpattern
static bool no_rgba_overlay
boost::tuple< int, int, int, int, int, int, int, int, int, int > cols
static PatternBgMap hb_pattern_cache
bool operator<(const Pattern10MapKey &rhs) const
boost::tuple< int, int > dim
Cairo::RefPtr< Cairo::Pattern > fgpattern
static Pattern10Map vm_pattern_cache
boost::tuple< int, int > dim
boost::tuple< float, float, float, float > stp
static int min_pattern_metric_size
boost::tuple< int, int > cols
Pattern10MapKey(int w, int h, float stp0, float stp1, float stp2, float stp3, int c0, int c1, int c2, int c3, int c4, int c5, int c6, int c7, int c8, int c9, int st)
GdkRectangle last_peak_rect
static int max_pattern_metric_size
static PatternBgMap vb_pattern_cache