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"
21 #include "frontends/WorkArea.h"
23 #include "FuncRequest.h"
24 #include "FuncStatus.h"
25 #include "LyX.h" // for lyx::use_gui
30 #include "support/lstrings.h"
31 #include "support/os.h"
33 #include <boost/scoped_ptr.hpp>
34 #include <boost/shared_ptr.hpp>
41 Application::Application(int &, char **)
47 LyXView & Application::createView(unsigned int width,
51 unsigned int iconSizeXY,
52 const std::string & geometryArg)
54 LyXView & view = gui().createRegisteredView();
55 theLyXFunc().setLyXView(&view);
58 view.setGeometry(width, height, posx, posy, maximized, iconSizeXY, geometryArg);
68 LyXView const * Application::currentView() const
74 LyXView * Application::currentView()
80 void Application::setCurrentView(LyXView & current_view)
82 current_view_ = ¤t_view;
85 } // namespace frontend
89 frontend::FontLoader & theFontLoader()
91 static frontend::NoGuiFontLoader no_gui_font_loader;
94 return no_gui_font_loader;
96 BOOST_ASSERT(theApp());
97 return theApp()->fontLoader();
101 frontend::FontMetrics const & theFontMetrics(Font const & f)
103 static frontend::NoGuiFontMetrics no_gui_font_metrics;
106 return no_gui_font_metrics;
108 BOOST_ASSERT(theApp());
109 return theApp()->fontLoader().metrics(f);
113 frontend::Clipboard & theClipboard()
115 BOOST_ASSERT(theApp());
116 return theApp()->clipboard();
120 frontend::Selection & theSelection()
122 BOOST_ASSERT(theApp());
123 return theApp()->selection();