[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 | chain all the windows when starting the GUI (DANGER: performance!!) |
---|
| 29 | |
---|
[3161] | 30 | widgets save themselves |
---|
[3147] | 31 | good way to step through all the Widgets |
---|
| 32 | ... many more ... |
---|
[3161] | 33 | label -> protected : getlabel function |
---|
| 34 | |
---|
[2581] | 35 | */ |
---|
[2018] | 36 | #include "orxonox_gui.h" |
---|
| 37 | #include "orxonox_gui_video.h" |
---|
| 38 | #include "orxonox_gui_audio.h" |
---|
| 39 | #include "orxonox_gui_exec.h" |
---|
| 40 | #include "orxonox_gui_flags.h" |
---|
[2580] | 41 | #include "orxonox_gui_banner.h" |
---|
[2613] | 42 | #include "orxonox_gui_keys.h" |
---|
[2018] | 43 | |
---|
| 44 | Window* orxonoxGUI; |
---|
| 45 | OrxonoxGuiVideo* video; |
---|
| 46 | OrxonoxGuiAudio* audio; |
---|
| 47 | OrxonoxGuiExec* exec; |
---|
[2580] | 48 | OrxonoxGuiFlags* flags; |
---|
| 49 | OrxonoxGuiBanner* banner; |
---|
[2613] | 50 | OrxonoxGuiKeys* keys; |
---|
[2018] | 51 | |
---|
| 52 | int main( int argc, char *argv[] ) |
---|
| 53 | { |
---|
| 54 | OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv); |
---|
| 55 | return 0; |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | /* ORXONOXGUI */ |
---|
| 59 | |
---|
[2588] | 60 | /** |
---|
[2623] | 61 | \brief Initializes the Gui |
---|
[2588] | 62 | */ |
---|
[2018] | 63 | OrxonoxGui::OrxonoxGui (int argc, char *argv[]) |
---|
| 64 | { |
---|
[3165] | 65 | #ifdef HAVE_GTK2 |
---|
[3164] | 66 | initGTK(argc, argv); |
---|
[3165] | 67 | #endif |
---|
[2740] | 68 | orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION); |
---|
[3165] | 69 | #ifdef HAVE_GTK2 |
---|
[2018] | 70 | orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit); |
---|
| 71 | orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit); |
---|
[3165] | 72 | #endif /* HAVE_GTK2 */ |
---|
[2018] | 73 | |
---|
[2024] | 74 | Box* windowBox = new Box ('h'); |
---|
| 75 | |
---|
[2580] | 76 | banner = new OrxonoxGuiBanner(); |
---|
[2595] | 77 | windowBox->fill (banner->getWidget()); |
---|
[2580] | 78 | |
---|
[2024] | 79 | Box* optionBox = new Box ('v'); |
---|
[2018] | 80 | |
---|
| 81 | Box* avBox = new Box ('h'); |
---|
| 82 | |
---|
| 83 | video = new OrxonoxGuiVideo (); |
---|
[2595] | 84 | avBox->fill (video->getWidget ()); |
---|
[2018] | 85 | audio = new OrxonoxGuiAudio (); |
---|
[2595] | 86 | avBox->fill (audio->getWidget ()); |
---|
[2018] | 87 | |
---|
[2024] | 88 | optionBox->fill (avBox); |
---|
[2613] | 89 | |
---|
| 90 | keys = new OrxonoxGuiKeys (); |
---|
| 91 | optionBox->fill (keys->getWidget ()); |
---|
| 92 | |
---|
[2018] | 93 | exec = new OrxonoxGuiExec (orxonoxGUI); |
---|
[2595] | 94 | optionBox->fill (exec->getWidget ()); |
---|
[2018] | 95 | |
---|
| 96 | flags = new OrxonoxGuiFlags (orxonoxGUI); |
---|
[2024] | 97 | |
---|
| 98 | |
---|
[2595] | 99 | optionBox->fill (flags->getWidget ()); |
---|
[2024] | 100 | windowBox->fill (optionBox); |
---|
[2018] | 101 | |
---|
| 102 | orxonoxGUI->fill (windowBox); |
---|
| 103 | flags->setTextFromFlags (orxonoxGUI); |
---|
| 104 | |
---|
| 105 | exec->setFilename ("~/.orxonox.conf"); |
---|
| 106 | exec->readFromFile (orxonoxGUI); |
---|
[2584] | 107 | orxonoxGUI->walkThrough(orxonoxGUI->listOptions); |
---|
[2018] | 108 | |
---|
| 109 | orxonoxGUI->showall (); |
---|
| 110 | |
---|
| 111 | |
---|
[3165] | 112 | #ifdef HAVE_GTK2 |
---|
[3164] | 113 | mainloopGTK(); |
---|
[3165] | 114 | #endif |
---|
[2018] | 115 | } |
---|
| 116 | |
---|