/[pcsx2_0.9.7]/trunk/3rdparty/wxWidgets/include/wx/msw/colour.h
ViewVC logotype

Contents of /trunk/3rdparty/wxWidgets/include/wx/msw/colour.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (show annotations) (download)
Mon Sep 6 11:40:06 2010 UTC (9 years, 5 months ago) by william
File MIME type: text/plain
File size: 2420 byte(s)
exported r3113 from ./upstream/trunk
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/colour.h
3 // Purpose: wxColour class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id: colour.h 51769 2008-02-13 22:36:43Z VZ $
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_COLOUR_H_
13 #define _WX_COLOUR_H_
14
15 #include "wx/object.h"
16
17 // ----------------------------------------------------------------------------
18 // Colour
19 // ----------------------------------------------------------------------------
20
21 class WXDLLEXPORT wxColour : public wxColourBase
22 {
23 public:
24 // constructors
25 // ------------
26
27 wxColour() { Init(); }
28 wxColour( ChannelType red, ChannelType green, ChannelType blue,
29 ChannelType alpha = wxALPHA_OPAQUE )
30 { Set(red, green, blue, alpha); }
31 wxColour( unsigned long colRGB ) { Set(colRGB); }
32 wxColour(const wxString& colourName) { Init(); Set(colourName); }
33 wxColour(const wxChar *colourName) { Init(); Set(colourName); }
34
35
36 // dtor
37 virtual ~wxColour();
38
39
40 // accessors
41 // ---------
42
43 bool Ok() const { return IsOk(); }
44 bool IsOk() const { return m_isInit; }
45
46 unsigned char Red() const { return m_red; }
47 unsigned char Green() const { return m_green; }
48 unsigned char Blue() const { return m_blue; }
49 unsigned char Alpha() const { return m_alpha ; }
50
51 // comparison
52 bool operator==(const wxColour& colour) const
53 {
54 return m_isInit == colour.m_isInit
55 && m_red == colour.m_red
56 && m_green == colour.m_green
57 && m_blue == colour.m_blue
58 && m_alpha == colour.m_alpha;
59 }
60
61 bool operator != (const wxColour& colour) const { return !(*this == colour); }
62
63 WXCOLORREF GetPixel() const { return m_pixel; }
64
65
66 public:
67 WXCOLORREF m_pixel;
68
69 protected:
70 // Helper function
71 void Init();
72
73 virtual void
74 InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
75
76 private:
77 bool m_isInit;
78 unsigned char m_red;
79 unsigned char m_blue;
80 unsigned char m_green;
81 unsigned char m_alpha;
82
83 private:
84 DECLARE_DYNAMIC_CLASS(wxColour)
85 };
86
87 #endif
88 // _WX_COLOUR_H_

  ViewVC Help
Powered by ViewVC 1.1.22