Bug 997: Fix unlikely stack corruption in get_pasv_socket.
[elinks/elinks-j605.git] / src / terminal / screen.h
blob5608a0e3819035e597f35b1892297abc8aef38a7
1 #ifndef EL__TERMINAL_SCREEN_H
2 #define EL__TERMINAL_SCREEN_H
5 struct screen_char;
6 struct terminal;
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. */
17 int cx, cy;
18 int lcx, lcy;
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. */
26 static inline void
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
40 * @y chars. */
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);
49 /* Meeep! */
50 void beep_terminal(struct terminal *term);
52 /* Release private screen drawing utilities. */
53 void done_screen_drivers(void);
55 #endif