Quarks qtGui: add 'Source' button for classes/methods list, and some cleanups
[supercollider.git] / QtCollider / Common.cpp
bloba9b68351ccdd4283c9b526e95640185ea87786f6
1 #include "Common.h"
2 #include "Slot.h"
4 #include <PyrKernel.h>
5 #include <VMGlobals.h>
6 #include <PyrLexer.h>
8 void QtCollider::lockLang()
10 qcDebugMsg(2,"locking lang!");
11 pthread_mutex_lock (&gLangMutex);
12 qcDebugMsg(2,"locked");
13 return;
16 // WARNING: QtCollider::lockLang() must be called before
17 void QtCollider::runLang (
18 PyrObjectHdr *receiver,
19 PyrSymbol *method,
20 const QList<QVariant> & args,
21 PyrSlot *result )
23 VMGlobals *g = gMainVMGlobals;
24 g->canCallOS = true;
25 ++g->sp; SetObject(g->sp, receiver);
26 Q_FOREACH( QVariant var, args ) {
27 ++g->sp;
28 if( Slot::setVariant( g->sp, var ) )
29 SetNil( g->sp );
31 runInterpreter(g, method, args.size() + 1);
32 g->canCallOS = false;
33 if (result) slotCopy(result, &g->result);
36 int QtCollider::wrongThreadError ()
38 qcErrorMsg( "You can not use this Qt functionality in the current thread. "
39 "Try scheduling on AppClock instead." );
40 return errFailed;