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

245 Commits

Author SHA1 Message Date
Ben Harris
58091f6971 Duplicate Session is done.
[originally from svn r2719]
2003-01-25 15:18:51 +00:00
Ben Harris
9812db5f1f Add support for "Duplicate Session", moving back-end selection into
mac_startsession() in the process.

[originally from svn r2718]
2003-01-25 15:15:40 +00:00
Ben Harris
2aa3b8e154 Ensure that development snapshots have a version number higher than the
preceding release.

[originally from svn r2717]
2003-01-25 14:09:47 +00:00
Ben Harris
db014f112a We now have _some_ useful AE support, so mention what's missing specifically.
Also mentio lack of Duplicate Session.

[originally from svn r2716]
2003-01-25 14:07:50 +00:00
Ben Harris
75f393a4be AEGetNthPtr() is stupid and counts from 1. Allowing for this gets aevt/odoc
working.

[originally from svn r2715]
2003-01-25 14:04:47 +00:00
Ben Harris
ba6a959e69 We'd like full-screen mode too.
[originally from svn r2705]
2003-01-24 00:37:27 +00:00
Ben Harris
583c313d43 Add a bug and a missing feature.
[originally from svn r2704]
2003-01-24 00:28:57 +00:00
Ben Harris
6993486b43 Redesign the macnet.c infrastructure, largely so as to avoid using Gestalt(),
which didn't detect the MacTCP emulation in Owen's Open Transport.

[originally from svn r2703]
2003-01-24 00:25:33 +00:00
Ben Harris
596f6e9787 Add Apple Event handlers for 'aevt'/'oapp', 'aevt'/'odoc' and 'aevt'/'pdoc'.
None of them does anything useful yet (though the odoc one tries to).

[originally from svn r2700]
2003-01-23 22:57:43 +00:00
Ben Harris
30347e5313 We'll need the event log to work, too.
[originally from svn r2671]
2003-01-21 00:28:20 +00:00
Ben Harris
802ae23334 Remove stray debugging printfs.
[originally from svn r2670]
2003-01-21 00:27:24 +00:00
Ben Harris
486d91c77c More unimplemented features.
[originally from svn r2669]
2003-01-20 22:55:54 +00:00
Ben Harris
85334a8317 Add minimal Apple Event support -- we handle the 'aevt'/'quit' event.
[originally from svn r2668]
2003-01-20 22:55:08 +00:00
Ben Harris
e8ef8452c2 Sync with reality and add more things that need fixing.
[originally from svn r2660]
2003-01-20 01:07:13 +00:00
Ben Harris
979366683d unitab_xterm is now basically right.
SC's optimiser seems to do something nasty to ssh.c.

[originally from svn r2652]
2003-01-19 00:00:53 +00:00
Ben Harris
03dee4b07d Use the correct ProcInfo for AddrToStr. This makes the MacTCP code work in
PowerPC builds.  Well, makes it not crash, anyway -- AddrToStr doesn't seem
to be returning amything very useful.

[originally from svn r2651]
2003-01-18 23:26:56 +00:00
Ben Harris
3afb0f5da8 Remember which file a session was opened from, so it can be the default one
to save back to.

[originally from svn r2648]
2003-01-18 20:52:59 +00:00
Ben Harris
99c1029649 Support for saving sessions on the Mac. This is slightly useful even in the
absence of a config dialogue, since it allows me to get Default Settings out.

[originally from svn r2646]
2003-01-18 20:09:21 +00:00
Ben Harris
c66d95c0b1 PuTTY doesn't remember which file it got a saved session from, so it's
as stationery-pad-aware as it needs to be.

[originally from svn r2643]
2003-01-18 17:24:21 +00:00
Ben Harris
56209f1741 Add "Save" and "Save As..." items to the menus. No code behind them yet.
[originally from svn r2642]
2003-01-18 17:14:34 +00:00
Ben Harris
2dc0bf7a60 Move mac_opensession() from macterm.c to macdlg.c.
[originally from svn r2641]
2003-01-18 16:54:25 +00:00
Ben Harris
06a48a0c06 Various things to make the Finder like us:
- Change the creator of files we don't want the user to open to 'pTTI' (for
   "PuTTY internal"), and give them application-missing strings.
 - Provide missing-application names for saved sessions.
 - Provide a ResEdit 'TMPL' resource for integers in saved sessions.
 - Provide an icon for saved session stationery pads (maybe "Default Settings"
   should be one of these by default).  No code to handle this yet.

