1 #ifndef __color_mapper_h 2 #define __color_mapper_h 3 4 class ColorMapper { 5 public: 6 ColorMapper(Display *dpy); 7 ~ColorMapper(); 8 9 unsigned long alloc_color( XColor *col ); 10 unsigned long alloc_named_color( const char *name ); get_colormap()11 Colormap get_colormap() { return mymap; } 12 13 private: 14 void setup_usage(); 15 void free_usage(); 16 17 Display *dpy; 18 Colormap mymap; 19 int cells; 20 XColor *colors; 21 }; 22 23 #endif 24