Split up in qt.core.
Annotate for file src/lib/lisp_object.h
2009-04-05 tobias 1 #ifndef LISP_OBJECT_H
17:56:16 ' 2 #define LISP_OBJECT_H
' 3
2010-01-10 tobias 4 #include "cl_smoke_qt.h"
08:52:09 ' 5
2009-04-05 tobias 6 #include <QMetaType>
17:56:16 ' 7 #include <QSharedData>
' 8 #include <QExplicitlySharedDataPointer>
' 9 #include <smoke.h>
' 10
' 11 extern "C"
' 12 {
2009-05-11 tobias 13 CL_SMOKE_QT_EXPORT int
2010-01-10 tobias 14 cl_smoke_setup_lisp_object(void* destruct);
2009-04-05 tobias 15
2009-07-02 tobias 16 CL_SMOKE_QT_EXPORT unsigned int
2010-01-10 tobias 17 cl_smoke_lisp_object_id(const void* object);
2009-04-05 tobias 18
2009-05-11 tobias 19 CL_SMOKE_QT_EXPORT int
2010-01-10 tobias 20 cl_smoke_lisp_object_is_set(const void* object);
2009-04-05 tobias 21
2009-05-11 tobias 22 CL_SMOKE_QT_EXPORT void*
2010-01-10 tobias 23 cl_smoke_make_lisp_object(unsigned int id);
2009-04-05 tobias 24
2009-05-11 tobias 25 CL_SMOKE_QT_EXPORT void*
2010-01-10 tobias 26 cl_smoke_free_lisp_object(void* object);
2009-04-05 tobias 27
2009-05-11 tobias 28 CL_SMOKE_QT_EXPORT void*
2010-01-10 tobias 29 cl_smoke_lisp_object_value(const void* variant);
2009-04-05 tobias 30 }
17:56:16 ' 31
' 32 namespace cl_smoke {
' 33 namespace qt {
' 34
' 35 class lisp_object
' 36 {
' 37 public:
2009-07-02 tobias 38 typedef void (*destructor)(unsigned int id);
2009-04-05 tobias 39
17:56:16 ' 40 lisp_object();
' 41
2009-07-02 tobias 42 lisp_object(unsigned int id);
2009-04-05 tobias 43
17:56:16 ' 44 lisp_object(const lisp_object& other);
' 45
2009-07-02 tobias 46 inline unsigned int
2009-04-05 tobias 47 id() const
17:56:16 ' 48 { Q_ASSERT(this->set()); return d->id; }
' 49
' 50 void
2009-07-02 tobias 51 set_id(unsigned int id);
2009-04-05 tobias 52
17:56:16 ' 53 inline bool
' 54 set() const
' 55 { return d->is_set; }
' 56
' 57 friend int
2010-01-10 tobias 58 ::cl_smoke_setup_lisp_object(void* destruct);
2009-04-05 tobias 59
17:56:16 ' 60 private:
' 61 struct data : public QSharedData
' 62 {
' 63 data();
2009-07-02 tobias 64 data(unsigned int id);
2009-04-05 tobias 65 ~data();
2009-07-02 tobias 66 unsigned int id;
2009-04-05 tobias 67 bool is_set;
17:56:16 ' 68
' 69 private:
' 70 Q_DISABLE_COPY(data)
' 71 };
' 72
' 73 QExplicitlySharedDataPointer<data> d;
' 74
' 75 static destructor destruct;
' 76 };
' 77
' 78 } // namespace qt
' 79 } // namespace cl_smoke
' 80
' 81 Q_DECLARE_METATYPE(cl_smoke::qt::lisp_object);
' 82
' 83 #endif // LISP_OBJECT_H