Changeset 2707 in orxonox.OLD for orxonox/branches/buerli/gui
- Timestamp:
- Nov 3, 2004, 12:29:03 AM (20 years ago)
- Location:
- orxonox/branches/buerli/gui
- Files:
-
- 10 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/buerli/gui/Makefile.am
r2589 r2707 3 3 4 4 bin_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 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 orxonox_gui_keys.cc 6 6 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 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 orxonox_gui_keys.h 8 8 9 9 # 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.1from Makefile.am.1 # Makefile.in generated by automake 1.8.5 from Makefile.am. 2 2 # @configure_input@ 3 3 4 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 20025 # Free Software Foundation, Inc.4 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 # 2003, 2004 Free Software Foundation, Inc. 6 6 # This Makefile.in is free software; the Free Software Foundation 7 7 # gives unlimited permission to copy and/or distribute it, … … 14 14 15 15 @SET_MAKE@ 16 17 18 SOURCES = $(gui_SOURCES) 16 19 17 20 srcdir = @srcdir@ … … 22 25 pkgincludedir = $(includedir)/@PACKAGE@ 23 26 top_builddir = .. 24 25 27 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 26 28 INSTALL = @INSTALL@ … … 36 38 PRE_UNINSTALL = : 37 39 POST_UNINSTALL = : 40 bin_PROGRAMS = gui$(EXEEXT) 41 subdir = gui 42 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ 43 $(srcdir)/Makefile.in 44 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 45 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 46 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 47 $(ACLOCAL_M4) 48 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 49 CONFIG_HEADER = $(top_builddir)/config.h 50 CONFIG_CLEAN_FILES = 51 am__installdirs = "$(DESTDIR)$(bindir)" 52 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) 53 PROGRAMS = $(bin_PROGRAMS) 54 am_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) 58 gui_OBJECTS = $(am_gui_OBJECTS) 59 gui_LDADD = $(LDADD) 60 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) 61 depcomp = $(SHELL) $(top_srcdir)/depcomp 62 am__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 70 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 71 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) 72 CXXLD = $(CXX) 73 CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ 74 -o $@ 75 SOURCES = $(gui_SOURCES) 76 DIST_SOURCES = $(gui_SOURCES) 77 HEADERS = $(noinst_HEADERS) 78 ETAGS = etags 79 CTAGS = ctags 80 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 38 81 ACLOCAL = @ACLOCAL@ 39 82 AMDEP_FALSE = @AMDEP_FALSE@ … … 90 133 am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 91 134 am__include = @am__include@ 135 am__leading_dot = @am__leading_dot@ 92 136 am__quote = @am__quote@ 93 137 bindir = @bindir@ … … 103 147 localstatedir = @localstatedir@ 104 148 mandir = @mandir@ 149 mkdir_p = @mkdir_p@ 105 150 oldincludedir = @oldincludedir@ 106 151 prefix = @prefix@ … … 111 156 target_alias = @target_alias@ 112 157 AM_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 158 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 orxonox_gui_keys.cc 159 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 orxonox_gui_keys.h 119 160 120 161 # uncomment the following if bencoder requires the math library … … 127 168 #TESTS=chk 128 169 EXTRA_DIST = rc banner.xpm 129 subdir = gui130 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs131 CONFIG_HEADER = $(top_builddir)/config.h132 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)/depcomp146 am__depfiles_maybe = depfiles147 @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.Po153 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.in162 SOURCES = $(gui_SOURCES)163 164 170 all: all-am 165 171 166 172 .SUFFIXES: 167 173 .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'; \ 169 184 cd $(top_srcdir) && \ 170 185 $(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 187 Makefile: $(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 174 203 install-binPROGRAMS: $(bin_PROGRAMS) 175 204 @$(NORMAL_INSTALL) 176 $(mkinstalldirs) $(DESTDIR)$(bindir)205 test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" 177 206 @list='$(bin_PROGRAMS)'; for p in $$list; do \ 178 207 p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ … … 180 209 ; then \ 181 210 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; \ 184 213 else :; fi; \ 185 214 done … … 189 218 @list='$(bin_PROGRAMS)'; for p in $$list; do \ 190 219 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"; \ 193 222 done 194 223 … … 200 229 201 230 mostlyclean-compile: 202 -rm -f *.$(OBJEXT) core *.core231 -rm -f *.$(OBJEXT) 203 232 204 233 distclean-compile: … … 210 239 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_exec.Po@am__quote@ 211 240 @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@ 212 242 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_video.Po@am__quote@ 213 243 214 distclean-depend:215 -rm -rf ./$(DEPDIR)216 217 244 .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 223 247 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 224 248 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ 225 249 @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 $@ $< 227 251 228 252 .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 234 255 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 235 256 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ 236 257 @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) '$<'` 238 259 uninstall-info-am: 239 240 ETAGS = etags241 ETAGSFLAGS =242 243 CTAGS = ctags244 CTAGSFLAGS =245 246 tags: TAGS247 260 248 261 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) … … 254 267 END { for (i in files) print i; }'`; \ 255 268 mkid -fID $$unique 269 tags: TAGS 256 270 257 271 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ … … 265 279 $(AWK) ' { files[$$0] = 1; } \ 266 280 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 271 286 ctags: CTAGS 272 287 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ … … 291 306 distclean-tags: 292 307 -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)297 308 298 309 distdir: $(DISTFILES) … … 308 319 if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 309 320 dir="/$$dir"; \ 310 $(mk installdirs) "$(distdir)$$dir"; \321 $(mkdir_p) "$(distdir)$$dir"; \ 311 322 else \ 312 323 dir=''; \ … … 326 337 check: check-am 327 338 all-am: Makefile $(PROGRAMS) $(HEADERS) 328 329 339 installdirs: 330 $(mkinstalldirs) $(DESTDIR)$(bindir) 331 340 for dir in "$(DESTDIR)$(bindir)"; do \ 341 test -z "$$dir" || $(mkdir_p) "$$dir"; \ 342 done 332 343 install: install-am 333 344 install-exec: install-exec-am … … 341 352 install-strip: 342 353 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 343 INSTALL_STRIP_FLAG=-s \354 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 344 355 `test -z '$(STRIP)' || \ 345 356 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install … … 349 360 350 361 distclean-generic: 351 -rm -f Makefile$(CONFIG_CLEAN_FILES)362 -rm -f $(CONFIG_CLEAN_FILES) 352 363 353 364 maintainer-clean-generic: … … 359 370 360 371 distclean: 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 374 distclean-am: clean-am distclean-compile distclean-generic \ 375 distclean-tags 364 376 365 377 dvi: dvi-am … … 367 379 dvi-am: 368 380 381 html: html-am 382 369 383 info: info-am 370 384 … … 382 396 383 397 maintainer-clean: maintainer-clean-am 384 398 -rm -rf ./$(DEPDIR) 399 -rm -f Makefile 385 400 maintainer-clean-am: distclean-am maintainer-clean-generic 386 401 … … 401 416 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ 402 417 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 \ 405 420 install-data install-data-am install-exec install-exec-am \ 406 421 install-info install-info-am install-man install-strip \ -
orxonox/branches/buerli/gui/orxonox_gui.cc
r2595 r2707 32 32 #include "orxonox_gui_flags.h" 33 33 #include "orxonox_gui_banner.h" 34 #include "orxonox_gui_keys.h" 34 35 35 36 Window* orxonoxGUI; … … 39 40 OrxonoxGuiFlags* flags; 40 41 OrxonoxGuiBanner* banner; 42 OrxonoxGuiKeys* keys; 41 43 42 44 int main( int argc, char *argv[] ) … … 49 51 50 52 /** 51 *Initializes the Gui53 \brief Initializes the Gui 52 54 */ 53 55 OrxonoxGui::OrxonoxGui (int argc, char *argv[]) … … 56 58 gtk_rc_parse( "rc" ); 57 59 58 orxonoxGUI = new Window( "Graphical Orxonox Launcher");60 orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION ); 59 61 orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit); 60 62 orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit); … … 75 77 76 78 optionBox->fill (avBox); 77 79 80 keys = new OrxonoxGuiKeys (); 81 optionBox->fill (keys->getWidget ()); 82 78 83 exec = new OrxonoxGuiExec (orxonoxGUI); 79 84 optionBox->fill (exec->getWidget ()); … … 99 104 100 105 /* 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 */ 111 Widget::~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 */ 105 132 void Widget::init() 106 133 { 134 next = NULL; 135 label = ""; 107 136 return; 108 137 } 109 138 110 /** 111 * Connect any signal to any given Sub-widget 112 */ 139 /** 140 \brief makes the widget visible. 141 */ 142 void Widget::show() 143 { 144 gtk_widget_show (this->widget); 145 } 146 147 /** 148 \brief hides the widget. 149 */ 150 void 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 */ 160 void 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 */ 113 168 void Widget::connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *)) 114 169 { … … 117 172 118 173 /** 119 *Connect a signal with additionally passing the whole Object120 174 \brief Connect a signal with additionally passing the whole Object 175 */ 121 176 void Widget::connectSignal (char* event, gint (*signal)( GtkWidget*, Widget *)) 122 177 { … … 125 180 126 181 /** 127 *Connect a signal with additionally passing a whole external Object128 182 \brief Connect a signal with additionally passing a whole external Object 183 */ 129 184 void Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *)) 130 185 { … … 132 187 } 133 188 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 */ 148 193 void Widget::walkThrough (void (*function)(Widget*)) 149 194 { 150 195 function(this); 151 switch (this->is_option)196 if (this->is_option < 0) 152 197 { 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); 159 199 } 160 200 … … 163 203 } 164 204 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 169 208 */ 170 209 void Widget::listOptions (Widget* widget) 171 210 { 172 211 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. 179 218 */ 180 219 void Widget::setOptions (Widget* widget) … … 184 223 } 185 224 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 */ 234 void 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 */ 248 void 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 */ 257 char* 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 */ 192 268 void Container::init (void) 193 269 { 270 is_option = -1; 271 272 static_cast<Packer*>(this)->init(); 273 194 274 return; 195 275 } 196 276 197 277 /** 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. 201 281 */ 202 282 void Container::fill (Widget *lowerWidget) … … 215 295 /* WINDOW */ 216 296 217 218 *Creating a new Window without a Name219 297 /** 298 \brief Creating a new Window without a Name 299 */ 220 300 Window::Window (void) 221 301 { … … 224 304 225 305 /** 226 *Creating a Window with a name227 \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 */ 229 309 Window::Window (char* windowName) 230 310 { … … 234 314 235 315 /** 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 */ 247 318 void Window::init() 248 319 { 249 is_option = -1; 250 next = NULL; 251 down = NULL; 320 isOpen = true; 321 322 static_cast<Container*>(this)->init(); 323 252 324 widget = gtk_window_new (GTK_WINDOW_TOPLEVEL); 253 325 gtk_window_set_policy (GTK_WINDOW(widget), TRUE, TRUE, TRUE); … … 259 331 260 332 /** 261 *Shows all Widgets that are included within this->widget.262 333 \brief Shows all Widgets that are included within this->widget. 334 */ 263 335 void Window::showall () 264 336 { 337 isOpen = true; 265 338 gtk_widget_show_all (widget); 266 339 } 267 340 268 341 /** 269 *Set The Window-title to title270 \param title title the Window should get.342 \brief Set The Window-title to title 343 \param title title the Window should get. 271 344 */ 272 345 void Window::setTitle (char* title) 273 346 { 347 label=title; 274 348 gtk_window_set_title (GTK_WINDOW (widget), title); 275 349 } … … 295 369 296 370 /** 297 *Creates a new Frame without a name298 371 \brief Creates a new Frame without a name 372 */ 299 373 Frame::Frame (void) 300 374 { … … 303 377 304 378 /** 305 *Creates a new Frame with name title306 379 \brief Creates a new Frame with name title 380 */ 307 381 Frame::Frame (char* title) 308 382 { … … 311 385 } 312 386 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 */ 323 390 void Frame::init() 324 391 { 325 is_option = -1; 326 next = NULL; 327 down = NULL; 392 static_cast<Container*>(this)->init(); 393 328 394 widget = gtk_frame_new (""); 329 395 gtk_container_set_border_width (GTK_CONTAINER (widget), 3); … … 331 397 332 398 /** 333 *Sets the Frames name to title334 \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 */ 336 402 void Frame::setTitle (char* title) 337 403 { 404 label = title; 338 405 gtk_frame_set_label (GTK_FRAME (widget), title); 339 406 } … … 342 409 343 410 /** 344 *Creates a new EventBox with default settings.345 411 \brief Creates a new EventBox with default settings. 412 */ 346 413 EventBox::EventBox () 347 414 { … … 349 416 } 350 417 /** 351 *Creates a new EventBox with name title352 \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) 353 420 */ 354 421 EventBox::EventBox (char* title) … … 360 427 361 428 /** 362 *Initializes a new EventBox363 429 \brief Initializes a new EventBox 430 */ 364 431 void EventBox::init(void) 365 432 { 366 433 is_option = -1; 367 next = NULL; 368 down = NULL; 434 435 static_cast<Container*>(this)->init(); 436 369 437 widget = gtk_event_box_new (); 370 438 gtk_container_set_border_width (GTK_CONTAINER (widget), 3); … … 373 441 374 442 /** 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). 377 445 */ 378 446 void EventBox::setTitle (char* title) 379 447 { 380 381 } 382 383 /** 384 * Destructs an EventBox (not Implemented) 385 */ 386 EventBox::~EventBox () 387 { 388 } 389 448 label = title; 449 } 390 450 391 451 /* BOX */ 392 452 393 453 /** 394 *Creates a new horizontal Box395 454 \brief Creates a new horizontal Box 455 */ 396 456 Box::Box (void) 397 457 { … … 400 460 401 461 /** 402 *Creates a new Box of type boxtype403 \param boxtype if 'v' the Box will be vertically, if 'h' the Box will be horizontally404 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 */ 405 465 Box::Box (char boxtype) 406 466 { … … 409 469 410 470 /** 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) 420 473 */ 421 474 void Box::init(char boxtype) 422 475 { 423 476 is_option = -2; 424 next = NULL; 425 down = NULL;477 478 static_cast<Packer*>(this)->init(); 426 479 if (boxtype == 'v') 427 480 { … … 435 488 436 489 /** 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 Next439 \param lowerWidget the next Widget that should be appendet to this Box440 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 */ 441 494 void Box::fill (Widget *lowerWidget) 442 495 { 443 /**444 * Fill a Box with its lowerwidgets445 */446 496 gtk_box_pack_start (GTK_BOX (this->widget), lowerWidget->widget, TRUE, TRUE, 0); 447 497 if (this->down == NULL) … … 462 512 463 513 /** 464 *Creates a new Image465 \param imagename the location of the Image on the Hard Disc514 \brief Creates a new Image 515 \param imagename the location of the Image on the Hard Disc 466 516 */ 467 517 Image::Image (char* imagename) … … 469 519 this->init(); 470 520 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 */ 476 527 void Image::init() 477 528 { 478 529 is_option = 0; 479 next = NULL; 530 531 static_cast<Widget*>(this)->init(); 480 532 } 481 533 … … 484 536 485 537 /** 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 */ 488 541 void Option::init() 489 542 { 543 value = 0; 544 flag_name = ""; 545 flag_name_short = ""; 546 default_value = 0; 547 548 static_cast<Widget*>(this)->init(); 549 490 550 return; 491 551 } 492 552 493 553 /** 494 *This sets The FlagName of an Option and defines its default Values495 !! Options will be saved if flagname is different from "" !!496 \param flagname the Name that will be displayed in the output497 \param defaultvalue the default Value for this Option (see definition of defaultvalue554 \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 498 558 */ 499 559 void Option::setFlagName (char* flagname, int defaultvalue) … … 501 561 flag_name = flagname; 502 562 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 output509 \param defaultvalue the default Value for this Option (see definition of defaultvalue510 \param flagnameshort a short flagname to be displayed in the output563 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 511 571 */ 512 572 void Option::setFlagName (char* flagname, char* flagnameshort, int defaultvalue) … … 515 575 flag_name_short = flagnameshort; 516 576 default_value = defaultvalue; 517 cout << "Set Flagname of " << option_name<< " to " << flagname << endl;577 cout << "Set Flagname of " << label << " to " << flagname << endl; 518 578 } 519 579 … … 522 582 523 583 /** 524 *Creates a new Button with a buttonname525 \param buttonname sets the Name of the Button584 \brief Creates a new Button with a buttonname 585 \param buttonname sets the Name of the Button 526 586 */ 527 587 Button::Button(char* buttonname) … … 532 592 533 593 /** 534 *Initializes a new Button535 594 \brief Initializes a new Button 595 */ 536 596 void Button::init(void) 537 597 { 538 598 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 545 602 widget = gtk_button_new_with_label (""); 546 603 } 547 604 548 605 /** 549 *Sets a new name to the Button550 \param title The name the Button should get606 \brief Sets a new name to the Button 607 \param title The name the Button should get 551 608 */ 552 609 void Button::setTitle (char *title) 553 610 { 554 option_name= title;611 label = title; 555 612 gtk_button_set_label (GTK_BUTTON(widget), title); 556 613 } 557 614 558 615 /** 559 *redraws the Button560 *not implemented yet561 616 \brief redraws the Button 617 not implemented yet 618 */ 562 619 void Button::redraw () 563 620 { … … 567 624 568 625 /** 569 *Creates a new CheckButton with an ame570 \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 */ 572 629 CheckButton::CheckButton (char* buttonname) 573 630 { … … 578 635 } 579 636 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 */ 590 640 void CheckButton::init(void) 591 641 { 592 642 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 599 646 widget = gtk_check_button_new_with_label (""); 600 647 } 601 648 602 649 /** 603 *Sets a new Title to a CheckButton604 \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. 605 652 */ 606 653 void CheckButton::setTitle(char* title) 607 654 { 608 option_name= title;655 label = title; 609 656 gtk_button_set_label(GTK_BUTTON(widget), title); 610 657 } … … 612 659 613 660 /** 614 *Signal OptionChange writes the Value from the CheckButton to its Object-Database.615 \param widget The widget(CheckButton) that has a changed Value616 \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 */ 618 665 gint CheckButton::OptionChange (GtkWidget *widget, Widget* checkbutton) 619 666 { 620 667 static_cast<CheckButton*>(checkbutton)->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ((CheckButton*)checkbutton->widget)); 621 668 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 Change628 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 */ 629 676 void CheckButton::redraw () 630 677 { … … 635 682 636 683 /** 637 *Creates a new Slider638 \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. 641 688 */ 642 689 Slider::Slider (char* slidername, int start, int end) … … 649 696 650 697 /** 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 */ 661 701 void Slider::init(int start, int end) 662 702 { 663 703 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 670 707 widget = gtk_hscale_new_with_range (start, end, 5); 671 708 } 672 709 673 710 /** 674 *Sets a new Title to the Slider675 \param title The new Name of the slider711 \brief Sets a new Title to the Slider 712 \param title The new Name of the slider 676 713 */ 677 714 void Slider::setTitle(char* title) 678 715 { 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 display685 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 */ 686 723 void Slider::setValue(int value) 687 724 { … … 690 727 691 728 /** 692 *Signal OptionChange writes the Value from the Slider to its Object-Database.693 \param widget The widget(Slider) that has a changed Value694 \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 */ 696 733 gint Slider::OptionChange (GtkWidget *widget, Widget* slider) 697 734 { 698 735 static_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE ((Slider*)slider->widget)); 699 736 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 widget705 *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 */ 707 744 void Slider::redraw () 708 745 { … … 713 750 714 751 /** 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 Menu718 \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 */ 720 757 Menu::Menu (char* menuname, ...) 721 758 { … … 737 774 738 775 /** 739 *Initializes a new Menu with no items740 776 \brief Initializes a new Menu with no items 777 */ 741 778 void Menu::init(void) 742 779 { 743 780 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 749 784 widget = gtk_option_menu_new (); 750 785 menu = gtk_menu_new (); … … 758 793 void Menu::setTitle(char* title) 759 794 { 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. 766 801 */ 767 802 void Menu::addItem (char* itemName) … … 772 807 773 808 /** 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 */ 813 gint Menu::OptionChange (GtkWidget *widget, Widget* menu) 778 814 { 779 815 static_cast<Menu*>(menu)->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (menu->widget)); 780 816 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 widget786 *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 () 787 823 */ 788 824 void Menu::redraw () … … 792 828 793 829 /** 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 */ 797 833 Label:: Label () 798 834 { … … 801 837 802 838 /** 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. 805 841 */ 806 842 Label:: Label (char* text) 807 843 { 844 this->init(); 845 this->setText(text); 846 } 847 848 /** 849 \brief initializes a new Label 850 */ 851 void Label::init(void) 852 { 808 853 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 (""); 811 858 gtk_label_set_line_wrap (GTK_LABEL(widget), TRUE); 812 859 } 813 860 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 */ 836 865 void Label::setText (char * text) 837 866 { 867 label = text; 838 868 gtk_label_set_text (GTK_LABEL (this->widget), text); 839 869 } 840 870 841 871 /** 842 *get the Text of a Label843 \return The Text the Label holds.872 \brief get the Text of a Label 873 \return The Text the Label holds. 844 874 */ 845 875 char* Label::getText () -
orxonox/branches/buerli/gui/orxonox_gui.h
r2595 r2707 7 7 #define _ORXONOX_GUI_H 8 8 9 #if HAVE_CONFIG_H 10 #include <config.h> 11 #endif 12 9 13 #include <stdlib.h> 10 #include <string.h>11 14 #include <gtk/gtkmain.h> 12 15 #include <gtk/gtkwindow.h> … … 34 37 35 38 //! This is the topmost object that can be displayed all others are derived from it. 36 37 39 class Widget 38 40 { 39 41 private: 40 42 public: 43 ~Widget (); 44 41 45 Widget* next; //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next 42 46 GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains. 43 v irtual void init(void);47 void init(void); 44 48 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; 46 54 void connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *)); 47 55 void connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *)); 48 56 void connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *)); 49 57 void show (); 58 void hide (); 59 void setSize(int width, int height); 50 60 51 61 void walkThrough (void (*function)(Widget*)); … … 55 65 }; 56 66 67 //! This is a Packer Object, which has the ability to Pack other Widgets into itself. 68 class 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 }; 57 78 58 79 //! This is a Container Class, it can contain one sub-Widget: down. … … 62 83 * The derived classes of Container can be displayed 63 84 */ 64 class Container : public Widget85 class Container : public Packer 65 86 { 66 87 private: 67 88 int borderwidth; 68 89 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); 74 93 // void setBorderWidth (int borderwidth); 75 94 // virtual void setTitle (char* title) = 0; … … 84 103 class Window : public Container 85 104 { 105 private: 106 bool isOpen; 86 107 public: 87 108 Window (char* windowName); 88 109 Window (void); 89 ~Window ();90 110 void init (); 91 111 … … 105 125 Frame (char* frameName); 106 126 Frame (void); 107 ~Frame ();108 127 void init(void); 109 128 … … 120 139 EventBox (char* eventBoxName); 121 140 EventBox (void); 122 ~EventBox ();123 141 void init(void); 124 142 … … 132 150 * A Box is always filled left->right (horizontally) or up->down (vertically) 133 151 */ 134 class Box : public Widget152 class Box : public Packer 135 153 { 136 154 public: 137 155 Box (void); 138 156 Box (char boxtype); 139 ~Box (void);140 157 void init(char boxtype); 141 158 142 Widget* down; //!< the Lower Widget of a Box.143 159 void fill (Widget* lowerWidget); 144 160 … … 154 170 public: 155 171 Image (char* imgaename); 156 ~Image ();157 172 void init(void); 158 173 }; … … 169 184 170 185 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 them172 186 char* flag_name; //!< options have a flag name that will be appendet if you start the Program from the GUI. 173 187 char* flag_name_short; //!< like flag_name but shorter … … 187 201 public: 188 202 Button (char* buttonname); 189 ~Button (void);190 203 void init(void); 191 204 … … 202 215 public: 203 216 CheckButton (char* buttonname); 204 ~CheckButton (void);205 217 static gint OptionChange (GtkWidget* widget, Widget* checkbutton); 206 218 … … 219 231 public: 220 232 Slider (char* slidername,int start, int end); 221 ~Slider ();222 233 void init(int start, int end); 223 234 … … 239 250 public: 240 251 Menu (char* menuname, ...); 241 ~Menu ();242 252 void init(void); 243 253 … … 255 265 Label (); 256 266 Label (char* text); 257 ~Label ();258 267 void init(void); 259 268 -
orxonox/branches/buerli/gui/orxonox_gui_audio.cc
r2595 r2707 33 33 audioFrame = new Frame ("Audio-Options:"); 34 34 audioBox = new Box ('v'); 35 audioFrame->setGroupName ("audio"); 35 36 36 37 enableSound = new CheckButton ("Disable Sound"); -
orxonox/branches/buerli/gui/orxonox_gui_banner.cc
r2595 r2707 63 63 logoEventBox = new EventBox(); 64 64 logoBox = new Box('v'); 65 logoLabel = new Label("OrxOnoX ");65 logoLabel = new Label("OrxOnoX, " PACKAGE_VERSION); 66 66 logoImage = new Image("banner.xpm"); 67 67 logoEventBox->fill(logoImage); … … 88 88 { 89 89 logoWindowIsOpen = 0; 90 logoWindow-> ~Window();90 logoWindow->hide(); 91 91 } 92 92 -
orxonox/branches/buerli/gui/orxonox_gui_exec.cc
r2595 r2707 38 38 execFrame = new Frame ("Execute-Tags:"); 39 39 execBox = new Box ('v'); 40 execFrame->setGroupName ("misc"); 40 41 41 42 start = new Button ("Start"); … … 109 110 CONFIG_FILE = fopen (configFile, "w"); 110 111 if (CONFIG_FILE) 111 writeFileText (widget );112 writeFileText (widget, 0); 112 113 fclose (CONFIG_FILE); 113 114 } … … 116 117 \brief Actually writes into the configuration file to the disk. 117 118 \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 */ 121 void 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 121 149 if (widget->is_option >= 1) 122 150 if (strcmp (static_cast<Option*>(widget)->flag_name, "") || strcmp (static_cast<Option*>(widget)->flag_name_short, "")) … … 124 152 char Buffer[256]; 125 153 char* space2under; 126 sprintf (Buffer, "%s", static_cast<Option*>(widget)-> option_name);154 sprintf (Buffer, "%s", static_cast<Option*>(widget)->label); 127 155 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; 129 157 while (space2under = strchr(Buffer, ' ')) 130 158 { … … 133 161 fprintf (CONFIG_FILE, "%s = %i\n", Buffer, static_cast<Option*>(widget)->value); 134 162 } 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 145 164 if (widget->next != NULL) 146 writeFileText (widget->next );165 writeFileText (widget->next, depth); 147 166 } 148 167 … … 156 175 if (CONFIG_FILE) 157 176 { 177 Widget* groupWidget = widget; 158 178 char Buffer[256] = ""; 159 179 char Variable[256]= ""; … … 161 181 while (fscanf (CONFIG_FILE, "%s", Buffer) != EOF) 162 182 { 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 } 163 191 if (!strcmp (Buffer, "=")) 164 192 { … … 171 199 fscanf (CONFIG_FILE, "%s", Buffer); 172 200 Value = atoi(Buffer); 173 readFileText ( widget, Variable, Value);201 readFileText (groupWidget, Variable, Value, 0); 174 202 sprintf (Variable, ""); 175 203 } … … 179 207 } 180 208 } 181 182 209 /** 183 210 \brief Maps Confugurations to the Options. … … 185 212 \param variableName the name of the Variable that should be set up. 186 213 \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 */ 216 void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, int variableValue, int depth) 189 217 { 190 218 if (widget->is_option >= 1) 191 if (!strcmp (static_cast<Option*>(widget)-> option_name, variableName))219 if (!strcmp (static_cast<Option*>(widget)->label, variableName)) 192 220 static_cast<Option*>(widget)->value = variableValue; 193 221 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); 202 225 } 203 226 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 */ 234 Widget* 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; 206 264 } 207 265 -
orxonox/branches/buerli/gui/orxonox_gui_exec.h
r2595 r2707 33 33 int shouldsave (); 34 34 void writeToFile (Widget* widget); 35 void writeFileText (Widget* widget );35 void writeFileText (Widget* widget, int depth); 36 36 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); 38 39 39 40 }; -
orxonox/branches/buerli/gui/orxonox_gui_flags.cc
r2595 r2707 39 39 40 40 flagsLabel = new Label (); 41 flagsLabel->setSize (260,60); 41 42 flagsBox->fill (flagsLabel); 42 43 shortFlags = new CheckButton ("shortFlags"); -
orxonox/branches/buerli/gui/orxonox_gui_video.cc
r2595 r2707 32 32 videoFrame = new Frame ("Video-Options:"); 33 33 videoBox = new Box ('v'); 34 videoFrame->setGroupName("video"); 34 35 35 36 fullscreen = new CheckButton ("Fullscreen-mode");
Note: See TracChangeset
for help on using the changeset viewer.