]> git.saurik.com Git - wxWidgets.git/blob - include/wx/object.h
2f5ffd3b5e97e50b1bff8731673c072d5778374b
[wxWidgets.git] / include / wx / object.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/object.h
3 // Purpose: wxObject class, plus run-time type information macros
4 // Author: Julian Smart
5 // Modified by: Ron Lee
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) 1997 Julian Smart
9 // (c) 2001 Ron Lee <ron@debian.org>
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_OBJECTH__
14 #define _WX_OBJECTH__
15
16 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
17 #pragma interface "object.h"
18 #endif
19
20 // ----------------------------------------------------------------------------
21 // headers
22 // ----------------------------------------------------------------------------
23
24 #include "wx/defs.h"
25 #include "wx/memory.h"
26
27 class WXDLLIMPEXP_BASE wxObject;
28
29 #if wxUSE_DYNAMIC_CLASSES
30
31 #ifndef wxUSE_EXTENDED_RTTI
32 #define wxUSE_EXTENDED_RTTI 0
33 #endif
34
35 #if wxUSE_EXTENDED_RTTI
36 #include "wx/xti.h"
37 #else
38
39 // ----------------------------------------------------------------------------
40 // conditional compilation
41 // ----------------------------------------------------------------------------
42
43 // this shouldn't be needed any longer as <wx/msw/private.h> does it but it
44 // doesn't hurt neither
45 #ifdef GetClassName
46 #undef GetClassName
47 #endif
48 #ifdef GetClassInfo
49 #undef GetClassInfo
50 #endif
51
52 class WXDLLIMPEXP_BASE wxClassInfo;
53 class WXDLLIMPEXP_BASE wxHashTable;
54 class WXDLLIMPEXP_BASE wxObjectRefData;
55
56 // ----------------------------------------------------------------------------
57 // wxClassInfo
58 // ----------------------------------------------------------------------------
59
60 typedef wxObject *(*wxObjectConstructorFn)(void);
61
62 class WXDLLIMPEXP_BASE wxClassInfo
63 {
64 public:
65 wxClassInfo( const wxChar *className,
66 const wxClassInfo *baseInfo1,
67 const wxClassInfo *baseInfo2,
68 int size,
69 wxObjectConstructorFn ctor )
70 : m_className(className)
71 , m_objectSize(size)
72 , m_objectConstructor(ctor)
73 , m_baseInfo1(baseInfo1)
74 , m_baseInfo2(baseInfo2)
75 , m_next(sm_first)
76 {
77 sm_first = this;
78 Register();
79 }
80
81 ~wxClassInfo();
82
83 wxObject *CreateObject() { return m_objectConstructor ? (*m_objectConstructor)() : 0; }
84
85 const wxChar *GetClassName() const { return m_className; }
86 const wxChar *GetBaseClassName1() const { return m_baseInfo1->GetClassName(); }
87 const wxChar *GetBaseClassName2() const { return m_baseInfo2->GetClassName(); }
88 const wxClassInfo *GetBaseClass1() const { return m_baseInfo1; }
89 const wxClassInfo *GetBaseClass2() const { return m_baseInfo2; }
90 int GetSize() const { return m_objectSize; }
91
92 wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; }
93 static const wxClassInfo *GetFirst() { return sm_first; }
94 const wxClassInfo *GetNext() const { return m_next; }
95 static wxClassInfo *FindClass(const wxChar *className);
96
97 // Climb upwards through inheritance hierarchy.
98 // Dual inheritance is catered for.
99
100 bool IsKindOf(const wxClassInfo *info) const
101 {
102 return info != 0 &&
103 ( info == this ||
104 ( m_baseInfo1 && m_baseInfo1->IsKindOf(info) ) ||
105 ( m_baseInfo2 && m_baseInfo2->IsKindOf(info) ) );
106 }
107
108 #ifdef WXWIN_COMPATIBILITY_2_4
109 // Initializes parent pointers and hash table for fast searching.
110 wxDEPRECATED( static void InitializeClasses() );
111 // Cleans up hash table used for fast searching.
112 wxDEPRECATED( static void CleanUpClasses() );
113 #endif
114 static void CleanUp();
115
116 public:
117 const wxChar *m_className;
118 int m_objectSize;
119 wxObjectConstructorFn m_objectConstructor;
120
121 // Pointers to base wxClassInfos: set in InitializeClasses
122
123 const wxClassInfo *m_baseInfo1;
124 const wxClassInfo *m_baseInfo2;
125
126 // class info object live in a linked list:
127 // pointers to its head and the next element in it
128
129 static wxClassInfo *sm_first;
130 wxClassInfo *m_next;
131
132 // FIXME: this should be private (currently used directly by way too
133 // many clients)
134 static wxHashTable *sm_classTable;
135
136 private:
137 // InitializeClasses() helper
138 static wxClassInfo *GetBaseByName(const wxChar *name);
139
140 DECLARE_NO_COPY_CLASS(wxClassInfo)
141
142 protected:
143 // registers the class
144 void Register();
145 void Unregister();
146 };
147
148 WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name);
149
150 #ifdef WXWIN_COMPATIBILITY_2_4
151 inline void wxClassInfo::InitializeClasses() {}
152 inline void wxClassInfo::CleanUpClasses() {}
153 #endif
154
155 // ----------------------------------------------------------------------------
156 // Dynamic class macros
157 // ----------------------------------------------------------------------------
158
159 #define DECLARE_DYNAMIC_CLASS(name) \
160 public: \
161 static wxClassInfo sm_class##name; \
162 virtual wxClassInfo *GetClassInfo() const \
163 { return &name::sm_class##name; }
164
165 #define DECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \
166 DECLARE_NO_ASSIGN_CLASS(name) \
167 DECLARE_DYNAMIC_CLASS(name)
168
169 #define DECLARE_DYNAMIC_CLASS_NO_COPY(name) \
170 DECLARE_NO_COPY_CLASS(name) \
171 DECLARE_DYNAMIC_CLASS(name)
172
173 #define DECLARE_ABSTRACT_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
174 #define DECLARE_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
175
176 // -----------------------------------
177 // for concrete classes
178 // -----------------------------------
179
180 // Single inheritance with one base class
181
182 #define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
183 wxObject* wxConstructorFor##name() \
184 { return new name; } \
185 wxClassInfo name::sm_class##name(wxT(#name), \
186 &basename::sm_class##basename, NULL, \
187 (int) sizeof(name), \
188 (wxObjectConstructorFn) wxConstructorFor##name);
189
190 // Multiple inheritance with two base classes
191
192 #define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \
193 wxObject* wxConstructorFor##name() \
194 { return new name; } \
195 wxClassInfo name::sm_class##name(wxT(#name), \
196 &basename1::sm_class##basename1, \
197 &basename2::sm_class##basename2, \
198 wxT(#basename2), (int) sizeof(name), \
199 (wxObjectConstructorFn) wxConstructorFor##name);
200
201 // -----------------------------------
202 // for abstract classes
203 // -----------------------------------
204
205 // Single inheritance with one base class
206
207 #define IMPLEMENT_ABSTRACT_CLASS(name, basename) \
208 wxClassInfo name::sm_class##name(wxT(#name), \
209 &basename::sm_class##basename, NULL, \
210 (int) sizeof(name), (wxObjectConstructorFn) 0);
211
212 // Multiple inheritance with two base classes
213
214 #define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
215 wxClassInfo name::sm_class##name(wxT(#name), \
216 &basename1::sm_class##basename1, \
217 &basename2::sm_class##basename2, \
218 (int) sizeof(name), \
219 (wxObjectConstructorFn) 0);
220
221 #define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
222 #define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2
223
224 #endif // !wxUSE_EXTENDED_RTTI
225
226
227 // -----------------------------------
228 // for pluggable classes
229 // -----------------------------------
230
231 // NOTE: this should probably be the very first statement
232 // in the class declaration so wxPluginSentinel is
233 // the first member initialised and the last destroyed.
234
235 // _DECLARE_DL_SENTINEL(name) wxPluginSentinel m_pluginsentinel;
236
237 #if wxUSE_NESTED_CLASSES
238
239 #define _DECLARE_DL_SENTINEL(name, exportdecl) \
240 class exportdecl name##PluginSentinel { \
241 private: \
242 static const wxString sm_className; \
243 public: \
244 name##PluginSentinel(); \
245 ~name##PluginSentinel(); \
246 }; \
247 name##PluginSentinel m_pluginsentinel;
248
249 #define _IMPLEMENT_DL_SENTINEL(name) \
250 const wxString name::name##PluginSentinel::sm_className(#name); \
251 name::name##PluginSentinel::name##PluginSentinel() { \
252 wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name); \
253 if( e != 0 ) { e->RefObj(); } \
254 } \
255 name::name##PluginSentinel::~name##PluginSentinel() { \
256 wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name); \
257 if( e != 0 ) { e->UnrefObj(); } \
258 }
259 #else
260
261 #define _DECLARE_DL_SENTINEL(name)
262 #define _IMPLEMENT_DL_SENTINEL(name)
263
264 #endif // wxUSE_NESTED_CLASSES
265
266 #define DECLARE_PLUGGABLE_CLASS(name) \
267 DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name, WXDLLEXPORT)
268 #define DECLARE_ABSTRACT_PLUGGABLE_CLASS(name) \
269 DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name, WXDLLEXPORT)
270
271 #define DECLARE_USER_EXPORTED_PLUGGABLE_CLASS(name, usergoo) \
272 DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name, usergoo)
273 #define DECLARE_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, usergoo) \
274 DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name, usergoo)
275
276 #define IMPLEMENT_PLUGGABLE_CLASS(name, basename) \
277 IMPLEMENT_DYNAMIC_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name)
278 #define IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2) \
279 IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name)
280 #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) \
281 IMPLEMENT_ABSTRACT_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name)
282 #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \
283 IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name)
284
285 #define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS(name, basename) \
286 IMPLEMENT_PLUGGABLE_CLASS(name, basename)
287 #define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS2(name, basename1, basename2) \
288 IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2)
289 #define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, basename) \
290 IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename)
291 #define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \
292 IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2)
293
294 #define CLASSINFO(name) (&name::sm_class##name)
295
296 #else // !wxUSE_DYNAMIC_CLASSES
297
298 // No dynamic class system: so stub out the macros
299
300 #define DECLARE_DYNAMIC_CLASS(name)
301 #define DECLARE_ABSTRACT_CLASS(name)
302 #define DECLARE_CLASS(name)
303 #define IMPLEMENT_DYNAMIC_CLASS(name, basename)
304 #define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2)
305 #define IMPLEMENT_ABSTRACT_CLASS(name, basename)
306 #define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2)
307 #define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
308 #define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2
309
310 #define DECLARE_PLUGGABLE_CLASS(name)
311 #define DECLARE_ABSTRACT_PLUGGABLE_CLASS(name)
312 #define IMPLEMENT_PLUGGABLE_CLASS(name, basename)
313 #define IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2)
314 #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename)
315 #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2)
316
317 #define DECLARE_USER_EXPORTED_PLUGGABLE_CLASS(name, usergoo)
318 #define DECLARE_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, usergoo)
319 #define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS(name, basename)
320 #define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS2(name, basename1, basename2)
321 #define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, basename)
322 #define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2)
323
324 #endif // wxUSE_DYNAMIC_CLASSES
325
326 #define wxIS_KIND_OF(obj, className) obj->IsKindOf(&className::sm_class##className)
327
328 // Just seems a bit nicer-looking (pretend it's not a macro)
329 #define wxIsKindOf(obj, className) obj->IsKindOf(&className::sm_class##className)
330
331 // to be replaced by dynamic_cast<> in the future
332 #define wxDynamicCast(obj, className) \
333 ((className *) wxCheckDynamicCast((wxObject*)(obj), &className::sm_class##className))
334
335 // The 'this' pointer is always true, so use this version
336 // to cast the this pointer and avoid compiler warnings.
337 #define wxDynamicCastThis(className) \
338 (IsKindOf(&className::sm_class##className) ? (className *)(this) : (className *)0)
339
340 #ifdef HAVE_CONST_CAST
341 #define wxConstCast(obj, className) const_cast<className *>(obj)
342 #else
343 #define wxConstCast(obj, className) ((className *)(obj))
344 #endif
345
346
347 #ifdef __WXDEBUG__
348 inline void wxCheckCast(void *ptr)
349 {
350 wxASSERT_MSG( ptr, _T("wxStaticCast() used incorrectly") );
351 }
352 #define wxStaticCast(obj, className) \
353 (wxCheckCast(wxDynamicCast(obj, className)), ((className *)(obj)))
354
355 #else // !__WXDEBUG__
356 #define wxStaticCast(obj, className) ((className *)(obj))
357
358 #endif // __WXDEBUG__
359
360 // ----------------------------------------------------------------------------
361 // set up memory debugging macros
362 // ----------------------------------------------------------------------------
363
364 /*
365 Which new/delete operator variants do we want?
366
367 _WX_WANT_NEW_SIZET_WXCHAR_INT = void *operator new (size_t size, wxChar *fileName = 0, int lineNum = 0)
368 _WX_WANT_DELETE_VOID = void operator delete (void * buf)
369 _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET = void operator delete (void *buf, const char *_fname, size_t _line)
370 _WX_WANT_DELETE_VOID_WXCHAR_INT = void operator delete(void *buf, wxChar*, int)
371 _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT = void *operator new[] (size_t size, wxChar *fileName , int lineNum = 0)
372 _WX_WANT_ARRAY_DELETE_VOID = void operator delete[] (void *buf)
373 _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT = void operator delete[] (void* buf, wxChar*, int )
374 */
375
376 #if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
377
378 // All compilers get this one
379 #define _WX_WANT_NEW_SIZET_WXCHAR_INT
380
381 // Everyone except Visage gets the next one
382 #ifndef __VISAGECPP__
383 #define _WX_WANT_DELETE_VOID
384 #endif
385
386 // Only visage gets this one under the correct circumstances
387 #if defined(__VISAGECPP__) && __DEBUG_ALLOC__
388 #define _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET
389 #endif
390
391 // Only VC++ 6.0 and CodeWarrior compilers get overloaded delete that matches new
392 #if ( defined(__VISUALC__) && (__VISUALC__ >= 1200) ) || (defined(__MWERKS__) && (__MWERKS__ >= 0x2400))
393 #define _WX_WANT_DELETE_VOID_WXCHAR_INT
394 #endif
395
396 // Now see who (if anyone) gets the array memory operators
397 #if wxUSE_ARRAY_MEMORY_OPERATORS
398
399 // Everyone except Visual C++ (cause problems for VC++ - crashes)
400 #if !defined(__VISUALC__)
401 #define _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT
402 #endif
403
404 // Everyone except Visual C++ (cause problems for VC++ - crashes)
405 #if !defined(__VISUALC__)
406 #define _WX_WANT_ARRAY_DELETE_VOID
407 #endif
408
409 // Only CodeWarrior 6 or higher
410 #if defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
411 #define _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT
412 #endif
413
414 #endif // wxUSE_ARRAY_MEMORY_OPERATORS
415
416 #endif // WXDEBUG && wxUSE_MEMORY_TRACING
417
418 // ----------------------------------------------------------------------------
419 // wxObject: the root class of wxWindows object hierarchy
420 // ----------------------------------------------------------------------------
421
422 class WXDLLIMPEXP_BASE wxObject
423 {
424 DECLARE_ABSTRACT_CLASS(wxObject)
425
426 private:
427 void InitFrom(const wxObject& other);
428
429 public:
430 wxObject() { m_refData = NULL; }
431 virtual ~wxObject() { UnRef(); }
432
433 wxObject(const wxObject& other)
434 {
435 InitFrom(other);
436 }
437
438 wxObject& operator=(const wxObject& other)
439 {
440 if ( this != &other )
441 {
442 UnRef();
443 InitFrom(other);
444 }
445 return *this;
446 }
447
448 bool IsKindOf(wxClassInfo *info) const;
449
450
451 // Turn on the correct set of new and delete operators
452
453 #ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT
454 void *operator new ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 );
455 #endif
456
457 #ifdef _WX_WANT_DELETE_VOID
458 void operator delete ( void * buf );
459 #endif
460
461 #ifdef _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET
462 void operator delete ( void *buf, const char *_fname, size_t _line );
463 #endif
464
465 #ifdef _WX_WANT_DELETE_VOID_WXCHAR_INT
466 void operator delete ( void *buf, const wxChar*, int );
467 #endif
468
469 #ifdef _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT
470 void *operator new[] ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 );
471 #endif
472
473 #ifdef _WX_WANT_ARRAY_DELETE_VOID
474 void operator delete[] ( void *buf );
475 #endif
476
477 #ifdef _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT
478 void operator delete[] (void* buf, const wxChar*, int );
479 #endif
480
481 // ref counted data handling methods
482
483 // get/set
484 wxObjectRefData *GetRefData() const { return m_refData; }
485 void SetRefData(wxObjectRefData *data) { m_refData = data; }
486
487 // make a 'clone' of the object
488 void Ref(const wxObject& clone);
489
490 // destroy a reference
491 void UnRef();
492
493 protected:
494 // ensure that our data is not shared with anybody else: if we have no
495 // data, it is created using CreateRefData() below, if we have shared data
496 // it is copied using CloneRefData(), otherwise nothing is done
497 void AllocExclusive();
498
499 // both methods must be implemented if Unshare() is used, not pure virtual
500 // only because of the backwards compatibility reasons
501
502 // create a new m_refData
503 virtual wxObjectRefData *CreateRefData() const;
504
505 // create a new m_refData initialized with the given one
506 virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
507
508 wxObjectRefData *m_refData;
509 };
510
511 // ----------------------------------------------------------------------------
512 // wxObjectRefData: ref counted data meant to be stored in wxObject
513 // ----------------------------------------------------------------------------
514
515 class WXDLLIMPEXP_BASE wxObjectRefData
516 {
517 friend class WXDLLIMPEXP_BASE wxObject;
518
519 public:
520 wxObjectRefData() : m_count(1) { }
521 virtual ~wxObjectRefData() { }
522
523 int GetRefCount() const { return m_count; }
524
525 private:
526 int m_count;
527 };
528
529
530 inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo)
531 {
532 return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : NULL;
533 }
534
535 #if wxUSE_EXTENDED_RTTI
536 class WXDLLIMPEXP_BASE wxDynamicObject : public wxObject
537 {
538 public:
539 // instantiates this object with an instance of its superclass
540 wxDynamicObject(wxObject* superClassInstance, const wxDynamicClassInfo *info) ;
541 ~wxDynamicObject();
542
543 void SetProperty (const wxChar *PropertyName, const wxxVariant &Value);
544 wxxVariant GetProperty (const wxChar *PropertyName) const ;
545
546 // get the runtime identity of this object
547 wxClassInfo *GetClassInfo() const
548 {
549 return const_cast<wxClassInfo*>((const wxClassInfo*)m_classInfo);
550 }
551
552 wxObject* GetSuperClassInstance() const
553 {
554 return m_superClassInstance ;
555 }
556 private :
557 wxObject *m_superClassInstance ;
558 const wxDynamicClassInfo *m_classInfo;
559 struct wxDynamicObjectInternal;
560 wxDynamicObjectInternal *m_data;
561 };
562 #endif
563
564 // ----------------------------------------------------------------------------
565 // more debugging macros
566 // ----------------------------------------------------------------------------
567
568 #ifdef __WXDEBUG__
569 #ifndef WXDEBUG_NEW
570 #define WXDEBUG_NEW new(__TFILE__,__LINE__)
571 #endif
572 #else // !__WXDEBUG__
573 #define WXDEBUG_NEW new
574 #endif
575
576 // Redefine new to be the debugging version. This doesn't work with all
577 // compilers, in which case you need to use WXDEBUG_NEW explicitly if you wish
578 // to use the debugging version.
579
580 #if defined(__WXDEBUG__) && wxUSE_GLOBAL_MEMORY_OPERATORS && wxUSE_DEBUG_NEW_ALWAYS
581 #define new new(__TFILE__,__LINE__)
582 #endif
583
584 #endif // _WX_OBJECTH__
585