]> git.saurik.com Git - wxWidgets.git/blob - interface/defs.h
removed @NULL,@true,@false tags from the function prototypes; fixed * and & displacin...
[wxWidgets.git] / interface / defs.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: defs.h
3 // Purpose: documentation for global functions
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 //@{
10 /**
11 These macros will swap the bytes of the @a value variable from little
12 endian to big endian or vice versa unconditionally, i.e. independently of the
13 current platform.
14 */
15 wxInt32 wxINT32_SWAP_ALWAYS(wxInt32 value);
16 wxUint32 wxUINT32_SWAP_ALWAYS(wxUint32 value);
17 wxInt16 wxINT16_SWAP_ALWAYS(wxInt16 value);
18 wxUint16 wxUINT16_SWAP_ALWAYS(wxUint16 value);
19 //@}
20
21
22 //@{
23 /**
24 This macro will swap the bytes of the @a value variable from little
25 endian to big endian or vice versa if the program is compiled on a
26 little-endian architecture (such as Intel PCs). If the program has
27 been compiled on a big-endian architecture, the value will be unchanged.
28 Use these macros to read data from and write data to a file that stores
29 data in big-endian format.
30 */
31 wxInt32 wxINT32_SWAP_ON_LE(wxInt32 value);
32 wxUint32 wxUINT32_SWAP_ON_LE(wxUint32 value);
33 wxInt16 wxINT16_SWAP_ON_LE(wxInt16 value);
34 wxUint16 wxUINT16_SWAP_ON_LE(wxUint16 value);
35 //@}
36
37 /**
38 This macro is similar to wxDEPRECATED but can be used
39 to not only declare the function @a func as deprecated but to also provide
40 its (inline) implementation @e body.
41 It can be used as following:
42
43 @code
44 class wxFoo
45 {
46 public:
47 // OldMethod() is deprecated, use NewMethod() instead
48 void NewMethod();
49 wxDEPRECATED_INLINE( void OldMethod(), NewMethod() );
50 };
51 @endcode
52 */
53 #define wxDEPRECATED_INLINE(func, body) /* implementation is private */
54
55 /**
56 @c wxEXPLICIT is a macro which expands to the C++ @c explicit keyword if
57 the compiler supports it or nothing otherwise. Thus, it can be used even in the
58 code which might have to be compiled with an old compiler without support for
59 this language feature but still take advantage of it when it is available.
60 */
61
62
63 /**
64 GNU C++ compiler gives a warning for any class whose destructor is private
65 unless it has a friend. This warning may sometimes be useful but it doesn't
66 make sense for reference counted class which always delete themselves (hence
67 destructor should be private) but don't necessarily have any friends, so this
68 macro is provided to disable the warning in such case. The @a name parameter
69 should be the name of the class but is only used to construct a unique friend
70 class name internally. Example of using the macro:
71
72 @code
73 class RefCounted
74 {
75 public:
76 RefCounted() { m_nRef = 1; }
77 void IncRef() { m_nRef++ ; }
78 void DecRef() { if ( !--m_nRef ) delete this; }
79
80 private:
81 ~RefCounted() { }
82
83 wxSUPPRESS_GCC_PRIVATE_DTOR(RefCounted)
84 };
85 @endcode
86
87 Notice that there should be no semicolon after this macro.
88 */
89 #define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name) /* implementation is private */
90
91 //@{
92 /**
93 This macro will swap the bytes of the @a value variable from little
94 endian to big endian or vice versa if the program is compiled on a
95 big-endian architecture (such as Sun work stations). If the program has
96 been compiled on a little-endian architecture, the value will be unchanged.
97 Use these macros to read data from and write data to a file that stores
98 data in little-endian (for example Intel i386) format.
99 */
100 wxInt32 wxINT32_SWAP_ON_BE(wxInt32 value);
101 wxUint32 wxUINT32_SWAP_ON_BE(wxUint32 value);
102 wxInt16 wxINT16_SWAP_ON_BE(wxInt16 value);
103 wxUint16 wxUINT16_SWAP_ON_BE(wxUint16 value);
104 //@}
105
106 /**
107 This macro can be used around a function declaration to generate warnings
108 indicating that this function is deprecated (i.e. obsolete and planned to be
109 removed in the future) when it is used. Only Visual C++ 7 and higher and g++
110 compilers currently support this functionality.
111 Example of use:
112
113 @code
114 // old function, use wxString version instead
115 wxDEPRECATED( void wxGetSomething(char *buf, size_t len) );
116
117 // ...
118 wxString wxGetSomething();
119 @endcode
120 */
121
122
123 /**
124 This macro is the same as the standard C99 @c va_copy for the compilers
125 which support it or its replacement for those that don't. It must be used to
126 preserve the value of a @c va_list object if you need to use it after
127 passing it to another function because it can be modified by the latter.
128 As with @c va_start, each call to @c wxVaCopy must have a matching
129 @c va_end.
130 */
131 void wxVaCopy(va_list argptrDst, va_list argptrSrc);
132
133 /**
134 This is a special version of wxDEPRECATED macro which
135 only does something when the deprecated function is used from the code outside
136 wxWidgets itself but doesn't generate warnings when it is used from wxWidgets.
137 It is used with the virtual functions which are called by the library itself --
138 even if such function is deprecated the library still has to call it to ensure
139 that the existing code overriding it continues to work, but the use of this
140 macro ensures that a deprecation warning will be generated if this function is
141 used from the user code or, in case of Visual C++, even when it is simply
142 overridden.
143 */
144
145