1/* 2 * Copyright 2001-2008, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * DarkWyrm <bpmagic@columbus.rr.com> 7 * Rene Gollent <rene@gollent.com> 8 */ 9#ifndef COLOR_SET_H 10#define COLOR_SET_H 11 12 13#include <InterfaceDefs.h> 14#include <Locker.h> 15#include <Message.h> 16#include <String.h> 17 18#include <map> 19 20typedef struct 21{ 22 color_which which; 23 const char* text; 24} ColorDescription; 25 26const ColorDescription* get_color_description(int32 index); 27int32 color_description_count(void); 28 29 30/*! 31 \class ColorSet ColorSet.h 32 \brief Encapsulates GUI system colors 33*/ 34class ColorSet : public BLocker { 35 public: 36 ColorSet(); 37 ColorSet(const ColorSet &cs); 38 ColorSet & operator=(const ColorSet &cs); 39 40 rgb_color GetColor(int32 which); 41 void SetColor(color_which which, rgb_color value); 42 43 static ColorSet DefaultColorSet(void); 44 45 inline bool operator==(const ColorSet &other) 46 { 47 return fColors == other.fColors; 48 } 49 50 inline bool operator!=(const ColorSet &other) 51 { 52 return fColors != other.fColors; 53 } 54 55 private: 56 std::map<color_which, rgb_color> fColors; 57}; 58 59#endif // COLOR_SET_H 60