| // Copyright 2019 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef UI_COLOR_COLOR_ID_H_ |
| #define UI_COLOR_COLOR_ID_H_ |
| |
| namespace ui { |
| |
| // ColorId contains identifiers for all input, intermediary, and output colors |
| // known to the core UI layer. Embedders can extend this enum with additional |
| // values that are understood by the ColorProvider implementation. Embedders |
| // define enum values from kUiColorsEnd. Values named beginning with "kColor" |
| // represent the actual colors; the rest are markers. |
| using ColorId = int; |
| enum ColorIds : ColorId { |
| kUiColorsStart = 0, |
| |
| // TODO(pkasting): Define this list. |
| kColorX = kUiColorsStart, |
| |
| // Embedders must start color IDs from this value. |
| kUiColorsEnd, |
| |
| // Embedders must not assign IDs larger than this value. This is used to |
| // verify that color IDs and color set IDs are not interchanged. |
| kUiColorsLast = 0xffff |
| }; |
| |
| // ColorSetId contains identifiers for all distinct color sets known to the core |
| // UI layer. As with ColorId, embedders can extend this enum with additional |
| // values that are understood by the ColorProvider implementation. Embedders |
| // define enum values from kUiColorSetsEnd. Values named beginning with |
| // "kColorSet" represent the actual colors; the rest are markers. |
| using ColorSetId = int; |
| enum ColorSetIds : ColorSetId { |
| kUiColorSetsStart = kUiColorsLast + 1, |
| |
| // TODO(pkasting): Define this list. |
| kColorSetX = kUiColorSetsStart, |
| |
| // Embedders must start color set IDs from this value. |
| kUiColorSetsEnd, |
| }; |
| |
| // Verifies that |id| is a color ID, not a color set ID. |
| #define DCHECK_COLOR_ID_VALID(id) \ |
| DCHECK_GE(id, kUiColorsStart); \ |
| DCHECK_LE(id, kUiColorsLast) |
| |
| // Verifies that |id| is a color set ID, not a color ID. |
| #define DCHECK_COLOR_SET_ID_VALID(id) DCHECK_GE(id, kUiColorSetsStart) |
| |
| } // namespace ui |
| |
| #endif // UI_COLOR_COLOR_ID_H_ |