]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/dummy_impl.cpp
Fix #10778 (issue with CJK and language nesting)
[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 TexRow support (needed by docstream)
52 //
53
54
55 void TexRow::newline()
56 {}
57
58
59 void TexRow::newlines(int)
60 {}
61
62
63 //
64 // Dummy LyXRC support
65 //
66
67 LyXRC lyxrc;
68
69 /** Note that some variables are not initialized correctly. Hopefully
70  * they are not used in our code (currently valgrind does not complain).
71  * Linking against the full LyXRC.cpp forces us to pull too much
72  * stuff.
73  */
74 LyXRC::LyXRC()
75 {}
76
77
78 //
79 // Dummy translation support (needed at many places)
80 //
81
82
83 Messages messages_;
84 Messages const & getMessages(string const &)
85 {
86         return messages_;
87 }
88
89
90 Messages const & getGuiMessages()
91 {
92         return messages_;
93 }
94
95
96 //
97 // Dummy formats support (needed by Lexer)
98 //
99
100 Formats formats;
101
102 bool Formats::isZippedFile(support::FileName const&) const
103 {
104         return false;
105 }
106
107
108 //
109 // Dummy features support (needed by ModuleList)
110 //
111
112
113 bool LaTeXFeatures::isAvailable(string const &)
114 {
115         return true;
116 }
117
118
119 string alignmentToCSS(LyXAlignment)
120 {
121         return string();
122 }
123
124 //
125 // Dummy FontMetrics (needed by Length)
126 //
127
128 namespace frontend {
129 class FontMetrics {
130         int em() const { return 0; };
131 };
132 }
133
134 class FontInfo;
135
136 frontend::FontMetrics const & theFontMetrics(FontInfo const &) {
137         static frontend::FontMetrics dummy;
138         return dummy;
139 }
140
141 //
142 // Keep the linker happy on Windows
143 //
144
145 void lyx_exit(int)
146 {}
147
148 }