]> git.lyx.org Git - lyx.git/blob - src/frontends/lyx_gui.C
transfer lyx_gui::exit() to frontends/lyx_gui.C
[lyx.git] / src / frontends / lyx_gui.C
1 /**
2  * \file frontends/lyx_gui.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  * \author Abdelrazak Younes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "lyx_gui.h"
15
16 #include "LyXView.h"
17 #include "Application.h"
18
19 #include "funcrequest.h"
20
21 using std::string;
22
23 lyx::frontend::Application * theApp;
24
25
26 namespace lyx_gui {
27
28 bool use_gui = true;
29
30 void parse_lyxrc()
31 {}
32
33
34 LyXView * create_view(unsigned int width, unsigned int height, int posx, int posy,
35           bool maximize)
36 {
37         return &theApp->createView(width, height, posx, posy, maximize);
38 }
39
40
41 int start(LyXView * view, string const & batch)
42 {
43         return theApp->start(batch);
44 }
45
46
47 void exit(int status)
48 {
49         theApp->exit(status);
50 }
51
52
53 FuncStatus getStatus(FuncRequest const & ev)
54 {
55         FuncStatus flag;
56         switch (ev.action) {
57         case LFUN_TOOLTIPS_TOGGLE:
58                 flag.unknown(true);
59                 break;
60         default:
61                 break;
62         }
63
64         return flag;
65 }
66
67
68 string const roman_font_name()
69 {
70         if (!use_gui)
71                 return "serif";
72
73         return theApp->romanFontName();
74 }
75
76
77 string const sans_font_name()
78 {
79         if (!use_gui)
80                 return "sans";
81
82         return theApp->sansFontName();
83 }
84
85
86 string const typewriter_font_name()
87 {
88         if (!use_gui)
89                 return "monospace";
90
91         return theApp->typewriterFontName();
92 }
93
94 }; // namespace lyx_gui