QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
global.h
1 /*
2  Copyright (C) 2009-2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #ifndef QGLIB_GLOBAL_H
18 #define QGLIB_GLOBAL_H
19 
20 // workaround for https://bugreports.qt-project.org/browse/QTBUG-22829
21 #if defined(Q_MOC_RUN) && !defined(BOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
22 #define BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
23 #endif
24 
25 #include <QtCore/QtGlobal>
26 #include <boost/config.hpp>
27 
28 /* defined by cmake when building this library */
29 #if defined(QtGLib_EXPORTS) || defined(Qt5GLib_EXPORTS)
30 # define QTGLIB_EXPORT Q_DECL_EXPORT
31 #else
32 # define QTGLIB_EXPORT Q_DECL_IMPORT
33 #endif
34 
35 #if !defined(Q_OS_WIN) && !defined(Q_CC_NOKIAX86) && \
36  !defined(Q_CC_RVCT) && defined(QT_VISIBILITY_AVAILABLE)
37 # define QTGLIB_NO_EXPORT __attribute__((visibility("hidden")))
38 #else
39 # define QTGLIB_NO_EXPORT
40 #endif
41 
42 typedef struct _GValue GValue;
43 typedef struct _GParamSpec GParamSpec;
44 typedef struct _GClosure GClosure;
45 typedef struct _GObject GObject;
46 typedef struct _GError GError;
47 
48 namespace QGlib {
49 
50 class Error;
51 class Value;
52 class Quark;
53 class Type;
54 class Signal;
55 class SignalHandler;
56 template <class T> class RefPointer;
57 class ParamSpec;
59 class Object;
61 
62 } //namespace QGlib
63 
64 
65 #define QGLIB_WRAPPER_DECLARATION_MACRO(CppClass, CClass, CNamespace, FakeSuperClass) \
66  public: \
67  typedef CNamespace##CClass CType; \
68  protected: \
69  CppClass() {} \
70  CppClass(const CppClass &); \
71  CppClass & operator=(const CppClass &); \
72  ~CppClass() {} \
73  friend QGlib::RefCountedObject* FakeSuperClass##_new(void*); \
74  private:
75 
76 #define QGLIB_WRAPPER(Class) \
77  QGLIB_WRAPPER_DECLARATION_MACRO(Class, Class, G, Class)
78 
79 #define QGLIB_WRAPPER_DIFFERENT_C_CLASS(Class, CClass) \
80  QGLIB_WRAPPER_DECLARATION_MACRO(Class, CClass, G, Class)
81 
82 
83 #if !defined(BOOST_NO_STATIC_ASSERT) //we have c++0x static_assert
84 # define QGLIB_STATIC_ASSERT(expr, message) static_assert(expr, message)
85 # define QGLIB_HAVE_CXX0X_STATIC_ASSERT 1
86 #else
87 # include <boost/static_assert.hpp>
88 # define QGLIB_STATIC_ASSERT(expr, message) BOOST_STATIC_ASSERT(expr)
89 #endif
90 
91 //check for the C++0x features that we need
92 #if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_NO_RVALUE_REFERENCES)
93 # define QGLIB_HAVE_CXX0X 1
94 #else
95 # define QGLIB_HAVE_CXX0X 0
96 #endif
97 
98 #endif
Smart pointer class for working with wrapper classes that support reference counting.
Definition: global.h:56
Wrapper class for GParamSpec.
Definition: paramspec.h:34
Wrapper class for GObject.
Definition: object.h:89