-/* $Id: mac.c,v 1.36 2003/01/24 00:25:33 ben Exp $ */
+/* $Id: mac.c,v 1.38 2003/02/01 12:54:40 simon Exp $ */
/*
* Copyright (c) 1999 Ben Harris
* All rights reserved.
case iSaveAs:
mac_savesessionas();
goto done;
+ case iDuplicate:
+ mac_dupsession();
+ goto done;
case iQuit:
cleanup_exit(0);
goto done;
case wSettings:
DisableItem(menu, iSave); /* XXX enable if modified */
EnableItem(menu, iSaveAs);
+ EnableItem(menu, iDuplicate);
menu = GetMenuHandle(mEdit);
DisableItem(menu, 0);
break;
default:
DisableItem(menu, iSave);
DisableItem(menu, iSaveAs);
+ DisableItem(menu, iDuplicate);
menu = GetMenuHandle(mEdit);
DisableItem(menu, 0);
break;
}
-char *platform_default_s(char const *name)
+FontSpec platform_default_font(char const *name)
{
+ FontSpec ret;
long smfs;
Str255 pname;
static char cname[256];
if (smfs != 0) {
GetFontName(HiWord(smfs), pname);
if (pname[0] == 0)
- return "Monaco";
- p2cstrcpy(cname, pname);
- return cname;
- } else
- return "Monaco";
+ strcpy(ret.name, "Monaco");
+ ret.height = LoWord(smfs);
+ p2cstrcpy(ret.name, pname);
+ } else {
+ strcpy(ret.name, "Monaco");
+ ret.height = 9;
+ }
+ ret.isbold = 0;
+ } else {
+ ret.name[0] = '\0';
}
+
+ return ret;
+}
+
+Filename platform_default_filename(const char *name)
+{
+ Filename ret;
+ if (!strcmp(name, "LogFileName"))
+ strcpy(ret.path, "putty.log");
+ else
+ *ret.path = '\0';
+ return ret;
+}
+
+char *platform_default_s(char const *name)
+{
return NULL;
}
{
long smfs;
- if (!strcmp(name, "FontHeight")) {
- smfs = GetScriptVariable(smSystemScript, smScriptMonoFondSize);
- if (smfs == 0)
- smfs = GetScriptVariable(smRoman, smScriptMonoFondSize);
- if (smfs != 0)
- return LoWord(smfs);
- else
- return 9;
- }
-
/* Non-raw cut and paste of line-drawing chars works badly on the
* current Unix stub implementation of the Unicode functions.
* So I'm going to temporarily set the default to raw mode so
/* SGT: I have no idea whether Mac X servers need anything here. */
}
+Filename filename_from_str(char *str)
+{
+ Filename ret;
+ strncpy(ret.path, str, sizeof(ret.path));
+ ret.path[sizeof(ret.path)-1] = '\0';
+ return ret;
+}
+
+char *filename_to_str(Filename fn)
+{
+ return fn.path;
+}
+
+int filename_equal(Filename f1, Filename f2)
+{
+ return !strcmp(f1.path, f2.path);
+}
+
+int filename_is_null(Filename fn)
+{
+ return !*fn.path;
+}
+
/*
* Local Variables:
* c-file-style: "simon"