#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"
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();
}