2013-05-18 02:43:13 -04:00
|
|
|
#ifndef _WINDOW_H_
|
|
|
|
#define _WINDOW_H_
|
|
|
|
|
2013-09-20 06:10:30 -04:00
|
|
|
#include "defines.h" /* COLOR, SCROLLCODE */
|
|
|
|
#include "buffer.h" /* buffer, line */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* There is a window structure allocated for every active display window. The
|
|
|
|
* windows are kept in a big list, in top to bottom screen order, with the
|
|
|
|
* listhead at "wheadp". Each window contains its own values of dot and mark.
|
|
|
|
* The flag field contains some bits that are set by commands to guide
|
|
|
|
* redisplay. Although this is a bit of a compromise in terms of decoupling,
|
|
|
|
* the full blown redisplay is just too expensive to run for every input
|
|
|
|
* character.
|
|
|
|
*/
|
2016-05-20 07:46:54 -04:00
|
|
|
typedef struct window {
|
2013-09-20 06:10:30 -04:00
|
|
|
struct window *w_wndp; /* Next window */
|
|
|
|
struct buffer *w_bufp; /* Buffer displayed in window */
|
2016-05-20 07:46:54 -04:00
|
|
|
line_p w_linep ; /* Top line in the window */
|
|
|
|
line_p w_dotp ; /* Line containing "." */
|
|
|
|
line_p w_markp ; /* Line containing "mark" */
|
|
|
|
int w_doto ; /* Byte offset for "." */
|
2013-09-20 06:10:30 -04:00
|
|
|
int w_marko; /* Byte offset for "mark" */
|
2014-12-23 21:01:37 -05:00
|
|
|
int w_toprow ; /* Origin 0 top row of window */
|
|
|
|
int w_ntrows ; /* # of rows of text in window */
|
2013-09-20 06:10:30 -04:00
|
|
|
char w_force; /* If NZ, forcing row. */
|
|
|
|
char w_flag; /* Flags. */
|
|
|
|
#if COLOR
|
|
|
|
char w_fcolor; /* current forground color */
|
|
|
|
char w_bcolor; /* current background color */
|
|
|
|
#endif
|
2016-05-20 07:46:54 -04:00
|
|
|
} *window_p ;
|
2013-09-20 06:10:30 -04:00
|
|
|
|
2016-05-20 07:46:54 -04:00
|
|
|
extern window_p curwp ; /* Current window */
|
|
|
|
extern window_p wheadp ; /* Head of list of windows */
|
|
|
|
|
|
|
|
/* curwbyte return the byte after the dot in current window */
|
|
|
|
#define curwbyte() lgetc( curwp->w_dotp, curwp->w_doto)
|
2013-10-08 05:41:49 -04:00
|
|
|
|
2013-09-20 06:10:30 -04:00
|
|
|
#define WFFORCE 0x01 /* Window needs forced reframe */
|
|
|
|
#define WFMOVE 0x02 /* Movement from line to line */
|
|
|
|
#define WFEDIT 0x04 /* Editing within a line */
|
|
|
|
#define WFHARD 0x08 /* Better to a full display */
|
|
|
|
#define WFMODE 0x10 /* Update mode line. */
|
|
|
|
#define WFCOLR 0x20 /* Needs a color change */
|
|
|
|
|
|
|
|
#if SCROLLCODE
|
|
|
|
#define WFKILLS 0x40 /* something was deleted */
|
|
|
|
#define WFINS 0x80 /* something was inserted */
|
|
|
|
#endif
|
2013-05-18 02:43:13 -04:00
|
|
|
|
|
|
|
int reposition( int f, int n);
|
|
|
|
int redraw( int f, int n) ;
|
|
|
|
int nextwind( int f, int n) ;
|
|
|
|
int prevwind( int f, int n) ;
|
|
|
|
int mvdnwind( int f, int n) ;
|
|
|
|
int mvupwind( int f, int n) ;
|
|
|
|
int onlywind( int f, int n) ;
|
|
|
|
int delwind( int f, int n) ;
|
|
|
|
int splitwind( int f, int n) ;
|
|
|
|
int enlargewind( int f, int n) ;
|
|
|
|
int shrinkwind( int f, int n) ;
|
|
|
|
int resize( int f, int n) ;
|
|
|
|
int scrnextup( int f, int n) ;
|
|
|
|
int scrnextdw( int f, int n) ;
|
|
|
|
int savewnd( int f, int n) ;
|
|
|
|
int restwnd( int f, int n) ;
|
|
|
|
int newsize( int f, int n) ;
|
|
|
|
int newwidth( int f, int n) ;
|
|
|
|
int getwpos( void) ;
|
|
|
|
void cknewwindow( void) ;
|
2016-05-20 07:46:54 -04:00
|
|
|
window_p wpopup( void) ; /* Pop up window creation. */
|
2013-05-18 02:43:13 -04:00
|
|
|
|
|
|
|
#endif
|