[originally from svn r2640]
2003-01-18 16:10:21 +00:00
Ben Harris
a8c33d8e12 Correct an incorrect black pixel in the PuTTY icon that's been annoying me
for some time.

[originally from svn r2638]
2003-01-18 12:25:43 +00:00
Ben Harris
ca7651538e It would help if everything agreed on the type of PuTTY random seed files.
[originally from svn r2636]
2003-01-18 12:18:04 +00:00
Ben Harris
1cbd489c5b Simplify the random-seed-saving code: There's no need to take great care to
preserve the old file in case the update is interrupted and replace it
atomically, so we just overwrite in place.  Much simpler.

[originally from svn r2635]
2003-01-18 12:03:28 +00:00
Ben Harris
fda52aad66 Add some icons for saved sessions and random seeds.
[originally from svn r2617]
2003-01-16 00:35:11 +00:00
Ben Harris
658e31a3c3 "I don't think that bit means what I think it means", if you see what I mean.
In other words, turn off the useTextEditServices bit in our 'SIZE' resource.

[originally from svn r2616]
2003-01-15 23:46:11 +00:00
Ben Harris
694aafa071 Add the ability to close sessions. This adds *_free() functions to most
areas of the code.  Not all back-ends have been tested, but Telnet and SSH
behave reasonably.

Incidentally, almost all of this patch was written through Mac PuTTY,
admittedly over a Telnet connection.

[originally from svn r2615]
2003-01-15 23:30:21 +00:00
Ben Harris
7a9c7f3d68 Make this compile again.
[originally from svn r2614]
2003-01-15 22:37:58 +00:00
Jacob Nevins
e8ebb4c879 Implement Simon's suggestion of moving DEFAULT_PROTOCOL into a per-backend-
link-module const variable `be_default_protocol' which suggests a sensible
default to the front end (which can ignore it). (DEFAULT_PORT is replaced by a
lookup in the backend[] table.)
Still not pretty, but it does mean that the recent fix for `ssh-default'
doesn't break PuTTYtel.

[originally from svn r2613]
2003-01-15 20:47:50 +00:00
Ben Harris
c6920b01c4 MacTCP returns canonical names with a trailing dot. We don't want this, so
strip it off.

[originally from svn r2612]
2003-01-15 18:47:41 +00:00
Ben Harris
55a996614b Use the standard linedraw->Unicode mapping from unicode.c to generate
unitab_xterm.  Most linedraw characters display correctly, but it's clear
that RDB and Apple disagree on some of the mappings.

[originally from svn r2601]
2003-01-14 19:57:36 +00:00
Ben Harris
1d92c2b783 Update for Unicode deglobalisations.
[originally from svn r2600]
2003-01-14 19:42:00 +00:00
Ben Harris
94fdeb2317 Update the "known bugs" and "missing features" sections.
[originally from svn r2599]
2003-01-14 19:41:19 +00:00
Ben Harris
902fbc43c2 Add constants to mac_res.r to set the binary version number.
Mention this in CHECKLST as a location where the version number has to be set.

[originally from svn r2598]
2003-01-14 19:29:18 +00:00
Ben Harris
34b400a131 const fallout.
[originally from svn r2597]
2003-01-14 19:09:24 +00:00
Ben Harris
0edb75b696 Remove debugging printfs from mac_workoutfontscale().
[originally from svn r2595]
2003-01-14 18:44:34 +00:00
Ben Harris
1f39efb94d Add double width/height support. This passes all the relevant parts of
vttest apart from the "mad programmer" screen, which I think is a linedraw
problem.
This also intorduces proper clipping of the drawn text for good measure.

[originally from svn r2593]
2003-01-14 18:43:26 +00:00
Ben Harris
a185e16467 request_resize() needs to call term_size() to tell the terminal emulator
that its resize request has been approved.

