Catagorized all functions and macros belonging to the RTTI and Versioning groups.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2008-03-14 07:44:48 +00:00
parent 4b8e857f88
commit 8af7f7c125
4 changed files with 266 additions and 176 deletions

View File

@@ -608,38 +608,53 @@ public:
// Global functions/macros
// ============================================================================
/**
The global pointer to the singleton wxApp object.
@see wxApp::GetInstance()
*/
wxApp *wxTheApp;
/** @ingroup group_funcmacro_rtti */
//@{
/**
This is used in headers to create a forward declaration of the
wxGetApp() function implemented by wxIMPLEMENT_APP().
This is used in headers to create a forward declaration of the wxGetApp()
function implemented by IMPLEMENT_APP().
It creates the declaration @a className wxGetApp(void).
@header{wx/app.h}
Example:
@code
wxDECLARE_APP(MyApp)
DECLARE_APP(MyApp)
@endcode
*/
#define wxDECLARE_APP(className) /* implementation is private */
#define DECLARE_APP( appClassName )
/**
This is used in the application class implementation file to make the
application class known to wxWidgets for dynamic construction.
@header{wx/app.h}
Example:
@code
IMPLEMENT_APP(MyApp)
@endcode
See also DECLARE_APP().
@see DECLARE_APP().
*/
#define IMPLEMENT_APP(className) /* implementation is private */
#define IMPLEMENT_APP( appClassName )
//@}
/**
The global pointer to the singleton wxApp object.
@see wxApp::GetInstance()
*/
wxApp *wxTheApp;
/**
This function doesn't exist in wxWidgets but it is created by using

View File

@@ -384,17 +384,32 @@ public:
// Global functions/macros
// ============================================================================
/** @ingroup group_funcmacro_rtti */
//@{
/**
Used inside a class declaration to declare that the class should be
made known to the class hierarchy, but objects of this class cannot be created
dynamically. The same as DECLARE_ABSTRACT_CLASS.
Returns a pointer to the wxClassInfo object associated with this class.
@header{wx/object.h}
*/
#define DECLARE_CLASS() /* implementation is private */
#define CLASSINFO( className )
/**
Used inside a class declaration to declare that the class should be made
known to the class hierarchy, but objects of this class cannot be created
dynamically. The same as DECLARE_ABSTRACT_CLASS().
@header{wx/object.h}
*/
#define DECLARE_CLASS( className )
/**
Used inside a class declaration to declare that the class should be
made known to the class hierarchy, but objects of this class cannot be created
dynamically. The same as DECLARE_CLASS.
dynamically. The same as DECLARE_CLASS().
@header{wx/object.h}
Example:
@code
@@ -409,90 +424,17 @@ public:
};
@endcode
*/
#define DECLARE_ABSTRACT_CLASS() /* implementation is private */
/**
Returns a pointer to the wxClassInfo object associated with this class.
*/
#define wxClassInfo* CLASSINFO() /* implementation is private */
/**
Same as @c reinterpret_castT(x) if the compiler supports reinterpret cast or
@c (T)x for old compilers.
@see wx_const_cast(), wx_static_cast()
*/
T wx_reinterpret_cast();
/**
Used in a C++ implementation file to complete the declaration of a
class that has run-time type information and two base classes. The
same as IMPLEMENT_ABSTRACT_CLASS2.
*/
#define IMPLEMENT_CLASS2() /* implementation is private */
/**
This macro expands into @c const_castclassname *(ptr) if the compiler
supports @e const_cast or into an old, C-style cast, otherwise.
@see wx_const_cast(), wxDynamicCast(), wxStaticCast()
*/
classname* wxConstCast();
/**
Used in a C++ implementation file to complete the declaration of
a class that has run-time type information. The same as IMPLEMENT_CLASS.
Example:
@code
IMPLEMENT_ABSTRACT_CLASS(wxCommand, wxObject)
wxCommand::wxCommand(void)
{
...
}
@endcode
*/
#define IMPLEMENT_ABSTRACT_CLASS() /* implementation is private */
/**
Used in a C++ implementation file to complete the declaration of
a class that has run-time type information. The same as
IMPLEMENT_ABSTRACT_CLASS.
*/
#define IMPLEMENT_CLASS() /* implementation is private */
/**
This macro is equivalent to @c wxDynamicCast(this, classname) but the
latter provokes spurious compilation warnings from some compilers (because it
tests whether @c this pointer is non-@NULL which is always @true), so
this macro should be used to avoid them.
@see wxDynamicCast()
*/
classname* wxDynamicCastThis();
/**
Used in a C++ implementation file to complete the declaration of
a class that has run-time type information, and whose instances
can be created dynamically. Use this for classes derived from two
base classes.
*/
#define IMPLEMENT_DYNAMIC_CLASS2() /* implementation is private */
/**
Creates and returns an object of the given class, if the class has been
registered with the dynamic class system using DECLARE... and IMPLEMENT...
macros.
*/
wxObject* wxCreateDynamicObject(const wxString& className);
#define DECLARE_ABSTRACT_CLASS( className )
/**
Used inside a class declaration to make the class known to wxWidgets RTTI
system and also declare that the objects of this class should be dynamically
creatable from run-time type information. Notice that this implies that the
class should have a default constructor, if this is not the case consider using
DECLARE_CLASS().
system and also declare that the objects of this class should be
dynamically creatable from run-time type information. Notice that this
implies that the class should have a default constructor, if this is not
the case consider using DECLARE_CLASS().
@header{wx/object.h}
Example:
@code
@@ -507,32 +449,158 @@ wxObject* wxCreateDynamicObject(const wxString& className);
};
@endcode
*/
#define DECLARE_DYNAMIC_CLASS() /* implementation is private */
#define DECLARE_DYNAMIC_CLASS( name )
/**
Same as @c const_castT(x) if the compiler supports const cast or
@c (T)x for old compilers. Unlike wxConstCast(),
the cast it to the type @e T and not to @c T * and also the order of
arguments is the same as for the standard cast.
Used in a C++ implementation file to complete the declaration of a class
that has run-time type information. The same as IMPLEMENT_ABSTRACT_CLASS().
@header{wx/object.h}
*/
#define IMPLEMENT_CLASS( className, baseClassName )
/**
Used in a C++ implementation file to complete the declaration of a class
that has run-time type information and two base classes. The same as
IMPLEMENT_ABSTRACT_CLASS2().
@header{wx/object.h}
*/
#define IMPLEMENT_CLASS2( className, baseClassName1, baseClassName2 )
/**
Used in a C++ implementation file to complete the declaration of a class
that has run-time type information. The same as IMPLEMENT_CLASS().
@header{wx/object.h}
Example:
@code
IMPLEMENT_ABSTRACT_CLASS(wxCommand, wxObject)
wxCommand::wxCommand(void)
{
...
}
@endcode
*/
#define IMPLEMENT_ABSTRACT_CLASS( className, baseClassName )
/**
Used in a C++ implementation file to complete the declaration of a class
that has run-time type information and two base classes. The same as
IMPLEMENT_CLASS2().
@header{wx/object.h}
*/
#define IMPLEMENT_ABSTRACT_CLASS2( className, baseClassName1, baseClassName2 )
/**
Used in a C++ implementation file to complete the declaration of a class
that has run-time type information, and whose instances can be created
dynamically.
@header{wx/object.h}
Example:
@code
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
wxFrame::wxFrame(void)
{
...
}
@endcode
*/
#define IMPLEMENT_DYNAMIC_CLASS( className, baseClassName )
/**
Used in a C++ implementation file to complete the declaration of a class
that has run-time type information, and whose instances can be created
dynamically. Use this for classes derived from two base classes.
@header{wx/object.h}
*/
#define IMPLEMENT_DYNAMIC_CLASS2( className, baseClassName1, baseClassName2 )
/**
Same as const_cast<T>(x) if the compiler supports const cast or (T)x for
old compilers. Unlike wxConstCast(), the cast it to the type T and not to
T * and also the order of arguments is the same as for the standard cast.
@header{wx/defs.h}
@see wx_reinterpret_cast(), wx_static_cast()
*/
T wx_const_cast();
#define wx_const_cast(T, x)
/**
Used in a C++ implementation file to complete the declaration of
a class that has run-time type information and two base classes. The same as
IMPLEMENT_CLASS2.
Same as reinterpret_cast<T>(x) if the compiler supports reinterpret cast or
(T)x for old compilers.
@header{wx/defs.h}
@see wx_const_cast(), wx_static_cast()
*/
#define IMPLEMENT_ABSTRACT_CLASS2() /* implementation is private */
#define wx_reinterpret_cast(T, x)
/**
Same as static_cast<T>(x) if the compiler supports static cast or (T)x for
old compilers. Unlike wxStaticCast(), there are no checks being done and
the meaning of the macro arguments is exactly the same as for the standard
static cast, i.e. T is the full type name and star is not appended to it.
@header{wx/defs.h}
@see wx_const_cast(), wx_reinterpret_cast(), wx_truncate_cast()
*/
#define wx_static_cast(T, x)
/**
This case doesnt correspond to any standard cast but exists solely to make
casts which possibly result in a truncation of an integer value more
readable.
@header{wx/defs.h}
*/
#define wx_truncate_cast(T, x)
/**
This macro expands into const_cast<classname *>(ptr) if the compiler
supports const_cast or into an old, C-style cast, otherwise.
@header{wx/defs.h}
@see wx_const_cast(), wxDynamicCast(), wxStaticCast()
*/
#define wxConstCast( object, className )
/**
This is defined in debug mode to be call the redefined new operator
with filename and line number arguments. The definition is:
@code
#define WXDEBUG_NEW new(__FILE__,__LINE__)
@endcode
In non-debug mode, this is defined as the normal new operator.
@header{wx/object.h}
*/
#define WXDEBUG_NEW( arg )
/**
This macro returns the pointer @e ptr cast to the type @e classname * if
the pointer is of this type (the check is done during the run-time) or
@NULL otherwise. Usage of this macro is preferred over obsoleted
wxObject::IsKindOf() function.
The @e ptr argument may be @NULL, in which case @NULL will be
returned.
The @e ptr argument may be @NULL, in which case @NULL will be returned.
@header{wx/object.h}
Example:
@code
@@ -548,57 +616,42 @@ T wx_const_cast();
}
@endcode
@see @ref overview_runtimeclassoverview "RTTI overview", wxDynamicCastThis(),
wxConstCast(), wxStaticCast()
@see @ref overview_runtimeclassoverview "RTTI Overview",
wxDynamicCastThis(), wxConstCast(), wxStaticCast()
*/
classname* wxDynamicCast();
#define wxDynamicCast( object, className )
/**
This is defined in debug mode to be call the redefined new operator
with filename and line number arguments. The definition is:
This macro is equivalent to wxDynamicCast() but the latter provokes
spurious compilation warnings from some compilers (because it tests whether
@c this pointer is non-@NULL which is always true), so this macro should be
used to avoid them.
@code
#define WXDEBUG_NEW new(__FILE__,__LINE__)
@endcode
@header{wx/object.h}
In non-debug mode, this is defined as the normal new operator.
@see wxDynamicCast()
*/
#define WXDEBUG_NEW() /* implementation is private */
#define wxDynamicCastThis( className )
/**
This macro checks that the cast is valid in debug mode (an assert failure will
result if @c wxDynamicCast(ptr, classname) == @NULL) and then returns the
result of executing an equivalent of @c static_castclassname *(ptr).
This macro checks that the cast is valid in debug mode (an assert failure
will result if wxDynamicCast(ptr, classname) == @NULL) and then returns the
result of executing an equivalent of static_cast<classname *>(ptr).
@header{wx/object.h}
@see wx_static_cast(), wxDynamicCast(), wxConstCast()
*/
classname* wxStaticCast();
#define wxStaticCast( object, className )
/**
Same as @c static_castT(x) if the compiler supports static cast or
@c (T)x for old compilers. Unlike wxStaticCast(),
there are no checks being done and the meaning of the macro arguments is exactly
the same as for the standard static cast, i.e. @e T is the full type name and
star is not appended to it.
Creates and returns an object of the given class, if the class has been
registered with the dynamic class system using DECLARE... and IMPLEMENT...
macros.
@see wx_const_cast(), wx_reinterpret_cast(), wx_truncate_cast()
@header{wx/object.h}
*/
T wx_static_cast();
wxObject *wxCreateDynamicObject(const wxString& name);
/**
Used in a C++ implementation file to complete the declaration of
a class that has run-time type information, and whose instances
can be created dynamically.
Example:
@code
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
wxFrame::wxFrame(void)
{
...
}
@endcode
*/
#define IMPLEMENT_DYNAMIC_CLASS() /* implementation is private */
//@}

