| [2581] | 1 | /*  | 
|---|
 | 2 |    orxonox - the future of 3D-vertical-scrollers | 
|---|
 | 3 |  | 
|---|
 | 4 |    Copyright (C) 2004 orx | 
|---|
 | 5 |  | 
|---|
 | 6 |    This program is free software; you can redistribute it and/or modify | 
|---|
 | 7 |    it under the terms of the GNU General Public License as published by | 
|---|
 | 8 |    the Free Software Foundation; either version 2, or (at your option) | 
|---|
 | 9 |    any later version. | 
|---|
 | 10 |  | 
|---|
 | 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. | 
|---|
 | 15 |  | 
|---|
 | 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 Foundation, | 
|---|
 | 18 |    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.   | 
|---|
 | 19 |  | 
|---|
 | 20 |  | 
|---|
 | 21 |    ### File Specific: | 
|---|
 | 22 |    main-programmer: Benjamin Grauer | 
|---|
 | 23 |  | 
|---|
| [3147] | 24 |    ToDO:  | 
|---|
 | 25 |    way to start gui without GTK (textmode) | 
|---|
 | 26 |    curl interface to Download cool stuff | 
|---|
 | 27 |  | 
|---|
 | 28 |    make Windows grab Focus if it is open and release it when closed (only child-windows) | 
|---|
 | 29 |    chain all the windows when starting the GUI (DANGER: performance!!) | 
|---|
 | 30 |  | 
|---|
 | 31 |    widgets save themselve | 
|---|
 | 32 |    good way to step through all the Widgets | 
|---|
 | 33 |    ... many more ... | 
|---|
| [2581] | 34 | */ | 
|---|
 | 35 |  | 
|---|
| [3147] | 36 | #include <gtk/gtkmain.h> | 
|---|
| [2018] | 37 |  | 
|---|
 | 38 | #include "orxonox_gui.h" | 
|---|
 | 39 | #include "orxonox_gui_video.h" | 
|---|
 | 40 | #include "orxonox_gui_audio.h" | 
|---|
 | 41 | #include "orxonox_gui_exec.h" | 
|---|
 | 42 | #include "orxonox_gui_flags.h" | 
|---|
| [2580] | 43 | #include "orxonox_gui_banner.h" | 
|---|
| [2613] | 44 | #include "orxonox_gui_keys.h" | 
|---|
| [2018] | 45 |  | 
|---|
 | 46 |   Window* orxonoxGUI; | 
|---|
 | 47 |   OrxonoxGuiVideo* video; | 
|---|
 | 48 |   OrxonoxGuiAudio* audio; | 
|---|
 | 49 |   OrxonoxGuiExec* exec; | 
|---|
| [2580] | 50 |   OrxonoxGuiFlags* flags; | 
|---|
 | 51 |   OrxonoxGuiBanner* banner; | 
|---|
| [2613] | 52 |   OrxonoxGuiKeys* keys; | 
|---|
| [2018] | 53 |  | 
|---|
 | 54 | int main( int argc, char *argv[] ) | 
|---|
 | 55 | { | 
|---|
 | 56 |   OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv); | 
|---|
 | 57 |   return 0; | 
|---|
 | 58 | } | 
|---|
 | 59 |  | 
|---|
 | 60 | /* ORXONOXGUI */ | 
|---|
 | 61 |  | 
|---|
| [2588] | 62 | /** | 
|---|
| [2623] | 63 |    \brief Initializes the Gui | 
|---|
| [2588] | 64 | */ | 
|---|
| [2018] | 65 | OrxonoxGui::OrxonoxGui (int argc, char *argv[]) | 
|---|
 | 66 | { | 
|---|
| [3147] | 67 |    | 
|---|
| [2018] | 68 |   gtk_init (&argc, &argv); | 
|---|
 | 69 |   gtk_rc_parse( "rc" ); | 
|---|
 | 70 |    | 
|---|
| [2740] | 71 |   orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION); | 
|---|
| [2018] | 72 |   orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit); | 
|---|
 | 73 |   orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit); | 
|---|
 | 74 |    | 
|---|
| [2024] | 75 |   Box* windowBox = new Box ('h'); | 
|---|
 | 76 |  | 
|---|
| [2580] | 77 |   banner = new OrxonoxGuiBanner(); | 
|---|
| [2595] | 78 |   windowBox->fill (banner->getWidget()); | 
|---|
| [2580] | 79 |    | 
|---|
| [2024] | 80 |   Box* optionBox = new Box ('v'); | 
|---|
| [2018] | 81 |    | 
|---|
 | 82 |   Box* avBox = new Box ('h'); | 
|---|
 | 83 |  | 
|---|
 | 84 |   video = new OrxonoxGuiVideo (); | 
|---|
| [2595] | 85 |   avBox->fill (video->getWidget ()); | 
|---|
| [2018] | 86 |   audio = new OrxonoxGuiAudio (); | 
|---|
| [2595] | 87 |   avBox->fill (audio->getWidget ()); | 
|---|
| [2018] | 88 |        | 
|---|
| [2024] | 89 |   optionBox->fill (avBox); | 
|---|
| [2613] | 90 |  | 
|---|
 | 91 |   keys = new OrxonoxGuiKeys (); | 
|---|
 | 92 |   optionBox->fill (keys->getWidget ()); | 
|---|
 | 93 |  | 
|---|
| [2018] | 94 |   exec = new OrxonoxGuiExec (orxonoxGUI); | 
|---|
| [2595] | 95 |   optionBox->fill (exec->getWidget ()); | 
|---|
| [2018] | 96 |  | 
|---|
 | 97 |   flags = new OrxonoxGuiFlags (orxonoxGUI); | 
|---|
| [2024] | 98 |  | 
|---|
 | 99 |  | 
|---|
| [2595] | 100 |   optionBox->fill (flags->getWidget ()); | 
|---|
| [2024] | 101 |   windowBox->fill (optionBox); | 
|---|
| [2018] | 102 |    | 
|---|
 | 103 |   orxonoxGUI->fill (windowBox); | 
|---|
 | 104 |   flags->setTextFromFlags (orxonoxGUI); | 
|---|
 | 105 |  | 
|---|
 | 106 |   exec->setFilename ("~/.orxonox.conf"); | 
|---|
 | 107 |   exec->readFromFile (orxonoxGUI); | 
|---|
| [2584] | 108 |   orxonoxGUI->walkThrough(orxonoxGUI->listOptions); | 
|---|
| [2018] | 109 |  | 
|---|
 | 110 |   orxonoxGUI->showall (); | 
|---|
 | 111 |  | 
|---|
 | 112 |    | 
|---|
 | 113 |   gtk_main(); | 
|---|
 | 114 | } | 
|---|
 | 115 |  | 
|---|