void DebugInit( void ) { NestedCallLevel = 0; UpdateFlags = 0; _SwitchOn( SW_ERROR_STARTUP ); _SwitchOn( SW_CHECK_SOURCE_EXISTS ); SET_NIL_ADDR( NilAddr ); TxtBuff = &DbgBuffers[0]; *TxtBuff = '\0'; NameBuff = &DbgBuffers[TXT_LEN+1]; *NameBuff = '\0'; CurrRadix = DefRadix = 10; DbgLevel = MIX; ActiveWindowLevel = MIX; _SwitchOn( SW_BELL ); _SwitchOn( SW_FLIP ); _SwitchOn( SW_RECURSE_CHECK ); _SwitchOff( SW_ADDING_SYMFILE ); _SwitchOff( SW_TASK_RUNNING ); RecordInit(); LogInit(); InitMADInfo(); InitMachState(); PathInit(); InitDbgInfo(); InitTrap( TrapParms ); if( !LangSetInit() ) { FiniTrap(); StartupErr( LIT_ENG( STARTUP_Loading_PRS ) ); } if( !InitCmd() ) { FiniTrap(); StartupErr( LIT_ENG( ERR_NO_MEMORY ) ); } InitScan(); InitLook(); InitBPs(); InitSource(); InitDLLList(); DUIInit(); InitHook(); VarDisplayInit(); }
/*********************************************************************** * Procedure: * Setup Screen - main function ************************************************************************/ void SetupScreen() { Scr.Look.magic = MAGIC_MYLOOK ; InitLook(&Scr.Look, False); InitFeel(&Scr.Feel, False); Scr.Vx = Scr.Vy = 0; Scr.CurrentDesk = 0; Scr.randomx = Scr.randomy = 0; Scr.RootCanvas = create_ascanvas_container( Scr.Root ); SetupColormaps(); CreateCursors (); CreateManagementWindows(); Scr.Windows = init_aswindow_list(); XSelectInput (dpy, Scr.Root, AS_ROOT_EVENT_MASK); MenuBalloons = create_balloon_state(); TitlebarBalloons = create_balloon_state(); }
void CleanupScreen() { int i ; if( Scr.Windows ) { grab_server(); destroy_aswindow_list( &(Scr.Windows), True ); ungrab_server(); } destroy_balloon_state(&TitlebarBalloons); destroy_balloon_state(&MenuBalloons); release_all_old_background( True ); DestroyManagementWindows(); CleanupColormaps(); if( Scr.RootCanvas ) destroy_ascanvas( &(Scr.RootCanvas) ); XSetInputFocus (dpy, PointerRoot, RevertToPointerRoot, CurrentTime); XSync (dpy, 0); #ifdef HAVE_XINERAMA if (Scr.xinerama_screens) { free (Scr.xinerama_screens); Scr.xinerama_screens_num = 0; Scr.xinerama_screens = NULL; } #endif /* XINERAMA */ for( i = 0 ; i < MAX_CURSORS; ++i ) if( Scr.standard_cursors[i] ) { XFreeCursor( dpy, Scr.standard_cursors[i] ); Scr.standard_cursors[i] = None ; } InitLook(&Scr.Look, True); InitFeel(&Scr.Feel, True); /* free display strings; can't do this in main(), because some OS's * don't copy the environment variables properly */ if( Scr.display_string ) { free (Scr.display_string); Scr.display_string = NULL ; } if( Scr.rdisplay_string ) { free (Scr.rdisplay_string); Scr.rdisplay_string = NULL ; } if( Scr.RootBackground ) { if( Scr.RootBackground->pmap ) { if( Scr.wmprops->root_pixmap == Scr.RootBackground->pmap ) { set_xrootpmap_id (Scr.wmprops, None ); set_as_background(Scr.wmprops, None ); } XFreePixmap( dpy, Scr.RootBackground->pmap ); ASSync(False); LOCAL_DEBUG_OUT( "root pixmap with id %lX destroyed", Scr.RootBackground->pmap ); Scr.RootBackground->pmap = None ; } free( Scr.RootBackground ); } LOCAL_DEBUG_OUT("destroying image manager : %p", Scr.image_manager); destroy_image_manager( Scr.image_manager, False ); LOCAL_DEBUG_OUT("destroying font manager : %p", Scr.font_manager); destroy_font_manager( Scr.font_manager, False ); LOCAL_DEBUG_OUT("destroying visual : %p", Scr.asv); destroy_screen_gcs(ASDefaultScr); destroy_asvisual( Scr.asv, False ); LOCAL_DEBUG_OUT("selecting input mask for Root window to 0 : %s",""); /* Must release SubstructureRedirectMask prior to releasing wm selection in * destroy_wmprops() : */ XSelectInput( dpy, Scr.Root, 0 ); XUngrabPointer( dpy, CurrentTime ); XUngrabButton (dpy, AnyButton, AnyModifier, Scr.Root); LOCAL_DEBUG_OUT("destroying wmprops : %p",Scr.wmprops); /* this must be done at the very end !!!! */ destroy_wmprops( Scr.wmprops, False); LOCAL_DEBUG_OUT("screen cleanup complete.%s",""); }