blob: c65953783dbe1780499147a24120c8ba1d86bda8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#ifndef __ardour_canvas_text_h__
#define __ardour_canvas_text_h__
#include <pangomm/fontdescription.h>
#include <pangomm/layout.h>
#include "canvas/item.h"
namespace ArdourCanvas {
class Text : public Item
{
public:
Text (Group *);
~Text();
void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
void compute_bounding_box () const;
XMLNode* get_state () const;
void set_state (XMLNode const *);
void set (std::string const &);
void set_color (uint32_t);
void set_font_description (Pango::FontDescription);
void set_alignment (Pango::Alignment);
void set_size_chars (int nchars);
void dump (std::ostream&) const;
private:
std::string _text;
uint32_t _color;
Pango::FontDescription* _font_description;
Pango::Alignment _alignment;
mutable Cairo::RefPtr<Cairo::ImageSurface> _image;
mutable Duple _origin;
mutable int _width;
mutable int _height;
mutable bool _need_redraw;
void redraw (Cairo::RefPtr<Cairo::Context>) const;
};
}
#endif /* __ardour_canvas_text_h__ */
|