]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_gui.C
small changes to ButtonController usage
[lyx.git] / src / lyx_gui.C
index 1a731b82c87d5cbaebaa632264439d3f3d529d5a..c44f6a02e16a49fc20f426fb6c351f5d11d7e87f 100644 (file)
 #pragma implementation
 #endif
 
-#ifdef KDEGUI
-#    include <kapp.h>
-#endif
-
-#ifdef GTKGUI
-#    include <gnome--/main.h>
-#endif
-
 #include <fcntl.h>
 #include "lyx_gui.h"
 #include FORMS_H_LOCATION
@@ -47,6 +39,7 @@
 #include "bufferlist.h"
 #include "language.h"
 #include "ColorHandler.h"
+#include "frontends/GUIRunTime.h"
 
 using std::endl;
 
@@ -63,7 +56,6 @@ FD_form_preamble * fd_form_preamble;
 FD_form_table * fd_form_table;
 FD_form_sendto * fd_form_sendto;
 FD_form_figure * fd_form_figure;
-FD_form_screen * fd_form_screen;
 FD_LaTeXLog * fd_latex_log; // from log_form.h
 Combox * combo_language;
 Combox * combo_language2;
@@ -91,7 +83,8 @@ FL_resource res[] =
 };
 
 
-extern "C" int LyX_XErrHandler(Display * display, XErrorEvent * xeev)
+extern "C"
+int LyX_XErrHandler(Display * display, XErrorEvent * xeev)
 {
 //#warning Please see if you can trigger this!
        // emergency save
@@ -410,7 +403,7 @@ void LyXGUI::create_forms()
                combo_language->addto((*cit).second.lang().c_str());
                combo_language2->addto((*cit).second.lang().c_str());
        }
-       combo_language2->select_text("No change");
+       combo_language2->select_text(_("No change"));
 
        // not really necessary, but we can do it anyway.
        fl_addto_choice(fd_form_document->choice_fontsize, "default|10|11|12");
@@ -525,11 +518,6 @@ void LyXGUI::create_forms()
                            CancelCloseBoxCB, 0);
        fl_set_button(fd_form_figure->radio_postscript, 1);
 
-       // the screen form
-       fd_form_screen = create_form_form_screen();
-       fl_set_form_atclose(fd_form_screen->form_screen,
-                           CancelCloseBoxCB, 0);
-
        // the latex log form
        fd_latex_log = create_form_LaTeXLog();
        fl_set_form_atclose(fd_latex_log->LaTeXLog,
@@ -539,7 +527,7 @@ void LyXGUI::create_forms()
        int main_placement = FL_PLACE_CENTER | FL_FREE_SIZE;
        int title_placement = FL_PLACE_CENTER;
        // Did we get a valid position?
-       if (xpos>= 0 && ypos>= 0) {
+       if (xpos >= 0 && ypos >= 0) {
                lyxViews->setPosition(xpos, ypos);
                if (lyxrc.show_banner) {
                        // show the title form in the middle of the main form
@@ -567,28 +555,11 @@ void LyXGUI::create_forms()
 
 
 void LyXGUI::runTime()
-       /* This will usually be toolkit (GUI) specific. This is
-        * also usually the XEvent dispatcher of the GUI. */
 {
-       if (!gui)
-               return;
+       if (!gui) return;
 
-       // XForms specific
-       XEvent ev;
-
-       while (!finished) {
-#ifdef KDEGUI
-               kapp->processEvents();
-#endif
-#ifdef GTKGUI
-               Gnome::Main::instance()->iteration(FALSE);
-#endif
-               
-               if (fl_check_forms() == FL_EVENT) {
-                       lyxerr << "LyX: This shouldn't happen..." << endl;
-                       fl_XNextEvent(&ev);
-               }
-       }
+       GUIRunTime grt;
+       grt.runTime();
 }
 
 
@@ -597,6 +568,7 @@ void LyXGUI::regBuf(Buffer * b)
        lyxViews->view()->buffer(b);
 }
 
+
 LyXView * LyXGUI::getLyXView() const
 {
        return lyxViews;