home *** CD-ROM | disk | FTP | other *** search
- /* (c) 1985, Phoenix Computer Products Corp. and Novum Organum, Inc. */
- /***
- * Name: wndstart -- start up the window system
- *
- * Synopsis: int rc, wndstart();
- * rc = wndstart();
- *
- * Description: Starts up the window system.
- *
- * Returns: RC_SUCCESS or RC_FAIL.
- *
- * (C) Novum Organum, Inc. 1985
- *
- ***/
-
- #define char8 unsigned char /* unsigned char */
-
- #include "pdefs.h"
- #include "psys.h"
- #include "pcterm0.h"
-
- static HDL _base, _h_isr;
- static int _been_here=NO;
-
- #define MAXNROWS 25
- #define MAXNCOLS 80
-
- int wndstart(void)
- {
- HDL wndist(), wndsetactv(), syisrist();
- int _wdsp();
- int rc, wndstop(), wint();
-
- rc = RC_FAIL;
-
- if ( _been_here == NO )
- {
- wupdinit();
- wminit(MAXNROWS, MAXNCOLS);
- wintinit();
- _been_here = YES;
- _sywndjmpset ( wndstop );
-
- _base = wndist(0,0,MAXNROWS,MAXNCOLS,vstgetcur());
- if ( _base )
- {
- wndsetactv(_base);
- _h_isr = syisrist( V_VID_INTRPT, wint );
- wndreset();
- _vdspsetdsp( _wdsp );
- rc = RC_SUCCESS;
- }
- else
- wndstop();
- wndsetupd( YES );
- }
- return ( rc );
- }
-
- _wndstarted()
- {
- return(_been_here);
- }
-
- /***
- * Name: wndstop -- shut down window system
- *
- * Synopsis: void wndstop();
- * wndstop();
- *
- * Description: closes up window system
- *
- * Returns: nothing
- *
- * (C) Novum Organum, Inc. 1985
- *
- ***/
-
- /*VOID*/wndstop()
- {
- int _vdsp();
- HDL h_top, _wndtop();
-
- if (_been_here)
- {
- _been_here = NO;
- syisrrls( _h_isr );
- _sywndjmpset ( NULLPFI );
- wndsetupd( NO );
-
- wndtobot(_base);
-
- while ((h_top = _wndtop()))
- wndrls(h_top);
-
- wmdone();
-
- _vdspsetdsp( _vdsp );
- vidsetloc( 23, 0 );
- }
- }
-
- HDL wndhbase()
- {
- return ( _base );
- }
-
-
- static int WND_stat = 0;
-
-
-
- WND_ON(struct pc_term *PTERM)
- {
- int wint(), _wdsp();
-
- if (_been_here == YES)
- {
- PTERM->WINDOW = WND_stat;
- PTERM->TLINIT = 1;
- _h_isr = syisrist( V_VID_INTRPT, wint );
- _vdspsetdsp( _wdsp );
- }
- }
-
-
-
- WND_STP(struct pc_term *PTERM)
- {
- int _vdsp();
-
- if (_been_here == YES && PTERM->TLINIT)
- {
- WND_stat = PTERM->WINDOW;
- PTERM->WINDOW = 0;
- PTERM->TLINIT = 0;
- syisrrls( _h_isr );
- _vdspsetdsp( _vdsp );
- }
- }
-