1507
|
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_SYMBOL_TABLE_H__
|
|
20 #define __PN_SYMBOL_TABLE_H__
|
|
21
|
|
22 #include "pnobject.h"
|
|
23
|
|
24
|
|
25 G_BEGIN_DECLS
|
|
26
|
|
27
|
|
28 #define PN_TYPE_SYMBOL_TABLE (pn_symbol_table_get_type ())
|
|
29 #define PN_SYMBOL_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PN_TYPE_SYMBOL_TABLE, PnSymbolTable))
|
|
30 #define PN_SYMBOL_TABLE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), PN_TYPE_SYMBOL_TABLE, PnSymbolTableClass))
|
|
31 #define PN_IS_SYMBOL_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PN_TYPE_SYMBOL_TABLE))
|
|
32 #define PN_IS_SYMBOL_TABLE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), PN_TYPE_SYMBOL_TABLE))
|
|
33 #define PN_SYMBOL_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PN_TYPE_SYMBOL_TABLE, PnSymbolTableClass))
|
|
34 #define PN_SYMBOL_TABLE_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class))
|
|
35 #define PN_SYMBOL_TABLE_CLASS_NAME(class) (g_type_name (PN_SYMBOL_TABLE_CLASS_TYPE (class)))
|
|
36
|
|
37 #define PN_VARIABLE(var) ((PnVariable *) var)
|
|
38 #define PN_VARIABLE_VALUE(var) (PN_VARIABLE (var)->value)
|
|
39 #define PN_VARIABLE_NAME(var) (PN_VARIABLE (var)->name)
|
|
40
|
|
41 typedef struct _PnVariable PnVariable;
|
|
42 typedef struct _PnSymbolTable PnSymbolTable;
|
|
43 typedef struct _PnSymbolTableClass PnSymbolTableClass;
|
|
44
|
|
45 struct _PnVariable
|
|
46 {
|
|
47 /*< public >*/
|
|
48 gdouble value; /* read-write */
|
|
49 gchar *name; /* read-only */
|
|
50
|
|
51 /*< private >*/
|
|
52 guint refs;
|
|
53 };
|
|
54
|
|
55 struct _PnSymbolTable
|
|
56 {
|
|
57 PnObject parent;
|
|
58
|
|
59 GList *variables;
|
|
60 };
|
|
61
|
|
62 struct _PnSymbolTableClass
|
|
63 {
|
|
64 PnObjectClass parent_class;
|
|
65 };
|
|
66
|
|
67 /* Creators */
|
|
68 GType pn_symbol_table_get_type (void);
|
|
69 PnSymbolTable *pn_symbol_table_new (void);
|
|
70
|
|
71 /* Accessors */
|
|
72 PnVariable *pn_symbol_table_ref_variable_by_name (PnSymbolTable *symbol_table,
|
|
73 const gchar *name);
|
|
74 void pn_symbol_table_ref_variable (PnSymbolTable *symbol_table,
|
|
75 PnVariable *variable);
|
|
76 void pn_symbol_table_unref_variable (PnSymbolTable *symbol_table,
|
|
77 PnVariable *variable);
|
|
78
|
|
79
|
|
80
|
|
81
|
|
82
|
|
83 #endif /* __PN_SYMBOL_TABLE_H__ */
|