]> git.lyx.org Git - features.git/blobdiff - src/frontends/xforms/lyx_gui.C
Replace LString.h with support/std_string.h,
[features.git] / src / frontends / xforms / lyx_gui.C
index d21f90250a29c073ab8953cd5d570b1f9a9a51b0..9500ef95cc3bfcc473d37c248207568f28320a62 100644 (file)
@@ -3,57 +3,59 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author unknown
+ * \author Lars Gullik Bjønnes
  * \author John Levon
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
 #include "lyx_gui.h"
+#include "ColorHandler.h"
+#include "xfont_loader.h"
+#include "xforms_helpers.h"
+#include "xformsImage.h"
+#include "XFormsView.h"
 
-#include "support/lyxlib.h"
-#include "support/os.h"
-#include "support/filetools.h"
-
+#include "bufferlist.h"
+#include "BufferView.h"
 #include "debug.h"
 #include "gettext.h"
-
 #include "lyx_main.h"
+#include "lyxfunc.h"
 #include "lyxrc.h"
-#include "lyxfont.h"
+#include "lyxserver.h"
+
 #include "graphics/LoaderQueue.h"
 
-// FIXME: move this stuff out again
-#include "bufferlist.h"
-#include "lyxfunc.h"
-#include "lyxserver.h"
-#include "BufferView.h"
-#include "XFormsView.h"
+#include "support/lyxlib.h"
+#include "support/os.h"
+#include "support/filetools.h"
+#include "support/path_defines.h"
 
-#include FORMS_H_LOCATION
-#include "ColorHandler.h"
-#include "xforms_helpers.h"
-#include "xfont_loader.h"
-#include "xformsImage.h"
+#include "lyx_forms.h"
+
+#include <boost/bind.hpp>
 
-#include "Lsstream.h"
+#include "support/std_sstream.h"
 #include <iomanip>
 #include <fcntl.h>
-#include <boost/bind.hpp>
+
+using namespace lyx::support;
 
 #ifndef CXX_GLOBAL_CSTD
 using std::exit;
 #endif
 
-using std::vector;
-using std::hex;
 using std::dec;
 using std::endl;
+using std::hex;
 using std::setbase;
 using std::setfill;
 using std::setw;
+using std::vector;
+
 
 extern BufferList bufferlist;
 
@@ -116,7 +118,7 @@ int LyX_XErrHandler(Display * display, XErrorEvent * xeev) {
        XGetErrorText(display, xeev->error_code, etxt, 512);
        lyxerr << etxt << " id: " << xeev->resourceid << endl;
        // By doing an abort we get a nice backtrace. (hopefully)
-       lyx::abort();
+       lyx::support::abort();
        return 0;
 }
 
@@ -169,7 +171,7 @@ void parse_init(int & argc, char * argv[])
 
        lyxColorHandler.reset(new LyXColorHandler());
 
-       using namespace grfx;
+       using namespace lyx::graphics;
 
        // connect the image loader based on the xforms library
        Image::newImage = boost::bind(&xformsImage::newImage);
@@ -184,7 +186,7 @@ void parse_init(int & argc, char * argv[])
 
 void parse_lyxrc()
 {
-       XformsColor::read(AddName(user_lyxdir, "preferences.xform"));
+       XformsColor::read(AddName(user_lyxdir(), "preferences.xform"));
 
        if (lyxrc.popup_font_encoding.empty())
                lyxrc.popup_font_encoding = lyxrc.font_norm;
@@ -276,30 +278,18 @@ void start(string const & batch, vector<string> const & files)
        view.show(xpos, ypos, "LyX");
        view.init();
 
-       Buffer * last = 0;
-
        // FIXME: some code below needs moving
 
        lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes);
 
        vector<string>::const_iterator cit = files.begin();
        vector<string>::const_iterator end = files.end();
-       for (; cit != end; ++cit) {
-               Buffer * b = bufferlist.loadLyXFile(*cit);
-               if (b) {
-                       last = b;
-               }
-       }
-
-       // switch to the last buffer successfully loaded
-       if (last) {
-               view.view()->buffer(last);
-       }
+       for (; cit != end; ++cit)
+               view.view()->loadLyXFile(*cit, true);
 
        // handle the batch commands the user asked for
-       if (!batch.empty()) {
+       if (!batch.empty())
                view.getLyXFunc().dispatch(batch);
-       }
 
        // enter the event loop
        while (!finished) {
@@ -325,6 +315,12 @@ void exit()
 }
 
 
+void sync_events()
+{
+       // FIXME
+}
+
+
 FuncStatus getStatus(FuncRequest const & /*ev*/)
 {
        // Nothing interesting to do here