2001-02-12 14:09:09 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file GUIRunTime.C
|
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
|
* Read the file COPYING
|
2000-08-16 15:27:11 +00:00
|
|
|
|
*
|
2001-02-12 14:09:09 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
*/
|
2000-08-16 15:27:11 +00:00
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
|
#pragma implementation
|
|
|
|
|
#endif
|
|
|
|
|
|
2000-08-22 18:28:11 +00:00
|
|
|
|
#include "GUIRunTime.h"
|
2000-08-17 15:20:30 +00:00
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
2000-08-16 15:27:11 +00:00
|
|
|
|
#include <kapp.h>
|
|
|
|
|
|
2000-08-17 15:20:30 +00:00
|
|
|
|
#include FORMS_H_LOCATION
|
|
|
|
|
|
2000-08-16 15:27:11 +00:00
|
|
|
|
using std::endl;
|
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
|
// tell me again why this test is cluttering up the source rather than
|
|
|
|
|
// being in lyxinclude.m4 ? - jbl
|
2000-09-11 15:30:21 +00:00
|
|
|
|
#if !defined(FL_REVISION) || FL_REVISION < 88 || FL_VERSION != 0
|
|
|
|
|
#error LyX will not compile with this version of XForms.\
|
|
|
|
|
Please get version 0.89.\
|
|
|
|
|
If you want to try to compile anyway, delete this test in src/frontends/kde/GUIRunTime.C.
|
|
|
|
|
#endif
|
|
|
|
|
|
2000-08-16 23:48:48 +00:00
|
|
|
|
extern bool finished;
|
2000-08-16 15:27:11 +00:00
|
|
|
|
|
2000-09-11 15:30:21 +00:00
|
|
|
|
static int const xforms_include_version = FL_INCLUDE_VERSION;
|
|
|
|
|
|
|
|
|
|
int GUIRunTime::initApplication(int argc, char * argv[])
|
|
|
|
|
{
|
2001-02-12 14:09:09 +00:00
|
|
|
|
// same here, this is clearly a configure-time test - jbl
|
2000-09-11 15:30:21 +00:00
|
|
|
|
int xforms_lib_version = fl_library_version(0, 0);
|
|
|
|
|
if (xforms_include_version != xforms_lib_version) {
|
2000-09-15 10:24:15 +00:00
|
|
|
|
lyxerr << "You are either running LyX with wrong "
|
2000-09-11 15:30:21 +00:00
|
|
|
|
"version of a dynamic XForms library\n"
|
|
|
|
|
"or you have build LyX with conflicting header "
|
|
|
|
|
"and library (different\n"
|
|
|
|
|
"versions of XForms. Sorry but there is no point "
|
|
|
|
|
"in continuing executing LyX!" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-19 11:18:35 +00:00
|
|
|
|
// I belive this is done in the wrong place, imo this should
|
|
|
|
|
// be done in lyx_gui.C similar to how/where xforms does it (Lgb)
|
2000-09-11 15:30:21 +00:00
|
|
|
|
static KApplication a(argc, argv);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2000-08-16 15:27:11 +00:00
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
|
|
2000-08-22 18:28:11 +00:00
|
|
|
|
void GUIRunTime::processEvents()
|
2000-08-16 15:27:11 +00:00
|
|
|
|
{
|
2000-08-22 18:28:11 +00:00
|
|
|
|
kapp->processEvents();
|
2000-08-16 15:27:11 +00:00
|
|
|
|
}
|
2000-08-16 23:48:48 +00:00
|
|
|
|
|
|
|
|
|
|
2000-08-22 18:28:11 +00:00
|
|
|
|
void GUIRunTime::runTime()
|
2000-08-16 23:48:48 +00:00
|
|
|
|
{
|
2000-08-22 18:28:11 +00:00
|
|
|
|
// We still use xforms event handler as the main one...
|
2000-08-16 23:48:48 +00:00
|
|
|
|
XEvent ev;
|
|
|
|
|
while (!finished) {
|
2000-08-22 18:28:11 +00:00
|
|
|
|
processEvents();
|
2000-08-16 23:48:48 +00:00
|
|
|
|
if (fl_check_forms() == FL_EVENT) {
|
|
|
|
|
lyxerr << "LyX: This shouldn't happen..." << endl;
|
|
|
|
|
fl_XNextEvent(&ev);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-09-18 19:41:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GUIRunTime::setDefaults()
|
|
|
|
|
{
|
|
|
|
|
FL_IOPT cntl;
|
|
|
|
|
cntl.buttonFontSize = FL_NORMAL_SIZE;
|
|
|
|
|
cntl.browserFontSize = FL_NORMAL_SIZE;
|
|
|
|
|
cntl.labelFontSize = FL_NORMAL_SIZE;
|
|
|
|
|
cntl.choiceFontSize = FL_NORMAL_SIZE;
|
|
|
|
|
cntl.inputFontSize = FL_NORMAL_SIZE;
|
|
|
|
|
cntl.menuFontSize = FL_NORMAL_SIZE;
|
|
|
|
|
cntl.borderWidth = -1;
|
|
|
|
|
cntl.vclass = FL_DefaultVisual;
|
|
|
|
|
fl_set_defaults(FL_PDVisual
|
|
|
|
|
| FL_PDButtonFontSize
|
|
|
|
|
| FL_PDBrowserFontSize
|
|
|
|
|
| FL_PDLabelFontSize
|
|
|
|
|
| FL_PDChoiceFontSize
|
|
|
|
|
| FL_PDInputFontSize
|
|
|
|
|
| FL_PDMenuFontSize
|
|
|
|
|
| FL_PDBorderWidth, &cntl);
|
|
|
|
|
}
|