]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/text.h
Support multiline text editing
[libs/gltk.git] / source / text.h
index d964aa19bbf4575ce7d10c9ceea743d38a15017c..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_
 
@@ -42,6 +49,11 @@ public:
        void insert(unsigned, const std::string &);
        const std::string &get() const { return text; }
        unsigned size() const { return text.size(); }
+       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;