]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/colour.h
wxDataObject now defined in defs.h and not here
[wxWidgets.git] / include / wx / msw / colour.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: colour.h
3 // Purpose: wxColour class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __COLOURH__
13 #define __COLOURH__
14
15 #ifdef __GNUG__
16 #pragma interface "colour.h"
17 #endif
18
19 // Colour
20 class WXDLLEXPORT wxColour: public wxObject
21 {
22 DECLARE_DYNAMIC_CLASS(wxColour)
23 public:
24 wxColour(void);
25 wxColour(const unsigned char r, const unsigned char g, const unsigned char b);
26 wxColour(const wxColour& col);
27 wxColour(const wxString& col);
28 ~wxColour(void) ;
29 wxColour& operator =(const wxColour& src) ;
30 wxColour& operator =(const wxString& src) ;
31 inline int Ok(void) const { return (m_isInit) ; }
32
33 void Set(unsigned char r, unsigned char g, unsigned char b);
34
35 // Let's remove this inelegant function
36 #if WXWIN_COMPATIBILITY
37 void Get(unsigned char *r, unsigned char *g, unsigned char *b) const;
38 #endif
39
40 inline unsigned char Red(void) const { return m_red; }
41 inline unsigned char Green(void) const { return m_green; }
42 inline unsigned char Blue(void) const { return m_blue; }
43
44 inline bool operator == (const wxColour& colour) { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); }
45
46 inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
47
48 WXCOLORREF GetPixel(void) const { return m_pixel; };
49
50 private:
51 bool m_isInit;
52 unsigned char m_red;
53 unsigned char m_blue;
54 unsigned char m_green;
55 public:
56 WXCOLORREF m_pixel ;
57 };
58
59 #define wxColor wxColour
60
61 #endif
62 // __COLOURH__