home *** CD-ROM | disk | FTP | other *** search
- /*
- wincurso.c 10/30/88
-
- % functions control the positon and shape of a window's text cursor.
- Consolidated from other files.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 3/24/89 ted Made macro out of win_GetCursorType.
- */
- /* -------------------------------------------------------------------------- */
- #include "oakhead.h"
- #include "disppriv.h"
- /* -------------------------------------------------------------------------- */
-
- void win_SetPixCursorPos(win, cursx, cursy)
- win_type win;
- opcoord cursx;
- opcoord cursy;
- {
- boolean wasshown;
-
- wasshown = win_HideCursor(win);
- win_setcursx(win, cursx);
- win_setcursy(win, cursy);
- if (wasshown) win_ShowCursor(win);
- }
- /* -------------------------------------------------------------------------- */
-
- void win_SetCursorType(win, ctype)
- win_type win;
- cursortype ctype;
- {
- boolean wasshown;
-
- wasshown = win_HideCursor(win);
- win_setcurstype(win, ctype);
- if (wasshown) win_ShowCursor(win);
- }
- /* -------------------------------------------------------------------------- */
-
- void win_GetCursorPixBox(win, cursboxp)
- win_type win;
- opbox *cursboxp;
- {
- cursboxp->xmin = win_GetCursx(win);
- cursboxp->ymax = win_GetCursy(win);
- cursboxp->xmax = cursboxp->xmin + win_GetFontWidth(win);
- cursboxp->ymin = cursboxp->ymax - win_GetFontHeight(win);
- }
- /* -------------------------------------------------------------------------- */
-
- boolean win_ShowCursor(win)
- win_type win;
- {
- boolean didshow;
-
- if (!win_Do(win, WINM_SHOWCURS, win, &didshow)) {
- didshow = FALSE;
- }
- return(didshow);
- }
- /* -------------------------------------------------------------------------- */
-
- boolean win_HideCursor(win)
- win_type win;
- {
- boolean didhide;
-
- if (!win_Do(win, WINM_HIDECURS, win, &didhide)) {
- didhide = FALSE;
- }
- return(didhide);
- }
- /* -------------------------------------------------------------------------- */
-
-