]> git.lyx.org Git - features.git/blobdiff - src/insets/insetgraphics.C
read the Changelog
[features.git] / src / insets / insetgraphics.C
index dd591b24522174529acae38fb4a273736b386f04..bfcc2088c2d829391f2a457e3eda46d03f2f0c9e 100644 (file)
@@ -15,6 +15,7 @@
 #include <config.h>
 
 #include "insets/insetgraphics.h"
+#include "BufferView.h"
 #include "Painter.h"
 #include "form_graphics.h"
 #include "lyx_gui_misc.h"
@@ -31,7 +32,8 @@ extern string system_tempdir;
 
 string browseFile();
 
-extern "C" void GraphicxCB(FL_OBJECT * obj, long arg) 
+extern "C"
+void GraphicxCB(FL_OBJECT * obj, long arg) 
 {
        lyxerr << "GraphicxCB: obj = " << obj << " arg = " << arg << endl;
        switch (arg) {
@@ -110,21 +112,21 @@ InsetGraphics::InsetGraphics()
 {}
 
 
-int InsetGraphics::ascent(Painter &, LyXFont const &) const 
+int InsetGraphics::ascent(BufferView *, LyXFont const &) const 
 {
        
        return 100;
 }
 
 
-int InsetGraphics::descent(Painter &, LyXFont const &) const 
+int InsetGraphics::descent(BufferView *, LyXFont const &) const 
 {
        // this is not true if viewport is used and clip is not.
        return 1;
 }
 
 
-int InsetGraphics::width(Painter &, LyXFont const &) const 
+int InsetGraphics::width(BufferView *, LyXFont const &) const 
 {
        if (bb.isSet()) {
                return bb.urx - bb.llx;
@@ -133,14 +135,16 @@ int InsetGraphics::width(Painter &, LyXFont const &) const
 }
 
 
-void InsetGraphics::draw(Painter & pain, LyXFont const & font,
-                        int baseline, float & x) const
+void InsetGraphics::draw(BufferView * bv, LyXFont const & font,
+                        int baseline, float & x, bool) const
 {
+       Painter & pain = bv->painter();
+
        // This will draw the graphics. As for now we only draw a
        // placeholder rectangele.
-       pain.rectangle(x, baseline - ascent(pain, font),
-                      width(pain, font),
-                      ascent(pain, font) + descent(pain, font));
+       pain.rectangle(int(x), baseline - ascent(bv, font),
+                      width(bv, font),
+                      ascent(bv, font) + descent(bv, font));
 }
 
 
@@ -171,7 +175,7 @@ Inset::EDITABLE InsetGraphics::Editable() const
 }
 
 
-void InsetGraphics::Write(ostream & os) const
+void InsetGraphics::Write(Buffer const *, ostream & os) const
 {
        // The question on the file format is still open.
        // Suggestions?
@@ -181,7 +185,7 @@ void InsetGraphics::Write(ostream & os) const
 }
 
 
-void InsetGraphics::Read(LyXLex & /*lex*/) 
+void InsetGraphics::Read(Buffer const *, LyXLex & /*lex*/) 
 {
        // For now we only use a static file...
        graphicsfile = "testfile.xpm";
@@ -191,7 +195,7 @@ void InsetGraphics::Read(LyXLex & /*lex*/)
 }
 
 
-int InsetGraphics::Latex(ostream & os,
+int InsetGraphics::Latex(Buffer const *, ostream & os,
                         bool /*fragile*/, bool/*fs*/) const
 {
        // MISSING: We have to decide how to do the order of the options
@@ -334,19 +338,19 @@ int InsetGraphics::Latex(ostream & os,
 }
 
 
-int InsetGraphics::Ascii(ostream &) const
+int InsetGraphics::Ascii(Buffer const *, ostream &) const
 {
        return 0;
 }
 
 
-int InsetGraphics::Linuxdoc(ostream &) const
+int InsetGraphics::Linuxdoc(Buffer const *, ostream &) const
 {
        return 0;
 }
 
 
-int InsetGraphics::DocBook(ostream &) const
+int InsetGraphics::DocBook(Buffer const *, ostream &) const
 {
        return 0;
 }