initial import
src/lib/lisp-object.h
Sun Apr 5 19:56:16 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* initial import
--- old-qt.core/src/lib/lisp-object.h 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.core/src/lib/lisp-object.h 2014-11-11 13:36:59.000000000 +0100
@@ -0,0 +1,82 @@
+#ifndef LISP_OBJECT_H
+#define LISP_OBJECT_H
+
+#include <QMetaType>
+#include <QSharedData>
+#include <QExplicitlySharedDataPointer>
+#include <smoke.h>
+
+
+extern "C"
+{
+ int
+ qt_smoke_setup_lisp_object(void* destruct);
+
+ int
+ qt_smoke_lisp_object_id(const void* object);
+
+ int
+ qt_smoke_lisp_object_set(const void* object);
+
+ void*
+ qt_smoke_make_lisp_object(int id);
+
+ void*
+ qt_smoke_free_lisp_object(void* object);
+
+ void*
+ qt_smoke_lisp_object_value(const void* variant);
+}
+
+namespace cl_smoke {
+namespace qt {
+
+class lisp_object
+{
+ public:
+ typedef void (*destructor)(int id);
+
+ lisp_object();
+
+ lisp_object(int id);
+
+ lisp_object(const lisp_object& other);
+
+ inline int
+ id() const
+ { Q_ASSERT(this->set()); return d->id; }
+
+ void
+ set_id(int id);
+
+ inline bool
+ set() const
+ { return d->is_set; }
+
+ friend int
+ ::qt_smoke_setup_lisp_object(void* destruct);
+
+ private:
+ struct data : public QSharedData
+ {
+ data();
+ data(int id);
+ ~data();
+ int id;
+ bool is_set;
+
+ private:
+ Q_DISABLE_COPY(data)
+ };
+
+ QExplicitlySharedDataPointer<data> d;
+
+ static destructor destruct;
+};
+
+} // namespace qt
+} // namespace cl_smoke
+
+Q_DECLARE_METATYPE(cl_smoke::qt::lisp_object);
+
+#endif // LISP_OBJECT_H