]> git.lyx.org Git - lyx.git/blob - src/ColorCode.h
revert erroneous previous commit.
[lyx.git] / src / ColorCode.h
1 // -*- C++ -*-
2 /**
3  * \file ColorCode.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * Full author contact details are available in file CREDITS.
8  */
9
10 #ifndef COLOR_CODE_H
11 #define COLOR_CODE_H
12
13 namespace lyx {
14
15 /// Names of colors, including all logical colors
16 enum ColorCode
17 {
18         /// No particular color---clear or default
19         Color_none,
20         /// The different text colors
21         Color_black,
22         ///
23         Color_white,
24         ///
25         Color_red,
26         ///
27         Color_green,
28         ///
29         Color_blue,
30         ///
31         Color_cyan,
32         ///
33         Color_magenta,
34         ///
35         Color_yellow,
36
37         // Needed interface colors
38
39         /// Cursor color
40         Color_cursor,
41         /// Background color
42         Color_background,
43         /// Foreground color
44         Color_foreground,
45         /// Background color of selected text
46         Color_selection,
47         /// Foreground color of selected text
48         Color_selectiontext,
49         /// Text color in LaTeX mode
50         Color_latex,
51         /// The color used for previews
52         Color_preview,
53         /// Inline completion color
54         Color_inlinecompletion,
55         /// Inline completion color for the non-unique part
56         Color_nonunique_inlinecompletion,
57
58         /// Label color for notes
59         Color_notelabel,
60         /// Background color of notes
61         Color_notebg,
62         /// Label color for comments
63         Color_commentlabel,
64         /// Background color of comments
65         Color_commentbg,
66         /// Label color for greyedout insets
67         Color_greyedoutlabel,
68         /// Background color of greyedout inset
69         Color_greyedoutbg,
70         /// Background color of shaded box
71         Color_shadedbg,
72         /// Background color of listings inset
73         Color_listingsbg,
74
75         /// Label color for branches
76         Color_branchlabel,
77         /// Label color for footnotes
78         Color_footlabel,
79         /// Label color for index insets
80         Color_indexlabel,
81         /// Label color for margin notes
82         Color_marginlabel,
83         /// Label color for URL insets
84         Color_urllabel,
85
86         /// Color for URL inset text
87         Color_urltext,
88
89         /// Color for the depth bars in the margin
90         Color_depthbar,
91         /// Color for marking foreign language words
92         Color_language,
93
94         /// Text color for command insets
95         Color_command,
96         /// Background color for command insets
97         Color_commandbg,
98         /// Frame color for command insets
99         Color_commandframe,
100
101         /// Special chars text color
102         Color_special,
103
104         /// Graphics inset background color
105         Color_graphicsbg,
106         /// Math inset text color
107         Color_math,
108         /// Math inset background color
109         Color_mathbg,
110         /// Macro math inset background color
111         Color_mathmacrobg,
112         /// Macro math inset background color hovered
113         Color_mathmacrohoverbg,
114         /// Macro math label color
115         Color_mathmacrolabel,
116         /// Macro math frame color
117         Color_mathmacroframe,
118         /// Macro math blended color 
119         Color_mathmacroblend,
120         /// Macro template color for old parameters 
121         Color_mathmacrooldarg,
122         /// Macro template color for new parameters 
123         Color_mathmacronewarg,
124         /// Math inset frame color under focus
125         Color_mathframe,
126         /// Math inset frame color not under focus
127         Color_mathcorners,
128         /// Math line color
129         Color_mathline,
130
131         /// caption frame color
132         Color_captionframe,
133
134         /// collapsable insets text
135         Color_collapsable,
136         /// collapsable insets frame
137         Color_collapsableframe,
138
139         /// Inset marker background color
140         Color_insetbg,
141         /// Inset marker frame color
142         Color_insetframe,
143
144         /// Error box text color
145         Color_error,
146         /// EOL marker color
147         Color_eolmarker,
148         /// Added space colour
149         Color_added_space,
150         /// Appendix marker color
151         Color_appendix,
152         /// changebar color
153         Color_changebar,
154         /// deleted text color
155         Color_deletedtext,
156         /// added text color
157         Color_addedtext,
158         /// changed text color author 1
159         Color_changedtextauthor1,
160         /// changed text color author 2
161         Color_changedtextauthor2,
162         /// changed text color author 3
163         Color_changedtextauthor3,
164         /// changed text color author 4
165         Color_changedtextauthor4,
166         /// changed text color author 5
167         Color_changedtextauthor5,
168         /// Top and bottom line color
169         Color_topline,
170         /// Table line color
171         Color_tabularline,
172         /// Table line color
173         Color_tabularonoffline,
174         /// Bottom area color
175         Color_bottomarea,
176         /// New page color
177         Color_newpage,
178         /// Page break color
179         Color_pagebreak,
180
181         // FIXME: why are the next four separate ??
182         /// Color used for button frame
183         Color_buttonframe,
184         /// Color used for bottom background
185         Color_buttonbg,
186         /// Color used for buttom under focus
187         Color_buttonhoverbg,
188
189         // Logical attributes
190
191         /// Color is inherited
192         Color_inherit,
193         /// For ignoring updates of a color
194         Color_ignore
195 };
196
197
198 struct RGBColor {
199         unsigned int r;
200         unsigned int g;
201         unsigned int b;
202         RGBColor() : r(0), g(0), b(0) {}
203         RGBColor(unsigned int red, unsigned int green, unsigned int blue)
204                 : r(red), g(green), b(blue) {}
205 };
206
207 inline bool operator==(RGBColor const & c1, RGBColor const & c2)
208 {
209         return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
210 }
211
212
213 inline bool operator!=(RGBColor const & c1, RGBColor const & c2)
214 {
215         return !(c1 == c2);
216 }
217
218 } // namespace lyx
219
220 #endif