| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef VMBIFTIO_H |
| 21 |
#define VMBIFTIO_H |
| 22 |
|
| 23 |
#include "os.h" |
| 24 |
#include "vmbif.h" |
| 25 |
#include "utf8.h" |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
class CVmBifTIO: public CVmBif |
| 32 |
{ |
| 33 |
public: |
| 34 |
|
| 35 |
static vm_bif_desc bif_table[]; |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
static void say(VMG_ uint argc); |
| 41 |
static void logging(VMG_ uint argc); |
| 42 |
static void clearscreen(VMG_ uint argc); |
| 43 |
static void more(VMG_ uint argc); |
| 44 |
static void input(VMG_ uint argc); |
| 45 |
static void inputkey(VMG_ uint argc); |
| 46 |
static void inputevent(VMG_ uint argc); |
| 47 |
static void inputdialog(VMG_ uint argc); |
| 48 |
static void askfile(VMG_ uint argc); |
| 49 |
static void timedelay(VMG_ uint argc); |
| 50 |
static void sysinfo(VMG_ uint argc); |
| 51 |
static void status_mode(VMG_ uint argc); |
| 52 |
static void status_right(VMG_ uint argc); |
| 53 |
static void res_exists(VMG_ uint argc); |
| 54 |
static void set_script_file(VMG_ uint argc); |
| 55 |
static void get_charset(VMG_ uint argc); |
| 56 |
static void flush_output(VMG_ uint argc); |
| 57 |
static void input_timeout(VMG_ uint argc); |
| 58 |
static void input_cancel(VMG_ uint argc); |
| 59 |
static void log_input_event(VMG_ uint argc); |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
static void banner_create(VMG_ uint argc); |
| 65 |
static void banner_delete(VMG_ uint argc); |
| 66 |
static void banner_say(VMG_ uint argc); |
| 67 |
static void banner_clear(VMG_ uint argc); |
| 68 |
static void banner_flush(VMG_ uint argc); |
| 69 |
static void banner_size_to_contents(VMG_ uint argc); |
| 70 |
static void banner_goto(VMG_ uint argc); |
| 71 |
static void banner_set_text_color(VMG_ uint argc); |
| 72 |
static void banner_set_screen_color(VMG_ uint argc); |
| 73 |
static void banner_get_info(VMG_ uint argc); |
| 74 |
static void banner_set_size(VMG_ uint argc); |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
static void log_console_create(VMG_ uint argc); |
| 80 |
static void log_console_close(VMG_ uint argc); |
| 81 |
static void log_console_say(VMG_ uint argc); |
| 82 |
|
| 83 |
protected: |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
static int map_ext_key(VMG_ char *buf, int extc); |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
static int map_raw_key(VMG_ char *buf, const char *c, size_t len); |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
static int raw_key_complete(VMG_ const char *c, size_t len); |
| 140 |
|
| 141 |
|
| 142 |
static void say_to_console(VMG_ class CVmConsole *console, uint argc); |
| 143 |
|
| 144 |
|
| 145 |
static void close_script_file(VMG0_); |
| 146 |
}; |
| 147 |
|
| 148 |
|
| 149 |
#endif |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
#ifdef VMBIF_DEFINE_VECTOR |
| 161 |
|
| 162 |
|
| 163 |
vm_bif_desc CVmBifTIO::bif_table[] = |
| 164 |
{ |
| 165 |
{ &CVmBifTIO::say, 1, 0, TRUE }, |
| 166 |
{ &CVmBifTIO::logging, 1, 1, FALSE }, |
| 167 |
{ &CVmBifTIO::clearscreen, 0, 0, FALSE }, |
| 168 |
{ &CVmBifTIO::more, 0, 0, FALSE }, |
| 169 |
{ &CVmBifTIO::input, 0, 0, FALSE }, |
| 170 |
{ &CVmBifTIO::inputkey, 0, 0, FALSE }, |
| 171 |
{ &CVmBifTIO::inputevent, 0, 1, FALSE }, |
| 172 |
{ &CVmBifTIO::inputdialog, 5, 0, FALSE }, |
| 173 |
{ &CVmBifTIO::askfile, 4, 0, FALSE }, |
| 174 |
{ &CVmBifTIO::timedelay, 1, 0, FALSE }, |
| 175 |
{ &CVmBifTIO::sysinfo, 1, 0, TRUE }, |
| 176 |
{ &CVmBifTIO::status_mode, 1, 0, FALSE }, |
| 177 |
{ &CVmBifTIO::status_right, 1, 0, FALSE }, |
| 178 |
{ &CVmBifTIO::res_exists, 1, 0, FALSE }, |
| 179 |
{ &CVmBifTIO::set_script_file, 1, 1, FALSE }, |
| 180 |
{ &CVmBifTIO::get_charset, 1, 0, FALSE }, |
| 181 |
{ &CVmBifTIO::flush_output, 0, 0, FALSE }, |
| 182 |
{ &CVmBifTIO::input_timeout, 0, 1, FALSE }, |
| 183 |
{ &CVmBifTIO::input_cancel, 1, 0, FALSE }, |
| 184 |
|
| 185 |
{ &CVmBifTIO::banner_create, 8, 0, FALSE }, |
| 186 |
{ &CVmBifTIO::banner_delete, 1, 0, FALSE }, |
| 187 |
{ &CVmBifTIO::banner_clear, 1, 0, FALSE }, |
| 188 |
{ &CVmBifTIO::banner_say, 1, 0, TRUE }, |
| 189 |
{ &CVmBifTIO::banner_flush, 1, 0, FALSE }, |
| 190 |
{ &CVmBifTIO::banner_size_to_contents, 1, 0, FALSE }, |
| 191 |
{ &CVmBifTIO::banner_goto, 3, 0, FALSE }, |
| 192 |
{ &CVmBifTIO::banner_set_text_color, 3, 0, FALSE }, |
| 193 |
{ &CVmBifTIO::banner_set_screen_color, 2, 0, FALSE }, |
| 194 |
{ &CVmBifTIO::banner_get_info, 1, 0, FALSE }, |
| 195 |
{ &CVmBifTIO::banner_set_size, 4, 0, FALSE }, |
| 196 |
|
| 197 |
{ &CVmBifTIO::log_console_create, 3, 0, FALSE }, |
| 198 |
{ &CVmBifTIO::log_console_close, 1, 0, FALSE }, |
| 199 |
{ &CVmBifTIO::log_console_say, 1, 0, TRUE }, |
| 200 |
|
| 201 |
{ &CVmBifTIO::log_input_event, 1, 0, FALSE } |
| 202 |
}; |
| 203 |
|
| 204 |
#endif |