00001
00002
00003
00004
00005 #ifndef WINTTY_H
00006 #define WINTTY_H
00007
00008 #define E extern
00009
00010 #ifndef WINDOW_STRUCTS
00011 #define WINDOW_STRUCTS
00012
00013
00014 typedef struct tty_mi {
00015 struct tty_mi *next;
00016 anything identifier;
00017 long count;
00018 char *str;
00019 int attr;
00020 boolean selected;
00021 char selector;
00022 char gselector;
00023 } tty_menu_item;
00024
00025
00026 struct WinDesc {
00027 int flags;
00028 xchar type;
00029 boolean active;
00030 uchar offx, offy;
00031 short rows, cols;
00032 short curx, cury;
00033 short maxrow, maxcol;
00034
00035
00036 short *datlen;
00037 char **data;
00038 char *morestr;
00039 tty_menu_item *mlist;
00040 tty_menu_item **plist;
00041 short plist_size;
00042 short npages;
00043 short nitems;
00044 short how;
00045 char menu_ch;
00046 };
00047
00048
00049 #define WIN_CANCELLED 1
00050 #define WIN_STOP 1
00051
00052
00053 struct DisplayDesc {
00054 uchar rows, cols;
00055 uchar curx, cury;
00056 #ifdef TEXTCOLOR
00057 int color;
00058 #endif
00059 int attrs;
00060 int toplin;
00061 int rawprint;
00062 int inmore;
00063 int inread;
00064 int intr;
00065 winid lastwin;
00066 char dismiss_more;
00067 };
00068
00069 #endif
00070
00071 #define MAXWIN 20
00072
00073
00074 #ifdef NHW_BASE
00075 #undef NHW_BASE
00076 #endif
00077 #define NHW_BASE 6
00078
00079 extern struct window_procs tty_procs;
00080
00081
00082 extern winid BASE_WINDOW;
00083
00084 extern struct WinDesc *wins[MAXWIN];
00085
00086 extern struct DisplayDesc *ttyDisplay;
00087
00088 extern char morc;
00089 extern char defmorestr[];
00090
00091
00092
00093
00094 E void FDECL(xwaitforspace, (const char *));
00095
00096
00097
00098 E void FDECL(tty_startup,(int*, int*));
00099 #ifndef NO_TERMS
00100 E void NDECL(tty_shutdown);
00101 #endif
00102 #if defined(apollo)
00103
00104
00105
00106
00107
00108 E void FDECL(xputc, (int));
00109 #else
00110 E void FDECL(xputc, (CHAR_P));
00111 #endif
00112 E void FDECL(xputs, (const char *));
00113 #if defined(SCREEN_VGA) || defined(SCREEN_8514)
00114 E void FDECL(xputg, (int, int, unsigned));
00115 #endif
00116 E void NDECL(cl_end);
00117 E void NDECL(clear_screen);
00118 E void NDECL(home);
00119 E void NDECL(standoutbeg);
00120 E void NDECL(standoutend);
00121 # if 0
00122 E void NDECL(revbeg);
00123 E void NDECL(boldbeg);
00124 E void NDECL(blinkbeg);
00125 E void NDECL(dimbeg);
00126 E void NDECL(m_end);
00127 # endif
00128 E void NDECL(backsp);
00129 E void NDECL(graph_on);
00130 E void NDECL(graph_off);
00131 E void NDECL(cl_eos);
00132
00133
00134
00135
00136
00137
00138
00139 E void FDECL(term_start_attr,(int attr));
00140 E void FDECL(term_end_attr,(int attr));
00141 E void NDECL(term_start_raw_bold);
00142 E void NDECL(term_end_raw_bold);
00143
00144 #ifdef TEXTCOLOR
00145 E void NDECL(term_end_color);
00146 E void FDECL(term_start_color,(int color));
00147 E int FDECL(has_color,(int color));
00148 #endif
00149
00150 #ifdef STATUS_COLORS
00151 E boolean FDECL(parse_status_color_options, (char *));
00152 #endif
00153
00154
00155
00156 E void FDECL(addtopl, (const char *));
00157 E void NDECL(more);
00158 E void FDECL(update_topl, (const char *));
00159 E void FDECL(putsyms, (const char*));
00160
00161
00162 #ifdef CLIPPING
00163 E void NDECL(setclipped);
00164 #endif
00165 E void FDECL(docorner, (int, int));
00166 E void NDECL(end_glyphout);
00167 E void FDECL(g_putch, (int));
00168 E void NDECL(win_tty_init);
00169
00170
00171 E void FDECL(tty_init_nhwindows, (int *, char **));
00172 E void NDECL(tty_player_selection);
00173 E void NDECL(tty_askname);
00174 E void NDECL(tty_get_nh_event) ;
00175 E void FDECL(tty_exit_nhwindows, (const char *));
00176 E void FDECL(tty_suspend_nhwindows, (const char *));
00177 E void NDECL(tty_resume_nhwindows);
00178 E winid FDECL(tty_create_nhwindow, (int));
00179 E void FDECL(tty_clear_nhwindow, (winid));
00180 E void FDECL(tty_display_nhwindow, (winid, BOOLEAN_P));
00181 E void FDECL(tty_dismiss_nhwindow, (winid));
00182 E void FDECL(tty_destroy_nhwindow, (winid));
00183 E void FDECL(tty_curs, (winid,int,int));
00184 E void FDECL(tty_putstr, (winid, int, const char *));
00185 E void FDECL(tty_display_file, (const char *, BOOLEAN_P));
00186 E void FDECL(tty_start_menu, (winid));
00187 E void FDECL(tty_add_menu, (winid,int,const ANY_P *,
00188 CHAR_P,CHAR_P,int,const char *, BOOLEAN_P));
00189 E void FDECL(tty_end_menu, (winid, const char *));
00190 E int FDECL(tty_select_menu, (winid, int, MENU_ITEM_P **));
00191 E char FDECL(tty_message_menu, (CHAR_P,int,const char *));
00192 E void NDECL(tty_update_inventory);
00193 E void NDECL(tty_mark_synch);
00194 E void NDECL(tty_wait_synch);
00195 #ifdef CLIPPING
00196 E void FDECL(tty_cliparound, (int, int));
00197 #endif
00198 #ifdef POSITIONBAR
00199 E void FDECL(tty_update_positionbar, (char *));
00200 #endif
00201 E void FDECL(tty_print_glyph, (winid,XCHAR_P,XCHAR_P,int));
00202 E void FDECL(tty_raw_print, (const char *));
00203 E void FDECL(tty_raw_print_bold, (const char *));
00204 E int NDECL(tty_nhgetch);
00205 E int FDECL(tty_nh_poskey, (int *, int *, int *));
00206 E void NDECL(tty_nhbell);
00207 E int NDECL(tty_doprev_message);
00208 E char FDECL(tty_yn_function, (const char *, const char *, CHAR_P));
00209 E void FDECL(tty_getlin, (const char *,char *));
00210 E int NDECL(tty_get_ext_cmd);
00211 E void FDECL(tty_number_pad, (int));
00212 E void NDECL(tty_delay_output);
00213 #ifdef CHANGE_COLOR
00214 E void FDECL(tty_change_color,(int color,long rgb,int reverse));
00215 #ifdef MAC
00216 E void FDECL(tty_change_background,(int white_or_black));
00217 E short FDECL(set_tty_font_name, (winid, char *));
00218 #endif
00219 E char * NDECL(tty_get_color_string);
00220 #endif
00221
00222
00223 E void NDECL(tty_start_screen);
00224 E void NDECL(tty_end_screen);
00225
00226 E void FDECL(genl_outrip, (winid,int));
00227
00228 #ifdef NO_TERMS
00229 # ifdef MAC
00230 # ifdef putchar
00231 # undef putchar
00232 # undef putc
00233 # endif
00234 # define putchar term_putc
00235 # define fflush term_flush
00236 # define puts term_puts
00237 E int FDECL(term_putc, (int c));
00238 E int FDECL(term_flush, (void *desc));
00239 E int FDECL(term_puts, (const char *str));
00240 # endif
00241 # if defined(MSDOS) || defined(WIN32CON)
00242 # if defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST) || defined(WIN32CON)
00243 # undef putchar
00244 # undef putc
00245 # undef puts
00246 # define putchar(x) xputc(x)
00247 # define putc(x) xputc(x)
00248 # define puts(x) xputs(x)
00249 # endif
00250 # ifdef POSITIONBAR
00251 E void FDECL(video_update_positionbar, (char *));
00252 # endif
00253 # endif
00254 #endif
00255
00256 #undef E
00257
00258 #endif