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