2 * \file frontend/Application.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Abdelrazak Younes
8 * Full author contact details are available in file CREDITS.
13 #include "frontends/Application.h"
15 #include "frontends/NoGuiFontLoader.h"
16 #include "frontends/NoGuiFontMetrics.h"
17 #include "frontends/FontLoader.h"
18 #include "frontends/FontMetrics.h"
19 #include "frontends/Gui.h"
20 #include "frontends/LyXView.h"
22 #include "FuncRequest.h"
23 #include "FuncStatus.h"
24 #include "LyX.h" // for lyx::use_gui
29 #include "support/lstrings.h"
30 #include "support/os.h"
36 frontend::FontLoader & theFontLoader()
38 static frontend::NoGuiFontLoader no_gui_font_loader;
41 return no_gui_font_loader;
43 BOOST_ASSERT(theApp());
44 return theApp()->fontLoader();
48 frontend::FontMetrics const & theFontMetrics(Font const & f)
50 return theFontMetrics(f.fontInfo());
54 frontend::FontMetrics const & theFontMetrics(FontInfo const & f)
56 static frontend::NoGuiFontMetrics no_gui_font_metrics;
59 return no_gui_font_metrics;
61 BOOST_ASSERT(theApp());
62 return theApp()->fontLoader().metrics(f);
66 frontend::Clipboard & theClipboard()
68 BOOST_ASSERT(theApp());
69 return theApp()->clipboard();
73 frontend::Selection & theSelection()
75 BOOST_ASSERT(theApp());
76 return theApp()->selection();