Check for SYS/GL during library init. Reason is that
[AROS.git] / rom / usb / trident / ActionClass.h
blobc4c2a1ae2f59073d0285376529762fc6b2d96c1d
1 /*****************************************************************************
2 ** This is the Action custom class, a sub class of Group.mui.
3 ******************************************************************************/
4 #ifndef ACTIONCLASS_H
5 #define ACTIONCLASS_H
6 /* private structures */
8 struct DefListEntry
10 struct Node node;
11 Object *infowindow;
14 struct HWListEntry
16 struct Node node;
17 Object *infowindow;
18 Object *classpopup;
19 struct Node *phw;
20 STRPTR devname;
21 IPTR unit;
22 STRPTR prodname;
25 struct PrefsListEntry
27 struct Node node;
28 Object *infowindow;
29 APTR *pic;
30 STRPTR id;
31 STRPTR owner;
32 STRPTR type;
33 ULONG chunkid;
34 STRPTR devid;
35 STRPTR ifid;
36 ULONG size;
39 struct DevListEntry
41 struct Node node;
42 Object *infowindow;
43 struct Node *pd;
44 struct DevWinData *devdata;
45 struct ActionData *adata;
48 struct ClsListEntry
50 struct Node node;
51 Object *infowindow;
52 struct Node *puc;
53 STRPTR desc;
56 struct ErrListEntry
58 struct Node node;
59 struct Node *pem;
63 struct ActionData
65 struct Hook HardwareDisplayHook;
66 struct Hook PrefsDisplayHook;
67 struct Hook DeviceDisplayHook;
68 struct Hook ClassDisplayHook;
69 struct Hook ErrorDisplayHook;
70 struct Hook IconDisplayHook;
72 struct List hwlist;
73 struct List prefslist;
74 struct HWListEntry *acthlnode;
75 struct List devlist;
76 struct List clslist;
77 struct List errlist;
78 ULONG errorlevel;
79 struct MsgPort *eventmsgport;
80 APTR eventhandler;
82 ULONG *configroot;
83 STRPTR devidstr;
84 STRPTR ifidstr;
86 BOOL autoclassesadded;
87 BOOL swallowconfigevent;
89 struct Task *OnlUpdTask;
91 struct MUI_InputHandlerNode eventihn;
93 Object *selfobj;
94 Object *appobj;
95 Object *winobj;
96 Object *mainobj;
97 Object *cfgpagelv;
98 Object *cfgpagegrp;
99 Object *cfgcntobj[7];
101 Object *hwlistobj;
102 Object *hwdevgrpobj;
103 Object *hwdevaslobj;
104 Object *hwdevobj;
105 Object *hwunitobj;
106 Object *hwnewobj;
107 Object *hwcopyobj;
108 Object *hwdelobj;
109 Object *hwinfoobj;
110 Object *hwonlineobj;
111 Object *hwofflineobj;
113 Object *onlineobj;
114 Object *offlineobj;
115 Object *restartobj;
116 Object *saveobj;
117 Object *useobj;
119 Object *devlistobj;
120 Object *devbindobj;
121 Object *devunbindobj;
122 Object *devpowercycleobj;
123 Object *devdisableobj;
124 Object *devsuspendobj;
125 Object *devresumeobj;
126 Object *devinfoobj;
127 Object *devcfgobj;
129 Object *clslistobj;
130 Object *clsnameobj;
131 Object *clsaddobj;
132 Object *clsremobj;
133 Object *clscfgobj;
134 Object *clsscanobj;
135 Object *errlvlobj;
136 Object *errsaveobj;
137 Object *errflushobj;
138 Object *errlistobj;
140 Object *cfgtaskpriobj;
141 Object *cfgbootdelayobj;
142 Object *cfgloginfoobj;
143 Object *cfglogwarnobj;
144 Object *cfglogerrobj;
145 Object *cfglogfailobj;
146 Object *cfgpopupnewobj;
147 Object *cfgpopupgoneobj;
148 Object *cfgpopupdeathobj;
149 Object *cfgpopupdelayobj;
150 Object *cfgpopupactivateobj;
151 Object *cfgpopuptofrontobj;
152 Object *cfgdevdtxsoundobj;
153 Object *cfgdevremsoundobj;
155 Object *cfgautolpobj;
156 Object *cfgautodeadobj;
157 Object *cfgautopcobj;
159 Object *cfgpowersavingobj;
160 Object *cfgforcesuspendobj;
161 Object *cfgsuspendtimeoutobj;
163 Object *mempoolobj;
165 Object *prefslistobj;
166 Object *prefsexportobj;
167 Object *prefsimportobj;
168 Object *prefsremoveobj;
169 Object *prefssaveasobj;
171 Object *mi_classpopup;
174 #define TAGBASE_Action (TAG_USER | 23<<16)
175 #define MUIM_Action_HW_New (TAGBASE_Action | 0x0001)
176 #define MUIM_Action_HW_Copy (TAGBASE_Action | 0x0002)
177 #define MUIM_Action_HW_Del (TAGBASE_Action | 0x0003)
178 #define MUIM_Action_HW_Info (TAGBASE_Action | 0x0004)
179 #define MUIM_Action_HW_InfoClose (TAGBASE_Action | 0x0005)
180 #define MUIM_Action_HW_Activate (TAGBASE_Action | 0x0006)
181 #define MUIM_Action_HW_Update (TAGBASE_Action | 0x0007)
182 #define MUIM_Action_HW_Online (TAGBASE_Action | 0x0008)
183 #define MUIM_Action_HW_Offline (TAGBASE_Action | 0x0009)
184 #define MUIM_Action_Online (TAGBASE_Action | 0x0010)
185 #define MUIM_Action_Offline (TAGBASE_Action | 0x0011)
186 #define MUIM_Action_ChgErrLevel (TAGBASE_Action | 0x0012)
187 #define MUIM_Action_FlushErrors (TAGBASE_Action | 0x0013)
188 #define MUIM_Action_Use (TAGBASE_Action | 0x0014)
189 #define MUIM_Action_LoadPrefs (TAGBASE_Action | 0x0015)
190 #define MUIM_Action_SavePrefs (TAGBASE_Action | 0x0016)
191 #define MUIM_Action_SavePrefsAs (TAGBASE_Action | 0x0017)
192 #define MUIM_Action_SaveQuit (TAGBASE_Action | 0x0018)
193 #define MUIM_Action_UseQuit (TAGBASE_Action | 0x0019)
194 #define MUIM_Action_SaveErrors (TAGBASE_Action | 0x001b)
195 #define MUIM_Action_SaveDeviceList (TAGBASE_Action | 0x001c)
196 #define MUIM_Action_Restart (TAGBASE_Action | 0x001d)
197 #define MUIM_Action_Dev_Activate (TAGBASE_Action | 0x0020)
198 #define MUIM_Action_Dev_Bind (TAGBASE_Action | 0x0021)
199 #define MUIM_Action_Dev_Unbind (TAGBASE_Action | 0x0022)
200 #define MUIM_Action_Dev_Info (TAGBASE_Action | 0x0023)
201 #define MUIM_Action_Dev_Configure (TAGBASE_Action | 0x0025)
202 #define MUIM_Action_Dev_ForceBind (TAGBASE_Action | 0x0026)
203 #define MUIM_Action_Dev_Suspend (TAGBASE_Action | 0x0027)
204 #define MUIM_Action_Dev_Resume (TAGBASE_Action | 0x0028)
205 #define MUIM_Action_Dev_PowerCycle (TAGBASE_Action | 0x0029)
206 #define MUIM_Action_Dev_Disable (TAGBASE_Action | 0x002a)
207 #define MUIM_Action_Cls_Activate (TAGBASE_Action | 0x0030)
208 #define MUIM_Action_Cls_Add (TAGBASE_Action | 0x0031)
209 #define MUIM_Action_Cls_Remove (TAGBASE_Action | 0x0032)
210 #define MUIM_Action_Cls_Configure (TAGBASE_Action | 0x0033)
211 #define MUIM_Action_Cls_Scan (TAGBASE_Action | 0x0034)
212 #define MUIM_Action_Cfg_Changed (TAGBASE_Action | 0x0040)
213 #define MUIM_Action_Cfg_Snd_Changed (TAGBASE_Action | 0x0041)
214 #define MUIM_Action_Info_MemPool (TAGBASE_Action | 0x0050)
215 #define MUIM_Action_CloseSubWinReq (TAGBASE_Action | 0x0051)
216 #define MUIM_Action_About (TAGBASE_Action | 0x0060)
217 #define MUIM_Action_WakeUp (TAGBASE_Action | 0x0061)
218 #define MUIM_Action_HandlePsdEvents (TAGBASE_Action | 0x0062)
219 #define MUIM_Action_Cfg_Activate (TAGBASE_Action | 0x0070)
220 #define MUIM_Action_Cfg_Export (TAGBASE_Action | 0x0071)
221 #define MUIM_Action_Cfg_Import (TAGBASE_Action | 0x0072)
222 #define MUIM_Action_Cfg_Remove (TAGBASE_Action | 0x0073)
224 /* MPREFS */
225 #define MUIM_Action_LoadPrefsFrom (TAGBASE_Action | 0x0080)
226 #define MUIM_Action_SavePrefsTo (TAGBASE_Action | 0x0081)
227 #define MUIM_Action_Prefs_Changed (TAGBASE_Action | 0x0082)
230 /* prototypes */
232 struct HWListEntry * AllocHWEntry(struct ActionData *data, struct Node *phw);
233 void FreeHWEntry(struct ActionData *data, struct HWListEntry *hlnode);
234 struct DevListEntry * AllocDevEntry(struct ActionData *data, struct Node *pd);
235 void FreeDevEntry(struct ActionData *data, struct DevListEntry *dlnode);
236 struct ClsListEntry * AllocClsEntry(struct ActionData *data, struct Node *puc);
237 void FreeClsEntry(struct ActionData *data, struct ClsListEntry *clnode);
238 void FreeErrorList(struct ActionData *data);
239 void CreateErrorList(struct ActionData *data);
240 Object * CreateClassPopup(void);
241 void CleanupEventHandler(struct ActionData *data);
242 BOOL SetupEventHandler(struct ActionData *data);
243 void UpdateConfigToGUI(struct ActionData *data);
245 BOOL InternalCreateConfig(void);
246 BOOL InternalCreateConfigGUI(struct ActionData *data);
247 BOOL WriteSysConfig(STRPTR name);
248 BOOL LoadConfigFromFile(STRPTR name);
250 IPTR Action_HW_Activate(struct IClass *cl, Object *obj, Msg msg);
252 AROS_UFP3(LONG, HardwareListDisplayHook,
253 AROS_UFPA(struct Hook *, hook, A0),
254 AROS_UFPA(char **, strarr, A2),
255 AROS_UFPA(struct HWListEntry *, hlnode, A1));
257 AROS_UFP3(LONG, PrefsListDisplayHook,
258 AROS_UFPA(struct Hook *, hook, A0),
259 AROS_UFPA(char **, strarr, A2),
260 AROS_UFPA(struct PrefsListEntry *, plnode, A1));
262 AROS_UFP3(LONG, DeviceListDisplayHook,
263 AROS_UFPA(struct Hook *, hook, A0),
264 AROS_UFPA(char **, strarr, A2),
265 AROS_UFPA(struct DevListEntry *, dlnode, A1));
267 AROS_UFP3(LONG, ClassListDisplayHook,
268 AROS_UFPA(struct Hook *, hook, A0),
269 AROS_UFPA(char **, strarr, A2),
270 AROS_UFPA(struct ClsListEntry *, clnode, A1));
272 AROS_UFP3(LONG, ErrorListDisplayHook,
273 AROS_UFPA(struct Hook *, hook, A0),
274 AROS_UFPA(char **, strarr, A2),
275 AROS_UFPA(struct ErrListEntry *, elnode, A1));
277 AROS_UFP3(LONG, IconListDisplayHook,
278 AROS_UFPA(struct Hook *, hook, A0),
279 AROS_UFPA(char **, strarr, A2),
280 AROS_UFPA(STRPTR, str, A1));
282 AROS_UFP3(IPTR, ActionDispatcher,
283 AROS_UFPA(struct IClass *, cl, A0),
284 AROS_UFPA(Object *, obj, A2),
285 AROS_UFPA(Msg, msg, A1));
287 #endif