]> git.lyx.org Git - lyx.git/blob - src/frontends/lyx_gui.C
9dd95c0e8d66e7abe48c915d3aa600f208a23783
[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 FuncStatus getStatus(FuncRequest const & ev)
48 {
49         FuncStatus flag;
50         switch (ev.action) {
51         case LFUN_TOOLTIPS_TOGGLE:
52                 flag.unknown(true);
53                 break;
54         default:
55                 break;
56         }
57
58         return flag;
59 }
60
61
62 string const roman_font_name()
63 {
64         if (!use_gui)
65                 return "serif";
66
67         return theApp->romanFontName();
68 }
69
70
71 string const sans_font_name()
72 {
73         if (!use_gui)
74                 return "sans";
75
76         return theApp->sansFontName();
77 }
78
79
80 string const typewriter_font_name()
81 {
82         if (!use_gui)
83                 return "monospace";
84
85         return theApp->typewriterFontName();
86 }
87
88 }; // namespace lyx_gui