Subversion Repositories planix.SVN

Rev

Rev 118 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 118 Rev 121
Line 317... Line 317...
317
 * Set the window parameters based on the base state bastate
317
 * Set the window parameters based on the base state bastate
318
 * and the available buffer space.
318
 * and the available buffer space.
319
 */
319
 */
320
setwind()
320
setwind()
321
{
321
{
-
 
322
#ifdef ADEBUG
-
 
323
	if (trace)
-
 
324
		tfixnl(), fprintf(trace, "setwindw() - bastate: %d,%d,%d)\n", 
-
 
325
				bastate,basWTOP,WBOT), tvliny();
-
 
326
#endif
-
 
327
 
322
 
328
 
323
	WCOLS = COLUMNS;
329
	WCOLS = COLUMNS;
324
	switch (bastate) {
330
	switch (bastate) {
325
 
331
 
326
	case ONEOPEN:
332
	case ONEOPEN:
Line 347... Line 353...
347
		WTOP = basWTOP; WBOT = LINES - 2; WECHO = LINES - 1;
353
		WTOP = basWTOP; WBOT = LINES - 2; WECHO = LINES - 1;
348
		break;
354
		break;
349
	}
355
	}
350
	state = bastate;
356
	state = bastate;
351
	basWLINES = WLINES = WBOT - WTOP + 1;
357
	basWLINES = WLINES = WBOT - WTOP + 1;
352
}
358
}
353
 
359
 
354
/*
360
/*
355
 * Can we hack an open/visual on this terminal?
361
 * Can we hack an open/visual on this terminal?
356
 * If so, then divide the screen buffer up into lines,
362
 * If so, then divide the screen buffer up into lines,
357
 * and initialize a bunch of state variables before we start.
363
 * and initialize a bunch of state variables before we start.
Line 362... Line 368...
362
#else
368
#else
363
	register short *atube;
369
	register short *atube;
364
#endif
370
#endif
365
{
371
{
366
	register int i;
372
	register int i;
367
 
373
 
368
	if (WCOLS == 1000)
374
	if (WCOLS == 1000)
369
		serror("Don't know enough about your terminal to use %s", Command);
375
		serror("Don't know enough about your terminal to use %s", Command);
370
	if (WCOLS > TUBECOLS)
376
	if (WCOLS > TUBECOLS)
371
		error("Terminal too wide");
377
		error("Terminal too wide");
372
	if (WLINES >= TUBELINES || WCOLS * (WECHO - ZERO + 1) > TUBESIZE)
378
	if (WLINES >= TUBELINES || WCOLS * (WECHO - ZERO + 1) > TUBESIZE)
373
		error("Screen too large");
379
		error("Screen too large");
374
 
380
 
375
	vtube0 = atube;
381
	vtube0 = atube;
376
	vclrbyte(atube, WCOLS * (WECHO - ZERO + 1));
382
	vclrbyte(atube, WCOLS * (WECHO - ZERO + 1));
377
	for (i = 0; i < ZERO; i++)
383
	for (i = 0; i < ZERO; i++)
378
#ifndef	BIT8
384
#ifndef	BIT8
379
		vtube[i] = (char *) 0;
385
		vtube[i] = (char *) 0;
380
#else
386
#else
381
		vtube[i] = (short *) 0;
387
		vtube[i] = (short *) 0;
382
#endif
388
#endif
383
	for (; i <= WECHO; i++)
389
	for (; i <= WECHO; i++)
384
		vtube[i] = atube, atube += WCOLS;
390
		vtube[i] = atube, atube += WCOLS;
385
	for (; i < TUBELINES; i++)
391
	for (; i < TUBELINES; i++)
386
#ifndef	BIT8
392
#ifndef	BIT8
387
		vtube[i] = (char *) 0;
393
		vtube[i] = (char *) 0;
Line 391... Line 397...
391
	vutmp = atube;
397
	vutmp = atube;
392
	vundkind = VNONE;
398
	vundkind = VNONE;
393
	vUNDdot = 0;
399
	vUNDdot = 0;
394
	OCOLUMNS = COLUMNS;
400
	OCOLUMNS = COLUMNS;
395
	inopen = 1;
401
	inopen = 1;
396
#ifdef CBREAK
402
#ifdef CBREAK
397
	signal(SIGINT, vintr);
403
	signal(SIGINT, vintr);
398
#endif
404
#endif
399
	vmoving = 0;
405
	vmoving = 0;
400
	splitw = 0;
406
	splitw = 0;
401
	doomed = 0;
407
	doomed = 0;
402
	holdupd = 0;
408
	holdupd = 0;
403
	Peekkey = 0;
409
	Peekkey = 0;
Line 431... Line 437...
431
 */
437
 */
432
vsetsiz(size)
438
vsetsiz(size)
433
	int size;
439
	int size;
434
{
440
{
435
	register int b;
441
	register int b;
-
 
442
 
-
 
443
#ifdef ADEBUG
-
 
444
	if (trace)
-
 
445
		tfixnl(), fprintf(trace, "vsetsize(%d): size\n", 
-
 
446
				size), tvliny();
-
 
447
#endif
-
 
448
 
-
 
449
 
436
 
450
 
437
	if (bastate != VISUAL)
451
	if (bastate != VISUAL)
438
		return;
452
		return;
439
	b = LINES - 1 - size;
453
	b = LINES - 1 - size;
440
	if (b >= LINES - 1)
454
	if (b >= LINES - 1)
441
		b = LINES - 2;
455
		b = LINES - 2;
442
	if (b < 0)
456
	if (b < 0)
443
		b = 0;
457
		b = 0;
-
 
458
 
-
 
459
//fprintf(trace,"vstesize LINES: %d, \n",LINES);	
444
	basWTOP = b;
460
	basWTOP = b;
445
	basWLINES = WBOT - b + 1;
461
	basWLINES = WBOT - b + 1;
446
}
462
}
447
 
463
 
448
winch()
464
winch()