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

Ah. We seem to be working with the Palette Manager again. Good.

[originally from svn r61]
This commit is contained in:
Ben Harris 1999-02-24 21:17:06 +00:00
parent eae4545aea
commit 013a8acfd0
2 changed files with 13 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $Id: mac_res.r,v 1.1.2.3 1999/02/24 01:29:10 ben Exp $ */ /* $Id: mac_res.r,v 1.1.2.4 1999/02/24 21:17:05 ben Exp $ */
/* PuTTY resources */ /* PuTTY resources */
#define PICT_RezTemplateVersion 1 #define PICT_RezTemplateVersion 1
@ -312,7 +312,7 @@ resource 'DITL' (wFatal, "fatalbox", purgeable) {
/* Terminal window */ /* Terminal window */
resource 'WIND' (PREF_pltt_ID, "terminal", purgeable) { resource 'WIND' (wTerminal, "terminal", purgeable) {
{ 0, 0, 200, 200 }, { 0, 0, 200, 200 },
zoomDocProc, zoomDocProc,
invisible, invisible,
@ -322,7 +322,7 @@ resource 'WIND' (PREF_pltt_ID, "terminal", purgeable) {
staggerParentWindowScreen staggerParentWindowScreen
}; };
resource 'pltt' (wTerminal, "terminal", purgeable) { resource 'pltt' (PREF_pltt_ID, "terminal", purgeable) {
{ {
0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* black */ 0x0000, 0x0000, 0x0000, pmTolerant, 0x2000, /* black */
0x5555, 0x5555, 0x5555, pmTolerant, 0x2000, /* bright black */ 0x5555, 0x5555, 0x5555, pmTolerant, 0x2000, /* bright black */

View File

@ -66,6 +66,8 @@ void mac_newsession(void) {
cfg.try_palette = FALSE; cfg.try_palette = FALSE;
cfg.bold_colour = TRUE; cfg.bold_colour = TRUE;
cfg.colours = GetNewPalette(PREF_pltt_ID); cfg.colours = GetNewPalette(PREF_pltt_ID);
if (cfg.colours == NULL)
fatalbox("Failed to get default palette");
onlysession = s; onlysession = s;
/* XXX: Own storage management? */ /* XXX: Own storage management? */
@ -78,8 +80,9 @@ void mac_newsession(void) {
term_size(24, 80, 100); term_size(24, 80, 100);
mac_initfont(s); mac_initfont(s);
mac_initpalette(s); mac_initpalette(s);
/* Set to TRUE to get palette updates in the background. */ /* Set to FALSE to not get palette updates in the background. */
SetPalette(s->window, s->palette, FALSE); SetPalette(s->window, s->palette, TRUE);
ActivatePalette(s->window);
ShowWindow(s->window); ShowWindow(s->window);
inbuf_putstr("\033[1mBold\033[m \033[2mfaint\033[m \033[3mitalic\033[m \033[4mu_line\033[m " inbuf_putstr("\033[1mBold\033[m \033[2mfaint\033[m \033[3mitalic\033[m \033[4mu_line\033[m "
"\033[5mslow bl\033[m \033[6mfast bl\033[m \033[7minverse\033[m \033[8mconceal\033[m " "\033[5mslow bl\033[m \033[6mfast bl\033[m \033[7minverse\033[m \033[8mconceal\033[m "
@ -115,7 +118,11 @@ static void mac_initfont(struct mac_session *s) {
static void mac_initpalette(struct mac_session *s) { static void mac_initpalette(struct mac_session *s) {
s->palette = NewPalette(0, NULL, 0, 0); if (mac_qdversion == gestaltOriginalQD)
return;
s->palette = NewPalette((*cfg.colours)->pmEntries, NULL, pmCourteous, 0);
if (s->palette == NULL)
fatalbox("Unable to create palette");
CopyPalette(cfg.colours, s->palette, 0, 0, (*cfg.colours)->pmEntries); CopyPalette(cfg.colours, s->palette, 0, 0, (*cfg.colours)->pmEntries);
} }