QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
global.h
00001 /*
00002     Copyright (C) 2009-2010  George Kiagiadakis <kiagiadakis.george@gmail.com>
00003 
00004     This library is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU Lesser General Public License as published
00006     by the Free Software Foundation; either version 2.1 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public License
00015     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 #ifndef QGLIB_GLOBAL_H
00018 #define QGLIB_GLOBAL_H
00019 
00020 // workaround for https://bugreports.qt-project.org/browse/QTBUG-22829
00021 #if defined(Q_MOC_RUN) && !defined(BOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
00022 #define BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
00023 #endif
00024 
00025 #include <QtCore/QtGlobal>
00026 #include <boost/config.hpp>
00027 
00028 /* defined by cmake when building this library */
00029 #if defined(QtGLib_EXPORTS)
00030 # define QTGLIB_EXPORT Q_DECL_EXPORT
00031 #else
00032 # define QTGLIB_EXPORT Q_DECL_IMPORT
00033 #endif
00034 
00035 #if !defined(Q_OS_WIN) && !defined(Q_CC_NOKIAX86) && \
00036     !defined(Q_CC_RVCT) && defined(QT_VISIBILITY_AVAILABLE)
00037 # define QTGLIB_NO_EXPORT __attribute__((visibility("hidden")))
00038 #else
00039 # define QTGLIB_NO_EXPORT
00040 #endif
00041 
00042 typedef struct _GValue GValue;
00043 typedef struct _GParamSpec GParamSpec;
00044 typedef struct _GClosure GClosure;
00045 typedef struct _GObject GObject;
00046 typedef struct _GError GError;
00047 
00048 namespace QGlib {
00049 
00050 class Error;
00051 class Value;
00052 class Quark;
00053 class Type;
00054 class Signal;
00055 class SignalHandler;
00056 template <class T> class RefPointer;
00057 class ParamSpec;
00058 typedef RefPointer<ParamSpec> ParamSpecPtr;
00059 class Object;
00060 typedef RefPointer<Object> ObjectPtr;
00061 
00062 } //namespace QGlib
00063 
00064 
00065 #define QGLIB_WRAPPER_DECLARATION_MACRO(CppClass, CClass, CNamespace, FakeSuperClass) \
00066     public: \
00067         typedef CNamespace##CClass CType; \
00068     protected: \
00069         CppClass() {} \
00070         CppClass(const CppClass &); \
00071         CppClass & operator=(const CppClass &); \
00072         ~CppClass() {} \
00073         friend QGlib::RefCountedObject* FakeSuperClass##_new(void*); \
00074     private:
00075 
00076 #define QGLIB_WRAPPER(Class) \
00077     QGLIB_WRAPPER_DECLARATION_MACRO(Class, Class, G, Class)
00078 
00079 #define QGLIB_WRAPPER_DIFFERENT_C_CLASS(Class, CClass) \
00080     QGLIB_WRAPPER_DECLARATION_MACRO(Class, CClass, G, Class)
00081 
00082 
00083 #if !defined(BOOST_NO_STATIC_ASSERT) //we have c++0x static_assert
00084 # define QGLIB_STATIC_ASSERT(expr, message) static_assert(expr, message)
00085 # define QGLIB_HAVE_CXX0X_STATIC_ASSERT 1
00086 #else
00087 # include <boost/static_assert.hpp>
00088 # define QGLIB_STATIC_ASSERT(expr, message) BOOST_STATIC_ASSERT(expr)
00089 #endif
00090 
00091 //check for the C++0x features that we need
00092 #if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_NO_RVALUE_REFERENCES)
00093 # define QGLIB_HAVE_CXX0X 1
00094 #else
00095 # define QGLIB_HAVE_CXX0X 0
00096 #endif
00097 
00098 #endif