3 This file is part of libmspgltk
4 Copyright © 2009-2010 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GLTK_TEXT_H_
9 #define MSP_GLTK_TEXT_H_
22 Stores and renders text. Supports multiline text.
36 std::vector<Line> lines;
40 Text(const Style &, const std::string &);
42 void set_style(const Style *);
44 unsigned get_width() const;
45 unsigned get_height() const;
47 void set(const std::string &);
48 void erase(unsigned, unsigned);
49 void insert(unsigned, const std::string &);
50 const std::string &get() const { return text; }
51 unsigned size() const { return text.size(); }
52 unsigned get_n_lines() const { return lines.size(); }
53 unsigned get_line_length(unsigned) const;
54 void offset_to_coords(unsigned, unsigned &, unsigned &) const;
55 unsigned coords_to_offset(unsigned, unsigned) const;
56 Geometry coords_to_geometry(unsigned, unsigned) const;
58 void render(const Part &, const Geometry &) const;
60 Text &operator=(const std::string &);