]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsTypes.C
move reading of bind files from lyxrc.C to kbmap.C; do not read bindings or menus...
[lyx.git] / src / graphics / GraphicsTypes.C
1 // -*- C++ -*-
2 /**
3  *  \file GraphicsTypes.C
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  *  \author Rob Lahaye
8  *
9  * Full author contact details available in file CREDITS
10  */
11
12 #include <config.h>
13
14 #include "graphics/GraphicsTypes.h"
15 #include "support/translator.h"
16
17 namespace lyx {
18 namespace graphics {
19
20 /// The translator between the Display enum and corresponding lyx string.
21 Translator<DisplayType, string> displayTranslator(DefaultDisplay, "default");
22
23 void setDisplayTranslator()
24 {
25         /// This variable keeps a tab on whether the translator is set.
26         static bool done = false;
27
28         if (!done) {
29                 done = true;
30
31                 // Fill the display translator
32                 displayTranslator.addPair(DefaultDisplay, "default");
33                 displayTranslator.addPair(MonochromeDisplay, "monochrome");
34                 displayTranslator.addPair(GrayscaleDisplay, "grayscale");
35                 displayTranslator.addPair(ColorDisplay, "color");
36                 displayTranslator.addPair(NoDisplay, "none");
37
38                 // backward compatibility for old lyxrc.display_graphics
39                 displayTranslator.addPair(MonochromeDisplay, "mono");
40                 displayTranslator.addPair(GrayscaleDisplay, "gray");
41                 displayTranslator.addPair(NoDisplay, "no");
42         }
43 }
44
45 } // namespace graphics
46 } // namespace lyx