]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetquotes.C
fix the resize bug, make some more inset funcs const, cleanup in lyxscreen, painter...
[lyx.git] / src / insets / insetquotes.C
index d069cc2d6b9836ada42f5b76c1ab500f8c448957..de2790db471288ad13ea977a94d9585fe1bb50c4 100644 (file)
@@ -22,6 +22,7 @@
 #include "buffer.h"
 #include "LaTeXFeatures.h"
 #include "support/lstrings.h"
+#include "Painter.h"
 
 // Quotes. Used for the various quotes. German, English, French,
 // Danish, Polish, all either double or single.
@@ -155,19 +156,19 @@ string InsetQuotes::DispString() const
 }
 
 
-int InsetQuotes::Ascent(LyXFont const & font) const
+int InsetQuotes::ascent(Painter &, LyXFont const & font) const
 {
        return font.maxAscent();
 }
 
 
-int InsetQuotes::Descent(LyXFont const & font) const
+int InsetQuotes::descent(Painter &, LyXFont const & font) const
 {
        return font.maxDescent();
 }
 
 
-int InsetQuotes::Width(LyXFont const & font) const
+int InsetQuotes::width(Painter &, LyXFont const & font) const
 {
        string text = DispString();
        int w = 0;
@@ -193,17 +194,17 @@ LyXFont InsetQuotes::ConvertFont(LyXFont font)
 }
 
 
-void InsetQuotes::Draw(LyXFont font, LyXScreen & scr,
-                      int baseline, float & x)
+void InsetQuotes::draw(Painter & pain, LyXFont const & font,
+                      int baseline, float & x) const
 {
        string text = DispString();
 
-       scr.drawString(font, text, baseline, int(x));
-       x += Width(font);
+       pain.text(int(x), baseline, text, font);
+       x += width(pain, font);
 }
 
 
-void InsetQuotes::Write(ostream & os)
+void InsetQuotes::Write(ostream & os) const
 {
        string text;
        text += language_char[language];
@@ -220,7 +221,7 @@ void InsetQuotes::Read(LyXLex & lex)
 }
 
 
-int InsetQuotes::Latex(ostream & os, signed char /*fragile*/)
+int InsetQuotes::Latex(ostream & os, signed char /*fragile*/) const
 {
        string quote;
        int res = Latex(quote, 0);
@@ -229,7 +230,7 @@ int InsetQuotes::Latex(ostream & os, signed char /*fragile*/)
 }
 
 
-int InsetQuotes::Latex(string & file, signed char /*fragile*/)
+int InsetQuotes::Latex(string & file, signed char /*fragile*/) const
 {
        string doclang = 
                current_view->buffer()->GetLanguage();
@@ -263,7 +264,7 @@ int InsetQuotes::Latex(string & file, signed char /*fragile*/)
 }
 
 
-int InsetQuotes::Linuxdoc(string & file)
+int InsetQuotes::Linuxdoc(string & file) const
 {
        file += "\"";
 
@@ -271,7 +272,7 @@ int InsetQuotes::Linuxdoc(string & file)
 }
 
 
-int InsetQuotes::DocBook(string & file)
+int InsetQuotes::DocBook(string & file) const
 {
        if(times == InsetQuotes::DoubleQ) {
                if (side == InsetQuotes::LeftQ)