1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-19 01:36:33 -04:00
elinks/src/terminal/screen.h
Petr Baudis 0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00

58 lines
1.5 KiB
C

/* $Id: screen.h,v 1.22 2004/04/23 20:44:30 pasky Exp $ */
#ifndef EL__TERMINAL_SCREEN_H
#define EL__TERMINAL_SCREEN_H
struct screen_char;
struct terminal;
/* The terminal's screen manages */
struct terminal_screen {
/* This is the screen's image, character by character. */
struct screen_char *image;
/* The previous screen's image, used for optimizing actual drawing. */
struct screen_char *last_image;
/* The current and the previous cursor positions. */
int cx, cy;
int lcx, lcy;
/* The range of line numbers that are out of sync with the physical
* screen. @dirty_from > @dirty_to means not dirty. */
int dirty_from, dirty_to;
};
/* Mark the screen ready for redrawing. */
static inline void
set_screen_dirty(struct terminal_screen *screen, int from, int to)
{
int_upper_bound(&screen->dirty_from, from);
int_lower_bound(&screen->dirty_to, to);
}
/* Initializes a screen. Returns NULL upon allocation failure. */
struct terminal_screen *init_screen(void);
/* Cleans up after the screen. */
void done_screen(struct terminal_screen *screen);
/* Update the size of the previous and the current screen image to hold @x time
* @y chars. */
void resize_screen(struct terminal *term, int x, int y);
/* Updates the terminal screen. */
void redraw_screen(struct terminal *term);
/* Erases the entire screen and moves the cursor to the upper left corner. */
void erase_screen(struct terminal *term);
/* Meeep! */
void beep_terminal(struct terminal *term);
/* Release private screen drawing utilities. */
void done_screen_drivers(void);
#endif