]>
Commit | Line | Data |
---|---|---|
7c78e7c7 RR |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: palette.cpp | |
01b2eeec KB |
3 | // Purpose: wxPalette |
4 | // Author: AUTHOR | |
5 | // Modified by: | |
6 | // Created: ??/??/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) AUTHOR | |
7c78e7c7 RR |
9 | // Licence: wxWindows licence |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
7c78e7c7 RR |
12 | #ifdef __GNUG__ |
13 | #pragma implementation "palette.h" | |
14 | #endif | |
15 | ||
16 | #include "wx/palette.h" | |
17 | ||
01b2eeec KB |
18 | #if !USE_SHARED_LIBRARIES |
19 | IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject) | |
20 | #endif | |
7c78e7c7 | 21 | |
01b2eeec KB |
22 | /* |
23 | * Palette | |
24 | * | |
25 | */ | |
7c78e7c7 | 26 | |
01b2eeec | 27 | wxPaletteRefData::wxPaletteRefData() |
7c78e7c7 | 28 | { |
01b2eeec KB |
29 | // TODO |
30 | } | |
7c78e7c7 | 31 | |
01b2eeec KB |
32 | wxPaletteRefData::~wxPaletteRefData() |
33 | { | |
34 | // TODO | |
35 | } | |
7c78e7c7 | 36 | |
01b2eeec | 37 | wxPalette::wxPalette() |
7c78e7c7 | 38 | { |
01b2eeec | 39 | } |
7c78e7c7 | 40 | |
01b2eeec | 41 | wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) |
7c78e7c7 | 42 | { |
01b2eeec KB |
43 | Create(n, red, green, blue); |
44 | } | |
7c78e7c7 | 45 | |
01b2eeec | 46 | wxPalette::~wxPalette() |
7c78e7c7 | 47 | { |
01b2eeec | 48 | } |
7c78e7c7 | 49 | |
01b2eeec KB |
50 | bool wxPalette::FreeResource(bool force) |
51 | { | |
52 | if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette) | |
53 | { | |
54 | DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette); | |
55 | } | |
56 | return TRUE; | |
57 | } | |
58 | ||
59 | bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) | |
7c78e7c7 RR |
60 | { |
61 | UnRef(); | |
7c78e7c7 | 62 | |
01b2eeec | 63 | m_refData = new wxPaletteRefData; |
7c78e7c7 | 64 | |
01b2eeec | 65 | // TODO |
7c78e7c7 | 66 | |
01b2eeec KB |
67 | return FALSE; |
68 | } | |
7c78e7c7 | 69 | |
01b2eeec | 70 | int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const |
7c78e7c7 | 71 | { |
01b2eeec KB |
72 | if ( !m_refData ) |
73 | return FALSE; | |
7c78e7c7 | 74 | |
01b2eeec KB |
75 | // TODO |
76 | return FALSE; | |
77 | } | |
7c78e7c7 | 78 | |
01b2eeec | 79 | bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const |
7c78e7c7 | 80 | { |
01b2eeec KB |
81 | if ( !m_refData ) |
82 | return FALSE; | |
7c78e7c7 | 83 | |
01b2eeec KB |
84 | if (index < 0 || index > 255) |
85 | return FALSE; | |
86 | ||
87 | // TODO | |
88 | return FALSE; | |
89 | } | |
7c78e7c7 | 90 | |
7c78e7c7 | 91 |