2003-03-21 14:51:47 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/cocoa/ObjcPose.h
|
|
|
|
// Purpose: Macros for initializing poseAs, among other things
|
|
|
|
// Author: David Elliott
|
2006-10-16 05:30:01 -04:00
|
|
|
// Modified by:
|
2003-03-21 14:51:47 -05:00
|
|
|
// Created: 2002/12/03
|
2006-10-16 05:30:01 -04:00
|
|
|
// RCS-ID: $Id$
|
2003-03-21 14:51:47 -05:00
|
|
|
// Copyright: (c) 2002 David Elliott <dfe@cox.net>
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2003-03-21 14:51:47 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __WX_COCOA_PRIVATE_POSER_H__
|
|
|
|
#define __WX_COCOA_PRIVATE_POSER_H__
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
Objective-C Poser class initialization
|
|
|
|
-------------------------------------------------------------------------*/
|
|
|
|
#ifdef __OBJC__
|
|
|
|
#import <objc/objc-class.h>
|
2004-01-21 23:41:34 -05:00
|
|
|
#import <Foundation/NSObjCRuntime.h>
|
2003-03-21 14:51:47 -05:00
|
|
|
|
|
|
|
class wxPoseAsInitializer
|
|
|
|
{
|
|
|
|
public:
|
2006-10-16 05:30:01 -04:00
|
|
|
wxPoseAsInitializer()
|
|
|
|
: m_next(sm_first)
|
|
|
|
{
|
|
|
|
sm_first = this;
|
|
|
|
}
|
|
|
|
virtual ~wxPoseAsInitializer()
|
|
|
|
{
|
|
|
|
sm_first = m_next;
|
|
|
|
}
|
|
|
|
static void InitializePosers()
|
|
|
|
{
|
|
|
|
while(sm_first)
|
|
|
|
{
|
|
|
|
delete sm_first;
|
|
|
|
}
|
|
|
|
};
|
2003-03-21 14:51:47 -05:00
|
|
|
protected:
|
2006-10-16 05:30:01 -04:00
|
|
|
wxPoseAsInitializer *m_next;
|
|
|
|
static wxPoseAsInitializer *sm_first;
|
2003-03-21 14:51:47 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
class wxDummyForPoseAsInitializer
|
|
|
|
{
|
|
|
|
public:
|
2006-10-16 05:30:01 -04:00
|
|
|
wxDummyForPoseAsInitializer(void*) {}
|
2003-03-21 14:51:47 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define WX_IMPLEMENT_POSER(poser) \
|
2003-07-02 16:46:34 -04:00
|
|
|
class wxPoseAsInitializerFor##poser: public wxPoseAsInitializer \
|
|
|
|
{ \
|
|
|
|
protected: \
|
|
|
|
virtual ~wxPoseAsInitializerFor##poser() \
|
|
|
|
{ \
|
|
|
|
class_poseAs([poser class],[poser superclass]); \
|
|
|
|
} \
|
|
|
|
}; \
|
|
|
|
wxDummyForPoseAsInitializer wxDummyPoseAsInitializerFor##poser(new wxPoseAsInitializerFor##poser)
|
2003-03-21 14:51:47 -05:00
|
|
|
|
2003-04-19 13:51:50 -04:00
|
|
|
#else // __OBJC__
|
|
|
|
#warning "Objective-C++ Only!"
|
2003-03-21 14:51:47 -05:00
|
|
|
#endif // __OBJC__
|
|
|
|
|
|
|
|
#endif // __WX_COCOA_PRIVATE_POSER_H__
|