home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / x / xvisrc.zoo / virtscr.h < prev    next >
C/C++ Source or Header  |  1992-07-28  |  3KB  |  85 lines

  1. /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  2. /***
  3.  
  4. * @(#)virtscr.h    2.3 (Chris & John Downey) 9/4/92
  5.  
  6. * program name:
  7.     xvi
  8. * function:
  9.     PD version of UNIX "vi" editor, with extensions.
  10. * module name:
  11.     virtscr.h
  12. * module function:
  13.     Definition of the VirtScr class.
  14. * history:
  15.     STEVIE - ST Editor for VI Enthusiasts, Version 3.10
  16.     Originally by Tim Thompson (twitch!tjt)
  17.     Extensive modifications by Tony Andrews (onecom!wldrdg!tony)
  18.     Heavily modified by Chris & John Downey
  19.  
  20. ***/
  21.  
  22. /*
  23.  * Type of an object whose pointers can be freely cast.
  24.  */
  25. #ifdef    __STDC__
  26. #   define  genptr    void
  27. #else
  28. #   define  genptr    char
  29. #endif
  30.  
  31. typedef struct virtscr {
  32.     genptr    *pv_window;
  33.     int        pv_rows;
  34.     int        pv_cols;
  35. /* public: */
  36.     struct virtscr
  37.         *(*v_new) P((struct virtscr *));
  38.     void    (*v_close) P((struct virtscr *));
  39.  
  40.     int        (*v_rows) P((struct virtscr *));
  41.     int        (*v_cols) P((struct virtscr *));
  42.  
  43.     void    (*v_clear_all) P((struct virtscr *));
  44.     void    (*v_clear_line) P((struct virtscr *, int, int));
  45.  
  46.     void    (*v_goto) P((struct virtscr *, int, int));
  47.     void    (*v_advise) P((struct virtscr *, int, int, int, char *));
  48.  
  49.     void    (*v_write) P((struct virtscr *, int, int, char *));
  50.     void    (*v_putc) P((struct virtscr *, int, int, int));
  51.  
  52.     void    (*v_set_colour) P((struct virtscr *, int));
  53.     int        (*v_colour_cost) P((struct virtscr *));
  54.  
  55.     void    (*v_flush) P((struct virtscr *));
  56.  
  57.     void    (*v_beep) P((struct virtscr *));
  58.  
  59. /* optional: do not use if NULL */
  60.     void    (*v_insert) P((struct virtscr *, int, int, char *));
  61.  
  62.     int        (*v_scroll) P((struct virtscr *, int, int, int));
  63.  
  64.     void    (*v_flash) P((struct virtscr *));
  65.  
  66.     void    (*v_status) P((struct virtscr *, char *, char *, long, long));
  67.  
  68.     void    (*v_activate) P((struct virtscr *));
  69. } VirtScr;
  70.  
  71. #define    VSrows(vs)            ((*(vs->v_rows))(vs))
  72. #define    VScols(vs)            ((*(vs->v_cols))(vs))
  73. #define    VSclear_all(vs)            ((*(vs->v_clear_all))(vs))
  74. #define    VSclear_line(vs, row, col)    ((*(vs->v_clear_line))(vs, row, col))
  75. #define    VSgoto(vs, row, col)        ((*(vs->v_goto))(vs, row, col))
  76. #define    VSadvise(vs, r, c, i, str)    ((*(vs->v_advise))(vs, r, c, i, str))
  77. #define    VSwrite(vs, row, col, str)    ((*(vs->v_write))(vs, row, col, str))
  78. #define    VSputc(vs, row, col, c)        ((*(vs->v_putc))(vs, row, col, c))
  79. #define    VSset_colour(vs, colour)    ((*(vs->v_set_colour))(vs, colour))
  80. #define    VScolour_cost(vs)        ((*(vs->v_colour_cost))(vs))
  81. #define    VSflush(vs)            ((*(vs->v_flush))(vs))
  82. #define    VSbeep(vs)            ((*(vs->v_beep))(vs))
  83. #define    VSinsert(vs, row, col, str)    ((*(vs->v_insert))(vs, row, col, str))
  84. #define    VSscroll(vs, start, end, n)    ((*(vs->v_scroll))(vs, start, end, n))
  85.