[originally from svn r2591]
2003-01-14 15:24:51 +00:00
Ben Harris
0e52f05217 Set the window title to the canonical host name when we connect.
[originally from svn r2574]
2003-01-12 16:25:58 +00:00
Ben Harris
b4d37df579 Consequences of Simon's recent deglobalisation changes.
[originally from svn r2573]
2003-01-12 16:11:27 +00:00
Ben Harris
6fbf5d8540 When receiving data, only pass up to the backend as much as we received.
[originally from svn r2572]
2003-01-12 15:46:33 +00:00
Ben Harris
cf2bcad348 Call ot_poll as appropriate.
Also use cleanup_exit() in preference to exit() so that MacTCP gets shut down
even on unclean exits.

[originally from svn r2560]
2003-01-12 14:45:33 +00:00
Ben Harris
80c29aa16f Don't fatalbox() unconditionally when opening a connection, since that makes
it a little difficult to do anything.

[originally from svn r2559]
2003-01-12 14:44:12 +00:00
Ben Harris
c81fa2ff24 COmpiling _before_ committing is usually a good idea.
[originally from svn r2556]
2003-01-12 14:23:00 +00:00
Ben Harris
05ae857752 Correct code to insert into a doubly-linked list.
[originally from svn r2553]
2003-01-12 13:50:04 +00:00
Ben Harris
eaff09160a Cute though DNSAddresses are, they're a poor match for the model the
rest of PuTTY has of DNS resolution, so I've replaced them with something
more conventional.  Sorry.

The new code has the advantage of working, of course.

[originally from svn r2551]
2003-01-12 13:06:59 +00:00
Ben Harris
f3eff8b5de Use memset() rather than OTMemzero(), and hence remove the need to weak link
against OTUtilityLib.

[originally from svn r2550]
2003-01-12 01:37:24 +00:00
Ben Harris
5d90fd4d1d Remove code for splatting test data into new terminals, since we can do
that over real network connections now.

[originally from svn r2549]
2003-01-12 01:25:34 +00:00
Ben Harris
139271a71a Change error handling to store the error number rather than the string,
and to convert to a string only on demand.  This makes it possible to have
the string contain the error number if we don't recognise it.

[originally from svn r2548]
2003-01-12 01:24:03 +00:00
Ben Harris
f9300b0011 Initial import of Owen's OpenTransport interface. It doesn't work yet, but
it does compile and link.

[originally from svn r2547]
2003-01-11 23:33:57 +00:00
Ben Harris
4818639014 Add an indirection layer between mtcpnet.c and the rest of PuTTY so that
we can have runtime switching between MacTCP and OpenTransport, and so
that we can cope if there's no TCP/IP stack available at all (albeit with
very little functionality at present).

[originally from svn r2546]
2003-01-11 19:43:59 +00:00
Ben Harris
2506a26ab4 Calling plug_closing() is highly likely to result in a call to sk_close(),
so arrange that mactcp_poll() can cope with that and not access freed memory
when it happens.

[originally from svn r2545]
2003-01-11 17:36:24 +00:00
Ben Harris
cd79a89c11 When polling MacTCP connections, check the connection state and if the far
end has sent a FIN pass that up to the plug.
TODO: handle less graceful connection closures.

[originally from svn r2544]
2003-01-11 17:31:59 +00:00
Ben Harris
0ea918fb3a const fallout from Simon's X forwarding changes.
[originally from svn r2540]
2003-01-11 14:08:07 +00:00
Simon Tatham
87f9446a26 Support XDM-AUTHORIZATION-1 for connecting to local X servers. If
we're going to be a security program, we can at least make a token
effort to use the most secure local X auth available! And I'm still
half-tempted to see if I can support it for remote X servers too...

