home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / DISPREIN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-07  |  1.3 KB  |  61 lines

  1. /*
  2.     disprein.c
  3.  
  4.     % Display manager change-horses-in-midstream swapper.
  5.  
  6.     8/12/89  by Ted.
  7.  
  8.     OWL 1.2
  9.     Copyright (c) 1988, 1989 by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.      3/28/90 jmd    ansi-fied
  15.      3/29/90 ted    Added win_Hide/ShowCursor to make cursor show afer reinit.
  16. */
  17. #include "oakhead.h"
  18. #include "disppriv.h"
  19.  
  20. /* -------------------------------------------------------------------------- */
  21.  
  22. boolean disp_ReInit(dmode_fptr dmode)
  23. /*
  24.     Change display manager without changing windows or window manager.
  25. */
  26. {
  27.     boolean mouseon;
  28.     boolean curson;
  29.  
  30.     mouseon = hard_IsMouseOn();
  31.     if (mouseon) hard_DeinitMouse();
  32.  
  33.     curson = win_HideCursor(disp_GetCurrentWin());
  34.  
  35.     /* Close fonts for all windows */
  36.  
  37.     /* Go back to initial mode so that new dmgr will have correct 'oldmode' */
  38.     disp_RestoreMode();
  39.  
  40.     /* Close down current DIG */
  41.     disp_CloseDIG();
  42.  
  43.     /* Initialize a new display manager and DIG. */
  44.     if (!dispsetup(dmode)) {
  45.         return(FALSE);
  46.     }
  47.  
  48.     /* Restore fonts for all windows */
  49.  
  50.     win_SetPixSize(disp_GetDispWin(), disp_GetPixWidth(), disp_GetPixHeight());
  51.  
  52.     disp_Repaint();
  53.  
  54.     if (curson)  win_ShowCursor(disp_GetCurrentWin());
  55.     if (mouseon) hard_InitMouse();
  56.  
  57.     return(TRUE);
  58. }
  59. /* -------------------------------------------------------------------------- */
  60.  
  61.