1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Correct handling of Mac OS 8.5 Window Manager and Control Manager. The new

functions turn out to be available only to PowerPC applications, through
WindowsLib and ControlsLib respectively, so we weak-link against those in
the obvious way.

[originally from svn r2441]
This commit is contained in:
Ben Harris 2003-01-04 00:13:18 +00:00
parent 106bf20b35
commit 561029bfdf
3 changed files with 17 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $Id: mac.c,v 1.14 2003/01/02 00:33:40 ben Exp $ */
/* $Id: mac.c,v 1.15 2003/01/04 00:13:18 ben Exp $ */
/*
* Copyright (c) 1999 Ben Harris
* All rights reserved.
@ -140,12 +140,19 @@ static void mac_startup(void) {
if (&RegisterAppearanceClient == kUnresolvedCFragSymbolAddress)
mac_gestalts.apprvers = 0;
#endif
#if TARGET_CPU_68K
mac_gestalts.cntlattr = 0;
mac_gestalts.windattr = 0;
#else
/* Mac OS 8.5 Control Manager (proportional scrollbars)? */
if (Gestalt(gestaltControlMgrAttr, &mac_gestalts.cntlattr) != noErr)
if (Gestalt(gestaltControlMgrAttr, &mac_gestalts.cntlattr) != noErr ||
&SetControlViewSize == kUnresolvedCFragSymbolAddress)
mac_gestalts.cntlattr = 0;
/* Mac OS 8.5 Window Manager? */
if (Gestalt(gestaltWindowMgrAttr, &mac_gestalts.windattr) != noErr)
if (Gestalt(gestaltWindowMgrAttr, &mac_gestalts.windattr) != noErr ||
&SetWindowContentColor == kUnresolvedCFragSymbolAddress)
mac_gestalts.windattr = 0;
#endif
/* Text Encoding Conversion Manager? */
if (
#if TARGET_RT_MAC_CFM

View File

@ -1,4 +1,4 @@
/* $Id: macterm.c,v 1.31 2003/01/02 00:33:40 ben Exp $ */
/* $Id: macterm.c,v 1.32 2003/01/04 00:13:18 ben Exp $ */
/*
* Copyright (c) 1999 Simon Tatham
* Copyright (c) 1999, 2002 Ben Harris
@ -336,7 +336,7 @@ static void mac_adjustwinbg(Session *s) {
if (!HAVE_COLOR_QD())
return;
#if TARGET_RT_CFM /* XXX doesn't link (at least for 68k) */
#if !TARGET_CPU_68K
if (mac_gestalts.windattr & gestaltWindowMgrPresent)
SetWindowContentColor(s->window,
&(*s->palette)->pmInfo[DEFAULT_BG].ciRGB);
@ -1180,8 +1180,7 @@ void set_sbar(void *frontend, int total, int start, int page) {
(*s->scrollbar)->contrlMin = 0;
(*s->scrollbar)->contrlMax = total - page;
SetControlValue(s->scrollbar, start);
#if TARGET_RT_CFM
/* XXX: This doesn't link for me. */
#if !TARGET_CPU_68K
if (mac_gestalts.cntlattr & gestaltControlMgrPresent)
SetControlViewSize(s->scrollbar, page);
#endif

View File

@ -637,6 +637,10 @@ Libs_CFM68K = {Libs_CFM} \xb6
"{CFM68KLibraries}NuMacRuntime.o"
Libs_PPC = {Libs_CFM} \xb6
"{SharedLibraries}ControlsLib" \xb6
-weaklib ControlsLib \xb6
"{SharedLibraries}WindowsLib" \xb6
-weaklib WindowsLib \xb6
"{PPCLibraries}StdCRuntime.o" \xb6
"{PPCLibraries}PPCCRuntime.o" \xb6
"{PPCLibraries}CarbonAccessors.o"