X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e668651137922bee36b5773d638aa696e78854d1..d7e918b594dccaada636fb2dd99081bc89e99db6:/include/wx/cocoa/ObjcPose.h diff --git a/include/wx/cocoa/ObjcPose.h b/include/wx/cocoa/ObjcPose.h index b5e53c0ab6..fc43094672 100644 --- a/include/wx/cocoa/ObjcPose.h +++ b/include/wx/cocoa/ObjcPose.h @@ -2,11 +2,11 @@ // Name: wx/cocoa/ObjcPose.h // Purpose: Macros for initializing poseAs, among other things // Author: David Elliott -// Modified by: +// Modified by: // Created: 2002/12/03 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) 2002 David Elliott -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WX_COCOA_PRIVATE_POSER_H__ @@ -17,46 +17,51 @@ Objective-C Poser class initialization -------------------------------------------------------------------------*/ #ifdef __OBJC__ #import +#import class wxPoseAsInitializer { public: - wxPoseAsInitializer(Class poser) - : m_poser(poser) - , m_next(sm_first) - { - sm_first = this; - } - ~wxPoseAsInitializer() - { - class_poseAs(m_poser,m_poser->super_class); - sm_first = m_next; - } - static void InitializePosers() - { - while(sm_first) - { - delete sm_first; - } - }; + wxPoseAsInitializer() + : m_next(sm_first) + { + sm_first = this; + } + virtual ~wxPoseAsInitializer() + { + sm_first = m_next; + } + static void InitializePosers() + { + while(sm_first) + { + delete sm_first; + } + }; protected: - Class m_poser; - wxPoseAsInitializer *m_next; - static wxPoseAsInitializer *sm_first; + wxPoseAsInitializer *m_next; + static wxPoseAsInitializer *sm_first; }; class wxDummyForPoseAsInitializer { public: - wxDummyForPoseAsInitializer(void*) {} + wxDummyForPoseAsInitializer(void*) {} }; #define WX_IMPLEMENT_POSER(poser) \ -wxDummyForPoseAsInitializer wxDummyPoseAsInitializerFor##poser(new wxPoseAsInitializer([poser class])) +class wxPoseAsInitializerFor##poser: public wxPoseAsInitializer \ +{ \ +protected: \ + virtual ~wxPoseAsInitializerFor##poser() \ + { \ + class_poseAs([poser class],[poser superclass]); \ + } \ +}; \ +wxDummyForPoseAsInitializer wxDummyPoseAsInitializerFor##poser(new wxPoseAsInitializerFor##poser) #else // __OBJC__ #warning "Objective-C++ Only!" #endif // __OBJC__ #endif // __WX_COCOA_PRIVATE_POSER_H__ -