#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 {
Application::Application(int &, char **)
{
-}
-
-
-void Application::setBufferView(BufferView * buffer_view)
-{
- buffer_view_ = buffer_view;
+ // FIXME: please confirm: with unicode, I think initEncoding()
+ // is not needed anymore!
+
+ // this can't be done before because it needs the Languages object
+ //initEncodings();
}
int posx, int posy,
bool maximize)
{
- // FIXME: please confirm: with unicode, I think initEncoding()
- // is not needed anymore!
-
- // this can't be done before because it needs the Languages object
- //initEncodings();
-
int view_id = gui().newView();
LyXView & view = gui().view(view_id);
theLyXFunc().setLyXView(&view);
- // FIXME: for now we assume that there is only one LyXView with id = 0.
- /*int workArea_id_ =*/ gui().newWorkArea(width, height, 0);
- //WorkArea * workArea_ = & theApp->gui().workArea(workArea_id_);
+ /*int workArea_id_ =*/ gui().newWorkArea(width, height, view_id);
view.init();
view.setGeometry(width, height, posx, posy, maximize);
+ setCurrentView(view);
+
return view;
}
-int Application::start(std::string const & batch)
+LyXView const & Application::currentView() const
+{
+ return *current_view_;
+}
+
+
+LyXView & Application::currentView()
+{
+ return *current_view_;
+}
+
+
+void Application::setCurrentView(LyXView & current_view)
+{
+ current_view_ = ¤t_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);
}
-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);
}
-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