2 * \file frontend/Application.C
\r
3 * This file is part of LyX, the document processor.
\r
4 * Licence details can be found in the file COPYING.
\r
6 * \author Abdelrazak Younes
\r
8 * Full author contact details are available in file CREDITS.
\r
13 #include "Application.h"
\r
15 #include "funcrequest.h"
\r
16 #include "LyXAction.h"
\r
18 #include "LyXView.h"
\r
20 #include "support/lstrings.h"
\r
21 #include "support/os.h"
\r
22 #include "support/package.h"
\r
24 #include <boost/scoped_ptr.hpp>
\r
26 using lyx::support::package;
\r
28 // FIXME: replace all occurence of lyxserver with theApp->server().
\r
29 LyXServer * lyxserver;
\r
30 // FIXME: replace all occurence of lyxsocket with theApp->socket().
\r
31 LyXServerSocket * lyxsocket;
\r
34 namespace frontend {
\r
37 Application::Application(int & argc, char ** argv)
\r
42 LyXFunc & Application::lyxFunc()
\r
44 return *lyxfunc_.get();
\r
48 LyXFunc const & Application::lyxFunc() const
\r
50 return *lyxfunc_.get();
\r
54 LyXServer & Application::server()
\r
56 return *lyx_server_.get();
\r
60 LyXServer const & Application::server() const
\r
62 return *lyx_server_.get();
\r
66 LyXServerSocket & Application::socket()
\r
68 return *lyx_socket_.get();
\r
72 LyXServerSocket const & Application::socket() const
\r
74 return *lyx_socket_.get();
\r
78 void Application::setBufferView(BufferView * buffer_view)
\r
80 buffer_view_ = buffer_view;
\r
84 int Application::start(std::string const & batch)
\r
86 lyx_server_.reset(new LyXServer(lyxfunc_.get(), lyxrc.lyxpipes));
\r
87 lyx_socket_.reset(new LyXServerSocket(lyxfunc_.get(),
\r
88 lyx::support::os::internal_path(package().temp_dir() + "/lyxsocket")));
\r
90 // FIXME: these two lines should disappear soon (Abdel 20/09/71)
\r
91 lyxserver = lyx_server_.get();
\r
92 lyxsocket = lyx_socket_.get();
\r
94 // handle the batch commands the user asked for
\r
95 if (!batch.empty()) {
\r
96 lyxfunc_->dispatch(lyxaction.lookupFunc(batch));
\r
103 } // namespace frontend
\r