File indexing completed on 2024-04-28 15:35:14
0001 /*************************************************************************** 0002 * Copyright (C) 2004 by Tomas Mecir * 0003 * kmuddy@kmuddy.org * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU Library General Public License as * 0007 * published by the Free Software Foundation; either version 2 of the * 0008 * License, or (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU Library General Public License for more details. * 0014 ***************************************************************************/ 0015 #ifndef CMXPCOLORS_H 0016 #define CMXPCOLORS_H 0017 0018 #include <map> 0019 #include <string> 0020 0021 #include "libmxp.h" 0022 0023 using namespace std; 0024 0025 /** 0026 This class contains a list of MXP colors. It is based on the singleton pattern (single-instance). 0027 0028 @author Tomas Mecir 0029 */ 0030 0031 class cMXPColors { 0032 public: 0033 /** destructor */ 0034 ~cMXPColors (); 0035 /** return an instance of this class */ 0036 static cMXPColors *self (); 0037 void addColor (const string &color, RGB def); 0038 void removeColor (const string &color); 0039 RGB color (const string &color); 0040 static RGB noColor () { return nocolor; }; 0041 protected: 0042 /** constructor */ 0043 cMXPColors (); 0044 0045 map<string, RGB> colors; 0046 static RGB nocolor; 0047 0048 static cMXPColors *_self; 0049 }; 0050 0051 #endif