Index: trunk/src/lib/shell/Makefile.am
===================================================================
--- trunk/src/lib/shell/Makefile.am	(revision 9406)
+++ trunk/src/lib/shell/Makefile.am	(revision 9869)
@@ -6,5 +6,4 @@
 libORXshell_a_SOURCES = \
 		shell.cc \
-		shell_buffer.cc \
 		shell_input.cc \
 		shell_command.cc \
@@ -16,8 +15,7 @@
 noinst_HEADERS= \
 		shell.h \
-		shell_buffer.h \
 		shell_input.h \
+		shell_command_class.h \
 		shell_command.h \
-		shell_command_class.h \
 		shell_completion.h \
 		shell_completion_plugin.h
Index: trunk/src/lib/shell/shell.cc
===================================================================
--- trunk/src/lib/shell/shell.cc	(revision 9406)
+++ trunk/src/lib/shell/shell.cc	(revision 9869)
@@ -18,5 +18,5 @@
 #include "shell.h"
 #include "shell_command.h"
-#include "shell_buffer.h"
+#include "debug_buffer.h"
 #include "shell_input.h"
 
@@ -54,4 +54,5 @@
   ->completionPlugin(0, OrxShell::CompletorFileSystem(".ttf", "fonts/"));
 
+  ObjectListDefinition(Shell);
 
   /**
@@ -60,8 +61,9 @@
   Shell::Shell ()
   {
-    this->setClassID(CL_SHELL, "Shell");
+    this->registerObject(this, Shell::_objectList);
+
     this->setName("Shell");
 
-    this->shellBuffer = ShellBuffer::getInstance();
+    this->shellBuffer = DebugBuffer::getInstance();
 
     // EVENT-Handler subscription of '`' to all States.
@@ -246,7 +248,5 @@
     this->setSizeX2D(width);
     for (std::list<MultiLineText*>::iterator textIt = this->bufferText.begin(); textIt != this->bufferText.end(); ++textIt)
-    {
       (*textIt)->setLineWidth(width);
-    }
   }
 
@@ -444,5 +444,5 @@
   {
     this->flush();
-    ShellBuffer::addBufferLineStatic("orxonox - shell\n ==================== \n", NULL);
+    DebugBuffer::addBufferLineStatic("orxonox - shell\n ==================== \n", NULL);
   }
 
@@ -470,9 +470,9 @@
         this->moveDisplayBuffer(-this->bufferDisplaySize+1);
       }
-      else if (event.type == EV_VIDEO_RESIZE)
-      {
-        this->updateResolution(event.resize.w);
-        this->repositionText();
-      }
+    }
+    else if (event.type == EV_VIDEO_RESIZE)
+    {
+      this->updateResolution(event.resize.w);
+      this->repositionText();
     }
   }
Index: trunk/src/lib/shell/shell.h
===================================================================
--- trunk/src/lib/shell/shell.h	(revision 9406)
+++ trunk/src/lib/shell/shell.h	(revision 9869)
@@ -14,5 +14,5 @@
 
 #include "shell_input.h"
-#include "shell_buffer.h"
+#include "debug_buffer.h"
 #include "material.h"
 
@@ -48,5 +48,5 @@
   class Shell : public Element2D, public EventListener
   {
-
+    ObjectListDeclaration(Shell);
   public:
     Shell();
@@ -93,5 +93,5 @@
   private:
     // GENERAL
-    ShellBuffer*                shellBuffer;            //!< The local ShellBuffer.
+    DebugBuffer*                shellBuffer;            //!< The local ShellBuffer.
 
     bool                        bActive;                //!< If the shell is active.
Index: trunk/src/lib/shell/shell_buffer.cc
===================================================================
--- trunk/src/lib/shell/shell_buffer.cc	(revision 9406)
+++ 	(revision )
@@ -1,139 +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_SHELL
-
-#include "shell_buffer.h"
-
-#include <stdarg.h>
-
-#include "debug.h"
-#include "shell.h"
-#include "lib/util/threading.h"
-
-namespace OrxShell
-{
-  /**
-   * @brief standard constructor
-   */
-  ShellBuffer::ShellBuffer ()
-  {
-    ShellBuffer::singletonRef = this;
-
-    this->lineCount = 0;
-    this->bufferArray[0] = '\0';
-
-    this->setMaxBufferSize(100);
-  }
-
-  ShellBuffer* ShellBuffer::singletonRef = NULL;
-  std::list<std::string> ShellBuffer::buffer;
-  char ShellBuffer::bufferArray[SHELL_BUFFER_SIZE] = "";
-
-
-  /**
-   * @brief standard deconstructor
-   */
-  ShellBuffer::~ShellBuffer ()
-  {
-    ShellBuffer::singletonRef = NULL;
-  }
-
-  /**
-   * @brief deletes all the Buffers
-   */
-  void ShellBuffer::flush()
-  {
-    this->buffer.clear();
-  }
-
-  /**
-   * @brief adds a new Line to the List of Buffers
-   * @param line the Line as in the first argument in printf
-   */
-  void ShellBuffer::addBufferLineStatic(const char* line, ...)
-  {
-    static OrxThread::Mutex ShellBuffer__bufferMutex;
-
-    OrxThread::MutexLock bufferLock(&ShellBuffer__bufferMutex);
-
-    va_list arguments;
-    va_start(arguments, line);
-    vsnprintf(ShellBuffer::bufferArray, SHELL_BUFFER_SIZE, line, arguments);
-    va_end(arguments);
-
-#if DEBUG_LEVEL < 3
-    if (ShellBuffer::singletonRef == NULL)
-#endif
-      printf(ShellBuffer::bufferArray);
-#if DEBUG_LEVEL < 3
-    else
-#else
-    if (ShellBuffer::singletonRef != NULL)
-#endif
-      ShellBuffer::singletonRef->addBufferLine(ShellBuffer::bufferArray);
-  }
-
-  /**
-   * @brief 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 ShellBuffer::addBufferLine(const char* line)
-  {
-    std::string inputBuffer = this->keepBuffer + line;
-
-    unsigned int lineBegin = 0;
-    unsigned int lineEnd = 0;
-    // adding all the new Lines
-    while (lineEnd < inputBuffer.size())
-    {
-      lineBegin = lineEnd;
-      lineEnd = inputBuffer.find('\n', (lineBegin == 0) ? 0: ++lineBegin);
-      if (likely(lineEnd != std::string::npos ))
-      {
-        this->lineCount++;
-        this->buffer.push_front(inputBuffer.substr(lineBegin, lineEnd - lineBegin));
-      }
-      else      // No end of Line reached.
-      {
-        this->keepBuffer = inputBuffer.substr(lineBegin, inputBuffer.size() - lineBegin);
-        break;
-      }
-
-      if (inputBuffer[lineBegin] == '\n')
-        lineBegin++, lineEnd++;
-
-      if (this->buffer.size() > this->maxBufferSize)
-        this->buffer.pop_back();
-    }
-  }
-
-  /**
-   * @brief displays some nice output from the Shell
-   */
-  void ShellBuffer::debug() const
-  {
-    PRINT(3)("Debugging output to console (not this shell)\n");
-
-    std::list<std::string>::const_iterator bufferLine;
-    for (bufferLine = --this->buffer.end(); bufferLine != this->buffer.begin(); --bufferLine)
-      printf((*bufferLine).c_str());
-  }
-
-}
Index: trunk/src/lib/shell/shell_buffer.h
===================================================================
--- trunk/src/lib/shell/shell_buffer.h	(revision 9406)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/*!
- * @file shell_buffer.h
- * @brief The Shell buffer Tasks
- * @see debug.h
-*/
-
-#ifndef _SHELL_BUFFER_H
-#define _SHELL_BUFFER_H
-
-#include <string>
-#include <list>
-#include <stdarg.h>
-
-#define      SHELL_BUFFER_SIZE       16384         //!< The Size of the input-buffers (should be large enough to carry any kind of input)
-
-namespace OrxShell
-{
-  //! A class handling output from orxonox via debug.h
-  /**
-   * the ShellBuffer redirects output from PRINTF(x) to the Shell and STDOUT
-   * the ShellBuffer is a front-filling queue of limited length, that has the
-   * youngest added Entry at the beginning, and the oldest at the end.
-   */
-  class ShellBuffer
-  {
-
-  public:
-    virtual ~ShellBuffer();
-    /** @returns a Pointer to the only object of this Class */
-    inline static ShellBuffer* getInstance() { if (!ShellBuffer::singletonRef) ShellBuffer::singletonRef = new ShellBuffer();  return ShellBuffer::singletonRef; };
-    /** @returns true if this class is instanciated, false otherwise */
-    inline static bool isInstanciated() { return (ShellBuffer::singletonRef == NULL)?false:true; };
-
-    static void addBufferLineStatic(const char* line, ...);
-    void addBufferLine(const char* line);
-
-    /// BUFFER
-    /** @param bufferSize the new Buffer-Size */
-    void setMaxBufferSize(unsigned int maxBufferSize) { this->maxBufferSize = maxBufferSize; };
-    void flush();
-
-    /** @returns the List of stings from the Buffer */
-    const std::list<std::string>& getBuffer() const { return this->buffer; };
-    /** @returns the Count of lines processed by the Shell. */
-    inline unsigned long getLineCount() const { return this->lineCount; };
-    /** @returns the Current Buffer Size. */
-    inline unsigned int getBufferSize() const { return this->buffer.size(); };
-
-    void debug() const;
-
-  private:
-    ShellBuffer();
-
-  private:
-    static ShellBuffer*           singletonRef;                       //!< The singleton-reference to the only memeber of this class.
-    unsigned int                  maxBufferSize;                         //!< The Size of the buffer
-
-    std::string                   keepBuffer;                         //!< a BUFFER to have multi-non-newLine commands be copied into the shell.
-
-    unsigned long                 lineCount;                          //!< how many Lines have been written out so far.
-
-    // The Beginning of buffer (buffer.front()) is the last added line.
-    static char                   bufferArray[SHELL_BUFFER_SIZE];     //!< a BUFFER for fast writing
-    static std::list<std::string> buffer;                             //!< A list of stored char-arrays(strings) to store the history
-  };
-
-}
-
-#endif /* _SHELL_BUFFER_H */
Index: trunk/src/lib/shell/shell_command.cc
===================================================================
--- trunk/src/lib/shell/shell_command.cc	(revision 9406)
+++ trunk/src/lib/shell/shell_command.cc	(revision 9869)
@@ -20,6 +20,6 @@
 
 #include "compiler.h"
