1 /* Tetrinet for Linux, by Andrew Church <achurch@achurch.org>
2  * This program is public domain.
3  *
4  * Input/output interface declaration and constant definitions.
5  */
6 
7 #ifndef IO_H
8 #define IO_H
9 
10 /* Text buffers: */
11 #define BUFFER_PLINE	0
12 #define BUFFER_GMSG	1
13 #define BUFFER_ATTDEF	2
14 
15 typedef struct {
16 
17     /**** Input routine. ****/
18 
19     /* Wait for input and return either an ASCII code, a K_* value, -1 if
20      * server input is waiting, or -2 if we time out. */
21     int (*wait_for_input)(int msec);
22 
23     /**** Output routines. ****/
24 
25     /* Initialize for output. */
26     void (*screen_setup)(void);
27     /* Redraw the screen. */
28     void (*screen_refresh)(void);
29     /* Redraw the screen after clearing it. */
30     void (*screen_redraw)(void);
31 
32     /* Draw text into the given buffer. */
33     void (*draw_text)(int bufnum, const char *s);
34     /* Clear the given text buffer. */
35     void (*clear_text)(int bufnum);
36 
37     /* Set up the fields display. */
38     void (*setup_fields)(void);
39     /* Draw our own field. */
40     void (*draw_own_field)(void);
41     /* Draw someone else's field. */
42     void (*draw_other_field)(int player);
43     /* Draw the game status information. */
44     void (*draw_status)(void);
45     /* Draw specials stuff */
46     void (*draw_specials)(void);
47     /* Write a text string for usage of a special. */
48     void (*draw_attdef)(const char *type, int from, int to);
49     /* Draw the game message input window. */
50     void (*draw_gmsg_input)(const char *s, int pos);
51     /* Clear the game message input window. */
52     void (*clear_gmsg_input)(void);
53 
54     /* Set up the partyline display. */
55     void (*setup_partyline)(void);
56     /* Draw the partyline input string with the cursor at the given position. */
57     void (*draw_partyline_input)(const char *s, int pos);
58 
59     /* Set up the winlist display. */
60     void (*setup_winlist)(void);
61 
62 } Interface;
63 
64 extern Interface tty_interface, xwin_interface;
65 
66 #endif	/* IO_H */
67