Mercurial > audlegacy-plugins
comparison src/paranormal/pn/pnscript.h @ 12:3da1b8942b8b trunk
[svn] - remove src/Input src/Output src/Effect src/General src/Visualization src/Container
author | nenolod |
---|---|
date | Mon, 18 Sep 2006 03:14:20 -0700 |
parents | src/Visualization/paranormal/pn/pnscript.h@13389e613d67 |
children |
comparison
equal
deleted
inserted
replaced
11:cff1d04026ae | 12:3da1b8942b8b |
---|---|
1 /* Paranormal - A highly customizable audio visualization library | |
2 * Copyright (C) 2001 Jamie Gennis <jgennis@mindspring.com> | |
3 * | |
4 * This library is free software; you can redistribute it and/or | |
5 * modify it under the terms of the GNU Library General Public | |
6 * License as published by the Free Software Foundation; either | |
7 * version 2 of the License, or (at your option) any later version. | |
8 * | |
9 * This library is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 * Library General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU Library General Public | |
15 * License along with this library; if not, write to the Free | |
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
17 */ | |
18 | |
19 #ifndef __PN_SCRIPT_H__ | |
20 #define __PN_SCRIPT_H__ | |
21 | |
22 #include "pnobject.h" | |
23 #include "pnsymboltable.h" | |
24 | |
25 | |
26 G_BEGIN_DECLS | |
27 | |
28 | |
29 /* Opcodes */ | |
30 enum | |
31 { | |
32 PN_OP_NOP, | |
33 PN_OP_END, | |
34 PN_OP_PUSHV, /* Push a variable */ | |
35 PN_OP_PUSHC, /* Push a constant */ | |
36 PN_OP_POP, | |
37 PN_OP_SET, | |
38 /* Arithmetic operators */ | |
39 PN_OP_ADD, | |
40 PN_OP_SUB, | |
41 PN_OP_MUL, | |
42 PN_OP_DIV, | |
43 PN_OP_NEG, | |
44 PN_OP_POW, | |
45 /* Functions */ | |
46 PN_OP_ABS, | |
47 PN_OP_MAX, | |
48 PN_OP_MIN, | |
49 PN_OP_SIN, | |
50 PN_OP_COS, | |
51 PN_OP_TAN, | |
52 PN_OP_ASIN, | |
53 PN_OP_ACOS, | |
54 PN_OP_ATAN, | |
55 PN_OP_LAST | |
56 }; | |
57 | |
58 #define PN_TYPE_SCRIPT (pn_script_get_type ()) | |
59 #define PN_SCRIPT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PN_TYPE_SCRIPT, PnScript)) | |
60 #define PN_SCRIPT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), PN_TYPE_SCRIPT, PnScriptClass)) | |
61 #define PN_IS_SCRIPT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PN_TYPE_SCRIPT)) | |
62 #define PN_IS_SCRIPT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), PN_TYPE_SCRIPT)) | |
63 #define PN_SCRIPT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PN_TYPE_SCRIPT, PnScriptClass)) | |
64 #define PN_SCRIPT_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class)) | |
65 #define PN_SCRIPT_CLASS_NAME(class) (g_type_name (PN_SCRIPT_CLASS_TYPE (class))) | |
66 | |
67 typedef struct _PnScript PnScript; | |
68 typedef struct _PnScriptClass PnScriptClass; | |
69 | |
70 struct _PnScript | |
71 { | |
72 PnObject parent; | |
73 | |
74 /* The symbol table that is being used by the current code */ | |
75 PnSymbolTable *symbol_table; | |
76 | |
77 /* The table of constants used by the script */ | |
78 gdouble *constant_table; | |
79 | |
80 /* The byte-compiled code */ | |
81 guint32 *code; | |
82 | |
83 /* The script stack used during script execution */ | |
84 gdouble *stack; | |
85 }; | |
86 | |
87 struct _PnScriptClass | |
88 { | |
89 PnObjectClass parent_class; | |
90 }; | |
91 | |
92 /* Creators */ | |
93 GType pn_script_get_type (void); | |
94 PnScript *pn_script_new (void); | |
95 | |
96 /* Actions */ | |
97 gboolean pn_script_parse_string (PnScript *script, | |
98 PnSymbolTable *symbol_table, | |
99 const gchar *string); | |
100 void pn_script_execute (PnScript *script); | |
101 | |
102 #endif /* __PN_SCRIPT_H__ */ |