home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / SCRNMS.ZIP / EDITOR.H < prev    next >
C/C++ Source or Header  |  1990-03-13  |  5KB  |  200 lines

  1. /* editor.h
  2. **
  3. ** Copyright (c) 1990, Chris Laforet Software/Chris Laforet
  4. ** All Rights Reserved
  5. **
  6. ** Started: 18 February 1990
  7. **
  8. ** Revision Information: $Logfile:   F:/libs/editor/vcs/editor.h_v  $
  9. **                       $Date:   27 Feb 1990 09:11:38  $
  10. **                       $Revision:   1.3  $
  11. **
  12. */
  13.  
  14.  
  15. #ifndef __SETJMP_H
  16.     #include <setjmp.h>
  17. #endif
  18.  
  19. #ifdef __cplusplus
  20.     extern "C"
  21.         {
  22. #endif
  23.  
  24.  
  25. #ifndef LIBRARY
  26.     #ifndef __TURBOC__
  27.         #ifndef __ZTC__
  28.             #ifndef PROTECTED
  29.                 #pragma comment(lib,"LEDITOR.LIB")
  30.             #else
  31.                 #pragma comment(lib,"LEDITORP.LIB")
  32.             #endif
  33.         #endif
  34.     #endif
  35. #endif
  36.  
  37.  
  38.  
  39. /* 1. Constants and Macros */
  40.  
  41. #define E_INVALID                0
  42. #define E_VALID                 1
  43. #define E_NOPAINT                2
  44. #define E_EXIT                    3
  45. #define E_QUIT                    4
  46. #define E_END                    5
  47. #define E_FORE                    6
  48. #define E_BACK                    7
  49. #define E_PGDN                    8
  50. #define E_PGUP                    9
  51. #define E_ERROR                 20
  52. #define E_MACRO
  53.  
  54.  
  55. #define ALPHA                    1
  56. #define NUMERIC                 2
  57. #define SIGNED_NUMERIC            4
  58. #define ALPHA_NUMERIC            8
  59. #define ALPHA_SYMBOLS            16
  60. #define ALPHA_SPACE             32
  61. #define ALPHA_NUMERIC_SYMBOLS    64
  62. #define DOS_PATHNAME            128
  63. #define ZIP_PLUS_4                256
  64. #define JUMP                    2048
  65. #define DECIMAL_POINT            4096
  66.  
  67.  
  68. #define TITLE_ONLY                0        /* field flags */
  69. #define READ_ONLY                1        /* read only field...no modify */
  70. #define FIELD                    2
  71. #define POP_UP                    4
  72. #define SELECT                    8
  73. #define REQUIRED                0x80
  74.  
  75.  
  76. #define NON_FATAL                0        /* error returns */
  77. #define FATAL                    1
  78. #define NOTICE                    2
  79.  
  80.  
  81. #define CLOCK_OFF                0
  82. #define CLOCK_ON                1
  83.  
  84.  
  85.  
  86. /* 2. Structures and Unions */
  87.  
  88. struct choice
  89.     {
  90.     char choice_letter;
  91.     char *choice_string;
  92.     };
  93.  
  94.  
  95. struct pop
  96.     {
  97.     int pop_ulc;
  98.     char *pop_title;
  99.     struct choice *pop_choices;
  100.     int pop_max_choices;
  101.     char pop_space;
  102.     char pop_shadow;
  103.     };
  104.  
  105.  
  106. struct sel
  107.     {
  108.     int sel_ulc;
  109.     char *sel_title;
  110.     int sel_width;
  111.     char **sel_strings;
  112.     int sel_max_strings;
  113.     };
  114.  
  115.  
  116. /******* The following structures are defined in HELPGEN.H ********/
  117.  
  118. struct hh        /* help-header structure */
  119.     {
  120.     char hh_sig[8];            /* help file signiture "HELPGEN\0" */
  121.     int hh_pages;            /* total number of pages (i.e. help screens) */
  122.     int hh_cols;            /* width of help system (set at 78) */
  123.     int hh_rows;            /* height of help system (set at 23) */
  124.     };
  125.  
  126.  
  127. struct ph        /* page header structure -- follows hh */
  128.     {
  129.     char ph_tag[41];        /* tag name for page */
  130.     char ph_title[61];        /* title for page */
  131.     long ph_offset;            /* absolute offset in file to page data */
  132.     int ph_lines;            /* number of lines on page */
  133.     int ph_links;            /* number of links on page */
  134.     };
  135.  
  136.  
  137. struct li        /* link information structure -- precedes lines of page data */
  138.     {
  139.     char li_link[41];        /* tag name for link */
  140.     int li_col;                /* starting column of link highlight */
  141.     int li_row;                /* starting row of link highlight */
  142.     int li_len;                /* length of link highlight */
  143.     };
  144.  
  145. /******* The previous structures are defined in HELPGEN.H ********/
  146.  
  147.  
  148.  
  149. /* 3. Global Variables */
  150.  
  151. extern unsigned long __cpu_speed;
  152. extern int __error_color;
  153. extern char _user_permission;
  154.  
  155.  
  156. /* 4. Functions */
  157.  
  158. extern int far edit_field(int cursor,int hicolor,int locolor,int clock_flag,int clock_pos,int clock_color,char far *format,char *string,
  159.     int (far *user_function)(int cursor,int hicolor,int locolor,int clock_flag,int clock_pos,int clock_color,char *format,char *string,int *offset,int *string_offset,int insert,int keystroke,int action));
  160. extern int far parse_entry(char entry);
  161.  
  162. extern void far set_jump_on(int total_time,jmp_buf jump_buffer);
  163. extern void far set_jump_off(void);
  164. extern void far update_time(int clock_pos,int clock_color);
  165. extern int far read_keyboard(int clock_flag,int clock_pos,int clock_color);
  166. extern void far beep(void);
  167.  
  168. extern int register_key(int key,int (far * action)(int,int,int,int));
  169. extern void deregister_key(int key);
  170. extern int (far *query_key(int key))(int,int,int,int);
  171. extern int execute_key(int key,int clock_flag,int clock_pos,int clock_color);
  172.  
  173. extern int far pop_menu(int start,int hicolor,int locolor,char *title,int max_choices,struct choice *choices,int shadow,int space,int clock_flag,int clock_pos,int clock_color);
  174.  
  175. extern int far select_menu(int start,int hicolor,int locolor,int selcolor,char *title,int max_choices,char **choices,int width,int selection,int clock_flag,int clock_pos,int clock_color);
  176.  
  177. extern void far error(int type,char far *string,int clock_flag,int clock_pos,int clock_color);
  178. extern void far set_critical_error(void);
  179.  
  180. extern int askyn(char *title,char *prompt,int hicolor,int locolor,int clock_flag,int clock_pos,int clock_color);
  181. extern struct window *open_message(char *message,int color);
  182. extern void close_message(struct window *wndw);
  183.  
  184. extern void far disable_boot(void);
  185. extern void far enable_boot(void);
  186.  
  187. extern int open_help(char *pathname,int hilite_color,int normal_color);
  188. extern void close_help(void);
  189. extern void set_help_colors(int hilite_color,int normal_color);
  190. extern void set_help_key(int key);
  191. extern void register_help(char *topic);
  192. extern void deregister_help(void);
  193. extern char *query_help_topic(void);
  194. extern void far pop_help(int clock_flag,int clock_pos,int clock_color);
  195.  
  196.  
  197. #ifdef __cplusplus
  198.     }
  199. #endif
  200.