]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/text.h
Style update: add spaces around assignments
[libs/gltk.git] / source / text.h
index 7be119216aae4086210e8cfec8133be9b65a2c8d..0e1afaebd198b3230736d38bf1c198b7cc4dc25c 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of libmspgltk
+Copyright © 2009-2010  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #ifndef MSP_GLTK_TEXT_H_
 #define MSP_GLTK_TEXT_H_
 
@@ -24,13 +31,15 @@ private:
                unsigned width;
        };
 
-       const Style *const &style;
+       const Style *style;
        std::string text;
        std::vector<Line> lines;
 
 public:
-       Text(const Style *const &);
-       Text(const Style *const &, const std::string &);
+       Text();
+       Text(const Style &, const std::string &);
+
+       void set_style(const Style *);
 
        unsigned get_width() const;
        unsigned get_height() const;
@@ -40,8 +49,11 @@ public:
        void insert(unsigned, const std::string &);
        const std::string &get() const { return text; }
        unsigned size() const { return text.size(); }
-
-       void update_style();
+       unsigned get_n_lines() const { return lines.size(); }
+       unsigned get_line_length(unsigned) const;
+       void offset_to_coords(unsigned, unsigned &, unsigned &) const;
+       unsigned coords_to_offset(unsigned, unsigned) const;
+       Geometry coords_to_geometry(unsigned, unsigned) const;
 
        void render(const Part &, const Geometry &) const;