]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/GUIRunTime.C
try this for distinguishing inner and outer tabs
[lyx.git] / src / frontends / kde / GUIRunTime.C
1 /**
2  * \file GUIRunTime.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author Jürgen Vigna
7  */
8
9 #include <config.h>
10
11 #ifdef __GNUG__
12 #pragma implementation
13 #endif
14
15 #include "GUIRunTime.h"
16 #include "debug.h"
17
18 #include <kapp.h>
19
20 #include FORMS_H_LOCATION
21
22 using std::endl;
23
24 // tell me again why this test is cluttering up the source rather than
25 // being in lyxinclude.m4 ? - jbl
26 #if !defined(FL_REVISION) || FL_REVISION < 88 || FL_VERSION != 0
27 #error LyX will not compile with this version of XForms.\
28        Please get version 0.89.\
29        If you want to try to compile anyway, delete this test in src/frontends/kde/GUIRunTime.C.
30 #endif
31
32 extern bool finished;
33
34 static int const xforms_include_version = FL_INCLUDE_VERSION;
35
36 int GUIRunTime::initApplication(int argc, char * argv[])
37 {
38         // same here, this is clearly a configure-time test - jbl
39         int xforms_lib_version = fl_library_version(0, 0);
40         if (xforms_include_version != xforms_lib_version) {
41                 lyxerr << "You are either running LyX with wrong "
42                         "version of a dynamic XForms library\n"
43                         "or you have build LyX with conflicting header "
44                         "and library (different\n"
45                         "versions of XForms. Sorry but there is no point "
46                         "in continuing executing LyX!" << endl;
47                 return 1;
48         }
49
50         // I belive this is done in the wrong place, imo this should
51         // be done in lyx_gui.C similar to how/where xforms does it (Lgb)
52         static KApplication a(argc, argv);
53
54         return 0;
55 }
56
57
58 void GUIRunTime::processEvents() 
59 {
60         kapp->processEvents();
61 }
62
63
64 void GUIRunTime::runTime()
65 {
66         // We still use xforms event handler as the main one...
67         XEvent ev;
68         while (!finished) {
69                 processEvents();
70                 if (fl_check_forms() == FL_EVENT) {
71                         lyxerr << "LyX: This shouldn't happen..." << endl;
72                         fl_XNextEvent(&ev);
73                 }
74         }
75 }
76
77
78 void GUIRunTime::setDefaults() 
79 {
80         FL_IOPT cntl;
81         cntl.buttonFontSize = FL_NORMAL_SIZE;
82         cntl.browserFontSize = FL_NORMAL_SIZE;
83         cntl.labelFontSize = FL_NORMAL_SIZE;
84         cntl.choiceFontSize = FL_NORMAL_SIZE;
85         cntl.inputFontSize = FL_NORMAL_SIZE;
86         cntl.menuFontSize  = FL_NORMAL_SIZE;
87         cntl.borderWidth = -1;
88         cntl.vclass = FL_DefaultVisual;
89         fl_set_defaults(FL_PDVisual
90                         | FL_PDButtonFontSize
91                         | FL_PDBrowserFontSize
92                         | FL_PDLabelFontSize
93                         | FL_PDChoiceFontSize
94                         | FL_PDInputFontSize
95                         | FL_PDMenuFontSize
96                         | FL_PDBorderWidth, &cntl);
97 }