mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
We now have saner handling of 4-bit modes (disable colour, get the Palette
Manager to give us bg, fg, bold fg and cursor). I've also removed some traces of the old scroll-optimiser. [originally from svn r68]
This commit is contained in:
parent
2145f64798
commit
23634d10df
73
mac_res.r
73
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
|
* Copyright (c) 1999 Ben Harris
|
||||||
* All rights reserved.
|
* 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) {
|
resource 'pltt' (PREF_pltt, purgeable) {
|
||||||
{
|
{
|
||||||
0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* black */
|
0x0000, 0x0000, 0x0000, PM_NORMAL, 0x2000, /* black */
|
||||||
0x5555, 0x5555, 0x5555, pmTolerant, 0x2000, /* bright black */
|
0x5555, 0x5555, 0x5555, PM_NORMAL, 0x2000, /* bright black */
|
||||||
0xbbbb, 0x0000, 0x0000, pmTolerant, 0x2000, /* red */
|
0xbbbb, 0x0000, 0x0000, PM_NORMAL, 0x2000, /* red */
|
||||||
0xffff, 0x5555, 0x5555, pmTolerant, 0x2000, /* bright red */
|
0xffff, 0x5555, 0x5555, PM_NORMAL, 0x2000, /* bright red */
|
||||||
0x0000, 0xbbbb, 0x0000, pmTolerant, 0x2000, /* green */
|
0x0000, 0xbbbb, 0x0000, PM_NORMAL, 0x2000, /* green */
|
||||||
0x5555, 0xffff, 0x5555, pmTolerant, 0x2000, /* bright green */
|
0x5555, 0xffff, 0x5555, PM_NORMAL, 0x2000, /* bright green */
|
||||||
0xbbbb, 0xbbbb, 0x0000, pmTolerant, 0x2000, /* yellow */
|
0xbbbb, 0xbbbb, 0x0000, PM_NORMAL, 0x2000, /* yellow */
|
||||||
0xffff, 0xffff, 0x0000, pmTolerant, 0x2000, /* bright yellow */
|
0xffff, 0xffff, 0x0000, PM_NORMAL, 0x2000, /* bright yellow */
|
||||||
0x0000, 0x0000, 0xbbbb, pmTolerant, 0x2000, /* blue */
|
0x0000, 0x0000, 0xbbbb, PM_NORMAL, 0x2000, /* blue */
|
||||||
0x5555, 0x5555, 0xffff, pmTolerant, 0x2000, /* bright blue */
|
0x5555, 0x5555, 0xffff, PM_NORMAL, 0x2000, /* bright blue */
|
||||||
0xbbbb, 0x0000, 0xbbbb, pmTolerant, 0x2000, /* magenta */
|
0xbbbb, 0x0000, 0xbbbb, PM_NORMAL, 0x2000, /* magenta */
|
||||||
0xffff, 0x5555, 0xffff, pmTolerant, 0x2000, /* bright magenta */
|
0xffff, 0x5555, 0xffff, PM_NORMAL, 0x2000, /* bright magenta */
|
||||||
0x0000, 0xbbbb, 0xbbbb, pmTolerant, 0x2000, /* cyan */
|
0x0000, 0xbbbb, 0xbbbb, PM_NORMAL, 0x2000, /* cyan */
|
||||||
0x5555, 0xffff, 0xffff, pmTolerant, 0x2000, /* bright cyan */
|
0x5555, 0xffff, 0xffff, PM_NORMAL, 0x2000, /* bright cyan */
|
||||||
0xbbbb, 0xbbbb, 0xbbbb, pmTolerant, 0x2000, /* white */
|
0xbbbb, 0xbbbb, 0xbbbb, PM_NORMAL, 0x2000, /* white */
|
||||||
0xffff, 0xffff, 0xffff, pmTolerant, 0x2000, /* bright white */
|
0xffff, 0xffff, 0xffff, PM_NORMAL, 0x2000, /* bright white */
|
||||||
0xbbbb, 0xbbbb, 0xbbbb, pmTolerant, 0x2000, /* default fg */
|
0xbbbb, 0xbbbb, 0xbbbb, PM_BASIC, 0x2000, /* default fg */
|
||||||
0xffff, 0xffff, 0xffff, pmTolerant, 0x2000, /* default bold fg */
|
0xffff, 0xffff, 0xffff, PM_BASIC, 0x2000, /* default bold fg */
|
||||||
0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* default bg */
|
0x0000, 0x0000, 0x0000, PM_BASIC, 0x2000, /* default bg */
|
||||||
0x5555, 0x5555, 0x5555, pmTolerant, 0x2000, /* default bold bg */
|
0x5555, 0x5555, 0x5555, PM_NORMAL, 0x2000, /* default bold bg */
|
||||||
0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* cursor bg */
|
0x0000, 0x0000, 0x0000, PM_NORMAL, 0x2000, /* cursor bg */
|
||||||
0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* bold cursor bg */
|
0x0000, 0x0000, 0x0000, PM_NORMAL, 0x2000, /* bold cursor bg */
|
||||||
0x0000, 0xffff, 0x0000, pmTolerant, 0x2000, /* cursor fg */
|
0x0000, 0xffff, 0x0000, PM_BASIC, 0x2000, /* cursor fg */
|
||||||
0x0000, 0xffff, 0x0000, pmTolerant, 0x2000, /* bold cursor fg */
|
0x0000, 0xffff, 0x0000, PM_NORMAL, 0x2000, /* bold cursor fg */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
46
macterm.c
46
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
|
* Copyright (c) 1999 Ben Harris
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@ -47,6 +47,11 @@
|
|||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
#include "mac.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 {
|
struct mac_session {
|
||||||
short fontnum;
|
short fontnum;
|
||||||
int font_ascent;
|
int font_ascent;
|
||||||
@ -261,10 +266,7 @@ void mac_updateterm(WindowPtr window) {
|
|||||||
EraseRect(&(*s->scrollbar)->contrlRect);
|
EraseRect(&(*s->scrollbar)->contrlRect);
|
||||||
UpdateControls(window, window->visRgn);
|
UpdateControls(window, window->visRgn);
|
||||||
/* Stop DrawGrowIcon giving us space for a horizontal scrollbar */
|
/* Stop DrawGrowIcon giving us space for a horizontal scrollbar */
|
||||||
clip.left = window->portRect.right - 15;
|
SetRect(&clip, window->portRect.right - 15, SHRT_MIN, SHRT_MAX, SHRT_MAX);
|
||||||
clip.right = SHRT_MAX;
|
|
||||||
clip.top = SHRT_MIN;
|
|
||||||
clip.bottom = SHRT_MAX;
|
|
||||||
ClipRect(&clip);
|
ClipRect(&clip);
|
||||||
DrawGrowIcon(window);
|
DrawGrowIcon(window);
|
||||||
clip.left = SHRT_MIN;
|
clip.left = SHRT_MIN;
|
||||||
@ -341,6 +343,13 @@ static pascal void do_text_for_device(short depth, short devflags,
|
|||||||
ForeColor(whiteColor);
|
ForeColor(whiteColor);
|
||||||
BackColor(blackColor);
|
BackColor(blackColor);
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
if ((a->attr & ATTR_BOLD) && cfg.bold_colour)
|
||||||
|
PmForeColor(DEFAULT_FG_BOLD);
|
||||||
|
else
|
||||||
|
PmForeColor(DEFAULT_FG);
|
||||||
|
PmBackColor(DEFAULT_BG);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
fgcolour = ((a->attr & ATTR_FGMASK) >> ATTR_FGSHIFT) * 2;
|
fgcolour = ((a->attr & ATTR_FGMASK) >> ATTR_FGSHIFT) * 2;
|
||||||
bgcolour = ((a->attr & ATTR_BGMASK) >> ATTR_BGSHIFT) * 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. */
|
/* 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
|
* Scroll the screen. (`lines' is +ve for scrolling forward, -ve
|
||||||
* for backward.)
|
* for backward.)
|
||||||
|
@ -59,8 +59,6 @@ static unsigned char *tabs;
|
|||||||
#define MAXNL 5
|
#define MAXNL 5
|
||||||
static int nl_count;
|
static int nl_count;
|
||||||
|
|
||||||
static int scroll_heuristic;
|
|
||||||
|
|
||||||
static enum {
|
static enum {
|
||||||
TOPLEVEL, IGNORE_NEXT,
|
TOPLEVEL, IGNORE_NEXT,
|
||||||
SEEN_ESC, SEEN_CSI, SET_GL, SET_GR,
|
SEEN_ESC, SEEN_CSI, SET_GL, SET_GR,
|
||||||
@ -147,7 +145,6 @@ void term_update(void) {
|
|||||||
do_paint (ctx, TRUE);
|
do_paint (ctx, TRUE);
|
||||||
free_ctx (ctx);
|
free_ctx (ctx);
|
||||||
nl_count = 0;
|
nl_count = 0;
|
||||||
scroll_heuristic = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user