[originally from svn r2537]
2003-01-11 09:31:54 +00:00
Simon Tatham
86977efa81 Introduce framework for authenticating with the local X server.
Windows and Mac backends have acquired auth-finding functions which
do nothing; Unix backend has acquired one which actually works, so
Plink can now do X forwarding believably.
(This checkin stretches into some unlikely parts of the code because
there have been one or two knock-on effects involving `const'. Bah.)

[originally from svn r2536]
2003-01-10 18:33:35 +00:00
Ben Harris
0d8ee2458a Implement get_window_title().
[originally from svn r2525]
2003-01-09 23:29:22 +00:00
Ben Harris
c342678579 Forcibly close any TCP connections that are still open when PuTTY exits.
This saves leaving them lying around to crash the machine later.

[originally from svn r2524]
2003-01-09 23:04:34 +00:00
Ben Harris
34a96d4924 Use c2pstrcpy() rather than silly sprintf() tricks.
[originally from svn r2523]
2003-01-09 22:51:41 +00:00
Ben Harris
76a43ad512 c2pstr() is deprecated. Use c2pstrcpy() instead.
[originally from svn r2522]
2003-01-09 22:45:48 +00:00
Ben Harris
79cbd905e7 Take advantage of having control over the default font to do the job properly:
ask the system script what it's preferred monospaced font is, and use that
if possible.  Failing, that, try the Roman script system, and if that fails,
fall back to Monaco 9.

[originally from svn r2521]
2003-01-09 22:39:47 +00:00
Ben Harris
627566b1f6 Set PuTTY's canBackground flag so that it receives CPU time (to process
incoming data) while in the background.

[originally from svn r2520]
2003-01-09 19:27:29 +00:00
Ben Harris
f11987f988 Install a notification procedure (ASR) on each TCP connection that wakes
PuTTY up when something happens.  This should allow it to receive data without
having to poll for it continuously.

[originally from svn r2519]
2003-01-09 19:26:39 +00:00
Simon Tatham
4d86f5979d I'm sick of all those #ifdefs in settings.c, and in any case plink
and pterm need at least one default setting to be _different_ (pterm
needs the default term type to be `xterm', while plink needs it to
be taken from $TERM). So here's a completely new alternative
mechanism for platform- and app-specific default settings. Ben will
probably want to check the integrity of the Mac port, since I've
fiddled with it without testing that it still compiles.

[originally from svn r2513]
2003-01-09 18:06:29 +00:00
Ben Harris
c601d72463 Add PuTTYtel binaries.
[originally from svn r2503]
2003-01-08 23:58:50 +00:00
Ben Harris
f4384cb6c7 Rather useless entropy-collection functions for Mac OS. These need work.
[originally from svn r2502]
2003-01-08 23:56:48 +00:00
Ben Harris
697794abbf Fairly major hackery to get SSH going on the Mac. Half the support
functions are only dummy stubs, but it's still minimally usable.  At
least, as long as you don't want to do anything complex like logging out.

[originally from svn r2500]
2003-01-08 22:46:12 +00:00
Ben Harris
dd39a1919d sshsha.c and sshmd5.c compile fine on PowerPC now.
[originally from svn r2471]
2003-01-05 15:31:45 +00:00
Ben Harris
30bff47c89 Add reception support for MacTCP. Now I can log in over TELNET, just about.
There are still lots of things to fix, like urgent data or the fact that
everything seems to happen one keypress too late, but this is an important
milestone.

[originally from svn r2458]
2003-01-05 12:53:38 +00:00
Ben Harris
a7ba273b5b When looking for the correct backend to use, look in the configuration
structure for the session, not the almost-dead global cfg.

[originally from svn r2457]
2003-01-05 11:31:51 +00:00
Ben Harris
ac85d9b8c9 Second work-in-progress MacTCP commit. We can now open a connection, but
not transfer any data across it.

[originally from svn r2456]
2003-01-05 10:52:56 +00:00
Ben Harris
ba15f25503 Beginnings of a MacTCP network layer. This has all of the DNS interface
present, including stuff to find and load the MacTCP DNR.  Actually making
a TCP connection is still unimplemented, though, and much testing remains
to be done.

[originally from svn r2452]
2003-01-04 19:51:20 +00:00
Ben Harris
94b7de24f1 Add a vsnprintf() for the Mac, which doesn't have one of its own. This is
the NetBSD kernel printf, which is integer-only and under a Berkeley-style
(now 3-clause) copyright owned by UCB.  This has only been compile-tested,
but almost all of my changes were in the definitions at the top (the exception
being to remove tty output).  This lacks 64-bit support because the Apple
68K C compiler, SC, lacks it too.

[originally from svn r2451]
2003-01-04 19:01:45 +00:00
Ben Harris
a952ead769 Provide a version of stricmp() and strnicmp() for Mac OS, which doesn't have
its own.  These are from NetBSD's libc, and have a standard (now 3-clause)
Berkeley licence.

Also provide a definition of DWORD and a better definition of BYTE.

