]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/dummy_impl.cpp
b20db6d9d6daad8053f80d04dfbbdaaa584041aa
[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
25 #include "support/Messages.h"
26
27 #include <iostream>
28
29 using namespace std;
30
31 namespace lyx {
32
33 //
34 // Dummy Alert support (needed by TextClass)
35 //
36
37
38 namespace frontend {
39 namespace Alert {
40         void warning(docstring const & title, docstring const & message,
41                                  bool const &)
42         {
43                 cerr << to_utf8(title) << "\n" << to_utf8(message) << endl;
44         }
45 }
46 }
47
48
49 //
50 // Dummy TexRow support (needed by docstream)
51 //
52
53
54 void TexRow::newline()
55 {}
56
57
58 void TexRow::newlines(int)
59 {}
60
61
62 //
63 // Dummy LyXRC support
64 //
65
66 LyXRC lyxrc;
67
68 /** Note that some variables are not initialized correctly. Hopefully
69  * they are not used in our code (currently valgrind does not complain).
70  * Linking against the full LyXRC.cpp forces us to pull too much
71  * stuff.
72  */
73 LyXRC::LyXRC()
74 {}
75
76
77 //
78 // Dummy translation support (needed at many places)
79 //
80
81
82 Messages messages_;
83 Messages const & getMessages(string const &)
84 {
85         return messages_;
86 }
87
88
89 Messages const & getGuiMessages()
90 {
91         return messages_;
92 }
93
94
95 //
96 // Dummy formats support (needed by Lexer)
97 //
98
99 Formats formats;
100
101 bool Formats::isZippedFile(support::FileName const&) const
102 {
103         return false;
104 }
105
106
107 //
108 // Dummy features support (needed by ModuleList)
109 //
110
111
112 bool LaTeXFeatures::isAvailable(string const &)
113 {
114         return true;
115 }
116
117
118 //
119 // Keep the linker happy on Windows
120 //
121
122 void lyx_exit(int)
123 {}
124
125 }