#include "frontends/Application.h"
+#include "frontends/NoGuiFontLoader.h"
+#include "frontends/NoGuiFontMetrics.h"
#include "frontends/FontLoader.h"
#include "frontends/FontMetrics.h"
#include "frontends/Gui.h"
#include "bufferlist.h"
#include "funcrequest.h"
#include "FuncStatus.h"
+#include "lyx_main.h"
#include "LyXAction.h"
#include "lyxfont.h"
#include "lyxfunc.h"
// this can't be done before because it needs the Languages object
//initEncodings();
- int view_id = gui().newView(width, height);
+ int view_id = gui().newView();
LyXView & view = gui().view(view_id);
pimpl_->lyxfunc_.reset(new LyXFunc(&view));
LyXFunc & theLyXFunc()
{
+ BOOST_ASSERT(theApp);
return theApp->lyxFunc();
}
lyx::frontend::FontLoader & theFontLoader()
{
+ static lyx::frontend::NoGuiFontLoader no_gui_font_loader;
+
+ if (!lyx::use_gui)
+ return no_gui_font_loader;
+
+ BOOST_ASSERT(theApp);
return theApp->fontLoader();
}
lyx::frontend::FontMetrics const & theFontMetrics(LyXFont const & f)
{
+ static lyx::frontend::NoGuiFontMetrics no_gui_font_metrics;
+
+ if (!lyx::use_gui)
+ return no_gui_font_metrics;
+
+ BOOST_ASSERT(theApp);
return theApp->fontLoader().metrics(f);
}
lyx::frontend::Clipboard & theClipboard()
{
+ BOOST_ASSERT(theApp);
return theApp->clipboard();
}
lyx::frontend::Selection & theSelection()
{
+ BOOST_ASSERT(theApp);
return theApp->selection();
}