Index: /code/branches/libs/src/libraries/core/GUIManager.cc
===================================================================
--- /code/branches/libs/src/libraries/core/GUIManager.cc	(revision 9670)
+++ /code/branches/libs/src/libraries/core/GUIManager.cc	(revision 9671)
@@ -230,5 +230,9 @@
             if (id == Ogre::RENDER_QUEUE_OVERLAY && invocation.empty())
             {
+#if CEGUI_VERSION >= 0x000800
+                CEGUI::System::getSingleton().renderAllGUIContexts();
+#else
                 CEGUI::System::getSingleton().renderGUI();
+#endif
 
                 // Important workaround! (at least required by CEGUI 0.7.5)
@@ -354,5 +358,9 @@
 
         // Align CEGUI mouse with OIS mouse
+#if CEGUI_VERSION >= 0x000800
+        guiSystem_->getDefaultGUIContext().injectMousePosition((float)mousePosition.first, (float)mousePosition.second);
+#else
         guiSystem_->injectMousePosition((float)mousePosition.first, (float)mousePosition.second);
+#endif
 
         // Initialise the Lua framework and load the schemes
@@ -366,7 +374,13 @@
         this->menuRootWindow_ = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow", "MenuRootWindow");
         // And connect them
+#if CEGUI_VERSION >= 0x000800
+        CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(this->rootWindow_);
+        this->rootWindow_->addChild(this->hudRootWindow_);
+        this->rootWindow_->addChild(this->menuRootWindow_);
+#else
         CEGUI::System::getSingleton().setGUISheet(this->rootWindow_);
         this->rootWindow_->addChildWindow(this->hudRootWindow_);
         this->rootWindow_->addChildWindow(this->menuRootWindow_);
+#endif
 
         // No background to start with (sets the alpha value to 0)
@@ -435,5 +449,5 @@
     {
         assert(guiSystem_);
-        this->protectedCall(boost::bind(&CEGUI::System::injectTimePulse, _1, time.getDeltaTime()));
+        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectTimePulse, _1, time.getDeltaTime()));
     }
 
@@ -610,11 +624,20 @@
     void GUIManager::buttonPressed(const KeyEvent& evt)
     {
-        this->protectedCall(boost::bind(&CEGUI::System::injectKeyDown, _1, evt.getKeyCode()));
-        this->protectedCall(boost::bind(&CEGUI::System::injectChar, _1, evt.getText()));
+#if CEGUI_VERSION >= 0x000800
+        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectKeyDown, _1, (CEGUI::Key::Scan) evt.getKeyCode())); // TODO: will this cast always work?
+        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectChar, _1, evt.getText()));
+#else
+        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectKeyDown, _1, evt.getKeyCode()));
+        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectChar, _1, evt.getText()));
+#endif
     }
 
     void GUIManager::buttonReleased(const KeyEvent& evt)
     {
-        this->protectedCall(boost::bind(&CEGUI::System::injectKeyUp, _1, evt.getKeyCode()));
+#if CEGUI_VERSION >= 0x000800
+        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectKeyUp, _1, (CEGUI::Key::Scan) evt.getKeyCode())); // TODO: will this cast always work?
+#else
+        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectKeyUp, _1, evt.getKeyCode()));
+#endif
     }
 
@@ -630,5 +653,9 @@
     void GUIManager::buttonPressed(MouseButtonCode::ByEnum id)
     {
-        this->protectedCall(boost::bind(&CEGUI::System::injectMouseButtonDown, _1, convertButton(id)));
+#if CEGUI_VERSION >= 0x000800
+        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseButtonDown, _1, convertButton(id)));
+#else
+        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseButtonDown, _1, convertButton(id)));
+#endif
     }
 
@@ -644,15 +671,27 @@
     void GUIManager::buttonReleased(MouseButtonCode::ByEnum id)
     {
-        this->protectedCall(boost::bind(&CEGUI::System::injectMouseButtonUp, _1, convertButton(id)));
+#if CEGUI_VERSION >= 0x000800
+        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseButtonUp, _1, convertButton(id)));
+#else
+        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseButtonUp, _1, convertButton(id)));
+#endif
     }
 
     void GUIManager::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
     {
-        this->protectedCall(boost::bind(&CEGUI::System::injectMousePosition, _1, (float)abs.x, (float)abs.y));
+#if CEGUI_VERSION >= 0x000800
+        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMousePosition, _1, (float)abs.x, (float)abs.y));
+#else
+        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMousePosition, _1, (float)abs.x, (float)abs.y));
+#endif
     }
 
     void GUIManager::mouseScrolled(int abs, int rel)
     {
-        this->protectedCall(boost::bind(&CEGUI::System::injectMouseWheelChange, _1, (float)sgn(rel) * this->numScrollLines_));
+#if CEGUI_VERSION >= 0x000800
+        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseWheelChange, _1, (float)sgn(rel) * this->numScrollLines_));
+#else
+        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseWheelChange, _1, (float)sgn(rel) * this->numScrollLines_));
+#endif
     }
 
