home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / DIGCURSL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-29  |  1.3 KB  |  60 lines

  1. /*
  2.     digcursl.c
  3.  
  4.     % Function for getting cursor size given cursor type.
  5.  
  6.     5/16/88  by Ted.
  7.     Extracted from pcfuncs.c
  8.  
  9.     OWL-DIG 1.2
  10.     Copyright (c) 1988, by Oakland Group, Inc.
  11.     ALL RIGHTS RESERVED.
  12.  
  13.     Revision History:
  14.     -----------------
  15.      3/28/90 jmd    ansi-fied
  16. */
  17.  
  18. #include "oakhead.h"
  19. #include "disppriv.h"
  20. #include "digutil.h"
  21. /* -------------------------------------------------------------------------- */
  22.  
  23. void DIGPRIV dig_getcurslines(cursortype ctype, opcoord nlines, opcoord *startp, opcoord *endp)
  24. {
  25.     opcoord thick, thin;
  26.  
  27.     thick = 2*(nlines/8);
  28.     thin = nlines/15;
  29.  
  30.     switch(ctype) {
  31.     case CURSOR_NONE:
  32.         *startp = 32;            /* special start value for no bios cursor */
  33.         *endp   = 1;            /* special end value for no bios cursor */
  34.         break;
  35.     case CURSOR_BLOCK:
  36.         *startp = 0;            /* start value */
  37.         *endp   = nlines;
  38.         break;
  39.     case CURSOR_DASH:
  40.         *startp = nlines / 2;
  41.         *endp   = (*startp) + (thick - thin);
  42.         break;
  43.     case CURSOR_HALF:
  44.         *startp = nlines / 2;
  45.         *endp   = nlines;
  46.         break;
  47.     case CURSOR_THIN:
  48.         *startp = nlines - (1 + thin);
  49.         *endp   = nlines;
  50.         break;
  51.     case CURSOR_NORMAL:
  52.     default:
  53.         *startp = nlines - thick;
  54.         *endp   = nlines - thin;
  55.         break;
  56.     }
  57. }
  58. /* -------------------------------------------------------------------------- */
  59.  
  60.