View File

@@ -6,51 +6,33 @@
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
/**
Same as wxCHECK_VERSION() but also checks that
@c wxSUBRELEASE_NUMBER is at least @e subrel.
*/
#define bool wxCHECK_VERSION_FULL(major, minor, release, subrel) /* implementation is private */
/** @ingroup group_funcmacro_version */
//@{
/**
This is a macro which evaluates to @true if the current wxWidgets version is at
least major.minor.release.
For example, to test if the program is compiled with wxWidgets 2.2 or higher,
the following can be done:
@code
wxString s;
#if wxCHECK_VERSION(2, 2, 0)
if ( s.StartsWith("foo") )
#else // replacement code for old version
if ( strncmp(s, "foo", 3) == 0 )
#endif
{
...
}
@endcode
Returns @true if the compiler being used is GNU C++ and its version is
at least major.minor or greater. Returns @false otherwise.
*/
#define bool wxCHECK_VERSION(major, minor, release) /* implementation is private */
#define wxCHECK_GCC_VERSION( major, minor )
/**
Returns 1 if the compiler being used to compile the code is Visual C++
compiler version @a major or greater. Otherwise, and also if
the compiler is not Visual C++ at all, returns 0.
Returns @true if the compiler being used is Sun CC Pro and its version is
at least major.minor or greater. Returns @false otherwise.
*/
#define bool wxCHECK_VISUALC_VERSION(major) /* implementation is private */
#define wxCHECK_SUNCC_VERSION( major, minor )
/**
Returns 1 if the compiler being used to compile the code is GNU C++
compiler (g++) version major.minor or greater. Otherwise, and also if
the compiler is not GNU C++ at all, returns 0.
Returns @true if the compiler being used is Visual C++ and its version is
at least major or greater. Returns @false otherwise.
*/
#define bool wxCHECK_GCC_VERSION(major, minor) /* implementation is private */
#define wxCHECK_VISUALC_VERSION( major )
/**
Returns 1 if the compiler being used to compile the code is Sun CC Pro
compiler and its version is at least @c major.minor. Otherwise returns
0.
Returns @true if the version of w32api headers used is major.minor or
greater. Otherwise, and also if we are not compiling with MinGW32/Cygwin
under Win32 at all, returns @false.
*/
#define bool wxCHECK_SUNCC_VERSION(major, minor) /* implementation is private */
#define wxCHECK_W32API_VERSION( major, minor )
//@}

40
interface/version.h Normal file
View File

@@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////
// Name: version.h
// Purpose: wxWidgets version numbers
// Author: wxWidgets team
// RCS-ID: $Id: numdlg.h 52425 2008-03-10 15:24:38Z FM $
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
/** @ingroup group_funcmacro_version */
//@{
/**
This is a macro which evaluates to @true if the current wxWidgets version
is at least major.minor.release.
For example, to test if the program is compiled with wxWidgets 2.2 or
higher, the following can be done:
@code
wxString s;
#if wxCHECK_VERSION(2, 2, 0)
if ( s.StartsWith("foo") )
#else // replacement code for old version
if ( strncmp(s, "foo", 3) == 0 )
#endif
{
...
}
@endcode
*/
#define wxCHECK_VERSION( major, minor, release )
/**
Same as wxCHECK_VERSION() but also checks that wxSUBRELEASE_NUMBER is at
least subrel.
*/
#define wxCHECK_VERSION_FULL( major, minor, release, subrel )
//@}