2 * \file frontend/Application.C
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 "Application.h"
15 #include "funcrequest.h"
16 #include "LyXAction.h"
20 #include "support/lstrings.h"
21 #include "support/os.h"
22 #include "support/package.h"
24 #include <boost/scoped_ptr.hpp>
26 using lyx::support::package;
32 Application::Application(int &, char **)
37 LyXFunc & Application::lyxFunc()
39 return *lyxfunc_.get();
43 LyXFunc const & Application::lyxFunc() const
45 return *lyxfunc_.get();
49 LyXServer & Application::server()
51 return *lyx_server_.get();
55 LyXServer const & Application::server() const
57 return *lyx_server_.get();
61 LyXServerSocket & Application::socket()
63 return *lyx_socket_.get();
67 LyXServerSocket const & Application::socket() const
69 return *lyx_socket_.get();
73 void Application::setBufferView(BufferView * buffer_view)
75 buffer_view_ = buffer_view;
79 int Application::start(std::string const & batch)
81 lyx_server_.reset(new LyXServer(lyxfunc_.get(), lyxrc.lyxpipes));
82 lyx_socket_.reset(new LyXServerSocket(lyxfunc_.get(),
83 lyx::support::os::internal_path(package().temp_dir() + "/lyxsocket")));
85 // handle the batch commands the user asked for
87 lyxfunc_->dispatch(lyxaction.lookupFunc(batch));
94 } // namespace frontend