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 #include "primitives.h"
23 #include "../Common.h"
24 #include "QC_Export.h"
25 #include "QtCollider.h"
29 using namespace QtCollider
;
31 LangPrimitiveList
& QtCollider::langPrimitives() {
32 static LangPrimitiveList
* primitives
= new LangPrimitiveList();
36 namespace QtCollider
{
38 PyrSymbol
*s_interpretCmdLine
;
39 PyrSymbol
*s_interpretPrintCmdLine
;
40 PyrSymbol
*s_doFunction
;
41 PyrSymbol
*s_doDrawFunc
;
47 PyrSymbol
*s_FloatArray
;
48 PyrSymbol
*s_SymbolArray
;
50 PyrSymbol
*s_QPalette
;
54 PyrSymbol
*s_QTreeViewItem
;
57 void initPrimitives () {
60 qcDebugMsg(1,"initializing QtGUI primitives");
62 int base
= nextPrimitiveIndex();
64 LangPrimitiveList
& primitives
= langPrimitives();
66 Q_FOREACH( LangPrimitiveData p
, primitives
) {
67 qcDebugMsg(2, QString("defining primitive '%1'").arg(p
.name
) );
68 definePrimitive( base
, index
++, p
.name
, p
.mediator
, p
.argc
+ 1, 0 );
71 s_interpretCmdLine
= getsym("interpretCmdLine");
72 s_interpretPrintCmdLine
= getsym("interpretPrintCmdLine");
74 s_doFunction
= getsym("doFunction");
75 s_doDrawFunc
= getsym("doDrawFunc");
77 s_Rect
= getsym("Rect");
78 s_Point
= getsym("Point");
79 s_Size
= getsym("Size");
80 s_Color
= getsym("Color");
81 s_Array
= getsym("Array");
82 s_FloatArray
= getsym("FloatArray");
83 s_SymbolArray
= getsym("SymbolArray");
84 s_String
= getsym("String");
85 s_QObject
= getsym("QObject");
86 s_QLayout
= getsym("QLayout");
87 s_QFont
= getsym("QFont");
88 s_QPalette
= getsym("QPalette");
89 s_QTreeViewItem
= getsym("QTreeViewItem");
92 } // namespace QtCollider