00001 #ifndef PERIAPSIS_MAIN_WINDOW_H 00002 #define PERIAPSIS_MAIN_WINDOW_H 00003 00004 // 00005 // $Id: main_window.hpp 2 2008-03-01 20:58:50Z kulibali $ 00006 // 00007 // Copyright (c) 2008, The Periapsis Project. All rights reserved. 00008 // 00009 // Redistribution and use in source and binary forms, with or without 00010 // modification, are permitted provided that the following conditions are 00011 // met: 00012 // 00013 // * Redistributions of source code must retain the above copyright notice, 00014 // this list of conditions and the following disclaimer. 00015 // 00016 // * Redistributions in binary form must reproduce the above copyright 00017 // notice, this list of conditions and the following disclaimer in the 00018 // documentation and/or other materials provided with the distribution. 00019 // 00020 // * Neither the name of the The Periapsis Project nor the names of its 00021 // contributors may be used to endorse or promote products derived from 00022 // this software without specific prior written permission. 00023 // 00024 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 00025 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 00026 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00027 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 00028 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00029 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00030 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00031 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00032 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00033 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00034 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 // 00036 00037 #include "data/singleton.hpp" 00038 #include "data/string.hpp" 00039 #include "data/config.hpp" 00040 #include "framework/widget.hpp" 00041 00042 namespace gsgl 00043 { 00044 namespace framework 00045 { 00046 class textbox; 00047 class button; 00048 class tabbox; 00049 } 00050 } 00051 00052 00053 namespace periapsis 00054 { 00055 00056 class periapsis_app; 00057 class simulation_tab; 00058 class settings_tab; 00059 00060 class load_scenery_thread; 00061 00062 00063 class main_window 00064 : public gsgl::framework::widget, public gsgl::data::singleton<main_window> 00065 { 00066 gsgl::framework::textbox *title_box, *status_bar; 00067 gsgl::framework::button *quit_button; 00068 gsgl::framework::tabbox *tab_box; 00069 simulation_tab *sim_tab; 00070 settings_tab *set_tab; 00071 00072 bool need_to_load_scenery; 00073 load_scenery_thread *loading_thread; 00074 00075 public: 00076 main_window(const gsgl::string & title, const int x, const int y); 00077 virtual ~main_window(); 00078 00079 // 00080 void set_status(const gsgl::string & message); 00081 00082 // 00083 virtual void draw(); 00084 00085 // 00086 00087 static gsgl::data::config_variable<int> WIDTH; 00088 static gsgl::data::config_variable<int> HEIGHT; 00089 static gsgl::data::config_variable<gsgl::platform::color> FOREGROUND; 00090 static gsgl::data::config_variable<gsgl::platform::color> BACKGROUND; 00091 static gsgl::data::config_variable<gsgl::string> FONT_FACE; 00092 static gsgl::data::config_variable<int> FONT_SIZE; 00093 00094 static gsgl::data::config_variable<int> TITLE_BOX_HEIGHT; 00095 static gsgl::data::config_variable<int> STATUS_BAR_HEIGHT; 00096 static gsgl::data::config_variable<int> TAB_BOX_SPACE; 00097 static gsgl::data::config_variable<int> QUIT_BUTTON_WIDTH; 00098 }; // class main_window 00099 00100 } // namespace periapsis 00101 00102 #endif