]> git.lyx.org Git - lyx.git/blobdiff - src/insets/figinset.C
Some more changes for updating text-insets.
[lyx.git] / src / insets / figinset.C
index 7fe8f386fd1e368736b0d943fa95f9a01323356d..e546f7edbb4a77a819e83c7fef44dbe6f08a166e 100644 (file)
@@ -405,7 +405,7 @@ void InitFigures()
        if (lyxrc.use_gui) {
                fl_add_canvas_handler(figinset_canvas, ClientMessage,
                                      GhostscriptMsg,
-                                     current_view->owner()->getMainForm());
+                                     current_view->owner()->getForm());
 
                local_gc_copy = createGC();
 
@@ -1034,10 +1034,11 @@ int InsetFig::width(Painter &, LyXFont const &) const
 }
 
 
-void InsetFig::draw(Painter & pain, LyXFont const & f,
-                   int baseline, float & x) const
+void InsetFig::draw(BufferView * bv, LyXFont const & f,
+                   int baseline, float & x, bool) const
 {
        LyXFont font(f);
+       Painter & pain = bv->painter();
        
        if (bitmap_waiting) getbitmaps();
        
@@ -1058,7 +1059,7 @@ void InsetFig::draw(Painter & pain, LyXFont const & f,
        } else {
                char * msg = 0;
                // draw frame
-               pain.rectangle(x, baseline - hgh - 1, wid + 1, hgh + 1);
+               pain.rectangle(int(x), baseline - hgh - 1, wid + 1, hgh + 1);
 
                if (figure && figure->data) {
                        if (figure->data->broken)  msg = _("[render error]");
@@ -1088,7 +1089,7 @@ void InsetFig::draw(Painter & pain, LyXFont const & f,
 }
 
 
-void InsetFig::Write(ostream & os) const
+void InsetFig::Write(Buffer const *, ostream & os) const
 {
        Regenerate();
        os << "Figure size " << wid << " " << hgh << "\n";
@@ -1107,7 +1108,7 @@ void InsetFig::Write(ostream & os) const
 }
 
 
-void InsetFig::Read(LyXLex & lex)
+void InsetFig::Read(Buffer const *, LyXLex & lex)
 {
        string buf;
        bool finished = false;
@@ -1191,7 +1192,7 @@ void InsetFig::Read(LyXLex & lex)
 }
 
 
-int InsetFig::Latex(ostream & os,
+int InsetFig::Latex(Buffer const *, ostream & os,
                    bool /* fragile*/, bool /* fs*/) const
 {
        Regenerate();
@@ -1200,28 +1201,29 @@ int InsetFig::Latex(ostream & os,
 }
 
 
-int InsetFig::Ascii(ostream &) const
+int InsetFig::Ascii(Buffer const *, ostream &) const
 {
        return 0;
 }
 
 
-int InsetFig::Linuxdoc(ostream &) const
+int InsetFig::Linuxdoc(Buffer const *, ostream &) const
 {
        return 0;
 }
 
 
-int InsetFig::DocBook(ostream & os) const
+int InsetFig::DocBook(Buffer const *, ostream & os) const
 {
-       string figurename = fname;
+       string buf1 = OnlyPath(owner->fileName());
+       string figurename = MakeRelPath(fname, buf1);
 
        if(suffixIs(figurename, ".eps"))
                figurename.erase(fname.length() - 4);
 
        os << "@<graphic fileref=\"" << figurename << "\"></graphic>";
        return 0;
-}
+} 
 
 
 void InsetFig::Validate(LaTeXFeatures & features) const