home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / editors / tde150.arj / TDECFG.H < prev    next >
C/C++ Source or Header  |  1992-04-01  |  6KB  |  201 lines

  1. #define TRUE            1
  2. #define FALSE           0
  3.  
  4. #define EXIST           0
  5.  
  6. #define VIDEO_INT       0x10
  7.  
  8. #define VGA             3
  9. #define EGA             2
  10. #define CGA             1
  11. #define MDA             0
  12.  
  13. #define NORMAL          7
  14. #define COLOR_ATTR      31
  15. #define MONO_ATTR       112
  16.  
  17.  
  18. #define ESC             27
  19. #define LEFT            (75 | 0x100)
  20. #define RIGHT           (77 | 0x100)
  21. #define UP              (72 | 0x100)
  22. #define DOWN            (80 | 0x100)
  23. #define RTURN           13
  24. #define PGUP            (73 | 0x100)
  25. #define PGDN            (81 | 0x100)
  26. #define F1              (59 | 0x100)
  27. #define F2              (60 | 0x100)
  28. #define F3              (61 | 0x100)
  29. #define F5              (63 | 0x100)
  30. #define F6              (64 | 0x100)
  31. #define F7              (65 | 0x100)
  32. #define F8              (66 | 0x100)
  33. #define F10             (68 | 0x100)
  34.  
  35.  
  36. #define U_LEFT          218
  37. #define U_RIGHT         191
  38. #define VER_LINE        179
  39. #define HOR_LINE        196
  40. #define L_LEFT          192
  41. #define L_RIGHT         217
  42.  
  43. #define SAVE            0
  44. #define RESTORE         1
  45.  
  46.  
  47. /*
  48.  * Save the underlying text of the screen in a structure.  We need to know
  49.  * the column and row to begin saving the text.  Since we are doing an
  50.  * optimal save and restore, we don't know how much memory to allocate to
  51.  * the save buffer.  If we use a pointer, then we can dynamically allocate as
  52.  * much or as little memory as we need.  Finally, we need a window pointer
  53.  * to point to the next item on the stack.
  54.  */
  55. typedef struct win {
  56.    int x;
  57.    int y;
  58.    int *buf;
  59.    struct win *n;
  60. } WINDOW;
  61.  
  62.  
  63. /*
  64.  * Structure to store the row and column of a string.
  65.  */
  66. struct screen {
  67.    unsigned int   row;
  68.    unsigned int   col;
  69.    unsigned char *text;
  70. };
  71.  
  72.  
  73. /*
  74.  * video adapter stuff.
  75.  */
  76. struct vcfg {
  77.    int color;
  78.    int rescan;
  79.    int mode;
  80.    int adapter;
  81.    int attr;
  82.    int far *videomem;
  83. };
  84.  
  85.  
  86. /*
  87.  * When we display a pop-up or pull-down window, we need to know a few things
  88.  * about the window and the text to display in the window.
  89.  */
  90. typedef struct {
  91.    int dply_col;        /* offset into window to begin displaying help list */
  92.    int dply_row;        /* dito */
  93.    int line_length;     /* the length of the help line in the window */
  94.    int avail_lines;     /* number of lines in the window available for list */
  95.    int v_row;           /* virtual row of cursor in window */
  96.    int select;          /* item currently selected in help list */
  97.    int num_entries;     /* total number of items in help list */
  98.    int ulft_col;        /* absolute upper left column of window */
  99.    int ulft_row;        /* absolute upper left row of window */
  100.    int total_col;       /* total number of columns in window */
  101.    int total_row;       /* total number of rows in window */
  102. } HELP_WINDOW;
  103.  
  104.  
  105. /*
  106.  * structure for list of available keys.   See default.h for more info.
  107.  */
  108. typedef struct {
  109.    char *key;           /* key name */
  110.    int  key_index;      /* offset into key structure in tde.exe file */
  111.    unsigned char func_index;     /* function of key */
  112. } KEY_DEFS;
  113.  
  114.  
  115. /*************  prototypes for functions in  tdecfg.c  *******************/
  116. void  main( int, char *[] );
  117. void xygoto( int, int );
  118. void video_config( void );
  119. int getkey( void );
  120. void s_output( char far *, int, int, int );
  121. void cls( void );
  122. void hlight_line( int, int, int, int );
  123. void c_off( void );
  124. void c_on( void );
  125. void scroll_window( int, int, int, int, int, int );
  126. void cls( void );
  127. void show_box( int, int, struct screen *, int );
  128. void make_window( int, int, int, int, int );
  129. void buf_box( int, int, int, int, int );
  130. void clear_window( int, int, int, int );
  131. void window_control( WINDOW **, int, int, int, int, int );
  132. void save_window( int *, int, int, int, int );
  133. void restore_window( int *, int, int, int, int );
  134. /*************************************************************************/
  135.  
  136.  
  137. /*************  prototypes for functions in  cfgcolor.c  *****************/
  138. void tdecolor( void );
  139. void initialize_color( void );
  140. void show_init_sample( void );
  141. void color_number( char *, int );
  142. void current_color_number( char *, int );
  143. void show_help_color( void );
  144. void show_fileheader_color( void );
  145. void show_text_color( void );
  146. void show_curl_color( void );
  147. void show_warning_color( void );
  148. void show_mode_color( void );
  149. void show_wrapped_color( void );
  150. void show_eof_color( void );
  151. void show_ruler_color( void );
  152. void show_rulerptr_color( void );
  153. void show_block_color( void );
  154. void show_hilitedfile_color( void );
  155. void change_colors( void );
  156. /*************************************************************************/
  157.  
  158.  
  159. /*************  prototypes for functions in  cfgkeys.c  *****************/
  160. void tdekeys( void );
  161. void initialize_keys( void );
  162. void show_key_def_list( HELP_WINDOW *, KEY_DEFS * );
  163. void show_func_list( HELP_WINDOW *, char *[] );
  164. void position_cursor( HELP_WINDOW *, int, int *, int *, int * );
  165. void master_help( HELP_WINDOW *, KEY_DEFS *, struct screen *, char *, int * );
  166. void new_assignment_help( HELP_WINDOW *, char *[], struct screen *, int * );
  167. void save_and_draw( HELP_WINDOW *, struct screen *, WINDOW ** );
  168. /*************************************************************************/
  169.  
  170.  
  171. /*************  prototypes for function in  cfghelp.c  *******************/
  172. void tdehelp( void );
  173. /*************************************************************************/
  174.  
  175.  
  176. /*************  prototypes for function in  cfgmacro.c  *******************/
  177. void tdemacro( void );
  178. /*************************************************************************/
  179.  
  180.  
  181. /*************  prototypes for functions in cfgmodes.c  *****************/
  182. void tdemodes( void );
  183. void initialize_modes( void );
  184. void show_init_mode( void );
  185. void show_insert_mode( void );
  186. void show_indent_mode( void );
  187. void show_tabsize( void );
  188. void show_controlz( void );
  189. void show_eol_out( void );
  190. void show_trail( void );
  191. void show_eol_display( void );
  192. void show_ww( void );
  193. void show_left( void );
  194. void show_para( void );
  195. void show_right( void );
  196. void show_cursor_size( void );
  197. void show_backup_mode( void );
  198. void show_ruler_mode( void );
  199. void change_modes( void );
  200. /*************************************************************************/
  201.