2013-04-04 18:45:27 -04:00
|
|
|
#ifndef __ardour_canvas_text_h__
|
|
|
|
|
#define __ardour_canvas_text_h__
|
|
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
#include <pangomm/fontdescription.h>
|
|
|
|
|
#include <pangomm/layout.h>
|
|
|
|
|
|
|
|
|
|
#include "canvas/item.h"
|
|
|
|
|
|
|
|
|
|
namespace ArdourCanvas {
|
|
|
|
|
|
|
|
|
|
class Text : public Item
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Text (Group *);
|
2013-04-04 18:45:27 -04:00
|
|
|
~Text();
|
2013-04-04 00:32:52 -04:00
|
|
|
|
|
|
|
|
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);
|
2013-04-04 18:45:27 -04:00
|
|
|
void set_font_description (Pango::FontDescription);
|
2013-04-04 00:32:52 -04:00
|
|
|
void set_alignment (Pango::Alignment);
|
|
|
|
|
|
2013-04-06 18:35:32 -04:00
|
|
|
void set_size_chars (int nchars);
|
|
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
private:
|
2013-04-06 18:35:32 -04:00
|
|
|
std::string _text;
|
|
|
|
|
uint32_t _color;
|
2013-04-04 00:32:52 -04:00
|
|
|
Pango::FontDescription* _font_description;
|
|
|
|
|
Pango::Alignment _alignment;
|
2013-04-06 19:04:34 -04:00
|
|
|
mutable Cairo::RefPtr<Cairo::ImageSurface> _image;
|
|
|
|
|
mutable Duple _origin;
|
|
|
|
|
mutable int _width;
|
|
|
|
|
mutable int _height;
|
|
|
|
|
mutable bool _need_redraw;
|
2013-04-06 18:35:32 -04:00
|
|
|
|
2013-04-06 19:04:34 -04:00
|
|
|
void redraw (Cairo::RefPtr<Cairo::Context>) const;
|
2013-04-04 00:32:52 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
2013-04-04 18:45:27 -04:00
|
|
|
|
|
|
|
|
#endif /* __ardour_canvas_text_h__ */
|