1 /************************************************************************
3 * Copyright 2010 Jakob Leben (jakob.leben@gmail.com)
5 * This file is part of SuperCollider Qt GUI.
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ************************************************************************/
22 #ifndef _SC_QT_COMMON_H
23 #define _SC_QT_COMMON_H
31 #include <QWaitCondition>
35 #include <PyrSymbol.h>
36 #include <PyrObject.h>
40 extern pthread_mutex_t gLangMutex
;
46 Q_DECLARE_METATYPE( VariantList
);
47 Q_DECLARE_METATYPE( PyrObject
* );
48 Q_DECLARE_METATYPE( QVector
<double> );
49 Q_DECLARE_METATYPE( QVector
<int> );
51 namespace QtCollider
{
59 Event_SCRequest_Input
= QEvent::User
,
60 Event_SCRequest_Sched
,
62 Event_SCRequest_Recompile
,
66 Event_Proxy_SetProperty
,
68 Event_Proxy_BringFront
,
70 Event_Proxy_SetAlwaysOnTop
,
71 Event_Proxy_StartDrag
,
80 inline void lockLang()
82 qcDebugMsg(2,"locking lang!");
83 pthread_mutex_lock (&gLangMutex
);
84 qcDebugMsg(2,"locked");
87 inline void unlockLang()
89 pthread_mutex_unlock(&gLangMutex
);
90 qcDebugMsg(2,"unlocked");
94 PyrObjectHdr
*receiver
,
96 const QList
<QVariant
> & args
= QList
<QVariant
>(),
97 PyrSlot
*result
= 0 );
99 int wrongThreadError ();
101 QPalette
systemPalette();
103 #define QC_DO_SYMBOLS \
104 QC_DO_SYMBOL(interpretCmdLine); \
105 QC_DO_SYMBOL(interpretPrintCmdLine); \
106 QC_DO_SYMBOL(doFunction); \
107 QC_DO_SYMBOL(doDrawFunc); \
108 QC_DO_SYMBOL(prRelease); \
109 QC_DO_SYMBOL(Rect); \
110 QC_DO_SYMBOL(Point); \
111 QC_DO_SYMBOL(Color); \
112 QC_DO_SYMBOL(Size); \
113 QC_DO_SYMBOL(QPalette); \
114 QC_DO_SYMBOL(QFont); \
115 QC_DO_SYMBOL(QObject); \
116 QC_DO_SYMBOL(QLayout); \
117 QC_DO_SYMBOL(QTreeViewItem); \
118 QC_DO_SYMBOL(Gradient); \
119 QC_DO_SYMBOL(HiliteGradient);
121 #define QC_DO_SYMBOL(SYM) extern PyrSymbol * sym_##SYM
125 #define SC_SYM( SYM ) QtCollider::sym_##SYM
126 #define SC_CLASS( SYM ) SC_SYM(SYM)->u.classobj
130 #endif //_SC_QT_COMMON_H