home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / cbw / part01 / banner.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-16  |  1.4 KB  |  61 lines

  1. /*
  2.  * Banner window abstraction.  Just a title text with default behavior.
  3.  *
  4.  * Robert W. Baldwin,  December 1984.
  5.  */
  6.  
  7.  
  8. #include    <stdio.h>
  9. #include    "window.h"
  10. #include    "layout.h"
  11.  
  12.  
  13. /* Window for the title banner. */
  14.  
  15. displine    banline1 = {
  16.             1,1,            /* Origin. */
  17.             1,MAXWIDTH,        /* Height and width. */
  18.             1,1,            /* Initial cursor position */
  19.             NULL,            /* No private data. */
  20.             wl_setcur,        /* Firstime = Set cursor to current value. */
  21.             wl_noop,        /* Lasttime = do nothing. */
  22.             wl_dldraw,        /* Default dispaly line draw routine. */
  23.             dokey,            /* Default keystroke handler. */
  24.             arwktab,        /* Basic arrow keystroke handler. */
  25.             1,MAXWIDTH,        /* Min and Max column for cursor in line. */
  26.             };
  27.  
  28. displine    *banlines[] = {
  29.             &banline1,        /* List of display lines for the banner. */
  30.             NULL,
  31.             };
  32.  
  33. twindow        banner = {
  34.             1,1,            /* Origin. */
  35.             1,MAXWIDTH,        /* Height and width. */
  36.             1,1,            /* Initial cursor position */
  37.             NULL,            /* No private data. */
  38.             wl_setcur,        /* Firstime = accept current cursor position. */
  39.             wl_noop,        /* Lasttime = do nothing. */
  40.             wl_twdraw,        /* Simple draw routine. */
  41.             dokey,            /* Default keystroke handler. */
  42.             arwktab,        /* Basic arrow keystroke handler. */
  43.             banlines,
  44.             };
  45.  
  46.  
  47.  
  48. /* Initialize the banner window and return a pointer to it.
  49.  * Fill in the banner text.
  50.  */
  51. gwindow *(ibanner())
  52. {
  53.     displine    *line;
  54.     int            i;
  55.  
  56.     line = banner.dlines[0];
  57.     clrdline(line);
  58.     setndline(line, BANTEXT, BANLM);
  59.     return ((gwindow *) &banner);
  60. }
  61.