home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / CSCAP323.ZIP / OWLSRC.EXE / PCBDRAWC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-28  |  1.3 KB  |  61 lines

  1. /*
  2.     pcbdrawc.c
  3.  
  4.     % pc_bDrawCursor
  5.  
  6.     10/19/88  by Ted.
  7.     Extracted from pcdisp.c
  8.  
  9.     OWL-PC 1.2
  10.     Copyright (c) 1988, by Oakland Group, Inc.
  11.     ALL RIGHTS RESERVED.
  12.  
  13.     Revision History:
  14.     -----------------
  15.      2/05/89 ted    Removed redundant disp clip.
  16.  
  17.      3/28/90 jmd    ansi-fied
  18. */
  19.  
  20. #include "pcpriv.h"
  21. /* -------------------------------------------------------------------------- */
  22.  
  23. void pc_bDrawCursor(ptd_struct *ptd, cursortype ctype)
  24. {
  25.     win_type win;
  26.     opbox clipbox;
  27.     int row, col;
  28.     ofont_type font;
  29.     opcoord x;
  30.     opcoord y;
  31.     int slen;
  32.  
  33.     win = ptd->win;
  34.     font = win_GetFont(win);
  35.  
  36.     opbox_copy(&clipbox, ptd->relboxp);
  37.     opbox_trans(&clipbox, win_GetXmin(win), win_GetYmin(win));
  38.     x = win_GetXmin(win) + win_GetCursx(win);
  39.     y = win_GetYmin(win) + win_GetCursy(win);
  40.  
  41.     col = opcoord_GetXCol(x + ofont_GetWidth(font) - 1, font);    /* round in */
  42.     row = opcoord_GetYRow(y - 1, font);
  43.     x = col * ofont_GetWidth(font);
  44.     y = (row + 1) * ofont_GetHeight(font);
  45.  
  46.     slen = 1;
  47.     opbox_clipstring(&clipbox, &x, &y, &slen, font);
  48.     if (slen <= 0) {
  49.         return;
  50.     }
  51.     if (ctype != CURSOR_NONE) {
  52.         pc_bsetcursorpos(row, col);
  53.     }
  54.     if (pcdata->curctype != ctype) {
  55.         pcdata->curctype = ctype;
  56.         pc_bsetcursortype(ctype, pcdata->fontlines);
  57.     }
  58. }
  59. /* -------------------------------------------------------------------------- */
  60.  
  61.