Rebuild autotool system
[construo.git] / screen_manager.cxx
blob7ecbec4c95cbbbd58fe0471320e2d19e583c5e29
1 // $Id: screen_manager.cxx,v 1.3 2003/01/11 19:07:48 grumbel Exp $
2 //
3 // Construo - A wire-frame construction gamee
4 // Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #include "load_gui_manager.hxx"
21 #include "save_gui_manager.hxx"
22 #include "world_gui_manager.hxx"
23 #include "screen_manager.hxx"
25 ScreenManager* ScreenManager::instance_ = 0;
27 ScreenManager::ScreenManager ()
28 : do_quit(false)
30 load_gui_manager = new LoadGUIManager();
31 save_gui_manager = new SaveGUIManager();
32 world_gui_manager = new WorldGUIManager();
34 current_gui_manager = world_gui_manager;
37 void
38 ScreenManager::run_once ()
40 current_gui_manager->run_once ();
43 bool
44 ScreenManager::is_finished ()
46 return do_quit;
49 void
50 ScreenManager::quit()
52 do_quit = true;
55 void
56 ScreenManager::set_gui (int gui_id)
58 switch (gui_id)
60 case WORLD_GUI:
61 current_gui_manager = world_gui_manager;
62 break;
63 case LOAD_GUI:
64 current_gui_manager = load_gui_manager;
65 break;
66 case SAVE_GUI:
67 current_gui_manager = save_gui_manager;
68 break;
72 ScreenManager*
73 ScreenManager::instance ()
75 if (instance_ == 0)
76 return (instance_ = new ScreenManager ());
77 else
78 return instance_;
81 /* EOF */