/////////////////////////////////////////////////////////////////////////////
-// Name: palette.cpp
+// Name: src/motif/palette.cpp
// Purpose: wxPalette
// Author: Julian Smart
// Modified by:
not the functionality that wxPalette::Create() aims to provide.
*/
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "palette.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/palette.h"
-#include "wx/window.h"
-#include "wx/app.h"
-#include "wx/utils.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/app.h"
+ #include "wx/utils.h"
+ #include "wx/window.h"
+#endif
#ifdef __VMS__
#pragma message disable nosimpint
pix_array_n = n;
xcol.flags = DoRed | DoGreen | DoBlue;
for(int i = 0; i < n; i++) {
- xcol.red = (unsigned short)red[i] << 8;
- xcol.green = (unsigned short)green[i] << 8;
- xcol.blue = (unsigned short)blue[i] << 8;
+ xcol.red = (unsigned short)(red[i] << 8);
+ xcol.green = (unsigned short)(green[i] << 8);
+ xcol.blue = (unsigned short)(blue[i] << 8);
pix_array[i] = (XAllocColor(display, cmap, &xcol) == 0) ? 0 : xcol.pixel;
}
return true;
}
-int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
+int wxPalette::GetPixel(unsigned char WXUNUSED(red),
+ unsigned char WXUNUSED(green),
+ unsigned char WXUNUSED(blue)) const
{
if ( !m_refData )
- return false;
+ return wxNOT_FOUND;
// TODO
- return false;
+ return wxNOT_FOUND;
}
bool wxPalette::GetRGB(int index, unsigned char *WXUNUSED(red), unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(blue)) const
struct rgb24 { unsigned char r, g, b; } *dptr = (struct rgb24 *)dest;
while(sz-- > 0) {
if((int)*data < pix_array_n) {
- dptr->r = pix_array[*data] & 0xFF;
- dptr->g = (pix_array[*data] >> 8) & 0xFF;
- dptr->b = (pix_array[*data] >> 16) & 0xFF;
+ dptr->r = (unsigned char)(pix_array[*data] & 0xFF);
+ dptr->g = (unsigned char)((pix_array[*data] >> 8) & 0xFF);
+ dptr->b = (unsigned char)((pix_array[*data] >> 16) & 0xFF);
}
data++;
dptr++;
M_PALETTEDATA->m_palettes.Append(c);
}
-