#include <config.h>
#include "insets/insetgraphics.h"
+#include "BufferView.h"
#include "Painter.h"
#include "form_graphics.h"
#include "lyx_gui_misc.h"
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) {
{}
-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;
}
-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(int(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));
}