X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/706068e4011b42dd98a0ec8306cfac684712c802..a90280fe1ac7b78563d44afffd1d3b0b521b5cd6:/interface/wx/defs.h diff --git a/interface/wx/defs.h b/interface/wx/defs.h index b1b2c9536e..812d422968 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -6,6 +6,23 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// + +/** + No id matches this one when compared to it. +*/ +int wxID_NONE = -3; + +/** + Id for a separator line in the menu (invalid for normal item). +*/ +int wxID_SEPARATOR = -2; + +/** + Any id: means that we don't care about the id, whether when installing + an event handler or when creating a new window. +*/ +int wxID_ANY = -1; + /** Item kinds for use with wxMenu, wxMenuItem, and wxToolBar. @@ -99,7 +116,7 @@ enum wxPaperSize wxPAPER_FANFOLD_STD_GERMAN, ///< German Std Fanfold, 8 1/2 by 12 inches wxPAPER_FANFOLD_LGL_GERMAN, ///< German Legal Fanfold, 8 1/2 by 13 inches - // Windows 95 Only + // wxMSW Only wxPAPER_ISO_B4, ///< B4 (ISO) 250 x 353 mm wxPAPER_JAPANESE_POSTCARD, ///< Japanese Postcard 100 x 148 mm @@ -107,13 +124,13 @@ enum wxPaperSize wxPAPER_10X11, ///< 10 x 11 in wxPAPER_15X11, ///< 15 x 11 in wxPAPER_ENV_INVITE, ///< Envelope Invite 220 x 220 mm - wxPAPER_LETTER_EXTRA, ///< Letter Extra 9 \275 x 12 in - wxPAPER_LEGAL_EXTRA, ///< Legal Extra 9 \275 x 15 in + wxPAPER_LETTER_EXTRA, ///< Letter Extra 9.5 x 12 in + wxPAPER_LEGAL_EXTRA, ///< Legal Extra 9.5 x 15 in wxPAPER_TABLOID_EXTRA, ///< Tabloid Extra 11.69 x 18 in wxPAPER_A4_EXTRA, ///< A4 Extra 9.27 x 12.69 in - wxPAPER_LETTER_TRANSVERSE, ///< Letter Transverse 8 \275 x 11 in + wxPAPER_LETTER_TRANSVERSE, ///< Letter Transverse 8.5 x 11 in wxPAPER_A4_TRANSVERSE, ///< A4 Transverse 210 x 297 mm - wxPAPER_LETTER_EXTRA_TRANSVERSE, ///< Letter Extra Transverse 9\275 x 12 in + wxPAPER_LETTER_EXTRA_TRANSVERSE, ///< Letter Extra Transverse 9.5 x 12 in wxPAPER_A_PLUS, ///< SuperA/SuperA/A4 227 x 356 mm wxPAPER_B_PLUS, ///< SuperB/SuperB/A3 305 x 487 mm wxPAPER_LETTER_PLUS, ///< Letter Plus 8.5 x 12.69 in @@ -180,7 +197,7 @@ enum wxPaperSize }; -/** @ingroup group_funcmacro_byteorder */ +/** @addtogroup group_funcmacro_byteorder */ //@{ /** @@ -190,14 +207,14 @@ enum wxPaperSize @header{wx/defs.h} */ -#define wxINT32_SWAP_ALWAYS( wxInt32 value ) -#define wxUINT32_SWAP_ALWAYS( wxUint32 value ) -#define wxINT16_SWAP_ALWAYS( wxInt16 value ) -#define wxUINT16_SWAP_ALWAYS( wxUint16 value ) +#define wxINT32_SWAP_ALWAYS( wxInt32_value ) +#define wxUINT32_SWAP_ALWAYS( wxUint32_value ) +#define wxINT16_SWAP_ALWAYS( wxInt16_value ) +#define wxUINT16_SWAP_ALWAYS( wxUint16_value ) //@} -/** @ingroup group_funcmacro_byteorder */ +/** @addtogroup group_funcmacro_byteorder */ //@{ /** @@ -211,14 +228,14 @@ enum wxPaperSize @header{wx/defs.h} */ -#define wxINT32_SWAP_ON_BE( wxInt32 value ) -#define wxUINT32_SWAP_ON_BE( wxUint32 value ) -#define wxINT16_SWAP_ON_BE( wxInt16 value ) -#define wxUINT16_SWAP_ON_BE( wxUint16 value ) +#define wxINT32_SWAP_ON_BE( wxInt32_value ) +#define wxUINT32_SWAP_ON_BE( wxUint32_value ) +#define wxINT16_SWAP_ON_BE( wxInt16_value ) +#define wxUINT16_SWAP_ON_BE( wxUint16_value ) //@} -/** @ingroup group_funcmacro_byteorder */ +/** @addtogroup group_funcmacro_byteorder */ //@{ /** @@ -232,16 +249,16 @@ enum wxPaperSize @header{wx/defs.h} */ -#define wxINT32_SWAP_ON_LE( wxInt32 value ) -#define wxUINT32_SWAP_ON_LE( wxUint32 value ) -#define wxINT16_SWAP_ON_LE( wxInt16 value ) -#define wxUINT16_SWAP_ON_LE( wxUint16 value ) +#define wxINT32_SWAP_ON_LE( wxInt32_value ) +#define wxUINT32_SWAP_ON_LE( wxUint32_value ) +#define wxINT16_SWAP_ON_LE( wxInt16_value ) +#define wxUINT16_SWAP_ON_LE( wxUint16_value ) //@} -/** @ingroup group_funcmacro_misc */ +/** @addtogroup group_funcmacro_misc */ //@{ /** @@ -290,6 +307,56 @@ enum wxPaperSize */ #define DECLARE_NO_COPY_CLASS(classname) +/** + Equivalent of DECLARE_NO_COPY_CLASS() for template classes. + + This macro can be used for template classes (with a single template + parameter) for the same purpose as DECLARE_NO_COPY_CLASS() is used with the + non-template classes. + + @param classname The name of the template class. + @param arg The name of the template parameter. + */ +#define DECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) + +/** + A function which deletes and nulls the pointer. + + This function uses operator delete to free the pointer and also sets it to + @NULL. Notice that this does @em not work for arrays, use wxDELETEA() for + them. + + @code + MyClass *ptr = new MyClass; + ... + wxDELETE(ptr); + wxASSERT(!ptr); + @endcode + + @header{wx/defs.h} +*/ +template wxDELETE(T*& ptr); + +/** + A function which deletes and nulls the pointer. + + This function uses vector operator delete (@c delete[]) to free the array + pointer and also sets it to @NULL. Notice that this does @em not work for + non-array pointers, use wxDELETE() for them. + + @code + MyClass *array = new MyClass[17]; + ... + wxDELETEA(array); + wxASSERT(!array); + @endcode + + @see wxDELETE() + + @header{wx/defs.h} +*/ +template wxDELETEA(T*& array); + /** This macro can be used around a function declaration to generate warnings indicating that this function is deprecated (i.e. obsolete and planned to @@ -390,6 +457,25 @@ enum wxPaperSize */ #define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name) +/** + Swaps the contents of two variables. + + This is similar to std::swap() but can be used even on the platforms where + the standard C++ library is not available (if you don't target such + platforms, please use std::swap() instead). + + The function relies on type T being copy constructible and assignable. + + Example of use: + @code + int x = 3, + y = 4; + wxSwap(x, y); + wxASSERT( x == 4 && y == 3 ); + @endcode + */ +template wxSwap(T& first, T& second); + /** This macro is the same as the standard C99 @c va_copy for the compilers which support it or its replacement for those that don't. It must be used