@@ -662,5 +701,9 @@
     void GUIManager::mouseLeft()
     {
-        this->protectedCall(boost::bind(&CEGUI::System::injectMouseLeaves, _1));
+#if CEGUI_VERSION >= 0x000800
+        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseLeaves, _1));
+#else
+        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseLeaves, _1));
+#endif
     }
 
@@ -714,10 +757,10 @@
         True if input was handled, false otherwise. A caught exception yields true.
     */
-    template <typename FunctionType>
-    bool GUIManager::protectedCall(FunctionType function)
+    template <typename FunctionType, typename ObjectType>
+    bool GUIManager::protectedCall(FunctionType function, ObjectType object)
     {
         try
         {
-            return function(this->guiSystem_);
+            return function(object);
         }
         catch (CEGUI::ScriptException& ex)
@@ -728,4 +771,18 @@
         }
     }
+
+    template <typename FunctionType>
+    bool GUIManager::protectedCeguiSystemCall(FunctionType function)
+    {
+        return this->protectedCall(function, this->guiSystem_);
+    }
+
+#if CEGUI_VERSION >= 0x000800
+    template <typename FunctionType>
+    bool GUIManager::protectedCeguiContextCall(FunctionType function)
+    {
+        return this->protectedCall(function, this->guiSystem_->getDefaultGUIContext());
+    }
+#endif
 
     /**
@@ -784,5 +841,9 @@
     void GUIManager::windowResized(unsigned int newWidth, unsigned int newHeight)
     {
+#if CEGUI_VERSION >= 0x000800
+        this->guiRenderer_->setDisplaySize(CEGUI::Sizef((float)newWidth, (float)newHeight));
+#else
         this->guiRenderer_->setDisplaySize(CEGUI::Size((float)newWidth, (float)newHeight));
+#endif
     }
 
@@ -834,5 +895,9 @@
             return;
 
+    #if CEGUI_VERSION >= 0x000800
+        CEGUI::FontManager::getSingleton().createFreeTypeFont(name, (float)size, true, fontName, "", CEGUI::ASM_Both, CEGUI::Sizef(800.0f, 600.0f));
+    #else
         CEGUI::FontManager::getSingleton().createFreeTypeFont(name, (float)size, true, fontName, "", true, 800.0f, 600.0f);
+    #endif
 #endif
     }
Index: /code/branches/libs/src/libraries/core/GUIManager.h
===================================================================
--- /code/branches/libs/src/libraries/core/GUIManager.h	(revision 9670)
+++ /code/branches/libs/src/libraries/core/GUIManager.h	(revision 9671)
@@ -156,6 +156,14 @@
         void executeCode(const std::string& str);
 
+        template <typename FunctionType, typename ObjectType>
+        bool protectedCall(FunctionType function, ObjectType object);
+
         template <typename FunctionType>
-        bool protectedCall(FunctionType function);
+        bool protectedCeguiSystemCall(FunctionType function);
+
+#if CEGUI_VERSION >= 0x000800
+        template <typename FunctionType>
+        bool protectedCeguiContextCall(FunctionType function);
+#endif
 
         void changedCeguiOutputLevel();
Index: /code/branches/libs/src/orxonox/chat/ChatInputHandler.cc
===================================================================
--- /code/branches/libs/src/orxonox/chat/ChatInputHandler.cc	(revision 9670)
+++ /code/branches/libs/src/orxonox/chat/ChatInputHandler.cc	(revision 9671)
@@ -31,9 +31,18 @@
 #include <cassert>
 #include <string>
-#include <CEGUIWindow.h>
-#include <CEGUIWindowManager.h>
-#include <elements/CEGUIListbox.h>
-#include <elements/CEGUIListboxItem.h>
-#include <elements/CEGUIListboxTextItem.h>
+
+#if CEGUI_VERSION >= 0x000800
+#   include <CEGUI/Window.h>
+#   include <CEGUI/WindowManager.h>
+#   include <CEGUI/widgets/Listbox.h>
+#   include <CEGUI/widgets/ListboxItem.h>
+#   include <CEGUI/widgets/ListboxTextItem.h>
+#else
+#   include <CEGUIWindow.h>
+#   include <CEGUIWindowManager.h>
+#   include <elements/CEGUIListbox.h>
+#   include <elements/CEGUIListboxItem.h>
+#   include <elements/CEGUIListboxTextItem.h>
+#endif
 
 #include "util/ScopedSingletonManager.h"
@@ -118,9 +127,13 @@
 
     /* GET WINDOW POINTERS */
