]> git.lyx.org Git - lyx.git/blob - src/tests/dummy_functions.cpp
Fix 'make check'
[lyx.git] / src / tests / dummy_functions.cpp
1 #include <config.h>
2
3 #include "Format.h"
4 #include "LyXRC.h"
5
6 #include "support/Messages.h"
7
8 using namespace std;
9
10 namespace lyx {
11         // Dummy verbose support
12         bool verbose = false;
13
14         // Dummy LyXRC support
15         LyXRC::LyXRC() {}
16         LyXRC lyxrc;
17
18         // Dummy LyXAlignment support
19         enum LyXAlignment {
20                 DUMMY
21         };
22
23         // Keep the linker happy on Windows
24         void lyx_exit(int) {}
25
26         // Dummy language support
27         Messages const & getGuiMessages()
28         {
29                 static Messages lyx_messages;
30
31                 return lyx_messages;
32         }
33         Messages const & getMessages(string const &)
34         {
35                 static Messages lyx_messages;
36
37                 return lyx_messages;
38         }
39
40         // Dummy formats support (needed by Lexer)
41         Formats & theFormats()
42         {
43                 static Formats dummy_formats;
44                 return dummy_formats;
45         }
46
47         string alignmentToCSS(LyXAlignment)
48         {
49                 return string();
50         }
51
52         //
53         // Dummy FontMetrics (needed by Length)
54         //
55         namespace frontend {
56         class FontMetrics {
57                 int em() const { return 0; };
58         };
59         } // namespace frontend
60
61         class FontInfo;
62
63         frontend::FontMetrics const & theFontMetrics(FontInfo const &) {
64                 static frontend::FontMetrics dummy;
65                 return dummy;
66         }
67
68         struct App {
69                 bool cancel_export;
70         };
71
72         App app;
73         App * theApp() { return &app; }
74
75 } // namespace lyx