/usr/include/wx-3.0/wx/rtti.h is in wx3.0-headers 3.0.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | /////////////////////////////////////////////////////////////////////////////
// Name: wx/rtti.h
// Purpose: old RTTI macros (use XTI when possible instead)
// Author: Julian Smart
// Modified by: Ron Lee
// Created: 01/02/97
// Copyright: (c) 1997 Julian Smart
// (c) 2001 Ron Lee <ron@debian.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_RTTIH__
#define _WX_RTTIH__
#if !wxUSE_EXTENDED_RTTI // XTI system is meant to replace these macros
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/memory.h"
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_BASE wxString;
class WXDLLIMPEXP_FWD_BASE wxClassInfo;
class WXDLLIMPEXP_FWD_BASE wxHashTable;
class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_BASE wxPluginLibrary;
class WXDLLIMPEXP_FWD_BASE wxHashTable_Node;
// ----------------------------------------------------------------------------
// wxClassInfo
// ----------------------------------------------------------------------------
typedef wxObject *(*wxObjectConstructorFn)(void);
class WXDLLIMPEXP_BASE wxClassInfo
{
friend class WXDLLIMPEXP_FWD_BASE wxObject;
friend WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name);
public:
wxClassInfo( const wxChar *className,
const wxClassInfo *baseInfo1,
const wxClassInfo *baseInfo2,
int size,
wxObjectConstructorFn ctor )
: m_className(className)
, m_objectSize(size)
, m_objectConstructor(ctor)
, m_baseInfo1(baseInfo1)
, m_baseInfo2(baseInfo2)
, m_next(sm_first)
{
sm_first = this;
Register();
}
~wxClassInfo();
wxObject *CreateObject() const
{ return m_objectConstructor ? (*m_objectConstructor)() : 0; }
bool IsDynamic() const { return (NULL != m_objectConstructor); }
const wxChar *GetClassName() const { return m_className; }
const wxChar *GetBaseClassName1() const
{ return m_baseInfo1 ? m_baseInfo1->GetClassName() : NULL; }
const wxChar *GetBaseClassName2() const
{ return m_baseInfo2 ? m_baseInfo2->GetClassName() : NULL; }
const wxClassInfo *GetBaseClass1() const { return m_baseInfo1; }
const wxClassInfo *GetBaseClass2() const { return m_baseInfo2; }
int GetSize() const { return m_objectSize; }
wxObjectConstructorFn GetConstructor() const
{ return m_objectConstructor; }
static const wxClassInfo *GetFirst() { return sm_first; }
const wxClassInfo *GetNext() const { return m_next; }
static wxClassInfo *FindClass(const wxString& className);
// Climb upwards through inheritance hierarchy.
// Dual inheritance is catered for.
bool IsKindOf(const wxClassInfo *info) const
{
return info != 0 &&
( info == this ||
( m_baseInfo1 && m_baseInfo1->IsKindOf(info) ) ||
( m_baseInfo2 && m_baseInfo2->IsKindOf(info) ) );
}
wxDECLARE_CLASS_INFO_ITERATORS();
private:
const wxChar *m_className;
int m_objectSize;
wxObjectConstructorFn m_objectConstructor;
// Pointers to base wxClassInfos
const wxClassInfo *m_baseInfo1;
const wxClassInfo *m_baseInfo2;
// class info object live in a linked list:
// pointers to its head and the next element in it
static wxClassInfo *sm_first;
wxClassInfo *m_next;
static wxHashTable *sm_classTable;
protected:
// registers the class
void Register();
void Unregister();
wxDECLARE_NO_COPY_CLASS(wxClassInfo);
};
WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name);
// ----------------------------------------------------------------------------
// Dynamic class macros
// ----------------------------------------------------------------------------
#define wxDECLARE_ABSTRACT_CLASS(name) \
public: \
static wxClassInfo ms_classInfo; \
virtual wxClassInfo *GetClassInfo() const
#define wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \
wxDECLARE_NO_ASSIGN_CLASS(name); \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_DYNAMIC_CLASS_NO_COPY(name) \
wxDECLARE_NO_COPY_CLASS(name); \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_DYNAMIC_CLASS(name) \
wxDECLARE_ABSTRACT_CLASS(name); \
static wxObject* wxCreateObject()
#define wxDECLARE_CLASS(name) \
wxDECLARE_ABSTRACT_CLASS(name)
// common part of the macros below
#define wxIMPLEMENT_CLASS_COMMON(name, basename, baseclsinfo2, func) \
wxClassInfo name::ms_classInfo(wxT(#name), \
&basename::ms_classInfo, \
baseclsinfo2, \
(int) sizeof(name), \
func); \
\
wxClassInfo *name::GetClassInfo() const \
{ return &name::ms_classInfo; }
#define wxIMPLEMENT_CLASS_COMMON1(name, basename, func) \
wxIMPLEMENT_CLASS_COMMON(name, basename, NULL, func)
#define wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, func) \
wxIMPLEMENT_CLASS_COMMON(name, basename1, &basename2::ms_classInfo, func)
// -----------------------------------
// for concrete classes
// -----------------------------------
// Single inheritance with one base class
#define wxIMPLEMENT_DYNAMIC_CLASS(name, basename) \
wxIMPLEMENT_CLASS_COMMON1(name, basename, name::wxCreateObject) \
wxObject* name::wxCreateObject() \
{ return new name; }
// Multiple inheritance with two base classes
#define wxIMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \
wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, \
name::wxCreateObject) \
wxObject* name::wxCreateObject() \
{ return new name; }
// -----------------------------------
// for abstract classes
// -----------------------------------
// Single inheritance with one base class
#define wxIMPLEMENT_ABSTRACT_CLASS(name, basename) \
wxIMPLEMENT_CLASS_COMMON1(name, basename, NULL)
// Multiple inheritance with two base classes
#define wxIMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, NULL)
// -----------------------------------
// XTI-compatible macros
// -----------------------------------
#include "wx/flags.h"
// these macros only do something when wxUSE_EXTENDED_RTTI=1
// (and in that case they are defined by xti.h); however to avoid
// to be forced to wrap these macros (in user's source files) with
//
// #if wxUSE_EXTENDED_RTTI
// ...
// #endif
//
// blocks, we define them here as empty.
#define wxEMPTY_PARAMETER_VALUE /**/
#define wxBEGIN_ENUM( e ) wxEMPTY_PARAMETER_VALUE
#define wxENUM_MEMBER( v ) wxEMPTY_PARAMETER_VALUE
#define wxEND_ENUM( e ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_SET_STREAMING(SetName,e) wxEMPTY_PARAMETER_VALUE
#define wxBEGIN_FLAGS( e ) wxEMPTY_PARAMETER_VALUE
#define wxFLAGS_MEMBER( v ) wxEMPTY_PARAMETER_VALUE
#define wxEND_FLAGS( e ) wxEMPTY_PARAMETER_VALUE
#define wxCOLLECTION_TYPE_INFO( element, collection ) wxEMPTY_PARAMETER_VALUE
#define wxHANDLER(name,eventClassType) wxEMPTY_PARAMETER_VALUE
#define wxBEGIN_HANDLERS_TABLE(theClass) wxEMPTY_PARAMETER_VALUE
#define wxEND_HANDLERS_TABLE() wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_DYNAMIC_CLASS_XTI( name, basename, unit ) \
wxIMPLEMENT_DYNAMIC_CLASS( name, basename )
#define wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK( name, basename, unit, callback ) \
wxIMPLEMENT_DYNAMIC_CLASS( name, basename )
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI( name, basename, unit ) \
wxIMPLEMENT_DYNAMIC_CLASS( name, basename)
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( name, basename, \
unit, toString, \
fromString ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_NO_BASE_XTI( name, unit ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_XTI( name, basename, unit ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_DYNAMIC_CLASS2_XTI( name, basename, basename2, unit) wxIMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2 )
#define wxCONSTRUCTOR_0(klass) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_DUMMY(klass) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_0(klass) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_1(klass,t0,v0) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_1(klass,t0,v0) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \
wxEMPTY_PARAMETER_VALUE
#define wxSETTER( property, Klass, valueType, setterMethod ) wxEMPTY_PARAMETER_VALUE
#define wxGETTER( property, Klass, valueType, gettermethod ) wxEMPTY_PARAMETER_VALUE
#define wxADDER( property, Klass, valueType, addermethod ) wxEMPTY_PARAMETER_VALUE
#define wxCOLLECTION_GETTER( property, Klass, valueType, gettermethod ) wxEMPTY_PARAMETER_VALUE
#define wxBEGIN_PROPERTIES_TABLE(theClass) wxEMPTY_PARAMETER_VALUE
#define wxEND_PROPERTIES_TABLE() wxEMPTY_PARAMETER_VALUE
#define wxHIDE_PROPERTY( pname ) wxEMPTY_PARAMETER_VALUE
#define wxPROPERTY( pname, type, setter, getter, defaultValue, flags, help, group) \
wxEMPTY_PARAMETER_VALUE
#define wxPROPERTY_FLAGS( pname, flags, type, setter, getter,defaultValue, \
pflags, help, group) wxEMPTY_PARAMETER_VALUE
#define wxREADONLY_PROPERTY( pname, type, getter,defaultValue, flags, help, group) \
wxGETTER( pname, class_t, type, getter ) wxEMPTY_PARAMETER_VALUE
#define wxREADONLY_PROPERTY_FLAGS( pname, flags, type, getter,defaultValue, \
pflags, help, group) wxEMPTY_PARAMETER_VALUE
#define wxPROPERTY_COLLECTION( pname, colltype, addelemtype, adder, getter, \
flags, help, group ) wxEMPTY_PARAMETER_VALUE
#define wxREADONLY_PROPERTY_COLLECTION( pname, colltype, addelemtype, getter, \
flags, help, group) wxEMPTY_PARAMETER_VALUE
#define wxEVENT_PROPERTY( name, eventType, eventClass ) wxEMPTY_PARAMETER_VALUE
#define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_PROPERTY(name, type) wxEMPTY_PARAMETER_VALUE
#define wxEMPTY_HANDLERS_TABLE(name) wxEMPTY_PARAMETER_VALUE
#endif // !wxUSE_EXTENDED_RTTI
#endif // _WX_RTTIH__
|