add wxUSE_WEAKREF (modified partially applied patch 1870445)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-02-09 14:40:26 +00:00
parent b721db1057
commit 4732e2dca9
14 changed files with 468 additions and 303 deletions

View File

@@ -291,6 +291,14 @@
# endif
#endif /* wxUSE_VARIANT */
#ifndef wxUSE_WEAKREF
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_WEAKREF must be defined."
# else
# define wxUSE_WEAKREF 0
# endif
#endif /* wxUSE_WEAKREF */
/*
Section 1b: all these tests are for GUI only.

View File

@@ -2258,7 +2258,10 @@ protected:
// wxEvtHandler: the base class for all objects handling wxWidgets events
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject, public wxTrackable
class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject
#if wxUSE_WEAKREF
, public wxTrackable
#endif
{
public:
wxEvtHandler();
@@ -2358,7 +2361,9 @@ public:
// Avoid problems at exit by cleaning up static hash table gracefully
void ClearEventHashTable() { GetEventHashTable().Clear(); }
#if wxUSE_WEAKREF
void OnSinkDestroyed( wxEvtHandler *sink );
#endif
private:
static const wxEventTableEntry sm_eventTableEntries[];
@@ -2425,13 +2430,16 @@ protected:
virtual void DoSetClientData( void *data );
virtual void *DoGetClientData() const;
#if wxUSE_WEAKREF
// Search tracker objects for event connection with this sink
wxEventConnectionRef *FindRefInTrackerList(wxEvtHandler *eventSink);
#endif
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxEvtHandler)
};
#if wxUSE_WEAKREF
// ----------------------------------------------------------------------------
// wxEventConnectionRef represents all connections between two event handlers
// and enables automatic disconnect when an event handler sink goes out of
@@ -2480,6 +2488,7 @@ private:
DECLARE_NO_ASSIGN_CLASS(wxEventConnectionRef)
};
#endif // wxUSE_WEAKREF
// Post a message to the given eventhandler which will be processed during the
// next event loop iteration

View File

@@ -235,6 +235,16 @@
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
// in this area, Visual C compiler options "/vmm /vmg" may help then).
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEAKREF 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network

View File

@@ -234,6 +234,16 @@
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
// in this area, Visual C compiler options "/vmm /vmg" may help then).
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEAKREF 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network

View File

@@ -234,6 +234,16 @@
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
// in this area, Visual C compiler options "/vmm /vmg" may help then).
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEAKREF 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network

View File

@@ -234,6 +234,16 @@
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
// in this area, Visual C compiler options "/vmm /vmg" may help then).
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEAKREF 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network

View File

@@ -234,6 +234,16 @@
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
// in this area, Visual C compiler options "/vmm /vmg" may help then).
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEAKREF 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network

View File

@@ -234,6 +234,16 @@
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
// in this area, Visual C compiler options "/vmm /vmg" may help then).
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEAKREF 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network

View File

@@ -230,6 +230,16 @@
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
// in this area, Visual C compiler options "/vmm /vmg" may help then).
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEAKREF 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network

View File

@@ -233,6 +233,16 @@
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
// in this area, Visual C compiler options "/vmm /vmg" may help then).
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEAKREF 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network