2021-08-11 05:02:19 -04:00
|
|
|
/* window.h -- window functionality */
|
2013-05-18 02:43:13 -04:00
|
|
|
#ifndef _WINDOW_H_
|
|
|
|
#define _WINDOW_H_
|
|
|
|
|
2021-08-12 23:06:58 -04:00
|
|
|
#include "defines.h" /* COLOR, SCROLLCODE */
|
|
|
|
#include "buffer.h" /* buffer_p, line_p */
|
|
|
|
#include "names.h" /* BINDABLE() */
|
2013-09-20 06:10:30 -04:00
|
|
|
|
2021-08-11 05:02:19 -04:00
|
|
|
/* 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.
|
2013-09-20 06:10:30 -04:00
|
|
|
*/
|
2016-05-20 07:46:54 -04:00
|
|
|
typedef struct window {
|
2021-08-12 23:06:58 -04:00
|
|
|
struct window *w_wndp; /* Next window */
|
|
|
|
buffer_p w_bufp ; /* Buffer displayed in window */
|
|
|
|
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 "." */
|
|
|
|
int w_marko ; /* Byte offset for "mark" */
|
|
|
|
int w_toprow ; /* Origin 0 top row of window */
|
|
|
|
int w_ntrows ; /* # of rows of text in window */
|
|
|
|
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
|
|
|
|
2021-08-12 23:06:58 -04:00
|
|
|
extern window_p curwp ; /* Current window */
|
|
|
|
extern window_p wheadp ; /* Head of list of windows */
|
2016-05-20 07:46:54 -04:00
|
|
|
|
|
|
|
/* 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
|
|
|
|
2021-08-12 23:06:58 -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 */
|
2013-09-20 06:10:30 -04:00
|
|
|
|
2021-08-12 23:06:58 -04:00
|
|
|
#if SCROLLCODE
|
|
|
|
# define WFKILLS 0x40 /* something was deleted */
|
|
|
|
# define WFINS 0x80 /* something was inserted */
|
|
|
|
#endif
|
2021-08-11 05:02:19 -04:00
|
|
|
|
|
|
|
/* Bindable functions */
|
|
|
|
BINDABLE( delwind) ;
|
|
|
|
BINDABLE( enlargewind) ;
|
|
|
|
BINDABLE( mvdnwind) ;
|
|
|
|
BINDABLE( mvupwind) ;
|
|
|
|
BINDABLE( newsize) ;
|
|
|
|
BINDABLE( newwidth) ;
|
|
|
|
BINDABLE( nextwind) ;
|
|
|
|
BINDABLE( onlywind) ;
|
|
|
|
BINDABLE( prevwind) ;
|
|
|
|
TBINDABLE( redraw) ;
|
|
|
|
TBINDABLE( reposition) ;
|
|
|
|
BINDABLE( resize) ;
|
|
|
|
BINDABLE( restwnd) ;
|
|
|
|
BINDABLE( savewnd) ;
|
|
|
|
BINDABLE( scrnextdw) ;
|
|
|
|
BINDABLE( scrnextup) ;
|
|
|
|
BINDABLE( shrinkwind) ;
|
|
|
|
BINDABLE( splitwind) ;
|
2013-05-18 02:43:13 -04:00
|
|
|
|
|
|
|
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
|
2021-08-11 05:02:19 -04:00
|
|
|
/* end of window.h */
|