+#include "helper_functions.h"
 #include "debug.h"
-#include "class_list.h"
 
 #include "key_names.h"
@@ -27,4 +27,5 @@
 namespace OrxShell
 {
+  ObjectListDefinition(ShellCommand);
   SHELL_COMMAND(debug, ShellCommandClass, help);
 
@@ -36,7 +37,7 @@
    * @param paramCount the count of parameters this command takes
    */
-  ShellCommand::ShellCommand(const std::string& commandName, const std::string& className, Executor* executor)
-  {
-    this->setClassID(CL_SHELL_COMMAND, "ShellCommand");
+  ShellCommand::ShellCommand(const std::string& commandName, const std::string& className, Executor<const SubString>* executor)
+  {
+    this->registerObject(this, ShellCommand::_objectList);
     PRINTF(4)("create shellcommand '%s' for class '%s'\n", commandName.c_str(), className.c_str());
     this->setName(commandName);
@@ -44,5 +45,4 @@
     // copy the executor:
     this->executor = executor;
-    this->executor->setName(commandName);
 
     for (unsigned int i = 0; i < this->executor->getParamCount(); i++)
@@ -75,5 +75,5 @@
    * @brief registers a new ShellCommand
    */
-  ShellCommand* ShellCommand::registerCommand(const std::string& commandName, const std::string& className, Executor* executor)
+  ShellCommand* ShellCommand::registerCommand(const std::string& commandName, const std::string& className, Executor<const SubString>* executor)
   {
     if (ShellCommand::exists(commandName, className))
@@ -94,10 +94,9 @@
   void ShellCommand::unregisterCommand(const std::string& commandName, const std::string& className)
   {
-
     ShellCommandClass* cmdClass = ShellCommandClass::acquireCommandClass(className);
     if (cmdClass != NULL)
     {
       CmdList::iterator cmd;
-      for (cmd = cmdClass->commandList.begin(); cmd != cmdClass->commandList.end(); cmd++)
+      for (cmd = cmdClass->_commandList.begin(); cmd != cmdClass->_commandList.end(); cmd++)
         if (commandName == (*cmd)->getName())
         {
@@ -119,8 +118,8 @@
 
     CmdList::const_iterator elem;
-    for (unsigned int i = 0; i < cmdClass->commandList.size(); i++)
-    {
-      if (commandName == cmdClass->commandList[i]->getName())
-        return (cmdClass->commandList[i]);
+    for (unsigned int i = 0; i < cmdClass->_commandList.size(); i++)
+    {
+      if (commandName == cmdClass->_commandList[i]->getName())
+        return (cmdClass->_commandList[i]);
     }
     return NULL;
@@ -242,21 +241,23 @@
       return false;
 
-    const std::list<BaseObject*>* objectList = ClassList::getList(cmd->shellClass->getName());
+    const ObjectListBase* const objectList = ObjectListBase::getObjectList(cmd->shellClass->getName());
     if (objectList != NULL)
     {
-      std::list<BaseObject*>::const_iterator bo;
+      ObjectListBase::base_list list;
+      objectList->getBaseObjectList(&list);
+      ObjectListBase::base_iterator it;
 
       // No Description given (only for speedup)
       if (objectDescriptor.empty())
       {
-        for (bo = objectList->begin(); bo != objectList->end(); bo++)
-          boList->push_back(*bo);
+        for (it = list.begin(); it != list.end(); it++)
+          boList->push_back(*it);
       }
       // some description
       else
       {
-        for (bo = objectList->begin(); bo != objectList->end(); bo++)
-          if (!nocaseCmp(objectDescriptor, (*bo)->getName(), objectDescriptor.size()))
-            boList->push_back(*bo);
+        for (it = list.begin(); it != list.end(); it++)
+          if (!nocaseCmp(objectDescriptor, (*it)->getName(), objectDescriptor.size()))
+            boList->push_back(*it);
       }
     }
@@ -299,9 +300,16 @@
     if (sc != NULL)
     {
-      for(std::vector<BaseObject*>::const_iterator bo = boList.begin(); bo != boList.end(); ++bo)
-      {
-        PRINT(0)("Command '%s' on '%s::%s'\n", sc->getCName(), (*bo)->getClassCName(), (*bo)->getCName());
-        (*sc->executor)((*bo), inputSplits.subSet(paramBegin));
-      }
+
+      if(sc->executor->getType() == Executor<const SubString>::FunctionStatic )
+      {
+	PRINT(0)("Static Command '%s' of Class '%s' with parameters\n", sc->getCName(), sc->shellClass->getCName());
+	(*sc->executor)(NULL, inputSplits.subSet(paramBegin));
+      }
+      else
+        for(std::vector<BaseObject*>::const_iterator bo = boList.begin(); bo != boList.end(); ++bo)
+        {
+          PRINT(0)("Command '%s' on '%s::%s'\n", sc->getCName(), (*bo)->getClassCName(), (*bo)->getCName());
+          (*sc->executor)((*bo), inputSplits.subSet(paramBegin));
+        }
       return true;
     }
@@ -376,7 +384,7 @@
     else
     {
-//       if(this->completors[parameter] == NULL)
-//       delete this->completors[parameter];
-//       this->completors[parameter] = completorPlugin.clone();
+      //       if(this->completors[parameter] == NULL)
+      //       delete this->completors[parameter];
+      //       this->completors[parameter] = completorPlugin.clone();
     }
     return this;
Index: trunk/src/lib/shell/shell_command.h
===================================================================
--- trunk/src/lib/shell/shell_command.h	(revision 9406)
+++ trunk/src/lib/shell/shell_command.h	(revision 9869)
@@ -9,5 +9,10 @@
 #include "base_object.h"
 
-#include "executor/executor.h"
+/// THIS IS USED TO LOAD CONSTANT AND STATIC FUNCTIONS EASILY.
+#include "executor/executor_substring.h"
+#include "executor/functor_member.h"
+#include "executor/functor_const_member.h"
+#include "executor/functor_static.h"
+
 #include "shell_completion_plugin.h"
 
@@ -35,5 +40,5 @@
    */
 #define SHELL_COMMAND(command, class, function) \
-           OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class>(&class::function))
+           OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class, BaseObject>(&class::function))
 
   /**
@@ -51,5 +56,5 @@
    */
 #define SHELL_COMMAND_STATIC(command, class, function) \
-           OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class>(function))
+           OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class, BaseObject>(function))
 
 
@@ -58,4 +63,6 @@
   class ShellCommand : public BaseObject
   {
+    ObjectListDeclaration(ShellCommand);
+
     friend class ShellCommandClass;
   public:
@@ -69,5 +76,5 @@
     ShellCommand* completionPlugin(unsigned int parameter, const CompletorPlugin& completorPlugin);
 
-    static ShellCommand* registerCommand(const std::string& commandName, const std::string& className, Executor* executor);
+    static ShellCommand* registerCommand(const std::string& commandName, const std::string& className, Executor<const SubString>* executor);
     static void unregisterCommand(const std::string& commandName, const std::string& className);
     static const ShellCommand* const getCommand(const std::string& commandName, const std::string& className);
@@ -85,5 +92,5 @@
 
   protected:
-    ShellCommand(const std::string& commandName, const std::string& className, Executor* executor);
+    ShellCommand(const std::string& commandName, const std::string& className, Executor<const SubString>* executor);
     virtual ~ShellCommand();
 
@@ -97,5 +104,5 @@
     std::string                      description;           //!< A description for this commnand. (initially ""). Assigned with (create)->describe("blablabla");
     std::vector<CompletorPlugin*>    completors;            //!< Completors for the Parameters
-    Executor*                        executor;              //!< The Executor, that really executes the Function.
+    Executor<const SubString>*       executor;              //!< The Executor, that really executes the Function.
   };
 
Index: trunk/src/lib/shell/shell_command_class.cc
===================================================================
--- trunk/src/lib/shell/shell_command_class.cc	(revision 9406)
+++ trunk/src/lib/shell/shell_command_class.cc	(revision 9869)
@@ -21,5 +21,4 @@
 
 #include "debug.h"
-#include "class_list.h"
 #include "compiler.h"
 
@@ -28,5 +27,7 @@
 namespace OrxShell
 {
-  CmdClassList* ShellCommandClass::commandClassList = NULL;
+  ObjectListDefinition(ShellCommandClass);
+
+  CmdClassList* ShellCommandClass::_commandClassList = NULL;
 
   /**
@@ -35,14 +36,12 @@
    */
   ShellCommandClass::ShellCommandClass(const std::string& className)
-      : className(className)
-  {
-    this->setClassID(CL_SHELL_COMMAND_CLASS, "ShellCommandClass");
+      : _className(className)
+  {
+    this->registerObject(this, ShellCommandClass::_objectList);
     this->setName(className);
 
-    this->classID = CL_NULL;
-
-    if (ShellCommandClass::commandClassList == NULL)
-      ShellCommandClass::commandClassList = new CmdClassList;
-    ShellCommandClass::commandClassList->push_back(this);
+    if (ShellCommandClass::_commandClassList == NULL)
+      ShellCommandClass::_commandClassList = new CmdClassList;
+    ShellCommandClass::_commandClassList->push_back(this);
   }
 
@@ -52,12 +51,12 @@
   ShellCommandClass::~ShellCommandClass()
   {
-    while(!this->commandList.empty())
-      delete this->commandList.back();
-
-    if (ShellCommandClass::commandClassList != NULL)
-    {
-      CmdClassList::iterator delClass = std::find(ShellCommandClass::commandClassList->begin(), ShellCommandClass::commandClassList->end(), this);
-      if (delClass != ShellCommandClass::commandClassList->end())
-        ShellCommandClass::commandClassList->erase(delClass);
+    while(!this->_commandList.empty())
+      delete this->_commandList.back();
+
+    if (ShellCommandClass::_commandClassList != NULL)
+    {
+      CmdClassList::iterator delClass = std::find(ShellCommandClass::_commandClassList->begin(), ShellCommandClass::_commandClassList->end(), this);
+      if (delClass != ShellCommandClass::_commandClassList->end())
+        ShellCommandClass::_commandClassList->erase(delClass);
     }
   }
@@ -68,5 +67,5 @@
   void ShellCommandClass::registerCommand(ShellCommand* command)
   {
-    this->commandList.push_back(command);
+    this->_commandList.push_back(command);
   }
 
@@ -77,7 +76,7 @@
   void ShellCommandClass::unregisterCommand(ShellCommand* command)
   {
-    CmdList::iterator delC = std::find(this->commandList.begin(), this->commandList.end(), command);
-    if (delC != this->commandList.end())
-      this->commandList.erase(delC);
+    CmdList::iterator delC = std::find(this->_commandList.begin(), this->_commandList.end(), command);
+    if (delC != this->_commandList.end())
+      this->_commandList.erase(delC);
   }
 
@@ -89,11 +88,11 @@
     // unregister all commands and Classes
     CmdClassList::iterator classIT;
-    if (ShellCommandClass::commandClassList == NULL)
+    if (ShellCommandClass::_commandClassList == NULL)
       return;
 
-    while (!ShellCommandClass::commandClassList->empty())
-      delete ShellCommandClass::commandClassList->back();
-    delete ShellCommandClass::commandClassList;
-    ShellCommandClass::commandClassList = NULL;
+    while (!ShellCommandClass::_commandClassList->empty())
+      delete ShellCommandClass::_commandClassList->back();
+    delete ShellCommandClass::_commandClassList;
+    ShellCommandClass::_commandClassList = NULL;
   }
 
@@ -107,15 +106,15 @@
   bool ShellCommandClass::getCommandListOfClass(const std::string& className, std::list<std::string>& stringList)
   {
-    if (ShellCommandClass::commandClassList == NULL)
+    if (ShellCommandClass::_commandClassList == NULL)
       return false;
 
 
     CmdClassList::const_iterator elem;
-    for(elem = ShellCommandClass::commandClassList->begin(); elem != ShellCommandClass::commandClassList->end(); elem++)
+    for(elem = ShellCommandClass::_commandClassList->begin(); elem != ShellCommandClass::_commandClassList->end(); elem++)
     {
       if (className == (*elem)->getName())
       {
         CmdList::iterator command;
-        for(command = (*elem)->commandList.begin(); command != (*elem)->commandList.end(); command++)
+        for(command = (*elem)->_commandList.begin(); command != (*elem)->_commandList.end(); command++)
           stringList.push_back((*command)->getName());
         return true;
@@ -133,11 +132,11 @@
   ShellCommandClass* ShellCommandClass::getCommandClass(const std::string& className)
   {
-    if (ShellCommandClass::commandClassList == NULL)
+    if (ShellCommandClass::_commandClassList == NULL)
       return false;
 
 
     CmdClassList::const_iterator classIT;
-    for (classIT = ShellCommandClass::commandClassList->begin(); classIT != ShellCommandClass::commandClassList->end(); classIT++)
-      if (className == (*classIT)->className)
+    for (classIT = ShellCommandClass::_commandClassList->begin(); classIT != ShellCommandClass::_commandClassList->end(); classIT++)
+      if (className == (*classIT)->_className)
         return (*classIT);
     return NULL;
@@ -152,11 +151,4 @@
   {
     return (ShellCommandClass::getCommandClass(className) != NULL);
-  }
-
-  ClassID ShellCommandClass::getClassID()
-  {
-    if (this->classID == CL_NULL)
-      this->classID = ClassList::StringToID(this->className);
-    return this->classID;
   }
 
@@ -181,5 +173,5 @@
   void ShellCommandClass::help(const std::string& className)
   {
-    if (ShellCommandClass::commandClassList == NULL)
+    if (ShellCommandClass::_commandClassList == NULL)
     {
       PRINT(0)("No Commands Registered\n");
@@ -187,15 +179,15 @@
     }
     if (className.empty())
-      PRINT(0)("===== Displaying %d registered Classes:\n", ShellCommandClass::commandClassList->size());
+      PRINT(0)("===== Displaying %d registered Classes:\n", ShellCommandClass::_commandClassList->size());
 
 
     CmdClassList::iterator classIT;
-    for (classIT = ShellCommandClass::commandClassList->begin(); classIT != ShellCommandClass::commandClassList->end(); classIT++)
-    {
-      if (className.empty() || className == (*classIT)->className)
+    for (classIT = ShellCommandClass::_commandClassList->begin(); classIT != ShellCommandClass::_commandClassList->end(); classIT++)
+    {
+      if (className.empty() || className == (*classIT)->_className)
       {
-        PRINT(0)("Class:'%s' registered %d commands: \n", (*classIT)->className.c_str(), (*classIT)->commandList.size());
+        PRINT(0)("Class:'%s' registered %d commands: \n", (*classIT)->_className.c_str(), (*classIT)->_commandList.size());
         CmdList::const_iterator cmdIT;
-        for (cmdIT = (*classIT)->commandList.begin(); cmdIT != (*classIT)->commandList.end(); cmdIT++)
+        for (cmdIT = (*classIT)->_commandList.begin(); cmdIT != (*classIT)->_commandList.end(); cmdIT++)
         {
           PRINT(0)("  command:'%s' : params:%d: ", (*cmdIT)->getCName(), (*cmdIT)->executor->getParamCount());
Index: trunk/src/lib/shell/shell_command_class.h
===================================================================
--- trunk/src/lib/shell/shell_command_class.h	(revision 9406)
+++ trunk/src/lib/shell/shell_command_class.h	(revision 9869)
@@ -25,8 +25,10 @@
   class ShellCommandClass : public BaseObject
   {
+    ObjectListDeclaration(ShellCommandClass);
+
     friend class ShellCommand;
   public:
     /** @returns the CommandClassList */
-    static const CmdClassList& getCommandClassList() { return *ShellCommandClass::commandClassList; };
+    static const CmdClassList& getCommandClassList() { return *ShellCommandClass::_commandClassList; };
 
     static bool getCommandListOfClass(const std::string& className, std::list<std::string>& stringList);
@@ -51,9 +53,8 @@
 
   private:
-    const std::string                      className;                 //!< The Name of the Class. This should match the ClassName of the Commands Class.
-    ClassID                                classID;                   //!< The classID of this Class
-    CmdList                                commandList;               //!< A list of Commands from this Class
+    const std::string                      _className;                 //!< The Name of the Class. This should match the ClassName of the Commands Class.
+    CmdList                                _commandList;               //!< A list of Commands from this Class
 
-    static CmdClassList*                   commandClassList;          //!< A list of Classes
+    static CmdClassList*                   _commandClassList;          //!< A list of Classes
   };
 }
Index: trunk/src/lib/shell/shell_completion.cc
===================================================================
--- trunk/src/lib/shell/shell_completion.cc	(revision 9406)
+++ trunk/src/lib/shell/shell_completion.cc	(revision 9869)
@@ -22,6 +22,5 @@
 #include "shell_command.h"
 
-#include "substring.h"
-#include "class_list.h"
+#include "helper_functions.h"
 #include "debug.h"
 
@@ -51,6 +50,6 @@
   bool ShellCompletion::autoComplete(std::string& input)
   {
-    long classID = CL_NULL;                          //< the classID retrieved from the Class.
-    const std::list<BaseObject*>* objectList = NULL; //< the list of Objects stored in classID's ClassList
+    ClassID classID;
+    const ObjectListBase* objectList = NULL;      //< the list of Objects stored in classID's ClassList
     bool emptyComplete = false;                      //< if the completion input is empty string. e.g ""
     long completeType = NullCompletion;              //< the Type we'd like to complete.
@@ -85,7 +84,8 @@
              (!emptyComplete && inputSplits.size() == 2))
     {
-      classID = ClassList::StringToID(inputSplits.getString(0));
-      objectList = ClassList::getList((ClassID)classID);
-      if (classID != CL_NULL)
+      objectList = ObjectListBase::getObjectList(inputSplits[0]);
+      if (objectList != NULL)
+        classID = objectList->identity();
+      if (classID != NullClass::staticClassID())
         completeType |= ObjectCompletion;
       completeType |= FunctionCompletion;
@@ -95,5 +95,5 @@
              (!emptyComplete && inputSplits.size() == 3))
     {
-      if (ClassList::exists(inputSplits[0], inputSplits[1]))
+      if (ObjectListBase::getBaseObject(inputSplits[0], inputSplits[1]))
         completeType |= FunctionCompletion;
     }
@@ -113,7 +113,7 @@
 
     if (completeType & ClassCompletion)
-      this->objectComplete(completeString, CL_SHELL_COMMAND_CLASS);
+      this->objectComplete(completeString, &ShellCommandClass::objectList());
     if (completeType & ObjectCompletion)
-      this->objectComplete(completeString, classID);
+      this->objectComplete(completeString, objectList);
     if (completeType & FunctionCompletion)
       this->commandComplete(completeString, inputSplits[0]);
@@ -133,17 +133,18 @@
    * @return true on success, false otherwise
    */
-  bool ShellCompletion::objectComplete(const std::string& objectBegin, long classID)
-  {
-    const std::list<BaseObject*>* boList = ClassList::getList((ClassID)classID);
-    if (boList != NULL)
-    {
-      CompletionType type = ObjectCompletion;
-      if (classID == CL_SHELL_COMMAND_CLASS)
-        type = ClassCompletion;
-      if (!this->addToCompleteList(*boList, objectBegin, type))
-        return false;
-    }
-    else
-      return false;
+  bool ShellCompletion::objectComplete(const std::string& objectBegin, const ObjectListBase* objectList)
+  {
+    assert (objectList != NULL);
+
+    CompletionType type = ObjectCompletion;
+    if (objectList == &ShellCommandClass::objectList())
+      type = ClassCompletion;
+
+    ObjectListBase::base_list list;
+    objectList->getBaseObjectList(&list);
+
+    if (!this->addToCompleteList(list, objectBegin, type))
+     return false;
+
     return true;
   }
@@ -321,16 +322,16 @@
     switch (type)
     {
-        default:// SHELLC_NONE
-        return typeNames[0];
-        case  ClassCompletion:
-        return typeNames[1];
-        case ObjectCompletion:
-        return typeNames[2];
-        case FunctionCompletion:
-        return typeNames[3];
-        case AliasCompletion:
-        return typeNames[4];
-        case ParamCompletion:
-        return typeNames[5];
+      default:// SHELLC_NONE
+      return typeNames[0];
+      case  ClassCompletion:
+      return typeNames[1];
+      case ObjectCompletion:
+      return typeNames[2];
+      case FunctionCompletion:
+      return typeNames[3];
+      case AliasCompletion:
+      return typeNames[4];
+      case ParamCompletion:
+      return typeNames[5];
     }
   }
Index: trunk/src/lib/shell/shell_completion.h
===================================================================
--- trunk/src/lib/shell/shell_completion.h	(revision 9406)
+++ trunk/src/lib/shell/shell_completion.h	(revision 9869)
@@ -16,4 +16,5 @@
 // FORWARD DECLARATION
 class BaseObject;
+class ObjectListBase;
 
 namespace OrxShell
@@ -50,8 +51,8 @@
       bool autoComplete(std::string& input);
 
-      static const std::string& ShellCompletion::typeToString(ShellCompletion::CompletionType type);
+      static const std::string& typeToString(ShellCompletion::CompletionType type);
 
     private:
-      bool objectComplete(const std::string& objectBegin, long classID);
+      bool objectComplete(const std::string& objectBegin, const ObjectListBase* const objectList);
       bool commandComplete(const std::string& commandBegin, const std::string& className);
       bool aliasComplete(const std::string& aliasBegin);
Index: trunk/src/lib/shell/shell_completion_plugin.cc
===================================================================
--- trunk/src/lib/shell/shell_completion_plugin.cc	(revision 9406)
+++ trunk/src/lib/shell/shell_completion_plugin.cc	(revision 9869)
@@ -21,6 +21,5 @@
 #include "shell_command.h"
 
-#include "substring.h"
-#include "class_list.h"
+#include "helper_functions.h"
 #include "loading/resource_manager.h"
 
@@ -98,5 +97,5 @@
     if (completionBegin.empty()) // if we do not yet have the beginning of the line, start with the chosen startDir.
     {
-      dir.setFileName(ResourceManager::getInstance()->getDataDir() + this->_subDir);
+      dir.setFileName(Resources::ResourceManager::getInstance()->mainGlobalPath().name() + this->_subDir);
       dir.open();
       for(unsigned int i = 0; i < dir.fileCount(); i++ )
@@ -113,5 +112,5 @@
         directoryName = completionBegin.substr(0, pos);
 
-      dir.setFileName(ResourceManager::getInstance()->getDataDir() + directoryName);
+      dir.setFileName(Resources::ResourceManager::getInstance()->mainGlobalPath().name() + directoryName);
       dir.open();
 
@@ -136,7 +135,7 @@
           continue;
         }
-        printf("%s\n", (ResourceManager::getInstance()->getDataDir() + fileName).c_str());
+	printf("%s\n", (Resources::ResourceManager::getInstance()->mainGlobalPath().name() + fileName).c_str());
         if (!nocaseCmp(completionBegin, fileName, completionBegin.size()) &&
-             ResourceManager::isInDataDir(fileName))
+	     Resources::ResourceManager::getInstance()->checkFileInMainPath(fileName))
         {
           printf("Dir %s\n", fileName.c_str());
Index: trunk/src/lib/shell/shell_input.cc
===================================================================
--- trunk/src/lib/shell/shell_input.cc	(revision 9406)
+++ trunk/src/lib/shell/shell_input.cc	(revision 9869)
@@ -24,4 +24,5 @@
 #include "compiler.h"
 #include "key_names.h"
+
 
 namespace OrxShell
@@ -31,4 +32,5 @@
   ->setAlias("help");
 
+  ObjectListDefinition(ShellInput);
 
   /**
@@ -39,8 +41,8 @@
       : Text ("")
   {
+    this->registerObject(this, ShellInput::_objectList);
+
     this->pressedKey = SDLK_FIRST;
-    this->setClassID(CL_SHELL_INPUT, "ShellInput");
-
-    this->inputLine = "";
+
     this->historyIT = ShellInput::history.begin();
     this->setHistoryLength(50);
@@ -53,5 +55,5 @@
     {
       //if (!this->isEventSubscribed(ES_SHELL, i))
-        this->subscribeEvent(ES_SHELL, i);
+      this->subscribeEvent(ES_SHELL, i);
     }
     // unsubscribe unused TODO improve.
@@ -60,5 +62,4 @@
     this->unsubscribeEvent(ES_SHELL, SDLK_PAGEUP);
     this->unsubscribeEvent(ES_SHELL, SDLK_PAGEDOWN);
-
   }
 
@@ -87,6 +88,7 @@
   void ShellInput::flush()
   {
-    this->inputLine.clear();
-    this->setText(this->inputLine);
+    this->inputLineBegin.clear();
+    this->inputLineEnd.clear();
+    this->clear();
   }
 
@@ -97,6 +99,7 @@
   void ShellInput::setInputText(const std::string& text)
   {
-    this->inputLine = text;
-    this->setText(this->inputLine);
+    this->inputLineBegin = text;
+    this->inputLineEnd.clear();
+    this->setText(text);
   }
 
@@ -114,6 +117,6 @@
     }
 
-    this->inputLine += character;
-    this->setText(this->inputLine);
+    this->inputLineBegin += character;
+    this->setText(this->inputLineBegin + this->inputLineEnd);
   }
 
@@ -130,6 +133,6 @@
     }
 
-    this->inputLine += characters;
-    this->setText(this->inputLine);
+    this->inputLineBegin += characters;
+    this->setText(this->inputLineBegin + this->inputLineEnd);
   }
 
@@ -145,9 +148,9 @@
       this->historyScrolling = false;
     }
-    if (this->inputLine.size() < characterCount)
-      characterCount = this->inputLine.size();
-
-    this->inputLine.erase(this->inputLine.size() - characterCount, this->inputLine.size());
-    this->setText(this->inputLine);
+    if (this->inputLineBegin.size() < characterCount)
+      characterCount = this->inputLineBegin.size();
+
+    this->inputLineBegin.erase(this->inputLineBegin.size() - characterCount, this->inputLineBegin.size());
+    this->setText(this->inputLineBegin + this->inputLineEnd);
   }
 
@@ -158,10 +161,9 @@
   bool ShellInput::executeCommand()
   {
-    ShellBuffer::addBufferLineStatic("Execute Command: %s\n", this->inputLine.c_str());
-
-    if (this->inputLine.empty())
+    if (this->getInput().empty())
       return false;
-
-    ShellCommand::execute(this->inputLine);
+    DebugBuffer::addBufferLineStatic("Execute Command: %s\n", this->getInput().c_str());
+
+    ShellCommand::execute(this->getInput());
 
     // removing the eventually added Entry (from scrolling) to the List
@@ -173,6 +175,6 @@
 
     // adding the new Command to the History
-    if (history.empty() || history.back() != this->inputLine)
-      this->history.push_back(this->inputLine);
+    if (history.empty() || history.back() != this->getInput())
+      this->history.push_back(this->getInput());
     if (this->history.size() > this->historyLength)
     {
@@ -193,5 +195,5 @@
     if (!this->historyScrolling)
     {
-      this->history.push_back(this->inputLine);
+      this->history.push_back(this->getInput());
       this->historyScrolling = true;
       this->historyIT = --this->history.end();
@@ -231,4 +233,30 @@
   }
 
+  /**
+   * @brief moves the cursor chars Characters to the right.
+   * @param chars how much to move the cursor.
+   */
+  void ShellInput::moveCursor(int chars)
+  {
+    if (chars > 0)
+    {
+      PRINTF(5)("move cursor %d to the right\n", chars);
+      if (chars >= (int) this->inputLineEnd.size())
+        chars = inputLineEnd.size();
+      this->inputLineBegin += this->inputLineEnd.substr(0, chars);
+      this->inputLineEnd.erase(0, chars);
+    }
+    else if (chars < 0)
+    {
+      chars = -chars;
+      PRINTF(5)("move cursor %d to the left\n", chars);
+
+      if (chars >= (int) this->inputLineBegin.size())
+	chars = inputLineBegin.size();
+      this->inputLineEnd = this->inputLineBegin.substr(this->inputLineBegin.size() - chars) + this->inputLineEnd;
+      this->inputLineBegin.erase(this->inputLineBegin.size() - chars);
+    }
+  }
+
 
   /**
@@ -237,14 +265,12 @@
   void ShellInput::help(const std::string& className, const std::string& functionName)
   {
-    printf("%s::%s\n", className.c_str(), functionName.c_str());
-
     if (className.empty())
     {
-      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)("Alias [parameter]\n");
-      PRINT(0)("- Also try 'help className'");
+      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)("   Alias [parameter]\n");
+      PRINT(0)("- Also try 'help className' or pushing 'TAB'\n");
     }
     else if (!className.empty() && functionName.empty())
@@ -269,17 +295,17 @@
       {
         case SDLK_BACKSPACE:
-          this->removeCharacters(1);
-          break;
+        this->removeCharacters(1);
+        break;
         case SDLK_UP:
-          this->historyMoveUp();
-          break;
+        this->historyMoveUp();
+        break;
         case SDLK_DOWN:
-          this->historyMoveDown();
-          break;
+        this->historyMoveDown();
+        break;
         default:
-          {
-            if (likely(pressedKey < 127))
-              this->addCharacter(this->pressedKey);
-          }
+        {
+          if (likely(pressedKey < 127))
+            this->addCharacter(this->pressedKey);
+        }
       }
     }
@@ -313,8 +339,20 @@
         this->pressedEvent = event.type;
       }
+      else if (event.type == SDLK_LEFT)
+      {
+        this->moveCursor(-1);
+        this->pressedKey = event.type;
+        this->pressedEvent = event.type;
+      }
+      else if (event.type == SDLK_RIGHT)
+      {
+        this->moveCursor(+1);
+        this->pressedKey = event.type;
+        this->pressedEvent = event.type;
+      }
       else if (event.type == SDLK_TAB)
       {
-        this->completion.autoComplete(this->inputLine);
-        this->setText(this->inputLine);
+        this->completion.autoComplete(this->inputLineBegin);
+        this->setText(this->getInput());
       }
       else if (event.type == SDLK_BACKSPACE)
@@ -325,4 +363,12 @@
         this->removeCharacters(1);
       }
+      else if (event.type == SDLK_DELETE)
+      {
+	if (!this->inputLineEnd.empty())
+	{
+	  this->inputLineEnd.erase(0, 1);
+	  this->setText(this->getInput());
+	}
+      }
       else if (event.type == SDLK_RETURN)
       {
Index: trunk/src/lib/shell/shell_input.h
===================================================================
--- trunk/src/lib/shell/shell_input.h	(revision 9406)
+++ trunk/src/lib/shell/shell_input.h	(revision 9869)
@@ -30,4 +30,5 @@
   class ShellInput : public Text,  public EventListener
   {
+    ObjectListDeclaration(ShellInput);
 
   public:
@@ -36,5 +37,5 @@
 
     /** @returns the inputLine */
-    const std::string& getInput() const { return this->inputLine; };
+    std::string getInput() const { return this->inputLineBegin + this->inputLineEnd; };
 
     // InputLine
@@ -54,4 +55,6 @@
     void historyMoveDown();
 
+    void moveCursor(int chars);
+
     void help(const std::string& className = "", const std::string& function = "");
 
@@ -63,5 +66,7 @@
     ShellCompletion                   completion;       //!< The Completion Interface.
 
-    std::string                       inputLine;        //!< the Char-Array of the Buffer
+    std::string                       inputLineBegin;   //!< The Line up to the cursor.
+    std::string                       inputLineEnd;     //!< The Line from the cursor on
+
     float                             repeatRate;       //!< The Repeat-Delay.
     float                             repeatDelay;      //!< The delay of the first Character of a given Character.
Index: trunk/src/lib/shell/some_shell_commands.cc
===================================================================
--- trunk/src/lib/shell/some_shell_commands.cc	(revision 9406)
+++ trunk/src/lib/shell/some_shell_commands.cc	(revision 9869)
@@ -29,25 +29,45 @@
 
 #include "network_game_rules.h"
-  SHELL_COMMAND(say, NetworkGameRules, shellSay)->setAlias("say");
+SHELL_COMMAND(say, NetworkGameRules, shellSay)->setAlias("say");
 
 #include "player_stats.h"
-  SHELL_COMMAND(nick, PlayerStats, shellNick)->setAlias("nick");
+SHELL_COMMAND(nick, PlayerStats, shellNick)->setAlias("nick");
 
-#include "class_list.h"
-  SHELL_COMMAND(debug, ClassList, ClassList::debugS)
-      ->describe("Shows all registered classes, if param1: is a valid ClassName only values of this class are shown. param2: how much output")
-      ->defaultValues(MT_NULL, 1);
+// #include "class_list.h"
+//   SHELL_COMMAND(debug, ClassList, ClassList::debugS)
+//       ->describe("Shows all registered classes, if param1: is a valid ClassName only values of this class are shown. param2: how much output")
+//       ->defaultValues(MT_NULL, 1);
 
 #include "p_node.h"
-  SHELL_COMMAND(debugNode, PNode, debugNode);
-  SHELL_COMMAND(setPosition, PNode, setAbsCoor);
+SHELL_COMMAND(debugNode, PNode, debugNode);
+SHELL_COMMAND(setPosition, PNode, setAbsCoor);
 
 #include "render_2d.h"
-  SHELL_COMMAND(toggleNodeVisibility, Render2D, toggleNodesVisibility);
+SHELL_COMMAND(toggleNodeVisibility, Render2D, toggleNodesVisibility);
 
 
 #include "material.h"
-  SHELL_COMMAND(setDiffuseTexture, Material, setDiffuseMap)
-      ->defaultValues(MT_NULL, (int)GL_TEXTURE_2D)
-      ->completionPlugin(0, CompletorFileSystem());
+SHELL_COMMAND(setDiffuseTexture, Material, setDiffuseMap)
+->defaultValues(MT_NULL, (int)GL_TEXTURE_2D)
+->completionPlugin(0, CompletorFileSystem());
 
+#include "loading/resource_manager.h"
+namespace Resources {
+  SHELL_COMMAND(debug, ResourceManager, debug);
+  SHELL_COMMAND(load, ResourceManager, loadFromLoadStringHACK);
+  SHELL_COMMAND(unload, ResourceManager, unloadAllBelowKeepLevelINT);
+}
+
+#include "loading/load_param_class_description.h"
+SHELL_COMMAND_STATIC(printAll, LoadParamClassDescription, &LoadParamClassDescription::printAll)
+->defaultValues(MT_NULL, true);
+SHELL_COMMAND_STATIC(capture, LoadParamClassDescription, &LoadParamClassDescription::captureDescriptions)
+    ->defaultValues(true);
+
+#include "loading/game_loader.h"
+SHELL_COMMAND(quit, GameLoader, stop)
+    ->describe("quits the game")
+    ->setAlias("orxoquit");
+
+#include "object_list.h"
+SHELL_COMMAND_STATIC(debugAll, ObjectListBase, &ObjectListBase::debugAll);
