wxInputStream& operator>>(wxString& line);
wxInputStream& operator>>(char& c);
wxInputStream& operator>>(short& i);
+ wxInputStream& operator>>(int& i);
wxInputStream& operator>>(long& i);
wxInputStream& operator>>(float& i);
+ wxInputStream& operator>>(wxObject *& obj);
+
+ wxInputStream& operator>>(unsigned char& c) { return operator>>((char&)c); }
+ wxInputStream& operator>>(unsigned short& i) { return operator>>((short&)i); }
+ wxInputStream& operator>>(unsigned int& i) { return operator>>((int&)i); }
+ wxInputStream& operator>>(unsigned long& i) { return operator>>((long&)i); }
wxInputStream& operator>>( __wxInputManip func) { return func(*this); }
protected:
wxOutputStream& operator<<(int i);
wxOutputStream& operator<<(long i);
wxOutputStream& operator<<(double f);
+ wxOutputStream& operator<<(wxObject& obj);
wxOutputStream& operator<<(float f) { return operator<<((double)f); }
wxOutputStream& operator<<(unsigned char c) { return operator<<((char)c); }
wxOutputStream& operator<<(unsigned short i) { return operator<<((short)i); }
wxOutputStream& operator<<(unsigned int i) { return operator<<((int)i); }
wxOutputStream& operator<<(unsigned long i) { return operator<<((long)i); }
-
wxOutputStream& operator<<( __wxOutputManip func) { return func(*this); }
protected:
bool OnInit(void);
};
+wxMutex text_mutex;
+
WX_DEFINE_ARRAY(wxThread *,wxArrayThread);
// Define a new frame type
while (1) {
TestDestroy();
+ text_mutex.Lock();
m_frame->m_txtctrl->WriteText(text);
+ text_mutex.UnLock();
wxSleep(1);
}
#include <dlfcn.h>
#endif
+#ifdef __WINDOWS__
+#include <windows.h>
+#endif
+
// ---------------------------------------------------------------------------
// Global variables
// ---------------------------------------------------------------------------
else
delete m_liblist;
+#ifdef linux
dlclose(m_handle);
+#endif
+#ifdef __WINDOWS__
+ FreeLibrary((HMODULE)m_handle);
+#endif
}
}
void *wxLibrary::GetSymbol(const wxString& symbname)
{
#ifdef linux
- return dlsym(m_handle, symbname.GetData());
+ return dlsym(m_handle, WXSTRINGCAST symbname);
+#endif
+#ifdef __WINDOWS__
+ return GetProcAddress(m_handle, WXSTRINGCAST symbname);
#endif
+ return NULL;
}
// ---------------------------------------------------------------------------
return ((wxLibrary *)node->Data());
#ifdef linux
- lib_name.Prepend("./lib");
+ lib_name.Prepend("lib");
lib_name += ".so";
printf("lib_name = %s\n", WXSTRINGCAST lib_name);
- void *handle = dlopen(lib_name.GetData(), RTLD_LAZY);
-
- printf("handle = %x\n", handle);
- lib = new wxLibrary(handle);
+ void *handle = dlopen(WXSTRINGCAST lib_name, RTLD_LAZY);
+ if (!handle)
+ return NULL;
#endif
#ifdef __WINDOWS__
lib_name += ".dll";
+ HMODULE handle = LoadLibrary(lib_name);
+ if (!handle)
+ return NULL;
#endif
+ lib = new wxLibrary((void *)handle);
m_loaded.Append(name.GetData(), lib);
return lib;
#include <ctype.h>
#include <wx/stream.h>
#include <wx/datstrm.h>
+#include <wx/objstrm.h>
#ifdef __BORLANDC__
#pragma hdrstop
return *this;
}
+wxInputStream& wxInputStream::operator>>(int& i)
+{
+ long l;
+
+ *this >> l;
+ i = (short)l;
+ return *this;
+}
+
wxInputStream& wxInputStream::operator>>(long& i)
{
/* I only implemented a simple integer parser */
return *this;
}
+wxInputStream& wxInputStream::operator>>(wxObject *& obj)
+{
+ wxObjectInputStream obj_s(*this);
+ obj = obj_s.LoadObject();
+ return *this;
+}
+
off_t wxInputStream::SeekI(off_t pos, wxSeekMode mode)
{
off_t ret_off;
return Write(strfloat, strfloat.Len());
}
+wxOutputStream& wxOutputStream::operator<<(wxObject& obj)
+{
+ wxObjectOutputStream obj_s(*this);
+ obj_s.SaveObject(obj);
+ return *this;
+}
+
// ----------------------------------------------------------------------------
// wxFilterInputStream
// ----------------------------------------------------------------------------
+/////////////////////////////////////////////////////////////////////////////
+// Name: sercore.cpp
+// Purpose: Serialization: core classes
+// Author: Guilhem Lavaux
+// Modified by:
+// Created: July 1998
+// RCS-ID: $Id$
+// Copyright: (c) 1998 Guilhem Lavaux
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
#ifdef __GNUG__
#pragma implementation "sercore.h"
#endif
+/////////////////////////////////////////////////////////////////////////////
+// Name: sercore.h
+// Purpose: Serialization: core classes
+// Author: Guilhem Lavaux
+// Modified by:
+// Created: July 1998
+// RCS-ID: $Id$
+// Copyright: (c) 1998 Guilhem Lavaux
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
#ifndef __SERCORE_H__
#define __SERCORE_H__
+/////////////////////////////////////////////////////////////////////////////
+// Name: serctrl.cpp
+// Purpose: Serialization: control classes
+// Author: Guilhem Lavaux
+// Modified by:
+// Created: July 1998
+// RCS-ID: $Id$
+// Copyright: (c) 1998 Guilhem Lavaux
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
#ifdef __GNUG__
#pragma implementation "serctrl.h"
#endif
+/////////////////////////////////////////////////////////////////////////////
+// Name: serctrl.h
+// Purpose: Serialization: control classes
+// Author: Guilhem Lavaux
+// Modified by:
+// Created: July 1998
+// RCS-ID: $Id$
+// Copyright: (c) 1998 Guilhem Lavaux
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
#ifndef __SERCTRL_H__
#define __SERCTRL_H__
+/////////////////////////////////////////////////////////////////////////////
+// Name: serext.cpp
+// Purpose: Serialization: Other classes
+// Author: Guilhem Lavaux
+// Modified by:
+// Created: July 1998
+// RCS-ID: $Id$
+// Copyright: (c) 1998 Guilhem Lavaux
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
#ifdef __GNUG__
#pragma implementation "serext.h"
#endif
+/////////////////////////////////////////////////////////////////////////////
+// Name: serext.cpp
+// Purpose: Serialization: Other classes
+// Author: Guilhem Lavaux
+// Modified by:
+// Created: July 1998
+// RCS-ID: $Id$
+// Copyright: (c) 1998 Guilhem Lavaux
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
#ifndef __SEREXT_H__
#define __SEREXT_H__
+/////////////////////////////////////////////////////////////////////////////
+// Name: sergdi.cpp
+// Purpose: Serialization: GDI classes
+// Author: Guilhem Lavaux
+// Modified by:
+// Created: July 1998
+// RCS-ID: $Id$
+// Copyright: (c) 1998 Guilhem Lavaux
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
#ifdef __GNUG__
#pragma implementation "sergdi.h"
#endif
+/////////////////////////////////////////////////////////////////////////////
+// Name: sergdi.h
+// Purpose: Serialization: GDI classes
+// Author: Guilhem Lavaux
+// Modified by:
+// Created: July 1998
+// RCS-ID: $Id$
+// Copyright: (c) 1998 Guilhem Lavaux
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
#ifndef __SERGDI_H__
#define __SERGDI_H__
+/////////////////////////////////////////////////////////////////////////////
+// Name: sermain.cpp
+// Purpose: Serialization: main
+// Author: Guilhem Lavaux
+// Modified by:
+// Created: July 1998
+// RCS-ID: $Id$
+// Copyright: (c) 1998 Guilhem Lavaux
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "serbase.h"
+#endif
+
#include <wx/dynlib.h>
#include <wx/serbase.h>
// Purpose: Serialization: wxWindow classes
// Author: Guilhem Lavaux
// Modified by:
-// Created: 11/07/98
+// Created: July 1998
// RCS-ID: $Id$
-// Copyright: (c) Guilhem Lavaux
+// Copyright: (c) 1998 Guilhem Lavaux
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#include <wx/objstrm.h>
#include <wx/utils.h>
#include <wx/frame.h>
+#include <wx/panel.h>
#include <wx/serbase.h>
#include "serwnd.h"
IMPLEMENT_SERIAL_CLASS(wxIndividualLayoutConstraint, wxObject)
IMPLEMENT_SERIAL_CLASS(wxLayoutConstraints, wxObject)
IMPLEMENT_SERIAL_CLASS(wxFrame, wxWindow)
+IMPLEMENT_SERIAL_CLASS(wxPanel, wxWindow)
//IMPLEMENT_SERIAL_CLASS(wxDialog, wxWindow)
IMPLEMENT_SERIAL_CLASS(wxMenuBar, wxWindow)
IMPLEMENT_SERIAL_CLASS(wxMenuItem, wxObject)
IMPLEMENT_SERIAL_CLASS(wxMenu, wxObject)
-// IMPLEMENT_ALIAS_SERIAL_CLASS(wxPanel, wxWindow)
-
void WXSERIAL(wxWindow)::StoreObject(wxObjectOutputStream& s)
{
wxWindow *win_object = (wxWindow *)Object();
item->Check( data_s.Read8() );
item->SetSubMenu( (wxMenu *)s.GetChild(0) );
}
+
+void WXSERIAL(wxPanel)::StoreObject(wxObjectOutputStream& s)
+{
+ WXSERIAL(wxWindow)::StoreObject(s);
+}
+
+void WXSERIAL(wxPanel)::LoadObject(wxObjectInputStream& s)
+{
+ WXSERIAL(wxWindow)::LoadObject(s);
+
+ ((wxPanel *)Object())->Create(m_parent, m_id, wxPoint(m_x, m_y),
+ wxSize(m_w, m_h), m_style, m_name);
+}
// Modified by:
// Created: July 1998
// RCS-ID: $Id$
-// Copyright: (c) Guilhem Lavaux
+// Copyright: (c) 1998 Guilhem Lavaux
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
DECLARE_SERIAL_CLASS(wxIndividualLayoutConstraint, wxObject)
DECLARE_SERIAL_CLASS(wxLayoutConstraints, wxObject)
DECLARE_SERIAL_CLASS(wxFrame, wxWindow)
-//DECLARE_SERIAL_CLASS(wxPanel, wxWindow)
+DECLARE_SERIAL_CLASS(wxPanel, wxWindow)
//DECLARE_SERIAL_CLASS(wxDialog, wxWindow)
DECLARE_SERIAL_CLASS(wxMenuBar, wxWindow)
DECLARE_SERIAL_CLASS(wxMenuItem, wxObject)