]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsTypes.C
If the graphics loader has a copy c-tor it should have copy assignment that does...
[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
16
17 namespace grfx {
18
19 /// The translator between the Display enum and corresponding lyx string.
20 Translator<DisplayType, string> displayTranslator(DefaultDisplay, "default");
21
22 void setDisplayTranslator()
23 {
24         /// This variable keeps a tab on whether the translator is set.
25         static bool done = false;
26
27         if (!done) {
28                 done = true;
29
30                 // Fill the display translator
31                 displayTranslator.addPair(DefaultDisplay, "default");
32                 displayTranslator.addPair(MonochromeDisplay, "monochrome");
33                 displayTranslator.addPair(GrayscaleDisplay, "grayscale");
34                 displayTranslator.addPair(ColorDisplay, "color");
35                 displayTranslator.addPair(NoDisplay, "none");
36
37                 // backward compatibility for old lyxrc.display_graphics
38                 displayTranslator.addPair(MonochromeDisplay, "mono");
39                 displayTranslator.addPair(GrayscaleDisplay, "gray");
40                 displayTranslator.addPair(NoDisplay, "no");
41         }
42 }
43
44 } // namespace grfx