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

1992/0627/port/devbit.c (diff list | history)

1992/0622/sys/src/9/port/devbit.c:352,3581992/0627/sys/src/9/port/devbit.c:352,358 (short | long | prev | next)
1990/0613    
	uchar *p, *q; 
	long miny, maxy, t, x, y; 
1991/0706    
	ulong l, nw, ws, rv, gv, bv; 
1992/0605    
	int off, j, dn; 
1992/0627    
	int off, j; 
1990/06231    
	Fontchar *i; 
1990/0902    
	GBitmap *src; 
1990/0327    
 
1992/0622/sys/src/9/port/devbit.c:436,4461992/0627/sys/src/9/port/devbit.c:436,446
1992/0622    
		 *	'I'		1 
		 *	ldepth		1 
		 * 	rectangle	16 
		 * if count great enough, also 
1992/0627    
		 * 	clip rectangle	16 
1992/0622    
		 *	font info	3*12 
		 *	fontchars	6*(defont->n+1) 
		 */ 
		if(n < 18) 
1992/0627    
		if(n < 34) 
1992/0622    
			error(Ebadblt); 
		p[0] = 'I'; 
		p[1] = gscreen.ldepth; 
1992/0622/sys/src/9/port/devbit.c:448,4631992/0627/sys/src/9/port/devbit.c:448,459
1992/0622    
		PLONG(p+6, gscreen.r.min.y); 
		PLONG(p+10, gscreen.r.max.x); 
		PLONG(p+14, gscreen.r.max.y); 
		dn = 18; 
		if(bit.init=='j' && n>=18+16){ 
			PLONG(p+18, gscreen.clipr.min.x); 
			PLONG(p+22, gscreen.clipr.min.y); 
			PLONG(p+26, gscreen.clipr.max.x); 
			PLONG(p+30, gscreen.clipr.max.y); 
			dn += 16; 
		} 
		if(n >= dn+3*12+6*(defont->n+1)){ 
			p += dn; 
1992/0627    
		PLONG(p+18, gscreen.clipr.min.x); 
		PLONG(p+22, gscreen.clipr.min.y); 
		PLONG(p+26, gscreen.clipr.max.x); 
		PLONG(p+30, gscreen.clipr.max.y); 
		if(n >= 34+3*12+6*(defont->n+1)){ 
			p += 34; 
1992/0622    
			sprint((char*)p, "%11d %11d %11d ", defont->n, 
				defont->height, defont->ascent); 
			p += 3*12; 
1992/0622/sys/src/9/port/devbit.c:468,4761992/0627/sys/src/9/port/devbit.c:464,472
1992/0622    
				p[4] = i->left; 
				p[5] = i->width; 
			} 
			n = dn+3*12+6*(defont->n+1); 
1992/0627    
			n = 34+3*12+6*(defont->n+1); 
1992/0622    
		}else 
			n = dn; 
1992/0627    
			n = 34; 
