]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_gui.C
Add splash to WorkArea. Remove calls to old splash dialog.
[lyx.git] / src / lyx_gui.C
index 7623c808a58132d7380f58db3c0b677423d1455a..a9c516d8aa63b8e2832347cd4ff18661a5640b96 100644 (file)
@@ -4,23 +4,24 @@
  *           LyX, The Document Processor
  *      
  *         Copyright 1995 Matthias Ettrich
- *          Copyright 1995-2000 The LyX Team.
+ *          Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
 #include <config.h>
 #include <cstdlib>
+#include <fcntl.h>
 
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
-//#include <fcntl.h>
 #include "lyx_gui.h"
 #include FORMS_H_LOCATION
 #include "support/filetools.h"
-#include "lyx.h"
-#include "form1.h"
+#include "support/os.h"
+#include "support/lyxlib.h"
+#include "figure_form.h"
 #include "print_form.h"
 #include "tex-strings.h"
 #include "lyx_main.h"
@@ -28,6 +29,7 @@
 #include "version.h"
 #include "LyXView.h"
 #include "buffer.h"
+#include "BufferView.h"
 #include "lyxserver.h"
 #include "lyxrc.h"
 #include "gettext.h"
@@ -37,7 +39,6 @@
 #endif
 #include "bufferlist.h"
 #include "ColorHandler.h"
-#include "frontends/Dialogs.h"
 #include "frontends/GUIRunTime.h"
 #include "frontends/xforms/xforms_helpers.h" // for XformColor
 
@@ -49,7 +50,6 @@ FD_form_figure * fd_form_figure;
 extern LyXServer * lyxserver;
 extern bool finished;  // flag, that we are quitting the program
 extern BufferList bufferlist;
-extern GUIRunTime guiruntime;
 extern string user_lyxdir;
 
 FL_CMD_OPT cmdopt[] =
@@ -57,11 +57,15 @@ FL_CMD_OPT cmdopt[] =
        {"-geometry", "*.geometry", XrmoptionSepArg, "690x510"}
 };
 
-static int width  = 690;
-static int height = 510;
-static int xpos   = -1;
-static int ypos   = -1;
-static char geometry[40];
+namespace {
+
+int width  = 690;
+int height = 510;
+int xpos   = -1;
+int ypos   = -1;
+char geometry[40];
+
+} // namespace anon
 
 
 FL_resource res[] =
@@ -70,7 +74,9 @@ FL_resource res[] =
 };
 
 
-extern "C"
+extern "C" {
+       
+static
 int LyX_XErrHandler(Display * display, XErrorEvent * xeev)
 {
        // emergency save
@@ -85,6 +91,8 @@ int LyX_XErrHandler(Display * display, XErrorEvent * xeev)
        lyx::abort();
        return 0; // Solaris CC wants us to return something
 }
+       
+}
 
 
 LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
@@ -114,6 +122,7 @@ LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
        Display * display = fl_get_display();
        if (!display) {
                lyxerr << "LyX: unable to access X display, exiting" << endl;
+               os::warn("Unable to access X display, exiting");
                exit(1);
        }
        fcntl(ConnectionNumber(display), F_SETFD, FD_CLOEXEC);
@@ -262,7 +271,7 @@ void LyXGUI::init()
 void LyXGUI::create_forms()
 {
        lyxerr[Debug::INIT] << "Initializing LyXView..." << endl;
-       lyxViews = new LyXView(width, height);
+       lyxViews = GUIRunTime::createMainView(width, height);
        lyxerr[Debug::INIT] << "Initializing LyXView...done" << endl;
 
        // From here down should be done by somebody else. (Lgb)
@@ -297,9 +306,6 @@ void LyXGUI::create_forms()
        }
 
        lyxViews->show(main_placement, FL_FULLBORDER, "LyX");
-
-       if (lyxrc.show_banner)
-               lyxViews->getDialogs()->showSplash();
 }
 
 
@@ -307,7 +313,7 @@ void LyXGUI::runTime()
 {
        if (!gui) return;
 
-       guiruntime.runTime();
+       GUIRunTime::runTime();
 }