File: Common.h

package info (click to toggle)
supercollider 1%3A3.10.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 45,496 kB
  • sloc: cpp: 283,513; lisp: 74,040; ansic: 72,252; sh: 23,016; python: 7,175; makefile: 1,087; perl: 766; java: 677; yacc: 314; lex: 175; ruby: 136; objc: 65; xml: 15
file content (118 lines) | stat: -rw-r--r-- 2,942 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/************************************************************************
*
* Copyright 2010 Jakob Leben (jakob.leben@gmail.com)
*
* This file is part of SuperCollider Qt GUI.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
************************************************************************/

#pragma once

#include "debug.h"

#include <QList>
#include <QVariant>
#include <QEvent>
#include <QMutex>
#include <QWaitCondition>
#include <QVector>

#include <SCBase.h>
#include <PyrSymbol.h>
#include <PyrObject.h>
#include <PyrSched.h>

Q_DECLARE_METATYPE( PyrObject * );
Q_DECLARE_METATYPE( QVector<double> );
Q_DECLARE_METATYPE( QVector<int> );

namespace QtCollider {

  enum EventType {
    Event_SCRequest_Work = QEvent::User,
    Event_SCRequest_Tick,
    Event_SCRequest_Quit,
    Event_ScMethodCall,
    Event_Refresh,
    Event_Proxy_SetProperty,
    Event_Proxy_Destroy,
    Event_Proxy_BringFront,
    Event_Proxy_SetFocus,
    Event_Proxy_SetAlwaysOnTop,
    Event_Proxy_Release
  };

  enum Synchronicity {
    Synchronous,
    Asynchronous
  };

  inline void lockLang()
  {
    qcDebugMsg(2,"locking lang!");
    gLangMutex.lock();
    qcDebugMsg(2,"locked");
  }

  inline void unlockLang()
  {
    gLangMutex.unlock();
    qcDebugMsg(2,"unlocked");
  }

  void runLang (
    PyrObjectHdr *receiver,
    PyrSymbol *method,
    const QList<QVariant> & args = QList<QVariant>(),
    PyrSlot *result = 0 );

  int wrongThreadError ();

  QPalette systemPalette();

#define QC_DO_SYMBOLS \
  QC_DO_SYMBOL(interpretCmdLine); \
  QC_DO_SYMBOL(interpretPrintCmdLine); \
  QC_DO_SYMBOL(doFunction); \
  QC_DO_SYMBOL(doDrawFunc); \
  QC_DO_SYMBOL(prRelease); \
  QC_DO_SYMBOL(Rect); \
  QC_DO_SYMBOL(Point); \
  QC_DO_SYMBOL(Color); \
  QC_DO_SYMBOL(Size); \
  QC_DO_SYMBOL(QPalette); \
  QC_DO_SYMBOL(Font); \
  QC_DO_SYMBOL(QCallback); \
  QC_DO_SYMBOL(WebPage); \
  QC_DO_SYMBOL(QObject); \
  QC_DO_SYMBOL(Layout); \
  QC_DO_SYMBOL(ScrollCanvas); \
  QC_DO_SYMBOL(TreeViewItem); \
  QC_DO_SYMBOL(Gradient); \
  QC_DO_SYMBOL(HiliteGradient); \
  QC_DO_SYMBOL(AbstractMenuAction); \
  QC_DO_SYMBOL(Menu); \
  QC_DO_SYMBOL(View); \
  QC_DO_SYMBOL(Image);

#define QC_DO_SYMBOL(SYM) extern PyrSymbol * sym_##SYM
QC_DO_SYMBOLS
#undef QC_DO_SYMBOL

#define SC_SYM( SYM ) QtCollider::sym_##SYM
#define SC_CLASS( SYM ) SC_SYM(SYM)->u.classobj

}