[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 | |
---|
| 24 | */ |
---|
| 25 | |
---|
[2018] | 26 | #include <iostream.h> |
---|
| 27 | |
---|
| 28 | #include "orxonox_gui.h" |
---|
| 29 | #include "orxonox_gui_video.h" |
---|
| 30 | #include "orxonox_gui_audio.h" |
---|
| 31 | #include "orxonox_gui_exec.h" |
---|
| 32 | #include "orxonox_gui_flags.h" |
---|
[2580] | 33 | #include "orxonox_gui_banner.h" |
---|
[2613] | 34 | #include "orxonox_gui_keys.h" |
---|
[2018] | 35 | |
---|
| 36 | Window* orxonoxGUI; |
---|
| 37 | OrxonoxGuiVideo* video; |
---|
| 38 | OrxonoxGuiAudio* audio; |
---|
| 39 | OrxonoxGuiExec* exec; |
---|
[2580] | 40 | OrxonoxGuiFlags* flags; |
---|
| 41 | OrxonoxGuiBanner* banner; |
---|
[2613] | 42 | OrxonoxGuiKeys* keys; |
---|
[2018] | 43 | |
---|
| 44 | int main( int argc, char *argv[] ) |
---|
| 45 | { |
---|
[2740] | 46 | Window::lastWindow = NULL; |
---|
[2018] | 47 | OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv); |
---|
| 48 | return 0; |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | /* ORXONOXGUI */ |
---|
| 52 | |
---|
[2588] | 53 | /** |
---|
[2623] | 54 | \brief Initializes the Gui |
---|
[2588] | 55 | */ |
---|
[2018] | 56 | OrxonoxGui::OrxonoxGui (int argc, char *argv[]) |
---|
| 57 | { |
---|
| 58 | gtk_init (&argc, &argv); |
---|
| 59 | gtk_rc_parse( "rc" ); |
---|
| 60 | |
---|
[2740] | 61 | orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION); |
---|
[2018] | 62 | orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit); |
---|
| 63 | orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit); |
---|
| 64 | |
---|
[2024] | 65 | Box* windowBox = new Box ('h'); |
---|
| 66 | |
---|
[2580] | 67 | banner = new OrxonoxGuiBanner(); |
---|
[2595] | 68 | windowBox->fill (banner->getWidget()); |
---|
[2580] | 69 | |
---|
[2024] | 70 | Box* optionBox = new Box ('v'); |
---|
[2018] | 71 | |
---|
| 72 | Box* avBox = new Box ('h'); |
---|
| 73 | |
---|
| 74 | video = new OrxonoxGuiVideo (); |
---|
[2595] | 75 | avBox->fill (video->getWidget ()); |
---|
[2018] | 76 | audio = new OrxonoxGuiAudio (); |
---|
[2595] | 77 | avBox->fill (audio->getWidget ()); |
---|
[2018] | 78 | |
---|
[2024] | 79 | optionBox->fill (avBox); |
---|
[2613] | 80 | |
---|
| 81 | keys = new OrxonoxGuiKeys (); |
---|
| 82 | optionBox->fill (keys->getWidget ()); |
---|
| 83 | |
---|
[2018] | 84 | exec = new OrxonoxGuiExec (orxonoxGUI); |
---|
[2595] | 85 | optionBox->fill (exec->getWidget ()); |
---|
[2018] | 86 | |
---|
| 87 | flags = new OrxonoxGuiFlags (orxonoxGUI); |
---|
[2024] | 88 | |
---|
| 89 | |
---|
[2595] | 90 | optionBox->fill (flags->getWidget ()); |
---|
[2024] | 91 | windowBox->fill (optionBox); |
---|
[2018] | 92 | |
---|
| 93 | orxonoxGUI->fill (windowBox); |
---|
| 94 | flags->setTextFromFlags (orxonoxGUI); |
---|
| 95 | |
---|
| 96 | exec->setFilename ("~/.orxonox.conf"); |
---|
| 97 | exec->readFromFile (orxonoxGUI); |
---|
[2584] | 98 | orxonoxGUI->walkThrough(orxonoxGUI->listOptions); |
---|
[2018] | 99 | |
---|
| 100 | orxonoxGUI->showall (); |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | gtk_main(); |
---|
| 104 | } |
---|
| 105 | |
---|