version 1.18, 2005/10/11 01:08:53 |
version 1.19, 2005/11/18 20:56:53 |
|
|
|
|
#include "def.h" |
#include "def.h" |
|
|
MGWIN * |
struct mgwin * |
new_window(BUFFER *bp) |
new_window(struct buffer *bp) |
{ |
{ |
MGWIN *wp; |
struct mgwin *wp; |
|
|
wp = calloc(1, sizeof(MGWIN)); |
wp = calloc(1, sizeof(struct mgwin)); |
if (wp == NULL) |
if (wp == NULL) |
return (NULL); |
return (NULL); |
|
|
|
|
int |
int |
refresh(int f, int n) |
refresh(int f, int n) |
{ |
{ |
MGWIN *wp; |
struct mgwin *wp; |
int oldnrow; |
int oldnrow, oldncol; |
int oldncol; |
|
|
|
oldnrow = nrow; |
oldnrow = nrow; |
oldncol = ncol; |
oldncol = ncol; |
|
|
int |
int |
nextwind(int f, int n) |
nextwind(int f, int n) |
{ |
{ |
MGWIN *wp; |
struct mgwin *wp; |
|
|
if ((wp = curwp->w_wndp) == NULL) |
if ((wp = curwp->w_wndp) == NULL) |
wp = wheadp; |
wp = wheadp; |
|
|
int |
int |
prevwind(int f, int n) |
prevwind(int f, int n) |
{ |
{ |
MGWIN *wp1, *wp2; |
struct mgwin *wp1, *wp2; |
|
|
wp1 = wheadp; |
wp1 = wheadp; |
wp2 = curwp; |
wp2 = curwp; |
|
|
int |
int |
onlywind(int f, int n) |
onlywind(int f, int n) |
{ |
{ |
MGWIN *wp; |
struct mgwin *wp; |
LINE *lp; |
struct line *lp; |
int i; |
int i; |
|
|
while (wheadp != curwp) { |
while (wheadp != curwp) { |
wp = wheadp; |
wp = wheadp; |
|
|
int |
int |
splitwind(int f, int n) |
splitwind(int f, int n) |
{ |
{ |
MGWIN *wp, *wp1, *wp2; |
struct mgwin *wp, *wp1, *wp2; |
LINE *lp; |
struct line *lp; |
int ntru, ntrd, ntrl; |
int ntru, ntrd, ntrl; |
|
|
if (curwp->w_ntrows < 3) { |
if (curwp->w_ntrows < 3) { |
ewprintf("Cannot split a %d line window", curwp->w_ntrows); |
ewprintf("Cannot split a %d line window", curwp->w_ntrows); |
|
|
int |
int |
enlargewind(int f, int n) |
enlargewind(int f, int n) |
{ |
{ |
MGWIN *adjwp; |
struct mgwin *adjwp; |
LINE *lp; |
struct line *lp; |
int i; |
int i; |
|
|
if (n < 0) |
if (n < 0) |
return (shrinkwind(f, -n)); |
return (shrinkwind(f, -n)); |
|
|
int |
int |
shrinkwind(int f, int n) |
shrinkwind(int f, int n) |
{ |
{ |
MGWIN *adjwp; |
struct mgwin *adjwp; |
LINE *lp; |
struct line *lp; |
int i; |
int i; |
|
|
if (n < 0) |
if (n < 0) |
return (enlargewind(f, -n)); |
return (enlargewind(f, -n)); |
|
|
int |
int |
delwind(int f, int n) |
delwind(int f, int n) |
{ |
{ |
MGWIN *wp, *nwp; |
struct mgwin *wp, *nwp; |
|
|
wp = curwp; /* Cheap... */ |
wp = curwp; /* Cheap... */ |
|
|
|
|
* Pick the uppermost window that isn't the current window. An LRU algorithm |
* Pick the uppermost window that isn't the current window. An LRU algorithm |
* might be better. Return a pointer, or NULL on error. |
* might be better. Return a pointer, or NULL on error. |
*/ |
*/ |
MGWIN * |
struct mgwin * |
wpopup(void) |
wpopup(void) |
{ |
{ |
MGWIN *wp; |
struct mgwin *wp; |
|
|
if (wheadp->w_wndp == NULL && |
if (wheadp->w_wndp == NULL && |
splitwind(FFRAND, 0) == FALSE) |
splitwind(FFRAND, 0) == FALSE) |