home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / WINCURSO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  2.0 KB  |  81 lines

  1. /*
  2.     wincurso.c    10/30/88
  3.  
  4.     % functions control the positon and shape of a window's text cursor.
  5.     Consolidated from other files.
  6.  
  7.     OWL 1.1
  8.     Copyright (c) 1988, by Oakland Group, Inc.
  9.     ALL RIGHTS RESERVED.
  10.  
  11.     Revision History:
  12.     -----------------
  13.      3/24/89 ted    Made macro out of win_GetCursorType.
  14. */
  15. /* -------------------------------------------------------------------------- */
  16. #include "oakhead.h"
  17. #include "disppriv.h"
  18. /* -------------------------------------------------------------------------- */
  19.  
  20. void win_SetPixCursorPos(win, cursx, cursy)
  21.     win_type win;
  22.     opcoord cursx;
  23.     opcoord cursy;
  24. {
  25.     boolean wasshown;
  26.  
  27.     wasshown = win_HideCursor(win);
  28.     win_setcursx(win, cursx);
  29.     win_setcursy(win, cursy);
  30.     if (wasshown) win_ShowCursor(win);
  31. }
  32. /* -------------------------------------------------------------------------- */
  33.  
  34. void win_SetCursorType(win, ctype)
  35.     win_type win;
  36.     cursortype ctype;
  37. {
  38.     boolean wasshown;
  39.  
  40.     wasshown = win_HideCursor(win);
  41.     win_setcurstype(win, ctype);
  42.     if (wasshown) win_ShowCursor(win);
  43. }
  44. /* -------------------------------------------------------------------------- */
  45.  
  46. void win_GetCursorPixBox(win, cursboxp)
  47.     win_type win;
  48.     opbox *cursboxp;
  49. {
  50.     cursboxp->xmin = win_GetCursx(win);
  51.     cursboxp->ymax = win_GetCursy(win);
  52.     cursboxp->xmax = cursboxp->xmin + win_GetFontWidth(win);
  53.     cursboxp->ymin = cursboxp->ymax - win_GetFontHeight(win);
  54. }
  55. /* -------------------------------------------------------------------------- */
  56.  
  57. boolean win_ShowCursor(win)
  58.     win_type win;
  59. {
  60.     boolean didshow;
  61.  
  62.     if (!win_Do(win, WINM_SHOWCURS, win, &didshow)) {
  63.         didshow = FALSE;
  64.     }
  65.     return(didshow);
  66. }
  67. /* -------------------------------------------------------------------------- */
  68.  
  69. boolean win_HideCursor(win)
  70.     win_type win;
  71. {
  72.     boolean didhide;
  73.  
  74.     if (!win_Do(win, WINM_HIDECURS, win, &didhide)) {
  75.         didhide = FALSE;
  76.     }
  77.     return(didhide);
  78. }
  79. /* -------------------------------------------------------------------------- */
  80.  
  81.