revert between 56095 -> 55830 in arch
[AROS.git] / workbench / devs / diskimage / zune_gui / include / diskimagegui.h
blob68e1534b36a82f1a21469219f508e652f17fc921
1 /* Copyright 2007-2012 Fredrik Wikstrom. All rights reserved.
2 **
3 ** Redistribution and use in source and binary forms, with or without
4 ** modification, are permitted provided that the following conditions
5 ** are met:
6 **
7 ** 1. Redistributions of source code must retain the above copyright
8 ** notice, this list of conditions and the following disclaimer.
9 **
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>
32 #include <dos/dos.h>
33 #include <dos/filehandler.h>
34 #include <libraries/mui.h>
35 #include <libraries/asl.h>
36 #include <libraries/gadtools.h>
37 #include "support.h"
38 #include "locale.h"
40 #define PROGNAME "DiskImageGUI"
41 #define MENU_ID(id) ((APTR)(id))
42 #ifndef DtpicObject
43 #define DtpicObject MUI_NewObject(MUIC_Dtpic
44 #endif
46 enum {
47 EVT_DUMMY,
48 EVT_POPKEY
51 enum {
52 WID_MAIN,
53 WID_PLUGINS,
54 WID_ABOUT,
55 WID_SETDEVICETYPE,
56 WID_MAX
59 enum {
60 MID_DUMMY,
61 MID_ABOUT,
62 MID_HIDE,
63 MID_ICONIFY,
64 MID_SNAPSHOT,
65 MID_QUIT,
66 MID_CHANGETEMPDIR,
67 MID_PLUGINS,
68 MID_SAVESETTINGS
71 enum {
72 GID_INSERT,
73 GID_EJECT,
74 GID_WRITEPROTECT,
75 GID_SETDEVICETYPE,
76 GID_REFRESH,
77 GID_DRIVELIST,
78 GID_PLUGINLIST,
79 GID_ABOUT_OK,
80 GID_DEVICETYPE,
81 GID_SETDEVICETYPE_SAVE,
82 GID_SETDEVICETYPE_CANCEL,
83 GID_MAX
86 struct GUIElements {
87 BOOL initialised;
88 APTR pool;
89 Object *app;
90 Object *wnd[WID_MAX];
91 Object *gad[GID_MAX];
94 struct DriveEntry {
95 ULONG unit_num;
96 UBYTE device_type;
97 BOOL writeprotect;
98 STRPTR unit;
99 STRPTR drive;
100 STRPTR diskimage;
101 IPTR list_pos;
104 struct PluginEntry {
105 BYTE pri_num;
106 UBYTE is_builtin;
107 UBYTE has_write;
108 STRPTR priority;
109 STRPTR name;
110 IPTR list_pos;
113 /* main.c */
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;
125 int main (void);
126 void ScanUnits (void);
127 void ScanPlugins (void);
128 void ChangeTempDir (void);
129 void SaveSettings (void);
131 /* gui.c */
132 extern struct GUIElements Gui;
133 BOOL CreateGUI (void);
134 void CleanupGUI (void);
135 void SetWindowBusy (ULONG wnd_id, ULONG busy);
137 /* drivelist.c */
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;
143 /* drivelist.c */
144 struct MUI_CustomClass *PluginList_CreateClass (void);
145 void PluginList_FreeClass (struct MUI_CustomClass *cl);
147 /* driveops.c */
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;
154 /* requesters.c */
155 void ImageNotFoundRequester (CONST_STRPTR image);
156 void IoErrRequester (LONG error);
157 void ErrorStringRequester (CONST_STRPTR error_string);
159 /* images.c */
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);
165 #endif