home *** CD-ROM | disk | FTP | other *** search
- /*
- winclear.c 10/30/88
-
- % functions that Clear a window on the display.
-
- Consolidated from other files.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 5/01/89 ted Took out tcol relics.
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- /* -------------------------------------------------------------------------- */
-
- /* Clears all unobscured parts of win. */
- void win_Clear(win, color)
- win_type win;
- opixval color;
- {
- boolean wasshown;
-
- disp_Cache();
- wasshown = win_HideCursor(win);
-
- win_Expose(win, WINM_CLEAR, (VOID *) &color);
-
- if (wasshown) win_ShowCursor(win);
- disp_Flush();
- }
- /* -------------------------------------------------------------------------- */
-
- void win_ClearPixBox(win, boxp, color)
- win_type win;
- opbox *boxp;
- opixval color;
-
- /* Clears all unobscured parts of win in relbox. */
- {
- boolean cursin;
- opbox cursbox;
- boolean wasshown;
-
- win_GetCursorPixBox(win, &cursbox);
- cursin = (opbox_clipbox(boxp, &cursbox) != 0);
-
- if (cursin) {
- disp_Cache();
- wasshown = win_HideCursor(win);
- }
- win_ExposePixBox(win, boxp, WINM_CLEAR, (VOID *) &color);
-
- if (cursin) {
- if (wasshown) win_ShowCursor(win);
- disp_Flush();
- }
- }
- /* -------------------------------------------------------------------------- */
-
- void win_ClearBox(win, cboxp, color)
- win_type win;
- ocbox *cboxp; /* Clipping coords relative to win */
- opixval color;
- {
- opbox box; /* display coords */
-
- if (win == NULL) return;
-
- ocbox_pixcoords(cboxp, win_GetFont(win), &box);
-
- /* Quit if box is not in window */
- if (!win_clipbox(win, &box)) return;
-
- win_ClearPixBox(win, &box, color);
- }
- /* -------------------------------------------------------------------------- */
-
-