1 /*****************************************************************************
2 ** This is the Action custom class, a sub class of Group.mui.
3 ******************************************************************************/
6 /* private structures */
44 struct DevWinData
*devdata
;
45 struct ActionData
*adata
;
65 struct Hook HardwareDisplayHook
;
66 struct Hook PrefsDisplayHook
;
67 struct Hook DeviceDisplayHook
;
68 struct Hook ClassDisplayHook
;
69 struct Hook ErrorDisplayHook
;
70 struct Hook IconDisplayHook
;
73 struct List prefslist
;
74 struct HWListEntry
*acthlnode
;
79 struct MsgPort
*eventmsgport
;
86 BOOL autoclassesadded
;
87 BOOL swallowconfigevent
;
89 struct Task
*OnlUpdTask
;
91 struct MUI_InputHandlerNode eventihn
;
111 Object
*hwofflineobj
;
121 Object
*devunbindobj
;
122 Object
*devpowercycleobj
;
123 Object
*devdisableobj
;
124 Object
*devsuspendobj
;
125 Object
*devresumeobj
;
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
;
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)
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)
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
));