#include <wx/colour.h>
#include <wx/palette.h>
#include <wx/dcmemory.h>
+#include <wx/log.h>
#include "sergdi.h"
IMPLEMENT_SERIAL_CLASS(wxBitmap, wxObject)
IMPLEMENT_SERIAL_CLASS(wxGDIObject, wxObject)
IMPLEMENT_SERIAL_CLASS(wxRegion, wxGDIObject)
-IMPLEMENT_SERIAL_CLASS(wxColour, wxGDIObject)
+IMPLEMENT_SERIAL_CLASS(wxColour, wxObject)
IMPLEMENT_SERIAL_CLASS(wxFont, wxGDIObject)
IMPLEMENT_SERIAL_CLASS(wxPen, wxGDIObject)
IMPLEMENT_SERIAL_CLASS(wxBrush, wxGDIObject)
w = data_s.Read16();
h = data_s.Read16();
- bitmap->Resize(w, h);
+ bitmap->SetWidth(w);
+ bitmap->SetHeight(h);
dc.SelectObject(*bitmap);
for (y=0;y<h;y++)
void WXSERIAL(wxColour)::StoreObject(wxObjectOutputStream& s)
{
- WXSERIAL(wxGDIObject)::StoreObject(s);
-
if (s.FirstStage())
return;
wxDataOutputStream data_s(s);
wxColour *colour = (wxColour *)Object();
+ if (!colour->Ok()) {
+ data_s.Write8(0);
+ data_s.Write8(0);
+ data_s.Write8(0);
+ wxLogDebug("wxColour (0x%x) isn't ready.\n", colour);
+ return;
+ }
+
data_s.Write8(colour->Red());
data_s.Write8(colour->Green());
data_s.Write8(colour->Blue());
void WXSERIAL(wxColour)::LoadObject(wxObjectInputStream& s)
{
- WXSERIAL(wxGDIObject)::LoadObject(s);
-
wxDataInputStream data_s(s);
wxColour *colour = (wxColour *)Object();
int r, g, b;
int i;
if (s.FirstStage()) {
+#ifdef __WXGTK__
for (i=0;i<list->GetImageCount();i++)
s.AddChild(list->GetBitmap(i));
+#endif
}
wxDataOutputStream data_s(s);