X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..f2616db56739e4962f683f59ac9e207756efe23c:/src/msw/palette.cpp?ds=inline diff --git a/src/msw/palette.cpp b/src/msw/palette.cpp index 1eaaa5e074..7d88c7fe72 100644 --- a/src/msw/palette.cpp +++ b/src/msw/palette.cpp @@ -30,9 +30,7 @@ #include "assert.h" -#if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject) -#endif /* * Palette @@ -54,7 +52,7 @@ wxPalette::wxPalette(void) { } -wxPalette::wxPalette(const 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) { Create(n, red, green, blue); } @@ -64,7 +62,7 @@ wxPalette::~wxPalette(void) // FreeResource(TRUE); } -bool wxPalette::FreeResource(bool force) +bool wxPalette::FreeResource(bool WXUNUSED(force)) { if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette) { @@ -73,10 +71,16 @@ bool wxPalette::FreeResource(bool force) return TRUE; } -bool wxPalette::Create(const int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) +bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) { UnRef(); +#if defined(__WXWINE__) || defined(__WXMICROWIN__) + + return (FALSE); + +#else + m_refData = new wxPaletteRefData; NPLOGPALETTE npPal = (NPLOGPALETTE)LocalAlloc(LMEM_FIXED, sizeof(LOGPALETTE) + @@ -98,18 +102,27 @@ bool wxPalette::Create(const int n, const unsigned char *red, const unsigned cha M_PALETTEDATA->m_hPalette = (WXHPALETTE) CreatePalette((LPLOGPALETTE)npPal); LocalFree((HANDLE)npPal); return TRUE; + +#endif } int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const { +#ifdef __WXMICROWIN__ + return FALSE; +#else if ( !m_refData ) return FALSE; return ::GetNearestPaletteIndex((HPALETTE) M_PALETTEDATA->m_hPalette, PALETTERGB(red, green, blue)); +#endif } -bool wxPalette::GetRGB(const int index, unsigned char *red, unsigned char *green, unsigned char *blue) const +bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const { +#ifdef __WXMICROWIN__ + return FALSE; +#else if ( !m_refData ) return FALSE; @@ -125,6 +138,7 @@ bool wxPalette::GetRGB(const int index, unsigned char *red, unsigned char *green return TRUE; } else return FALSE; +#endif } void wxPalette::SetHPALETTE(WXHPALETTE pal)