]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Application.C
hopefully fix tex2lyx linking.
[lyx.git] / src / frontends / Application.C
index b259a957f6dd366864de5beb47b1e58b903a28ac..a4902161f27a7356fc0e241cff924cb70d61c7b6 100644 (file)
 
 #include "support/lstrings.h"
 #include "support/os.h"
-#include "support/package.h"
 
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
-using lyx::support::package;
 
 namespace lyx {
 namespace frontend {
@@ -50,12 +48,6 @@ Application::Application(int &, char **)
 }
 
 
-void Application::setBufferView(BufferView * buffer_view)
-{
-       buffer_view_ = buffer_view;
-}
-
-
 LyXView & Application::createView(unsigned int width,
                                                                  unsigned int height,
                                                                  int posx, int posy,
@@ -71,24 +63,45 @@ LyXView & Application::createView(unsigned int width,
        view.init();
        view.setGeometry(width, height, posx, posy, maximize);
 
+       setCurrentView(view);
+
        return view;
 }
 
 
+LyXView const & Application::currentView() const
+{
+       return *current_view_;
+}
+
+
+LyXView & Application::currentView()
+{
+       return *current_view_;
+}
+
+
+void Application::setCurrentView(LyXView & current_view)
+{
+       current_view_ = &current_view;
+}
+
+
 int Application::start(std::string const & /*batch*/)
 {
        return exec();
 }
 
+
 } // namespace frontend
-} // namespace lyx
 
 
-lyx::frontend::FontLoader & theFontLoader()
+
+frontend::FontLoader & theFontLoader()
 {
-       static lyx::frontend::NoGuiFontLoader no_gui_font_loader;
+       static frontend::NoGuiFontLoader no_gui_font_loader;
 
-       if (!lyx::use_gui)
+       if (!use_gui)
                return no_gui_font_loader;
 
        BOOST_ASSERT(theApp);
@@ -96,11 +109,11 @@ lyx::frontend::FontLoader & theFontLoader()
 }
 
 
-lyx::frontend::FontMetrics const & theFontMetrics(LyXFont const & f)
+frontend::FontMetrics const & theFontMetrics(LyXFont const & f)
 {
-       static lyx::frontend::NoGuiFontMetrics no_gui_font_metrics;
+       static frontend::NoGuiFontMetrics no_gui_font_metrics;
 
-       if (!lyx::use_gui)
+       if (!use_gui)
                return no_gui_font_metrics;
 
        BOOST_ASSERT(theApp);
@@ -108,16 +121,18 @@ lyx::frontend::FontMetrics const & theFontMetrics(LyXFont const & f)
 }
 
 
-lyx::frontend::Clipboard & theClipboard()
+frontend::Clipboard & theClipboard()
 {
        BOOST_ASSERT(theApp);
        return theApp->clipboard();
 }
 
 
-lyx::frontend::Selection & theSelection()
+frontend::Selection & theSelection()
 {
        BOOST_ASSERT(theApp);
        return theApp->selection();
 }
 
+
+} // namespace lyx