#endif
#if !USE_SHARED_LIBRARY
-wxClassInfo wxObject::classwxObject("wxObject", NULL, NULL, sizeof(wxObject), NULL);
-wxClassInfo *wxClassInfo::first = NULL;
+wxClassInfo wxObject::classwxObject((char *) "wxObject", (char *) NULL, (char *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
+wxClassInfo *wxClassInfo::first = (wxClassInfo *) NULL;
#endif
/*
wxObject::wxObject(void)
{
- m_refData = NULL;
+ m_refData = (wxObjectRefData *) NULL;
}
wxObject::~wxObject(void)
next = first;
first = this;
- baseInfo1 = NULL;
- baseInfo2 = NULL;
+ baseInfo1 = (wxClassInfo *) NULL;
+ baseInfo2 = (wxClassInfo *) NULL;
}
wxObject *wxClassInfo::CreateObject(void)
if (objectConstructor)
return (wxObject *)(*objectConstructor)();
else
- return NULL;
+ return (wxObject *) NULL;
}
wxClassInfo *wxClassInfo::FindClass(char *c)
return p;
p = p->next;
}
- return NULL;
+ return (wxClassInfo *) NULL;
}
// Climb upwards through inheritance hierarchy.
return info->CreateObject();
info = info->next;
}
- return NULL;
+ return (wxObject *) NULL;
}
#ifdef USE_STORABLE_CLASSES
+#include "wx/serbase.h"
+#include "wx/dynlib.h"
+#include "wx/msgdlg.h"
+
wxObject* wxCreateStoredObject( wxInputStream &stream )
{
wxObjectInputStream obj_s(stream);
return obj_s.LoadObject();
};
+void wxObject::StoreObject( wxObjectOutputStream& stream )
+{
+ wxString obj_name = wxString(GetClassInfo()->GetClassName()) + "_Serialize";
+ wxLibrary *lib = wxTheLibraries.LoadLibrary("wxserial");
+ WXSERIAL(wxObject) *serial;
+
+ if (!lib) {
+ wxMessageBox("Can't load wxSerial dynamic library.", "Alert !");
+ return;
+ }
+ serial = (WXSERIAL(wxObject) *)lib->CreateObject( obj_name );
+
+ if (!serial) {
+ wxString message;
+
+ message.Printf("Can't find the serialization object (%s) for the object %s",
+ WXSTRINGCAST obj_name, WXSTRINGCAST GetClassInfo()->GetClassName());
+ wxMessageBox(message, "Alert !");
+ return;
+ }
+
+ serial->SetObject(this);
+ serial->StoreObject(stream);
+
+ delete serial;
+}
+
+void wxObject::LoadObject( wxObjectInputStream& stream )
+{
+ wxString obj_name = wxString(GetClassInfo()->GetClassName()) + "_Serialize";
+ wxLibrary *lib = wxTheLibraries.LoadLibrary("wxserial");
+ WXSERIAL(wxObject) *serial =
+ (WXSERIAL(wxObject) *)lib->CreateObject( obj_name );
+
+ if (!serial) {
+ wxString message;
+
+ message.Printf("Can't find the serialization object (%s) for the object %s",
+ WXSTRINGCAST obj_name,
+ WXSTRINGCAST GetClassInfo()->GetClassName());
+ wxMessageBox(message, "Alert !");
+ return;
+ }
+
+ serial->SetObject(this);
+ serial->LoadObject(stream);
+
+ delete serial;
+}
+
#endif
/*
if (m_refData->m_count == 0)
delete m_refData;
}
- m_refData = NULL;
+ m_refData = (wxObjectRefData *) NULL;
}
/*