home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / PCBDRAWC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  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 1.1
  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.  
  18. #include "pcpriv.h"
  19. /* -------------------------------------------------------------------------- */
  20.  
  21. void pc_bDrawCursor(ptd, ctype)
  22.     ptd_struct *ptd;
  23.     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.