]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsTypes.C
0b49ed415508d75175bbb53a8fd2d05a7e1cebcc
[lyx.git] / src / graphics / GraphicsTypes.C
1 // -*- C++ -*-
2 /**
3  *  \file GraphicsTypes.C
4  *  Copyright 2002 the LyX Team
5  *  Read the file COPYING
6  */
7
8 #include "graphics/GraphicsTypes.h"
9
10 namespace grfx {
11
12 /// The translator between the Display enum and corresponding lyx string.
13 Translator< DisplayType, string > displayTranslator(DefaultDisplay, "default");
14
15 void setDisplayTranslator()
16 {
17         /// This variable keeps a tab on whether the translator is set.
18         static bool done = false;
19
20         if (!done) {
21                 done = true;
22
23                 // Fill the display translator
24                 displayTranslator.addPair(DefaultDisplay, "default");
25                 displayTranslator.addPair(MonochromeDisplay, "monochrome");
26                 displayTranslator.addPair(GrayscaleDisplay, "grayscale");
27                 displayTranslator.addPair(ColorDisplay, "color");
28                 displayTranslator.addPair(NoDisplay, "none");
29                 
30                 // backward compatibility for old lyxrc.display_graphics
31                 displayTranslator.addPair(MonochromeDisplay, "mono");
32                 displayTranslator.addPair(GrayscaleDisplay, "gray");
33                 displayTranslator.addPair(NoDisplay, "no");
34         }
35 }
36
37 } // namespace grfx