00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * 00008 * Chris AtLee 00009 * Side Effects Software Inc 00010 * 477 Richmond Street West 00011 * Toronto, Ontario 00012 * Canada M5V 3E7 00013 * 416-504-9876 00014 * 00015 * NAME: (UT_ColorList.h, C++) 00016 * 00017 * COMMENTS: 00018 */ 00019 00020 #ifndef _UT_ColorList_ 00021 #define _UT_ColorList_ 00022 00023 #include "UT_API.h" 00024 #include "UT_String.h" 00025 #include "UT_Color.h" 00026 #include "UT_SortedSymbolTable.h" 00027 00028 class UT_API UT_ColorList 00029 { 00030 public: 00031 UT_ColorList(); 00032 00033 // Load the given file on startup 00034 UT_ColorList(const char* rgbfile); 00035 00036 virtual ~UT_ColorList(); 00037 00038 // Load colors from rgbfile (in X11 rgb.txt format) 00039 void loadFile(const char* rgbfile); 00040 00041 // Was there an error parsing the file? 00042 bool error() const { return myIsError; }; 00043 00044 // Get the number or errors, and the line and description of the first 00045 // error in the file 00046 void getError(int& nerrors, int& errline, UT_String& errmsg) const; 00047 00048 // How many colors are in the list 00049 uint numColors() const; 00050 00051 // Get a color by name 00052 UT_Color getColor(const char* colorname) const; 00053 00054 // Get a color by index 00055 UT_Color getColor(uint i) const; 00056 00057 // Get the name of the color at index i 00058 UT_String getColorName(uint i) const; 00059 00060 protected: 00061 bool myIsError; 00062 int myNumErrors; 00063 int myErrLine; 00064 UT_String myErrMsg; 00065 UT_SortedSymbolTable myColors; 00066 }; 00067 00068 #endif
1.5.9