/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ### File Specific: main-programmer: Benjamin Grauer */ #include "orxonox_gui.h" #include "orxonox_gui_video.h" #include "orxonox_gui_audio.h" #include "orxonox_gui_exec.h" #include "orxonox_gui_flags.h" #include "orxonox_gui_banner.h" #include "orxonox_gui_keys.h" #include "orxonox_gui_update.h" Window* orxonoxGUI; OrxonoxGuiVideo* video; OrxonoxGuiAudio* audio; OrxonoxGuiExec* exec; OrxonoxGuiFlags* flags; OrxonoxGuiBanner* banner; OrxonoxGuiKeys* keys; OrxonoxGuiUpdate* update; int main( int argc, char *argv[] ) { OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv); return 0; } /* ORXONOXGUI */ /** \brief Initializes the Gui */ OrxonoxGui::OrxonoxGui (int argc, char *argv[]) { #ifdef HAVE_GTK2 initGTK(argc, argv); #endif /* HAVE_GTK2 */ orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION); #ifdef HAVE_GTK2 orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit); orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit); #endif /* HAVE_GTK2 */ Box* windowBox = new Box ('h'); banner = new OrxonoxGuiBanner(); windowBox->fill (banner->getWidget()); Box* optionBox = new Box ('v'); Box* avBox = new Box ('h'); video = new OrxonoxGuiVideo (); avBox->fill (video->getWidget ()); audio = new OrxonoxGuiAudio (); avBox->fill (audio->getWidget ()); optionBox->fill (avBox); keys = new OrxonoxGuiKeys (); optionBox->fill (keys->getWidget ()); exec = new OrxonoxGuiExec (orxonoxGUI); optionBox->fill (exec->getWidget ()); flags = new OrxonoxGuiFlags (orxonoxGUI); optionBox->fill (flags->getWidget ()); windowBox->fill (optionBox); update = new OrxonoxGuiUpdate (); optionBox->fill(update->getWidget()); orxonoxGUI->fill (windowBox); flags->setTextFromFlags (orxonoxGUI); exec->setFilename ("~/.orxonox.conf"); exec->readFromFile (orxonoxGUI); // orxonoxGUI->walkThrough(orxonoxGUI->listOptions); orxonoxGUI->showall (); #ifdef HAVE_GTK2 mainloopGTK(); #else /* HAVE_GTK2 */ cout << " Listing all the Orxonox Options: \n"; cout << " #############################\n"; orxonoxGUI->walkThrough(orxonoxGUI->listOptions); cout << "\nDo you want me to save the the above values now? [Yn] "; char c = getchar(); if ((c == 'y' || c == 'Y' || c== 10) && exec->shouldsave()) exec->writeToFile (Window::mainWindow); #endif /* HAVE_GTK2 */ }