Unhardcode and increase bindable Lua-script-action count
[ardour.git] / libs / canvas / canvas / text.h
index f72c08856635612fb3e1632700bcde07371cde9c..c05bc6905016995aa914dd764f1cc4428cadad5a 100644 (file)
@@ -33,41 +33,43 @@ class LIBCANVAS_API Text : public Item
 public:
        Text (Canvas*);
        Text (Item*);
-       ~Text();
+       ~Text();
 
        void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
        void compute_bounding_box () const;
 
-        ArdourCanvas::Color color () const { return _color; }
-       void set_color (ArdourCanvas::Color);
+       Gtkmm2ext::Color color () const { return _color; }
+       void set_color (Gtkmm2ext::Color);
 
        void set (std::string const &);
        void set_font_description (Pango::FontDescription);
        void set_alignment (Pango::Alignment);
 
-        void clamp_width (double);
+       void clamp_width (double);
 
-        void set_size_chars (int nchars);
-        void dump (std::ostream&) const;
+       double width() const;
+       double height() const;
+
+       void set_size_chars (int nchars);
+       void dump (std::ostream&) const;
 
        std::string text() const { return _text; }
+       double text_width() const;
 
 private:
        std::string             _text;
-        ArdourCanvas::Color     _color;
+       Gtkmm2ext::Color        _color;
        Pango::FontDescription* _font_description;
        Pango::Alignment        _alignment;
-        mutable Cairo::RefPtr<Cairo::ImageSurface> _image;
-        mutable Duple          _origin;
-        mutable double         _width;
-        mutable double         _height;
-        mutable bool           _need_redraw;
-        mutable double         _width_correction;
-        double                 _clamped_width;
-
-        void redraw (Cairo::RefPtr<Cairo::Context>) const;
-        void redraw (Glib::RefPtr<Pango::Context>) const;
-        void _redraw (Glib::RefPtr<Pango::Layout>) const;
+       mutable Cairo::RefPtr<Cairo::ImageSurface> _image;
+       mutable Duple           _origin;
+       mutable double          _width;
+       mutable double          _height;
+       mutable bool            _need_redraw;
+       mutable double          _width_correction;
+       double                  _clamped_width;
+
+       void _redraw () const;
 };
 
 }