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