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