-/* $Id: mac.c,v 1.9 2002/12/29 19:14:56 ben Exp $ */
+/* $Id: mac.c,v 1.14 2003/01/02 00:33:40 ben Exp $ */
/*
* Copyright (c) 1999 Ben Harris
* All rights reserved.
#include <Devices.h>
#include <DiskInit.h>
#include <Gestalt.h>
+#include <LowMem.h>
#include <Resources.h>
#include <Script.h>
#include <TextCommon.h>
mac_gestalts.encvvers = 0;
else {
mac_gestalts.encvvers = (*ti)->tecVersion;
+ mac_gestalts.uncvattr = (*ti)->tecUnicodeConverterFeatures;
DisposeHandle((Handle)ti);
}
windows.about = NULL;
windows.licence = NULL;
+ {
+ short vol;
+ long dirid;
+
+ /* Set the default directory for loading and saving settings. */
+ /* XXX Should we create it? */
+ if (get_session_dir(FALSE, &vol, &dirid) == noErr) {
+ LMSetSFSaveDisk(-vol);
+ LMSetCurDirStore(dirid);
+ }
+ }
init_ucs();
}
mac_clickterm(window, event);
break;
case wAbout:
- if (DialogSelect(event, &(DialogPtr)window, &item))
+ if (DialogSelect(event, &window, &item))
switch (item) {
case wiAboutLicence:
mac_openlicence();
break;
}
break;
+ case wSettings:
+ mac_clickdlg(window, event);
+ break;
}
}
case wTerminal:
mac_activateterm(window, active);
break;
+ case wSettings:
+ mac_activatedlg(window, event);
+ break;
case wAbout:
mac_activateabout(window, event);
break;
mac_updateterm(window);
break;
case wAbout:
+ case wSettings:
BeginUpdate(window);
UpdateDialog(window, window->visRgn);
EndUpdate(window);
*/
static int mac_windowtype(WindowPtr window) {
int kind;
+ long refcon;
if (window == NULL)
return wNone;
return wDA;
if (GetWVariant(window) == zoomDocProc)
return wTerminal;
- return GetWRefCon(window);
+ refcon = GetWRefCon(window);
+ if (refcon < 1024)
+ return refcon;
+ else
+ return wSettings;
}
/*
case iNew:
mac_newsession();
goto done;
+ case iOpen:
+ mac_opensession();
+ goto done;
case iClose:
mac_closewindow(window);
goto done;