]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsTypes.C
displayTranslator is now a function. No need to invoke setDisplayTranslator
[lyx.git] / src / graphics / GraphicsTypes.C
1 /**
2  * \file GraphicsTypes.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Rob Lahaye
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "graphics/GraphicsTypes.h"
14
15 using std::string;
16
17
18 namespace lyx {
19 namespace graphics {
20
21 namespace {
22
23 /// The translator between the Display enum and corresponding lyx string.
24 Translator<DisplayType, string> const initTranslator()
25 {
26         Translator<DisplayType, string> translator(DefaultDisplay, "default");
27
28         // Fill the display translator
29         translator.addPair(MonochromeDisplay, "monochrome");
30         translator.addPair(GrayscaleDisplay, "grayscale");
31         translator.addPair(ColorDisplay, "color");
32         translator.addPair(NoDisplay, "none");
33
34         return translator;
35 }
36
37 } // namespace anon
38
39 Translator<DisplayType, string> const & displayTranslator() 
40 {
41         static Translator<DisplayType, string> const translator =
42                 initTranslator();
43         return translator;
44 }
45
46 } // namespace graphics
47 } // namespace lyx