summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <kiagiadakis.george@gmail.com>2010-03-22 16:13:50 +0200
committerGeorge Kiagiadakis <kiagiadakis.george@gmail.com>2010-03-22 16:13:50 +0200
commitb08b62e3dd943a041051e125b31f588e0fee5c82 (patch)
tree80738a74a71209af26e6b64ff25cb90888b923e3
parentef8454fd3e8aef37888c7a584ad77c15fd959dee (diff)
Add protected constructors/destructor to all wrapper classes, so that they can only be used with RefPointer.
-rw-r--r--src/QGlib/closure.h2
-rw-r--r--src/QGlib/global.h11
-rw-r--r--src/QGlib/object.h2
-rw-r--r--src/QGlib/paramspec.h2
-rw-r--r--src/QGst/global.h10
-rw-r--r--src/QGst/object.h2
6 files changed, 22 insertions, 7 deletions
diff --git a/src/QGlib/closure.h b/src/QGlib/closure.h
index 7cd5a79..9f84215 100644
--- a/src/QGlib/closure.h
+++ b/src/QGlib/closure.h
@@ -26,7 +26,7 @@ namespace QGlib {
class Closure : public RefCountedObject
{
- QGLIB_WRAPPER(GClosure)
+ QGLIB_WRAPPER(Closure)
public:
void setMarshaller(void (*marshaller)(GClosure*, GValue*, uint, const GValue*, void*, void*));
diff --git a/src/QGlib/global.h b/src/QGlib/global.h
index 3fb465b..b1aa18c 100644
--- a/src/QGlib/global.h
+++ b/src/QGlib/global.h
@@ -66,10 +66,15 @@ struct GetType<T*> { inline operator Type() { return Type::Pointer; } };
}
-#define QGLIB_WRAPPER(GlibClass) \
+#define QGLIB_WRAPPER(Class) \
public: \
- typedef GlibClass CType; \
- private:
+ typedef G##Class CType; \
+ protected: \
+ Class() {} \
+ Class(const Class &); \
+ Class & operator=(const Class &); \
+ ~Class() {} \
+ template <class T> friend class QGlib::RefPointer;
template <class T>
diff --git a/src/QGlib/object.h b/src/QGlib/object.h
index 0e76e43..74391a0 100644
--- a/src/QGlib/object.h
+++ b/src/QGlib/object.h
@@ -24,7 +24,7 @@ namespace QGlib {
class Object : public RefCountedObject
{
- QGLIB_WRAPPER(GObject)
+ QGLIB_WRAPPER(Object)
public:
ParamSpecPtr findProperty(const char *name) const;
QList<ParamSpecPtr> listProperties() const;
diff --git a/src/QGlib/paramspec.h b/src/QGlib/paramspec.h
index 37b68cb..9eaf30a 100644
--- a/src/QGlib/paramspec.h
+++ b/src/QGlib/paramspec.h
@@ -23,7 +23,7 @@ namespace QGlib {
class ParamSpec : public RefCountedObject
{
- QGLIB_WRAPPER(GParamSpec)
+ QGLIB_WRAPPER(ParamSpec)
public:
enum ParamFlag { //codegen: prefix=G_PARAM_, ReadWrite=READWRITE
Readable = 1<<0,
diff --git a/src/QGst/global.h b/src/QGst/global.h
index d1e4fad..37c4184 100644
--- a/src/QGst/global.h
+++ b/src/QGst/global.h
@@ -28,4 +28,14 @@ typedef QGlib::RefPointer<Object> ObjectPtr;
}
+#define QGST_WRAPPER(Class) \
+ public: \
+ typedef Gst##Class CType; \
+ protected: \
+ Class() {} \
+ Class(const Class &); \
+ Class & operator=(const Class &); \
+ ~Class() {} \
+ template <class T> friend class QGlib::RefPointer;
+
#endif
diff --git a/src/QGst/object.h b/src/QGst/object.h
index d568f57..825af1d 100644
--- a/src/QGst/object.h
+++ b/src/QGst/object.h
@@ -24,7 +24,7 @@ namespace QGst {
class Object : public QGlib::Object
{
- QGLIB_WRAPPER(GstObject)
+ QGST_WRAPPER(Object)
protected:
virtual void ref();
virtual void unref();