Index: trunk/src/util/shell.cc
===================================================================
--- trunk/src/util/shell.cc	(revision 5159)
+++ 	(revision )
@@ -1,896 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-*/
-
-//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
-
-#include "shell.h"
-#include "shell_command.h"
-
-#include "text_engine.h"
-#include "list.h"
-#include "graphics_engine.h"
-#include "event_handler.h"
-#include "debug.h"
-#include "class_list.h"
-
-#include "key_names.h"
-#include <stdarg.h>
-#include <stdio.h>
-
-using namespace std;
-
-
-/**
- * standard constructor
- */
-Shell::Shell ()
-{
-  this->setClassID(CL_SHELL, "Shell");
-  this->setName("Shell");
-
-  this->keepBufferArray[0] = '\0';
-  this->keepBuffer = false;
-
-  this->bActive = false;
-  this->buffer = new tList<char>;
-  this->bufferIterator = this->buffer->getIterator();
-
-  this->inputHistory = new tList<char>;
-  //this->commandList = new tList<ShellCommand>;
-
-  this->textSize = 15;
-  this->lineSpacing = 5;
-
-  //this->bufferSize = 0;
-  this->bufferText = NULL;
-  this->setBufferSize(10);
-  this->bufferDisplaySize = 10;
-  this->setAbsCoor2D(3, -400);
-  this->delayed = 0;
-  this->setRepeatDelay(.3, .05);
-  this->pressedKey = SDLK_FIRST;
-
-  this->inputLineText = NULL;
-  this->inputLine = new char[1];
-  this->inputLine[0] = '\0';
-
-  this->rebuildText();
-  this->completionList = NULL;
-
-  // EVENT-Handler subscription of '`' to all States, and all other keyboard commands to ES_SEHLL
-  EventHandler* evh = EventHandler::getInstance();
-  evh->subscribe(this, ES_ALL, SDLK_BACKQUOTE);
-  for (int i = 1; i < SDLK_LAST; i++)
-    evh->subscribe(this, ES_SHELL, i);
-
-  //void ShellCommand<T>::registerCommand(const char* commandName, ClassID classID, T* object, void* functionPointer, unsigned int paramCount, ...)
-
-  ShellCommand<Shell>::registerCommand("clear", CL_SHELL, &Shell::clear);
-  ShellCommand<Shell>::registerCommand("testS", CL_SHELL, &Shell::testS);
-  ShellCommand<Shell>::registerCommand("testI", CL_SHELL, &Shell::testI, 5);
-  ShellCommand<Shell>::registerCommand("testB", CL_SHELL, &Shell::testB);
-  ShellCommand<Shell>::registerCommand("testF", CL_SHELL, &Shell::testF);
-  ShellCommand<Shell>::registerCommand("testSF", CL_SHELL, &Shell::testSF);
-}
-
-
-void Shell::testI (int i)
-{
-  PRINTF(3)("This is the Test for one Int '%d'\n", i);
-}
-
-void Shell::testS (const char* s)
-{
-  PRINTF(3)("This is the Test for one String '%s'\n", s);
-}
-
-void Shell::testB (bool b)
-{
-  PRINTF(3)("This is the Test for one Bool: ");
-  if (b)
-    PRINTF(3)("true\n");
-  else
-    PRINTF(3)("false\n");
-}
-
-void Shell::testF (float f)
-{
-  PRINTF(3)("This is the Test for one Float '%f'\n", f);
-}
-
-void Shell::testSF (const char* s, float f)
-{
-  PRINTF(3)("This is the Test for one String '%s' and one Float '%f'\n",s , f);
-}
-
-
-
-Shell* Shell::singletonRef = NULL;
-
-/**
- * standard deconstructor
- */
-Shell::~Shell ()
-{
-  // delete the displayable Buffers
-  for (int i = 0; i < this->bufferDisplaySize; i++)
-    delete this->bufferText[i];
-  delete[] this->bufferText;
-
-  // delete the inputLine
-  delete this->inputLineText;
-  delete this->inputLine;
-
-  // delete all the Chars in the Buffers
-  char* charElem = this->bufferIterator->firstElement();
-  while (charElem != NULL)
-  {
-    delete charElem;
-    charElem = this->bufferIterator->nextElement();
-  }
-  delete this->bufferIterator;
-
-//  if (this->completionList != NULL)
-    //delete this->completionList;
-
-  Shell::singletonRef = NULL;
-}
-
-/**
- * activates the shell
- *
- * This also feeds the Last few lines from the main buffers into the displayBuffer
- */
-void Shell::activate()
-{
-  if (this->bActive == true)
-    PRINTF(3)("The shell is already active\n");
-  this->bActive = true;
-
-  EventHandler::getInstance()->setState(ES_SHELL);
-  this->setRelCoorSoft2D(0, 0, 1, 5);
-
-  this->bufferIterator->lastElement();
-  for (int i = 0; i < this->bufferDisplaySize; i++)
-    this->bufferText[i]->setText(this->bufferIterator->prevElement(), true);
-}
-
-/**
- * deactiveates the Shell.
- */
-void Shell::deactivate()
-{
-  if (this->bActive == false)
-    PRINTF(3)("The shell is already inactive\n");
-  this->bActive = false;
-
-  EventHandler::getInstance()->setState(ES_GAME);
-  this->setRelCoorSoft2D(0, -400, 1, 5);
-
-  this->bufferIterator->lastElement();
-  for (int i = 0; i < this->bufferDisplaySize; i++)
-    this->bufferText[i]->setText(this->bufferIterator->prevElement(), false);
-}
-
-
-/**
- * sets the size of the text and spacing
- * @param textSize the size of the Text in Pixels
- * @param lineSpacing the size of the Spacing between two lines in pixels
- *
- * this also rebuilds the entire Text, inputLine and displayBuffer,
- * to be accurate again.
- */
-void Shell::setTextSize(unsigned int textSize, unsigned int lineSpacing)
-{
-  this->textSize = textSize;
-  this->lineSpacing = lineSpacing;
-
-  this->rebuildText();
-}
-
-/**
- * rebuilds the Text's
- *
- * use this function, if you changed the Font/Size or something else.
- */
-void Shell::rebuildText()
-{
-  if (this->inputLineText == NULL)
-    delete this->inputLineText;
-  this->inputLineText = TextEngine::getInstance()->createText("fonts/Aniron_Bold.ttf", this->textSize, TEXT_RENDER_DYNAMIC);
-  this->inputLineText->setColor(1, 0, 0);
-  this->inputLineText->setAlignment(TEXT_ALIGN_LEFT);
-  this->inputLineText->setText(NULL);
-  this->inputLineText->setParent2D(this);
-  this->inputLineText->setRelCoor2D(5, (this->textSize + this->lineSpacing)*this->bufferDisplaySize + this->textSize);
-
-  this->setBufferDisplaySize(this->bufferDisplaySize);
-}
-
-/**
- * sets The count of Lines to display in the buffer.
- * @param bufferDisplaySize the count of lines to display in the Shell-Buffer.
- */
-void Shell::setBufferDisplaySize(unsigned int bufferDisplaySize)
-{
-  if (this->bufferText != NULL)
-  {
-    for (unsigned int i = 0; i < this->bufferDisplaySize; i++)
-      delete this->bufferText[i];
-    delete[] this->bufferText;
-  }
-
-  this->bufferText = new Text*[bufferDisplaySize];
-  for (unsigned int i = 0; i < bufferDisplaySize; i++)
-  {
-    this->bufferText[i] = TextEngine::getInstance()->createText("fonts/Aniron_Bold.ttf", this->textSize, TEXT_RENDER_DYNAMIC);
-    this->bufferText[i]->setColor(1, 0, 0);
-    this->bufferText[i]->setAlignment(TEXT_ALIGN_LEFT);
-    this->bufferText[i]->setRelCoor2D(calculateLinePosition(i));
-    this->bufferText[i]->setText(NULL);
-    this->bufferText[i]->setParent2D(this);
-  }
-  this->bufferDisplaySize = bufferDisplaySize;
-
-  this->shellHeight = (this->textSize + this->lineSpacing) * (bufferDisplaySize+1);
-}
-
-/**
- * deletes all the Buffers
- */
-void Shell::flushBuffers()
-{
-  // remove all chars from the BufferTexts.
-  if (this->bufferText)
-    for (int i = 0; i < this->bufferDisplaySize; i++)
-    {
-      this->bufferText[i]->setText(NULL, true);
-    }
-
-  // delete all the Chars in the Buffers
-  tIterator<char>* charIterator = this->buffer->getIterator();
-  char* charElem = charIterator->firstElement();
-  while (charElem != NULL)
-  {
-    delete charElem;
-
-    charElem = charIterator->nextElement();
-  }
-  delete charIterator;
-  delete this->buffer;
-  this->buffer = new tList<char>;
-}
-
-/**
- * adds a new Line to the List of Buffers
- * @param line the Line as in the first argument in printf
- * @param args the arguments as a va_list
- */
-bool Shell::addBufferLineStatic(const char* line, ...)
-{
-  va_list arguments;
-  va_start(arguments, line);
-
-#if DEBUG < 3
-  if (Shell::singletonRef == NULL)
-#endif
-
-  vprintf(line, arguments);
-#if DEBUG < 3
-  else
-#else
-  if (Shell::singletonRef != NULL)
-#endif
-    Shell::singletonRef->addBufferLine(line, arguments);
-  return true;
-}
-
-/**
- * add a Line to the List of Buffers
- * @param line
- * @param arguments
- *
- * This function Adds one line to the buffer.
- * and displays the line as the First Line of the display-buffer
- */
-void Shell::addBufferLine(const char* line, va_list arguments)
-{
-   vsprintf(this->bufferArray, line, arguments);
-
-   char* inputEnd;
-   char* newLineBegin;
-   char* newLineEnd;
-
-   // check if we have something left in the buffers
-   if (unlikely(this->keepBuffer))
-   {
-     strcat(this->keepBufferArray, this->bufferArray);
-     inputEnd = this->keepBufferArray + strlen(this->keepBufferArray);
-     newLineBegin = this->keepBufferArray;
-     this->keepBuffer = false;
-   }
-   else
-   {
-     inputEnd = this->bufferArray + strlen(this->bufferArray);
-     newLineBegin = this->bufferArray;
-   }
-
-   // adding all the new Lines
-   while (newLineBegin < inputEnd)
-   {
-     newLineEnd = strchr(newLineBegin, '\n');
-     if (newLineEnd != NULL && *newLineEnd == '\n')
-       *newLineEnd = '\0';
-     else
-     {
-//       newLineEnd = newLineBegin + strlen(newLineBegin);
-       strcpy(this->keepBufferArray, newLineBegin);
-       this->keepBuffer = true;
-       break;
-     }
-
-     char* addLine = new char[strlen(newLineBegin)+1];
-     strcpy(addLine, newLineBegin);
-
-     this->buffer->add(addLine);
-
-     if (this->buffer->getSize() > this->bufferSize)
-     {
-       delete this->buffer->firstElement();
-       this->buffer->remove(this->buffer->firstElement());
-     }
-
-     if (this->bActive)
-     {
-       this->printToDisplayBuffer(addLine);
-     }
-     newLineBegin = newLineEnd+1;
-   }
-}
-
-/**
- * prints out some text to the input-buffers
- * @param text the text to output.
- */
-void Shell::printToDisplayBuffer(const char* text)
-{
-  if(likely(bufferText != NULL))
-  {
-    Text* lastText = this->bufferText[this->bufferDisplaySize-1];
-
-    Text* swapText;
-    Text* moveText = this->bufferText[0];
-    this->bufferText[0]->setRelCoorSoft2D(this->calculateLinePosition(1),10);
-    for (unsigned int i = 1; i < this->bufferDisplaySize; i++)
-    {
-      if ( i < this->bufferDisplaySize-1)
-        this->bufferText[i]->setRelCoorSoft2D(this->calculateLinePosition(i+1),5);
-      swapText = this->bufferText[i];
-      this  ->bufferText[i] = moveText;
-      moveText = swapText;
-    }
-    lastText->setRelCoor2D(this->calculateLinePosition(0));
-    this->bufferText[0] = lastText;
-
-    this->bufferText[0]->setText(text, true);
-  }
-}
-
-/**
- * moves the buffer around lineCount lines upwards (negative values move down)
- * @param lineCount the Count of lines to move upwards
- *
- * @todo
- */
-void Shell::moveBuffer(int lineCount)
-{
-}
-
-/**
- * @param lineNumber the n-th line from the bottom
- * @returns the Buffer at Line lineNumber
- */
-const char* Shell::getBufferLine(unsigned int lineNumber)
-{
-  tIterator<char>* charIterator = this->buffer->getIterator();
-  char* charElem = charIterator->firstElement();
-
-  int i = 1;
-  while (charElem != NULL)
-  {
-    if (i++ < lineNumber)
-    {
-      delete charIterator;
-      return charElem;
-    }
-
-    charElem = charIterator->nextElement();
-  }
-  delete charIterator;
-}
-
-/**
- * deletes the InputLine
- */
-void Shell::flushInputLine()
-{
-  if (likely(this->inputLine != NULL))
-  {
-    delete[] this->inputLine;
-  }
-  this->inputLine = new char[1];
-  *this->inputLine = '\0';
-  this->inputLineText->setText(this->inputLine, true);
-}
-
-/**
- * adds one character to the inputLine
- * @param character the character to add to the inputLine
- */
-void Shell::addCharacter(char character)
-{
-  char* addCharLine = new char[strlen(inputLine)+2];
-
-  sprintf(addCharLine, "%s%c", this->inputLine, character);
-  delete this->inputLine;
-  this->inputLine = addCharLine;
-  this->inputLineText->setText(inputLine, true);
-}
-
-/**
- * adds multiple Characters to thr inputLine
- * @param characters a '\0' terminated char-array to add to the InputLine
- */
-void Shell::addCharacters(const char* characters)
-{
-  char* addCharLine = new char[strlen(inputLine)+strlen(characters)+1];
-
-  sprintf(addCharLine, "%s%s", this->inputLine, characters);
-  delete this->inputLine;
-  this->inputLine = addCharLine;
-  this->inputLineText->setText(inputLine, true);
-}
-
-/**
- * removes characterCount characters from the InputLine
- * @param characterCount the count of Characters to remove from the input Line
- */
-void Shell::removeCharacters(unsigned int characterCount)
-{
-  if (strlen(this->inputLine) == 0)
-    return;
-
-  if (characterCount > strlen(this->inputLine))
-    characterCount = strlen(this->inputLine);
-
-  char* removeCharLine = new char[strlen(inputLine)-characterCount+1];
-
-  strncpy(removeCharLine, this->inputLine, strlen(inputLine)-characterCount);
-  removeCharLine[strlen(inputLine)-characterCount] = '\0';
-  delete this->inputLine;
-  this->inputLine = removeCharLine;
-  this->inputLineText->setText(inputLine, true);
-}
-
-/**
- * executes the command stored in the inputLine
- * @return true if the command was commited successfully, false otherwise
- */
-bool Shell::executeCommand()
-{
-  this->addBufferLineStatic("Execute Command: %s\n", this->inputLine);
-
-  char* newCommand = new char[strlen(this->inputLine)+1];
-  strcpy(newCommand, this->inputLine);
-  this->inputHistory->add(newCommand);
-
-  ShellCommandBase::execute(this->inputLine);
-
-  this->flushInputLine();
-
-  return false;
-}
-
-void Shell::clear()
-{
-  this->flushBuffers();
-  this->addBufferLine("orxonox - shell\n ==================== \n", NULL);
-}
-
-/**
- * sets the Repeate-delay and rate
- * @param repeatDelay the Delay it takes, to repeate a key
- * @param repeatRate the rate to repeate a pressed key
- */
-void Shell::setRepeatDelay(float repeatDelay, float repeatRate)
-{
-  this->repeatDelay = repeatDelay;
-  this->repeatRate = repeatRate;
-
-}
-
-/**
- * listens for some event
- * @param event the Event happened
- */
-void Shell::process(const Event &event)
-{
-  if (event.bPressed)
-  {
-    PRINTF(5)("Shell received command %s\n", SDLKToKeyname(event.type));
-    if (event.type == SDLK_BACKQUOTE)
-    {
-      if (EventHandler::getInstance()->getState() == ES_GAME)
-        this->activate();
-      else
-        this->deactivate();
-    }
-    else if (event.type == SDLK_F1)
-      this->help();
-    else if (event.type == SDLK_F2)
-      this->debug();
-    else if (event.type == SDLK_TAB)
-      this->autoComplete();
-    else if (event.type == SDLK_BACKSPACE)
-    {
-      this->delayed = this->repeatDelay;
-      this->pressedKey = SDLK_BACKSPACE;
-      this->removeCharacters(1);
-    }
-    else if (event.type == SDLK_RETURN)
-      this->executeCommand();
-    /*
-    else if (event.type == SDLK_UP)
-    {
-//      this->flushInputLine();
-      tIterator<char>* iterator = this->commandList->getIterator();
-      char* command = iterator->lastElement();
-      while (command)
-      {
-        if (!strcmp (command, inputLine))
-        {
-          inputLine = iterator->prevElement();
-          return;
-        }
-        command = iterator->prevElement();
-      }
-      inputLine = iterator->lastElement();
-    }
-    */
-    else if (likely(event.type < 127))
-    {
-      Uint8 *keystate = SDL_GetKeyState(NULL);
-      this->delayed = this->repeatDelay;
-      if (unlikely( keystate[SDLK_LSHIFT] || keystate[SDLK_RSHIFT] ))
-      {
-        this->pressedKey = event.type-32;
-        this->addCharacter(event.type-32);
-      }
-      else
-      {
-        this->pressedKey = event.type;
-        this->addCharacter(event.type);
-      }
-    }
-  }
-  else // if(!event.bPressed)
-  {
-    if (this->pressedKey == event.type || (this->pressedKey == event.type - 32))
-    {
-      this->pressedKey = SDLK_FIRST;
-      this->delayed = 0.0;
-    }
-  }
-}
-
-/**
- * ticks the Shell for dt Seconds
- * @param dt the elapsed time since the last tick();
- */
-void Shell::tick(float dt)
-{
-  if (this->delayed > 0.0)
-    this->delayed -= dt;
-  else if (this->pressedKey != SDLK_FIRST )
-  {
-    this->delayed = this->repeatRate;
-    if (this->pressedKey == SDLK_BACKSPACE)
-      this->removeCharacters(1);
-    else if (pressedKey < 127)
-      this->addCharacter(this->pressedKey);
-  }
-}
-
-/**
- * displays the Shell
- */
-void Shell::draw() const
-{
-  glPushMatrix();
-  // transform for alignment.
-  // setting the Blending effects
-
-  glColor4f(0.0f, 0.0f, 0.8f, .4);
-  glEnable(GL_BLEND);
-  glDisable(GL_TEXTURE_2D);
-  glBlendFunc(GL_SRC_ALPHA, GL_ONE);
-
-  glBindTexture(GL_TEXTURE_2D, 0);
-  glBegin(GL_TRIANGLE_STRIP);
-
-  glTexCoord2f(0, 0);
-  glVertex2f(this->getAbsCoor2D().x,   this->getAbsCoor2D().y  );
-
-  glTexCoord2f(1, 0);
-  glVertex2f(GraphicsEngine::getInstance()->getResolutionX() - this->getAbsCoor2D().x, this->getAbsCoor2D().y  );
-
-  glTexCoord2f(0, 1);
-  glVertex2f(this->getAbsCoor2D().x, this->getAbsCoor2D().y + this->shellHeight);
-
-  glTexCoord2f(1, 1);
-  glVertex2f(GraphicsEngine::getInstance()->getResolutionX() - this->getAbsCoor2D().x, this->getAbsCoor2D().y + this->shellHeight);
-
-  glEnd();
-}
-
-
-/**
- * autocompletes the Shell's inputLine
- * @returns true, if a result was found, false otherwise
- *
- * @todo implement it!!
- */
-bool Shell::autoComplete()
-{
-  //PRINTF(3)("AutoCompletion not implemented yet\n");
-
-  char* completionLine = new char[strlen(inputLine)+1];
-  strcpy(completionLine, this->inputLine);
-
-  char* commandBegin = strrchr(completionLine, ' ');
-  if (commandBegin == NULL)
-    commandBegin = completionLine;
-  else
-  {
-    if(commandBegin >= completionLine + strlen(completionLine))
-      commandBegin = completionLine + strlen(completionLine);
-    else
-      commandBegin++;
-  }
-
-  char* objectStart;
-  if (objectStart = strstr(commandBegin, "::"))
-  {
-    char* classIdentity = new char[objectStart - commandBegin +1];
-    strncpy(classIdentity, commandBegin, objectStart - commandBegin);
-    classIdentity[objectStart - commandBegin] = '\0';
-    this->objectComplete(objectStart+2, ClassList::StringToID(classIdentity));
-    delete[] classIdentity;
-  }
-  else
-    this->classComplete(commandBegin);
-
-  delete[] completionLine;
-}
-
-/**
- * autocompletes a className
- * @param classBegin the Beginning of a String to autoComplete
- * @return true on success, false otherwise
- */
-bool Shell::classComplete(const char* classBegin)
-{
-  if (unlikely(classBegin == NULL))
-    return false;
-  const tList<const char>* clList = ClassList::getClassList();
-  if (clList != NULL)
-  {
-    const tList<const char>* classList = this->createCompleteList(clList, classBegin);
-    if (classList != NULL)
-      this->generalComplete(classList, classBegin, "%s::", "::");
-    else
-      return false;
-  }
-  else
-    return false;
-  return true;
-}
-
-/**
- * autocompletes an ObjectName
- * @param objectBegin the beginning string of a Object
- * @param classID the ID of the Class to search for.
- * @return true on success, false otherwise
- */
-bool Shell::objectComplete(const char* objectBegin, long classID)
-{
-  printf("%s\n", objectBegin);
-
-  if (unlikely(objectBegin == NULL))
-    return false;
-  tList<BaseObject>* boList = ClassList::getList(classID);
-  if (boList != NULL)
-  {
-    printf("\n", boList->firstElement()->getName());
-    const tList<const char>* objectList = this->createCompleteList(boList, objectBegin);
-    if (objectList != NULL)
-      this->generalComplete(objectList, objectBegin, "%s");
-    else
-      return false;
-  }
-  else
-    return false;
-  return true;
-}
-
-bool Shell::functionComplete(const char* functionBegin)
-{
-}
-
-/**
- * completes the inputline on grounds of an inputList
- * @param stringList the List to parse through
- * @param begin the String to search in the inputList, and to extend with it.
- * @param displayAs how to display the found value to the user, printf-style, !!with only one %s!! ex.: "::%s::"
- * @param addBack what should be added at the end of the completion
- * @param addFront what should be added to the front of one finished completion
- * @return true if ok, false otherwise
- */
-bool Shell::generalComplete(const tList<const char>* stringList, const char* begin, const char* displayAs, const char* addBack, const char* addFront)
-{
-  if (stringList->getSize() == 0)
-    return false;
-
-  const char* addString = stringList->firstElement();
-  unsigned int addLength = 0;
-  unsigned int inputLenght = strlen(begin);
-
-  if (addString != NULL)
-    addLength = strlen(addString);
-  tIterator<const char>* charIterator = stringList->getIterator();
-  const char* charElem = charIterator->firstElement();
-  while (charElem != NULL)
-  {
-    PRINTF(0)(displayAs, charElem);
-    for (unsigned int i = inputLenght; i < addLength; i++)
-      if (addString[i] != charElem[i])
-    {
-      addLength = i;
-      break;
-    }
-    charElem = charIterator->nextElement();
-  }
-  delete charIterator;
-
-  if (addLength >= inputLenght)
-  {
-    char* adder = new char[addLength+1];
-    strncpy(adder, addString, addLength);
-    adder[addLength] = '\0';
-    this->removeCharacters(inputLenght);
-    this->addCharacters(adder);
-    if (addBack != NULL && stringList->getSize() == 1)
-      this->addCharacters("::");
-    delete[] adder;
-  }
-  return true;
-}
-
-/**
- * searches for classes, which beginn with classNameBegin
- * @param inputList the List to parse through
- * @param classNameBegin the beginning string
- * @return a NEW char-array with ClassNames. The LIST should be deleted afterwards,
- * !! The strings MUST NOT be deleted !!
- */
-const tList<const char>* Shell::createCompleteList(const tList<const char>* inputList, const char* classNameBegin)
-{
-  if (inputList == NULL || classNameBegin == NULL)
-    return NULL;
-  unsigned int searchLength = strlen(classNameBegin);
-  if (this->completionList != NULL)
-    delete this->completionList;
-  this->completionList = new tList<const char>;
-
-//  tList<const char>* classList = ClassList::getClassList();
-
-  tIterator<const char>* iterator = inputList->getIterator();
-  const char* enumString = iterator->firstElement();
-  while (enumString != NULL)
-  {
-    if (strlen(enumString)>searchLength+1 &&
-        !strncasecmp(enumString, classNameBegin, searchLength))
-    {
-      this->completionList->add(enumString);
-    }
-    enumString = iterator->nextElement();
-  }
-  delete iterator;
-
-  return this->completionList;
-}
-
-/**
- * searches for classes, which beginn with classNameBegin
- * @param inputList the List to parse through
- * @param classNameBegin the beginning string
- * @return a NEW char-array with ClassNames. The LIST should be deleted afterwards,
- * !! The strings MUST NOT be deleted !!
- */
-const tList<const char>* Shell::createCompleteList(const tList<BaseObject>* inputList, const char* classNameBegin)
-{
-  if (inputList == NULL || classNameBegin == NULL)
-    return NULL;
-  unsigned int searchLength = strlen(classNameBegin);
-  if (this->completionList != NULL)
-    delete this->completionList;
-  this->completionList = new tList<const char>;
-
-  tIterator<BaseObject>* iterator = inputList->getIterator();
-  BaseObject* enumBO = iterator->firstElement();
-  while (enumBO != NULL)
-  {
-    if (enumBO->getName() != NULL &&
-        strlen(enumBO->getName())>searchLength+1 &&
-        !strncasecmp(enumBO->getName(), classNameBegin, searchLength))
-    {
-      this->completionList->add(enumBO->getName());
-    }
-    enumBO = iterator->nextElement();
-  }
-  delete iterator;
-
-  return this->completionList;
-}
-
-void Shell::help() const
-{
-  PRINT(0)("Help for the most important Shell-commands\n");
-  PRINT(0)("F1 - HELP; F2 - DEBUG; ` - open/close shell\n");
-  PRINT(0)("input order:\n");
-  PRINT(0)("ClassName::objectName function [parameter1, [parameter2 ...]]  or\n");
-  PRINT(0)("Command [parameter]\n");
-}
-
-
-///////////////////////
-// HELPER FUNCTIONS  //
-///////////////////////
-Vector Shell::calculateLinePosition(unsigned int lineNumber)
-{
-  return Vector(5, (this->textSize + this->lineSpacing)*(this->bufferDisplaySize - lineNumber -1) + this->textSize, 0);
-}
-
-
-
-/**
- * displays some nice output from the Shell
- */
-void Shell::debug() const
-{
-  PRINT(3)("Debugging output to console (not this shell)\n");
-
-  if (this->pressedKey != SDLK_FIRST)
-    printf("%s::%f %f\n", SDLKToKeyname(this->pressedKey), this->delayed, this->repeatDelay);
-
-
-  char* tmpChar = this->bufferIterator->firstElement();
-  while(tmpChar != NULL)
-  {
-    printf(tmpChar);
-    tmpChar = this->bufferIterator->nextElement();
-  }
-}
Index: trunk/src/util/shell.h
===================================================================
--- trunk/src/util/shell.h	(revision 5159)
+++ 	(revision )
@@ -1,134 +1,0 @@
-/*!
- * @file shell.h
- * Definition of a on-screen-shell
-*/
-
-#ifndef _SHELL_H
-#define _SHELL_H
-
-#include "element_2d.h"
-#include "event_listener.h"
-
-#include <stdarg.h>
-
-#define      SHELL_BUFFER_SIZE       16384         //!< The Size of the input-buffers (should be large enough to carry any kind of input)
-
-// FORWARD DECLARATION
-class Text;
-class ShellCommandBase;
-template<class T> class tList;
-template<class T> class tIterator;
-
-//! A class that is able to redirect all output to a openGL-Shell, and that one can use to input some commands
-/**
- * the major idea is, that all the Output can be redirected to the Shell,
- * and does not have to be displayed to the opening Shell, this is good,
- * for developers using Windows, where all output is otherwise redirected
- * to stdout.txt
- *
- * Furthermore the Shell should enable us, to input some simple commands
- * Each Class can tell check itself in to the Shell, and listen for commands.
- *
- * @todo implement what is written above :/
- */
-class Shell : public Element2D, public EventListener {
-
-  public:
-    virtual ~Shell();
-    /** @returns a Pointer to the only object of this Class */
-    inline static Shell* getInstance() { if (!Shell::singletonRef) Shell::singletonRef = new Shell();  return Shell::singletonRef; };
-
-    void testI (int i);
-    void testS (const char* s);
-    void testB (bool b);
-    void testF (float f);
-    void testSF (const char* s, float f);
-
-    void activate();
-    void deactivate();
-
-    void setTextSize(unsigned int textSize, unsigned int lineSpacing = 1);
-    void rebuildText();
-
-    // BUFFER //
-    void setBufferSize(unsigned int bufferSize) { this->bufferSize = bufferSize; };
-    void setBufferDisplaySize(unsigned int bufferDisplaySize);
-    void flushBuffers();
-    static bool addBufferLineStatic(const char* line, ...);
-    void addBufferLine(const char* line, va_list arg);
-    void printToDisplayBuffer(const char* text);
-    void moveBuffer(unsigned int lineCount);
-    void moveBufferTo(unsigned int lineNumber);
-    const char* getBufferLine(unsigned int lineNumber);
-
-    // InputLine
-    void flushInputLine();
-    void addCharacter(char character);
-    void addCharacters(const char* characters);
-    void removeCharacters(unsigned int characterCount = 1);
-    bool executeCommand();
-
-    void clear();
-
-    void setRepeatDelay(float repeatDelay, float repeatRate);
-
-    // EventListener
-    virtual void process(const Event &event);
-
-    // Element2D-functions
-    void tick(float dt);
-    virtual void draw() const;
-
-    void help() const;
-    void debug() const;
-
-  private:
-    bool autoComplete();
-    bool classComplete(const char* classBegin);
-    bool objectComplete(const char* objectBegin, long classID);
-    bool functionComplete(const char* functionBegin);
-
-    bool generalComplete(const tList<const char>* stringList, const char* begin, const char* displayAs = "%s", const char* addBack = NULL, const char* addFront = NULL);
-
-    const tList<const char>* createCompleteList(const tList<const char>* inputList, const char* classNameBegin);
-    const tList<const char>* createCompleteList(const tList<BaseObject>* inputList, const char* classNameBegin);
-    const tList<const char>* createCompleteList(const tList<ShellCommandBase>* inputList, const char* classNameBegin);
-
-    // helpers //
-    Vector calculateLinePosition(unsigned int lineNumber);
-
-
-  private:
-    Shell();
-    static Shell*            singletonRef;           //!< The singleton-reference to the only memeber of this class.
-
-    unsigned int             bufferSize;             //!< The Size of the buffer
-    unsigned int             bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters)
-
-    Text*                    inputLineText;          //!< The inputLine of the Shell
-    char*                    inputLine;              //!< the Char-Array of the Buffer
-    float                    repeatRate;             //!< The Repeat-Delay.
-    float                    repeatDelay;            //!< The delay of the first Character of a given Character.
-    float                    delayed;                //!< how much of the delay is remaining.
-    int                      pressedKey;             //!< the pressed key that will be repeated.
-
-    tList<char>*             buffer;                 //!< A list of stored char-arrays(strings) to store the history
-    tIterator<char>*         bufferIterator;         //!< An iterator for the Shells main buffer.
-
-    tList<char>*             inputHistory;           //!< The history of given commands.
-
-    Text**                   bufferText;             //!< A list of stored bufferTexts for the display of the buffer
-    unsigned int             textSize;               //!< The size of the text.
-    unsigned int             lineSpacing;            //!< The Spacing between lines.
-    unsigned int             shellHeight;            //!< The hight of the Shell in Pixels
-    bool                     bActive;                //!< if the shell is active;
-
-    char                     bufferArray[SHELL_BUFFER_SIZE];     //!< a BUFFER for fast writing
-    char                     keepBufferArray[SHELL_BUFFER_SIZE]; //!< a BUFFER to have multi-non-newLine commands be copied into the shell.
-    bool                     keepBuffer;
-
-    // completion
-    tList<const char>*       completionList;          //!< A list of completions, that are io.
-};
-
-#endif /* _SHELL_H */
Index: trunk/src/util/shell_command.cc
===================================================================
--- trunk/src/util/shell_command.cc	(revision 5159)
+++ 	(revision )
@@ -1,277 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-*/
-
-//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
-
-#include "shell_command.h"
-
-#include "list.h"
-#include "debug.h"
-#include "class_list.h"
-
-#include "key_names.h"
-#include <stdarg.h>
-#include <stdio.h>
-
-using namespace std;
-
-ShellCommandBase::ShellCommandBase(const char* commandName, ClassID classID, unsigned int paramCount, ...)
-{
-  this->setClassID(CL_SHELL_COMMAND, "ShellCommand");
-  this->setName(commandName);
-
-  this->classID = classID;
-  this->className = ClassList::IDToString(classID);
-
-  if (classID & CL_MASK_SINGLETON == CL_MASK_SINGLETON)
-    this->isSingleton = true;
-  else
-    this->isSingleton = false;
-
-  // handling parameters, and storing them:
-  if (paramCount > FUNCTOR_MAX_ARGUMENTS)
-    paramCount = FUNCTOR_MAX_ARGUMENTS;
-  this->paramCount = paramCount;
-  this->parameters = new unsigned int[paramCount];
-
-  va_list parameterList;
-  va_start(parameterList, paramCount);
-
-  for (unsigned int i = 0; i < paramCount; i++)
-  {
-    this->parameters[i] = va_arg(parameterList, int);
-
-    switch (this->parameters[i])
-    {
-      case ParameterBool:
-        this->defaultBools[i] = va_arg(parameterList, int);
-        break;
-      case ParameterChar:
-        this->defaultStrings[i] = new char[2];
-        sprintf(this->defaultStrings[0], "%c",  va_arg(parameterList, int));
-        break;
-      case ParameterString:
-        this->defaultStrings[i] = va_arg(parameterList, char*);
-        break;
-      case ParameterInt:
-        this->defaultInts[i] = va_arg(parameterList, int);
-        break;
-      case ParameterUInt:
-        this->defaultInts[i] = va_arg(parameterList, unsigned int);
-        break;
-      case ParameterFloat:
-        this->defaultFloats[i] = va_arg(parameterList, double);
-        break;
-      case ParameterLong:
-        this->defaultInts[i] = va_arg(parameterList, long);
-        break;
-      default:
-        break;
-    }
-  }
-
-  // adding this ShellCommand to the list of known Commands
-  ShellCommandBase::commandList->add(this);
-}
-
-ShellCommandBase::~ShellCommandBase()
-{
-  delete[] this->parameters;
-}
-
-
-tList<ShellCommandBase>* ShellCommandBase::commandList = NULL;
-
-bool ShellCommandBase::isRegistered(const char* commandName, ClassID classID, unsigned int paramCount, ...)
-{
-  va_list parameterList;
-  va_start(parameterList, paramCount);
-
-  if (ShellCommandBase::commandList == NULL)
-  {
-    ShellCommandBase::commandList = new tList<ShellCommandBase>;
-    ShellCommand<ShellCommandBase>::registerCommand("debug", CL_SHELL_COMMAND, &ShellCommandBase::debug);
-    return false;
-  }
-
-  tIterator<ShellCommandBase>* iterator = ShellCommandBase::commandList->getIterator();
-  ShellCommandBase* elem = iterator->firstElement();
-  while(elem != NULL)
-  {
-    if (classID == elem->classID && !strcmp(commandName, elem->getName()))
-    {
-      PRINTF(2)("Command already registered\n");
-      delete iterator;
-      return true;
-    }
-    elem = iterator->nextElement();
-  }
-  delete iterator;
-  return false;
-}
-
-
-/**
- * executes commands
- * @param executionString the string containing the following input
- * ClassName [ObjectName] functionName [parameter1[,parameter2[,...]]]
- * @return true on success, false otherwise.
- */
-bool ShellCommandBase::execute(const char* executionString)
-{
-  if (ShellCommandBase::commandList == NULL)
-    return false;
-
-  tIterator<ShellCommandBase>* iterator = ShellCommandBase::commandList->getIterator();
-  ShellCommandBase* elem = iterator->firstElement();
-  while(elem != NULL)
-  {
-    printf("%s::%s\n", elem->className, elem->getName());
-    if (!strncasecmp (executionString, elem->className, strlen(elem->className)) &&
-         (*(executionString+strlen(elem->className)) == ' ' ||
-          *(executionString+strlen(elem->className)) == ':' ))
-    {
-      const char* commandBegin = executionString + strlen(elem->className);
-
-      PRINTF(4)("Class %s matches\n", elem->className);
-      BaseObject* objectPointer = NULL;
-      if (elem->isSingleton)
-      {
-        while(*commandBegin == ' ')
-          commandBegin++;
-        if (strncmp (commandBegin, elem->getName(), strlen(elem->getName())) ||
-            *(commandBegin + strlen(elem->getName())) != ' ' &&
-            *(commandBegin + strlen(elem->getName())) != '\0')
-        {
-          elem = iterator->nextElement();
-          continue;
-        }
-        PRINTF(4)("Command %s matches\n", elem->getName());
-        // getting singleton-reference
-        tList<BaseObject>* list =  ClassList::getList(elem->classID);
-        if (list != NULL)
-          objectPointer = list->firstElement();
-      }
-      else
-      {
-        // checking for the Object
-        while(*commandBegin == ' ')
-          commandBegin++;
-        tList<BaseObject>* list = ClassList::getList(elem->classID);
-        if (list == NULL)
-          break;
-        tIterator<BaseObject>* iterBO = list->getIterator();
-        BaseObject* enumBO = iterBO->firstElement();
-        while(enumBO != NULL)
-        {
-          if(!strncmp(commandBegin, enumBO->getName(), strlen(enumBO->getName())))
-          {
-            PRINTF(4)("Object %s matches\n", enumBO->getName());
-            objectPointer = enumBO;
-            break;
-          }
-          enumBO = iterBO->nextElement();
-        }
-        delete iterBO;
-
-        // break on no object Found. We cannot operate on Classes, but on Objects
-        if (objectPointer == NULL)
-          break;
-        commandBegin = commandBegin + strlen(objectPointer->getName());
-        while(*commandBegin == ' ')
-          commandBegin++;
-        // checking for the requested function.
-        if (strncmp (commandBegin, elem->getName(), strlen(elem->getName())))
-        {
-          elem = iterator->nextElement();
-          continue;
-        }
-        PRINTF(4)("Function '%s' found\n", commandBegin);
-      }
-      const char* paramBegin = strchr(commandBegin, ' ');
-      if (paramBegin == NULL)
-        paramBegin = commandBegin + strlen(elem->getName());
-      while (*paramBegin == ' ')
-        paramBegin++;
-
-      PRINTF(3)("Parameters to Pass: %s\n", paramBegin);
-      if (objectPointer != NULL && paramBegin != NULL)
-      {
-        elem->executeCommand(objectPointer, paramBegin);
-        delete iterator;
-        return true;
-      }
-    }
-    elem = iterator->nextElement();
-  }
-  delete iterator;
-  return true;
-}
-
-
-void ShellCommandBase::debug()
-{
-  if (ShellCommandBase::commandList == NULL)
-  {
-    PRINT(0)("No Command registered so far\n");
-    return;
-  }
-
-  tIterator<ShellCommandBase>* iterator = ShellCommandBase::commandList->getIterator();
-  ShellCommandBase* elem = iterator->firstElement();
-  while(elem != NULL)
-  {
-    PRINT(0)("Class %s registered command %s with %d parameters: ", elem->className, elem->getName(), elem->paramCount);
-    for (unsigned int i = 0; i< elem->paramCount; i++)
-      printf(ShellCommandBase::paramToString(elem->parameters[i]));
-    printf("\n");
-
-    elem = iterator->nextElement();
-  }
-  delete iterator;
-}
-
-
-
-const char* ShellCommandBase::paramToString(long parameter)
-{
-  switch (parameter)
-  {
-    case ParameterBool:
-      return "BOOL";
-      break;
-    case ParameterChar:
-      return "CHAR";
-      break;
-    case ParameterString:
-      return "STRING";
-      break;
-    case ParameterInt:
-      return "INT";
-      break;
-    case ParameterUInt:
-      return "UINT";
-      break;
-    case ParameterFloat:
-      return "FLOAT";
-      break;
-    case ParameterLong:
-      return "LONG";
-      break;
-    default:
-      return "NULL";
-      break;
-  }
-}
Index: trunk/src/util/shell_command.h
===================================================================
--- trunk/src/util/shell_command.h	(revision 5159)
+++ 	(revision )
@@ -1,237 +1,0 @@
-/*!
- * @file shell_command.h
- * Definition of a on-screen-shell
-*/
-
-#ifndef _SHELL_COMMAND_H
-#define _SHELL_COMMAND_H
-
-#include "base_object.h"
-
-#include "helper_functions.h"
-#include "substring.h"
-#include "functor_list.h"
-
-#include <stdarg.h>
-
-#define SHELL_COMMAND_MAX_SIZE
-
-
-
-// FORWARD DECLARATION
-template<class T> class tList;
-
-
-///////////////////////
-// MACRO DEFINITIONS //
-///////////////////////
-#define   l_BOOL_DEFGRAB(i)         this->defaultBools[i]
-#define   l_INT_DEFGRAB(i)          this->defaultInts[i]
-#define   l_UINT_DEFGRAB(i)         (unsigned int)this->defaultInts[i]
-#define   l_LONG_DEFGRAB(i)         (long)this->defaultInts[i]
-#define   l_FLOAT_DEFGRAB(i)        this->defaultFloats[i]
-#define   l_STRING_DEFGRAB(i)       this->defaultStrings[i]
-
-//////////////////////////
-// COMMAND REGISTRATION //
-//////////////////////////
-// NO ARGUMENTS
-#define ShellCommandRegister0() \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)()) \
-  { \
-    if (isRegistered(commandName, classID, 0)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function); \
-  }
-
-#define ShellCommandRegister1(t1) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE), t1##_TYPE d1 = t1##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 1, t1##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1); \
-  }
-
-#define ShellCommandRegister2(t1,t2) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 2, t1##_PARAM, t2##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1, d2); \
-  }
-
-#define ShellCommandRegister3(t1,t2,t3) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 3, t1##_PARAM, t2##_PARAM, t3##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1, d2, d3); \
-  }
-
-#define ShellCommandRegister4(t1,t2,t3,t4) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1, d2, d3, d4); \
-  }
-#define ShellCommandRegister5(t1,t2,t3,t4,t5) \
-  static void registerCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE), t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT, t5##_TYPE d5 = t5##_DEFAULT) \
-  { \
-    if (isRegistered(commandName, classID, 5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM)== true) \
-      return; \
-    new ShellCommand<T>(commandName, classID, function, d1, d2, d3, d4, d5); \
-  }
-
-//////////////////
-// CONSTRUCTORS //
-/////////////////
-#define ShellCommandConstructor0() \
-  void (T::*functionPointer_0)(); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)()) \
-  : ShellCommandBase(commandName, classID, 0) \
-  { \
-    this->functionPointer_0 = function; \
-  }
-
-#define ShellCommandConstructor1(t1) \
-  void (T::*functionPointer_1_##t1)(t1##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE), t1##_TYPE d1) \
-  : ShellCommandBase(commandName, classID, 1, t1##_PARAM, d1) \
-  { \
-    this->functionPointer_1_##t1 = function; \
-  }
-
-#define ShellCommandConstructor2(t1,t2) \
-  void (T::*functionPointer_2_##t1##_##t2)(t1##_TYPE, t2##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE), t1##_TYPE d1, t2##_TYPE d2) \
-  : ShellCommandBase(commandName, classID, 2, t1##_PARAM, d1, t2##_PARAM, d2) \
-  { \
-    this->functionPointer_2_##t1##_##t2 = function; \
-  }
-
-#define ShellCommandConstructor3(t1,t2,t3) \
-  void (T::*functionPointer_3_##t1##_##t2##_##t3)(t1##_TYPE, t2##_TYPE, t3##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3) \
-  : ShellCommandBase(commandName, classID, 3, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3) \
-  { \
-    this->functionPointer_3_##t1##_##t2##_##t3 = function; \
-  }
-
-#define ShellCommandConstructor4(t1,t2,t3,t4) \
-  void (T::*functionPointer_4_##t1##_##t2##_##t3##_##t4)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4) \
-  : ShellCommandBase(commandName, classID, 4, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4) \
-  { \
-    this->functionPointer_4_##t1##_##t2##_##t3##_##t4 = function; \
-  }
-
-#define ShellCommandConstructor5(t1,t2,t3,t4,t5) \
-  void (T::*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE); \
-  ShellCommand(const char* commandName, ClassID classID, void (T::*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4, t5##_TYPE d5) \
-  : ShellCommandBase(commandName, classID, 5, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4, t5##_PARAM, d5) \
-  { \
-    this->functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5 = function; \
-  }
-
-///////////////
-// EXECUTION //
-///////////////
-#define ShellCommandExecute0() \
-  if (this->paramCount == 0) \
-    (dynamic_cast<T*>(object)->*functionPointer_0)()
-
-#define ShellCommandExecute1(t1) \
-   else if (this->paramCount == 1 && this->parameters[0] == t1##_PARAM) \
-    (dynamic_cast<T*>(object)->*functionPointer_1_##t1)(t1##_FUNC(parameters, t1##_DEFGRAB(0)))
-
-#define ShellCommandExecute2(t1,t2) \
-   else if (this->paramCount == 2 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM) \
-    (dynamic_cast<T*>(object)->*functionPointer_2_##t1##_##t2)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)))
-
-#define ShellCommandExecute3(t1,t2,t3) \
-   else if (this->paramCount == 3 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM && this->parameters[2] == t3##_PARAM) \
-    (dynamic_cast<T*>(object)->*functionPointer_3_##t1##_##t2##_##t3)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)))
-
-#define ShellCommandExecute4(t1,t2,t3,t4) \
-   else if (this->paramCount == 4 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM && this->parameters[2] == t3##_PARAM && this->parameters[3] == t4##_PARAM) \
-    (dynamic_cast<T*>(object)->*functionPointer_4_##t1##_##t2##_##t3##_##t4)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3)))
-
-#define ShellCommandExecute5(t1,t2,t3,t4,t5) \
-   else if (this->paramCount == 5 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM && this->parameters[2] == t3##_PARAM && this->parameters[3] == t4##_PARAM && this->parameters[4] == t5##_PARAM) \
-    (dynamic_cast<T*>(object)->*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3)), t5##_FUNC(sub.getString(4), t5##_DEFGRAB(4)))
-
-
-
-////////////////
-// BASE CLASS //
-////////////////
-//! a baseClass for all possible ShellCommands
-class ShellCommandBase : public BaseObject
-{
-  public:
-    static bool execute (const char* executionString);
-
-    static const tList<ShellCommandBase>* getCommandList() { return ShellCommandBase::commandList; };
-
-
-  protected:
-    ShellCommandBase(const char* commandName, ClassID classID, unsigned int paramCount, ...);
-    ~ShellCommandBase();
-
-    static bool isRegistered(const char* commandName, ClassID classID, unsigned int paramCount, ...);
-    static const char* paramToString(long parameter);
-
-    void debug();
-  private:
-    virtual void executeCommand (BaseObject* object, const char* parameters) = NULL;
-
-  protected:
-    void*                            functionPointer;     //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL )
-    unsigned int                     paramCount;          //!< the count of parameters
-    unsigned int*                    parameters;          //!< Parameters
-    bool                             isSingleton;         //!< if the Class is Singleton @todo autocheck
-    char*                            defaultStrings[FUNCTOR_MAX_ARGUMENTS];
-    int                              defaultInts[FUNCTOR_MAX_ARGUMENTS];
-    float                            defaultFloats[FUNCTOR_MAX_ARGUMENTS];
-    bool                             defaultBools[FUNCTOR_MAX_ARGUMENTS];
-
-  private:
-    long                             classID;             //!< The ID of the Class associated to this Command
-    const char*                      className;           //!< The Name of the Class associated to this Command
-
-    // STATIC MEMBERS
-    static tList<ShellCommandBase>*  commandList;         //!< A list of availiable commands.
-};
-
-//! keeps information about a ShellCommand
-template<class T> class ShellCommand : public ShellCommandBase
-{
-  public:
-    static void unregisterCommand(const char* commandNaame, ClassID classID);
-
-#ifdef FUNCTOR_LIST
-#undef FUNCTOR_LIST
-#endif
-
-#define FUNCTOR_LIST(x) ShellCommandRegister ## x
-#include "functor_list.h"
-#undef FUNCTOR_LIST
-
-
-  private:
-#define FUNCTOR_LIST(x) ShellCommandConstructor ## x
-#include "functor_list.h"
-#undef FUNCTOR_LIST
-
-    virtual void executeCommand (BaseObject* object, const char* parameters)
-    {
-//      if (parameters != NULL)
-      SubString sub(parameters);
-#define FUNCTOR_LIST(x) ShellCommandExecute ## x
-#include "functor_list.h"
-#undef FUNCTOR_LIST
-    }
-};
-
-#endif /* _SHELL_COMMAND_H */
