AeBinEditor.h
5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// AeBinEditor.h
//
// This class contains the abstract and concrete definitions
// for editor clients of the database. Editors have both read
// and write access into the database.
//
// The AeBinEditor abstract class represents an editor for assets
// according to their type or bin. It could also be called a list
// editor since the assets are viewed in a list. This editor has
// lots of routines to support the list widget callbacks and must
// handle all the user input for each cell in the list.
//
// The AeAssetEditor, which edits all assets, and the AeBankEditor,
// which edits only bank assets, are implemented as AeBinEditors.
//
#ifndef __AeBinEditor__
#define __AeBinEditor__
#include <Xm/Xm.h>
#include "AeTypes.h"
#include "AeAsset.h"
#include "AeEditor.h"
typedef enum
{
kModNone = 0,
kModShift,
kModAlt,
kModDown,
kModMotion,
kModUp
} TEditModifier;
struct _XbaeMatrixEnterCellCallbackStruct;
struct _XbaeMatrixLeaveCellCallbackStruct;
struct _XbaeMatrixModifyVerifyCallbackStruct;
struct _XbaeMatrixDrawCellCallbackStruct;
struct _XbaeMatrixWriteCellCallbackStruct;
struct _XbaeMatrixSelectCellCallbackStruct;
struct _XbaeMatrixTraverseCellCallbackStruct;
struct _XbaeMatrixDefaultActionCallbackStruct;
template<class T> class GList;
class AeAssetBase;
class AeAssetBinUI;
class AeAssetBin;
class AeAsset;
class AeAssetUI;
class AeFieldUI;
class AeBinView;
class AeBinEditor : public AeEditor
{
public:
AeBinEditor (void);
virtual ~AeBinEditor (void);
virtual void SetAssetBase (AeAssetBase *);
virtual void CreateAsset (AeAsset *, Boolean);
virtual void UpdateAsset (AeAsset *, Boolean);
virtual void DeleteAsset (AeAsset *, Boolean);
virtual void SelectAsset (AeAsset *, Boolean);
virtual void OnlineAsset (AeAsset *, Boolean);
virtual void UpdateResume (void);
void UpdateHierarchy (void);
virtual void OpenEditor (AeAsset *) { }
void InsertAsset (void);
void DeleteAssetUI (void);
void InsertChildAsset (void);
void RemoveChildAsset (void);
void SelectOrphans (void);
void SelectParents (void);
void DeselectAllAssets (void);
void DeleteAllBankAssets (void);
void SetIndexedBinUI (int index);
void SelectTypedBinUI (TAssetType);
void SetBinListUserData (Widget list);
void SetAssetFieldValue (AeAssetUI *, AeFieldUI *, void *);
AeBinView * GetView (void) { return fView; }
AeAssetBinUI * GetBinUI (void) { return fBinUI; }
int GetNumBins (void);
int GetNumBinAssets (void);
int GetNumBinFields (void);
void GetBinNames (String *);
void GetBinFieldLabels (String *);
void GetBinFieldWidths (short *);
void GetBinFieldMaxLens (int *);
void GetBinFieldAligns (unsigned char *);
Boolean FindTypedBinUI (TAssetType, AeAssetBinUI * &);
void ClickEdit (Widget, XEvent *, Boolean *);
void EnterCell (Widget, _XbaeMatrixEnterCellCallbackStruct * );
void LeaveCell (Widget, _XbaeMatrixLeaveCellCallbackStruct * );
void ModifyVerify (Widget, _XbaeMatrixModifyVerifyCallbackStruct * );
void DrawCell (Widget, _XbaeMatrixDrawCellCallbackStruct * );
void WriteCell (Widget, _XbaeMatrixWriteCellCallbackStruct * );
void SelectCell (Widget, _XbaeMatrixSelectCellCallbackStruct * );
void TraverseCell (Widget, _XbaeMatrixTraverseCellCallbackStruct *);
void DefaultAction (Widget, _XbaeMatrixDefaultActionCallbackStruct * );
void SelectAssetUI (AeAssetUI *, TEditModifier);
static XrmQuark qLeft;
static XrmQuark qRight;
static XrmQuark qUp;
static XrmQuark qDown;
// menu editing support
static void MenuCallback (Widget, XtPointer, XtPointer);
static AeBinEditor * fMenuEditor;
static AeAssetUI * fMenuAssetUI;
static AeFieldUI * fMenuFieldUI;
protected:
virtual Boolean binHasUI (AeAssetBin *);
void createBinUIs (void);
void initBinUIs (void);
void initChildBinUIs (void);
AeAssetUI * createAssetUI (AeAsset *);
int getNumAssetUIs (GList<AeAsset *> *);
void setListAssetData (GList<AeAsset *> *, int level,
int & row, Widget list);
void initName (AeAssetBinUI *);
void initFieldUIList (AeAssetBinUI *);
void initFieldUIs (void);
void initBankFileFieldUI (AeAssetBinUI *);
void initBankFieldUI (AeAssetBinUI *);
void initInstFieldUI (AeAssetBinUI *);
void initSoundFieldUI (AeAssetBinUI *);
void initEnvFieldUI (AeAssetBinUI *);
void initKeymapFieldUI (AeAssetBinUI *);
void initWaveFieldUI (AeAssetBinUI *);
void initFxFieldUI (AeAssetBinUI *);
void initFxSxnFieldUI (AeAssetBinUI *);
void updateAsset (AeAsset * asset);
void updateWidths (void);
TEditModifier params2modifier (int, String *);
AeAssetBinUI * fBinUI;
GList<AeAssetBinUI *> * fBinUIList;
GList<AeAssetUI *> * fSelectionList;
AeBinView * fView;
};
#endif // __AeBinEditor__