3 * Copyright 2002 the LyX Team
4 * Read the file COPYING
7 * \author John Levon <moz@compsoc.man.ac.uk>
14 #include "support/lyxlib.h"
15 #include "support/os.h"
16 #include "support/filetools.h"
24 // FIXME: move this stuff out again
25 #include "bufferlist.h"
27 #include "lyxserver.h"
28 #include "BufferView.h"
33 #include <boost/bind.hpp>
35 #include <qapplication.h>
37 #ifndef CXX_GLOBAL_CSTD
46 extern BufferList bufferlist;
48 // FIXME: wrong place !
49 LyXServer * lyxserver;
51 void lyx_gui::parse_init(int & argc, char * argv[])
53 static QApplication a(argc, argv);
57 void lyx_gui::parse_lyxrc()
64 void lyx_gui::start(string const & batch, vector<string> files)
69 unsigned int width = 690;
70 unsigned int height = 510;
72 QtView view(width, height);
73 view.show(xpos, ypos, "LyX");
78 // FIXME: some code below needs moving
80 lyxserver = new LyXServer(view.getLyXFunc(), lyxrc.lyxpipes);
82 vector<string>::const_iterator cit = files.begin();
83 vector<string>::const_iterator end = files.end();
84 for (; cit != end; ++cit) {
85 Buffer * b = bufferlist.loadLyXFile(*cit);
91 // switch to the last buffer successfully loaded
93 view.view()->buffer(last);
96 // handle the batch commands the user asked for
98 view.getLyXFunc()->verboseDispatch(batch, false);
102 qApp->processEvents();
110 void lyx_gui::init_graphics()
116 string const lyx_gui::hexname(LColor::color col)