1992/0622    
		bit.init = 0; 
	}else if(bit.lastid > 0){ 
		/* 
1992/0622/sys/src/9/port/devbit.c:782,7941992/0627/sys/src/9/port/devbit.c:778,789
1992/0209    
			break; 
 
1990/0604    
		case 'i': 
1992/0605    
		case 'j': 
1990/0604    
			/* 
			 * init 
			 * 
1992/0605    
			 *	'i','j'		1 
1992/0627    
			 *	'i'		1 
1990/0604    
			 */ 
1992/0605    
			bit.init = *p; 
1992/0627    
			bit.init = 1; 
1990/0604    
			m -= 1; 
			p += 1; 
1990/0327    
			break; 
1992/0622/sys/src/9/port/devbit.c:905,9161992/0627/sys/src/9/port/devbit.c:900,913
1992/0209    
			 *	height		1 
			 *	ascent		1 
			 *	ldepth		2 
1992/0627    
			 *	ncache		2 
1992/0209    
			 * next read returns allocated font id 
			 */ 
			if(m < 5) 
1992/0627    
			if(m < 7) 
1992/0209    
				error(Ebadblt); 
			v = GSHORT(p+3); 
			if(v < 0) 
1992/0627    
			t = GSHORT(p+5); 
			if(v<0 || t<0) 
1992/0209    
				error(Ebadblt); 
1992/0621    
			for(i=0; i<bit.nfont; i++) 
				if(bit.font[i] == 0) 
1992/0622/sys/src/9/port/devbit.c:922,9271992/0627/sys/src/9/port/devbit.c:919,926
1992/0621    
			bit.nfont += DMAP; 
1992/0209    
		fontfound: 
1992/0621    
			ff = smalloc(sizeof(GFont)); 
1992/0627    
			ff->ncache = t; 
			ff->cache = smalloc(t*sizeof(GCacheinfo)); 
1992/0621    
			bit.font[i] = ff; 
			ff = bit.font[i]; 
1992/0209    
			ff->height = p[1]; 
1992/0622/sys/src/9/port/devbit.c:929,9361992/0627/sys/src/9/port/devbit.c:928,935
1992/0209    
			ff->ldepth = v; 
			ff->width = 0; 
			ff->b = 0; 
			m -= 5; 
			p += 5; 
1992/0627    
			m -= 7; 
			p += 7; 
1992/0621    
			bit.lastfid = i; 
1992/0209    
			break; 
 
1992/0622/sys/src/9/port/devbit.c:1016,10681992/0627/sys/src/9/port/devbit.c:1015,1030
1990/0613    
			m -= 11; 
1990/06111    
			break; 
 
1990/0329    
		case 't': 
1992/0627    
		case 's': 
1990/0329    
			/* 
			 * texture 
			 *	't'		1 
			 *	dst id		2 
1992/0604    
			 *	rect		16 
1990/0329    
			 *	src id		2 
			 *	fcode		2 
			 */ 
			if(m < 23) 
1990/11211    
				error(Ebadblt); 
1990/0329    
			v = GSHORT(p+1); 
1992/0621    
			if(v<0 || v>=bit.nmap || (dst=bit.map[v])==0) 
1990/11211    
				error(Ebadbitmap); 
1990/0504    
			off = 0; 
1991/0706    
			fc = GSHORT(p+21) & 0xF; 
			if(v == 0){ 
				if(flipping) 
					fc = flipD[fc]; 
1990/0504    
				off = 1; 
1991/0706    
			} 
1990/0329    
			rect.min.x = GLONG(p+3); 
			rect.min.y = GLONG(p+7); 
			rect.max.x = GLONG(p+11); 
			rect.max.y = GLONG(p+15); 
			v = GSHORT(p+19); 
1992/0621    
			if(v<0 || v>=bit.nmap || (src=bit.map[v])==0) 
1990/11211    
				error(Ebadbitmap); 
1991/0701    
			if(off && !isoff){ 
				cursoroff(1); 
				isoff = 1; 
1990/0329    
			} 
1991/0706    
			gtexture(dst, rect, src, fc); 
1990/0329    
			m -= 23; 
			p += 23; 
			break; 
                 
1992/0209    
		case 'u': 
			/* 
			 * string 
			 *	'u'		1 
1992/0627    
			 *	's'		1 
1992/0209    
			 *	id		2 
			 *	pt		8 
			 *	font id		2 
			 *	code		2 
			 *	n		2 
			 * 	cache indexes	2*n (not null terminated) 
1992/0627    
			 * 	cache indices	2*n (not null terminated) 
1992/0209    
			 */ 
			if(m < 17) 
				error(Ebadblt); 
1992/0622/sys/src/9/port/devbit.c:1095,11001992/0627/sys/src/9/port/devbit.c:1057,1099
1992/0209    
			p += l; 
			break; 
 
1992/0627    
		case 't': 
			/* 
			 * texture 
			 *	't'		1 
			 *	dst id		2 
			 *	rect		16 
			 *	src id		2 
			 *	fcode		2 
			 */ 
			if(m < 23) 
				error(Ebadblt); 
			v = GSHORT(p+1); 
			if(v<0 || v>=bit.nmap || (dst=bit.map[v])==0) 
				error(Ebadbitmap); 
			off = 0; 
			fc = GSHORT(p+21) & 0xF; 
			if(v == 0){ 
				if(flipping) 
					fc = flipD[fc]; 
				off = 1; 
			} 
			rect.min.x = GLONG(p+3); 
			rect.min.y = GLONG(p+7); 
			rect.max.x = GLONG(p+11); 
			rect.max.y = GLONG(p+15); 
			v = GSHORT(p+19); 
			if(v<0 || v>=bit.nmap || (src=bit.map[v])==0) 
				error(Ebadbitmap); 
			if(off && !isoff){ 
				cursoroff(1); 
				isoff = 1; 
			} 
			gtexture(dst, rect, src, fc); 
			m -= 23; 
			p += 23; 
			break; 
 
1992/0209    
		case 'v': 
			/* 
			 * clear font cache and bitmap 
1992/0622/sys/src/9/port/devbit.c:1380,13851992/0627/sys/src/9/port/devbit.c:1379,1385
1992/0621    
{ 
	if(f->b) 
		bitfree(f->b); 
1992/0627    
	free(f->cache); 
1992/0621    
	free(f); 
} 
 


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