home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 1.ddi / H / W4.H < prev   
Encoding:
C/C++ Source or Header  |  1990-11-19  |  10.3 KB  |  293 lines

  1. /*  w4.h   (c)Copyright Sequiter Software Inc., 1987-1990.  All rights reserved.  */
  2.  
  3. #ifdef UNIX
  4.    #ifndef CURSES_DONE
  5.       /* This header file is sometimes called 'curses.h': */
  6.       #ifdef H_CURSES
  7.          #include <curses.h>
  8.       #else
  9.          #include <tinfo.h>
  10.       #endif
  11.       #define CURSES_DONE
  12.    #endif
  13.  
  14.    #define  F_BLUE      A_NORMAL
  15.    #define  F_GREEN     A_NORMAL
  16.    #define  F_RED       A_NORMAL
  17.    #define  F_WHITE     A_NORMAL
  18.    #define  F_INTENSE   A_STANDOUT
  19.    #define  B_BLUE      A_REVERSE
  20.    #define  B_GREEN     A_REVERSE
  21.    #define  B_RED       A_REVERSE
  22.    #define  B_WHITE     A_REVERSE
  23.    #define  B_BLINK     A_BLINK
  24.  
  25.    #define  SINGLE     "--||    "
  26.    #define  DOUBLE     "--||    "
  27.    #define  DOUBLE_TOP "--||    "
  28.    #define  PANEL      "--||    "
  29. #else
  30.    #define  F_BLUE      1L
  31.    #define  F_GREEN     2L
  32.    #define  F_RED       4L
  33.    #define  F_CYAN      3L
  34.    #define  F_MAGENTA   5L
  35.    #define  F_YELLOW    6L
  36.    #define  F_WHITE     7L
  37.    #define  F_INTENSE   8L
  38.    #define  B_BLUE   0x10L
  39.    #define  B_GREEN  0x20L
  40.    #define  B_RED    0x40L
  41.    #define  B_WHITE  0x70L
  42.    #define  B_BLINK  0x80L
  43.  
  44.    #define  SINGLE     "\xC4\xC4\xB3\xB3\xDA\xBF\xC0\xD9"
  45.    #define  DOUBLE     "\xCD\xCD\xBA\xBA\xC9\xBB\xC8\xBC"
  46.    #define  DOUBLE_TOP "\xCD\xCD\xB3\xB3\xD5\xB8\xD4\xBE"
  47.    #define  PANEL      "\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB"
  48. #endif
  49.  
  50. #define  MAX_GET_WIDTH    258
  51. #define  DEFAULT_DATE    "MMM/DD/YY"
  52.  
  53. extern  int  v4default_window ;
  54. extern  char v4default_date[] ;
  55.  
  56. typedef int  ACTION(int) ;
  57.  
  58. typedef struct cb_window_st
  59. {
  60.    int   next, prev ;
  61.  
  62.    /* Window Information */
  63.    int   hand ;                  /* A negative handle means use 'screen_ptr' */
  64.    int   start_row ;             /* The windows Origin Row */
  65.    int   start_col ;             /* The windows Origin Column */
  66.    int   row ;                   /* The current Row */
  67.    int   col ;                   /* The current Column */
  68.    int   width ;                 /* Number of characters in screen width */
  69.    int   display_bytes ;         /* Number of bytes on the screen */
  70.    int   height ;                /* The number of rows per page */
  71.    int   active ;                /* True if the window has been displayed */
  72.    char *border_chars ;          /* Border Characters; (char *) 0 if none */
  73.    long  border_attribute ;      /* Border Attribute Character */
  74.    long  attribute ;             /* The Current Attribute */
  75.  
  76.    #ifdef UNIX
  77.       WINDOW  *win ;
  78.       int      border_offset ;
  79.    #else
  80.       /* Some Extra Curses Definitions */
  81.       char *data ;                  /* A memory copy of the screen data */
  82.       char *old_screen ;            /* The old Screen Information for Popups */
  83.    #endif
  84.  
  85.    int   title_row ;
  86.    int   title_col ;
  87.    char *title ;
  88.    long  title_attribute ;
  89.  
  90.    /* Get Information */
  91.    int   first_get ;             /* A Reference to the First Get */
  92.    int   last_get ;              /* A Reference to the Last Get */
  93.    int   release ;               /* True if Gets are Released after Use */
  94.    char  get_delimiter[2] ;
  95.    long  get_attribute ;
  96.  
  97.    /* Menu Information */
  98.    int   first_menu ;            /* Reference to the first menu item reference */
  99.    int   last_menu ;             /* Reference to the last menu item reference */
  100.    int   start_item ;            /* The starting menu item reference */
  101.    int   horizontal ;            /* True if Horizontal Menu */
  102.    int   item_width ;            /* Column Distance between Menu Items */
  103.    int   key_read ;              /* 1 - Single Char; 2 - String Compare */
  104.    int   ignore_case ;           /* 1 - Ignore case of key */
  105.    long  menu_attribute ;        /* Default normal menu item attribute */
  106.    long  menu_att_active ;       /* Selected menu item attribute */
  107.    int   force_refresh ;         /* Refresh the menu window */
  108.    int   arrow_exit ;            /* TRUE if opposite arrow keys cause
  109.                     'n4activate' to exit */
  110.    int   up_key ;                /* A key to move the menu system up one */
  111.    int   exit_key ;              /* A key to exit the menu system */
  112.    int   return_start ;          /* A range of keys which exit the menu system */
  113.    int   return_end ;
  114. }  CB_WINDOW ;
  115.  
  116.  
  117. typedef struct menu_st
  118. {
  119.    int    next, prev ;
  120.  
  121.    int    row ;           /* Specific row of menu item */
  122.    int    col ;           /* Specific column of menu item */
  123.  
  124.    int    window_ref ;    /* Corresponding window reference number */
  125.  
  126.    char  *item_ptr ;      /* Menu Item text */
  127.    int    skip_over ;     /* True if the this Menu Item may not be chosen */
  128.  
  129.    int    key_value ;     /* A key to move to and/or activate the menu item */
  130.    int    key_activate ;  /* Non-zero if the key press activates the menu item */
  131.    int    key_highlight_pos ;  /* -1 if there is no highlighting of special key */
  132.  
  133.    char  *message ;       /* Displayed with routine 'n4message_do' */
  134.    long   attribute ;     /* Attribute for the menu item (When Not Selected) */
  135.  
  136.    ACTION *action ;
  137.    ACTION *reaction ;
  138.    int    parm_data ;     /* Parameter for the action/reaction routine. */
  139.    void  *ptr_data ;      /* Pointer data. */
  140.    int    int_data ;      /* Extra integer data. */
  141. }  MENU ;
  142.  
  143.  
  144. typedef struct get_st
  145. {
  146.    int   next, prev ;
  147.  
  148.    int   row ;              /* Row of the entry area */
  149.    int   col ;              /* Column of the entry area */
  150.    int   width_scr ;        /* Width of the Screen */
  151.  
  152.    int   window_ref ;       /* The Window Reference Number */
  153.  
  154.    char *picture ;          /* A picture entry template */
  155.    int   num_decimals ;     /* The number of decimals for numeric entries */
  156.    int   upper_convert ;    /* TRUE if complete Upper Case Conversion */
  157.  
  158.    #ifdef KR
  159.       int (*valid)() ;      /* Routine to call to verify the GET */
  160.       int (*call)() ;       /* Routine to call before the GET */
  161.    #else
  162.       int (*valid)(struct get_st *) ;
  163.       int (*call)(struct get_st *, char *, int) ;
  164.    #endif
  165.    int   call_data ;        /* Some data to be passed to the call routine */
  166.    char  type ;             /* C (Character), D (Date), L (Logical),
  167.                                N (Numeric),   d (double), l (long), i (int) */
  168.    void *data ;             /* Pointer to the Data Buffer */
  169.    int   width_data ;       /* The number of bytes pointed to by 'data' */
  170.    long  attribute ;        /* The attribute to be used for the 'GET' */
  171.    char  delimiter[2] ;     /* Up to two delimeter characters */
  172.    char *message ;          /* A message displayed by 'g4message_do' */
  173.  
  174. }  GET ;
  175.  
  176. typedef  int GET_ROUTINE( GET *, char *, int ) ;
  177.  
  178. GET     *g4alloc( int, int, void *, char ) ;
  179. void     g4( int, int, char * ) ;
  180. long     g4attribute( long ) ;
  181. void     g4bell( void) ;
  182. int      g4bell_set( int ) ;
  183. void     g4call( GET_ROUTINE *, int ) ;
  184. int      g4char( void) ;
  185. void     g4date( int, int, char * ) ;
  186. void     g4delimiter( char * ) ;
  187. void     g4double( int, int, double * ) ;
  188. void     g4display( void) ;
  189. void     g4field( int, int, long ) ;
  190. void     g4int( int, int, int * ) ;
  191. void     g4logical( int, int, int * ) ;
  192. void     g4long( int, int, long * ) ;
  193. int      g4menu( GET *, char *, int ) ;
  194. int      g4menu_help( GET *, char *, int ) ;
  195. void     g4message( char * ) ;
  196. void     g4message_do( char * ) ;
  197. void     g4numeric( int, int, char * ) ;
  198. void     g4picture( char * ) ;
  199. int      g4read( void) ;
  200. int      g4release( int ) ;
  201. void     g4upper( void) ;
  202. void     g4valid( int (*)(GET *)) ; /* g3valid has a routine as a parameter */
  203. void     g4width( int, int ) ;
  204.  
  205. int      n4( char * ) ;
  206. void     n4action( ACTION * ) ;
  207. int      n4activate( int ) ;
  208. void     n4arrow_exit( void ) ;
  209. void     n4attribute( long, long ) ;
  210. void     n4attribute_item( int, long ) ;
  211. void     n4calc( int, int, int ) ;
  212. int      n4char(void) ;
  213. void     n4char_routine( int (*)(void) ) ;
  214. int      n4sub_menu( int ) ;
  215. void     n4get_calc( int ) ;
  216. void     n4horizontal( void) ;
  217. int      n4int_get( int ) ;
  218. void     n4int_save( int ) ;
  219. int      n4item( int, int, char * ) ;
  220. char    *n4item_text( int ) ;
  221. void     n4item_width( int ) ;
  222. void     n4key( int, int, int ) ;
  223. void     n4key_set( int, int ) ;
  224. void     n4key_special( int, int, int, int ) ;
  225. void     n4lotus( int ) ;
  226. void     n4message( char *) ;
  227. void     n4message_do( char * ) ;
  228. void     n4parm( int ) ;
  229. void    *n4ptr_get( int ) ;
  230. void     n4ptr_save( void * ) ;
  231. void     n4pulldown( int ) ;
  232. void     n4reaction( ACTION * ) ;
  233. void     n4refresh( int ) ;
  234. int      n4search( char * ) ;
  235. int      n4skip_over( int, int ) ;
  236. void     n4start_item( int ) ;
  237.  
  238. void     w4( int, int, char * ) ;
  239. void     w4activate( int ) ;
  240. long     w4attribute( long ) ;
  241. void     w4border( char *, long ) ;
  242. void     w4box( char *, int, int, int, int) ;
  243. void     w4centre( int, char *) ;
  244. void     w4clear( int ) ;
  245. void     w4close( int ) ;
  246. int      w4col( void) ;
  247. void     w4cursor( int, int ) ;
  248. void     w4cursor_size( int, int ) ;
  249. void     w4deactivate( int ) ;
  250. int      w4define( int, int, int, int ) ;
  251. #ifdef MSC
  252. int  cdecl w4display( char *, ... ) ;
  253. #else
  254. int      w4display( char *, ... ) ;
  255. #endif
  256. void     w4double( int, int, double, int, int ) ;
  257. void     w4eject( void) ;
  258. void     w4enlarge(void) ;
  259. void     w4exit(int) ;
  260. void     w4field( int, int, long ) ;
  261. int      w4handle( int ) ;
  262. int      w4height( int ) ;
  263. int      w4init( int, int, int ) ;
  264. void     w4init_undo(void) ;
  265. void     w4int( int, int, int, int ) ;
  266. void     w4long( int,  int, long, int ) ;
  267. void     w4memory( void) ;
  268. void     w4num( int, int, char *, int ) ;
  269. void     w4num_att( int, int, char *, int, long ) ;
  270. void     w4out( char * ) ;
  271. void     w4popup(void) ;
  272. void     w4position( int, int ) ;
  273. void     w4position_set( int, int ) ;
  274. void     w4read( int, int, char *, int ) ;
  275. void     w4read_window( int, char * ) ;
  276. void     w4repeat( int, int, char, int ) ;
  277. int      w4row( void) ;
  278. void     w4scroll( int ) ;
  279. int      w4select( int ) ;
  280. void     w4shrink(void) ;
  281. void     w4title( int, int, char *, long ) ;
  282. int      w4width( int ) ;
  283. void     w4write( int, int, char *, int ) ;
  284. void     w4write_att( int, int, char *, int, long ) ;
  285. void     w4write_window( int, char * ) ;
  286.  
  287. #ifdef UNIX
  288.    void  w4refresh_off() ;
  289.    void  w4refresh_on() ;
  290.    void  w4refresh(int) ;
  291. #endif
  292.  
  293.