X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c78e7c70271608b076b1dbed201b1204e6898d4..27dc7e21d9bc78c7c0c991eb9c0c0350278d163d:/src/qt/palette.cpp diff --git a/src/qt/palette.cpp b/src/qt/palette.cpp index 5256aa14ca..445b545f0c 100644 --- a/src/qt/palette.cpp +++ b/src/qt/palette.cpp @@ -1,103 +1,91 @@ ///////////////////////////////////////////////////////////////////////////// // Name: palette.cpp -// Purpose: -// Author: Robert Roebling -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem +// Purpose: wxPalette +// Author: AUTHOR +// Modified by: +// Created: ??/??/98 +// RCS-ID: $Id$ +// Copyright: (c) AUTHOR // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - #ifdef __GNUG__ #pragma implementation "palette.h" #endif #include "wx/palette.h" -//----------------------------------------------------------------------------- -// wxPalette -//----------------------------------------------------------------------------- +#if !USE_SHARED_LIBRARIES +IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject) +#endif -class wxPaletteRefData: public wxObjectRefData -{ - public: - - wxPaletteRefData(void); - ~wxPaletteRefData(void); - -}; - -wxPaletteRefData::wxPaletteRefData(void) -{ -}; +/* + * Palette + * + */ -wxPaletteRefData::~wxPaletteRefData(void) +wxPaletteRefData::wxPaletteRefData() { -}; + // TODO +} -//----------------------------------------------------------------------------- - -#define M_PALETTEDATA ((wxPaletteRefData *)m_refData) - -IMPLEMENT_DYNAMIC_CLASS(wxPalette,wxGDIObject) +wxPaletteRefData::~wxPaletteRefData() +{ + // TODO +} -wxPalette::wxPalette(void) +wxPalette::wxPalette() { -}; +} -wxPalette::wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue ) +wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) { - m_refData = new wxPaletteRefData(); - Create( n, red, green, blue ); -}; + Create(n, red, green, blue); +} -wxPalette::wxPalette( const wxPalette& palette ) +wxPalette::~wxPalette() { - Ref( palette ); -}; +} -wxPalette::wxPalette( const wxPalette* palette ) +bool wxPalette::FreeResource(bool force) +{ + if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette) + { + DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette); + } + return TRUE; +} + +bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) { UnRef(); - if (palette) Ref( *palette ); -}; -wxPalette::~wxPalette(void) -{ -}; + m_refData = new wxPaletteRefData; -wxPalette& wxPalette::operator = ( const wxPalette& palette ) -{ - if (*this == palette) return (*this); - Ref( palette ); - return *this; -}; + // TODO -bool wxPalette::operator == ( const wxPalette& palette ) -{ - return m_refData == palette.m_refData; -}; + return FALSE; +} -bool wxPalette::operator != ( const wxPalette& palette ) +int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const { - return m_refData != palette.m_refData; -}; + if ( !m_refData ) + return FALSE; -bool wxPalette::Ok(void) const -{ - return (m_refData); -}; + // TODO + return FALSE; +} -bool wxPalette::Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) +bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const { -}; + if ( !m_refData ) + return FALSE; -int wxPalette::GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const -{ -}; + if (index < 0 || index > 255) + return FALSE; + + // TODO + return FALSE; +} -bool wxPalette::GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const -{ -};