48 #ifndef QT_NO_DATASTREAM
53 #error qmetatype.h must be included before any header file that defines Bool
66 Void = 0,
Bool = 1, Int = 2, UInt = 3, LongLong = 4, ULongLong = 5,
86 FirstCoreExtType = 128 ,
87 VoidStar = 128, Long = 129, Short = 130, Char = 131, ULong = 132,
88 UShort = 133, UChar = 134, Float = 135, QObjectStar = 136, QWidgetStar = 137,
93 #if defined(QT_COORD_TYPE)
95 #elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
104 typedef void (*Destructor)(
void *);
105 typedef void *(*Constructor)(
const void *);
107 #ifndef QT_NO_DATASTREAM
109 typedef void (*LoadOperator)(QDataStream &,
void *);
110 static void registerStreamOperators(
const char *typeName, SaveOperator saveOp,
111 LoadOperator loadOp);
112 static void registerStreamOperators(
int type, SaveOperator saveOp,
113 LoadOperator loadOp);
115 static int registerType(
const char *typeName, Destructor destructor,
117 static int registerTypedef(
const char *typeName,
int aliasId);
118 static int type(
const char *typeName);
119 static const char *typeName(
int type);
120 static bool isRegistered(
int type);
121 static void *construct(
int type,
const void *copy = 0);
122 static void destroy(
int type,
void *
data);
123 static void unregisterType(
const char *typeName);
125 #ifndef QT_NO_DATASTREAM
126 static bool save(QDataStream &stream,
int type,
const void *
data);
127 static bool load(QDataStream &stream,
int type,
void *
data);
131 template <
typename T>
137 template <
typename T>
142 return new T(*static_cast<const T*>(t));
145 #ifndef QT_NO_DATASTREAM
146 template <
typename T>
152 template <
typename T>
157 #endif // QT_NO_DATASTREAM
159 template <
typename T>
165 template <
typename T>
173 template <typename T, bool Defined = QMetaTypeId2<T>::Defined>
184 template <
typename T>
195 typedef void*(*ConstructPtr)(
const T*);
196 ConstructPtr cptr = qMetaTypeConstructHelper<T>;
197 typedef void(*DeletePtr)(T*);
198 DeletePtr dptr = qMetaTypeDeleteHelper<T>;
201 reinterpret_cast<QMetaType::Constructor>(cptr));
204 #ifndef QT_NO_DATASTREAM
205 template <
typename T>
213 typedef void(*LoadPtr)(QDataStream &, T *);
214 SavePtr sptr = qMetaTypeSaveHelper<T>;
215 LoadPtr lptr = qMetaTypeLoadHelper<T>;
217 qRegisterMetaType<T>(typeName);
219 reinterpret_cast<QMetaType::LoadOperator>(lptr));
221 #endif // QT_NO_DATASTREAM
223 template <
typename T>
233 template <
typename T>
235 #
if !defined(qdoc) && !defined(Q_CC_SUN)
247 #ifndef QT_NO_DATASTREAM
248 template <
typename T>
252 typedef void(*LoadPtr)(QDataStream &, T *);
253 SavePtr sptr = qMetaTypeSaveHelper<T>;
254 LoadPtr lptr = qMetaTypeLoadHelper<T>;
256 register int id = qMetaTypeId<T>();
258 reinterpret_cast<QMetaType::SaveOperator>(sptr),
259 reinterpret_cast<QMetaType::LoadOperator>(lptr));
265 #define Q_DECLARE_METATYPE(TYPE) \
268 struct QMetaTypeId< TYPE > \
270 enum { Defined = 1 }; \
271 static int qt_metatype_id() \
273 static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
275 metatype_id = qRegisterMetaType< TYPE >(#TYPE, \
276 reinterpret_cast< TYPE *>(quintptr(-1))); \
277 return metatype_id; \
282 #define Q_DECLARE_BUILTIN_METATYPE(TYPE, NAME) \
284 template<> struct QMetaTypeId2<TYPE> \
286 enum { Defined = 1, MetaType = QMetaType::NAME }; \
287 static inline int qt_metatype_id() { return QMetaType::NAME; } \
416 #endif // QMETATYPE_H
GLuint GLuint GLsizei GLenum type
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
#define QT_BEGIN_NAMESPACE
GLsizei GLsizei GLenum GLenum const GLvoid * data
typedef Bool(APIENTRYP PFNGLXMAKECONTEXTCURRENTPROC)(Display *dpy