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

  1. /*
  2.     winclear.c    10/30/88
  3.  
  4.     % functions that Clear a window on the display.
  5.  
  6.     Consolidated from other files.
  7.  
  8.     OWL 1.1
  9.     Copyright (c) 1988, by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.      5/01/89 ted    Took out tcol relics.
  15. */
  16.  
  17. #include "oakhead.h"
  18. #include "disppriv.h"
  19. /* -------------------------------------------------------------------------- */
  20.  
  21. /*    Clears all unobscured parts of win. */
  22. void win_Clear(win, color)
  23.     win_type win;
  24.     opixval color;
  25. {
  26.     boolean wasshown;
  27.  
  28.     disp_Cache();
  29.     wasshown = win_HideCursor(win);
  30.  
  31.     win_Expose(win, WINM_CLEAR, (VOID *) &color);
  32.  
  33.     if (wasshown) win_ShowCursor(win);
  34.     disp_Flush();
  35. }
  36. /* -------------------------------------------------------------------------- */
  37.  
  38. void win_ClearPixBox(win, boxp, color)
  39.     win_type win;
  40.     opbox *boxp;
  41.     opixval color;
  42.  
  43. /*    Clears all unobscured parts of win in relbox. */
  44. {
  45.     boolean cursin;
  46.     opbox cursbox;
  47.     boolean wasshown;
  48.  
  49.     win_GetCursorPixBox(win, &cursbox);
  50.     cursin = (opbox_clipbox(boxp, &cursbox) != 0);
  51.  
  52.     if (cursin) {
  53.         disp_Cache();
  54.         wasshown = win_HideCursor(win);
  55.     }
  56.     win_ExposePixBox(win, boxp, WINM_CLEAR, (VOID *) &color);
  57.  
  58.     if (cursin) {
  59.         if (wasshown) win_ShowCursor(win);
  60.         disp_Flush();
  61.     }
  62. }
  63. /* -------------------------------------------------------------------------- */
  64.  
  65. void win_ClearBox(win, cboxp, color)
  66.     win_type win;
  67.     ocbox *cboxp;    /* Clipping coords relative to win */
  68.     opixval color;
  69. {
  70.     opbox box;        /* display coords */
  71.  
  72.     if (win == NULL) return;
  73.  
  74.     ocbox_pixcoords(cboxp, win_GetFont(win), &box);
  75.  
  76.     /* Quit if box is not in window */
  77.     if (!win_clipbox(win, &box)) return;
  78.  
  79.     win_ClearPixBox(win, &box, color);
  80. }
  81. /* -------------------------------------------------------------------------- */
  82.  
  83.