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 /// No particular color---clear or default 18 Color_none, 19 /// The different text colors 20 Color_black, 21 /// 22 Color_white, 23 /// 24 Color_blue, 25 /// 26 Color_brown, 27 /// 28 Color_cyan, 29 /// 30 Color_darkgray, 31 /// 32 Color_gray, 33 /// 34 Color_green, 35 /// 36 Color_lightgray, 37 /// 38 Color_lime, 39 /// 40 Color_magenta, 41 /// 42 Color_olive, 43 /// 44 Color_orange, 45 /// 46 Color_pink, 47 /// 48 Color_purple, 49 /// 50 Color_red, 51 /// 52 Color_teal, 53 /// 54 Color_violet, 55 /// 56 Color_yellow, 57 58 // Needed interface colors 59 60 /// Cursor color 61 Color_cursor, 62 /// Background color 63 Color_background, 64 /// Foreground color 65 Color_foreground, 66 /// Background color of selected text 67 Color_selection, 68 /// Foreground color of selected text 69 Color_selectiontext, 70 /// Text color in LaTeX mode 71 Color_latex, 72 /// The color used for previews 73 Color_preview, 74 /// Inline completion color 75 Color_inlinecompletion, 76 /// Inline completion color for the non-unique part 77 Color_nonunique_inlinecompletion, 78 79 /// Label color for notes 80 Color_notelabel, 81 /// Background color of notes 82 Color_notebg, 83 /// Label color for comments 84 Color_commentlabel, 85 /// Background color of comments 86 Color_commentbg, 87 /// Label color for greyedout insets 88 Color_greyedoutlabel, 89 /// Color for greyedout inset text 90 Color_greyedouttext, 91 /// Background color of greyedout inset 92 Color_greyedoutbg, 93 /// Background color of shaded box 94 Color_shadedbg, 95 /// Background color of listings inset 96 Color_listingsbg, 97 98 /// Label color for branches 99 Color_branchlabel, 100 /// Label color for footnotes 101 Color_footlabel, 102 /// Label color for index insets 103 Color_indexlabel, 104 /// Label color for margin notes 105 Color_marginlabel, 106 /// Text color for phantom insets 107 Color_phantomtext, 108 /// Label color for URL insets 109 Color_urllabel, 110 111 /// Color for URL inset text 112 Color_urltext, 113 114 /// Color for the depth bars in the margin 115 Color_depthbar, 116 /// Color that indicates when a row can be scrolled 117 Color_scroll, 118 /// Color for marking foreign language words 119 Color_language, 120 121 /// Text color for command insets 122 Color_command, 123 /// Background color for command insets 124 Color_commandbg, 125 /// Frame color for command insets 126 Color_commandframe, 127 128 /// Special chars text color 129 Color_special, 130 131 /// Graphics inset background color 132 Color_graphicsbg, 133 /// Math inset text color 134 Color_math, 135 /// Math inset background color 136 Color_mathbg, 137 /// Macro math inset background color 138 Color_mathmacrobg, 139 /// Macro math inset background color hovered 140 Color_mathmacrohoverbg, 141 /// Macro math label color 142 Color_mathmacrolabel, 143 /// Macro math frame color 144 Color_mathmacroframe, 145 /// Macro math blended color 146 Color_mathmacroblend, 147 /// Macro template color for old parameters 148 Color_mathmacrooldarg, 149 /// Macro template color for new parameters 150 Color_mathmacronewarg, 151 /// Math inset frame color under focus 152 Color_mathframe, 153 /// Math inset frame color not under focus 154 Color_mathcorners, 155 /// Math line color 156 Color_mathline, 157 158 /// Collapsible insets text 159 Color_collapsible, 160 /// Collapsible insets frame 161 Color_collapsibleframe, 162 163 /// Inset marker background color 164 Color_insetbg, 165 /// Inset marker frame color 166 Color_insetframe, 167 168 /// Error box text color 169 Color_error, 170 /// End of line (EOL) marker color 171 Color_eolmarker, 172 /// Added space colour 173 Color_added_space, 174 /// Appendix marker color 175 Color_appendix, 176 /// Changebar color 177 Color_changebar, 178 /// Deleted text color 179 Color_deletedtext, 180 /// Added text color 181 Color_addedtext, 182 /// Changed text color author 1 183 Color_changedtextauthor1, 184 /// Changed text color author 2 185 Color_changedtextauthor2, 186 /// Changed text color author 3 187 Color_changedtextauthor3, 188 /// Changed text color author 4 189 Color_changedtextauthor4, 190 /// Changed text color author 5 191 Color_changedtextauthor5, 192 /// Deleted text modifying color 193 Color_deletedtextmodifier, 194 /// Table line color 195 Color_tabularline, 196 /// Table line color 197 Color_tabularonoffline, 198 /// Bottom area color 199 Color_bottomarea, 200 /// New page color 201 Color_newpage, 202 /// Page break color 203 Color_pagebreak, 204 205 // FIXME: why are the next four separate ?? 206 /// Color used for button frame 207 Color_buttonframe, 208 /// Color used for bottom background 209 Color_buttonbg, 210 /// Color used for buttom under focus 211 Color_buttonhoverbg, 212 /// Color used for the pilcrow sign to mark the end of a paragraph 213 Color_paragraphmarker, 214 /// Preview frame color 215 Color_previewframe, 216 217 // Logical attributes 218 219 /// Color is inherited 220 Color_inherit, 221 /// Color for regexp frame 222 Color_regexpframe, 223 /// For ignoring updates of a color 224 Color_ignore 225 }; 226 227 228 struct RGBColor { 229 unsigned int r; 230 unsigned int g; 231 unsigned int b; RGBColorRGBColor232 RGBColor() : r(0), g(0), b(0) {} RGBColorRGBColor233 RGBColor(unsigned int red, unsigned int green, unsigned int blue) 234 : r(red), g(green), b(blue) {} 235 }; 236 237 inline bool operator==(RGBColor const & c1, RGBColor const & c2) 238 { 239 return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b); 240 } 241 242 243 inline bool operator!=(RGBColor const & c1, RGBColor const & c2) 244 { 245 return !(c1 == c2); 246 } 247 248 } // namespace lyx 249 250 #endif 251