Eliminated some warnings under Windows; wxGetHomeDir problem in wxFile;
eliminated memory leak report by making class table dynamically allocated/freed; tidied up names in wxClassInfo. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2,6 +2,17 @@
|
|||||||
wxWindows 2.0 for Windows Change Log
|
wxWindows 2.0 for Windows Change Log
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
|
Alpha 16, September 8th 1998
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
- Added wxSashWindow, wxSashLayoutWindow classes, and sashtest
|
||||||
|
sample.
|
||||||
|
- Guilhem's socket classes added, plus wxsocket sample.
|
||||||
|
- A few more makefiles added.
|
||||||
|
- GnuWin32/BC++ compatibility mods.
|
||||||
|
- Further doc updates.
|
||||||
|
- wxProp updates for correct working with wxGTK.
|
||||||
|
|
||||||
Alpha 15, August 31st 1998
|
Alpha 15, August 31st 1998
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
|
@@ -10,6 +10,10 @@
|
|||||||
#include <wx/dynarray.h>
|
#include <wx/dynarray.h>
|
||||||
#include <wx/hash.h>
|
#include <wx/hash.h>
|
||||||
|
|
||||||
|
#ifdef LoadLibrary
|
||||||
|
#undef LoadLibrary
|
||||||
|
#endif
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// wxLibrary
|
// wxLibrary
|
||||||
|
|
||||||
|
@@ -8,14 +8,26 @@
|
|||||||
// Copyright: (c) Guilhem Lavaux
|
// Copyright: (c) Guilhem Lavaux
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_WXFSTREAM_H__
|
#ifndef _WX_WXFSTREAM_H__
|
||||||
#define _WX_WXFSTREAM_H__
|
#define _WX_WXFSTREAM_H__
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface "fstream.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <wx/object.h>
|
#include <wx/object.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/stream.h>
|
#include <wx/stream.h>
|
||||||
#include <wx/file.h>
|
#include <wx/file.h>
|
||||||
|
|
||||||
|
// Disable warnings such as
|
||||||
|
// 'wxFileStream' : inherits 'wxFileInputStream::Peek' via dominance
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4250)
|
||||||
|
#endif
|
||||||
|
|
||||||
class wxFileStreamBase {
|
class wxFileStreamBase {
|
||||||
protected:
|
protected:
|
||||||
wxFile *m_file;
|
wxFile *m_file;
|
||||||
@@ -69,4 +81,8 @@ class wxFileStream: public wxStream,
|
|||||||
virtual ~wxFileStream();
|
virtual ~wxFileStream();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default:4250)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -45,38 +45,48 @@ typedef wxObject * (*wxObjectConstructorFn) (void);
|
|||||||
class WXDLLEXPORT wxClassInfo
|
class WXDLLEXPORT wxClassInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char *className;
|
|
||||||
char *baseClassName1;
|
|
||||||
char *baseClassName2;
|
|
||||||
int objectSize;
|
|
||||||
wxObjectConstructorFn objectConstructor;
|
|
||||||
|
|
||||||
// Pointers to base wxClassInfos: set in InitializeClasses
|
|
||||||
// called from wx_main.cc
|
|
||||||
wxClassInfo *baseInfo1;
|
|
||||||
wxClassInfo *baseInfo2;
|
|
||||||
|
|
||||||
static wxClassInfo *first;
|
|
||||||
wxClassInfo *next;
|
|
||||||
|
|
||||||
static wxHashTable classTable;
|
|
||||||
|
|
||||||
wxClassInfo(char *cName, char *baseName1, char *baseName2, int sz, wxObjectConstructorFn fn);
|
wxClassInfo(char *cName, char *baseName1, char *baseName2, int sz, wxObjectConstructorFn fn);
|
||||||
|
|
||||||
wxObject *CreateObject(void);
|
wxObject *CreateObject(void);
|
||||||
|
|
||||||
inline char *GetClassName(void) const { return className; }
|
inline char *GetClassName(void) const { return m_className; }
|
||||||
inline char *GetBaseClassName1(void) const { return baseClassName1; }
|
inline char *GetBaseClassName1(void) const { return m_baseClassName1; }
|
||||||
inline char *GetBaseClassName2(void) const { return baseClassName2; }
|
inline char *GetBaseClassName2(void) const { return m_baseClassName2; }
|
||||||
inline int GetSize(void) const { return objectSize; }
|
inline wxClassInfo* GetBaseClass1() const { return m_baseInfo1; }
|
||||||
|
inline wxClassInfo* GetBaseClass2() const { return m_baseInfo2; }
|
||||||
|
inline int GetSize(void) const { return m_objectSize; }
|
||||||
|
inline wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; }
|
||||||
|
inline wxClassInfo* GetFirst() const { return sm_first; }
|
||||||
|
inline wxClassInfo* GetNext() const { return m_next; }
|
||||||
bool IsKindOf(wxClassInfo *info);
|
bool IsKindOf(wxClassInfo *info);
|
||||||
|
|
||||||
static wxClassInfo *FindClass(char *c);
|
static wxClassInfo *FindClass(char *c);
|
||||||
// Initializes parent pointers for fast searching.
|
|
||||||
|
// Initializes parent pointers and hash table for fast searching.
|
||||||
static void InitializeClasses(void);
|
static void InitializeClasses(void);
|
||||||
|
|
||||||
|
// Cleans up hash table used for fast searching.
|
||||||
|
static void CleanUpClasses(void);
|
||||||
|
|
||||||
|
public:
|
||||||
|
char* m_className;
|
||||||
|
char* m_baseClassName1;
|
||||||
|
char* m_baseClassName2;
|
||||||
|
int m_objectSize;
|
||||||
|
wxObjectConstructorFn m_objectConstructor;
|
||||||
|
|
||||||
|
// Pointers to base wxClassInfos: set in InitializeClasses
|
||||||
|
// called from wx_main.cc
|
||||||
|
wxClassInfo* m_baseInfo1;
|
||||||
|
wxClassInfo* m_baseInfo2;
|
||||||
|
|
||||||
|
static wxClassInfo* sm_first;
|
||||||
|
wxClassInfo* m_next;
|
||||||
|
|
||||||
|
static wxHashTable* sm_classTable;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxObject* WXDLLEXPORT wxCreateDynamicObject(char *name);
|
wxObject* WXDLLEXPORT wxCreateDynamicObject(const char *name);
|
||||||
|
|
||||||
#ifdef USE_SERIAL
|
#ifdef USE_SERIAL
|
||||||
wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
|
wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
|
||||||
@@ -84,9 +94,9 @@ wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
|
|||||||
|
|
||||||
#define DECLARE_DYNAMIC_CLASS(name) \
|
#define DECLARE_DYNAMIC_CLASS(name) \
|
||||||
public:\
|
public:\
|
||||||
static wxClassInfo class##name;\
|
static wxClassInfo sm_class##name;\
|
||||||
wxClassInfo *GetClassInfo() \
|
wxClassInfo *GetClassInfo() \
|
||||||
{ return &name::class##name; }
|
{ return &name::sm_class##name; }
|
||||||
|
|
||||||
#define DECLARE_ABSTRACT_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
|
#define DECLARE_ABSTRACT_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
|
||||||
#define DECLARE_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
|
#define DECLARE_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
|
||||||
@@ -99,13 +109,13 @@ wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
|
|||||||
#define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
|
#define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
|
||||||
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
||||||
{ return new name; }\
|
{ return new name; }\
|
||||||
wxClassInfo name::class##name((char *) #name, (char *) #basename, (char *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
|
wxClassInfo name::sm_class##name((char *) #name, (char *) #basename, (char *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
|
||||||
|
|
||||||
// Multiple inheritance with two base classes
|
// Multiple inheritance with two base classes
|
||||||
#define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \
|
#define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \
|
||||||
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
||||||
{ return new name; }\
|
{ return new name; }\
|
||||||
wxClassInfo name::class##name((char *) #name, (char *) #basename1, (char *) #basename2, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
|
wxClassInfo name::sm_class##name((char *) #name, (char *) #basename1, (char *) #basename2, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
|
||||||
|
|
||||||
//////
|
//////
|
||||||
////// for abstract classes
|
////// for abstract classes
|
||||||
@@ -113,17 +123,17 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
|||||||
|
|
||||||
// Single inheritance with one base class
|
// Single inheritance with one base class
|
||||||
#define IMPLEMENT_ABSTRACT_CLASS(name, basename) \
|
#define IMPLEMENT_ABSTRACT_CLASS(name, basename) \
|
||||||
wxClassInfo name::class##name((char *) #name, (char *) #basename, \
|
wxClassInfo name::sm_class##name((char *) #name, (char *) #basename, \
|
||||||
(char *) NULL, (int) sizeof(name), (wxObjectConstructorFn) NULL);
|
(char *) NULL, (int) sizeof(name), (wxObjectConstructorFn) NULL);
|
||||||
|
|
||||||
// Multiple inheritance with two base classes
|
// Multiple inheritance with two base classes
|
||||||
#define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
|
#define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
|
||||||
wxClassInfo name::class##name((char *) #name, (char *) #basename1, (char *) #basename2, (int) sizeof(name), (wxObjectConstructorFn) NULL);
|
wxClassInfo name::sm_class##name((char *) #name, (char *) #basename1, (char *) #basename2, (int) sizeof(name), (wxObjectConstructorFn) NULL);
|
||||||
|
|
||||||
#define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
|
#define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
|
||||||
#define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2
|
#define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2
|
||||||
|
|
||||||
#define CLASSINFO(name) (&name::class##name)
|
#define CLASSINFO(name) (&name::sm_class##name)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -140,7 +150,7 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IS_KIND_OF(obj, className) obj->IsKindOf(&className::class##className)
|
#define IS_KIND_OF(obj, className) obj->IsKindOf(&className::sm_class##className)
|
||||||
|
|
||||||
// Unfortunately Borland seems to need this include.
|
// Unfortunately Borland seems to need this include.
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
@@ -158,12 +168,12 @@ class WXDLLEXPORT wxObject
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
// This is equivalent to using the macro DECLARE_ABSTRACT_CLASS
|
// This is equivalent to using the macro DECLARE_ABSTRACT_CLASS
|
||||||
static wxClassInfo classwxObject;
|
static wxClassInfo sm_classwxObject;
|
||||||
|
|
||||||
wxObject(void);
|
wxObject(void);
|
||||||
virtual ~wxObject(void);
|
virtual ~wxObject(void);
|
||||||
|
|
||||||
virtual wxClassInfo *GetClassInfo(void) { return &classwxObject; }
|
virtual wxClassInfo *GetClassInfo(void) { return &sm_classwxObject; }
|
||||||
|
|
||||||
bool IsKindOf(wxClassInfo *info);
|
bool IsKindOf(wxClassInfo *info);
|
||||||
|
|
||||||
@@ -198,9 +208,9 @@ class WXDLLEXPORT wxObject
|
|||||||
inline void SetRefData(wxObjectRefData *data) { m_refData = data; }
|
inline void SetRefData(wxObjectRefData *data) { m_refData = data; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxObjectRefData *m_refData;
|
wxObjectRefData* m_refData;
|
||||||
#ifdef USE_SERIAL
|
#ifdef USE_SERIAL
|
||||||
wxObject_Serialize *m_serialObj;
|
wxObject_Serialize* m_serialObj;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -8,11 +8,12 @@
|
|||||||
// Copyright: (c) Guilhem Lavaux
|
// Copyright: (c) Guilhem Lavaux
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_NETWORK_SOCKET_H
|
#ifndef _WX_NETWORK_SOCKET_H
|
||||||
#define _WX_NETWORK_SOCKET_H
|
#define _WX_NETWORK_SOCKET_H
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "socket.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@@ -29,6 +29,13 @@ typedef wxOutputStream& (*__wxOutputManip)(wxOutputStream&);
|
|||||||
|
|
||||||
wxOutputStream& WXDLLEXPORT wxEndL(wxOutputStream& o_stream);
|
wxOutputStream& WXDLLEXPORT wxEndL(wxOutputStream& o_stream);
|
||||||
|
|
||||||
|
// Disable warnings such as
|
||||||
|
// 'wxFilterStream' : inherits 'wxFilterInputStream::Peek' via dominance
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4250)
|
||||||
|
#endif
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Stream buffer
|
// Stream buffer
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -244,4 +251,8 @@ class WXDLLEXPORT wxFilterStream: public wxStream,
|
|||||||
wxFilterStream();
|
wxFilterStream();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default:4250)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -13,6 +13,15 @@
|
|||||||
#pragma implementation "dynlib.h"
|
#pragma implementation "dynlib.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif //__BORLANDC__
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#endif //WX_PRECOMP
|
||||||
|
|
||||||
#include <wx/dynlib.h>
|
#include <wx/dynlib.h>
|
||||||
#include <wx/filefn.h>
|
#include <wx/filefn.h>
|
||||||
#include <wx/list.h>
|
#include <wx/list.h>
|
||||||
@@ -87,9 +96,9 @@ void wxLibrary::PrepareClasses(wxClassInfo **first)
|
|||||||
wxClassInfo *info = *first;
|
wxClassInfo *info = *first;
|
||||||
while (info)
|
while (info)
|
||||||
{
|
{
|
||||||
if (info->className)
|
if (info->m_className)
|
||||||
classTable.Put(info->className, (wxObject *)info);
|
classTable.Put(info->m_className, (wxObject *)info);
|
||||||
info = info->next;
|
info = info->m_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set base pointers for each wxClassInfo
|
// Set base pointers for each wxClassInfo
|
||||||
@@ -97,10 +106,10 @@ void wxLibrary::PrepareClasses(wxClassInfo **first)
|
|||||||
while (info)
|
while (info)
|
||||||
{
|
{
|
||||||
if (info->GetBaseClassName1())
|
if (info->GetBaseClassName1())
|
||||||
info->baseInfo1 = (wxClassInfo *)classTable.Get(info->GetBaseClassName1());
|
info->m_baseInfo1 = (wxClassInfo *)classTable.Get(info->GetBaseClassName1());
|
||||||
if (info->GetBaseClassName2())
|
if (info->GetBaseClassName2())
|
||||||
info->baseInfo2 = (wxClassInfo *)classTable.Get(info->GetBaseClassName2());
|
info->m_baseInfo2 = (wxClassInfo *)classTable.Get(info->GetBaseClassName2());
|
||||||
info = info->next;
|
info = info->m_next;
|
||||||
}
|
}
|
||||||
*first = NULL;
|
*first = NULL;
|
||||||
}
|
}
|
||||||
@@ -111,7 +120,7 @@ void *wxLibrary::GetSymbol(const wxString& symbname)
|
|||||||
return dlsym(m_handle, WXSTRINGCAST symbname);
|
return dlsym(m_handle, WXSTRINGCAST symbname);
|
||||||
#endif
|
#endif
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
return GetProcAddress(m_handle, WXSTRINGCAST symbname);
|
return GetProcAddress((HINSTANCE) m_handle, WXSTRINGCAST symbname);
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -84,14 +84,14 @@ void ConvertToIeeeExtended(double num, unsigned char *bytes)
|
|||||||
|
|
||||||
bytes[0] = expon >> 8;
|
bytes[0] = expon >> 8;
|
||||||
bytes[1] = expon;
|
bytes[1] = expon;
|
||||||
bytes[2] = hiMant >> 24;
|
bytes[2] = (unsigned char) hiMant >> 24;
|
||||||
bytes[3] = hiMant >> 16;
|
bytes[3] = (unsigned char) hiMant >> 16;
|
||||||
bytes[4] = hiMant >> 8;
|
bytes[4] = (unsigned char) hiMant >> 8;
|
||||||
bytes[5] = hiMant;
|
bytes[5] = (unsigned char) hiMant;
|
||||||
bytes[6] = loMant >> 24;
|
bytes[6] = (unsigned char) loMant >> 24;
|
||||||
bytes[7] = loMant >> 16;
|
bytes[7] = (unsigned char) loMant >> 16;
|
||||||
bytes[8] = loMant >> 8;
|
bytes[8] = (unsigned char) loMant >> 8;
|
||||||
bytes[9] = loMant;
|
bytes[9] = (unsigned char) loMant;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -788,8 +788,8 @@ bool wxDebugContext::PrintClasses(void)
|
|||||||
wxNode *node;
|
wxNode *node;
|
||||||
wxClassInfo *info;
|
wxClassInfo *info;
|
||||||
|
|
||||||
wxClassInfo::classTable.BeginFind();
|
wxClassInfo::sm_classTable->BeginFind();
|
||||||
node = wxClassInfo::classTable.Next();
|
node = wxClassInfo::sm_classTable->Next();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
info = (wxClassInfo *)node->Data();
|
info = (wxClassInfo *)node->Data();
|
||||||
@@ -801,7 +801,7 @@ bool wxDebugContext::PrintClasses(void)
|
|||||||
wxTrace("is a %s", info->GetBaseClassName1());
|
wxTrace("is a %s", info->GetBaseClassName1());
|
||||||
else if (info->GetBaseClassName1() && info->GetBaseClassName2())
|
else if (info->GetBaseClassName1() && info->GetBaseClassName2())
|
||||||
wxTrace("is a %s, %s", info->GetBaseClassName1(), info->GetBaseClassName2());
|
wxTrace("is a %s, %s", info->GetBaseClassName1(), info->GetBaseClassName2());
|
||||||
if (info->objectConstructor)
|
if (info->GetConstructor())
|
||||||
wxTrace(": dynamic\n");
|
wxTrace(": dynamic\n");
|
||||||
else
|
else
|
||||||
wxTrace("\n");
|
wxTrace("\n");
|
||||||
|
@@ -39,18 +39,18 @@ bool wxModule::RegisterModules(void)
|
|||||||
wxNode *node;
|
wxNode *node;
|
||||||
wxClassInfo* classInfo;
|
wxClassInfo* classInfo;
|
||||||
|
|
||||||
wxClassInfo::classTable.BeginFind();
|
wxClassInfo::sm_classTable->BeginFind();
|
||||||
node = wxClassInfo::classTable.Next();
|
node = wxClassInfo::sm_classTable->Next();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
classInfo = (wxClassInfo *)node->Data();
|
classInfo = (wxClassInfo *)node->Data();
|
||||||
if ((classInfo != (& (wxModule::classwxModule))) &&
|
if ((classInfo != (& (wxModule::sm_classwxModule))) &&
|
||||||
classInfo->IsKindOf(CLASSINFO(wxModule)))
|
classInfo->IsKindOf(CLASSINFO(wxModule)))
|
||||||
{
|
{
|
||||||
wxModule* module = (wxModule*) classInfo->CreateObject();
|
wxModule* module = (wxModule*) classInfo->CreateObject();
|
||||||
RegisterModule(module);
|
RegisterModule(module);
|
||||||
}
|
}
|
||||||
node = wxClassInfo::classTable.Next();
|
node = wxClassInfo::sm_classTable->Next();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -41,9 +41,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
wxClassInfo wxObject::classwxObject((char *) "wxObject", (char *) NULL, (char *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
|
wxClassInfo wxObject::sm_classwxObject((char *) "wxObject", (char *) NULL, (char *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
|
||||||
wxClassInfo *wxClassInfo::first = (wxClassInfo *) NULL;
|
wxClassInfo* wxClassInfo::sm_first = (wxClassInfo *) NULL;
|
||||||
wxHashTable wxClassInfo::classTable(wxKEY_STRING);
|
wxHashTable* wxClassInfo::sm_classTable = (wxHashTable*) NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -130,36 +130,36 @@ void wxObject::operator delete[] (void * buf)
|
|||||||
|
|
||||||
wxClassInfo::wxClassInfo(char *cName, char *baseName1, char *baseName2, int sz, wxObjectConstructorFn constr)
|
wxClassInfo::wxClassInfo(char *cName, char *baseName1, char *baseName2, int sz, wxObjectConstructorFn constr)
|
||||||
{
|
{
|
||||||
className = cName;
|
m_className = cName;
|
||||||
baseClassName1 = baseName1;
|
m_baseClassName1 = baseName1;
|
||||||
baseClassName2 = baseName2;
|
m_baseClassName2 = baseName2;
|
||||||
|
|
||||||
objectSize = sz;
|
m_objectSize = sz;
|
||||||
objectConstructor = constr;
|
m_objectConstructor = constr;
|
||||||
|
|
||||||
next = first;
|
m_next = sm_first;
|
||||||
first = this;
|
sm_first = this;
|
||||||
|
|
||||||
baseInfo1 = (wxClassInfo *) NULL;
|
m_baseInfo1 = (wxClassInfo *) NULL;
|
||||||
baseInfo2 = (wxClassInfo *) NULL;
|
m_baseInfo2 = (wxClassInfo *) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObject *wxClassInfo::CreateObject(void)
|
wxObject *wxClassInfo::CreateObject(void)
|
||||||
{
|
{
|
||||||
if (objectConstructor)
|
if (m_objectConstructor)
|
||||||
return (wxObject *)(*objectConstructor)();
|
return (wxObject *)(*m_objectConstructor)();
|
||||||
else
|
else
|
||||||
return (wxObject *) NULL;
|
return (wxObject *) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxClassInfo *wxClassInfo::FindClass(char *c)
|
wxClassInfo *wxClassInfo::FindClass(char *c)
|
||||||
{
|
{
|
||||||
wxClassInfo *p = first;
|
wxClassInfo *p = sm_first;
|
||||||
while (p)
|
while (p)
|
||||||
{
|
{
|
||||||
if (p && p->GetClassName() && strcmp(p->GetClassName(), c) == 0)
|
if (p && p->GetClassName() && strcmp(p->GetClassName(), c) == 0)
|
||||||
return p;
|
return p;
|
||||||
p = p->next;
|
p = p->m_next;
|
||||||
}
|
}
|
||||||
return (wxClassInfo *) NULL;
|
return (wxClassInfo *) NULL;
|
||||||
}
|
}
|
||||||
@@ -174,20 +174,22 @@ bool wxClassInfo::IsKindOf(wxClassInfo *info)
|
|||||||
// For some reason, when making/using a DLL, static data has to be included
|
// For some reason, when making/using a DLL, static data has to be included
|
||||||
// in both the DLL and the application. This can lead to duplicate
|
// in both the DLL and the application. This can lead to duplicate
|
||||||
// wxClassInfo objects, so we have to test the name instead of the pointers.
|
// wxClassInfo objects, so we have to test the name instead of the pointers.
|
||||||
|
// PROBABLY NO LONGER TRUE now I've done DLL creation right.
|
||||||
|
/*
|
||||||
#if WXMAKINGDLL
|
#if WXMAKINGDLL
|
||||||
if (GetClassName() && info->GetClassName() && (strcmp(GetClassName(), info->GetClassName()) == 0))
|
if (GetClassName() && info->GetClassName() && (strcmp(GetClassName(), info->GetClassName()) == 0))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
#else
|
||||||
|
*/
|
||||||
if (this == info)
|
if (this == info)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (baseInfo1)
|
if (m_baseInfo1)
|
||||||
if (baseInfo1->IsKindOf(info))
|
if (m_baseInfo1->IsKindOf(info))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (baseInfo2)
|
if (m_baseInfo2)
|
||||||
return baseInfo2->IsKindOf(info);
|
return m_baseInfo2->IsKindOf(info);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -195,37 +197,58 @@ bool wxClassInfo::IsKindOf(wxClassInfo *info)
|
|||||||
// Set pointers to base class(es) to speed up IsKindOf
|
// Set pointers to base class(es) to speed up IsKindOf
|
||||||
void wxClassInfo::InitializeClasses(void)
|
void wxClassInfo::InitializeClasses(void)
|
||||||
{
|
{
|
||||||
|
wxClassInfo::sm_classTable = new wxHashTable(wxKEY_STRING);
|
||||||
|
|
||||||
// Index all class infos by their class name
|
// Index all class infos by their class name
|
||||||
wxClassInfo *info = first;
|
wxClassInfo *info = sm_first;
|
||||||
while (info)
|
while (info)
|
||||||
{
|
{
|
||||||
if (info->className)
|
if (info->m_className)
|
||||||
classTable.Put(info->className, (wxObject *)info);
|
sm_classTable->Put(info->m_className, (wxObject *)info);
|
||||||
info = info->next;
|
info = info->m_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set base pointers for each wxClassInfo
|
// Set base pointers for each wxClassInfo
|
||||||
info = first;
|
info = sm_first;
|
||||||
while (info)
|
while (info)
|
||||||
{
|
{
|
||||||
if (info->GetBaseClassName1())
|
if (info->GetBaseClassName1())
|
||||||
info->baseInfo1 = (wxClassInfo *)classTable.Get(info->GetBaseClassName1());
|
info->m_baseInfo1 = (wxClassInfo *)sm_classTable->Get(info->GetBaseClassName1());
|
||||||
if (info->GetBaseClassName2())
|
if (info->GetBaseClassName2())
|
||||||
info->baseInfo2 = (wxClassInfo *)classTable.Get(info->GetBaseClassName2());
|
info->m_baseInfo2 = (wxClassInfo *)sm_classTable->Get(info->GetBaseClassName2());
|
||||||
info = info->next;
|
info = info->m_next;
|
||||||
}
|
}
|
||||||
first = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObject *wxCreateDynamicObject(char *name)
|
// Clean up hash table
|
||||||
|
void wxClassInfo::CleanUpClasses(void)
|
||||||
{
|
{
|
||||||
wxClassInfo *info;
|
delete wxClassInfo::sm_classTable;
|
||||||
|
wxClassInfo::sm_classTable = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
info = (wxClassInfo *)wxClassInfo::classTable.Get(name);
|
wxObject *wxCreateDynamicObject(const char *name)
|
||||||
if (!info)
|
{
|
||||||
return (wxObject *)NULL;
|
if (wxClassInfo::sm_classTable)
|
||||||
|
{
|
||||||
|
wxClassInfo *info = (wxClassInfo *)wxClassInfo::sm_classTable->Get(name);
|
||||||
|
if (!info)
|
||||||
|
return (wxObject *)NULL;
|
||||||
|
|
||||||
return info->CreateObject();
|
return info->CreateObject();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxClassInfo *info = wxClassInfo::sm_first;
|
||||||
|
while (info)
|
||||||
|
{
|
||||||
|
if (info->m_className && strcmp(info->m_className, name) == 0)
|
||||||
|
return info->CreateObject();
|
||||||
|
info = info->m_next;
|
||||||
|
}
|
||||||
|
return (wxObject*) NULL;
|
||||||
|
}
|
||||||
|
return (wxObject*) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_SERIAL
|
#ifdef USE_SERIAL
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "socket.h"
|
#pragma implementation "socket.h"
|
||||||
#pragma interface
|
// #pragma interface
|
||||||
#pragma implementation "socket.cpp"
|
// #pragma implementation "socket.cpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
@@ -92,6 +92,9 @@
|
|||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
#define close closesocket
|
#define close closesocket
|
||||||
#define ioctl ioctlsocket
|
#define ioctl ioctlsocket
|
||||||
|
#ifdef errno
|
||||||
|
#undef errno
|
||||||
|
#endif
|
||||||
#define errno WSAGetLastError()
|
#define errno WSAGetLastError()
|
||||||
#ifdef EWOULDBLOCK
|
#ifdef EWOULDBLOCK
|
||||||
#undef EWOULDBLOCK
|
#undef EWOULDBLOCK
|
||||||
@@ -369,26 +372,26 @@ wxSocketBase& wxSocketBase::WriteMsg(const char *buffer, size_t nbytes)
|
|||||||
{
|
{
|
||||||
SockMsg msg;
|
SockMsg msg;
|
||||||
|
|
||||||
msg.sig[0] = 0xad;
|
msg.sig[0] = (char) 0xad;
|
||||||
msg.sig[1] = 0xde;
|
msg.sig[1] = (char) 0xde;
|
||||||
msg.sig[2] = 0xed;
|
msg.sig[2] = (char) 0xed;
|
||||||
msg.sig[3] = 0xfe;
|
msg.sig[3] = (char) 0xfe;
|
||||||
|
|
||||||
msg.len[0] = nbytes & 0xff;
|
msg.len[0] = (char) nbytes & 0xff;
|
||||||
msg.len[1] = (nbytes >> 8) & 0xff;
|
msg.len[1] = (char) (nbytes >> 8) & 0xff;
|
||||||
msg.len[2] = (nbytes >> 16) & 0xff;
|
msg.len[2] = (char) (nbytes >> 16) & 0xff;
|
||||||
msg.len[3] = (nbytes >> 24) & 0xff;
|
msg.len[3] = (char) (nbytes >> 24) & 0xff;
|
||||||
|
|
||||||
if (Write((char *)&msg, sizeof(msg)).LastCount() < sizeof(msg))
|
if (Write((char *)&msg, sizeof(msg)).LastCount() < sizeof(msg))
|
||||||
return *this;
|
return *this;
|
||||||
if (Write(buffer, nbytes).LastCount() < nbytes)
|
if (Write(buffer, nbytes).LastCount() < nbytes)
|
||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
msg.sig[0] = 0xed;
|
msg.sig[0] = (char) 0xed;
|
||||||
msg.sig[1] = 0xfe;
|
msg.sig[1] = (char) 0xfe;
|
||||||
msg.sig[2] = 0xad;
|
msg.sig[2] = (char) 0xad;
|
||||||
msg.sig[3] = 0xde;
|
msg.sig[3] = (char) 0xde;
|
||||||
msg.len[0] = msg.len[1] = msg.len[2] = msg.len[3] = 0;
|
msg.len[0] = msg.len[1] = msg.len[2] = msg.len[3] = (char) 0;
|
||||||
Write((char *)&msg, sizeof(msg));
|
Write((char *)&msg, sizeof(msg));
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
@@ -415,7 +418,7 @@ bool wxSocketBase::IsData() const
|
|||||||
FD_ZERO(&sock_set);
|
FD_ZERO(&sock_set);
|
||||||
FD_SET(m_fd, &sock_set);
|
FD_SET(m_fd, &sock_set);
|
||||||
select(FD_SETSIZE, &sock_set, NULL, NULL, &tv);
|
select(FD_SETSIZE, &sock_set, NULL, NULL, &tv);
|
||||||
return FD_ISSET(m_fd, &sock_set);
|
return (FD_ISSET(m_fd, &sock_set) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
@@ -348,7 +348,7 @@ wxInputStream& wxInputStream::operator>>(float& f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (c == '.') {
|
if (c == '.') {
|
||||||
float f_multiplicator = 0.1;
|
float f_multiplicator = (float) 0.1;
|
||||||
c = GetC();
|
c = GetC();
|
||||||
|
|
||||||
while (isdigit(c)) {
|
while (isdigit(c)) {
|
||||||
|
@@ -293,6 +293,8 @@ void wxApp::CommonCleanUp(void)
|
|||||||
wxCleanUpResourceSystem();
|
wxCleanUpResourceSystem();
|
||||||
|
|
||||||
wxSystemSettings::Done();
|
wxSystemSettings::Done();
|
||||||
|
|
||||||
|
wxClassInfo::CleanUpClasses();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLog *wxApp::CreateLogTarget()
|
wxLog *wxApp::CreateLogTarget()
|
||||||
|
@@ -293,6 +293,8 @@ void wxApp::CommonCleanUp(void)
|
|||||||
wxCleanUpResourceSystem();
|
wxCleanUpResourceSystem();
|
||||||
|
|
||||||
wxSystemSettings::Done();
|
wxSystemSettings::Done();
|
||||||
|
|
||||||
|
wxClassInfo::CleanUpClasses();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLog *wxApp::CreateLogTarget()
|
wxLog *wxApp::CreateLogTarget()
|
||||||
|
@@ -337,6 +337,8 @@ void wxApp::CleanUp()
|
|||||||
if (wxWinHandleList)
|
if (wxWinHandleList)
|
||||||
delete wxWinHandleList ;
|
delete wxWinHandleList ;
|
||||||
|
|
||||||
|
wxClassInfo::CleanUpClasses();
|
||||||
|
|
||||||
// do it as the very last thing because everything else can log messages
|
// do it as the very last thing because everything else can log messages
|
||||||
wxLog::DontCreateOnDemand();
|
wxLog::DontCreateOnDemand();
|
||||||
delete wxLog::SetActiveTarget(NULL);
|
delete wxLog::SetActiveTarget(NULL);
|
||||||
|
@@ -81,6 +81,7 @@ COMMONOBJS = \
|
|||||||
$(COMMDIR)\docview.obj \
|
$(COMMDIR)\docview.obj \
|
||||||
$(COMMDIR)\docmdi.obj \
|
$(COMMDIR)\docmdi.obj \
|
||||||
$(COMMDIR)\dynarray.obj \
|
$(COMMDIR)\dynarray.obj \
|
||||||
|
$(COMMDIR)\dynlib.obj \
|
||||||
$(COMMDIR)\event.obj \
|
$(COMMDIR)\event.obj \
|
||||||
$(COMMDIR)\file.obj \
|
$(COMMDIR)\file.obj \
|
||||||
$(COMMDIR)\filefn.obj \
|
$(COMMDIR)\filefn.obj \
|
||||||
@@ -770,6 +771,11 @@ $(COMMDIR)/dynarray.obj: $*.$(SRCSUFF)
|
|||||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||||
<<
|
<<
|
||||||
|
|
||||||
|
$(COMMDIR)/dynlib.obj: $*.$(SRCSUFF)
|
||||||
|
cl @<<
|
||||||
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||||
|
<<
|
||||||
|
|
||||||
$(COMMDIR)/event.obj: $*.$(SRCSUFF)
|
$(COMMDIR)/event.obj: $*.$(SRCSUFF)
|
||||||
cl @<<
|
cl @<<
|
||||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||||
|
@@ -34,9 +34,9 @@ wxDirInfo::wxDirInfo( const wxString &path )
|
|||||||
{
|
{
|
||||||
m_name = "My Home";
|
m_name = "My Home";
|
||||||
m_path += "/";
|
m_path += "/";
|
||||||
char buf[300];
|
wxString str;
|
||||||
wxGetHomeDir( buf );
|
wxGetHomeDir( & str );
|
||||||
m_path = buf;
|
m_path = str;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (m_path == "/proc") m_name = "Info Filesystem";
|
if (m_path == "/proc") m_name = "Info Filesystem";
|
||||||
|
@@ -156,9 +156,9 @@ MyFrame::MyFrame(void) :
|
|||||||
m_dir = new wxDirCtrl( m_splitter, ID_DIRCTRL, "/", wxPoint(10,45), wxSize(200,330) );
|
m_dir = new wxDirCtrl( m_splitter, ID_DIRCTRL, "/", wxPoint(10,45), wxSize(200,330) );
|
||||||
|
|
||||||
wxString homepath( "/home" );
|
wxString homepath( "/home" );
|
||||||
char buf[300];
|
wxString str;
|
||||||
wxGetHomeDir( buf );
|
wxGetHomeDir( & str );
|
||||||
homepath = buf;
|
homepath = str;
|
||||||
m_rightFile = new wxFileCtrl( m_splitter, ID_FILECTRL, homepath, wxPoint(220,5), wxSize(200,330) );
|
m_rightFile = new wxFileCtrl( m_splitter, ID_FILECTRL, homepath, wxPoint(220,5), wxSize(200,330) );
|
||||||
|
|
||||||
m_leftFile = new wxFileCtrl( m_splitter, ID_FILECTRL, homepath, wxPoint(0,5), wxSize(200,330) );
|
m_leftFile = new wxFileCtrl( m_splitter, ID_FILECTRL, homepath, wxPoint(0,5), wxSize(200,330) );
|
||||||
|
Reference in New Issue
Block a user