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>
31 #include <devices/diskimage.h>
33 #include <dos/filehandler.h>
34 #include <libraries/mui.h>
35 #include <libraries/asl.h>
36 #include <libraries/gadtools.h>
40 #define PROGNAME "DiskImageGUI"
41 #define MENU_ID(id) ((APTR)(id))
43 #define DtpicObject MUI_NewObject(MUIC_Dtpic
81 GID_SETDEVICETYPE_SAVE
,
82 GID_SETDEVICETYPE_CANCEL
,
114 extern CONST TEXT verstag
[];
115 extern struct LocaleInfo LocaleInfo
;
116 extern BYTE DiskChangeSignal
;
117 extern BYTE ReloadPluginsSignal
;
118 extern struct DiskObject
*Icon
;
119 extern struct FileRequester
*FileReq
;
120 extern struct MUI_CustomClass
*DriveListClass
;
121 extern struct MUI_CustomClass
*PluginListClass
;
122 extern struct Hook BrokerHook
;
123 extern struct Hook MenuHook
;
124 extern struct Hook SignalHook
;
126 void ScanUnits (void);
127 void ScanPlugins (void);
128 void ChangeTempDir (void);
129 void SaveSettings (void);
132 extern struct GUIElements Gui
;
133 BOOL
CreateGUI (void);
134 void CleanupGUI (void);
135 void SetWindowBusy (ULONG wnd_id
, ULONG busy
);
138 struct MUI_CustomClass
*DriveList_CreateClass (void);
139 void DriveList_FreeClass (struct MUI_CustomClass
*cl
);
140 extern struct Hook DriveList_ActiveHook
;
141 extern struct Hook DriveList_DoubleClickHook
;
144 struct MUI_CustomClass
*PluginList_CreateClass (void);
145 void PluginList_FreeClass (struct MUI_CustomClass
*cl
);
148 extern struct Hook InsertHook
;
149 extern struct Hook EjectHook
;
150 extern struct Hook WriteProtectHook
;
151 extern struct Hook SetDeviceTypeHook
;
152 extern struct Hook DoSetDeviceTypeHook
;
155 void ImageNotFoundRequester (CONST_STRPTR image
);
156 void IoErrRequester (LONG error
);
157 void ErrorStringRequester (CONST_STRPTR error_string
);
160 #define IMG_PATH_LEN (128)
161 BOOL
FindImage (CONST_STRPTR image
, STRPTR path
, LONG path_size
);
162 Object
*LoadImage (CONST_STRPTR image
, STRPTR image_path
, const struct TagItem
*tags
);
163 Object
*MakeImageButton (CONST_STRPTR image
, CONST_STRPTR help
, BOOL disabled
, STRPTR image_path
);