-# $Id: Makefile.mpw,v 1.1.2.3 1999/03/16 20:27:30 ben Exp $
+# $Id: Makefile.mpw,v 1.1.2.4 1999/03/27 15:39:45 ben Exp $
# This is the Makefile for building PuTTY for the Mac OS.
# Users of non-Mac systems will see some pretty strange characters around.
Includes =
Sym¥68K =
ObjDir¥68K =
+Sym¥PPC =
+ObjDir¥PPC =
COptions = {Includes} {Sym¥68K} -proto strict -opt all
+PPCCOptions = {Includes} {Sym¥PPC} -opt size
Objects¥68K = ¶
"{ObjDir¥68K}mac.c.o" ¶
"{ObjDir¥68K}terminal.c.o" ¶
"{ObjDir¥68K}testback.c.o"
+Objects¥PPC = ¶
+ "{ObjDir¥PPC}mac.c.x" ¶
+ "{ObjDir¥PPC}maccfg.c.x" ¶
+ "{ObjDir¥PPC}macterm.c.x" ¶
+ "{ObjDir¥PPC}misc.c.x" ¶
+# "{ObjDir¥PPC}ssh.c.x" ¶
+# "{ObjDir¥PPC}sshcrc.c.x" ¶
+# "{ObjDir¥PPC}sshdes.c.x" ¶
+# "{ObjDir¥PPC}sshmd5.c.x" ¶
+# "{ObjDir¥PPC}sshrand.c.x" ¶
+# "{ObjDir¥PPC}sshrsa.c.x" ¶
+# "{ObjDir¥PPC}sshsha.c.x" ¶
+# "{ObjDir¥PPC}telnet.c.x" ¶
+ "{ObjDir¥PPC}terminal.c.x" ¶
+ "{ObjDir¥PPC}testback.c.x"
+
+
Libs¥68K = "{CLibraries}StdCLib.o" ¶
"{Libraries}MacRuntime.o" ¶
"{Libraries}IntEnv.o" ¶
"{Libraries}Interface.o"
+Libs¥PPC = "{SharedLibraries}InterfaceLib" ¶
+ "{SharedLibraries}StdCLib" ¶
+ "{SharedLibraries}MathLib" ¶
+ "{PPCLibraries}StdCRuntime.o" ¶
+ "{PPCLibraries}PPCCRuntime.o" ¶
+ "{PPCLibraries}PPCToolLibs.o"
+
+PuTTY.ppc ÄÄ {¥MondoBuild¥} {Objects¥PPC}
+ PPCLink ¶
+ -o {Targ} {Sym¥PPC} ¶
+ {Objects¥PPC} ¶
+ -t 'APPL' ¶
+ -c 'pTTY' ¶
+ {Libs¥PPC}
+
+
PuTTY ÄÄ {Objects¥68K} {Libs¥68K}
IF (`exists {Targ}.NJ`)
ILink ¶
"{ObjDir¥68K}mac.c.o" Ä {¥MondoBuild¥} mac.c putty.h mac.h macresid.h
{C} mac.c -o {Targ} {COptions}
+"{ObjDir¥PPC}mac.c.x" Ä {¥MondoBuild¥} mac.c putty.h mac.h macresid.h
+ {PPCC} mac.c -o {Targ} {PPCCOptions}
+
"{ObjDir¥68K}maccfg.c.o" Ä {¥MondoBuild¥} maccfg.c putty.h mac.h macresid.h
{C} maccfg.c -o {Targ} {COptions}
+"{ObjDir¥PPC}maccfg.c.x" Ä {¥MondoBuild¥} maccfg.c putty.h mac.h macresid.h
+ {PPCC} maccfg.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}macterm.c.o" Ä {¥MondoBuild¥} macterm.c mac.h putty.h
{C} macterm.c -o {Targ} {COptions}
+"{ObjDir¥PPC}macterm.c.x" Ä {¥MondoBuild¥} macterm.c mac.h putty.h
+ {PPCC} macterm.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}misc.c.o" Ä {¥MondoBuild¥} misc.c putty.h
{C} misc.c -o {Targ} {COptions}
+"{ObjDir¥PPC}misc.c.x" Ä {¥MondoBuild¥} misc.c putty.h
+ {PPCC} misc.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}ssh.c.o" Ä {¥MondoBuild¥} ssh.c
{C} ssh.c -o {Targ} {COptions}
+"{ObjDir¥PPC}ssh.c.x" Ä {¥MondoBuild¥} ssh.c
+ {PPCC} ssh.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshcrc.c.o" Ä {¥MondoBuild¥} sshcrc.c
{C} sshcrc.c -o {Targ} {COptions}
+"{ObjDir¥PPC}sshcrc.c.x" Ä {¥MondoBuild¥} sshcrc.c
+ {PPCC} sshcrc.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshdes.c.o" Ä {¥MondoBuild¥} sshdes.c
{C} sshdes.c -o {Targ} {COptions}
+"{ObjDir¥PPC}sshdes.c.x" Ä {¥MondoBuild¥} sshdes.c
+ {PPCC} sshdes.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshmd5.c.o" Ä {¥MondoBuild¥} sshmd5.c
{C} sshmd5.c -o {Targ} {COptions}
+"{ObjDir¥PPC}sshmd5.c.x" Ä {¥MondoBuild¥} sshmd5.c
+ {PPCC} sshmd5.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshrand.c.o" Ä {¥MondoBuild¥} sshrand.c
{C} sshrand.c -o {Targ} {COptions}
+"{ObjDir¥PPC}sshrand.c.x" Ä {¥MondoBuild¥} sshrand.c
+ {PPCC} sshrand.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshrsa.c.o" Ä {¥MondoBuild¥} sshrsa.c
{C} sshrsa.c -o {Targ} {COptions}
+"{ObjDir¥PPC}sshrsa.c.x" Ä {¥MondoBuild¥} sshrsa.c
+ {PPCC} sshrsa.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshsha.c.o" Ä {¥MondoBuild¥} sshsha.c
{C} sshsha.c -o {Targ} {COptions}
+"{ObjDir¥PPC}sshsha.c.x" Ä {¥MondoBuild¥} sshsha.c
+ {PPCC} sshsha.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}telnet.c.o" Ä {¥MondoBuild¥} telnet.c
{C} telnet.c -o {Targ} {COptions}
+"{ObjDir¥PPC}telnet.c.x" Ä {¥MondoBuild¥} telnet.c
+ {PPCC} telnet.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}terminal.c.o" Ä {¥MondoBuild¥} terminal.c putty.h
{C} terminal.c -o {Targ} {COptions}
+"{ObjDir¥PPC}terminal.c.x" Ä {¥MondoBuild¥} terminal.c putty.h
+ {PPCC} terminal.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}testback.c.o" Ä {¥MondoBuild¥} testback.c putty.h
{C} testback.c -o {Targ} {COptions}
+"{ObjDir¥PPC}testback.c.x" Ä {¥MondoBuild¥} testback.c putty.h
+ {PPCC} testback.c -o {Targ} {PPCCoptions}
-/* $Id: mac.c,v 1.1.2.17 1999/03/21 23:23:42 ben Exp $ */
+/* $Id: mac.c,v 1.1.2.18 1999/03/27 15:39:45 ben Exp $ */
/*
* Copyright (c) 1999 Ben Harris
* All rights reserved.
static void mac_zoomwindow(WindowPtr, short);
static void mac_shutdown(void);
-static void mac_newsession(void);
-
struct mac_windows {
WindowPtr terminal; /* XXX: Temporary */
WindowPtr about;
/* Mac OS 8.5 Control Manager (proportional scrollbars)? */
if (Gestalt(gestaltControlMgrAttr, &mac_gestalts.cntlattr) != noErr)
mac_gestalts.cntlattr = 0;
+ /* Mac OS 8.5 Window Manager? */
+ if (Gestalt(gestaltWindowMgrAttr, &mac_gestalts.windattr) != noErr)
+ mac_gestalts.windattr = 0;
/* We've been tested with the Appearance Manager */
if (mac_gestalts.apprvers != 0)
static void mac_eventloop(void) {
Boolean gotevent;
EventRecord event;
- int i;
RgnHandle cursrgn;
cursrgn = NewRgn();
* Handle a key press
*/
static void mac_keypress(EventRecord *event) {
- char key;
WindowPtr window;
if (event->what == keyDown && (event->modifiers & cmdKey)) {
-/* $Id: macterm.c,v 1.1.2.28 1999/03/23 00:43:46 ben Exp $ */
+/* $Id: macterm.c,v 1.1.2.29 1999/03/27 15:39:45 ben Exp $ */
/*
* Copyright (c) 1999 Ben Harris
* All rights reserved.
static int mac_keytrans(struct mac_session *, EventRecord *, unsigned char *);
static void text_click(struct mac_session *, EventRecord *);
-#ifdef USES_ROUTINE_DESCRIPTORS
+#if TARGET_RT_MAC_CFM
static RoutineDescriptor mac_scrolltracker_upp =
BUILD_ROUTINE_DESCRIPTOR(uppControlActionProcInfo,
(ProcPtr)mac_scrolltracker);
static RoutineDescriptor mac_set_attr_mask_upp =
BUILD_ROUTINE_DESCRIPTOR(uppDeviceLoopDrawingProcInfo,
(ProcPtr)mac_set_attr_mask);
-#else /* not USES_ROUTINE_DESCRIPTORS */
+#else /* not TARGET_RT_MAC_CFM */
#define mac_scrolltracker_upp mac_scrolltracker
#define do_text_for_device_upp do_text_for_device
#define mac_set_attr_mask_upp mac_set_attr_mask
-#endif /* not USES_ROUTINE_DESCRIPTORS */
+#endif /* not TARGET_RT_MAC_CFM */
/*
* Temporary hack till I get the terminal emulator supporting multiple
void mac_newsession(void) {
struct mac_session *s;
- int i;
UInt32 starttime;
char msg[128];
}
/*
- * I don't think this is (a) safe or (b) a good way to do this.
+ * Set the background colour of the window correctly. Should be
+ * called whenever the default background changes.
*/
static void mac_adjustwinbg(struct mac_session *s) {
- if (s->wctab == NULL)
- s->wctab = (WCTabHandle)NewHandle(sizeof(**s->wctab));
- if (s->wctab == NULL)
- return; /* do without */
- (*s->wctab)->wCSeed = 0;
- (*s->wctab)->wCReserved = 0;
- (*s->wctab)->ctSize = 0;
- (*s->wctab)->ctTable[0].value = wContentColor;
- (*s->wctab)->ctTable[0].rgb = (*s->palette)->pmInfo[DEFAULT_BG].ciRGB;
- SetWinColor(s->window, s->wctab);
+#if 0 /* XXX doesn't link (at least for 68k) */
+ if (mac_gestalts.windattr & gestaltWindowMgrPresent)
+ SetWindowContentColor(s->window,
+ &(*s->palette)->pmInfo[DEFAULT_BG].ciRGB);
+ else
+#endif
+ {
+ if (s->wctab == NULL)
+ s->wctab = (WCTabHandle)NewHandle(sizeof(**s->wctab));
+ if (s->wctab == NULL)
+ return; /* do without */
+ (*s->wctab)->wCSeed = 0;
+ (*s->wctab)->wCReserved = 0;
+ (*s->wctab)->ctSize = 0;
+ (*s->wctab)->ctTable[0].value = wContentColor;
+ (*s->wctab)->ctTable[0].rgb = (*s->palette)->pmInfo[DEFAULT_BG].ciRGB;
+ SetWinColor(s->window, s->wctab);
+ }
}
/*
unsigned char buf[20];
int len;
struct mac_session *s;
- int i;
s = (struct mac_session *)GetWRefCon(window);
len = mac_keytrans(s, event, buf);
void do_text(struct mac_session *s, int x, int y, char *text, int len,
unsigned long attr) {
int style = 0;
- int bgcolour, fgcolour;
- RGBColor rgbfore, rgbback;
struct do_text_args a;
RgnHandle textrgn;