[originally from svn r2449]
2003-01-04 17:24:49 +00:00
Ben Harris
e82053be5c <MacTypes.h> says we should use NULL rather than nil in C, so do that.
[originally from svn r2444]
2003-01-04 12:45:11 +00:00
Ben Harris
e13dfa3562 Re-arrange the sums in the size tip code so as to ensure that we're always do
division on positive numbers, hence avoiding nasty problems of rounding
towards zero when I wanted rounding down.

[originally from svn r2443]
2003-01-04 00:48:13 +00:00
Ben Harris
7c40e3434d Small simplification in mac_init().
[originally from svn r2442]
2003-01-04 00:31:04 +00:00
Ben Harris
561029bfdf 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]
2003-01-04 00:13:18 +00:00
Ben Harris
0a6e82b4dd Update copyright notices that both Owen and Simon managed to miss.
_How_ many copies of the licence do we need? *grin*

[originally from svn r2435]
2003-01-03 12:20:14 +00:00
Ben Harris
8af9c0a745 Pull in Script.r so we can use verBritain in the 'vers' resources rather
than hardcoding 2.

[originally from svn r2432]
2003-01-03 00:40:52 +00:00
Ben Harris
375185cf9f Any Mac that can handle CFM-68K code must have at least a 68020 CPU, and hence
be equipped with Color QuickDraw, as are all PowerPC systems.  Hence, don't
bother with support for basic QuickDraw in the CFM-68K and PowerPC builds.

[originally from svn r2431]
2003-01-02 23:52:44 +00:00
Ben Harris
44a1e7fff2 Add a prototype for init_ucs().
[originally from svn r2430]
2003-01-02 23:39:53 +00:00
Ben Harris
19ed21b98a Having tested it, note that the Classic 68K build seems to work on Mac OS X
now.  Also describe more generally which builds work where.

[originally from svn r2429]
2003-01-02 18:09:21 +00:00
Ben Harris
0416b77c7f If for some reason do_text() fails to translate from Unicode to the font
encoding, have it go through the rest of its motions with an empty string
anyway, so as to at least give a sensible empty box of the right colour.

If SetFallbackUnicodeToText() fails, switch over to using the charset
library, hence avoiding problems in do_text().

If the version of the Unicode Converter we're using doesn't understand about
interrupt-safe fallback functions, don't try to tell it we've got one.  This
prevents SetFallbackUnicodeToText() from failing on systems with old Unicode
Converters.

[originally from svn r2414]
2003-01-02 00:33:40 +00:00
Ben Harris
7bdd57f300 The redirection operator I wanted was >>, not >.
[originally from svn r2411]
2003-01-01 20:28:52 +00:00
Ben Harris
b002b19ff9 Ignore .rsrc files.
[originally from svn r2410]
2003-01-01 20:26:55 +00:00
Ben Harris
0ea7e35008 Add a mechanism for determining which charset to use for a given Mac OS font,
and use it.

[originally from svn r2409]
2003-01-01 19:51:13 +00:00
Ben Harris
d8413715a9 Remove a couple of unnecessary casts that my compiler seems to have taken
exception to.

[originally from svn r2402]
2003-01-01 11:45:43 +00:00
Ben Harris
491f7be9fc Use the shiny new character-set library to handle conversion from Unicode
to Mac OS Roman for display if the Unicode Converter isn't around.  Support
for Mac character sets other than Roman (e.g. the variant used by the Apple
VT100 font) is still absent.

[originally from svn r2401]
2002-12-31 22:49:03 +00:00
Ben Harris
3777de60cb Add a small comment explaining my failure to find any way to get QuickDraw
to give me the missing-character glyph for a font.
While I'm here, change the character we substitute for unmappable ones
to '.', since that's what the charset library uses.

[originally from svn r2397]
2002-12-31 20:11:38 +00:00
Ben Harris
6c1c86f23d Add a minimalist settings dialogue, which contains a single button
marked "open".  Still, it seems to work.

[originally from svn r2392]
2002-12-31 01:40:14 +00:00
Ben Harris
d807c97bfd Remove mentions of files and functions that no longer exist.
[originally from svn r2391]
2002-12-30 23:33:13 +00:00
Ben Harris
fc02176fcd No need to compile resources manually now.
[originally from svn r2390]
2002-12-30 23:15:46 +00:00
Ben Harris
47f459bb5f Add support for compiling 'vers' resources into Mac applications. This is
needlessly complex because Rez's preprocessor doesn't do either ANSI or K&R
stringification, and the MPW Shell isn't much good as shells go.

