plan 9 kernel history: overview | file list | diff list

1990/0912/gnot/screen.c (diff list | history)

1990/0902/sys/src/9/gnot/screen.c:7,121990/0912/sys/src/9/gnot/screen.c:7,13 (short | long | prev | next)
1990/0330    
#include	"ureg.h" 
1990/0808    
#include	"errno.h" 
1990/03091    
 
1990/0912    
#include	<libg.h> 
1990/0902    
#include	<gnot.h> 
1990/03091    
 
#define	MINX	8 
1990/0902/sys/src/9/gnot/screen.c:24,301990/0912/sys/src/9/gnot/screen.c:25,31
1990/0808    
int	duartacr; 
1990/0830    
int	duartimr; 
1990/0329    
 
1990/0902    
GBitmap	screen = 
1990/0912    
GBitmap	gscreen = 
1990/03091    
{ 
1990/0320    
	(ulong*)((4*1024*1024-256*1024)|KZERO),	/* BUG */ 
1990/03091    
	0, 
1990/0902/sys/src/9/gnot/screen.c:42,521990/0912/sys/src/9/gnot/screen.c:43,53
1990/05313    
	 * Read HEX switch to set ldepth 
	 */ 
	if(*(uchar*)MOUSE & (1<<4)){ 
		screen.ldepth = 1; 
1990/0912    
		gscreen.ldepth = 1; 
1990/05313    
		defont = &defont1; 
	}else 
		defont = &defont0; 
1990/0902    
	gbitblt(&screen, Pt(0, 0), &screen, screen.r, 0); 
1990/0912    
	gbitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, 0); 
1990/03091    
	out.pos.x = MINX; 
	out.pos.y = 0; 
	out.bwid = defont0.info[' '].width; 
1990/0902/sys/src/9/gnot/screen.c:61,731990/0912/sys/src/9/gnot/screen.c:62,74
1990/03091    
	if(c == '\n'){ 
		out.pos.x = MINX; 
		out.pos.y += defont0.height; 
1990/0329    
		if(out.pos.y > screen.r.max.y-defont0.height) 
			out.pos.y = screen.r.min.y; 
1990/0902    
		gbitblt(&screen, Pt(0, out.pos.y), &screen, 
1990/0329    
		    Rect(0, out.pos.y, screen.r.max.x, out.pos.y+2*defont0.height), 0); 
1990/0912    
		if(out.pos.y > gscreen.r.max.y-defont0.height) 
			out.pos.y = gscreen.r.min.y; 
		gbitblt(&gscreen, Pt(0, out.pos.y), &gscreen, 
		    Rect(0, out.pos.y, gscreen.r.max.x, out.pos.y+2*defont0.height), 0); 
1990/03091    
	}else if(c == '\t'){ 
1990/08101    
		out.pos.x += (8-((out.pos.x-MINX)/out.bwid&7))*out.bwid; 
1990/0329    
		if(out.pos.x >= screen.r.max.x) 
1990/0912    
		if(out.pos.x >= gscreen.r.max.x) 
1990/03091    
			screenputc('\n'); 
	}else if(c == '\b'){ 
		if(out.pos.x >= out.bwid+MINX){ 
1990/0902/sys/src/9/gnot/screen.c:76,861990/0912/sys/src/9/gnot/screen.c:77,87
1990/03091    
			out.pos.x -= out.bwid; 
		} 
	}else{ 
1990/0329    
		if(out.pos.x >= screen.r.max.x-out.bwid) 
1990/0912    
		if(out.pos.x >= gscreen.r.max.x-out.bwid) 
1990/03091    
			screenputc('\n'); 
		buf[0] = c&0x7F; 
		buf[1] = 0; 
1990/0902    
		out.pos = gstring(&screen, out.pos, defont, buf, S); 
1990/0912    
		out.pos = gstring(&gscreen, out.pos, defont, buf, S); 
1990/03091    
	} 
} 
 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)