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/LyXView.h"
21 #include "FuncRequest.h"
22 #include "FuncStatus.h"
23 #include "LyX.h" // for lyx::use_gui
28 #include "support/lstrings.h"
29 #include "support/os.h"
35 frontend::FontLoader & theFontLoader()
37 static frontend::NoGuiFontLoader no_gui_font_loader;
40 return no_gui_font_loader;
42 BOOST_ASSERT(theApp());
43 return theApp()->fontLoader();
47 frontend::FontMetrics const & theFontMetrics(Font const & f)
49 return theFontMetrics(f.fontInfo());
53 frontend::FontMetrics const & theFontMetrics(FontInfo const & f)
55 static frontend::NoGuiFontMetrics no_gui_font_metrics;
58 return no_gui_font_metrics;
60 BOOST_ASSERT(theApp());
61 return theApp()->fontLoader().metrics(f);
65 frontend::Clipboard & theClipboard()
67 BOOST_ASSERT(theApp());
68 return theApp()->clipboard();
72 frontend::Selection & theSelection()
74 BOOST_ASSERT(theApp());
75 return theApp()->selection();