1 #ifndef EL__TERMINAL_SCREEN_H
2 #define EL__TERMINAL_SCREEN_H
8 /* The terminal's screen manages */
9 struct terminal_screen
{
10 /* This is the screen's image, character by character. */
11 struct screen_char
*image
;
13 /* The previous screen's image, used for optimizing actual drawing. */
14 struct screen_char
*last_image
;
16 /* The current and the previous cursor positions. */
20 /* The range of line numbers that are out of sync with the physical
21 * screen. @dirty_from > @dirty_to means not dirty. */
22 int dirty_from
, dirty_to
;
25 /* Mark the screen ready for redrawing. */
27 set_screen_dirty(struct terminal_screen
*screen
, int from
, int to
)
29 int_upper_bound(&screen
->dirty_from
, from
);
30 int_lower_bound(&screen
->dirty_to
, to
);
33 /* Initializes a screen. Returns NULL upon allocation failure. */
34 struct terminal_screen
*init_screen(void);
36 /* Cleans up after the screen. */
37 void done_screen(struct terminal_screen
*screen
);
39 /* Update the size of the previous and the current screen image to hold @x time
41 void resize_screen(struct terminal
*term
, int x
, int y
);
43 /* Updates the terminal screen. */
44 void redraw_screen(struct terminal
*term
);
46 /* Erases the entire screen and moves the cursor to the upper left corner. */
47 void erase_screen(struct terminal
*term
);
50 void beep_terminal(struct terminal
*term
);
52 /* Release private screen drawing utilities. */
53 void done_screen_drivers(void);