]> git.lyx.org Git - lyx.git/blob - src/ColorCode.h
HTML for stackrel.
[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         /// Color for greyedout inset text
69         Color_greyedouttext,
70         /// Background color of greyedout inset
71         Color_greyedoutbg,
72         /// Background color of shaded box
73         Color_shadedbg,
74         /// Background color of listings inset
75         Color_listingsbg,
76
77         /// Label color for branches
78         Color_branchlabel,
79         /// Label color for footnotes
80         Color_footlabel,
81         /// Label color for index insets
82         Color_indexlabel,
83         /// Label color for margin notes
84         Color_marginlabel,
85         /// Text color for phantom insets
86         Color_phantomtext,
87         /// Label color for URL insets
88         Color_urllabel,
89
90         /// Color for URL inset text
91         Color_urltext,
92
93         /// Color for the depth bars in the margin
94         Color_depthbar,
95         /// Color for marking foreign language words
96         Color_language,
97
98         /// Text color for command insets
99         Color_command,
100         /// Background color for command insets
101         Color_commandbg,
102         /// Frame color for command insets
103         Color_commandframe,
104
105         /// Special chars text color
106         Color_special,
107
108         /// Graphics inset background color
109         Color_graphicsbg,
110         /// Math inset text color
111         Color_math,
112         /// Math inset background color
113         Color_mathbg,
114         /// Macro math inset background color
115         Color_mathmacrobg,
116         /// Macro math inset background color hovered
117         Color_mathmacrohoverbg,
118         /// Macro math label color
119         Color_mathmacrolabel,
120         /// Macro math frame color
121         Color_mathmacroframe,
122         /// Macro math blended color 
123         Color_mathmacroblend,
124         /// Macro template color for old parameters 
125         Color_mathmacrooldarg,
126         /// Macro template color for new parameters 
127         Color_mathmacronewarg,
128         /// Math inset frame color under focus
129         Color_mathframe,
130         /// Math inset frame color not under focus
131         Color_mathcorners,
132         /// Math line color
133         Color_mathline,
134
135         /// Caption frame color
136         Color_captionframe,
137
138         /// Collapsable insets text
139         Color_collapsable,
140         /// Collapsable insets frame
141         Color_collapsableframe,
142
143         /// Inset marker background color
144         Color_insetbg,
145         /// Inset marker frame color
146         Color_insetframe,
147
148         /// Error box text color
149         Color_error,
150         /// EOL marker color
151         Color_eolmarker,
152         /// Added space colour
153         Color_added_space,
154         /// Appendix marker color
155         Color_appendix,
156         /// Changebar color
157         Color_changebar,
158         /// Deleted text color
159         Color_deletedtext,
160         /// Added text color
161         Color_addedtext,
162         /// Changed text color author 1
163         Color_changedtextauthor1,
164         /// Changed text color author 2
165         Color_changedtextauthor2,
166         /// Changed text color author 3
167         Color_changedtextauthor3,
168         /// Changed text color author 4
169         Color_changedtextauthor4,
170         /// Changed text color author 5
171         Color_changedtextauthor5,
172         /// Deleted text modifying color
173         Color_deletedtextmodifier,
174         /// Top and bottom line color
175         Color_topline,
176         /// Table line color
177         Color_tabularline,
178         /// Table line color
179         Color_tabularonoffline,
180         /// Bottom area color
181         Color_bottomarea,
182         /// New page color
183         Color_newpage,
184         /// Page break color
185         Color_pagebreak,
186
187         // FIXME: why are the next four separate ??
188         /// Color used for button frame
189         Color_buttonframe,
190         /// Color used for bottom background
191         Color_buttonbg,
192         /// Color used for buttom under focus
193         Color_buttonhoverbg,
194         /// Color used for the pilcrow sign to mark the end of a paragraph
195         Color_paragraphmarker,
196         /// Preview frame color
197         Color_previewframe,
198
199         // Logical attributes
200
201         /// Color is inherited
202         Color_inherit,
203         /// Color for regexp frame
204         Color_regexpframe,
205         /// For ignoring updates of a color
206         Color_ignore
207 };
208
209
210 struct RGBColor {
211         unsigned int r;
212         unsigned int g;
213         unsigned int b;
214         RGBColor() : r(0), g(0), b(0) {}
215         RGBColor(unsigned int red, unsigned int green, unsigned int blue)
216                 : r(red), g(green), b(blue) {}
217 };
218
219 inline bool operator==(RGBColor const & c1, RGBColor const & c2)
220 {
221         return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
222 }
223
224
225 inline bool operator!=(RGBColor const & c1, RGBColor const & c2)
226 {
227         return !(c1 == c2);
228 }
229
230 } // namespace lyx
231
232 #endif