]> git.lyx.org Git - features.git/blobdiff - src/insets/inseterror.C
read the Changelog
[features.git] / src / insets / inseterror.C
index a01ca847812a517c396ed0fbc192e01620ec78d9..7cfdd4b25028f750b9703d83997b30e616d2c021 100644 (file)
 #include "gettext.h"
 #include "lyx_gui_misc.h" // CancelCloseBoxCB
 #include "Painter.h"
+#include "BufferView.h"
 #include "font.h"
 
 using std::ostream;
 
 /* Error, used for the LaTeX-Error Messages */
 
+#if 0
 InsetError::InsetError()
 {
        form = 0;
 }
+#endif
 
 
 InsetError::InsetError(string const & str)
-       : contents(str)
-{
-       form = 0;
-}
+       : contents(str), form(0)
+{}
 
 
 InsetError::~InsetError()
@@ -47,7 +48,7 @@ InsetError::~InsetError()
 }
 
 
-int InsetError::ascent(Painter &, LyXFont const & font) const
+int InsetError::ascent(BufferView *, LyXFont const & font) const
 {
        LyXFont efont;
        efont.setSize(font.size()).decSize();
@@ -55,7 +56,7 @@ int InsetError::ascent(Painter &, LyXFont const & font) const
 }
 
 
-int InsetError::descent(Painter &, LyXFont const & font) const
+int InsetError::descent(BufferView *, LyXFont const & font) const
 {
        LyXFont efont;
        efont.setSize(font.size()).decSize();
@@ -63,7 +64,7 @@ int InsetError::descent(Painter &, LyXFont const & font) const
 }
 
 
-int InsetError::width(Painter &, LyXFont const & font) const
+int InsetError::width(BufferView *, LyXFont const & font) const
 {
        LyXFont efont;
        efont.setSize(font.size()).decSize();
@@ -71,26 +72,27 @@ int InsetError::width(Painter &, LyXFont const & font) const
 }
 
 
-void InsetError::draw(Painter & pain, LyXFont const & font,
-                     int baseline, float & x) const
+void InsetError::draw(BufferView * bv, LyXFont const & font,
+                     int baseline, float & x, bool) const
 {
+       Painter & pain = bv->painter();
        LyXFont efont;
        efont.setSize(font.size()).decSize();
        efont.setColor(LColor::error);
    
        // Draw as "Error" in a framed box
        x += 1;
-       pain.fillRectangle(int(x), baseline - ascent(pain, font) + 1,
-                         width(pain, font) - 2,
-                         ascent(pain, font) + descent(pain, font) - 2,
+       pain.fillRectangle(int(x), baseline - ascent(bv, font) + 1,
+                         width(bv, font) - 2,
+                         ascent(bv, font) + descent(bv, font) - 2,
                           LColor::insetbg);
-       pain.rectangle(int(x), baseline - ascent(pain, font) + 1,
-                      width(pain, font) - 2,
-                      ascent(pain, font) + descent(pain, font) - 2,
+       pain.rectangle(int(x), baseline - ascent(bv, font) + 1,
+                      width(bv, font) - 2,
+                      ascent(bv, font) + descent(bv, font) - 2,
                       LColor::error);
        pain.text(int(x + 2), baseline, _("Error"), efont);
 
-       x +=  width(pain, font) - 1;
+       x +=  width(bv, font) - 1;
 }
 
 
@@ -153,7 +155,8 @@ void InsetError::CloseErrorCB(FL_OBJECT * ob, long)
 
 
 // A C wrapper
-extern "C" void C_InsetError_CloseErrorCB(FL_OBJECT * ob, long data)
+extern "C"
+void C_InsetError_CloseErrorCB(FL_OBJECT * ob, long data)
 {
         InsetError::CloseErrorCB(ob , data);
 }