source: cpp/frams/param/mutparamlist.h @ 836

Last change on this file since 836 was 792, checked in by Maciej Komosinski, 6 years ago

Code formatting

  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1// This file is a part of Framsticks SDK.  http://www.framsticks.com/
2// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
3// See LICENSE.txt for details.
4
5#ifndef _MUTPARAMLIST_H_
6#define _MUTPARAMLIST_H_
7
8#include "param.h"
9#include "mutparamiface.h"
10#include <frams/util/list.h>
11
12struct ParamInfo;
13
14class MutableParamList : public virtual ParamInterface, public MutableParamInterface
15{
16        SList list;
17        const char *objname;
18        int getSubParam(int i, ParamInterface **sub_p, int *sub_i);
19        int getSubGroup(int i, ParamInterface **sub_p, int *sub_i);
20
21        ParamInfo* getParamInfo(int i);
22        void addPI(int pos, ParamInfo *pi);
23        int findPI(ParamInfo *pi);
24        int findPI(ParamInterface *p);
25        int findPI(MutableParamInterface *p);
26        void adjustPI(int firstPI, int addprop, int addgroup);
27        void removePI(int pi_index);
28
29#define STATRICKCLASS MutableParamList
30        STCALLBACKDEF(onPropAdd);
31        STCALLBACKDEF(onPropDelete);
32        STCALLBACKDEF(onGroupAdd);
33        STCALLBACKDEF(onGroupDelete);
34        STCALLBACKDEF(onPropChange);
35        STCALLBACKDEF(onGroupChange);
36        STCALLBACKDEF(onPropActivate);
37#undef STATRICKCLASS
38
39public:
40
41        void firePropChange(int i) { onchange.action(i); }
42        void fireGroupChange(int i) { ongroupchange.action(i); }
43
44        MutableParamList(const char* n = 0, const char* d = 0) :objname(n), description(d) {}
45        ~MutableParamList();
46
47        void operator+=(ParamInterface *p);
48        void operator-=(ParamInterface *p);
49        void operator+=(MutableParamInterface *p);
50        void operator-=(MutableParamInterface *p);
51        void insert(int i, ParamInterface *p);
52        void insert(int i, MutableParamInterface *p);
53        void operator-=(int i);
54
55        /** remove all sub params */
56        void clear();
57
58        const char* getName() { return objname; }
59        const char* description;
60        const char* getDescription() { return description; }
61
62        int getGroupCount();
63        int getPropCount();
64
65        const char *id(int i);
66        const char *name(int i);
67        const char *type(int i);
68        const char *help(int i);
69        int flags(int i);
70        int group(int i);
71        void call(int i, ExtValue* args, ExtValue *ret);
72        const char *grname(int i);
73
74        int grmember(int gi, int n);
75
76        SString getString(int);
77        paInt getInt(int);
78        double getDouble(int);
79        ExtValue getExtValue(int);
80        ExtObject getObject(int);
81
82        int setInt(int, paInt);
83        int setDouble(int, double);
84        int setString(int, const SString &);
85        int setObject(int, const ExtObject&);
86        int setExtValue(int, const ExtValue&);
87};
88
89#endif
Note: See TracBrowser for help on using the repository browser.