]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/dummy_impl.cpp
Update tex2lyx tests
[lyx.git] / src / tex2lyx / dummy_impl.cpp
1 /**
2  * \file dummy_impl.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Jean-Marc Lasgouttes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 /**
12  * This file contains dummy implementation of some methods that are
13  * needed byclasses used by tex2lyx. This allows to reduce the number
14  * of classes we have to link against.
15 */
16
17 // {[(
18
19 #include <config.h>
20
21 #include "Format.h"
22 #include "LaTeXFeatures.h"
23 #include "LyXRC.h"
24 #include "output_xhtml.h"
25
26 #include "support/Messages.h"
27
28 #include <iostream>
29
30 using namespace std;
31
32 namespace lyx {
33
34 //
35 // Dummy Alert support (needed by TextClass)
36 //
37
38
39 namespace frontend {
40 namespace Alert {
41         void warning(docstring const & title, docstring const & message,
42                                  bool const &)
43         {
44                 cerr << to_utf8(title) << "\n" << to_utf8(message) << endl;
45         }
46 }
47 }
48
49
50 //
51 // Dummy verbose support
52 //
53
54 bool verbose = false;
55
56
57 //
58 // Dummy LyXRC support
59 //
60
61 LyXRC lyxrc;
62
63 /** Note that some variables are not initialized correctly. Hopefully
64  * they are not used in our code (currently valgrind does not complain).
65  * Linking against the full LyXRC.cpp forces us to pull too much
66  * stuff.
67  */
68 LyXRC::LyXRC()
69 {}
70
71
72 //
73 // Dummy translation support (needed at many places)
74 //
75
76
77 Messages messages_;
78 Messages const & getMessages(string const &)
79 {
80         return messages_;
81 }
82
83
84 Messages const & getGuiMessages()
85 {
86         return messages_;
87 }
88
89
90 //
91 // Dummy formats support (needed by Lexer)
92 //
93
94 Formats formats;
95
96 bool Formats::isZippedFile(support::FileName const&) const
97 {
98         return false;
99 }
100
101
102 //
103 // Dummy features support (needed by ModuleList)
104 //
105
106
107 bool LaTeXFeatures::isAvailable(string const &)
108 {
109         return true;
110 }
111
112
113 string alignmentToCSS(LyXAlignment)
114 {
115         return string();
116 }
117
118 //
119 // Dummy FontMetrics (needed by Length)
120 //
121
122 namespace frontend {
123 class FontMetrics {
124         int em() const { return 0; };
125 };
126 }
127
128 class FontInfo;
129
130 frontend::FontMetrics const & theFontMetrics(FontInfo const &) {
131         static frontend::FontMetrics dummy;
132         return dummy;
133 }
134
135 //
136 // Keep the linker happy on Windows
137 //
138
139 void lyx_exit(int)
140 {}
141
142 }