8aeeadb5
—
pyros2097 13 years ago
Minor Changes
- .settings/org.eclipse.core.resources.prefs +1 -0
- Bin/sqc.exe +0 -0
- Bin/sqc/include/sqstdaux.h +16 -0
- Bin/sqc/include/sqstdblob.h +20 -0
- Bin/sqc/include/sqstdio.h +53 -0
- Bin/sqc/include/sqstdmath.h +15 -0
- Bin/sqc/include/sqstdstring.h +33 -0
- Bin/sqc/include/sqstdsystem.h +15 -0
- Bin/sqc/include/squirrel.h +506 -0
- Bin/sqc/lib/libsqstdlib.a +0 -0
- Bin/sqc/lib/libsquirrel.a +0 -0
- Bin/sqc/makefile +2 -0
- Bin/sqc/sqc.cpp +45 -0
- Bin/sqc/sqc.exe +0 -0
- Bin/sqc/st.cnut +0 -0
- Bin/sqc/stest.nut +1 -0
- Icons/logosabel.png +0 -0
- Icons/logosabel.xcf +0 -0
- README.md +12 -11
- Test/sabel.png +0 -0
- Test/testMain.py +49 -0
- Test/title.wav +0 -0
- Widget/adb.py +1 -1
- Widget/adb.pyc +0 -0
- Widget/ant.py +19 -17
- Widget/editor.py +12 -9
- Widget/editor.pyc +0 -0
- Widget/parser.py +32 -39
- Widget/style.py +1 -1
- Widget/tree.py +21 -18
- Widget/tree.pyc +0 -0
- Widget/workthread.py +2 -2
- build/exe.win32-2.7/Sabel.exe +0 -0
- build/exe.win32-2.7/Sabel.zip +0 -0
- build/exe.win32-2.7/{config.yaml → config.yml} +15 -11
- build/exe.win32-2.7/library.zip +0 -0
- config.yml +4 -6
- globals.py +1 -1
- mainwindow.py +46 -31
- runtests.py +10 -0
- window.py +5 -2
.settings/org.eclipse.core.resources.prefs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
eclipse.preferences.version=1
|
|
2
2
|
encoding//Widget/audio.py=utf-8
|
|
3
|
+
encoding/runtests.py=utf-8
|
Bin/sqc.exe
CHANGED
|
Binary file
|
Bin/sqc/include/sqstdaux.h
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* see copyright notice in squirrel.h */
|
|
2
|
+
#ifndef _SQSTD_AUXLIB_H_
|
|
3
|
+
#define _SQSTD_AUXLIB_H_
|
|
4
|
+
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
SQUIRREL_API void sqstd_seterrorhandlers(HSQUIRRELVM v);
|
|
10
|
+
SQUIRREL_API void sqstd_printcallstack(HSQUIRRELVM v);
|
|
11
|
+
|
|
12
|
+
#ifdef __cplusplus
|
|
13
|
+
} /*extern "C"*/
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
#endif /* _SQSTD_AUXLIB_H_ */
|
Bin/sqc/include/sqstdblob.h
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* see copyright notice in squirrel.h */
|
|
2
|
+
#ifndef _SQSTDBLOB_H_
|
|
3
|
+
#define _SQSTDBLOB_H_
|
|
4
|
+
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
SQUIRREL_API SQUserPointer sqstd_createblob(HSQUIRRELVM v, SQInteger size);
|
|
10
|
+
SQUIRREL_API SQRESULT sqstd_getblob(HSQUIRRELVM v,SQInteger idx,SQUserPointer *ptr);
|
|
11
|
+
SQUIRREL_API SQInteger sqstd_getblobsize(HSQUIRRELVM v,SQInteger idx);
|
|
12
|
+
|
|
13
|
+
SQUIRREL_API SQRESULT sqstd_register_bloblib(HSQUIRRELVM v);
|
|
14
|
+
|
|
15
|
+
#ifdef __cplusplus
|
|
16
|
+
} /*extern "C"*/
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
#endif /*_SQSTDBLOB_H_*/
|
|
20
|
+
|
Bin/sqc/include/sqstdio.h
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* see copyright notice in squirrel.h */
|
|
2
|
+
#ifndef _SQSTDIO_H_
|
|
3
|
+
#define _SQSTDIO_H_
|
|
4
|
+
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
|
|
7
|
+
#define SQSTD_STREAM_TYPE_TAG 0x80000000
|
|
8
|
+
|
|
9
|
+
struct SQStream {
|
|
10
|
+
virtual SQInteger Read(void *buffer, SQInteger size) = 0;
|
|
11
|
+
virtual SQInteger Write(void *buffer, SQInteger size) = 0;
|
|
12
|
+
virtual SQInteger Flush() = 0;
|
|
13
|
+
virtual SQInteger Tell() = 0;
|
|
14
|
+
virtual SQInteger Len() = 0;
|
|
15
|
+
virtual SQInteger Seek(SQInteger offset, SQInteger origin) = 0;
|
|
16
|
+
virtual bool IsValid() = 0;
|
|
17
|
+
virtual bool EOS() = 0;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
extern "C" {
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
#define SQ_SEEK_CUR 0
|
|
24
|
+
#define SQ_SEEK_END 1
|
|
25
|
+
#define SQ_SEEK_SET 2
|
|
26
|
+
|
|
27
|
+
typedef void* SQFILE;
|
|
28
|
+
|
|
29
|
+
SQUIRREL_API SQFILE sqstd_fopen(const SQChar *,const SQChar *);
|
|
30
|
+
SQUIRREL_API SQInteger sqstd_fread(SQUserPointer, SQInteger, SQInteger, SQFILE);
|
|
31
|
+
SQUIRREL_API SQInteger sqstd_fwrite(const SQUserPointer, SQInteger, SQInteger, SQFILE);
|
|
32
|
+
SQUIRREL_API SQInteger sqstd_fseek(SQFILE , SQInteger , SQInteger);
|
|
33
|
+
SQUIRREL_API SQInteger sqstd_ftell(SQFILE);
|
|
34
|
+
SQUIRREL_API SQInteger sqstd_fflush(SQFILE);
|
|
35
|
+
SQUIRREL_API SQInteger sqstd_fclose(SQFILE);
|
|
36
|
+
SQUIRREL_API SQInteger sqstd_feof(SQFILE);
|
|
37
|
+
|
|
38
|
+
SQUIRREL_API SQRESULT sqstd_createfile(HSQUIRRELVM v, SQFILE file,SQBool own);
|
|
39
|
+
SQUIRREL_API SQRESULT sqstd_getfile(HSQUIRRELVM v, SQInteger idx, SQFILE *file);
|
|
40
|
+
|
|
41
|
+
//compiler helpers
|
|
42
|
+
SQUIRREL_API SQRESULT sqstd_loadfile(HSQUIRRELVM v,const SQChar *filename,SQBool printerror);
|
|
43
|
+
SQUIRREL_API SQRESULT sqstd_dofile(HSQUIRRELVM v,const SQChar *filename,SQBool retval,SQBool printerror);
|
|
44
|
+
SQUIRREL_API SQRESULT sqstd_writeclosuretofile(HSQUIRRELVM v,const SQChar *filename);
|
|
45
|
+
|
|
46
|
+
SQUIRREL_API SQRESULT sqstd_register_iolib(HSQUIRRELVM v);
|
|
47
|
+
|
|
48
|
+
#ifdef __cplusplus
|
|
49
|
+
} /*extern "C"*/
|
|
50
|
+
#endif
|
|
51
|
+
|
|
52
|
+
#endif /*_SQSTDIO_H_*/
|
|
53
|
+
|
Bin/sqc/include/sqstdmath.h
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* see copyright notice in squirrel.h */
|
|
2
|
+
#ifndef _SQSTD_MATH_H_
|
|
3
|
+
#define _SQSTD_MATH_H_
|
|
4
|
+
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
SQUIRREL_API SQRESULT sqstd_register_mathlib(HSQUIRRELVM v);
|
|
10
|
+
|
|
11
|
+
#ifdef __cplusplus
|
|
12
|
+
} /*extern "C"*/
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
#endif /*_SQSTD_MATH_H_*/
|
Bin/sqc/include/sqstdstring.h
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* see copyright notice in squirrel.h */
|
|
2
|
+
#ifndef _SQSTD_STRING_H_
|
|
3
|
+
#define _SQSTD_STRING_H_
|
|
4
|
+
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
typedef unsigned int SQRexBool;
|
|
10
|
+
typedef struct SQRex SQRex;
|
|
11
|
+
|
|
12
|
+
typedef struct {
|
|
13
|
+
const SQChar *begin;
|
|
14
|
+
SQInteger len;
|
|
15
|
+
} SQRexMatch;
|
|
16
|
+
|
|
17
|
+
SQUIRREL_API SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error);
|
|
18
|
+
SQUIRREL_API void sqstd_rex_free(SQRex *exp);
|
|
19
|
+
SQUIRREL_API SQBool sqstd_rex_match(SQRex* exp,const SQChar* text);
|
|
20
|
+
SQUIRREL_API SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end);
|
|
21
|
+
SQUIRREL_API SQBool sqstd_rex_searchrange(SQRex* exp,const SQChar* text_begin,const SQChar* text_end,const SQChar** out_begin, const SQChar** out_end);
|
|
22
|
+
SQUIRREL_API SQInteger sqstd_rex_getsubexpcount(SQRex* exp);
|
|
23
|
+
SQUIRREL_API SQBool sqstd_rex_getsubexp(SQRex* exp, SQInteger n, SQRexMatch *subexp);
|
|
24
|
+
|
|
25
|
+
SQUIRREL_API SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen,SQChar **output);
|
|
26
|
+
|
|
27
|
+
SQUIRREL_API SQRESULT sqstd_register_stringlib(HSQUIRRELVM v);
|
|
28
|
+
|
|
29
|
+
#ifdef __cplusplus
|
|
30
|
+
} /*extern "C"*/
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
#endif /*_SQSTD_STRING_H_*/
|
Bin/sqc/include/sqstdsystem.h
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* see copyright notice in squirrel.h */
|
|
2
|
+
#ifndef _SQSTD_SYSTEMLIB_H_
|
|
3
|
+
#define _SQSTD_SYSTEMLIB_H_
|
|
4
|
+
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
extern "C" {
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
SQUIRREL_API SQInteger sqstd_register_systemlib(HSQUIRRELVM v);
|
|
10
|
+
|
|
11
|
+
#ifdef __cplusplus
|
|
12
|
+
} /*extern "C"*/
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
#endif /* _SQSTD_SYSTEMLIB_H_ */
|
Bin/sqc/include/squirrel.h
ADDED
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2012 Alberto Demichelis
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
|
12
|
+
all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
20
|
+
THE SOFTWARE.
|
|
21
|
+
*/
|
|
22
|
+
#ifndef _SQUIRREL_H_
|
|
23
|
+
#define _SQUIRREL_H_
|
|
24
|
+
|
|
25
|
+
#ifdef __cplusplus
|
|
26
|
+
extern "C" {
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
#ifndef SQUIRREL_API
|
|
30
|
+
#define SQUIRREL_API extern
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
#if (defined(_WIN64) || defined(_LP64))
|
|
34
|
+
#ifndef _SQ64
|
|
35
|
+
#define _SQ64
|
|
36
|
+
#endif
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
#ifdef _SQ64
|
|
40
|
+
|
|
41
|
+
#ifdef _MSC_VER
|
|
42
|
+
typedef __int64 SQInteger;
|
|
43
|
+
typedef unsigned __int64 SQUnsignedInteger;
|
|
44
|
+
typedef unsigned __int64 SQHash; /*should be the same size of a pointer*/
|
|
45
|
+
#else
|
|
46
|
+
typedef long long SQInteger;
|
|
47
|
+
typedef unsigned long long SQUnsignedInteger;
|
|
48
|
+
typedef unsigned long long SQHash; /*should be the same size of a pointer*/
|
|
49
|
+
#endif
|
|
50
|
+
typedef int SQInt32;
|
|
51
|
+
typedef unsigned int SQUnsignedInteger32;
|
|
52
|
+
#else
|
|
53
|
+
typedef int SQInteger;
|
|
54
|
+
typedef int SQInt32; /*must be 32 bits(also on 64bits processors)*/
|
|
55
|
+
typedef unsigned int SQUnsignedInteger32; /*must be 32 bits(also on 64bits processors)*/
|
|
56
|
+
typedef unsigned int SQUnsignedInteger;
|
|
57
|
+
typedef unsigned int SQHash; /*should be the same size of a pointer*/
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
#ifdef SQUSEDOUBLE
|
|
62
|
+
typedef double SQFloat;
|
|
63
|
+
#else
|
|
64
|
+
typedef float SQFloat;
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
#if defined(SQUSEDOUBLE) && !defined(_SQ64) || !defined(SQUSEDOUBLE) && defined(_SQ64)
|
|
68
|
+
#ifdef _MSC_VER
|
|
69
|
+
typedef __int64 SQRawObjectVal; //must be 64bits
|
|
70
|
+
#else
|
|
71
|
+
typedef long long SQRawObjectVal; //must be 64bits
|
|
72
|
+
#endif
|
|
73
|
+
#define SQ_OBJECT_RAWINIT() { _unVal.raw = 0; }
|
|
74
|
+
#else
|
|
75
|
+
typedef SQUnsignedInteger SQRawObjectVal; //is 32 bits on 32 bits builds and 64 bits otherwise
|
|
76
|
+
#define SQ_OBJECT_RAWINIT()
|
|
77
|
+
#endif
|
|
78
|
+
|
|
79
|
+
#ifndef SQ_ALIGNMENT // SQ_ALIGNMENT shall be less than or equal to SQ_MALLOC alignments, and its value shall be power of 2.
|
|
80
|
+
#if defined(SQUSEDOUBLE) || defined(_SQ64)
|
|
81
|
+
#define SQ_ALIGNMENT 8
|
|
82
|
+
#else
|
|
83
|
+
#define SQ_ALIGNMENT 4
|
|
84
|
+
#endif
|
|
85
|
+
#endif
|
|
86
|
+
|
|
87
|
+
typedef void* SQUserPointer;
|
|
88
|
+
typedef SQUnsignedInteger SQBool;
|
|
89
|
+
typedef SQInteger SQRESULT;
|
|
90
|
+
|
|
91
|
+
#define SQTrue (1)
|
|
92
|
+
#define SQFalse (0)
|
|
93
|
+
|
|
94
|
+
struct SQVM;
|
|
95
|
+
struct SQTable;
|
|
96
|
+
struct SQArray;
|
|
97
|
+
struct SQString;
|
|
98
|
+
struct SQClosure;
|
|
99
|
+
struct SQGenerator;
|
|
100
|
+
struct SQNativeClosure;
|
|
101
|
+
struct SQUserData;
|
|
102
|
+
struct SQFunctionProto;
|
|
103
|
+
struct SQRefCounted;
|
|
104
|
+
struct SQClass;
|
|
105
|
+
struct SQInstance;
|
|
106
|
+
struct SQDelegable;
|
|
107
|
+
struct SQOuter;
|
|
108
|
+
|
|
109
|
+
#ifdef _UNICODE
|
|
110
|
+
#define SQUNICODE
|
|
111
|
+
#endif
|
|
112
|
+
|
|
113
|
+
#ifdef SQUNICODE
|
|
114
|
+
#if (defined(_MSC_VER) && _MSC_VER >= 1400) // 1400 = VS8
|
|
115
|
+
|
|
116
|
+
#if !defined(_NATIVE_WCHAR_T_DEFINED) //this is if the compiler considers wchar_t as native type
|
|
117
|
+
#define wchar_t unsigned short
|
|
118
|
+
#endif
|
|
119
|
+
|
|
120
|
+
#else
|
|
121
|
+
typedef unsigned short wchar_t;
|
|
122
|
+
#endif
|
|
123
|
+
|
|
124
|
+
typedef wchar_t SQChar;
|
|
125
|
+
#define _SC(a) L##a
|
|
126
|
+
#define scstrcmp wcscmp
|
|
127
|
+
#define scsprintf swprintf
|
|
128
|
+
#define scstrlen wcslen
|
|
129
|
+
#define scstrtod wcstod
|
|
130
|
+
#ifdef _SQ64
|
|
131
|
+
#define scstrtol _wcstoi64
|
|
132
|
+
#else
|
|
133
|
+
#define scstrtol wcstol
|
|
134
|
+
#endif
|
|
135
|
+
#define scatoi _wtoi
|
|
136
|
+
#define scstrtoul wcstoul
|
|
137
|
+
#define scvsprintf vswprintf
|
|
138
|
+
#define scstrstr wcsstr
|
|
139
|
+
#define scisspace iswspace
|
|
140
|
+
#define scisdigit iswdigit
|
|
141
|
+
#define scisxdigit iswxdigit
|
|
142
|
+
#define scisalpha iswalpha
|
|
143
|
+
#define sciscntrl iswcntrl
|
|
144
|
+
#define scisalnum iswalnum
|
|
145
|
+
#define scprintf wprintf
|
|
146
|
+
#define MAX_CHAR 0xFFFF
|
|
147
|
+
#else
|
|
148
|
+
typedef char SQChar;
|
|
149
|
+
#define _SC(a) a
|
|
150
|
+
#define scstrcmp strcmp
|
|
151
|
+
#define scsprintf sprintf
|
|
152
|
+
#define scstrlen strlen
|
|
153
|
+
#define scstrtod strtod
|
|
154
|
+
#ifdef _SQ64
|
|
155
|
+
#ifdef _MSC_VER
|
|
156
|
+
#define scstrtol _strtoi64
|
|
157
|
+
#else
|
|
158
|
+
#define scstrtol strtoll
|
|
159
|
+
#endif
|
|
160
|
+
#else
|
|
161
|
+
#define scstrtol strtol
|
|
162
|
+
#endif
|
|
163
|
+
#define scatoi atoi
|
|
164
|
+
#define scstrtoul strtoul
|
|
165
|
+
#define scvsprintf vsprintf
|
|
166
|
+
#define scstrstr strstr
|
|
167
|
+
#define scisspace isspace
|
|
168
|
+
#define scisdigit isdigit
|
|
169
|
+
#define scisxdigit isxdigit
|
|
170
|
+
#define sciscntrl iscntrl
|
|
171
|
+
#define scisalpha isalpha
|
|
172
|
+
#define scisalnum isalnum
|
|
173
|
+
#define scprintf printf
|
|
174
|
+
#define MAX_CHAR 0xFF
|
|
175
|
+
#endif
|
|
176
|
+
|
|
177
|
+
#ifdef _SQ64
|
|
178
|
+
#define _PRINT_INT_PREC _SC("ll")
|
|
179
|
+
#define _PRINT_INT_FMT _SC("%lld")
|
|
180
|
+
#else
|
|
181
|
+
#define _PRINT_INT_FMT _SC("%d")
|
|
182
|
+
#endif
|
|
183
|
+
|
|
184
|
+
#define SQUIRREL_VERSION _SC("Squirrel 3.0.3 stable")
|
|
185
|
+
#define SQUIRREL_COPYRIGHT _SC("Copyright (C) 2003-2012 Alberto Demichelis")
|
|
186
|
+
#define SQUIRREL_AUTHOR _SC("Alberto Demichelis")
|
|
187
|
+
#define SQUIRREL_VERSION_NUMBER 303
|
|
188
|
+
|
|
189
|
+
#define SQ_VMSTATE_IDLE 0
|
|
190
|
+
#define SQ_VMSTATE_RUNNING 1
|
|
191
|
+
#define SQ_VMSTATE_SUSPENDED 2
|
|
192
|
+
|
|
193
|
+
#define SQUIRREL_EOB 0
|
|
194
|
+
#define SQ_BYTECODE_STREAM_TAG 0xFAFA
|
|
195
|
+
|
|
196
|
+
#define SQOBJECT_REF_COUNTED 0x08000000
|
|
197
|
+
#define SQOBJECT_NUMERIC 0x04000000
|
|
198
|
+
#define SQOBJECT_DELEGABLE 0x02000000
|
|
199
|
+
#define SQOBJECT_CANBEFALSE 0x01000000
|
|
200
|
+
|
|
201
|
+
#define SQ_MATCHTYPEMASKSTRING (-99999)
|
|
202
|
+
|
|
203
|
+
#define _RT_MASK 0x00FFFFFF
|
|
204
|
+
#define _RAW_TYPE(type) (type&_RT_MASK)
|
|
205
|
+
|
|
206
|
+
#define _RT_NULL 0x00000001
|
|
207
|
+
#define _RT_INTEGER 0x00000002
|
|
208
|
+
#define _RT_FLOAT 0x00000004
|
|
209
|
+
#define _RT_BOOL 0x00000008
|
|
210
|
+
#define _RT_STRING 0x00000010
|
|
211
|
+
#define _RT_TABLE 0x00000020
|
|
212
|
+
#define _RT_ARRAY 0x00000040
|
|
213
|
+
#define _RT_USERDATA 0x00000080
|
|
214
|
+
#define _RT_CLOSURE 0x00000100
|
|
215
|
+
#define _RT_NATIVECLOSURE 0x00000200
|
|
216
|
+
#define _RT_GENERATOR 0x00000400
|
|
217
|
+
#define _RT_USERPOINTER 0x00000800
|
|
218
|
+
#define _RT_THREAD 0x00001000
|
|
219
|
+
#define _RT_FUNCPROTO 0x00002000
|
|
220
|
+
#define _RT_CLASS 0x00004000
|
|
221
|
+
#define _RT_INSTANCE 0x00008000
|
|
222
|
+
#define _RT_WEAKREF 0x00010000
|
|
223
|
+
#define _RT_OUTER 0x00020000
|
|
224
|
+
|
|
225
|
+
typedef enum tagSQObjectType{
|
|
226
|
+
OT_NULL = (_RT_NULL|SQOBJECT_CANBEFALSE),
|
|
227
|
+
OT_INTEGER = (_RT_INTEGER|SQOBJECT_NUMERIC|SQOBJECT_CANBEFALSE),
|
|
228
|
+
OT_FLOAT = (_RT_FLOAT|SQOBJECT_NUMERIC|SQOBJECT_CANBEFALSE),
|
|
229
|
+
OT_BOOL = (_RT_BOOL|SQOBJECT_CANBEFALSE),
|
|
230
|
+
OT_STRING = (_RT_STRING|SQOBJECT_REF_COUNTED),
|
|
231
|
+
OT_TABLE = (_RT_TABLE|SQOBJECT_REF_COUNTED|SQOBJECT_DELEGABLE),
|
|
232
|
+
OT_ARRAY = (_RT_ARRAY|SQOBJECT_REF_COUNTED),
|
|
233
|
+
OT_USERDATA = (_RT_USERDATA|SQOBJECT_REF_COUNTED|SQOBJECT_DELEGABLE),
|
|
234
|
+
OT_CLOSURE = (_RT_CLOSURE|SQOBJECT_REF_COUNTED),
|
|
235
|
+
OT_NATIVECLOSURE = (_RT_NATIVECLOSURE|SQOBJECT_REF_COUNTED),
|
|
236
|
+
OT_GENERATOR = (_RT_GENERATOR|SQOBJECT_REF_COUNTED),
|
|
237
|
+
OT_USERPOINTER = _RT_USERPOINTER,
|
|
238
|
+
OT_THREAD = (_RT_THREAD|SQOBJECT_REF_COUNTED) ,
|
|
239
|
+
OT_FUNCPROTO = (_RT_FUNCPROTO|SQOBJECT_REF_COUNTED), //internal usage only
|
|
240
|
+
OT_CLASS = (_RT_CLASS|SQOBJECT_REF_COUNTED),
|
|
241
|
+
OT_INSTANCE = (_RT_INSTANCE|SQOBJECT_REF_COUNTED|SQOBJECT_DELEGABLE),
|
|
242
|
+
OT_WEAKREF = (_RT_WEAKREF|SQOBJECT_REF_COUNTED),
|
|
243
|
+
OT_OUTER = (_RT_OUTER|SQOBJECT_REF_COUNTED) //internal usage only
|
|
244
|
+
}SQObjectType;
|
|
245
|
+
|
|
246
|
+
#define ISREFCOUNTED(t) (t&SQOBJECT_REF_COUNTED)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
typedef union tagSQObjectValue
|
|
250
|
+
{
|
|
251
|
+
struct SQTable *pTable;
|
|
252
|
+
struct SQArray *pArray;
|
|
253
|
+
struct SQClosure *pClosure;
|
|
254
|
+
struct SQOuter *pOuter;
|
|
255
|
+
struct SQGenerator *pGenerator;
|
|
256
|
+
struct SQNativeClosure *pNativeClosure;
|
|
257
|
+
struct SQString *pString;
|
|
258
|
+
struct SQUserData *pUserData;
|
|
259
|
+
SQInteger nInteger;
|
|
260
|
+
SQFloat fFloat;
|
|
261
|
+
SQUserPointer pUserPointer;
|
|
262
|
+
struct SQFunctionProto *pFunctionProto;
|
|
263
|
+
struct SQRefCounted *pRefCounted;
|
|
264
|
+
struct SQDelegable *pDelegable;
|
|
265
|
+
struct SQVM *pThread;
|
|
266
|
+
struct SQClass *pClass;
|
|
267
|
+
struct SQInstance *pInstance;
|
|
268
|
+
struct SQWeakRef *pWeakRef;
|
|
269
|
+
SQRawObjectVal raw;
|
|
270
|
+
}SQObjectValue;
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
typedef struct tagSQObject
|
|
274
|
+
{
|
|
275
|
+
SQObjectType _type;
|
|
276
|
+
SQObjectValue _unVal;
|
|
277
|
+
}SQObject;
|
|
278
|
+
|
|
279
|
+
typedef struct tagSQMemberHandle{
|
|
280
|
+
SQBool _static;
|
|
281
|
+
SQInteger _index;
|
|
282
|
+
}SQMemberHandle;
|
|
283
|
+
|
|
284
|
+
typedef struct tagSQStackInfos{
|
|
285
|
+
const SQChar* funcname;
|
|
286
|
+
const SQChar* source;
|
|
287
|
+
SQInteger line;
|
|
288
|
+
}SQStackInfos;
|
|
289
|
+
|
|
290
|
+
typedef struct SQVM* HSQUIRRELVM;
|
|
291
|
+
typedef SQObject HSQOBJECT;
|
|
292
|
+
typedef SQMemberHandle HSQMEMBERHANDLE;
|
|
293
|
+
typedef SQInteger (*SQFUNCTION)(HSQUIRRELVM);
|
|
294
|
+
typedef SQInteger (*SQRELEASEHOOK)(SQUserPointer,SQInteger size);
|
|
295
|
+
typedef void (*SQCOMPILERERROR)(HSQUIRRELVM,const SQChar * /*desc*/,const SQChar * /*source*/,SQInteger /*line*/,SQInteger /*column*/);
|
|
296
|
+
typedef void (*SQPRINTFUNCTION)(HSQUIRRELVM,const SQChar * ,...);
|
|
297
|
+
typedef void (*SQDEBUGHOOK)(HSQUIRRELVM /*v*/, SQInteger /*type*/, const SQChar * /*sourcename*/, SQInteger /*line*/, const SQChar * /*funcname*/);
|
|
298
|
+
typedef SQInteger (*SQWRITEFUNC)(SQUserPointer,SQUserPointer,SQInteger);
|
|
299
|
+
typedef SQInteger (*SQREADFUNC)(SQUserPointer,SQUserPointer,SQInteger);
|
|
300
|
+
|
|
301
|
+
typedef SQInteger (*SQLEXREADFUNC)(SQUserPointer);
|
|
302
|
+
|
|
303
|
+
typedef struct tagSQRegFunction{
|
|
304
|
+
const SQChar *name;
|
|
305
|
+
SQFUNCTION f;
|
|
306
|
+
SQInteger nparamscheck;
|
|
307
|
+
const SQChar *typemask;
|
|
308
|
+
}SQRegFunction;
|
|
309
|
+
|
|
310
|
+
typedef struct tagSQFunctionInfo {
|
|
311
|
+
SQUserPointer funcid;
|
|
312
|
+
const SQChar *name;
|
|
313
|
+
const SQChar *source;
|
|
314
|
+
}SQFunctionInfo;
|
|
315
|
+
|
|
316
|
+
/*vm*/
|
|
317
|
+
SQUIRREL_API HSQUIRRELVM sq_open(SQInteger initialstacksize);
|
|
318
|
+
SQUIRREL_API HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize);
|
|
319
|
+
SQUIRREL_API void sq_seterrorhandler(HSQUIRRELVM v);
|
|
320
|
+
SQUIRREL_API void sq_close(HSQUIRRELVM v);
|
|
321
|
+
SQUIRREL_API void sq_setforeignptr(HSQUIRRELVM v,SQUserPointer p);
|
|
322
|
+
SQUIRREL_API SQUserPointer sq_getforeignptr(HSQUIRRELVM v);
|
|
323
|
+
SQUIRREL_API void sq_setprintfunc(HSQUIRRELVM v, SQPRINTFUNCTION printfunc,SQPRINTFUNCTION errfunc);
|
|
324
|
+
SQUIRREL_API SQPRINTFUNCTION sq_getprintfunc(HSQUIRRELVM v);
|
|
325
|
+
SQUIRREL_API SQPRINTFUNCTION sq_geterrorfunc(HSQUIRRELVM v);
|
|
326
|
+
SQUIRREL_API SQRESULT sq_suspendvm(HSQUIRRELVM v);
|
|
327
|
+
SQUIRREL_API SQRESULT sq_wakeupvm(HSQUIRRELVM v,SQBool resumedret,SQBool retval,SQBool raiseerror,SQBool throwerror);
|
|
328
|
+
SQUIRREL_API SQInteger sq_getvmstate(HSQUIRRELVM v);
|
|
329
|
+
SQUIRREL_API SQInteger sq_getversion();
|
|
330
|
+
|
|
331
|
+
/*compiler*/
|
|
332
|
+
SQUIRREL_API SQRESULT sq_compile(HSQUIRRELVM v,SQLEXREADFUNC read,SQUserPointer p,const SQChar *sourcename,SQBool raiseerror);
|
|
333
|
+
SQUIRREL_API SQRESULT sq_compilebuffer(HSQUIRRELVM v,const SQChar *s,SQInteger size,const SQChar *sourcename,SQBool raiseerror);
|
|
334
|
+
SQUIRREL_API void sq_enabledebuginfo(HSQUIRRELVM v, SQBool enable);
|
|
335
|
+
SQUIRREL_API void sq_notifyallexceptions(HSQUIRRELVM v, SQBool enable);
|
|
336
|
+
SQUIRREL_API void sq_setcompilererrorhandler(HSQUIRRELVM v,SQCOMPILERERROR f);
|
|
337
|
+
|
|
338
|
+
/*stack operations*/
|
|
339
|
+
SQUIRREL_API void sq_push(HSQUIRRELVM v,SQInteger idx);
|
|
340
|
+
SQUIRREL_API void sq_pop(HSQUIRRELVM v,SQInteger nelemstopop);
|
|
341
|
+
SQUIRREL_API void sq_poptop(HSQUIRRELVM v);
|
|
342
|
+
SQUIRREL_API void sq_remove(HSQUIRRELVM v,SQInteger idx);
|
|
343
|
+
SQUIRREL_API SQInteger sq_gettop(HSQUIRRELVM v);
|
|
344
|
+
SQUIRREL_API void sq_settop(HSQUIRRELVM v,SQInteger newtop);
|
|
345
|
+
SQUIRREL_API SQRESULT sq_reservestack(HSQUIRRELVM v,SQInteger nsize);
|
|
346
|
+
SQUIRREL_API SQInteger sq_cmp(HSQUIRRELVM v);
|
|
347
|
+
SQUIRREL_API void sq_move(HSQUIRRELVM dest,HSQUIRRELVM src,SQInteger idx);
|
|
348
|
+
|
|
349
|
+
/*object creation handling*/
|
|
350
|
+
SQUIRREL_API SQUserPointer sq_newuserdata(HSQUIRRELVM v,SQUnsignedInteger size);
|
|
351
|
+
SQUIRREL_API void sq_newtable(HSQUIRRELVM v);
|
|
352
|
+
SQUIRREL_API void sq_newtableex(HSQUIRRELVM v,SQInteger initialcapacity);
|
|
353
|
+
SQUIRREL_API void sq_newarray(HSQUIRRELVM v,SQInteger size);
|
|
354
|
+
SQUIRREL_API void sq_newclosure(HSQUIRRELVM v,SQFUNCTION func,SQUnsignedInteger nfreevars);
|
|
355
|
+
SQUIRREL_API SQRESULT sq_setparamscheck(HSQUIRRELVM v,SQInteger nparamscheck,const SQChar *typemask);
|
|
356
|
+
SQUIRREL_API SQRESULT sq_bindenv(HSQUIRRELVM v,SQInteger idx);
|
|
357
|
+
SQUIRREL_API void sq_pushstring(HSQUIRRELVM v,const SQChar *s,SQInteger len);
|
|
358
|
+
SQUIRREL_API void sq_pushfloat(HSQUIRRELVM v,SQFloat f);
|
|
359
|
+
SQUIRREL_API void sq_pushinteger(HSQUIRRELVM v,SQInteger n);
|
|
360
|
+
SQUIRREL_API void sq_pushbool(HSQUIRRELVM v,SQBool b);
|
|
361
|
+
SQUIRREL_API void sq_pushuserpointer(HSQUIRRELVM v,SQUserPointer p);
|
|
362
|
+
SQUIRREL_API void sq_pushnull(HSQUIRRELVM v);
|
|
363
|
+
SQUIRREL_API SQObjectType sq_gettype(HSQUIRRELVM v,SQInteger idx);
|
|
364
|
+
SQUIRREL_API SQRESULT sq_typeof(HSQUIRRELVM v,SQInteger idx);
|
|
365
|
+
SQUIRREL_API SQInteger sq_getsize(HSQUIRRELVM v,SQInteger idx);
|
|
366
|
+
SQUIRREL_API SQHash sq_gethash(HSQUIRRELVM v, SQInteger idx);
|
|
367
|
+
SQUIRREL_API SQRESULT sq_getbase(HSQUIRRELVM v,SQInteger idx);
|
|
368
|
+
SQUIRREL_API SQBool sq_instanceof(HSQUIRRELVM v);
|
|
369
|
+
SQUIRREL_API SQRESULT sq_tostring(HSQUIRRELVM v,SQInteger idx);
|
|
370
|
+
SQUIRREL_API void sq_tobool(HSQUIRRELVM v, SQInteger idx, SQBool *b);
|
|
371
|
+
SQUIRREL_API SQRESULT sq_getstring(HSQUIRRELVM v,SQInteger idx,const SQChar **c);
|
|
372
|
+
SQUIRREL_API SQRESULT sq_getinteger(HSQUIRRELVM v,SQInteger idx,SQInteger *i);
|
|
373
|
+
SQUIRREL_API SQRESULT sq_getfloat(HSQUIRRELVM v,SQInteger idx,SQFloat *f);
|
|
374
|
+
SQUIRREL_API SQRESULT sq_getbool(HSQUIRRELVM v,SQInteger idx,SQBool *b);
|
|
375
|
+
SQUIRREL_API SQRESULT sq_getthread(HSQUIRRELVM v,SQInteger idx,HSQUIRRELVM *thread);
|
|
376
|
+
SQUIRREL_API SQRESULT sq_getuserpointer(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p);
|
|
377
|
+
SQUIRREL_API SQRESULT sq_getuserdata(HSQUIRRELVM v,SQInteger idx,SQUserPointer *p,SQUserPointer *typetag);
|
|
378
|
+
SQUIRREL_API SQRESULT sq_settypetag(HSQUIRRELVM v,SQInteger idx,SQUserPointer typetag);
|
|
379
|
+
SQUIRREL_API SQRESULT sq_gettypetag(HSQUIRRELVM v,SQInteger idx,SQUserPointer *typetag);
|
|
380
|
+
SQUIRREL_API void sq_setreleasehook(HSQUIRRELVM v,SQInteger idx,SQRELEASEHOOK hook);
|
|
381
|
+
SQUIRREL_API SQChar *sq_getscratchpad(HSQUIRRELVM v,SQInteger minsize);
|
|
382
|
+
SQUIRREL_API SQRESULT sq_getfunctioninfo(HSQUIRRELVM v,SQInteger level,SQFunctionInfo *fi);
|
|
383
|
+
SQUIRREL_API SQRESULT sq_getclosureinfo(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger *nparams,SQUnsignedInteger *nfreevars);
|
|
384
|
+
SQUIRREL_API SQRESULT sq_getclosurename(HSQUIRRELVM v,SQInteger idx);
|
|
385
|
+
SQUIRREL_API SQRESULT sq_setnativeclosurename(HSQUIRRELVM v,SQInteger idx,const SQChar *name);
|
|
386
|
+
SQUIRREL_API SQRESULT sq_setinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer p);
|
|
387
|
+
SQUIRREL_API SQRESULT sq_getinstanceup(HSQUIRRELVM v, SQInteger idx, SQUserPointer *p,SQUserPointer typetag);
|
|
388
|
+
SQUIRREL_API SQRESULT sq_setclassudsize(HSQUIRRELVM v, SQInteger idx, SQInteger udsize);
|
|
389
|
+
SQUIRREL_API SQRESULT sq_newclass(HSQUIRRELVM v,SQBool hasbase);
|
|
390
|
+
SQUIRREL_API SQRESULT sq_createinstance(HSQUIRRELVM v,SQInteger idx);
|
|
391
|
+
SQUIRREL_API SQRESULT sq_setattributes(HSQUIRRELVM v,SQInteger idx);
|
|
392
|
+
SQUIRREL_API SQRESULT sq_getattributes(HSQUIRRELVM v,SQInteger idx);
|
|
393
|
+
SQUIRREL_API SQRESULT sq_getclass(HSQUIRRELVM v,SQInteger idx);
|
|
394
|
+
SQUIRREL_API void sq_weakref(HSQUIRRELVM v,SQInteger idx);
|
|
395
|
+
SQUIRREL_API SQRESULT sq_getdefaultdelegate(HSQUIRRELVM v,SQObjectType t);
|
|
396
|
+
SQUIRREL_API SQRESULT sq_getmemberhandle(HSQUIRRELVM v,SQInteger idx,HSQMEMBERHANDLE *handle);
|
|
397
|
+
SQUIRREL_API SQRESULT sq_getbyhandle(HSQUIRRELVM v,SQInteger idx,const HSQMEMBERHANDLE *handle);
|
|
398
|
+
SQUIRREL_API SQRESULT sq_setbyhandle(HSQUIRRELVM v,SQInteger idx,const HSQMEMBERHANDLE *handle);
|
|
399
|
+
|
|
400
|
+
/*object manipulation*/
|
|
401
|
+
SQUIRREL_API void sq_pushroottable(HSQUIRRELVM v);
|
|
402
|
+
SQUIRREL_API void sq_pushregistrytable(HSQUIRRELVM v);
|
|
403
|
+
SQUIRREL_API void sq_pushconsttable(HSQUIRRELVM v);
|
|
404
|
+
SQUIRREL_API SQRESULT sq_setroottable(HSQUIRRELVM v);
|
|
405
|
+
SQUIRREL_API SQRESULT sq_setconsttable(HSQUIRRELVM v);
|
|
406
|
+
SQUIRREL_API SQRESULT sq_newslot(HSQUIRRELVM v, SQInteger idx, SQBool bstatic);
|
|
407
|
+
SQUIRREL_API SQRESULT sq_deleteslot(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
|
|
408
|
+
SQUIRREL_API SQRESULT sq_set(HSQUIRRELVM v,SQInteger idx);
|
|
409
|
+
SQUIRREL_API SQRESULT sq_get(HSQUIRRELVM v,SQInteger idx);
|
|
410
|
+
SQUIRREL_API SQRESULT sq_rawget(HSQUIRRELVM v,SQInteger idx);
|
|
411
|
+
SQUIRREL_API SQRESULT sq_rawset(HSQUIRRELVM v,SQInteger idx);
|
|
412
|
+
SQUIRREL_API SQRESULT sq_rawdeleteslot(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
|
|
413
|
+
SQUIRREL_API SQRESULT sq_newmember(HSQUIRRELVM v,SQInteger idx,SQBool bstatic);
|
|
414
|
+
SQUIRREL_API SQRESULT sq_rawnewmember(HSQUIRRELVM v,SQInteger idx,SQBool bstatic);
|
|
415
|
+
SQUIRREL_API SQRESULT sq_arrayappend(HSQUIRRELVM v,SQInteger idx);
|
|
416
|
+
SQUIRREL_API SQRESULT sq_arraypop(HSQUIRRELVM v,SQInteger idx,SQBool pushval);
|
|
417
|
+
SQUIRREL_API SQRESULT sq_arrayresize(HSQUIRRELVM v,SQInteger idx,SQInteger newsize);
|
|
418
|
+
SQUIRREL_API SQRESULT sq_arrayreverse(HSQUIRRELVM v,SQInteger idx);
|
|
419
|
+
SQUIRREL_API SQRESULT sq_arrayremove(HSQUIRRELVM v,SQInteger idx,SQInteger itemidx);
|
|
420
|
+
SQUIRREL_API SQRESULT sq_arrayinsert(HSQUIRRELVM v,SQInteger idx,SQInteger destpos);
|
|
421
|
+
SQUIRREL_API SQRESULT sq_setdelegate(HSQUIRRELVM v,SQInteger idx);
|
|
422
|
+
SQUIRREL_API SQRESULT sq_getdelegate(HSQUIRRELVM v,SQInteger idx);
|
|
423
|
+
SQUIRREL_API SQRESULT sq_clone(HSQUIRRELVM v,SQInteger idx);
|
|
424
|
+
SQUIRREL_API SQRESULT sq_setfreevariable(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval);
|
|
425
|
+
SQUIRREL_API SQRESULT sq_next(HSQUIRRELVM v,SQInteger idx);
|
|
426
|
+
SQUIRREL_API SQRESULT sq_getweakrefval(HSQUIRRELVM v,SQInteger idx);
|
|
427
|
+
SQUIRREL_API SQRESULT sq_clear(HSQUIRRELVM v,SQInteger idx);
|
|
428
|
+
|
|
429
|
+
/*calls*/
|
|
430
|
+
SQUIRREL_API SQRESULT sq_call(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror);
|
|
431
|
+
SQUIRREL_API SQRESULT sq_resume(HSQUIRRELVM v,SQBool retval,SQBool raiseerror);
|
|
432
|
+
SQUIRREL_API const SQChar *sq_getlocal(HSQUIRRELVM v,SQUnsignedInteger level,SQUnsignedInteger idx);
|
|
433
|
+
SQUIRREL_API SQRESULT sq_getcallee(HSQUIRRELVM v);
|
|
434
|
+
SQUIRREL_API const SQChar *sq_getfreevariable(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval);
|
|
435
|
+
SQUIRREL_API SQRESULT sq_throwerror(HSQUIRRELVM v,const SQChar *err);
|
|
436
|
+
SQUIRREL_API SQRESULT sq_throwobject(HSQUIRRELVM v);
|
|
437
|
+
SQUIRREL_API void sq_reseterror(HSQUIRRELVM v);
|
|
438
|
+
SQUIRREL_API void sq_getlasterror(HSQUIRRELVM v);
|
|
439
|
+
|
|
440
|
+
/*raw object handling*/
|
|
441
|
+
SQUIRREL_API SQRESULT sq_getstackobj(HSQUIRRELVM v,SQInteger idx,HSQOBJECT *po);
|
|
442
|
+
SQUIRREL_API void sq_pushobject(HSQUIRRELVM v,HSQOBJECT obj);
|
|
443
|
+
SQUIRREL_API void sq_addref(HSQUIRRELVM v,HSQOBJECT *po);
|
|
444
|
+
SQUIRREL_API SQBool sq_release(HSQUIRRELVM v,HSQOBJECT *po);
|
|
445
|
+
SQUIRREL_API SQUnsignedInteger sq_getrefcount(HSQUIRRELVM v,HSQOBJECT *po);
|
|
446
|
+
SQUIRREL_API void sq_resetobject(HSQOBJECT *po);
|
|
447
|
+
SQUIRREL_API const SQChar *sq_objtostring(const HSQOBJECT *o);
|
|
448
|
+
SQUIRREL_API SQBool sq_objtobool(const HSQOBJECT *o);
|
|
449
|
+
SQUIRREL_API SQInteger sq_objtointeger(const HSQOBJECT *o);
|
|
450
|
+
SQUIRREL_API SQFloat sq_objtofloat(const HSQOBJECT *o);
|
|
451
|
+
SQUIRREL_API SQUserPointer sq_objtouserpointer(const HSQOBJECT *o);
|
|
452
|
+
SQUIRREL_API SQRESULT sq_getobjtypetag(const HSQOBJECT *o,SQUserPointer * typetag);
|
|
453
|
+
|
|
454
|
+
/*GC*/
|
|
455
|
+
SQUIRREL_API SQInteger sq_collectgarbage(HSQUIRRELVM v);
|
|
456
|
+
SQUIRREL_API SQRESULT sq_resurrectunreachable(HSQUIRRELVM v);
|
|
457
|
+
|
|
458
|
+
/*serialization*/
|
|
459
|
+
SQUIRREL_API SQRESULT sq_writeclosure(HSQUIRRELVM vm,SQWRITEFUNC writef,SQUserPointer up);
|
|
460
|
+
SQUIRREL_API SQRESULT sq_readclosure(HSQUIRRELVM vm,SQREADFUNC readf,SQUserPointer up);
|
|
461
|
+
|
|
462
|
+
/*mem allocation*/
|
|
463
|
+
SQUIRREL_API void *sq_malloc(SQUnsignedInteger size);
|
|
464
|
+
SQUIRREL_API void *sq_realloc(void* p,SQUnsignedInteger oldsize,SQUnsignedInteger newsize);
|
|
465
|
+
SQUIRREL_API void sq_free(void *p,SQUnsignedInteger size);
|
|
466
|
+
|
|
467
|
+
/*debug*/
|
|
468
|
+
SQUIRREL_API SQRESULT sq_stackinfos(HSQUIRRELVM v,SQInteger level,SQStackInfos *si);
|
|
469
|
+
SQUIRREL_API void sq_setdebughook(HSQUIRRELVM v);
|
|
470
|
+
SQUIRREL_API void sq_setnativedebughook(HSQUIRRELVM v,SQDEBUGHOOK hook);
|
|
471
|
+
|
|
472
|
+
/*UTILITY MACRO*/
|
|
473
|
+
#define sq_isnumeric(o) ((o)._type&SQOBJECT_NUMERIC)
|
|
474
|
+
#define sq_istable(o) ((o)._type==OT_TABLE)
|
|
475
|
+
#define sq_isarray(o) ((o)._type==OT_ARRAY)
|
|
476
|
+
#define sq_isfunction(o) ((o)._type==OT_FUNCPROTO)
|
|
477
|
+
#define sq_isclosure(o) ((o)._type==OT_CLOSURE)
|
|
478
|
+
#define sq_isgenerator(o) ((o)._type==OT_GENERATOR)
|
|
479
|
+
#define sq_isnativeclosure(o) ((o)._type==OT_NATIVECLOSURE)
|
|
480
|
+
#define sq_isstring(o) ((o)._type==OT_STRING)
|
|
481
|
+
#define sq_isinteger(o) ((o)._type==OT_INTEGER)
|
|
482
|
+
#define sq_isfloat(o) ((o)._type==OT_FLOAT)
|
|
483
|
+
#define sq_isuserpointer(o) ((o)._type==OT_USERPOINTER)
|
|
484
|
+
#define sq_isuserdata(o) ((o)._type==OT_USERDATA)
|
|
485
|
+
#define sq_isthread(o) ((o)._type==OT_THREAD)
|
|
486
|
+
#define sq_isnull(o) ((o)._type==OT_NULL)
|
|
487
|
+
#define sq_isclass(o) ((o)._type==OT_CLASS)
|
|
488
|
+
#define sq_isinstance(o) ((o)._type==OT_INSTANCE)
|
|
489
|
+
#define sq_isbool(o) ((o)._type==OT_BOOL)
|
|
490
|
+
#define sq_isweakref(o) ((o)._type==OT_WEAKREF)
|
|
491
|
+
#define sq_type(o) ((o)._type)
|
|
492
|
+
|
|
493
|
+
/* deprecated */
|
|
494
|
+
#define sq_createslot(v,n) sq_newslot(v,n,SQFalse)
|
|
495
|
+
|
|
496
|
+
#define SQ_OK (0)
|
|
497
|
+
#define SQ_ERROR (-1)
|
|
498
|
+
|
|
499
|
+
#define SQ_FAILED(res) (res<0)
|
|
500
|
+
#define SQ_SUCCEEDED(res) (res>=0)
|
|
501
|
+
|
|
502
|
+
#ifdef __cplusplus
|
|
503
|
+
} /*extern "C"*/
|
|
504
|
+
#endif
|
|
505
|
+
|
|
506
|
+
#endif /*_SQUIRREL_H_*/
|
Bin/sqc/lib/libsqstdlib.a
ADDED
|
Binary file
|
Bin/sqc/lib/libsquirrel.a
ADDED
|
Binary file
|
Bin/sqc/makefile
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
all:
|
|
2
|
+
g++ -o sqc.exe -Iinclude sqc.cpp lib/libsquirrel.a lib/libsqstdlib.a
|
Bin/sqc/sqc.cpp
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#include <iostream>
|
|
2
|
+
#include <fstream>
|
|
3
|
+
#include <squirrel.h>
|
|
4
|
+
#include <sqstdio.h>
|
|
5
|
+
|
|
6
|
+
using std::cout;
|
|
7
|
+
|
|
8
|
+
void compile_error_handler(HSQUIRRELVM v, const SQChar* desc, const SQChar* source, SQInteger line, SQInteger column)
|
|
9
|
+
{
|
|
10
|
+
cout<<line<<","<<column<<","<<desc<< std::endl;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
int main(int argc, char** argv)
|
|
14
|
+
{
|
|
15
|
+
if (argc < 2) {
|
|
16
|
+
cout << "Usage: " << argv[0] << " <source> <destination>" << std::endl;
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// open vm
|
|
21
|
+
HSQUIRRELVM v = sq_open(1024);
|
|
22
|
+
if (!v) {
|
|
23
|
+
cout << "Could not open Squirrel VM" << std::endl;
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// set compile error handler
|
|
28
|
+
sq_setcompilererrorhandler(v, compile_error_handler);
|
|
29
|
+
|
|
30
|
+
// compile source file
|
|
31
|
+
if (SQ_FAILED(sqstd_loadfile(v, argv[1], SQTrue))) {
|
|
32
|
+
//cout << "Could not compile source file " << argv[1] << std::endl;
|
|
33
|
+
sq_close(v);
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// serialize closure containing the source
|
|
38
|
+
//if (SQ_FAILED(sqstd_writeclosuretofile(v, "1.cnut"))) {
|
|
39
|
+
// cout << "Could not serialize closure" << std::endl;
|
|
40
|
+
//}
|
|
41
|
+
|
|
42
|
+
sq_close(v);
|
|
43
|
+
cout <<"Success";
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
Bin/sqc/sqc.exe
ADDED
|
Binary file
|
Bin/sqc/st.cnut
ADDED
|
Binary file
|
Bin/sqc/stest.nut
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
print"ggsg")
|
Icons/logosabel.png
CHANGED
|
Binary file
|
Icons/logosabel.xcf
ADDED
|
Binary file
|
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Sabel v0.57
|
|
1
|
+
## Sabel v0.57
|
|
2
|
-
=====
|
|
2
|
+
========================
|
|
3
3
|
|
|
4
4
|
Sabel is an IDE for programming squirrel and EmoFramework.
|
|
5
5
|
Can be used to Create games for android and ios.
|
|
@@ -9,16 +9,17 @@ With this Editor you Can Easily create Games for android and iOS using squirrel
|
|
|
9
9
|
Just add you source files to the editor , edit away your code.
|
|
10
10
|
|
|
11
11
|
WORKS only on Device for Now.Will add emulator support in next version.
|
|
12
|
-
Features:
|
|
12
|
+
## Features:
|
|
13
|
-
|
|
13
|
+
* Code completion.
|
|
14
|
-
|
|
14
|
+
* Instant Launch of your main.nut to SDcard in Android.
|
|
15
|
-
|
|
15
|
+
* Android Debug logcat is directly displayed in console.
|
|
16
|
-
|
|
16
|
+
* Python Interactive Interpreter.
|
|
17
|
+
|
|
17
|
-
Check out Sabel
|
|
18
|
+
Check out [Sabel](http://code.google.com/p/sabel-ide/)
|
|
18
|
-
Check out Squirrel
|
|
19
|
+
Check out [Squirrel](http://www.squirrel-lang.org)
|
|
19
|
-
Check out Emo
|
|
20
|
+
Check out [Emo](http://www.emo-framework.com)
|
|
20
21
|
|
|
21
|
-
TODO:
|
|
22
|
+
## TODO:
|
|
22
23
|
- Fix Closed Projects Bug
|
|
23
24
|
- Add Build Options
|
|
24
25
|
- Add OS support
|
Test/sabel.png
ADDED
|
Binary file
|
Test/testMain.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from nose.tools import eq_, ok_
|
|
2
|
+
from PyQt4.QtGui import QApplication,QSplashScreen
|
|
3
|
+
from PyQt4.QtCore import Qt
|
|
4
|
+
app = QApplication([])
|
|
5
|
+
import mainwindow
|
|
6
|
+
import icons
|
|
7
|
+
import sys
|
|
8
|
+
import os
|
|
9
|
+
|
|
10
|
+
path = os.getcwd()
|
|
11
|
+
|
|
12
|
+
class TestMainWindow:
|
|
13
|
+
def __init__(self):
|
|
14
|
+
self.frame = mainwindow.MainWindow()
|
|
15
|
+
self.frame.showMaximized()
|
|
16
|
+
self.frame.init()
|
|
17
|
+
#self.test_file()
|
|
18
|
+
#self.test_syntax()
|
|
19
|
+
#self.test_openImage()
|
|
20
|
+
#self.test_openAudio()
|
|
21
|
+
self.test_openEditor()
|
|
22
|
+
sys.exit(app.exec_())
|
|
23
|
+
|
|
24
|
+
def test_file(self):
|
|
25
|
+
eq_(False,self.frame.createTab("somefile.c"))
|
|
26
|
+
eq_(False,self.frame.createTab(os.path.join(os.getcwd(),"cx.py")))
|
|
27
|
+
|
|
28
|
+
def test_syntax(self):
|
|
29
|
+
eq_(0,self.frame.syntax("somefile.py"))
|
|
30
|
+
eq_(1,self.frame.syntax("somefile.c"))
|
|
31
|
+
eq_(1,self.frame.syntax("somefile.cpp"))
|
|
32
|
+
eq_(1,self.frame.syntax("somefile.h"))
|
|
33
|
+
eq_(1,self.frame.syntax("somefile.hpp"))
|
|
34
|
+
eq_(2,self.frame.syntax("somefile.nut"))
|
|
35
|
+
eq_(2,self.frame.syntax("somefile.neko"))
|
|
36
|
+
eq_(2,self.frame.syntax("somefile.lua"))
|
|
37
|
+
|
|
38
|
+
def test_openImage(self):
|
|
39
|
+
eq_(False,self.frame.openImage("somefile.png"))
|
|
40
|
+
eq_(True,self.frame.openImage("C:/CODE/Sabel/Icons/sabel.png"))
|
|
41
|
+
|
|
42
|
+
def test_openAudio(self):
|
|
43
|
+
eq_(False,self.frame.openAudio("somefile.wav"))
|
|
44
|
+
eq_(True,self.frame.openAudio("C:/CODE/Sabel/Test/title.wav"))
|
|
45
|
+
|
|
46
|
+
def test_openEditor(self):
|
|
47
|
+
eq_(False,self.frame.openEditor("somefile.nut"))
|
|
48
|
+
eq_(True,self.frame.openEditor("C:/CODE/Sabel/Test/testMain.py"))
|
|
49
|
+
|
Test/title.wav
ADDED
|
Binary file
|
Widget/adb.py
CHANGED
|
@@ -4,10 +4,10 @@ from PyQt4.QtCore import pyqtSignal,SIGNAL,QThread,QProcess,QString,QTimer
|
|
|
4
4
|
from workthread import WorkThread
|
|
5
5
|
|
|
6
6
|
class Adb(QWidget):
|
|
7
|
+
isRunning = False
|
|
7
8
|
def __init__(self,parent):
|
|
8
9
|
QWidget.__init__(self,parent)
|
|
9
10
|
self.parent = parent
|
|
10
|
-
self.isRunning = False
|
|
11
11
|
self.adb_thread = WorkThread()
|
|
12
12
|
self.timer = QTimer()
|
|
13
13
|
self.device = config.device()
|
Widget/adb.pyc
CHANGED
|
Binary file
|
Widget/ant.py
CHANGED
|
@@ -8,14 +8,14 @@ class Ant(QWidget):
|
|
|
8
8
|
def __init__(self,parent):
|
|
9
9
|
QWidget.__init__(self,parent)
|
|
10
10
|
self.parent = parent
|
|
11
|
-
self.
|
|
11
|
+
self.ant_thread = WorkThread()
|
|
12
12
|
self.timer = QTimer()
|
|
13
|
-
#self.
|
|
13
|
+
#self.ant_thread = antThread()
|
|
14
|
-
self.connect(self.
|
|
14
|
+
self.connect(self.ant_thread, SIGNAL("update"),self.update)
|
|
15
|
-
self.connect(self.
|
|
15
|
+
self.connect(self.ant_thread, SIGNAL("fini"),self.newstart)
|
|
16
16
|
#self.connect(self.timer , SIGNAL('timeout()') , self.onTimeout)
|
|
17
|
-
#self.connect(self.
|
|
17
|
+
#self.connect(self.ant_thread , SIGNAL('started()') , self.onThreadStarted)
|
|
18
|
-
#self.connect(self.
|
|
18
|
+
#self.connect(self.ant_thread , SIGNAL('finished()'), self.onThreadFinished)
|
|
19
19
|
|
|
20
20
|
def onTimeout(self):
|
|
21
21
|
print "timeout"
|
|
@@ -66,8 +66,8 @@ class Ant(QWidget):
|
|
|
66
66
|
self.showOutput()
|
|
67
67
|
self.parent.textEdit.clear()
|
|
68
68
|
self.parent.textEdit.append("Creating... "+prj.getPath())
|
|
69
|
-
self.
|
|
69
|
+
self.ant_thread.setCmd("android.bat update project -p "+prj.getPath())
|
|
70
|
-
self.
|
|
70
|
+
self.ant_thread.run()
|
|
71
71
|
|
|
72
72
|
def build(self,prj):
|
|
73
73
|
if self.isRunning == False:
|
|
@@ -75,8 +75,8 @@ class Ant(QWidget):
|
|
|
75
75
|
self.showOutput()
|
|
76
76
|
self.parent.textEdit.clear()
|
|
77
77
|
self.parent.textEdit.append("Ant Building Debug... "+ospathjoin(prj.getPath(),"build.xml"))
|
|
78
|
-
self.
|
|
78
|
+
self.ant_thread.setCmd("ant.bat debug -buildfile "+ospathjoin(prj.getPath(),"build.xml"))
|
|
79
|
-
self.
|
|
79
|
+
self.ant_thread.run()
|
|
80
80
|
|
|
81
81
|
def clean(self,prj):
|
|
82
82
|
if self.isRunning == False:
|
|
@@ -84,8 +84,8 @@ class Ant(QWidget):
|
|
|
84
84
|
self.showOutput()
|
|
85
85
|
self.parent.textEdit.clear()
|
|
86
86
|
self.parent.textEdit.append("Ant Cleaning... "+prj.getPath())
|
|
87
|
-
self.
|
|
87
|
+
self.ant_thread.setCmd("ant.bat clean -buildfile "+ospathjoin(prj.getPath(),"build.xml"))
|
|
88
|
-
self.
|
|
88
|
+
self.ant_thread.run()
|
|
89
89
|
|
|
90
90
|
def buildRun(self,prj):
|
|
91
91
|
if self.isRunning == False:
|
|
@@ -93,8 +93,8 @@ class Ant(QWidget):
|
|
|
93
93
|
self.showOutput()
|
|
94
94
|
self.parent.textEdit.clear()
|
|
95
95
|
self.parent.textEdit.append("Ant Building and Installing... "+ospathjoin(prj.getPath(),"build.xml"))
|
|
96
|
-
self.
|
|
96
|
+
self.ant_thread.setCmd("ant.bat debug install -buildfile "+ospathjoin(prj.getPath(),"build.xml"))
|
|
97
|
-
self.
|
|
97
|
+
self.ant_thread.run()
|
|
98
98
|
|
|
99
99
|
def run(self,prj):
|
|
100
100
|
if self.isRunning == False:
|
|
@@ -102,8 +102,10 @@ class Ant(QWidget):
|
|
|
102
102
|
self.showOutput()
|
|
103
103
|
self.parent.textEdit.clear()
|
|
104
104
|
self.parent.textEdit.append("Installing... "+prj.getPath())
|
|
105
|
-
self.
|
|
105
|
+
self.ant_thread.setCmd("ant.bat install -buildfile "+ospathjoin(prj.getPath(),"build.xml"))
|
|
106
|
-
self.
|
|
106
|
+
self.ant_thread.run()
|
|
107
107
|
|
|
108
108
|
def close(self):
|
|
109
|
+
self.ant_thread.kill_process()
|
|
110
|
+
self.ant_thread.close_process()
|
|
109
|
-
self.
|
|
111
|
+
self.ant_thread.quit()
|
Widget/editor.py
CHANGED
|
@@ -23,7 +23,7 @@ class Editor(QsciScintilla):
|
|
|
23
23
|
else:
|
|
24
24
|
self.setEolMode(self.EolMac)
|
|
25
25
|
self.init()
|
|
26
|
-
self.setTabWidth(
|
|
26
|
+
self.setTabWidth(config.tabwidth())
|
|
27
27
|
|
|
28
28
|
def init(self):
|
|
29
29
|
#Margin
|
|
@@ -111,16 +111,10 @@ class Editor(QsciScintilla):
|
|
|
111
111
|
#fix this lines not showing properly
|
|
112
112
|
def addError(self,lineno):
|
|
113
113
|
'''First delete all present markers then add new lines or errors'''
|
|
114
|
+
'''sqc can only find out 1 error line just like an interpreter'''
|
|
114
115
|
if(len(self.errorLines) == 0):
|
|
115
116
|
self.errorLines.append(lineno-1)
|
|
116
117
|
self.markerAdd(lineno-1, 0)
|
|
117
|
-
else:
|
|
118
|
-
#print self.errorLines
|
|
119
|
-
for i in self.errorLines:
|
|
120
|
-
self.markerDelete(i, 0)
|
|
121
|
-
self.errorLines[:] = []
|
|
122
|
-
self.errorLines.append(lineno-1)
|
|
123
|
-
self.markerAdd(lineno-1, 0)
|
|
124
118
|
#print self.errorLines
|
|
125
119
|
|
|
126
120
|
#if self.markersAtLine() != 0:
|
|
@@ -131,7 +125,12 @@ class Editor(QsciScintilla):
|
|
|
131
125
|
|
|
132
126
|
#assert self.errorLines == []
|
|
133
127
|
|
|
134
|
-
|
|
128
|
+
def reset(self):
|
|
129
|
+
if(len(self.errorLines) != 0):
|
|
130
|
+
for i in self.errorLines:
|
|
131
|
+
self.markerDelete(i, 0)
|
|
132
|
+
self.errorLines[:] = []
|
|
133
|
+
|
|
135
134
|
def zoomin(self):
|
|
136
135
|
self.fontSize += 1
|
|
137
136
|
config.setFontSize(self.fontSize)
|
|
@@ -154,6 +153,10 @@ class Editor(QsciScintilla):
|
|
|
154
153
|
|
|
155
154
|
def setThreshold(self,val):
|
|
156
155
|
self.setAutoCompletionThreshold(val)
|
|
156
|
+
|
|
157
|
+
def setLine(self,lineno):
|
|
158
|
+
self.setCursorPosition(int(lineno),0)
|
|
159
|
+
self.setCaretLineVisible(True)
|
|
157
160
|
|
|
158
161
|
|
|
159
162
|
"""
|
Widget/editor.pyc
CHANGED
|
Binary file
|
Widget/parser.py
CHANGED
|
@@ -1,52 +1,45 @@
|
|
|
1
|
-
from globals import
|
|
1
|
+
from globals import sqc
|
|
2
2
|
from PyQt4.QtGui import QWidget
|
|
3
|
-
import threading
|
|
4
|
-
from subprocess import PIPE,Popen
|
|
5
3
|
from PyQt4.QtCore import SIGNAL
|
|
4
|
+
from workthread import WorkThread
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
class Parser(QWidget):
|
|
9
8
|
def __init__(self,parent):
|
|
10
9
|
QWidget.__init__(self,parent)
|
|
11
10
|
self.parent = parent
|
|
12
|
-
self.
|
|
11
|
+
self.par_thread = WorkThread()
|
|
13
|
-
self.isRunning = False
|
|
14
|
-
self.connect(self, SIGNAL("
|
|
12
|
+
self.connect(self.par_thread, SIGNAL("update"),self.error)
|
|
13
|
+
self.connect(self.par_thread, SIGNAL("fini"),self.stop)
|
|
15
14
|
|
|
16
|
-
def
|
|
15
|
+
def error(self,text):
|
|
16
|
+
'''Solved problem by adding Success to sqc file'''
|
|
17
|
+
self.parent.errorTree.reset()
|
|
18
|
+
if(text != "" and text != "Success"):
|
|
19
|
+
if(self.parent.tabWidget_3.isHidden()):
|
|
20
|
+
self.parent.tabWidget_3.show()
|
|
21
|
+
self.parent.tabWidget_3.setCurrentIndex(0)
|
|
17
|
-
|
|
22
|
+
errorlist = text.split(',')
|
|
23
|
+
fileName = self.parent.files[self.parent.tabWidget.currentIndex()]
|
|
18
|
-
|
|
24
|
+
self.parent.errorTree.addError(fileName,errorlist)
|
|
25
|
+
self.parent.tabWidget.currentWidget().reset()
|
|
19
|
-
|
|
26
|
+
self.parent.tabWidget.currentWidget().addError(int(errorlist[0]))
|
|
27
|
+
else:
|
|
20
|
-
|
|
28
|
+
if not(self.parent.tabWidget_3.isHidden()):
|
|
21
|
-
|
|
29
|
+
self.parent.tabWidget_3.hide()
|
|
22
|
-
|
|
30
|
+
self.parent.tabWidget.currentWidget().reset()
|
|
23
|
-
|
|
24
|
-
def output(self,pipe):
|
|
25
|
-
while True:
|
|
26
|
-
try:
|
|
27
|
-
|
|
31
|
+
self.parent.errorTree.reset()
|
|
28
|
-
|
|
32
|
+
|
|
29
|
-
|
|
33
|
+
|
|
30
|
-
|
|
31
|
-
if len(line) > 0:
|
|
32
|
-
self.emit(SIGNAL("parse"),line)
|
|
33
|
-
except:
|
|
34
|
-
print "except"
|
|
35
|
-
#traceback.print_exc()
|
|
36
|
-
|
|
37
|
-
|
|
38
34
|
def run(self,nfile):
|
|
39
|
-
#print nfile
|
|
40
35
|
if(nfile.endswith(".nut")):
|
|
41
|
-
self.
|
|
36
|
+
self.par_thread.setCmd(sqc+" "+nfile)
|
|
42
|
-
if self.parser_process != None and self.parser_process.poll() == None:
|
|
43
|
-
|
|
37
|
+
self.par_thread.run()
|
|
44
|
-
|
|
38
|
+
|
|
45
|
-
t = threading.Thread(target=self.output, args=(self.parser_process.stdout,))
|
|
46
|
-
|
|
39
|
+
def stop(self):
|
|
47
|
-
|
|
40
|
+
self.par_thread.close_process()
|
|
48
41
|
|
|
49
|
-
|
|
50
42
|
def close(self):
|
|
43
|
+
self.par_thread.kill_process()
|
|
51
|
-
|
|
44
|
+
self.par_thread.close_process()
|
|
52
|
-
|
|
45
|
+
self.par_thread.quit()
|
Widget/style.py
CHANGED
|
@@ -68,7 +68,7 @@ class Style8:
|
|
|
68
68
|
def __init__(self):
|
|
69
69
|
self.color = QColor('#000000')
|
|
70
70
|
self.paper = QColor('#ffffff')
|
|
71
|
-
self.caret = QColor('#
|
|
71
|
+
self.caret = QColor('#e8f2fe')#eclipse java blue caret bg
|
|
72
72
|
self.marker = QColor('#ee1111')
|
|
73
73
|
self.margin = QColor('#cccccc')
|
|
74
74
|
|
Widget/tree.py
CHANGED
|
@@ -119,8 +119,10 @@ class ProjectTree(QTreeWidget):
|
|
|
119
119
|
#self.setColumnWidth(0,280)
|
|
120
120
|
|
|
121
121
|
def initProjects(self):
|
|
122
|
+
if(config.projects() != None):
|
|
123
|
+
if(len(config.projects()) != None):
|
|
122
|
-
|
|
124
|
+
for pro in config.projects():
|
|
123
|
-
|
|
125
|
+
self.createProject(pro)
|
|
124
126
|
|
|
125
127
|
def readDir(self,parent,path):
|
|
126
128
|
for d in oslistdir(path):
|
|
@@ -174,7 +176,8 @@ class ProjectTree(QTreeWidget):
|
|
|
174
176
|
#print "adding"+startDir
|
|
175
177
|
else:
|
|
176
178
|
#print "removing"+startDir
|
|
179
|
+
if(startDir in self.projects):
|
|
177
|
-
|
|
180
|
+
self.projects.remove(startDir)
|
|
178
181
|
config.setProject(self.projects)
|
|
179
182
|
QMessageBox.about(self,"Can't Open Project","Project Does Not Exist %s"%startDir)
|
|
180
183
|
|
|
@@ -524,31 +527,31 @@ class ProjectTree(QTreeWidget):
|
|
|
524
527
|
class Error(QTreeWidgetItem):
|
|
525
528
|
def __init__(self,parent,line,text):
|
|
526
529
|
QTreeWidgetItem.__init__(self,parent)
|
|
527
|
-
self.closed = False
|
|
528
|
-
if(self.closed):
|
|
529
|
-
|
|
530
|
+
self.setIcon(0,Icons.error)
|
|
531
|
+
self.setText(0,"Line "+line+": "+text)
|
|
532
|
+
|
|
533
|
+
class ErrorFile(QTreeWidgetItem):
|
|
530
|
-
|
|
534
|
+
def __init__(self,parent,name):
|
|
535
|
+
QTreeWidgetItem.__init__(self,parent)
|
|
531
|
-
|
|
536
|
+
self.setIcon(0,Icons.file_obj)
|
|
532
|
-
self.setText(0,"
|
|
537
|
+
self.setText(0,"File: "+name)
|
|
533
|
-
self.setText(1,text)
|
|
534
538
|
|
|
535
539
|
class ErrorTree(QTreeWidget):
|
|
536
540
|
def __init__(self,parent = None):
|
|
537
541
|
QTreeWidget.__init__(self,parent)
|
|
538
542
|
self.errorCount = 0
|
|
539
|
-
self.setColumnCount(
|
|
543
|
+
self.setColumnCount(1)
|
|
540
|
-
self.
|
|
544
|
+
self.header().close()
|
|
541
545
|
|
|
542
|
-
def addError(self,errorlist):
|
|
546
|
+
def addError(self,fileName,errorlist):
|
|
543
|
-
|
|
547
|
+
f = ErrorFile(self,fileName)
|
|
544
|
-
i = Error(
|
|
548
|
+
i = Error(f,errorlist[0],errorlist[2])
|
|
545
|
-
self.addTopLevelItem(
|
|
549
|
+
self.addTopLevelItem(f)
|
|
550
|
+
self.expandAll()
|
|
546
551
|
|
|
547
552
|
def reset(self):
|
|
548
|
-
#print self.topLevelItemCount()
|
|
549
553
|
if(self.topLevelItemCount() != 0):
|
|
550
554
|
self.clear()
|
|
551
|
-
self.errorCount = 0
|
|
552
555
|
|
|
553
556
|
class OutlineTree(QTreeWidget):
|
|
554
557
|
def __init__(self,parent = None):
|
Widget/tree.pyc
CHANGED
|
Binary file
|
Widget/workthread.py
CHANGED
|
@@ -49,10 +49,10 @@ class WorkThread(QThread):
|
|
|
49
49
|
self.emit(SIGNAL("fini"),no,self.cmd)
|
|
50
50
|
|
|
51
51
|
def readOutput(self):
|
|
52
|
-
self.emit(SIGNAL("update"),
|
|
52
|
+
self.emit(SIGNAL("update"),str(self.process.readAllStandardOutput()))
|
|
53
53
|
|
|
54
54
|
def readErrors(self):
|
|
55
|
-
self.emit(SIGNAL("update"),
|
|
55
|
+
self.emit(SIGNAL("update"),str(self.process.readAllStandardError()))
|
|
56
56
|
|
|
57
57
|
def __del__(self):
|
|
58
58
|
self.wait()
|
build/exe.win32-2.7/Sabel.exe
CHANGED
|
Binary file
|
build/exe.win32-2.7/Sabel.zip
CHANGED
|
Binary file
|
build/exe.win32-2.7/{config.yaml → config.yml}
RENAMED
|
@@ -7,7 +7,6 @@ ANT:
|
|
|
7
7
|
- android update project --target 5 --path .
|
|
8
8
|
- ant debug install
|
|
9
9
|
CMD:
|
|
10
|
-
- GCC
|
|
11
10
|
- CMD
|
|
12
11
|
- PYTHON
|
|
13
12
|
- ADB
|
|
@@ -15,22 +14,19 @@ CMD:
|
|
|
15
14
|
- Make
|
|
16
15
|
- SQ
|
|
17
16
|
- JAVA
|
|
17
|
+
- GCC
|
|
18
|
+
- NEKO
|
|
19
|
+
- NEKOC
|
|
18
20
|
ClosedProject:
|
|
19
21
|
- 0
|
|
20
22
|
- 0
|
|
21
|
-
- 0
|
|
22
23
|
File:
|
|
23
|
-
- C:/CODE/assetsd/main.nut
|
|
24
|
-
- C:/CODE/assetsd/creditscene.nut
|
|
25
|
-
- C:/CODE/assetsd/logoscene.nut
|
|
26
24
|
- C:/Documents and Settings/Administrator/My Documents/www.mercyelectronic.com/index.html
|
|
27
25
|
- C:/Documents and Settings/Administrator/My Documents/www.mercyelectronic.com/style.css
|
|
28
|
-
- C:/neko-1.8.2/Makefile
|
|
29
26
|
PARAM:
|
|
30
|
-
-
|
|
27
|
+
- hh
|
|
31
28
|
Project:
|
|
32
29
|
- C:/CODE/datad/
|
|
33
|
-
- C:/CODE/assetsd/
|
|
34
30
|
Recent: []
|
|
35
31
|
Setting:
|
|
36
32
|
device: 1
|
|
@@ -44,6 +40,14 @@ Setting:
|
|
|
44
40
|
workspace: C:/CODE/
|
|
45
41
|
Style: 0
|
|
46
42
|
TODO:
|
|
43
|
+
- Fix Closed Projects Bug
|
|
44
|
+
- Add Build Options
|
|
47
|
-
-
|
|
45
|
+
- Add OS support
|
|
46
|
+
- Add Style Options
|
|
48
|
-
-
|
|
47
|
+
- Add iOS support
|
|
48
|
+
- Make Mac Build
|
|
49
|
+
- Add Lua and Neko Lexers
|
|
49
|
-
- Dude
|
|
50
|
+
- Dude Thats it for now
|
|
51
|
+
- Squirrel Parser
|
|
52
|
+
- Lua Parser
|
|
53
|
+
- Neko Parser
|
build/exe.win32-2.7/library.zip
CHANGED
|
Binary file
|
config.yml
CHANGED
|
@@ -20,15 +20,13 @@ ClosedProject:
|
|
|
20
20
|
- 0
|
|
21
21
|
- 0
|
|
22
22
|
File:
|
|
23
|
-
- C:/CODE/assetsd/common.nut
|
|
24
|
-
- C:/CODE/
|
|
23
|
+
- C:/CODE/assets/creditscene.nut
|
|
25
|
-
- C:/CODE/assetsd/logoscene.nut
|
|
26
|
-
- C:/
|
|
24
|
+
- C:/Documents and Settings/Administrator/My Documents/www.mercyelectronic.com/index.html
|
|
25
|
+
- C:/Documents and Settings/Administrator/My Documents/www.mercyelectronic.com/style.css
|
|
27
26
|
PARAM:
|
|
28
27
|
- Dude
|
|
29
28
|
Project:
|
|
30
|
-
- C:/CODE/datad/
|
|
31
|
-
- C:/CODE/
|
|
29
|
+
- C:/CODE/assets/
|
|
32
30
|
Recent: []
|
|
33
31
|
Setting:
|
|
34
32
|
device: 1
|
globals.py
CHANGED
|
@@ -32,7 +32,7 @@ workDir = os.getcwd()
|
|
|
32
32
|
apiDir = ospathjoin(workDir,"api")
|
|
33
33
|
iconDir = ospathjoin("Icons")
|
|
34
34
|
binDir = ospathjoin(workDir,"bin")
|
|
35
|
-
|
|
35
|
+
sqc = ospathjoin(binDir,"sqc.exe")
|
|
36
36
|
|
|
37
37
|
recycle = send2trash
|
|
38
38
|
PY_VERSION = python_version()
|
mainwindow.py
CHANGED
|
@@ -29,20 +29,22 @@ class MainWindow(Window):
|
|
|
29
29
|
self.connect(self.tabWidget,SIGNAL("dropped"), self.createTabs)
|
|
30
30
|
self.tabWidget.tabCloseRequested.connect(self.closeTab)
|
|
31
31
|
self.treeWidget.itemDoubleClicked.connect(self.treeItemClicked)
|
|
32
|
+
self.errorTree.itemDoubleClicked.connect(self.errorLine)
|
|
32
33
|
self.connect(self.treeWidget,SIGNAL("openFileClicked"),self.treeItemClicked)
|
|
33
34
|
self.connect(self.treeWidget,SIGNAL("create"), lambda x:self.ant.create(x))
|
|
34
35
|
self.connect(self.treeWidget,SIGNAL("build"), lambda x:self.ant.build(x))
|
|
35
36
|
self.connect(self.treeWidget,SIGNAL("buildRun"), lambda x:self.ant.buildRun(x))
|
|
36
37
|
self.connect(self.treeWidget,SIGNAL("clean"), lambda x:self.ant.clean(x))
|
|
37
38
|
self.connect(self.treeWidget,SIGNAL("run"), lambda x:self.ant.run(x))
|
|
38
|
-
self.initInterpreter()
|
|
39
|
+
#self.initInterpreter()
|
|
39
40
|
|
|
40
41
|
def initConfig(self):
|
|
41
42
|
self.recent = config.recent()
|
|
42
43
|
self.dirty = []
|
|
43
44
|
if(config.files() != None):
|
|
45
|
+
if(len(config.files()) != 0):
|
|
44
|
-
|
|
46
|
+
for i in config.files():
|
|
45
|
-
|
|
47
|
+
self.createTab(i)
|
|
46
48
|
|
|
47
49
|
def treeItemClicked(self,item):
|
|
48
50
|
if(item.isFile()):
|
|
@@ -58,6 +60,7 @@ class MainWindow(Window):
|
|
|
58
60
|
self.ipy.initInterpreter(locals())
|
|
59
61
|
self.tabWidget_3.addTab(self.ipy, "Python")
|
|
60
62
|
|
|
63
|
+
'''Must go through this only'''
|
|
61
64
|
def createTab(self,nfile):
|
|
62
65
|
if(nfile != None):
|
|
63
66
|
if(self.files != None):
|
|
@@ -65,30 +68,29 @@ class MainWindow(Window):
|
|
|
65
68
|
if(nfile in self.files):
|
|
66
69
|
#print "File Already Open\n"+nfile
|
|
67
70
|
self.tabWidget.setCurrentIndex(self.files.index(nfile))
|
|
68
|
-
return
|
|
71
|
+
return False
|
|
69
72
|
if(ospathexists(nfile)):
|
|
70
73
|
self.openEditor(nfile)
|
|
71
|
-
return
|
|
74
|
+
return True
|
|
72
75
|
else:
|
|
73
|
-
#dont know must check this the last file is not removed executes only
|
|
74
|
-
#1 when it has to remove 2 files
|
|
75
|
-
#check sel.files
|
|
76
|
-
|
|
76
|
+
if(nfile in self.files):
|
|
77
|
-
print "removing"+nfile
|
|
78
|
-
|
|
77
|
+
self.files.remove(nfile)
|
|
79
78
|
config.setFile(self.files)
|
|
80
79
|
QMessageBox.about(self,"Can't Open","File Does Not Exist\n"+nfile)
|
|
81
|
-
return
|
|
80
|
+
return False
|
|
82
81
|
|
|
83
82
|
def createTabs(self,links):
|
|
83
|
+
if(links != None):
|
|
84
|
+
if(len(links) != 0):
|
|
84
|
-
|
|
85
|
+
for i in links:
|
|
85
|
-
|
|
86
|
+
self.createTab(i)
|
|
86
87
|
|
|
87
88
|
def openEditor(self,nfile):
|
|
88
89
|
text = ""
|
|
89
90
|
try:
|
|
90
91
|
infile = open(nfile, 'r')
|
|
91
92
|
text = infile.read()
|
|
93
|
+
#infile.close()
|
|
92
94
|
self.files.append(nfile)
|
|
93
95
|
config.setFile(self.files)
|
|
94
96
|
self.dirty.append(False)
|
|
@@ -100,25 +102,37 @@ class MainWindow(Window):
|
|
|
100
102
|
if(len(self.files)) != 0:
|
|
101
103
|
#This line sets the opened file to display first Important not checked
|
|
102
104
|
self.tabWidget.setCurrentIndex(len(self.files)-1)
|
|
105
|
+
return True
|
|
103
106
|
except:
|
|
104
|
-
|
|
107
|
+
if(nfile in self.files):
|
|
105
|
-
|
|
108
|
+
self.files.remove(nfile)
|
|
106
109
|
config.setFile(self.files)
|
|
107
110
|
QMessageBox.about(self,"Can't Open","File is Being Used\n"+nfile)
|
|
111
|
+
return False
|
|
108
|
-
finally:
|
|
112
|
+
#finally:
|
|
109
|
-
|
|
113
|
+
# infile.close()
|
|
110
114
|
|
|
111
115
|
|
|
112
116
|
def openImage(self,nfile):
|
|
117
|
+
if(ospathexists(nfile)):
|
|
113
|
-
|
|
118
|
+
form = Image(self,nfile)
|
|
114
|
-
|
|
119
|
+
form.show()
|
|
120
|
+
return True
|
|
121
|
+
else:
|
|
122
|
+
QMessageBox.about(self,"Can't Open","File Does Not Exist\n"+nfile)
|
|
123
|
+
return False
|
|
115
124
|
#print nfile
|
|
116
125
|
#self.tiler.addImage(nfile)
|
|
117
126
|
#self.tiler.show()
|
|
118
127
|
|
|
119
128
|
def openAudio(self,nfile):
|
|
129
|
+
if(ospathexists(nfile)):
|
|
120
|
-
|
|
130
|
+
form = Audio(self,nfile)
|
|
121
|
-
|
|
131
|
+
form.show()
|
|
132
|
+
return True
|
|
133
|
+
else:
|
|
134
|
+
QMessageBox.about(self,"Can't Open","File Does Not Exist\n"+nfile)
|
|
135
|
+
return False
|
|
122
136
|
|
|
123
137
|
def closeTab(self,index):
|
|
124
138
|
'''Boolean result invocation method.'''
|
|
@@ -165,15 +179,13 @@ class MainWindow(Window):
|
|
|
165
179
|
if len(self.files) != 0:
|
|
166
180
|
if(fname in self.files):
|
|
167
181
|
self.createTab(fname)
|
|
168
|
-
return
|
|
182
|
+
return True
|
|
169
183
|
else:
|
|
170
184
|
QMessageBox.about(self, "Already Open","File Already Open")
|
|
171
|
-
return
|
|
185
|
+
return False
|
|
172
186
|
else:
|
|
173
187
|
self.createTab(fname)
|
|
174
188
|
else:
|
|
175
|
-
#print "not"
|
|
176
|
-
#this is when the files list is empty and None type
|
|
177
189
|
self.files = []
|
|
178
190
|
self.createTab(fname)
|
|
179
191
|
|
|
@@ -191,12 +203,12 @@ class MainWindow(Window):
|
|
|
191
203
|
fl.write(tempText)
|
|
192
204
|
fl.close()
|
|
193
205
|
self.clearDirty(index)
|
|
194
|
-
self.parser.run(self.files[index])
|
|
195
206
|
else:
|
|
196
207
|
QMessageBox.about(self, "Can't Save","Failed to save ...")
|
|
197
|
-
self.statusBar().showMessage('Failed to save ...', 5000)
|
|
198
208
|
except:
|
|
199
209
|
QMessageBox.about(self, "Can't Save","File is Locked")
|
|
210
|
+
self.parser.run(self.files[index])
|
|
211
|
+
#must implement for all files
|
|
200
212
|
|
|
201
213
|
def fileSaveAll(self):
|
|
202
214
|
def fileSaveIndex(index):
|
|
@@ -212,7 +224,6 @@ class MainWindow(Window):
|
|
|
212
224
|
self.clearDirty(index)
|
|
213
225
|
else:
|
|
214
226
|
QMessageBox.about(self, "Can't Save","Failed to save ...")
|
|
215
|
-
self.statusBar().showMessage('Failed to save ...', 5000)
|
|
216
227
|
except:
|
|
217
228
|
QMessageBox.about(self, "Can't Save","File is Locked")
|
|
218
229
|
if(self.files != None):
|
|
@@ -222,7 +233,7 @@ class MainWindow(Window):
|
|
|
222
233
|
|
|
223
234
|
|
|
224
235
|
def closeEvent(self, event):
|
|
225
|
-
#check this
|
|
236
|
+
#check this adb.exe process is always on
|
|
226
237
|
self.adb.close()
|
|
227
238
|
self.parser.close()
|
|
228
239
|
self.command.close()
|
|
@@ -246,8 +257,12 @@ class MainWindow(Window):
|
|
|
246
257
|
lang = 0
|
|
247
258
|
if nfile.endswith(".py"):
|
|
248
259
|
lang = 0
|
|
249
|
-
elif (nfile.endswith(".cpp") or nfile.endswith(".h") or nfile.endswith(".c")):
|
|
260
|
+
elif (nfile.endswith(".cpp") or nfile.endswith(".h") or nfile.endswith(".c") or nfile.endswith(".hpp")):
|
|
250
261
|
lang = 1
|
|
251
262
|
elif nfile.endswith(".nut"):
|
|
252
263
|
lang = 2
|
|
264
|
+
elif nfile.endswith(".neko"):
|
|
265
|
+
lang = 2
|
|
266
|
+
elif nfile.endswith(".lua"):
|
|
267
|
+
lang = 2
|
|
253
268
|
return lang
|
runtests.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import os
|
|
2
|
+
def main(func):
|
|
3
|
+
cmd = "nosetests C:/CODE/Sabel/Test/testMain.py:TestMainWindow"#+".test_file
|
|
4
|
+
try:
|
|
5
|
+
os.system(cmd)
|
|
6
|
+
except OSError, e:
|
|
7
|
+
raise Exception, "Error: ", e
|
|
8
|
+
|
|
9
|
+
if __name__ == "__main__":
|
|
10
|
+
main("")
|
window.py
CHANGED
|
@@ -425,8 +425,11 @@ class Window(QMainWindow):
|
|
|
425
425
|
def replaceAllText(self):
|
|
426
426
|
edt = self.tabWidget.widget(self.tabWidget.currentIndex())
|
|
427
427
|
while(edt.findText(self.lineEdit.text(),self.regex.isChecked(),self.caseSensitive.isChecked(),self.wholeWord.isChecked(),self.backward.isChecked())):
|
|
428
|
-
edt.replaceText(self.lineEdit_2.text())
|
|
428
|
+
edt.replaceText(self.lineEdit_2.text())
|
|
429
|
-
|
|
429
|
+
def errorLine(self,error):
|
|
430
|
+
index = self.tabWidget.currentIndex()
|
|
431
|
+
edt = self.tabWidget.widget(index)
|
|
432
|
+
edt.setLine(error.line)
|
|
430
433
|
'''Font Functions'''
|
|
431
434
|
def zoomin(self):
|
|
432
435
|
for i in range(len(self.files)):
|