]> 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 e39691c7d8349d694a374407e8916a30360e3428..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
@@ -1919,11 +1921,11 @@ void InsetFig::RestoreForm()
                fl_activate_object(form->Height);
        }
 
-       int pflags = flags & 3;
-       fl_set_button(form->Wysiwyg0, (pflags == 0));
-       fl_set_button(form->Wysiwyg1, (pflags == 1));
-       fl_set_button(form->Wysiwyg2, (pflags == 2));
-       fl_set_button(form->Wysiwyg3, (pflags == 3));
+       int piflags = flags & 3;
+       fl_set_button(form->Wysiwyg0, (piflags == 0));
+       fl_set_button(form->Wysiwyg1, (piflags == 1));
+       fl_set_button(form->Wysiwyg2, (piflags == 2));
+       fl_set_button(form->Wysiwyg3, (piflags == 3));
        fl_set_button(form->Frame, ((flags & 4) != 0));
        fl_set_button(form->Translations, ((flags & 8) != 0));
        fl_set_button(form->Subfigure, (subfigure != 0));