Add Bocfel interpreter
[projects/chimara/chimara.git] / interpreters / bocfel / screen.h
1 #ifndef ZTERP_SCREEN_H
2 #define ZTERP_SCREEN_H
3
4 #include <stdint.h>
5
6 #ifdef ZTERP_GLK
7 #include <glk.h>
8 #endif
9
10 /* Boolean flag describing whether the header bit meaning “fixed font” is set. */
11 extern int header_fixed_font;
12
13 extern uint32_t read_pc;
14
15 void init_screen(void);
16
17 int create_mainwin(void);
18 int create_statuswin(void);
19 int create_upperwin(void);
20 void get_screen_size(unsigned int *, unsigned int *);
21 void close_upper_window(void);
22 void cancel_all_events(void);
23
24 /* Text styles. */
25 #define STYLE_NONE      (0U     )
26 #define STYLE_REVERSE   (1U << 0)
27 #define STYLE_BOLD      (1U << 1)
28 #define STYLE_ITALIC    (1U << 2)
29 #define STYLE_FIXED     (1U << 3)
30
31 void show_message(const char *, ...);
32
33 #ifdef GLK_MODULE_LINE_TERMINATORS
34 void term_keys_reset(void);
35 void term_keys_add(uint8_t);
36 #endif
37
38 #ifdef GARGLK
39 void update_color(int, unsigned long);
40 #endif
41
42 /* Output streams. */
43 #define OSTREAM_SCREEN          1
44 #define OSTREAM_SCRIPT          2
45 #define OSTREAM_MEMORY          3
46 #define OSTREAM_RECORD          4
47
48 /* Input streams. */
49 #define ISTREAM_KEYBOARD        0
50 #define ISTREAM_FILE            1
51
52 int output_stream(int16_t, uint16_t);
53 int input_stream(int);
54
55 void set_current_style(void);
56
57 int print_handler(uint32_t, void (*)(uint8_t));
58 void put_char_u(uint16_t);
59 void put_char(uint8_t);
60
61 void zoutput_stream(void);
62 void zinput_stream(void);
63 void zprint(void);
64 void zprint_ret(void);
65 void znew_line(void);
66 void zerase_window(void);
67 void zerase_line(void);
68 void zset_cursor(void);
69 void zget_cursor(void);
70 void zset_colour(void);
71 void zset_true_colour(void);
72 void zset_text_style(void);
73 void zset_font(void);
74 void zprint_table(void);
75 void zprint_char(void);
76 void zprint_num(void);
77 void zprint_addr(void);
78 void zprint_paddr(void);
79 void zsplit_window(void);
80 void zset_window(void);
81 void zread_char(void);
82 void zshow_status(void);
83 void zread(void);
84 void zprint_unicode(void);
85 void zcheck_unicode(void);
86 void zpicture_data(void);
87 void zget_wind_prop(void);
88 void zprint_form(void);
89 void zmake_menu(void);
90 void zbuffer_screen(void);
91
92 #endif