Also make _all_ the Mac executables depend on reources, not just the
Classic 68K one.

[originally from svn r2389]
2002-12-30 23:14:11 +00:00
Ben Harris
14432c234a Set the default directory to somewhere useful (the PuTTY saved sessions
folder) when we start up.

[originally from svn r2388]
2002-12-30 19:01:44 +00:00
Ben Harris
71d699c28c Add an "open" command to the "file" (now "session") menu on the Mac to
open an existing saved session.  This has entailed adding an extra hook to
settings.c to allow for loading settings other than by name.

[originally from svn r2387]
2002-12-30 18:21:17 +00:00
Ben Harris
d5d52933dd Remove a spurious reference to a variable I've removed.
[originally from svn r2386]
2002-12-30 15:41:52 +00:00
Ben Harris
6ca089d035 Add spaces to system include lines to that mkfiles.pl doesn't try to
follow them (silly Rez can't do angle-bracket includes).

[originally from svn r2384]
2002-12-30 14:17:51 +00:00
Ben Harris
cababe03ef Add various files produced by the build system.
[originally from svn r2382]
2002-12-29 19:19:10 +00:00
Ben Harris
ecdb9ce7b1 Don't try to call TerminateUnicodeConverter() in the CFM world: it isn't there.
[originally from svn r2381]
2002-12-29 19:14:56 +00:00
Ben Harris
d1eddb0958 Brutally simplify out all the junk that MPW left here when it first wrote this
file.

[originally from svn r2380]
2002-12-29 19:11:40 +00:00
Ben Harris
b838180aa0 Add support for building a CFM-68K version of PuTTY, which is rather smaller
than the Classic 68K version.  This requires installing more bits of the
Text Encoding Converter SDK, since Apple seem to have forgotten to put _any_
68k bits for it, either CFM or Classic, in Universal Interfaces.

Also don't bother linking against libraries we don't seem to need.

[originally from svn r2379]
2002-12-29 19:01:33 +00:00
Ben Harris
9b45be7987 Substantial overhaul of Mac build system. We now have working PowerPC builds,
and optimisation (for size) enabled.

[originally from svn r2378]
2002-12-29 15:44:15 +00:00
Ben Harris
f883570ed8 It would be better if I deleted the unused variable from the correct function.
[originally from svn r2373]
2002-12-28 22:44:27 +00:00
Ben Harris
454e6d2a43 Remove more unused variables.
[originally from svn r2372]
2002-12-28 22:25:31 +00:00
Ben Harris
1cfe88e9d2 Dispose of some unused local variables.
[originally from svn r2371]
2002-12-28 22:22:43 +00:00
Ben Harris
875d7c351e Remove an unnecessary "{Includes}" from the example Rez command.
[originally from svn r2317]
2002-12-13 00:50:53 +00:00
Ben Harris
8abe8187f7 Provide a full set of small application icons for PuTTY, now equipped with
small lightning flashes too.

[originally from svn r2316]
2002-12-13 00:45:08 +00:00
Ben Harris
93f12a008d Use the Unicode Converter to convert from Unicode to the display encoding
if it's available.  Linking against the static Unicode Converter library
costs us about 30k on Classic 68K, which I can live with.

Because the default fallback converter can generate multiple output
characters for a single input character, we provide our own fallback that
doesn't.  It converts everything to '?' instead.

[originally from svn r2315]
2002-12-13 00:02:48 +00:00
Ben Harris
c6bbb682a3 When loading a string setting, expect in the same form we would have
saved (raw text rather than Pascal string).

[originally from svn r2314]
2002-12-12 23:55:51 +00:00
Ben Harris
5b4947e590 Add some documentation for the Mac port.
[originally from svn r2305]
2002-12-11 18:34:49 +00:00
Ben Harris
8ff26fd9e5 Since PuTTY depends on lots of features of System 7, have it bale out if
it finds itself running on anything older.  This is better than killing the
whole system with an umimplemented trap.

[originally from svn r2300]
2002-12-10 01:11:40 +00:00
Ben Harris
d78a0aacc0 When resizing the window, redraw the grow box as well as the scroll bar.
I wasn't noticing the bug on my system, since the Appearance Manager handles
the grow box itself when it's present.

[originally from svn r2299]
2002-12-09 23:26:52 +00:00
Ben Harris
05456758c4 Update the non-Color Quickdraw code in pre_paint() to match recent changes
to the Color Quickdraw code.  This makes redraw work properly on old Macs
again.

[originally from svn r2298]
2002-12-09 22:49:56 +00:00
Ben Harris
e06e554830 Oops. When deciding which attributes are interesting, we want the union of
all the screens' capabilites, not the intersection.

[originally from svn r2297]
2002-12-08 22:23:08 +00:00
Ben Harris
65b8dd1501 Remove a stray prototype for mac_set_attr_mask().
[originally from svn r2296]
2002-12-08 22:15:10 +00:00
Ben Harris
c76391bccb Remove some unused cruft.
[originally from svn r2295]
2002-12-08 22:09:47 +00:00
Ben Harris
7522f5302d Slightly cheesy size-tip implementation. This is suboptimal in two ways:
* It paints over the top-left corner of the terminal window.  A little
   floating window would be rather nicer and not much harder to do.
 * It uses the low-memory global, DragHook, which is unavailable in Carbon
   and broken in some versions of Mac OS 8 (8.5?).  I suspect this is
   unavoidable, though.

[originally from svn r2287]
2002-12-08 01:17:31 +00:00
Ben Harris
f2bfdefe45 When scrolling part of the window, scroll the update region as well so that
parts that haven't been painted yet still get an update event in their new
location.  This code seems far too complicated, and I suspect there's a
better way.  Still, scrolling continuously with the window partially
off-screen now works.

[originally from svn r2284]
2002-12-07 15:21:56 +00:00
Jacob Nevins
64bbf0d4f2 Ignore generated Mac Makefile
[originally from svn r2283]
2002-12-07 12:03:33 +00:00
Ben Harris
7c308678e4 Use the Script Manager to find a small Roman font for the licence box rather
than assuming that the application font at 9pt will be useful (which it
probably won't be on non-Roman systems).

[originally from svn r2282]
2002-12-06 00:09:34 +00:00
Ben Harris
a0a3d6fad8 Add some comments explaining what each of these functions is used for.
[originally from svn r2280]
2002-12-04 19:44:57 +00:00
Ben Harris
c975d75c74 Driver script for building PuTTY under MPW. MPW isn't multi-tasking, so its
"make" program just emits a script for us to run.  This script wraps all that
horribleness up so we don't have to see it.

[originally from svn r2274]
2002-12-02 21:06:12 +00:00
Ben Harris
12081087e7 Improve support for non-colour displays by adding a mask of attributes to
ignore when breaking text into runs for display, and implement setting this
on Mac (other ports just use 0xffffffff).

We don't use DeviceLoop for this any more because Apple Technical Q&A
QA1024 says we shouldn't.  Unlike their example, we don't depend on the
Display Manager's being present either.

[originally from svn r2264]
2002-11-29 00:32:03 +00:00
Ben Harris
26f8c13f7b Don't call SetFractEnable every time we draw some text, since
SetFractEnable unconditionally flushes the Font Manager's width cache,
and the default is fine for us anyway.  This more or less doubles
redraw speed, which is nice, but still not really fast enough.

[originally from svn r2263]
2002-11-28 21:10:55 +00:00
Ben Harris
4b3ed26016 Follow the recommendations in Tech Note TB575 for clipping off the space
for the horizontal scroll bar when drawing the grow box.

[originally from svn r2262]
2002-11-28 21:02:07 +00:00
Ben Harris
81b29767a4 Use StdText() rather than DrawText, so that (later) we can support scaling of
text to get double-width etc.

Also set the background when scrolling in Original Quickdraw.

[originally from svn r2261]
2002-11-28 00:25:09 +00:00
Ben Harris
a8e0271b8d Substantial overhaul of colour handling in do_text(). Highlights include:
* No more mucking about with transfer modes.  We always set up the foreground
  and background sensibly, EraseRect the whole lot and use srcOr.  Apple
  Tech Note QD505 suggests that this should be faster than srcCopy.
* Always use the Palette Manager if we've got Color QuickDraw, even in 1bpp
  modes.
* Apply the cursor colours _after_ all the other stuff, rather than trying to
  get them through everything else intact.

Unfortunately, this doesn't make much difference to the speed.

[originally from svn r2259]
2002-11-26 01:32:51 +00:00
Ben Harris
5de2925051 Add support for displaying the licence window.
[originally from svn r2255]
2002-11-24 15:08:52 +00:00
Ben Harris
a1b5ba2270 Fix scrolling on systems without Color QuickDraw. It seems that the current
background colour and pen mode have some silly effects on ScrollRect, so
set them back to their defaults before calling it.

[originally from svn r2254]
2002-11-24 00:38:44 +00:00
Ben Harris
d63d02b743 Don't try to initialise the palette unless we have Color QuickDraw. This gets
PuTTY running on my Mac SE again (albeit very slowly and with scroll
optimisation broken for some reason).

[originally from svn r2253]
2002-11-23 22:36:56 +00:00
Ben Harris
d60ea36673 Add a Config * argument to ldisc_create(), and use it in place of the global
cfg throughout ldisc.c.  Not tested other than on Mac, but all other ports
just pass &cfg as this argument for now.

[originally from svn r2250]
2002-11-23 20:02:38 +00:00
Ben Harris
8280e645e4 Add a "Config *" argument to term_init(), and use that instead of the global
cfg throughout the terminal emulator.  Not tested in PuTTY and pterm, but they
just pass in &cfg.

[originally from svn r2248]
2002-11-23 19:01:01 +00:00
Ben Harris
7b0352362c Only try to retrieve a 'vers' resource from the current resource file (the
application), rather from the entire chain.  This prevents us displaying the
System version if PuTTY doesn't have one.  Also cope with not finding any
'vers' resource.

[originally from svn r2247]
2002-11-23 18:22:47 +00:00
Ben Harris
a90e1fda80 We don't currently need the Thread Manager (and all being well we never will),
so stop checking for it.

[originally from svn r2246]
2002-11-23 15:11:13 +00:00
Ben Harris
721399ac82 On a keypress, hide the mouse cursor, send the key to the line discipline
(rather than straight to the backend), and then prod the terminal.  I think
this is closer to the correct set of things to do.

[originally from svn r2245]
2002-11-23 14:22:11 +00:00
Ben Harris
1eef3b7e84 Remove a debugging printf.
[originally from svn r2243]
2002-11-23 13:16:36 +00:00
Ben Harris
03aa22be3c Bring in some of my scroll-optimisation stuff from the old Mac port.
This introduces a new front-end function, do_scroll(), which is expected to
scroll a part of the physical display and cause repaint events for any
areas that couldn't be scrolled (e.g. because they were hidden).
scroll_display() is a wrapper around this which also updates disptext to
match.

Currently, scroll_display is only used in response to user scrollback requests
(via term_scroll()), but extending scroll() to use it as well should be
easy.

All of this is conditional on the front end's defining OPTIMISE_SCROLL, since
only the Mac front end currently implements do_scroll().

[originally from svn r2242]
2002-11-23 13:07:29 +00:00
Ben Harris
55c618d344 Fiddle with mac_initpalette() so that the cursor works in 2bpp modes as well.
[originally from svn r2233]
2002-11-20 00:33:44 +00:00
Ben Harris
55fc07c583 Remove has_focus from Session and use the one in Terminal. Active vs passive
cursor now behaves correctly.

[originally from svn r2232]
2002-11-20 00:11:05 +00:00
Ben Harris
d50ad9ddb9 Remove CURSOR_FG_BOLD and CURSOR_BG_BOLD, and hence bring reality in line
with palette_reset()'s expectations.

[originally from svn r2231]
2002-11-19 23:59:27 +00:00
Ben Harris
93a461028b Pass co-ordinates to term_paint() in characters rather than pixels. Partial
redraws now work rather better.

[originally from svn r2230]
2002-11-19 22:05:48 +00:00
Ben Harris
ba0dbdfecc Mac resource source file, missed in last commit.
[originally from svn r2227]
2002-11-19 02:14:35 +00:00
Ben Harris
c4eebb49a9 Tentative merge of ben-mac-port (only dead for three years!) into the trunk.
This doesn't include any mkfiles.pl glue, and is missing one or two other
fixes.  The terminal emulator is kind of working, though, as, I believe, is
the store module.  Everything else is yet to be done.

[originally from svn r2226]
2002-11-19 02:13:46 +00:00