/////////////////////////////////////////////////////////////////////////////
-// Name: xpmdecod.cpp
+// Name: src/common/xpmdecod.cpp
// Purpose: wxXPMDecoder
// Author: John Cristy, Vaclav Slavik
// RCS-ID: $Id$
#include "wx/wxprec.h"
#ifdef __BORLANDC__
-# pragma hdrstop
+ #pragma hdrstop
#endif
+#if wxUSE_IMAGE && wxUSE_XPM
+
#ifndef WX_PRECOMP
-# include "wx/defs.h"
+ #include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/utils.h"
+ #if wxUSE_STREAMS
+ #include "wx/stream.h"
+ #endif
#endif
-#if wxUSE_IMAGE && wxUSE_XPM
-
-#include "wx/stream.h"
#include "wx/image.h"
-#include "wx/utils.h"
-#include "wx/log.h"
#include "wx/hashmap.h"
-#include "wx/intl.h"
#include <string.h>
#include <ctype.h>
struct wxXPMColourMapData
{
+ wxXPMColourMapData() { R = G = B = 0; }
unsigned char R,G,B;
};
WX_DECLARE_STRING_HASH_MAP(wxXPMColourMapData, wxXPMColourMap);
/*
* Create colour map:
*/
+ wxXPMColourMapData clr_data;
for (i = 0; i < colors_cnt; i++)
{
const char *xmpColLine = xpm_data[1 + i];
return wxNullImage;
}
- wxXPMColourMapData clr_data;
-
for (i_key = 0; i_key < chars_per_pixel; i_key++)
key[i_key] = (wxChar)xmpColLine[i_key];
clr_def = ParseColor(xmpColLine + chars_per_pixel);
{
img.SetMask(true);
img.SetMaskColour(255, 0, 255);
+ clr_data.R =
+ clr_data.B = 255;
+ clr_data.G = 0;
hasMask = true;
maskKey = key;
}