home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / EDITOR / TDE120.ZIP / TDECFG.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-05  |  5.2 KB  |  168 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 F10             (68 | 0x100)
  31.  
  32.  
  33. #define U_LEFT          218
  34. #define U_RIGHT         191
  35. #define VER_LINE        179
  36. #define HOR_LINE        196
  37. #define L_LEFT          192
  38. #define L_RIGHT         217
  39.  
  40. #define SAVE            0
  41. #define RESTORE         1
  42.  
  43.  
  44. /*
  45.  * Save the underlying text of the screen in a structure.  We need to know
  46.  * the column and row to begin saving the text.  Since we are doing an
  47.  * optimal save and restore, we don't know how much memory to allocate to
  48.  * the save buffer.  If we use a pointer, then we can dynamically allocate as
  49.  * much or as little memory as we need.  Finally, we need a window pointer
  50.  * to point to the next item on the stack.
  51.  */
  52. typedef struct win {
  53.    int x;
  54.    int y;
  55.    int *buf;
  56.    struct win *n;
  57. } WINDOW;
  58.  
  59.  
  60. /*
  61.  * Structure to store the row and column of a string.
  62.  */
  63. struct screen {
  64.    unsigned int   row;
  65.    unsigned int   col;
  66.    unsigned char *text;
  67. };
  68.  
  69.  
  70. /*
  71.  * video adapter stuff.
  72.  */
  73. struct vcfg {
  74.    int color;
  75.    int rescan;
  76.    int mode;
  77.    int adapter;
  78.    int attr;
  79.    int far *videomem;
  80. };
  81.  
  82.  
  83. /*
  84.  * When we display a pop-up or pull-down window, we need to know a few things
  85.  * about the window and the text to display in the window.
  86.  */
  87. typedef struct {
  88.    int dply_col;        /* offset into window to begin displaying help list */
  89.    int dply_row;        /* dito */
  90.    int line_length;     /* the length of the help line in the window */
  91.    int avail_lines;     /* number of lines in the window available for list */
  92.    int v_row;           /* virtual row of cursor in window */
  93.    int select;          /* item currently selected in help list */
  94.    int num_entries;     /* total number of items in help list */
  95.    int ulft_col;        /* absolute upper left column of window */
  96.    int ulft_row;        /* absolute upper left row of window */
  97.    int total_col;       /* total number of columns in window */
  98.    int total_row;       /* total number of rows in window */
  99. } HELP_WINDOW;
  100.  
  101.  
  102. /*
  103.  * structure for list of available keys.   See default.h for more info.
  104.  */
  105. typedef struct {
  106.    char *key;           /* key name */
  107.    int  key_index;      /* offset into key structure in tde.exe file */
  108.    unsigned char func_index;     /* function of key */
  109. } KEY_DEFS;
  110.  
  111.  
  112. /*************  prototypes for functions in  tdecfg.c  *******************/
  113. void  main( int, char *[] );
  114. void xygoto( int, int );
  115. void video_config( void );
  116. int getkey( void );
  117. void s_output( char far *, int, int, int );
  118. void cls( void );
  119. void hlight_line( int, int, int, int );
  120. void c_off( void );
  121. void c_on( void );
  122. void scroll_window( int, int, int, int, int, int );
  123. void cls( void );
  124. void show_box( int, int, struct screen *, int );
  125. void make_window( int, int, int, int, int );
  126. void buf_box( int, int, int, int, int );
  127. void clear_window( int, int, int, int );
  128. void window_control( WINDOW **, int, int, int, int, int );
  129. void save_window( int *, int, int, int, int );
  130. void restore_window( int *, int, int, int, int );
  131. /*************************************************************************/
  132.  
  133.  
  134. /*************  prototypes for functions in  tdecolor.c  *****************/
  135. void tdecolor( void );
  136. void initialize_color( void );
  137. void show_init_sample( void );
  138. void color_number( char *, int );
  139. void current_color_number( char *, int );
  140. void show_help_color( void );
  141. void show_fileheader_color( void );
  142. void show_text_color( void );
  143. void show_block_color( void );
  144. void show_warning_color( void );
  145. void show_mode_color( void );
  146. void show_wrapped_color( void );
  147. void show_eof_color( void );
  148. void change_colors( void );
  149. /*************************************************************************/
  150.  
  151.  
  152. /*************  prototypes for functions in  tdekeys.c  *****************/
  153. void tdekeys( void );
  154. void initialize_keys( void );
  155. void show_key_def_list( HELP_WINDOW *, KEY_DEFS * );
  156. void show_func_list( HELP_WINDOW *, char *[] );
  157. void position_cursor( HELP_WINDOW *, int, int *, int *, int * );
  158. void master_help( HELP_WINDOW *, KEY_DEFS *, struct screen *, char *, int * );
  159. void new_assignment_help( HELP_WINDOW *, char *[], struct screen *, int * );
  160. void save_and_draw( HELP_WINDOW *, struct screen *, WINDOW ** );
  161. /*************************************************************************/
  162.  
  163.  
  164. /*************  prototypes for function in  tdehelp.c  *******************/
  165. void tdehelp( void );
  166. /*************************************************************************/
  167.  
  168.