1 /* Copyright 2007-2012 Fredrik Wikstrom. All rights reserved.
3 ** Redistribution and use in source and binary forms, with or without
4 ** modification, are permitted provided that the following conditions
7 ** 1. Redistributions of source code must retain the above copyright
8 ** notice, this list of conditions and the following disclaimer.
10 ** 2. Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
14 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
15 ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 ** POSSIBILITY OF SUCH DAMAGE.
27 #ifndef DISKIMAGEGUI_H
28 #define DISKIMAGEGUI_H
30 #include <exec/exec.h>
32 #include <devices/diskimage.h>
33 #include <libraries/commodities.h>
34 #include <intuition/intuition.h>
35 #include <libraries/gadtools.h>
36 #include <libraries/asl.h>
37 #include <libraries/screennotify.h>
38 #include <reaction/reaction.h>
39 #include <classes/extwindow.h>
40 #include <gadgets/extscroller.h>
45 #define PROGNAME "DiskImageGUI"
46 #define WORKBENCHNAME "Workbench"
47 #define GA(o) ((struct Gadget *)(o))
48 #define MENU_ID(id) ((APTR)(id))
50 #ifndef ACTION_GET_DISK_FSSM
51 #define ACTION_GET_DISK_FSSM 4201
52 #define ACTION_FREE_DISK_FSSM 4202
85 IID_LIST_WRITEPROTECTED
,
98 LID_DEVICETYPECHOOSER
,
109 GID_DEVICETYPECHOOSER
,
110 GID_SETDEVICETYPE_SAVE
,
111 GID_SETDEVICETYPE_CANCEL
,
144 struct MsgPort
*userport
;
145 struct MsgPort
*appport
;
146 struct Screen
*screen
;
148 struct Menu
*menustrip
;
149 Object
*windows
[WID_MAX
];
150 Object
*images
[IID_MAX
];
151 Object
*gadgets
[GID_MAX
];
152 struct List
*lists
[LID_MAX
];
153 #ifdef FALLBACK_IMAGES
154 BOOL fallback_image
[IID_MAX
];
159 extern struct LocaleInfo LocaleInfo
;
160 extern struct DiskObject
*Icon
;
161 extern struct FileRequester
*FileReq
;
162 extern PrefsObject
*ApplicationPrefs
;
163 int main (int argc
, STRPTR
*argv
);
164 struct DiskObject
*GetProgramIcon (void);
165 void BeginScreenNotify (void);
166 void StopScreenNotify (void);
167 LONG
GetUnitNumber (struct Node
*node
);
168 LONG
GetSelectedUnit (void);
169 CONST_STRPTR
GetSelectedPlugin (void);
170 void ScanUnits (void);
171 void ScanPlugins (void);
172 void UpdateSpeedBar (void);
173 void ChangeTempDir (void);
174 void SaveSettings (void);
177 extern struct MsgPort
*BrokerPort
;
178 extern CxObj
*Broker
;
179 BOOL
RegisterCxBroker (void);
180 void UnregisterCxBroker (void);
183 void RestoreWindowSize (Object
*window
, CONST_STRPTR name
);
184 void SaveWindowSize (Object
*window
, CONST_STRPTR name
, BOOL envarc
);
187 extern struct GUIElements Gui
;
188 BOOL
SetupGUI (void);
189 void CleanupGUI (void);
190 APTR
ShowWindow (ULONG window_id
);
191 void HideWindow (ULONG window_id
);
192 void IconifyWindow (ULONG window_id
);
193 void SetWindowBusy (ULONG window_id
, ULONG busy
);
194 ULONG
GetGUISignals (void);
195 void UpdateLBVertScroller (ULONG wnd_id
, ULONG lb_id
, ULONG sc_id
);
198 BOOL
FindImage (CONST_STRPTR image
, STRPTR path
, LONG path_size
);
199 Object
*LoadImage (struct Screen
*screen
, CONST_STRPTR image
, BOOL selected
, BOOL disabled
);
202 LONG
DoReq (Object
*req
);
203 #ifndef FALLBACK_IMAGES
204 void ImageNotFoundRequester (CONST_STRPTR image
);
206 void AboutRequester (void);
207 void IoErrRequester (LONG error
);
208 void ErrorStringRequester (CONST_STRPTR error_string
);
209 void RequiredVersionRequester (CONST_STRPTR res_name
, LONG version
, LONG revision
);
212 void InsertOrEjectDisk (void);
213 void InsertDisk (void);
214 void EjectDisk (void);
215 void ToggleWriteProtect (void);
217 /* setdevicetype.c */
218 void SetDeviceType (void);