home *** CD-ROM | disk | FTP | other *** search
- /*
- pcbdrawc.c
-
- % pc_bDrawCursor
-
- 10/19/88 by Ted.
- Extracted from pcdisp.c
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 2/05/89 ted Removed redundant disp clip.
- */
-
- #include "pcpriv.h"
- /* -------------------------------------------------------------------------- */
-
- void pc_bDrawCursor(ptd, ctype)
- ptd_struct *ptd;
- cursortype ctype;
- {
- win_type win;
- opbox clipbox;
- int row, col;
- ofont_type font;
- opcoord x;
- opcoord y;
- int slen;
-
- win = ptd->win;
- font = win_GetFont(win);
-
- opbox_copy(&clipbox, ptd->relboxp);
- opbox_trans(&clipbox, win_GetXmin(win), win_GetYmin(win));
- x = win_GetXmin(win) + win_GetCursx(win);
- y = win_GetYmin(win) + win_GetCursy(win);
-
- col = opcoord_GetXCol(x + ofont_GetWidth(font) - 1, font); /* round in */
- row = opcoord_GetYRow(y - 1, font);
- x = col * ofont_GetWidth(font);
- y = (row + 1) * ofont_GetHeight(font);
-
- slen = 1;
- opbox_clipstring(&clipbox, &x, &y, &slen, font);
- if (slen <= 0) {
- return;
- }
- if (ctype != CURSOR_NONE) {
- pc_bsetcursorpos(row, col);
- }
- if (pcdata->curctype != ctype) {
- pcdata->curctype = ctype;
- pc_bsetcursortype(ctype, pcdata->fontlines);
- }
- }
- /* -------------------------------------------------------------------------- */
-
-