Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2707 in orxonox.OLD for orxonox/branches/buerli/gui


Ignore:
Timestamp:
Nov 3, 2004, 12:29:03 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/buerli: merged back from trunk, with new configure makefile and so forth.

Location:
orxonox/branches/buerli/gui
Files:
10 edited
2 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/buerli/gui/Makefile.am

    r2589 r2707  
    33
    44bin_PROGRAMS=gui
    5 gui_SOURCES=orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc orxonox_gui_banner.cc
     5gui_SOURCES=orxonox_gui.cc orxonox_gui_video.cc orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc orxonox_gui_banner.cc orxonox_gui_keys.cc
    66
    7 noinst_HEADERS=orxonox_gui.h orxonox_gui_video.h orxonox_gui_audio.h orxonox_gui_exec.h orxonox_gui_flags.h orxonox_gui_banner.h
     7noinst_HEADERS=orxonox_gui.h orxonox_gui_video.h orxonox_gui_audio.h orxonox_gui_exec.h orxonox_gui_flags.h orxonox_gui_banner.h orxonox_gui_keys.h
    88
    99#  uncomment the following if bencoder requires the math library
  • orxonox/branches/buerli/gui/Makefile.in

    r2617 r2707  
    1 # Makefile.in generated by automake 1.7.1 from Makefile.am.
     1# Makefile.in generated by automake 1.8.5 from Makefile.am.
    22# @configure_input@
    33
    4 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    5 # Free Software Foundation, Inc.
     4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5# 2003, 2004  Free Software Foundation, Inc.
    66# This Makefile.in is free software; the Free Software Foundation
    77# gives unlimited permission to copy and/or distribute it,
     
    1414
    1515@SET_MAKE@
     16
     17
     18SOURCES = $(gui_SOURCES)
    1619
    1720srcdir = @srcdir@
     
    2225pkgincludedir = $(includedir)/@PACKAGE@
    2326top_builddir = ..
    24 
    2527am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    2628INSTALL = @INSTALL@
     
    3638PRE_UNINSTALL = :
    3739POST_UNINSTALL = :
     40bin_PROGRAMS = gui$(EXEEXT)
     41subdir = gui
     42DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
     43        $(srcdir)/Makefile.in
     44ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     45am__aclocal_m4_deps = $(top_srcdir)/configure.ac
     46am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
     47        $(ACLOCAL_M4)
     48mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
     49CONFIG_HEADER = $(top_builddir)/config.h
     50CONFIG_CLEAN_FILES =
     51am__installdirs = "$(DESTDIR)$(bindir)"
     52binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
     53PROGRAMS = $(bin_PROGRAMS)
     54am_gui_OBJECTS = orxonox_gui.$(OBJEXT) orxonox_gui_video.$(OBJEXT) \
     55        orxonox_gui_audio.$(OBJEXT) orxonox_gui_exec.$(OBJEXT) \
     56        orxonox_gui_flags.$(OBJEXT) orxonox_gui_banner.$(OBJEXT) \
     57        orxonox_gui_keys.$(OBJEXT)
     58gui_OBJECTS = $(am_gui_OBJECTS)
     59gui_LDADD = $(LDADD)
     60DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
     61depcomp = $(SHELL) $(top_srcdir)/depcomp
     62am__depfiles_maybe = depfiles
     63@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/orxonox_gui.Po \
     64@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_audio.Po \
     65@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_banner.Po \
     66@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_exec.Po \
     67@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_flags.Po \
     68@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_keys.Po \
     69@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_video.Po
     70CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
     71        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     72CXXLD = $(CXX)
     73CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
     74        -o $@
     75SOURCES = $(gui_SOURCES)
     76DIST_SOURCES = $(gui_SOURCES)
     77HEADERS = $(noinst_HEADERS)
     78ETAGS = etags
     79CTAGS = ctags
     80DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    3881ACLOCAL = @ACLOCAL@
    3982AMDEP_FALSE = @AMDEP_FALSE@
     
    90133am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
    91134am__include = @am__include@
     135am__leading_dot = @am__leading_dot@
    92136am__quote = @am__quote@
    93137bindir = @bindir@
     
    103147localstatedir = @localstatedir@
    104148mandir = @mandir@
     149mkdir_p = @mkdir_p@
    105150oldincludedir = @oldincludedir@
    106151prefix = @prefix@
     
    111156target_alias = @target_alias@
    112157AM_CXXFLAGS = `pkg-config --cflags gtk+-2.0` $(MSBITFIELDS)
    113 
    114 #AM_LDFLAGS=`pkg-config --libs  gtk+-2.0`
    115 bin_PROGRAMS = gui
    116 gui_SOURCES = orxonox_gui.cc orxonox_gui_video.cc       orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc orxonox_gui_banner.cc
    117 
    118 noinst_HEADERS = orxonox_gui.h orxonox_gui_video.h orxonox_gui_audio.h orxonox_gui_exec.h orxonox_gui_flags.h orxonox_gui_banner.h
     158gui_SOURCES = orxonox_gui.cc orxonox_gui_video.cc       orxonox_gui_audio.cc orxonox_gui_exec.cc orxonox_gui_flags.cc orxonox_gui_banner.cc orxonox_gui_keys.cc
     159noinst_HEADERS = orxonox_gui.h orxonox_gui_video.h orxonox_gui_audio.h orxonox_gui_exec.h orxonox_gui_flags.h orxonox_gui_banner.h orxonox_gui_keys.h
    119160
    120161#  uncomment the following if bencoder requires the math library
     
    127168#TESTS=chk
    128169EXTRA_DIST = rc banner.xpm
    129 subdir = gui
    130 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
    131 CONFIG_HEADER = $(top_builddir)/config.h
    132 CONFIG_CLEAN_FILES =
    133 bin_PROGRAMS = gui$(EXEEXT)
    134 PROGRAMS = $(bin_PROGRAMS)
    135 
    136 am_gui_OBJECTS = orxonox_gui.$(OBJEXT) orxonox_gui_video.$(OBJEXT) \
    137         orxonox_gui_audio.$(OBJEXT) orxonox_gui_exec.$(OBJEXT) \
    138         orxonox_gui_flags.$(OBJEXT) orxonox_gui_banner.$(OBJEXT)
    139 gui_OBJECTS = $(am_gui_OBJECTS)
    140 gui_LDADD = $(LDADD)
    141 gui_DEPENDENCIES =
    142 gui_LDFLAGS =
    143 
    144 DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
    145 depcomp = $(SHELL) $(top_srcdir)/depcomp
    146 am__depfiles_maybe = depfiles
    147 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/orxonox_gui.Po \
    148 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_audio.Po \
    149 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_banner.Po \
    150 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_exec.Po \
    151 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_flags.Po \
    152 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_video.Po
    153 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    154         $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
    155 CXXLD = $(CXX)
    156 CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
    157         -o $@
    158 DIST_SOURCES = $(gui_SOURCES)
    159 HEADERS = $(noinst_HEADERS)
    160 
    161 DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in
    162 SOURCES = $(gui_SOURCES)
    163 
    164170all: all-am
    165171
    166172.SUFFIXES:
    167173.SUFFIXES: .cc .o .obj
    168 $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
     174$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
     175        @for dep in $?; do \
     176          case '$(am__configure_deps)' in \
     177            *$$dep*) \
     178              cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
     179                && exit 0; \
     180              exit 1;; \
     181          esac; \
     182        done; \
     183        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  gui/Makefile'; \
    169184        cd $(top_srcdir) && \
    170185          $(AUTOMAKE) --gnu  gui/Makefile
    171 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
    172         cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
    173 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
     186.PRECIOUS: Makefile
     187Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     188        @case '$?' in \
     189          *config.status*) \
     190            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
     191          *) \
     192            echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
     193            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
     194        esac;
     195
     196$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
     197        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
     198
     199$(top_srcdir)/configure:  $(am__configure_deps)
     200        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
     201$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
     202        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
    174203install-binPROGRAMS: $(bin_PROGRAMS)
    175204        @$(NORMAL_INSTALL)
    176         $(mkinstalldirs) $(DESTDIR)$(bindir)
     205        test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
    177206        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    178207          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
     
    180209          ; then \
    181210            f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
    182            echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
    183            $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
     211           echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
     212           $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
    184213          else :; fi; \
    185214        done
     
    189218        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    190219          f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
    191           echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
    192           rm -f $(DESTDIR)$(bindir)/$$f; \
     220          echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
     221          rm -f "$(DESTDIR)$(bindir)/$$f"; \
    193222        done
    194223
     
    200229
    201230mostlyclean-compile:
    202         -rm -f *.$(OBJEXT) core *.core
     231        -rm -f *.$(OBJEXT)
    203232
    204233distclean-compile:
     
    210239@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_exec.Po@am__quote@
    211240@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_flags.Po@am__quote@
     241@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_keys.Po@am__quote@
    212242@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_video.Po@am__quote@
    213243
    214 distclean-depend:
    215         -rm -rf ./$(DEPDIR)
    216 
    217244.cc.o:
    218 @am__fastdepCXX_TRUE@   if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
    219 @am__fastdepCXX_TRUE@     -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
    220 @am__fastdepCXX_TRUE@   then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
    221 @am__fastdepCXX_TRUE@   else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
    222 @am__fastdepCXX_TRUE@   fi
     245@am__fastdepCXX_TRUE@   if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
     246@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
    223247@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
    224248@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
    225249@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    226 @am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
     250@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ $<
    227251
    228252.cc.obj:
    229 @am__fastdepCXX_TRUE@   if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
    230 @am__fastdepCXX_TRUE@     -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \
    231 @am__fastdepCXX_TRUE@   then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
    232 @am__fastdepCXX_TRUE@   else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
    233 @am__fastdepCXX_TRUE@   fi
     253@am__fastdepCXX_TRUE@   if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
     254@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
    234255@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
    235256@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
    236257@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    237 @am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`
     258@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
    238259uninstall-info-am:
    239 
    240 ETAGS = etags
    241 ETAGSFLAGS =
    242 
    243 CTAGS = ctags
    244 CTAGSFLAGS =
    245 
    246 tags: TAGS
    247260
    248261ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
     
    254267               END { for (i in files) print i; }'`; \
    255268        mkid -fID $$unique
     269tags: TAGS
    256270
    257271TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
     
    265279          $(AWK) '    { files[$$0] = 1; } \
    266280               END { for (i in files) print i; }'`; \
    267         test -z "$(ETAGS_ARGS)$$tags$$unique" \
    268           || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    269              $$tags $$unique
    270 
     281        if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
     282          test -n "$$unique" || unique=$$empty_fix; \
     283          $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
     284            $$tags $$unique; \
     285        fi
    271286ctags: CTAGS
    272287CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
     
    291306distclean-tags:
    292307        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
    293 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    294 
    295 top_distdir = ..
    296 distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
    297308
    298309distdir: $(DISTFILES)
     
    308319          if test "$$dir" != "$$file" && test "$$dir" != "."; then \
    309320            dir="/$$dir"; \
    310             $(mkinstalldirs) "$(distdir)$$dir"; \
     321            $(mkdir_p) "$(distdir)$$dir"; \
    311322          else \
    312323            dir=''; \
     
    326337check: check-am
    327338all-am: Makefile $(PROGRAMS) $(HEADERS)
    328 
    329339installdirs:
    330         $(mkinstalldirs) $(DESTDIR)$(bindir)
    331 
     340        for dir in "$(DESTDIR)$(bindir)"; do \
     341          test -z "$$dir" || $(mkdir_p) "$$dir"; \
     342        done
    332343install: install-am
    333344install-exec: install-exec-am
     
    341352install-strip:
    342353        $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
    343           INSTALL_STRIP_FLAG=-s \
     354          install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
    344355          `test -z '$(STRIP)' || \
    345356            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
     
    349360
    350361distclean-generic:
    351         -rm -f Makefile $(CONFIG_CLEAN_FILES)
     362        -rm -f $(CONFIG_CLEAN_FILES)
    352363
    353364maintainer-clean-generic:
     
    359370
    360371distclean: distclean-am
    361 
    362 distclean-am: clean-am distclean-compile distclean-depend \
    363         distclean-generic distclean-tags
     372        -rm -rf ./$(DEPDIR)
     373        -rm -f Makefile
     374distclean-am: clean-am distclean-compile distclean-generic \
     375        distclean-tags
    364376
    365377dvi: dvi-am
     
    367379dvi-am:
    368380
     381html: html-am
     382
    369383info: info-am
    370384
     
    382396
    383397maintainer-clean: maintainer-clean-am
    384 
     398        -rm -rf ./$(DEPDIR)
     399        -rm -f Makefile
    385400maintainer-clean-am: distclean-am maintainer-clean-generic
    386401
     
    401416.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
    402417        clean-generic ctags distclean distclean-compile \
    403         distclean-depend distclean-generic distclean-tags distdir dvi \
    404         dvi-am info info-am install install-am install-binPROGRAMS \
     418        distclean-generic distclean-tags distdir dvi dvi-am html \
     419        html-am info info-am install install-am install-binPROGRAMS \
    405420        install-data install-data-am install-exec install-exec-am \
    406421        install-info install-info-am install-man install-strip \
  • orxonox/branches/buerli/gui/orxonox_gui.cc

    r2595 r2707  
    3232#include "orxonox_gui_flags.h"
    3333#include "orxonox_gui_banner.h"
     34#include "orxonox_gui_keys.h"
    3435
    3536  Window* orxonoxGUI;
     
    3940  OrxonoxGuiFlags* flags;
    4041  OrxonoxGuiBanner* banner;
     42  OrxonoxGuiKeys* keys;
    4143
    4244int main( int argc, char *argv[] )
     
    4951
    5052/**
    51  * Initializes the Gui
     53   \brief Initializes the Gui
    5254*/
    5355OrxonoxGui::OrxonoxGui (int argc, char *argv[])
     
    5658  gtk_rc_parse( "rc" );
    5759 
    58   orxonoxGUI = new Window("Graphical Orxonox Launcher");
     60  orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION );
    5961  orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);
    6062  orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);
     
    7577     
    7678  optionBox->fill (avBox);
    77    
     79
     80  keys = new OrxonoxGuiKeys ();
     81  optionBox->fill (keys->getWidget ());
     82
    7883  exec = new OrxonoxGuiExec (orxonoxGUI);
    7984  optionBox->fill (exec->getWidget ());
     
    99104
    100105/* WIDGET */
    101 /**
    102  * Initializes a widget.
    103  * Nothing to do here.
    104  */
     106
     107/**
     108   \brief deletes any given Widget
     109   This is still pretty crappy.
     110*/
     111Widget::~Widget()
     112{
     113  //  cout << "hiding: " <<this->label <<"\n";
     114  this->hide();
     115  //  cout << "check if Packer: "<<this->label <<"\n";
     116  if (this->is_option < 0)
     117    {
     118      //  cout << "get Down "<<this->label <<"\n";
     119      static_cast<Packer*>(this)->down->~Widget();
     120    }
     121  //  cout << "next != NULL?: " <<this->label <<"\n";
     122  if (this->next != NULL)
     123    this->next->~Widget();
     124  cout << "delete Widget: " <<this->label <<"\n";
     125  //  delete widget;
     126}
     127
     128/**
     129   \brief Initializes a widget.
     130   Initializes the next Pointer and the other Widget-specific Defaults.
     131*/
    105132void Widget::init()
    106133{
     134  next = NULL;
     135  label = "";
    107136  return;
    108137}
    109138
    110 /**
    111  * Connect any signal to any given Sub-widget
    112  */
     139/**
     140   \brief makes the widget visible.
     141*/
     142void Widget::show()
     143{
     144  gtk_widget_show (this->widget);
     145}
     146
     147/**
     148   \brief hides the widget.
     149*/
     150void Widget::hide()
     151{
     152  gtk_widget_hide (this->widget);
     153}
     154
     155/**
     156   \brief Sets the resolution of a specific widget to the given size.
     157   \param width the width of the widget to set.
     158   \param height the height of the widget to set.
     159*/
     160void Widget::setSize(int width, int height)
     161{
     162  gtk_widget_set_usize (this->widget, width, height);
     163}
     164
     165/**
     166    \brief Connect any signal to any given Sub-widget
     167*/
    113168void Widget::connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *))
    114169{
     
    117172
    118173/**
    119  * Connect a signal with additionally passing the whole Object
    120  */
     174   \brief Connect a signal with additionally passing the whole Object
     175*/
    121176void Widget::connectSignal (char* event, gint (*signal)( GtkWidget*, Widget *))
    122177{
     
    125180
    126181/**
    127  * Connect a signal with additionally passing a whole external Object
    128  */
     182   \brief Connect a signal with additionally passing a whole external Object
     183*/
    129184void Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *))
    130185{
     
    132187}
    133188
    134 
    135 /**
    136  * Function to Shows a specific widget.
    137  */
    138 void Widget::show()
    139 {
    140   gtk_widget_show (this->widget);
    141 }
    142 
    143 /**
    144  * Moves through all the Widgets downwards from this and executes the function on them.
    145  \param function must be of type void and takes a Widget* as an Input.
    146 
    147  */
     189/**
     190   \brief Moves through all the Widgets downwards from this and executes the function on them.
     191   \param function must be of type void and takes a Widget* as an Input.
     192*/
    148193void Widget::walkThrough (void (*function)(Widget*))
    149194{
    150195  function(this);
    151   switch (this->is_option)
     196  if (this->is_option < 0)
    152197    {
    153     case -1:
    154       static_cast<Container*>(this)->down->walkThrough (function);
    155       break;
    156     case -2:
    157       static_cast<Box*>(this)->down->walkThrough (function);
    158       break;
     198      static_cast<Packer*>(this)->down->walkThrough (function);
    159199    }
    160200
     
    163203}
    164204
    165 
    166 /**
    167  * This is for listing the option of "widget"
    168  \param widget specifies the widget that should be listed
     205/**
     206    \brief This is for listing the option of "widget"
     207    \param widget specifies the widget that should be listed
    169208*/
    170209void Widget::listOptions (Widget* widget)
    171210{
    172211  if (widget->is_option >= 1)
    173     cout << static_cast<Option*>(widget)->option_name <<" is : " << static_cast<Option*>(widget)->value <<endl;
    174 }
    175 
    176 /**
    177  * This is for setting the option of "widget"
    178  \param widget specifies the widget that should be set.
     212    cout << static_cast<Option*>(widget)->label <<" is : " << static_cast<Option*>(widget)->value <<endl;
     213}
     214
     215/**
     216    \brief This is for setting the option of "widget"
     217    \param widget specifies the widget that should be set.
    179218*/
    180219void Widget::setOptions (Widget* widget)
     
    184223}
    185224
    186 /* CONTAINERS*/
    187 
    188 /**
    189  * Initializes a Container.
    190  * nothing to do here
    191  */
     225//void deleteWidget(Widget* lastWidget)
     226
     227
     228/* PACKERS */
     229
     230/**
     231   \brief Initializes a Packer.
     232   Sets the down-pinter to NULL and other PackerSpecific-values to their defaults.
     233*/
     234void Packer::init (void)
     235{
     236  down = NULL;
     237  this->setGroupName ("");
     238
     239
     240  static_cast<Widget*>(this)->init();
     241  return;
     242}
     243
     244/**
     245   \brief Sets the group name under which all the lower widgets of this will be saved.
     246   \param name The name of the group.
     247*/
     248void Packer::setGroupName (char* name)
     249{
     250  groupName = name;
     251}
     252
     253/**
     254   \brief Retrieves the group name under which all the lower widgets of this will be saved.
     255   \returns name The name of the group.
     256*/
     257char* Packer::getGroupName (void)
     258{
     259  return groupName;
     260}
     261
     262/* CONTAINERS */
     263
     264/**
     265   \brief Initializes a Container.
     266   sets the Container-Specific defaults.
     267*/
    192268void Container::init (void)
    193269{
     270  is_option = -1;
     271
     272  static_cast<Packer*>(this)->init();
     273
    194274  return;
    195275}
    196276
    197277/**
    198  * Fills a Container with lowerWidget.
    199  * It does this by filling up the down pointer only if down points to NULL.
    200  \param lowerWidget the Widget that should be filled into the Container.
     278   \briefFills a Container with lowerWidget.
     279   It does this by filling up the down pointer only if down points to NULL.
     280   \param lowerWidget the Widget that should be filled into the Container.
    201281*/
    202282void Container::fill (Widget *lowerWidget)
     
    215295/* WINDOW */
    216296
    217   /**
    218    * Creating a new Window without a Name
    219    */
     297/**
     298   \brief Creating a new Window without a Name
     299*/
    220300Window::Window (void)
    221301{
     
    224304
    225305/**
    226  * Creating a Window with a name
    227  \param windowName the name the window should get.
    228  */
     306   \brief Creating a Window with a name
     307   \param windowName the name the window should get.
     308*/
    229309Window::Window (char* windowName)
    230310{
     
    234314
    235315/**
    236  * Destoying a Window (very BAD implemented).
    237  * For now it just hides the window.
    238  */
    239 Window::~Window ()
    240 {
    241   gtk_widget_hide (widget);
    242 }
    243 
    244 /**
    245  *initializes a new Window
    246  */
     316   \brief initializes a new Window
     317*/
    247318void Window::init()
    248319{
    249   is_option = -1;
    250   next = NULL;
    251   down = NULL;
     320  isOpen = true;
     321
     322  static_cast<Container*>(this)->init();
     323
    252324  widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    253325  gtk_window_set_policy (GTK_WINDOW(widget), TRUE, TRUE, TRUE);
     
    259331
    260332/**
    261  * Shows all Widgets that are included within this->widget.
    262  */
     333   \brief Shows all Widgets that are included within this->widget.
     334*/
    263335void Window::showall ()
    264336{
     337  isOpen = true;
    265338  gtk_widget_show_all  (widget);
    266339}
    267340
    268341/**
    269  * Set The Window-title to title
    270  \param title title the Window should get.
     342   \brief Set The Window-title to title
     343   \param title title the Window should get.
    271344*/
    272345void Window::setTitle (char* title)
    273346{
     347  label=title;
    274348  gtk_window_set_title (GTK_WINDOW (widget), title);
    275349}
     
    295369
    296370/**
    297  * Creates a new Frame without a name
    298  */
     371    \brief Creates a new Frame without a name
     372*/
    299373Frame::Frame (void)
    300374{
     
    303377
    304378/**
    305  * Creates a new Frame with name title
    306  */
     379   \brief Creates a new Frame with name title
     380*/
    307381Frame::Frame (char* title)
    308382{
     
    311385}
    312386
    313 /**
    314  * Destroys given Frame (not implemented yet)
    315  */
    316 Frame::~Frame ()
    317 {
    318 }
    319 
    320 /**
    321  * Initializes a new Frame with default settings
    322  */
     387/**
     388    \brief Initializes a new Frame with default settings
     389*/
    323390void Frame::init()
    324391{
    325   is_option = -1;
    326   next = NULL;
    327   down = NULL;
     392  static_cast<Container*>(this)->init();
     393 
    328394  widget = gtk_frame_new ("");
    329395  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
     
    331397
    332398/**
    333  * Sets the Frames name to title
    334  \param title The title the Frame should get.
    335  */
     399   \brief Sets the Frames name to title
     400   \param title The title the Frame should get.
     401*/
    336402void Frame::setTitle (char* title)
    337403{
     404  label = title;
    338405  gtk_frame_set_label (GTK_FRAME (widget), title);
    339406}
     
    342409
    343410/**
    344  * Creates a new EventBox with default settings.
    345  */
     411   \brief Creates a new EventBox with default settings.
     412*/
    346413EventBox::EventBox ()
    347414{
     
    349416}
    350417/**
    351  * Creates a new EventBox with name title
    352  \param title title the Eventbox should get (only data-structure-internal)
     418   \brief Creates a new EventBox with name title
     419   \param title title the Eventbox should get (only data-structure-internal)
    353420*/
    354421EventBox::EventBox (char* title)
     
    360427
    361428/**
    362  * Initializes a new EventBox
    363  */
     429   \brief Initializes a new EventBox
     430*/
    364431void EventBox::init(void)
    365432{
    366433  is_option = -1;
    367   next = NULL;
    368   down = NULL;
     434
     435  static_cast<Container*>(this)->init();
     436
    369437  widget = gtk_event_box_new ();
    370438  gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
     
    373441
    374442/**
    375  * Sets the Title of the EventBox (not implemented)
    376  \param title Name the EventBox should get (only datastructure-internal).
     443   \brief Sets the Title of the EventBox (not implemented)
     444   \param title Name the EventBox should get (only datastructure-internal).
    377445*/
    378446void EventBox::setTitle (char* title)
    379447{
    380 
    381 }
    382 
    383 /**
    384  * Destructs an EventBox (not Implemented)
    385  */
    386 EventBox::~EventBox ()
    387 {
    388 }
    389 
     448  label = title;
     449}
    390450
    391451/* BOX */
    392452
    393453/**
    394  * Creates a new horizontal Box
    395  */
     454   \brief Creates a new horizontal Box
     455*/
    396456Box::Box (void)
    397457{
     
    400460
    401461/**
    402  * Creates a new Box of type boxtype
    403  \param boxtype if 'v' the Box will be vertically, if 'h' the Box will be horizontally
    404  */
     462   \brief Creates a new Box of type boxtype
     463   \param boxtype if 'v' the Box will be vertically, if 'h' the Box will be horizontally
     464*/
    405465Box::Box (char boxtype)
    406466{
     
    409469
    410470/**
    411  * Destroys given Box (not implemented yet)
    412  */
    413 Box::~Box ()
    414 {
    415 }
    416 
    417 /**
    418  * Initializes a new Box with type boxtype
    419  \param boxtype see Box(char boxtype)
     471   \brief Initializes a new Box with type boxtype
     472   \param boxtype see Box(char boxtype)
    420473*/
    421474void Box::init(char boxtype)
    422475{
    423476  is_option = -2;
    424   next = NULL;
    425   down = NULL;
     477
     478  static_cast<Packer*>(this)->init();
    426479  if (boxtype == 'v')
    427480    {
     
    435488
    436489/**
    437  * Fills a box with a given Widget.
    438  * It does this by apending the first one to its down-pointer and all its following ones to the preceding next-pointer. The last one will receive a NULL pointer as Next
    439  \param lowerWidget the next Widget that should be appendet to this Box
    440  */
     490    \brief Fills a box with a given Widget.
     491   It does this by apending the first one to its down-pointer and all its following ones to the preceding next-pointer. The last one will receive a NULL pointer as Next
     492    \param lowerWidget the next Widget that should be appendet to this Box
     493*/
    441494void Box::fill (Widget *lowerWidget)
    442495{
    443   /**
    444    * Fill a Box with its lowerwidgets
    445    */
    446496  gtk_box_pack_start (GTK_BOX (this->widget), lowerWidget->widget, TRUE, TRUE, 0);
    447497  if (this->down == NULL)
     
    462512
    463513/**
    464  * Creates a new Image
    465  \param imagename the location of the Image on the Hard Disc
     514   \brief Creates a new Image
     515   \param imagename the location of the Image on the Hard Disc
    466516*/
    467517Image::Image (char* imagename)
     
    469519  this->init();
    470520  widget = gtk_image_new_from_file (imagename);
    471 }
    472 
    473 /**
    474  * Initializes a new Image
    475  */
     521  label = imagename;
     522}
     523
     524/**
     525    \brief Initializes a new Image
     526*/
    476527void Image::init()
    477528{
    478529  is_option = 0;
    479   next = NULL;
     530
     531  static_cast<Widget*>(this)->init();
    480532}
    481533
     
    484536
    485537/**
    486  * Initializes a new Option: nothing to do here
    487  */
     538   \brief Initializes a new Option.
     539   sets all Option-Specific-Values to their defaults.
     540*/
    488541void Option::init()
    489542{
     543  value = 0;
     544  flag_name = "";
     545  flag_name_short = "";
     546  default_value = 0;
     547
     548  static_cast<Widget*>(this)->init();
     549
    490550  return;
    491551}
    492552
    493553/**
    494  * This sets The FlagName of an Option and defines its default Values
    495  !! Options will be saved if flagname is different from "" !!
    496 \param flagname the Name that will be displayed in the output
    497 \param defaultvalue the default Value for this Option (see definition of defaultvalue
     554   \brief This sets The FlagName of an Option and defines its default Values
     555   !! Options will be saved if flagname is different from "" !!
     556   \param flagname the Name that will be displayed in the output
     557   \param defaultvalue the default Value for this Option (see definition of defaultvalue
    498558*/
    499559void Option::setFlagName (char* flagname, int defaultvalue)
     
    501561  flag_name = flagname;
    502562  default_value = defaultvalue;
    503   cout << "Set Flagname of " << option_name << " to " << flagname << endl;
    504 }
    505 
    506 /**
    507  * see Option::setFlagName (char* flagname, int defaultvalue)
    508  \param flagname the Name that will be displayed in the output
    509  \param defaultvalue the default Value for this Option (see definition of defaultvalue
    510  \param flagnameshort a short flagname to be displayed in the output
     563  cout << "Set Flagname of " << label << " to " << flagname << endl;
     564}
     565
     566/**
     567    \brief see Option::setFlagName (char* flagname, int defaultvalue)
     568    \param flagname the Name that will be displayed in the output
     569    \param defaultvalue the default Value for this Option (see definition of defaultvalue
     570    \param flagnameshort a short flagname to be displayed in the output
    511571*/
    512572void Option::setFlagName (char* flagname, char* flagnameshort,  int defaultvalue)
     
    515575  flag_name_short = flagnameshort;
    516576  default_value = defaultvalue;
    517   cout << "Set Flagname of " << option_name << " to " << flagname << endl;
     577  cout << "Set Flagname of " << label << " to " << flagname << endl;
    518578}
    519579
     
    522582
    523583/**
    524  * Creates a new Button with a buttonname
    525  \param buttonname sets the Name of the Button
     584   \brief Creates a new Button with a buttonname
     585   \param buttonname sets the Name of the Button
    526586*/
    527587Button::Button(char* buttonname)
     
    532592
    533593/**
    534  * Initializes a new Button
    535  */
     594   \brief Initializes a new Button
     595*/
    536596void Button::init(void)
    537597{
    538598  is_option = 0;
    539   value = 0;
    540   next = NULL;
    541   option_name ="";
    542   flag_name = "";
    543   flag_name_short = "";
    544   default_value = 0;
     599
     600  static_cast<Option*>(this)->init();
     601
    545602  widget = gtk_button_new_with_label ("");
    546603}
    547604
    548605/**
    549  * Sets a new name to the Button
    550 \param title The name the Button should get
     606   \brief Sets a new name to the Button
     607   \param title The name the Button should get
    551608*/
    552609void Button::setTitle (char *title)
    553610{
    554   option_name = title;
     611  label = title;
    555612  gtk_button_set_label (GTK_BUTTON(widget), title);
    556613}
    557614
    558615/**
    559  * redraws the Button
    560  * not implemented yet
    561  */
     616   \brief redraws the Button
     617   not implemented yet
     618*/
    562619void Button::redraw ()
    563620{
     
    567624
    568625/**
    569  * Creates a new CheckButton with an ame
    570  \param buttonname The name the CheckButton should display.
    571  */
     626   \brief Creates a new CheckButton with an ame
     627   \param buttonname The name the CheckButton should display.
     628*/
    572629CheckButton::CheckButton (char* buttonname)
    573630{
     
    578635}
    579636
    580 /**
    581  * Destructs a CheckButton (not Implemented yet).
    582  */
    583 CheckButton::~CheckButton()
    584 {
    585 }
    586 
    587 /**
    588  * Initiali a new CheckButton with default settings
    589  */
     637/**
     638   \brief Initialize a new CheckButton with default settings
     639*/
    590640void CheckButton::init(void)
    591641{
    592642  is_option = 1;
    593   value = 0;
    594   next = NULL;
    595   option_name = "";
    596   flag_name = "";
    597   flag_name_short = "";
    598   default_value = 0;
     643
     644  static_cast<Option*>(this)->init();
     645
    599646  widget = gtk_check_button_new_with_label ("");
    600647}
    601648
    602649/**
    603  * Sets a new Title to a CheckButton
    604  \param title The new Name the CheckButton should display.
     650   \brief Sets a new Title to a CheckButton
     651   \param title The new Name the CheckButton should display.
    605652*/
    606653void CheckButton::setTitle(char* title)
    607654{
    608   option_name = title;
     655  label = title;
    609656  gtk_button_set_label(GTK_BUTTON(widget), title);
    610657}
     
    612659
    613660/**
    614  * Signal OptionChange writes the Value from the CheckButton to its Object-Database.
    615  \param widget The widget(CheckButton) that has a changed Value
    616  \param checkbutton the CheckButton-Object that should receive the change.
    617  */
     661    \brief Signal OptionChange writes the Value from the CheckButton to its Object-Database.
     662    \param widget The widget(CheckButton) that has a changed Value
     663    \param checkbutton the CheckButton-Object that should receive the change.
     664*/
    618665gint CheckButton::OptionChange (GtkWidget *widget, Widget* checkbutton)
    619666{
    620667  static_cast<CheckButton*>(checkbutton)->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ((CheckButton*)checkbutton->widget));
    621668  flags->setTextFromFlags(orxonoxGUI);
    622   cout << static_cast<CheckButton*>(checkbutton)->option_name << " set to: " << static_cast<CheckButton*>(checkbutton)->value << endl;
    623 }
    624 
    625 /**
    626  * Redraws the CheckButton (if option has changed).
    627  * Example: if new settings are loaded the Button must be redrawn for the GUI to display that Change
    628  */
     669  cout << static_cast<CheckButton*>(checkbutton)->label << " set to: " << static_cast<CheckButton*>(checkbutton)->value << endl;
     670}
     671
     672/**
     673   \brief Redraws the CheckButton (if option has changed).
     674   Example: if new settings are loaded the Button must be redrawn for the GUI to display that Change
     675*/
    629676void CheckButton::redraw ()
    630677{
     
    635682
    636683/**
    637  * Creates a new Slider
    638  \param slidername The data-structure-name of the slider.
    639  \param start The minimal Value of the slider.
    640  \param end The maximal Value of the slider.
     684   \brief Creates a new Slider
     685   \param slidername The data-structure-name of the slider.
     686   \param start The minimal Value of the slider.
     687   \param end The maximal Value of the slider.
    641688*/
    642689Slider::Slider (char* slidername, int start, int end)
     
    649696
    650697/**
    651  * Destructs a Slider (not implemented yet)
    652  */
    653 Slider::~Slider()
    654 {
    655 }
    656 
    657 /**
    658  * Initializes a Slider with start and end Values
    659  * params: see Slider::Slider (char* slidername, int start, int end)
    660  */
     698   \brief Initializes a Slider with start and end Values
     699   params: see Slider::Slider (char* slidername, int start, int end)
     700*/
    661701void Slider::init(int start, int end)
    662702{
    663703  is_option = 2;
    664   value = 0;
    665   next = NULL;
    666   option_name = "";
    667   flag_name = "";
    668   flag_name_short = "";
    669   default_value = 0;
     704
     705  static_cast<Option*>(this)->init();
     706
    670707  widget = gtk_hscale_new_with_range (start, end, 5);
    671708}
    672709
    673710/**
    674  * Sets a new Title to the Slider
    675  \param title The new Name of the slider
     711   \brief Sets a new Title to the Slider
     712   \param title The new Name of the slider
    676713*/
    677714void Slider::setTitle(char* title)
    678715{
    679   option_name = title;
    680 }
    681 
    682 /**
    683  * Setting a new value to the Slider.
    684  * Maybe you also require a Slider::redraw() for this to display
    685  */
     716  label = title;
     717}
     718
     719/**
     720   \brief Setting a new value to the Slider.
     721   Maybe you also require a Slider::redraw() for this to display
     722*/
    686723void Slider::setValue(int value)
    687724{
     
    690727
    691728/**
    692  * Signal OptionChange writes the Value from the Slider to its Object-Database.
    693  \param widget The widget(Slider) that has a changed Value
    694  \param slider the Slider-Object that should receive the change.
    695  */
     729    \brief Signal OptionChange writes the Value from the Slider to its Object-Database.
     730    \param widget The widget(Slider) that has a changed Value
     731    \param slider the Slider-Object that should receive the change.
     732*/
    696733gint Slider::OptionChange (GtkWidget *widget, Widget* slider)
    697734{
    698735  static_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE ((Slider*)slider->widget));
    699736  flags->setTextFromFlags(orxonoxGUI);
    700   cout << static_cast<Slider*>(slider)->option_name << " set to: "<< static_cast<Slider*>(slider)->value << endl;
    701 }
    702 
    703 /**
    704  * Redraws the widget
    705  * Example: see void CheckButton::redraw ()
    706  */
     737  cout << static_cast<Slider*>(slider)->label << " set to: "<< static_cast<Slider*>(slider)->value << endl;
     738}
     739
     740/**
     741   \brief Redraws the widget
     742   Example: see void CheckButton::redraw ()
     743*/
    707744void Slider::redraw ()
    708745{
     
    713750
    714751/**
    715  * Creates a Menu-Item-list out of multiple input.
    716  * !! Consider, that the last input argument has to be "lastItem" for this to work!!
    717  \param menuname The Database-Name of this Menu
    718  \param ... items to be added to this Menu. !! Consider, that the last input argument has to be "lastItem" for this to work!!
    719  */
     752    \brief Creates a Menu-Item-list out of multiple input.
     753   !! Consider, that the last input argument has to be "lastItem" for this to work!!
     754    \param menuname The Database-Name of this Menu
     755    \param ... items to be added to this Menu. !! Consider, that the last input argument has to be "lastItem" for this to work!!
     756*/
    720757Menu::Menu (char* menuname, ...)
    721758{
     
    737774
    738775/**
    739  * Initializes a new Menu with no items
    740  */
     776   \brief Initializes a new Menu with no items
     777*/
    741778void Menu::init(void)
    742779{
    743780  is_option = 2;
    744   value = 0;
    745   next = NULL;
    746   flag_name = "";
    747   flag_name_short = "";
    748   default_value = 0;
     781
     782  static_cast<Option*>(this)->init();
     783
    749784  widget = gtk_option_menu_new ();
    750785  menu = gtk_menu_new ();
     
    758793void Menu::setTitle(char* title)
    759794{
    760   option_name = title;
    761 }
    762 
    763 /**
    764  * appends a new Item to the Menu-List.
    765  \param itemName the itemName to be appendet.
     795  label = title;
     796}
     797
     798/**
     799   \brief appends a new Item to the Menu-List.
     800   \param itemName the itemName to be appendet.
    766801*/
    767802void Menu::addItem (char* itemName)
     
    772807
    773808/**
    774  * Signal OptionChange writes the Value from the Menu to its Object-Database.
    775  \param widget The widget(Menu) that has a changed Value
    776  \param menu the Menu-Object that should receive the change.
    777  */gint Menu::OptionChange (GtkWidget *widget, Widget* menu)
     809    \brief Signal OptionChange writes the Value from the Menu to its Object-Database.
     810    \param widget The widget(Menu) that has a changed Value
     811    \param menu the Menu-Object that should receive the change.
     812*/
     813gint Menu::OptionChange (GtkWidget *widget, Widget* menu)
    778814{
    779815  static_cast<Menu*>(menu)->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (menu->widget));
    780816  flags->setTextFromFlags(orxonoxGUI);
    781   cout << static_cast<Menu*>(menu)->option_name << " changed to : " << static_cast<Menu*>(menu)->value << endl;
    782 }
    783 
    784 /**
    785  * Redraws the widget
    786  * Example: see void CheckButton::redraw ()
     817  cout << static_cast<Menu*>(menu)->label << " changed to : " << static_cast<Menu*>(menu)->value << endl;
     818}
     819
     820/**
     821   \brief Redraws the widget
     822   Example: see void CheckButton::redraw ()
    787823 */
    788824void Menu::redraw ()
     
    792828
    793829/**
    794  * Creates a new default Label with no Text.
    795  * You migth consider adding Label::setTitle with this.
    796  */
     830   \brief Creates a new default Label with no Text.
     831   You migth consider adding Label::setTitle with this.
     832*/
    797833Label:: Label ()
    798834{
     
    801837
    802838/**
    803  * Creates a new Label with a Text.
    804  \param text The text to be displayed.
     839   \brief Creates a new Label with a Text.
     840   \param text The text to be displayed.
    805841*/
    806842Label:: Label (char* text)
    807843{
     844  this->init();
     845  this->setText(text);
     846}
     847
     848/**
     849   \brief initializes a new Label
     850*/
     851void Label::init(void)
     852{
    808853  is_option = 0;
    809   next = NULL;
    810   widget = gtk_label_new (text);
     854
     855  static_cast<Widget*>(this)->init();
     856
     857  widget = gtk_label_new ("");
    811858  gtk_label_set_line_wrap (GTK_LABEL(widget), TRUE);
    812859}
    813860
    814 /**
    815  * Destructs a Label
    816  */
    817 Label::~Label ()
    818 {}
    819 
    820 /**
    821  * initializes a new Label
    822  */
    823 void Label::init(void)
    824 {
    825   is_option = 0;
    826   next = NULL;
    827   widget = gtk_label_new ("");
    828   gtk_widget_set_usize (widget, 260, 60);
    829   gtk_label_set_line_wrap (GTK_LABEL(widget), TRUE);
    830 }
    831 
    832 /**
    833  * Sets a new Text to a Label.
    834  \param text The text to be inserted into the Label.
    835  */
     861/**
     862   \brief Sets a new Text to a Label.
     863   \param text The text to be inserted into the Label.
     864*/
    836865void Label::setText (char * text)
    837866{
     867  label = text;
    838868  gtk_label_set_text (GTK_LABEL (this->widget), text);
    839869}
    840870
    841871/**
    842  * get the Text of a Label
    843  \return The Text the Label holds.
     872   \brief get the Text of a Label
     873   \return The Text the Label holds.
    844874*/
    845875char* Label::getText ()
  • orxonox/branches/buerli/gui/orxonox_gui.h

    r2595 r2707  
    77#define _ORXONOX_GUI_H
    88
     9#if HAVE_CONFIG_H
     10#include <config.h>
     11#endif
     12
    913#include <stdlib.h>
    10 #include <string.h>
    1114#include <gtk/gtkmain.h>
    1215#include <gtk/gtkwindow.h>
     
    3437
    3538//! This is the topmost object that can be displayed all others are derived from it.
    36 
    3739class Widget
    3840{
    3941 private:
    4042 public:
     43  ~Widget ();
     44
    4145  Widget* next; //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next
    4246  GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains.
    43   virtual void init(void);
     47  void init(void);
    4448  int is_option; //!< with this Paramenter one can set the IsOption type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option
    45   enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2}; //!< defines is_option states
     49  /**
     50     \briefdefines is_option states
     51  */
     52  enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2};
     53  char* label; //!< The name of the Widget. Some do display it, Options need it to save;
    4654  void connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *));
    4755  void connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *));
    4856  void connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *));
    4957  void show ();
     58  void hide ();
     59  void setSize(int width, int height);
    5060
    5161  void walkThrough (void (*function)(Widget*));
     
    5565};
    5666
     67//! This is a Packer Object, which has the ability to Pack other Widgets into itself.
     68class Packer : public Widget
     69{
     70 public:
     71  Widget* down; //!< this points to the Widget below this.
     72  char* groupName; //!< For each Packer you can specify a Groupname under which the lowerWidgets will be saved.
     73
     74  void init(void);
     75  void setGroupName (char* name);
     76  char* getGroupName (void);
     77};
    5778
    5879//! This is a Container Class, it can contain one sub-Widget: down.
     
    6283 * The derived classes of Container can be displayed
    6384*/
    64 class Container : public Widget
     85class Container : public Packer
    6586{
    6687 private:
    6788  int borderwidth;
    6889  int policy;
    69   char* label;
    70  
    71  public:
    72   void init(void);
    73   Widget* down; //!< this points to the Widget below this.
     90 
     91 public:
     92  void init(void);
    7493  //  void setBorderWidth (int borderwidth);
    7594  //  virtual void setTitle (char* title) = 0;
     
    84103class Window : public Container
    85104{
     105 private:
     106  bool isOpen;
    86107 public:
    87108  Window (char* windowName);
    88109  Window (void);
    89   ~Window ();
    90110  void init ();
    91111 
     
    105125  Frame (char* frameName);
    106126  Frame (void);
    107   ~Frame ();
    108127  void init(void);
    109128 
     
    120139  EventBox (char* eventBoxName);
    121140  EventBox (void);
    122   ~EventBox ();
    123141  void init(void);
    124142 
     
    132150 * A Box is always filled left->right (horizontally) or up->down (vertically)
    133151 */
    134 class Box : public Widget
     152class Box : public Packer
    135153{
    136154 public:
    137155  Box (void);
    138156  Box (char boxtype);
    139   ~Box (void);
    140157  void init(char boxtype);
    141158
    142   Widget* down; //!< the Lower Widget of a Box.
    143159  void fill (Widget* lowerWidget);
    144160
     
    154170 public:
    155171  Image (char* imgaename);
    156   ~Image ();
    157172  void init(void);
    158173};
     
    169184
    170185  int value; //!< every option has a value either true or false (0,1) or something else like 25 for 25% of the volume
    171   char* option_name; //!< options have a name, that can be displayed around them
    172186  char* flag_name; //!< options have a flag name that will be appendet if you start the Program from the GUI.
    173187  char* flag_name_short; //!< like flag_name but shorter
     
    187201 public:
    188202  Button (char* buttonname);
    189   ~Button (void);
    190203  void init(void);
    191204
     
    202215 public:
    203216  CheckButton (char* buttonname);
    204   ~CheckButton (void);
    205217  static gint OptionChange (GtkWidget* widget, Widget* checkbutton);
    206218 
     
    219231 public:
    220232  Slider (char* slidername,int start, int end);
    221   ~Slider ();
    222233  void init(int start, int end);
    223234
     
    239250 public:
    240251  Menu (char* menuname, ...);
    241   ~Menu ();
    242252  void init(void);
    243253
     
    255265  Label ();
    256266  Label (char* text);
    257   ~Label ();
    258267  void init(void);
    259268 
  • orxonox/branches/buerli/gui/orxonox_gui_audio.cc

    r2595 r2707  
    3333  audioFrame = new Frame ("Audio-Options:");
    3434  audioBox = new Box ('v');
     35  audioFrame->setGroupName ("audio");
    3536 
    3637  enableSound = new CheckButton ("Disable Sound");
  • orxonox/branches/buerli/gui/orxonox_gui_banner.cc

    r2595 r2707  
    6363          logoEventBox = new EventBox();
    6464          logoBox = new Box('v');
    65           logoLabel = new Label("OrxOnoX");
     65          logoLabel = new Label("OrxOnoX, " PACKAGE_VERSION);
    6666          logoImage = new Image("banner.xpm");
    6767          logoEventBox->fill(logoImage);
     
    8888{
    8989  logoWindowIsOpen = 0;
    90   logoWindow->~Window();
     90  logoWindow->hide();
    9191}
    9292
  • orxonox/branches/buerli/gui/orxonox_gui_exec.cc

    r2595 r2707  
    3838  execFrame = new Frame ("Execute-Tags:");
    3939  execBox = new Box ('v');
     40  execFrame->setGroupName ("misc");
    4041 
    4142  start = new Button ("Start");
     
    109110  CONFIG_FILE = fopen (configFile, "w");
    110111  if (CONFIG_FILE)
    111     writeFileText (widget);
     112    writeFileText (widget, 0);
    112113  fclose (CONFIG_FILE);
    113114}
     
    116117   \brief Actually writes into the configuration file to the disk.
    117118   \param widget from which Widget on should be saved.
    118 */
    119 void OrxonoxGuiExec::writeFileText (Widget* widget)
    120 {
     119   \param depth initially "0", and grows higher, while new Groups are bundeled.
     120*/
     121void OrxonoxGuiExec::writeFileText (Widget* widget, int depth)
     122{
     123  int counter = 0;
     124  while (counter < depth && ((widget->is_option>0
     125                              && (strcmp (static_cast<Option*>(widget)->flag_name, "")
     126                                  || strcmp (static_cast<Option*>(widget)->flag_name_short, "")) )
     127                             || (widget->is_option<0
     128                                 && strcmp (static_cast<Packer*>(widget)->getGroupName(), ""))))
     129    {
     130      fprintf (CONFIG_FILE, "  ", depth);
     131      counter++;
     132    }
     133 
     134  // check if it is a Packer, and if it is, check if it has a name and if there is something in it.
     135  if (widget->is_option <0)
     136    {
     137      if (strcmp (static_cast<Packer*>(widget)->getGroupName(), ""))
     138        {
     139          fprintf (CONFIG_FILE, "[%s]\n", static_cast<Packer*>(widget)->getGroupName());
     140          writeFileText (static_cast<Packer*>(widget)->down, depth+1);
     141          fprintf(CONFIG_FILE, "\n");
     142        }
     143      else
     144        {
     145          writeFileText (static_cast<Packer*>(widget)->down, depth);
     146        }
     147    }
     148 
    121149  if (widget->is_option >= 1)
    122150    if  (strcmp (static_cast<Option*>(widget)->flag_name, "") || strcmp (static_cast<Option*>(widget)->flag_name_short, ""))
     
    124152        char Buffer[256];
    125153        char* space2under;
    126         sprintf (Buffer, "%s", static_cast<Option*>(widget)->option_name);
     154        sprintf (Buffer, "%s", static_cast<Option*>(widget)->label);
    127155        if (strchr (Buffer, '_'))
    128           cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl; 
     156          cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl;
    129157        while (space2under = strchr(Buffer, ' '))
    130158          {
     
    133161        fprintf (CONFIG_FILE, "%s = %i\n", Buffer, static_cast<Option*>(widget)->value);
    134162      }
    135   switch (widget->is_option)
    136     {
    137     case -1:
    138       writeFileText (static_cast<Container*>(widget)->down);
    139       break;
    140     case -2:
    141       writeFileText (static_cast<Box*>(widget)->down);
    142       break;
    143     }
    144  
     163
    145164  if (widget->next != NULL)
    146     writeFileText (widget->next);
     165    writeFileText (widget->next, depth);
    147166}
    148167
     
    156175  if (CONFIG_FILE)
    157176    {
     177      Widget* groupWidget = widget;
    158178      char Buffer[256] = "";
    159179      char Variable[256]= "";
     
    161181      while (fscanf (CONFIG_FILE, "%s", Buffer) != EOF)
    162182        {
     183          if (!strncmp (Buffer, "[", 1))
     184            {
     185              if ((groupWidget = locateGroup (widget, Buffer, 1))==NULL)
     186                {
     187                  cout << "!!There is no group called " << Buffer << " in this GUI.\n First best Widget will get the Infos assigned.\n Config-File will be updated in next Save\n";
     188                  groupWidget = widget;
     189                }
     190            }
    163191          if (!strcmp (Buffer, "="))
    164192            {
     
    171199              fscanf (CONFIG_FILE, "%s", Buffer);
    172200              Value = atoi(Buffer);
    173               readFileText (widget, Variable, Value);
     201              readFileText (groupWidget, Variable, Value, 0);
    174202              sprintf (Variable, "");
    175203            }
     
    179207    }
    180208}
    181 
    182209/**
    183210   \brief Maps Confugurations to the Options.
     
    185212   \param variableName the name of the Variable that should be set up.
    186213   \param variableValue the Value of the Variable that should be set up
    187 */
    188 void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, int variableValue)
     214   \param depth the depth of the local Widget
     215*/
     216void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, int variableValue, int depth)
    189217{
    190218  if (widget->is_option >= 1)
    191     if (!strcmp (static_cast<Option*>(widget)->option_name, variableName))
     219    if (!strcmp (static_cast<Option*>(widget)->label, variableName))
    192220        static_cast<Option*>(widget)->value = variableValue;
    193221
    194   switch (widget->is_option)
    195     {
    196     case -1:
    197       readFileText (static_cast<Container*>(widget)->down, variableName, variableValue);
    198       break;
    199     case -2:
    200       readFileText (static_cast<Box*>(widget)->down, variableName, variableValue);
    201       break;
     222  if (widget->is_option < 0)
     223    {
     224      readFileText (static_cast<Packer*>(widget)->down, variableName, variableValue, depth+1);
    202225    }
    203226
    204   if (widget->next != NULL)
    205     readFileText (widget->next, variableName, variableValue);
     227  if (widget->next != NULL && depth !=0)
     228    readFileText (widget->next, variableName, variableValue, depth);
     229}
     230
     231/**
     232   \brief locates a Group member
     233*/
     234Widget* OrxonoxGuiExec::locateGroup(Widget* widget, char* groupName, int depth)
     235{
     236  Widget* tmp;
     237
     238  // removes the trailing and ending [ ].
     239  if (!strncmp (groupName, "[", 1))
     240    {
     241      groupName = groupName+1;
     242      groupName[strlen(groupName)-1] = '\0';
     243    }
     244
     245  if (widget->is_option < 0)
     246    {
     247      if (!strcmp(groupName, static_cast<Packer*>(widget)->getGroupName()))
     248        {
     249          return widget;
     250        }
     251      else
     252        {
     253          if ((tmp = locateGroup (static_cast<Packer*>(widget)->down, groupName, depth+1)) != NULL)
     254            return tmp;
     255        }
     256    }
     257 
     258  if (widget->next != NULL && depth != 0)
     259    {
     260      if ((tmp = locateGroup (widget->next, groupName, depth)) != NULL)
     261        return tmp;
     262    }
     263  return NULL;
    206264}
    207265
  • orxonox/branches/buerli/gui/orxonox_gui_exec.h

    r2595 r2707  
    3333  int shouldsave ();
    3434  void writeToFile (Widget* widget);
    35   void writeFileText (Widget* widget);
     35  void writeFileText (Widget* widget, int depth);
    3636  void readFromFile (Widget* widget);
    37   void readFileText (Widget* widget, char* variableName, int variableValue);
     37  void readFileText (Widget* widget, char* variableName, int variableValue, int depth);
     38  Widget* locateGroup(Widget* widget, char* groupName, int depth);
    3839
    3940};
  • orxonox/branches/buerli/gui/orxonox_gui_flags.cc

    r2595 r2707  
    3939
    4040  flagsLabel = new Label ();
     41  flagsLabel->setSize (260,60);
    4142  flagsBox->fill (flagsLabel);
    4243  shortFlags = new CheckButton ("shortFlags");
  • orxonox/branches/buerli/gui/orxonox_gui_video.cc

    r2595 r2707  
    3232  videoFrame = new Frame ("Video-Options:");
    3333  videoBox = new Box ('v');
     34  videoFrame->setGroupName("video");
    3435 
    3536  fullscreen = new CheckButton ("Fullscreen-mode");
Note: See TracChangeset for help on using the changeset viewer.