Index: /trunk/src/lib/shell/Makefile.am
===================================================================
--- /trunk/src/lib/shell/Makefile.am	(revision 5177)
+++ /trunk/src/lib/shell/Makefile.am	(revision 5178)
@@ -6,4 +6,5 @@
 libORXshell_a_SOURCES = shell.cc \
 			shell_buffer.cc \
+			shell_input.cc \
 		        shell_command.cc \
 			shell_completion.cc
@@ -12,4 +13,5 @@
 noinst_HEADERS= shell.h \
 		shell_buffer.h \
+		shell_input.h \
                 shell_command.h \
 		shell_completion.h
Index: /trunk/src/lib/shell/Makefile.in
===================================================================
--- /trunk/src/lib/shell/Makefile.in	(revision 5177)
+++ /trunk/src/lib/shell/Makefile.in	(revision 5178)
@@ -55,5 +55,6 @@
 libORXshell_a_LIBADD =
 am_libORXshell_a_OBJECTS = shell.$(OBJEXT) shell_buffer.$(OBJEXT) \
-	shell_command.$(OBJEXT) shell_completion.$(OBJEXT)
+	shell_input.$(OBJEXT) shell_command.$(OBJEXT) \
+	shell_completion.$(OBJEXT)
 libORXshell_a_OBJECTS = $(am_libORXshell_a_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@@ -63,5 +64,6 @@
 @AMDEP_TRUE@	./$(DEPDIR)/shell_buffer.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/shell_command.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/shell_completion.Po
+@AMDEP_TRUE@	./$(DEPDIR)/shell_completion.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/shell_input.Po
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -187,4 +189,5 @@
 libORXshell_a_SOURCES = shell.cc \
 			shell_buffer.cc \
+			shell_input.cc \
 		        shell_command.cc \
 			shell_completion.cc
@@ -192,4 +195,5 @@
 noinst_HEADERS = shell.h \
 		shell_buffer.h \
+		shell_input.h \
                 shell_command.h \
 		shell_completion.h
@@ -246,4 +250,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_command.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_completion.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_input.Po@am__quote@
 
 .cc.o:
Index: /trunk/src/lib/shell/shell.h
===================================================================
--- /trunk/src/lib/shell/shell.h	(revision 5177)
+++ /trunk/src/lib/shell/shell.h	(revision 5178)
@@ -9,9 +9,6 @@
 #include "element_2d.h"
 #include "event_listener.h"
-//#include "shell_buffer.h"
 
 #include <stdarg.h>
-
-#define      SHELL_BUFFER_SIZE       16384
 
 // FORWARD DECLARATION
@@ -59,9 +56,9 @@
     void addCharacters(const char* characters);
     void removeCharacters(unsigned int characterCount = 1);
+    void setRepeatDelay(float repeatDelay, float repeatRate);
     bool executeCommand();
 
     void clear();
 
-    void setRepeatDelay(float repeatDelay, float repeatRate);
 
     // EventListener
Index: /trunk/src/lib/shell/shell_completion.cc
===================================================================
--- /trunk/src/lib/shell/shell_completion.cc	(revision 5177)
+++ /trunk/src/lib/shell/shell_completion.cc	(revision 5178)
@@ -18,6 +18,12 @@
 #include "shell_completion.h"
 
+#include "base_object.h"
+#include "class_list.h"
+#include "list.h"
+#include "debug.h"
+
+#include "stdlibincl.h"
+
 using namespace std;
-
 
 /**
@@ -49,2 +55,219 @@
   // delete what has to be deleted here
 }
+
+
+
+/**
+ * autocompletes the Shell's inputLine
+ * @returns true, if a result was found, false otherwise
+ *
+ * @todo implement it!!
+ */
+bool ShellCompletion::autoComplete(const char* inputLine)
+{
+  //PRINTF(3)("AutoCompletion not implemented yet\n");
+
+  char* completionLine = new char[strlen(inputLine)+1];
+  strcpy(completionLine, 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 ShellCompletion::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 ShellCompletion::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;
+}
+
+/**
+ * completes a Function
+ * @param functionBegin the beginning of the function String
+ */
+bool ShellCompletion::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 ShellCompletion::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>* ShellCompletion::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>* ShellCompletion::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;
+}
Index: /trunk/src/lib/shell/shell_completion.h
===================================================================
--- /trunk/src/lib/shell/shell_completion.h	(revision 5177)
+++ /trunk/src/lib/shell/shell_completion.h	(revision 5178)
@@ -8,5 +8,9 @@
 
 // FORWARD DECLARATION
-
+class BaseObject;
+template<class T> class tList;
+#ifndef NULL
+#define NULL 0            //!< a pointer to NULL
+#endif
 
 //! A class for ...
@@ -17,7 +21,18 @@
   virtual ~ShellCompletion();
 
+  bool autoComplete(const char* inputLine);
+  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);
+
 
  private:
-
+   tList<const char>*       completionList;          //!< A list of completions, that are io.
 };
 
Index: /trunk/src/lib/shell/shell_input.cc
===================================================================
--- /trunk/src/lib/shell/shell_input.cc	(revision 5178)
+++ /trunk/src/lib/shell/shell_input.cc	(revision 5178)
@@ -0,0 +1,38 @@
+/*
+   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: ...
+   co-programmer: ...
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "shell_input.h"
+
+using namespace std;
+
+
+/**
+ * standard constructor
+ * @todo this constructor is not jet implemented - do it
+*/
+ShellInput::ShellInput ()
+{
+
+}
+
+/**
+ * standard deconstructor
+*/
+ShellInput::~ShellInput ()
+{
+  // delete what has to be deleted here
+}
Index: /trunk/src/lib/shell/shell_input.h
===================================================================
--- /trunk/src/lib/shell/shell_input.h	(revision 5178)
+++ /trunk/src/lib/shell/shell_input.h	(revision 5178)
@@ -0,0 +1,43 @@
+/*!
+ * @file shell_input.h
+ * @brief Definition of ...
+*/
+
+#ifndef _SHELL_INPUT_H
+#define _SHELL_INPUT_H
+
+// FORWARD DECLARATION
+class Text;
+template<class T> class tList;
+
+
+//! A class for ...
+class ShellInput {
+
+ public:
+  ShellInput();
+  virtual ~ShellInput();
+
+
+  // InputLine
+  void flush();
+  void addCharacter(char character);
+  void addCharacters(const char* characters);
+  void removeCharacters(unsigned int characterCount = 1);
+  void setRepeatDelay(float repeatDelay, float repeatRate);
+
+
+ private:
+    // HANDLING TEXT INPUT
+   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>*             inputHistory;           //!< The history of given commands.
+
+};
+
+#endif /* _SHELL_INPUT_H */
