diff --git a/mac_res.r b/mac_res.r index c03261bb..4ed315d6 100644 --- a/mac_res.r +++ b/mac_res.r @@ -1,4 +1,4 @@ -/* $Id: mac_res.r,v 1.1.2.6 1999/02/28 17:05:11 ben Exp $ */ +/* $Id: mac_res.r,v 1.1.2.7 1999/03/02 23:19:20 ben Exp $ */ /* * Copyright (c) 1999 Ben Harris * All rights reserved. @@ -587,32 +587,55 @@ resource 'TMPL' (128, "pSET") { }; }; + +/* + * *mutter* It might be nice if Apple could actually put all the flags in + * Palettes.r. + */ + +#define pmCourteous 0x0000 +#define pmDithered 0x0001 +#define pmTolerant 0x0002 +#define pmAnimated 0x0004 +#define pmExplicit 0x0008 +#define pmWhite 0x0010 +#define pmBlack 0x0020 +#define pmInhibitG2 0x0100 +#define pmInhibitC2 0x0200 +#define pmInhibitG4 0x0400 +#define pmInhibitC4 0x0800 +#define pmInhibitG8 0x1000 +#define pmInhibitC8 0x2000 + +#define PM_BASIC (pmTolerant | pmInhibitG4 | pmInhibitG8) +#define PM_NORMAL (PM_BASIC | pmInhibitG2 | pmInhibitC2) + resource 'pltt' (PREF_pltt, purgeable) { { - 0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* black */ - 0x5555, 0x5555, 0x5555, pmTolerant, 0x2000, /* bright black */ - 0xbbbb, 0x0000, 0x0000, pmTolerant, 0x2000, /* red */ - 0xffff, 0x5555, 0x5555, pmTolerant, 0x2000, /* bright red */ - 0x0000, 0xbbbb, 0x0000, pmTolerant, 0x2000, /* green */ - 0x5555, 0xffff, 0x5555, pmTolerant, 0x2000, /* bright green */ - 0xbbbb, 0xbbbb, 0x0000, pmTolerant, 0x2000, /* yellow */ - 0xffff, 0xffff, 0x0000, pmTolerant, 0x2000, /* bright yellow */ - 0x0000, 0x0000, 0xbbbb, pmTolerant, 0x2000, /* blue */ - 0x5555, 0x5555, 0xffff, pmTolerant, 0x2000, /* bright blue */ - 0xbbbb, 0x0000, 0xbbbb, pmTolerant, 0x2000, /* magenta */ - 0xffff, 0x5555, 0xffff, pmTolerant, 0x2000, /* bright magenta */ - 0x0000, 0xbbbb, 0xbbbb, pmTolerant, 0x2000, /* cyan */ - 0x5555, 0xffff, 0xffff, pmTolerant, 0x2000, /* bright cyan */ - 0xbbbb, 0xbbbb, 0xbbbb, pmTolerant, 0x2000, /* white */ - 0xffff, 0xffff, 0xffff, pmTolerant, 0x2000, /* bright white */ - 0xbbbb, 0xbbbb, 0xbbbb, pmTolerant, 0x2000, /* default fg */ - 0xffff, 0xffff, 0xffff, pmTolerant, 0x2000, /* default bold fg */ - 0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* default bg */ - 0x5555, 0x5555, 0x5555, pmTolerant, 0x2000, /* default bold bg */ - 0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* cursor bg */ - 0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* bold cursor bg */ - 0x0000, 0xffff, 0x0000, pmTolerant, 0x2000, /* cursor fg */ - 0x0000, 0xffff, 0x0000, pmTolerant, 0x2000, /* bold cursor fg */ + 0x0000, 0x0000, 0x0000, PM_NORMAL, 0x2000, /* black */ + 0x5555, 0x5555, 0x5555, PM_NORMAL, 0x2000, /* bright black */ + 0xbbbb, 0x0000, 0x0000, PM_NORMAL, 0x2000, /* red */ + 0xffff, 0x5555, 0x5555, PM_NORMAL, 0x2000, /* bright red */ + 0x0000, 0xbbbb, 0x0000, PM_NORMAL, 0x2000, /* green */ + 0x5555, 0xffff, 0x5555, PM_NORMAL, 0x2000, /* bright green */ + 0xbbbb, 0xbbbb, 0x0000, PM_NORMAL, 0x2000, /* yellow */ + 0xffff, 0xffff, 0x0000, PM_NORMAL, 0x2000, /* bright yellow */ + 0x0000, 0x0000, 0xbbbb, PM_NORMAL, 0x2000, /* blue */ + 0x5555, 0x5555, 0xffff, PM_NORMAL, 0x2000, /* bright blue */ + 0xbbbb, 0x0000, 0xbbbb, PM_NORMAL, 0x2000, /* magenta */ + 0xffff, 0x5555, 0xffff, PM_NORMAL, 0x2000, /* bright magenta */ + 0x0000, 0xbbbb, 0xbbbb, PM_NORMAL, 0x2000, /* cyan */ + 0x5555, 0xffff, 0xffff, PM_NORMAL, 0x2000, /* bright cyan */ + 0xbbbb, 0xbbbb, 0xbbbb, PM_NORMAL, 0x2000, /* white */ + 0xffff, 0xffff, 0xffff, PM_NORMAL, 0x2000, /* bright white */ + 0xbbbb, 0xbbbb, 0xbbbb, PM_BASIC, 0x2000, /* default fg */ + 0xffff, 0xffff, 0xffff, PM_BASIC, 0x2000, /* default bold fg */ + 0x0000, 0x0000, 0x0000, PM_BASIC, 0x2000, /* default bg */ + 0x5555, 0x5555, 0x5555, PM_NORMAL, 0x2000, /* default bold bg */ + 0x0000, 0x0000, 0x0000, PM_NORMAL, 0x2000, /* cursor bg */ + 0x0000, 0x0000, 0x0000, PM_NORMAL, 0x2000, /* bold cursor bg */ + 0x0000, 0xffff, 0x0000, PM_BASIC, 0x2000, /* cursor fg */ + 0x0000, 0xffff, 0x0000, PM_NORMAL, 0x2000, /* bold cursor fg */ } }; diff --git a/macterm.c b/macterm.c index 0bf6230d..020fe354 100644 --- a/macterm.c +++ b/macterm.c @@ -1,4 +1,4 @@ -/* $Id: macterm.c,v 1.1.2.12 1999/03/02 21:51:55 ben Exp $ */ +/* $Id: macterm.c,v 1.1.2.13 1999/03/02 23:19:20 ben Exp $ */ /* * Copyright (c) 1999 Ben Harris * All rights reserved. @@ -47,6 +47,11 @@ #include "putty.h" #include "mac.h" +#define DEFAULT_FG 16 +#define DEFAULT_FG_BOLD 17 +#define DEFAULT_BG 18 +#define DEFAULT_BG_BOLD 19 + struct mac_session { short fontnum; int font_ascent; @@ -261,10 +266,7 @@ void mac_updateterm(WindowPtr window) { EraseRect(&(*s->scrollbar)->contrlRect); UpdateControls(window, window->visRgn); /* Stop DrawGrowIcon giving us space for a horizontal scrollbar */ - clip.left = window->portRect.right - 15; - clip.right = SHRT_MAX; - clip.top = SHRT_MIN; - clip.bottom = SHRT_MAX; + SetRect(&clip, window->portRect.right - 15, SHRT_MIN, SHRT_MAX, SHRT_MAX); ClipRect(&clip); DrawGrowIcon(window); clip.left = SHRT_MIN; @@ -341,6 +343,13 @@ static pascal void do_text_for_device(short depth, short devflags, ForeColor(whiteColor); BackColor(blackColor); break; + case 2: + if ((a->attr & ATTR_BOLD) && cfg.bold_colour) + PmForeColor(DEFAULT_FG_BOLD); + else + PmForeColor(DEFAULT_FG); + PmBackColor(DEFAULT_BG); + break; default: fgcolour = ((a->attr & ATTR_FGMASK) >> ATTR_FGSHIFT) * 2; bgcolour = ((a->attr & ATTR_BGMASK) >> ATTR_BGSHIFT) * 2; @@ -469,33 +478,6 @@ void palette_reset(void) { /* Palette Manager will generate update events as required. */ } -/* - * Move `lines' lines from position `from' to position `to' in the - * window. - * Note that this is currently broken if "from" and "to" are more - * than "lines" lines apart. - */ -void optimised_move(int to, int from, int lines) { - Rect r; - RgnHandle update; - struct mac_session *s = onlysession; - int min, max, d; - - SetPort(s->window); - - min = (to < from ? to : from); - max = to + from - min; - d = max - min; - - update = NewRgn(); - r.left = 0; r.right = cols * font_width; - r.top = min * font_height; r.bottom = (max+lines) * font_height; - ScrollRect(&r, 0, (to - from) * font_height, update); - InvalRgn(update); /* XXX: necessary? probably harmless anyway */ - DisposeRgn(update); -} - - /* * Scroll the screen. (`lines' is +ve for scrolling forward, -ve * for backward.) diff --git a/terminal.c b/terminal.c index db901607..e44b7b2c 100644 --- a/terminal.c +++ b/terminal.c @@ -59,8 +59,6 @@ static unsigned char *tabs; #define MAXNL 5 static int nl_count; -static int scroll_heuristic; - static enum { TOPLEVEL, IGNORE_NEXT, SEEN_ESC, SEEN_CSI, SET_GL, SET_GR, @@ -147,7 +145,6 @@ void term_update(void) { do_paint (ctx, TRUE); free_ctx (ctx); nl_count = 0; - scroll_heuristic = 0; } }