+#if CEGUI_VERSION >= 0x000800
+    input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/input" );
+    inputonly = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox-inputonly/input" );
+    CEGUI::Window *history = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/history" );
+#else
     input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" );
     inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" );
-
-    /* get pointer to the history window */
     CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" );
+#endif
 
     /* cast it to a listbox */
@@ -141,5 +154,5 @@
     // reds
     for( i = 0; i < NumberOfColors/3; ++i )
-    { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
+    { this->text_colors[ i ] = CEGUIColour( red, green, blue );
       green += 0.2f, blue += 0.2f;
     }
@@ -148,5 +161,5 @@
     red = 0.5, green = 1, blue = 0.5;
     for( ; i < NumberOfColors*2/3; ++i )
-    { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
+    { this->text_colors[ i ] = CEGUIColour( red, green, blue );
       red += 0.2f, blue += 0.2f;
     }
@@ -155,5 +168,5 @@
     red = 0.5, green = 0.5, blue = 1;
     for( ; i < NumberOfColors; ++i )
-    { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
+    { this->text_colors[ i ] = CEGUIColour( red, green, blue );
       red += 0.2f, green += 0.2f;
     }
@@ -272,6 +285,9 @@
     {
       /* adjust curser position - magic number 5 for font width */
-      sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().getWidth()/6),
-        cursorpos, assembled.length() );
+#if CEGUI_VERSION >= 0x000800
+      sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().get().getWidth()/6), cursorpos, assembled.length() );
+#else
+      sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().getWidth()/6), cursorpos, assembled.length() );
+#endif
       this->input->setProperty( "Text", assembled.substr( disp_offset ) );
     }
@@ -279,6 +295,9 @@
     {
       /* adjust curser position - magic number 5 for font width */
-      sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().getWidth()/6),
-        cursorpos, assembled.length() );
+#if CEGUI_VERSION >= 0x000800
+      sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().get().getWidth()/6), cursorpos, assembled.length() );
+#else
+      sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().getWidth()/6), cursorpos, assembled.length() );
+#endif
       this->inputonly->setProperty( "Text", assembled.substr( disp_offset) );
     }
Index: /code/branches/libs/src/orxonox/chat/ChatInputHandler.h
===================================================================
--- /code/branches/libs/src/orxonox/chat/ChatInputHandler.h	(revision 9670)
+++ /code/branches/libs/src/orxonox/chat/ChatInputHandler.h	(revision 9671)
@@ -33,6 +33,12 @@
 
 #include <string>
-#include <CEGUIForwardRefs.h>
-#include <CEGUIcolour.h>
+
+#if CEGUI_VERSION >= 0x000800
+#   include <CEGUI/ForwardRefs.h>
+#   include <CEGUI/Colour.h>
+#else
+#   include <CEGUIForwardRefs.h>
+#   include <CEGUIcolour.h>
+#endif
 
 #include "util/Singleton.h"
@@ -41,4 +47,11 @@
 namespace orxonox // tolua_export
 { // tolua_export
+
+#if CEGUI_VERSION >= 0x000800
+  typedef CEGUI::Colour CEGUIColour;
+#else
+  typedef CEGUI::colour CEGUIColour;
+#endif
+
   /* class to handle chat using an InputBuffer */
   class _OrxonoxExport ChatInputHandler  // tolua_export
@@ -55,5 +68,5 @@
       /* colors for nickname coloring */
       static const int NumberOfColors = 10;
-      CEGUI::colour text_colors[ NumberOfColors ];
+      CEGUIColour text_colors[ NumberOfColors ];
 
       /** input state */
