]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_gui.C
small changes to ButtonController usage
[lyx.git] / src / lyx_gui.C
index 55daaf72f6259fe8df2970060b9117f0e0d0161a..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;
 
@@ -90,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
@@ -409,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");
@@ -533,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
@@ -561,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;
-
-       // XForms specific
-       XEvent ev;
+       if (!gui) return;
 
-       while (!finished) {
-#ifdef KDEGUI
-               kapp->processEvents();
-#endif
-#ifdef GTKGUI
-               while(Gnome::Main::instance()->events_pending()) 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();
 }
 
 
@@ -591,6 +568,7 @@ void LyXGUI::regBuf(Buffer * b)
        lyxViews->view()->buffer(b);
 }
 
+
 LyXView * LyXGUI::getLyXView() const
 {
        return lyxViews;