4 Original GPL release version 4.12
5 Copyright 1993-2000 Jonathan Potter
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 All users of Directory Opus 4 (including versions distributed
22 under the GPL) are entitled to upgrade to the latest version of
23 Directory Opus version 5 at a reduced price. Please see
24 http://www.gpsoft.com.au for more information.
26 The release of Directory Opus 4 under the GPL in NO WAY affects
27 the existing commercial status of Directory Opus 5.
33 #include <proto/inovamusic.h>
34 #include <proto/screennotify.h>
35 #include <proto/sysinfo.h>
36 #include <proto/multiuser.h>
41 #include <proto/locale.h>
42 #define NO_INLINE_STDARG
53 CloseDevice((struct IORequest *)keyboard_req);
54 LDeleteExtIO((struct IORequest *)keyboard_req);
58 CloseDevice((struct IORequest
*)input_req
);
59 LDeleteExtIO((struct IORequest
*)input_req
);
63 if (ScreenNotifyBase
&& snm_port
) while (! RemWorkbenchClient(snm_handle
)) Delay(10);
64 if (snm_port
) LDeletePort(snm_port
);
65 CloseLibrary(ScreenNotifyBase
);
70 main_proc
->pr_WindowPtr
=windowptr_save
;
76 D(bug("Freeing special dirs\n"));
78 freedir(dopus_specialwin
[a
],-1);
79 if ( completion
[a
].memory
) LFreeRemember(&completion
[a
].memory
); // HUX
81 if (dir_memory_pool
) LibDeletePool(dir_memory_pool
);
82 for (a
=0;a
<NUMFONTS
;a
++) freefont(a
);
85 LFreeRemember(&general_key
);
86 LFreeRemember(&border_key
);
87 LFreeRemember(&menu_key
);
88 FreeStringFile(&stringdata
);
90 if (configopus_segment
) UnLoadSeg(configopus_segment
);
92 if (external_mod_segment
[a
]) UnLoadSeg(external_mod_segment
[a
]);
95 if ( user_appicon
) FreeDiskObject ( user_appicon
); // HUX
97 if (nil_file_handle
) Close(nil_file_handle
);
99 if (func_reselection
.reselection_list
)
100 FreeMem(func_reselection
.reselection_list
,func_reselection
.reselection_size
);
101 if (count_port
) LDeletePort(count_port
);
102 if (arexx_port
) LDeletePort(arexx_port
);
103 if (general_port
) LDeletePort(general_port
);
104 if (appmsg_port
) LDeletePort(appmsg_port
);
107 if (sortmenu
) PM_FreePopupMenu(sortmenu
);
109 /*if (IconBase)*/ CloseLibrary(IconBase
);
110 /*if (DiskfontBase)*/ CloseLibrary(DiskfontBase
);
111 // /*if (PPBase)*/ CloseLibrary((struct Library *)PPBase);
112 /*if (WorkbenchBase)*/ CloseLibrary(WorkbenchBase
);
113 /*if (CxBase)*/ CloseLibrary(CxBase
);
114 /*if (RexxSysBase)*/ CloseLibrary((struct Library
*)RexxSysBase
);
115 /*if (UtilityBase)*/ CloseLibrary((struct Library
*)UtilityBase
);
116 CloseLibrary(CyberGfxBase
);
120 CloseLibrary((struct Library
*)xfdMasterBase
);
121 CloseLibrary((struct Library
*)xadMasterBase
);
125 FreeSysInfo(sysinfo
);
126 CloseLibrary(SysInfoBase
);
129 if (user_info
) FreeUserInfo(user_info
);
130 if (group_info
) FreeGroupInfo(group_info
);
131 CloseLibrary(AccountsBase
);
134 if (mu_userinfo
) muFreeUserInfo(mu_userinfo
);
135 if (mu_groupinfo
) muFreeGroupInfo(mu_groupinfo
);
136 CloseLibrary((struct Library
*)muBase
);
140 CloseLibrary((struct Library
*)MUSICBase
);
144 CloseLibrary(LocaleBase
);
145 CloseLibrary(DataTypesBase
);
146 CloseLibrary(AmigaGuideBase
);
147 CloseLibrary(GadToolsBase
);
149 /*if (DOpusBase)*/ CloseLibrary((struct Library
*) DOpusBase
);
151 main_proc
->pr_CIS
=old_pr_cis
;
152 main_proc
->pr_COS
=old_pr_cos
;
153 main_proc
->pr_ConsoleTask
=old_pr_consoletask
;
165 dotaskmsg(clockmsg_port
,TASK_QUIT
,0,0,NULL
,0);
166 /*DeleteTask(clock_task);*/ clock_task
=NULL
;
172 if (hotkeymsg_port
) {
173 dotaskmsg(hotkeymsg_port
,TASK_QUIT
,0,0,NULL
,0);
174 DeleteTask(hotkey_task
); hotkey_task
=NULL
;
181 if (scr_font
[num
]) CloseFont(scr_font
[num
]);
187 LFreeRemember(&help_key
);
188 dopus_firsthelp
=NULL
;
191 void freedynamiccfg()
193 struct ConfigStuff cstuff
;
200 int checkwindowquit()
202 struct Window
*wind
,*temp
;
205 if (!MainScreen
) return(1);
207 for (a = 1, wind = MainScreen->FirstWindow; wind; wind = wind->NextWindow)
217 if ((PubScreenStatus(MainScreen
, PSNF_PRIVATE
) & PSNF_PRIVATE
) == 0)
220 if (!(simplerequest(globstring
[STR_ALIEN_WINDOWS
],globstring
[STR_CLOSE
],
221 str_cancelstring
,NULL
))) {
223 PubScreenStatus(MainScreen
, 0);
226 for (wind
= MainScreen
->FirstWindow
; wind
; )
228 temp
= wind
->NextWindow
;
229 if (wind
!= Window
) CloseWindow(wind
);
237 void dotaskmsg(port
,command
,value
,total
,data
,flag
)
238 struct MsgPort
*port
;
239 int command
,value
,total
;
244 struct dopustaskmsg taskmsg
;
246 taskmsg
.msg
.mn_Node
.ln_Type
=NT_MESSAGE
;
247 taskmsg
.msg
.mn_ReplyPort
=general_port
;
248 taskmsg
.msg
.mn_Length
=(UWORD
)sizeof(struct dopustaskmsg
);
249 taskmsg
.command
=command
;
255 PutMsg(port
,(struct Message
*)&taskmsg
);
257 WaitPort(general_port
);
258 /* cut by Jacek Rzeuski (31.03.2000) to avoid on-copy-exit crashes
259 GetMsg(general_port);
261 /* inserted by Jacek Rzeuski (31.03.2000) to avoid on-copy-exit crashes */
262 while(GetMsg(general_port
) != (struct Message
*)&taskmsg
);
269 if (status_iconified
) cleanupiconify();
271 if (MainScreen
) ScreenToBack(MainScreen
);
275 if (Window
->MenuStrip
) ClearMenuStrip(Window
);
276 if (WorkbenchBase
&& dopus_appwindow
) {
277 RemoveAppWindow(dopus_appwindow
);
278 dopus_appwindow
=NULL
;
285 if (! CloseScreen(MainScreen
))
287 simplerequest(globstring
[STR_CANNOT_CLOSE_SCREEN
],str_okaystring
,NULL
);
288 while(!(CloseScreen(MainScreen
))) Delay(50);