00001 #ifndef PALETTE_CLASS 00002 #define PALETTE_CLASS 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : palette * 00007 * Author : Chris Koeritz * 00008 * * 00009 * Purpose: * 00010 * * 00011 * A shared set of operations on edit controls that permits different * 00012 * manners of creating and presenting the windows that really show the info. * 00013 * * 00014 ******************************************************************************* 00015 * Copyright (c) 1995-$now By Author. This program is free software; you can * 00016 * redistribute it and/or modify it under the terms of the GNU General Public * 00017 * License as published by the Free Software Foundation; either version 2 of * 00018 * the License or (at your option) any later version. This is online at: * 00019 * http://www.fsf.org/copyleft/gpl.html * 00020 * Please send any updates to: fred@gruntose.com * 00021 \*****************************************************************************/ 00022 00023 #include "winexdll.h" 00024 00025 #include <basis/portable.h> 00026 00027 class WINDOWS_EXTENSIONS_CLASS_STYLE palette 00028 { 00029 public: 00030 palette(); 00031 // creates an invalid palette. 00032 palette(const palette &to_copy); 00033 // copies the palette in "to_copy". 00034 palette(HPALETTE to_attach); 00035 // copies the palette in "to_attach". 00036 palette(LOGPALETTE *to_copy); 00037 // creates the palette from the logical palette in "to_copy". 00038 palette(int colors, RGBQUAD *values); 00039 // creates the palette from an array of color "values" given the number 00040 // of "colors". 00041 ~palette(); 00042 00043 inline bool valid() { return !!OS_palette; } 00044 // returns true if this object seems to be valid. 00045 00046 palette &operator =(const palette &to_copy); 00047 // standard assignment operator. 00048 00049 HPALETTE win_palette() { return OS_palette; } 00050 // retrieves the OS version of the palette held here. do not delete this 00051 // returned handle. 00052 00053 void reset(); 00054 // trashes the palette held here and resets to an unconstructed one. 00055 00056 private: 00057 HPALETTE OS_palette; // operating system version of palette. 00058 }; 00059 00061 00062 /* 00063 * WIdentityPalette half-tone identity palette. 00064 */ 00065 00066 class WINDOWS_EXTENSIONS_CLASS_STYLE WIdentityPalette 00067 { 00068 public: 00069 WIdentityPalette(); 00070 virtual ~WIdentityPalette(); 00071 00072 HPALETTE m_hPalette; 00073 }; 00074 00075 #endif 00076
1.5.1