Browse Source

Rename conflicting filenames

Josh Engebretson 10 years ago
parent
commit
3345560c82
33 changed files with 218 additions and 213 deletions
  1. 4 4
      Source/Atomic/UI/SystemUI/BorderImage.cpp
  2. 2 2
      Source/Atomic/UI/SystemUI/BorderImage.h
  3. 3 3
      Source/Atomic/UI/SystemUI/Button.cpp
  4. 1 1
      Source/Atomic/UI/SystemUI/Button.h
  5. 2 2
      Source/Atomic/UI/SystemUI/CheckBox.cpp
  6. 1 1
      Source/Atomic/UI/SystemUI/CheckBox.h
  7. 3 3
      Source/Atomic/UI/SystemUI/Cursor.cpp
  8. 1 1
      Source/Atomic/UI/SystemUI/Cursor.h
  9. 5 5
      Source/Atomic/UI/SystemUI/DropDownList.cpp
  10. 1 1
      Source/Atomic/UI/SystemUI/DropDownList.h
  11. 2 2
      Source/Atomic/UI/SystemUI/FontFaceBitmap.cpp
  12. 2 2
      Source/Atomic/UI/SystemUI/FontFaceFreeType.cpp
  13. 7 7
      Source/Atomic/UI/SystemUI/LineEdit.cpp
  14. 4 4
      Source/Atomic/UI/SystemUI/ListView.cpp
  15. 3 3
      Source/Atomic/UI/SystemUI/Menu.cpp
  16. 3 3
      Source/Atomic/UI/SystemUI/MessageBox.cpp
  17. 1 1
      Source/Atomic/UI/SystemUI/ScrollBar.cpp
  18. 4 4
      Source/Atomic/UI/SystemUI/ScrollView.cpp
  19. 1 1
      Source/Atomic/UI/SystemUI/Slider.cpp
  20. 3 3
      Source/Atomic/UI/SystemUI/Sprite.cpp
  21. 1 1
      Source/Atomic/UI/SystemUI/Sprite.h
  22. 96 96
      Source/Atomic/UI/SystemUI/SystemUI.cpp
  23. 12 12
      Source/Atomic/UI/SystemUI/SystemUI.h
  24. 11 11
      Source/Atomic/UI/SystemUI/SystemUIBatch.cpp
  25. 5 5
      Source/Atomic/UI/SystemUI/SystemUIBatch.h
  26. 5 0
      Source/Atomic/UI/SystemUI/SystemUIEvents.h
  27. 8 8
      Source/Atomic/UI/SystemUI/Text.cpp
  28. 2 2
      Source/Atomic/UI/SystemUI/Text.h
  29. 2 2
      Source/Atomic/UI/SystemUI/ToolTip.cpp
  30. 10 10
      Source/Atomic/UI/SystemUI/UIElement.cpp
  31. 4 4
      Source/Atomic/UI/SystemUI/UIElement.h
  32. 8 8
      Source/Atomic/UI/SystemUI/Window.cpp
  33. 1 1
      Source/Atomic/UI/SystemUI/Window.h

+ 4 - 4
Source/Atomic/UI/SystemUI/BorderImage.cpp

@@ -66,7 +66,7 @@ void BorderImage::RegisterObject(Context* context)
     ENUM_ACCESSOR_ATTRIBUTE("Blend Mode", GetBlendMode, SetBlendMode, BlendMode, blendModeNames, 0, AM_FILE);
 }
 
-void BorderImage::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void BorderImage::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
     GetBatches(batches, vertexData, currentScissor, hovering_ || selected_ || HasFocus() ? hoverOffset_ : IntVector2::ZERO);
 }
@@ -126,7 +126,7 @@ void BorderImage::SetTiled(bool enable)
     tiled_ = enable;
 }
 
-void BorderImage::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor,
+void BorderImage::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor,
     const IntVector2& offset)
 {
     bool allOpaque = true;
@@ -134,7 +134,7 @@ void BorderImage::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vert
         color_[C_BOTTOMLEFT].a_ < 1.0f || color_[C_BOTTOMRIGHT].a_ < 1.0f)
         allOpaque = false;
 
-    UIBatch
+    SystemUIBatch
         batch(this, blendMode_ == BLEND_REPLACE && !allOpaque ? BLEND_ALPHA : blendMode_, currentScissor, texture_, &vertexData);
 
     // Calculate size of the inner rect, and texture dimensions of the inner rect
@@ -194,7 +194,7 @@ void BorderImage::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vert
                 uvBorder.bottom_);
     }
 
-    UIBatch::AddOrMerge(batch, batches);
+    SystemUIBatch::AddOrMerge(batch, batches);
 
     // Reset hovering for next frame
     hovering_ = false;

+ 2 - 2
Source/Atomic/UI/SystemUI/BorderImage.h

@@ -48,7 +48,7 @@ public:
     static void RegisterObject(Context* context);
 
     /// Return UI rendering batches.
-    virtual void GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
 
     /// Set texture.
     void SetTexture(Texture* texture);
@@ -98,7 +98,7 @@ public:
 protected:
     /// Return UI rendering batches with offset to image rectangle.
     void GetBatches
-        (PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor, const IntVector2& offset);
+        (PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor, const IntVector2& offset);
 
     /// Texture.
     SharedPtr<Texture> texture_;

+ 3 - 3
Source/Atomic/UI/SystemUI/Button.cpp

@@ -23,8 +23,8 @@
 #include "../../Core/Context.h"
 #include "../../Input/InputEvents.h"
 #include "Button.h"
-#include "UI.h"
-#include "UIEvents.h"
+#include "SystemUI.h"
+#include "SystemUIEvents.h"
 
 #include "../../DebugNew.h"
 
@@ -89,7 +89,7 @@ void Button::Update(float timeStep)
     }
 }
 
-void Button::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void Button::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
     IntVector2 offset(IntVector2::ZERO);
     if (hovering_ || HasFocus())

+ 1 - 1
Source/Atomic/UI/SystemUI/Button.h

@@ -46,7 +46,7 @@ public:
     /// Perform UI element update.
     virtual void Update(float timeStep);
     /// Return UI rendering batches.
-    virtual void GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
     /// React to mouse click begin.
     virtual void OnClickBegin
         (const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor);

+ 2 - 2
Source/Atomic/UI/SystemUI/CheckBox.cpp

@@ -24,7 +24,7 @@
 #include "../../Core/Context.h"
 #include "../../Input/InputEvents.h"
 #include "CheckBox.h"
-#include "UIEvents.h"
+#include "SystemUIEvents.h"
 
 #include "../../DebugNew.h"
 
@@ -60,7 +60,7 @@ void CheckBox::RegisterObject(Context* context)
     ACCESSOR_ATTRIBUTE("Checked Image Offset", GetCheckedOffset, SetCheckedOffset, IntVector2, IntVector2::ZERO, AM_FILE);
 }
 
-void CheckBox::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void CheckBox::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
     IntVector2 offset(IntVector2::ZERO);
     if (hovering_ || selected_ || HasFocus())

+ 1 - 1
Source/Atomic/UI/SystemUI/CheckBox.h

@@ -45,7 +45,7 @@ public:
     static void RegisterObject(Context* context);
 
     /// Return UI rendering batches.
-    virtual void GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
     /// React to mouse click begin.
     virtual void OnClickBegin
         (const IntVector2& position, const IntVector2& screenPosition, int button, int buttons, int qualifiers, Cursor* cursor);

+ 3 - 3
Source/Atomic/UI/SystemUI/Cursor.cpp

@@ -25,7 +25,7 @@
 #include "../../Input/Input.h"
 #include "../../IO/Log.h"
 #include "../../Resource/ResourceCache.h"
-#include "UI.h"
+#include "SystemUI.h"
 
 #include "../../DebugNew.h"
 
@@ -108,7 +108,7 @@ void Cursor::RegisterObject(Context* context)
     MIXED_ACCESSOR_ATTRIBUTE("Shapes", GetShapesAttr, SetShapesAttr, VariantVector, Variant::emptyVariantVector, AM_FILE);
 }
 
-void Cursor::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void Cursor::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
     unsigned initialSize = vertexData.Size();
     const IntVector2& offset = shapeInfos_[shape_].hotSpot_;
@@ -256,7 +256,7 @@ void Cursor::ApplyOSCursorShape()
 {
     // Mobile platforms do not support applying OS cursor shapes: comment out to avoid log error messages
 #if !defined(ANDROID) && !defined(IOS)
-    if (!osShapeDirty_ || !GetSubsystem<Input>()->IsMouseVisible() || GetSubsystem<UI>()->GetCursor() != this)
+    if (!osShapeDirty_ || !GetSubsystem<Input>()->IsMouseVisible() || GetSubsystem<SystemUI>()->GetCursor() != this)
         return;
 
     CursorShapeInfo& info = shapeInfos_[shape_];

+ 1 - 1
Source/Atomic/UI/SystemUI/Cursor.h

@@ -106,7 +106,7 @@ public:
     static void RegisterObject(Context* context);
 
     /// Return UI rendering batches.
-    virtual void GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
 
     /// Define a shape.
     void DefineShape(const String& shape, Image* image, const IntRect& imageRect, const IntVector2& hotSpot);

+ 5 - 5
Source/Atomic/UI/SystemUI/DropDownList.cpp

@@ -26,8 +26,8 @@
 #include "DropDownList.h"
 #include "ListView.h"
 #include "Text.h"
-#include "UI.h"
-#include "UIEvents.h"
+#include "SystemUI.h"
+#include "SystemUIEvents.h"
 #include "Window.h"
 
 #include "../../DebugNew.h"
@@ -86,7 +86,7 @@ void DropDownList::ApplyAttributes()
     SetSelection(selectionAttr_);
 }
 
-void DropDownList::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void DropDownList::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
     Menu::GetBatches(batches, vertexData, currentScissor);
 
@@ -134,7 +134,7 @@ void DropDownList::OnShowPopup()
     SetPopupOffset(0, showAbove ? -popup_->GetHeight() : GetHeight());
 
     // Focus the ListView to allow making the selection with keys
-    GetSubsystem<UI>()->SetFocusElement(listView_);
+    GetSubsystem<SystemUI>()->SetFocusElement(listView_);
 }
 
 void DropDownList::OnHidePopup()
@@ -327,7 +327,7 @@ void DropDownList::HandleItemClicked(StringHash eventType, VariantMap& eventData
 
     // Close and defocus the popup. This will actually send the selection forward
     if (listView_->HasFocus())
-        GetSubsystem<UI>()->SetFocusElement(focusMode_ < FM_FOCUSABLE ? 0 : this);
+        GetSubsystem<SystemUI>()->SetFocusElement(focusMode_ < FM_FOCUSABLE ? 0 : this);
     ShowPopup(false);
 }
 

+ 1 - 1
Source/Atomic/UI/SystemUI/DropDownList.h

@@ -48,7 +48,7 @@ public:
     /// Apply attribute changes that can not be applied immediately.
     virtual void ApplyAttributes();
     /// Return UI rendering batches.
-    virtual void GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
     /// React to the popup being shown.
     virtual void OnShowPopup();
     /// React to the popup being hidden.

+ 2 - 2
Source/Atomic/UI/SystemUI/FontFaceBitmap.cpp

@@ -30,7 +30,7 @@
 #include "../../Resource/ResourceCache.h"
 #include "Font.h"
 #include "FontFaceBitmap.h"
-#include "UI.h"
+#include "SystemUI.h"
 
 #include "../../DebugNew.h"
 
@@ -188,7 +188,7 @@ bool FontFaceBitmap::Load(FontFace* fontFace, bool usedGlyphs)
     rowHeight_ = fontFace->rowHeight_;
 
     unsigned numPages = 1;
-    int maxTextureSize = font_->GetSubsystem<UI>()->GetMaxFontTextureSize();
+    int maxTextureSize = font_->GetSubsystem<SystemUI>()->GetMaxFontTextureSize();
     AreaAllocator allocator(FONT_TEXTURE_MIN_SIZE, FONT_TEXTURE_MIN_SIZE, maxTextureSize, maxTextureSize);
 
     for (HashMap<unsigned, FontGlyph>::ConstIterator i = fontFace->glyphMapping_.Begin(); i != fontFace->glyphMapping_.End(); ++i)

+ 2 - 2
Source/Atomic/UI/SystemUI/FontFaceFreeType.cpp

@@ -28,7 +28,7 @@
 #include "../../IO/MemoryBuffer.h"
 #include "Font.h"
 #include "FontFaceFreeType.h"
-#include "UI.h"
+#include "SystemUI.h"
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
@@ -99,7 +99,7 @@ bool FontFaceFreeType::Load(const unsigned char* fontData, unsigned fontDataSize
     // Ensure the FreeType library is kept alive as long as TTF font resources exist
     freeType_ = freeType;
 
-    UI* ui = font_->GetSubsystem<UI>();
+    SystemUI* ui = font_->GetSubsystem<SystemUI>();
     int maxTextureSize = ui->GetMaxFontTextureSize();
 
     FT_Face face;

+ 7 - 7
Source/Atomic/UI/SystemUI/LineEdit.cpp

@@ -24,8 +24,8 @@
 #include "../../Input/Input.h"
 #include "LineEdit.h"
 #include "Text.h"
-#include "UI.h"
-#include "UIEvents.h"
+#include "SystemUI.h"
+#include "SystemUIEvents.h"
 
 #include "../../DebugNew.h"
 
@@ -221,7 +221,7 @@ void LineEdit::OnKey(int key, int buttons, int qualifiers)
             unsigned length = text_->GetSelectionLength();
 
             if (text_->GetSelectionLength())
-                GetSubsystem<UI>()->SetClipboardText(line_.SubstringUTF8(start, length));
+                GetSubsystem<SystemUI>()->SetClipboardText(line_.SubstringUTF8(start, length));
 
             if (key == 'X' && editable_)
             {
@@ -239,7 +239,7 @@ void LineEdit::OnKey(int key, int buttons, int qualifiers)
     case 'V':
         if (editable_ && textCopyable_ && qualifiers & QUAL_CTRL)
         {
-            const String& clipBoard = GetSubsystem<UI>()->GetClipboardText();
+            const String& clipBoard = GetSubsystem<SystemUI>()->GetClipboardText();
             if (!clipBoard.Empty())
             {
                 // Remove selected text first
@@ -407,7 +407,7 @@ void LineEdit::OnKey(int key, int buttons, int qualifiers)
     case KEY_KP_ENTER:
         {
             // If using the on-screen keyboard, defocus this element to hide it now
-            if (GetSubsystem<UI>()->GetUseScreenKeyboard() && HasFocus())
+            if (GetSubsystem<SystemUI>()->GetUseScreenKeyboard() && HasFocus())
                 SetFocus(false);
 
             using namespace TextFinished;
@@ -647,7 +647,7 @@ void LineEdit::HandleFocused(StringHash eventType, VariantMap& eventData)
     }
     UpdateCursor();
 
-    if (GetSubsystem<UI>()->GetUseScreenKeyboard())
+    if (GetSubsystem<SystemUI>()->GetUseScreenKeyboard())
         GetSubsystem<Input>()->SetScreenKeyboardVisible(true);
 }
 
@@ -655,7 +655,7 @@ void LineEdit::HandleDefocused(StringHash eventType, VariantMap& eventData)
 {
     text_->ClearSelection();
 
-    if (GetSubsystem<UI>()->GetUseScreenKeyboard())
+    if (GetSubsystem<SystemUI>()->GetUseScreenKeyboard())
         GetSubsystem<Input>()->SetScreenKeyboardVisible(false);
 }
 

+ 4 - 4
Source/Atomic/UI/SystemUI/ListView.cpp

@@ -26,8 +26,8 @@
 #include "CheckBox.h"
 #include "ListView.h"
 #include "Text.h"
-#include "UI.h"
-#include "UIEvents.h"
+#include "SystemUI.h"
+#include "SystemUIEvents.h"
 
 #include "../../DebugNew.h"
 
@@ -898,7 +898,7 @@ void ListView::CopySelectedItemsToClipboard() const
             selectedText.Append(text->GetText()).Append("\n");
     }
 
-    GetSubsystem<UI>()->SetClipboardText(selectedText);
+    GetSubsystem<SystemUI>()->SetClipboardText(selectedText);
 }
 
 bool ListView::IsSelected(unsigned index) const
@@ -996,7 +996,7 @@ void ListView::EnsureItemVisibility(UIElement* item)
 void ListView::HandleUIMouseClick(StringHash eventType, VariantMap& eventData)
 {
     // Disregard the click end if a drag is going on
-    if (selectOnClickEnd_ && GetSubsystem<UI>()->IsDragging())
+    if (selectOnClickEnd_ && GetSubsystem<SystemUI>()->IsDragging())
         return;
 
     int button = eventData[UIMouseClick::P_BUTTON].GetInt();

+ 3 - 3
Source/Atomic/UI/SystemUI/Menu.cpp

@@ -24,8 +24,8 @@
 #include "../../Input/InputEvents.h"
 #include "../../IO/Log.h"
 #include "Menu.h"
-#include "UI.h"
-#include "UIEvents.h"
+#include "SystemUI.h"
+#include "SystemUIEvents.h"
 #include "Window.h"
 
 #include "../../DebugNew.h"
@@ -432,7 +432,7 @@ void Menu::HandleKeyDown(StringHash eventType, VariantMap& eventData)
         eventData[P_REPEAT].GetBool() == false)
     {
         // Ignore if UI has modal element
-        if (GetSubsystem<UI>()->HasModalElement())
+        if (GetSubsystem<SystemUI>()->HasModalElement())
             return;
 
         HandlePressedReleased(eventType, eventData);

+ 3 - 3
Source/Atomic/UI/SystemUI/MessageBox.cpp

@@ -28,8 +28,8 @@
 #include "Button.h"
 #include "MessageBox.h"
 #include "Text.h"
-#include "UI.h"
-#include "UIEvents.h"
+#include "SystemUI.h"
+#include "SystemUIEvents.h"
 #include "Window.h"
 
 namespace Atomic
@@ -55,7 +55,7 @@ MessageBox::MessageBox(Context* context, const String& messageString, const Stri
             return;         // Note: windowless MessageBox should not be used!
     }
 
-    UI* ui = GetSubsystem<UI>();
+    SystemUI* ui = GetSubsystem<SystemUI>();
     window_ = ui->LoadLayout(layoutFile, styleFile);
     if (!window_)   // Error is already logged
         return;

+ 1 - 1
Source/Atomic/UI/SystemUI/ScrollBar.cpp

@@ -25,7 +25,7 @@
 #include "Button.h"
 #include "ScrollBar.h"
 #include "Slider.h"
-#include "UIEvents.h"
+#include "SystemUIEvents.h"
 
 namespace Atomic
 {

+ 4 - 4
Source/Atomic/UI/SystemUI/ScrollView.cpp

@@ -26,8 +26,8 @@
 #include "ScrollBar.h"
 #include "ScrollView.h"
 #include "Slider.h"
-#include "UI.h"
-#include "UIEvents.h"
+#include "SystemUI.h"
+#include "SystemUIEvents.h"
 
 #include "../../DebugNew.h"
 
@@ -126,9 +126,9 @@ void ScrollView::Update(float timeStep)
         return;
     }
 
-    if (GetSubsystem<UI>()->IsDragging())
+    if (GetSubsystem<SystemUI>()->IsDragging())
     {
-        Vector<UIElement*> dragElements = GetSubsystem<UI>()->GetDragElements();
+        Vector<UIElement*> dragElements = GetSubsystem<SystemUI>()->GetDragElements();
 
         for (unsigned i = 0; i < dragElements.Size(); i++)
         {

+ 1 - 1
Source/Atomic/UI/SystemUI/Slider.cpp

@@ -24,7 +24,7 @@
 #include "../../Input/InputEvents.h"
 #include "../../IO/Log.h"
 #include "Slider.h"
-#include "UIEvents.h"
+#include "SystemUIEvents.h"
 
 #include "../../DebugNew.h"
 

+ 3 - 3
Source/Atomic/UI/SystemUI/Sprite.cpp

@@ -96,7 +96,7 @@ const IntVector2& Sprite::GetScreenPosition() const
     return screenPosition_;
 }
 
-void Sprite::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void Sprite::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
     bool allOpaque = true;
     if (GetDerivedOpacity() < 1.0f || color_[C_TOPLEFT].a_ < 1.0f || color_[C_TOPRIGHT].a_ < 1.0f ||
@@ -104,13 +104,13 @@ void Sprite::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexDat
         allOpaque = false;
 
     const IntVector2& size = GetSize();
-    UIBatch
+    SystemUIBatch
         batch(this, blendMode_ == BLEND_REPLACE && !allOpaque ? BLEND_ALPHA : blendMode_, currentScissor, texture_, &vertexData);
 
     batch.AddQuad(GetTransform(), 0, 0, size.x_, size.y_, imageRect_.left_, imageRect_.top_, imageRect_.right_ - imageRect_.left_,
         imageRect_.bottom_ - imageRect_.top_);
 
-    UIBatch::AddOrMerge(batch, batches);
+    SystemUIBatch::AddOrMerge(batch, batches);
 
     // Reset hovering for next frame
     hovering_ = false;

+ 1 - 1
Source/Atomic/UI/SystemUI/Sprite.h

@@ -49,7 +49,7 @@ public:
     /// Update and return screen position.
     virtual const IntVector2& GetScreenPosition() const;
     /// Return UI rendering batches.
-    virtual void GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
     /// React to position change.
     virtual void OnPositionSet();
 

+ 96 - 96
Source/Atomic/UI/SystemUI/UI.cpp → Source/Atomic/UI/SystemUI/SystemUI.cpp

@@ -47,8 +47,8 @@
 #include "Sprite.h"
 #include "Text.h"
 #include "ToolTip.h"
-#include "UI.h"
-#include "UIEvents.h"
+#include "SystemUI.h"
+#include "SystemUIEvents.h"
 #include "Window.h"
 
 #include <SDL/include/SDL.h>
@@ -76,7 +76,7 @@ const int DEFAULT_FONT_TEXTURE_MAX_SIZE = 2048;
 
 const char* UI_CATEGORY = "UI";
 
-UI::UI(Context* context) :
+SystemUI::SystemUI(Context* context) :
     Object(context),
     rootElement_(new UIElement(context)),
     rootModalElement_(new UIElement(context)),
@@ -114,27 +114,27 @@ UI::UI(Context* context) :
     // Register UI library object factories
     RegisterUILibrary(context_);
 
-    SubscribeToEvent(E_SCREENMODE, HANDLER(UI, HandleScreenMode));
-    SubscribeToEvent(E_MOUSEBUTTONDOWN, HANDLER(UI, HandleMouseButtonDown));
-    SubscribeToEvent(E_MOUSEBUTTONUP, HANDLER(UI, HandleMouseButtonUp));
-    SubscribeToEvent(E_MOUSEMOVE, HANDLER(UI, HandleMouseMove));
-    SubscribeToEvent(E_MOUSEWHEEL, HANDLER(UI, HandleMouseWheel));
-    SubscribeToEvent(E_TOUCHBEGIN, HANDLER(UI, HandleTouchBegin));
-    SubscribeToEvent(E_TOUCHEND, HANDLER(UI, HandleTouchEnd));
-    SubscribeToEvent(E_TOUCHMOVE, HANDLER(UI, HandleTouchMove));
-    SubscribeToEvent(E_KEYDOWN, HANDLER(UI, HandleKeyDown));
-    SubscribeToEvent(E_TEXTINPUT, HANDLER(UI, HandleTextInput));
-    SubscribeToEvent(E_DROPFILE, HANDLER(UI, HandleDropFile));
+    SubscribeToEvent(E_SCREENMODE, HANDLER(SystemUI, HandleScreenMode));
+    SubscribeToEvent(E_MOUSEBUTTONDOWN, HANDLER(SystemUI, HandleMouseButtonDown));
+    SubscribeToEvent(E_MOUSEBUTTONUP, HANDLER(SystemUI, HandleMouseButtonUp));
+    SubscribeToEvent(E_MOUSEMOVE, HANDLER(SystemUI, HandleMouseMove));
+    SubscribeToEvent(E_MOUSEWHEEL, HANDLER(SystemUI, HandleMouseWheel));
+    SubscribeToEvent(E_TOUCHBEGIN, HANDLER(SystemUI, HandleTouchBegin));
+    SubscribeToEvent(E_TOUCHEND, HANDLER(SystemUI, HandleTouchEnd));
+    SubscribeToEvent(E_TOUCHMOVE, HANDLER(SystemUI, HandleTouchMove));
+    SubscribeToEvent(E_KEYDOWN, HANDLER(SystemUI, HandleKeyDown));
+    SubscribeToEvent(E_TEXTINPUT, HANDLER(SystemUI, HandleTextInput));
+    SubscribeToEvent(E_DROPFILE, HANDLER(SystemUI, HandleDropFile));
 
     // Try to initialize right now, but skip if screen mode is not yet set
     Initialize();
 }
 
-UI::~UI()
+SystemUI::~SystemUI()
 {
 }
 
-void UI::SetCursor(Cursor* cursor)
+void SystemUI::SetCursor(Cursor* cursor)
 {
     // Remove old cursor (if any) and set new
     if (cursor_)
@@ -155,7 +155,7 @@ void UI::SetCursor(Cursor* cursor)
     }
 }
 
-void UI::SetFocusElement(UIElement* element, bool byKey)
+void SystemUI::SetFocusElement(UIElement* element, bool byKey)
 {
     using namespace FocusChanged;
 
@@ -211,7 +211,7 @@ void UI::SetFocusElement(UIElement* element, bool byKey)
     SendEvent(E_FOCUSCHANGED, eventData);
 }
 
-bool UI::SetModalElement(UIElement* modalElement, bool enable)
+bool SystemUI::SetModalElement(UIElement* modalElement, bool enable)
 {
     if (!modalElement)
         return false;
@@ -285,7 +285,7 @@ bool UI::SetModalElement(UIElement* modalElement, bool enable)
     }
 }
 
-void UI::Clear()
+void SystemUI::Clear()
 {
     rootElement_->RemoveAllChildren();
     rootModalElement_->RemoveAllChildren();
@@ -293,7 +293,7 @@ void UI::Clear()
         rootElement_->AddChild(cursor_);
 }
 
-void UI::Update(float timeStep)
+void SystemUI::Update(float timeStep)
 {
     assert(rootElement_ && rootModalElement_);
 
@@ -313,10 +313,10 @@ void UI::Update(float timeStep)
     // Drag begin based on time
     if (dragElementsCount_ > 0 && !mouseGrabbed)
     {
-        for (HashMap<WeakPtr<UIElement>, UI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
+        for (HashMap<WeakPtr<UIElement>, SystemUI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
         {
             WeakPtr<UIElement> dragElement = i->first_;
-            UI::DragData* dragData = i->second_;
+            SystemUI::DragData* dragData = i->second_;
 
             if (!dragElement)
             {
@@ -387,7 +387,7 @@ void UI::Update(float timeStep)
     Update(timeStep, rootModalElement_);
 }
 
-void UI::RenderUpdate()
+void SystemUI::RenderUpdate()
 {
     assert(rootElement_ && rootModalElement_ && graphics_);
 
@@ -421,7 +421,7 @@ void UI::RenderUpdate()
     }
 }
 
-void UI::Render(bool resetRenderTargets)
+void SystemUI::Render(bool resetRenderTargets)
 {
     // Perform the default render only if not rendered yet
     if (resetRenderTargets && uiRendered_)
@@ -451,7 +451,7 @@ void UI::Render(bool resetRenderTargets)
     uiRendered_ = true;
 }
 
-void UI::DebugDraw(UIElement* element)
+void SystemUI::DebugDraw(UIElement* element)
 {
     if (element)
     {
@@ -460,7 +460,7 @@ void UI::DebugDraw(UIElement* element)
     }
 }
 
-SharedPtr<UIElement> UI::LoadLayout(Deserializer& source, XMLFile* styleFile)
+SharedPtr<UIElement> SystemUI::LoadLayout(Deserializer& source, XMLFile* styleFile)
 {
     SharedPtr<XMLFile> xml(new XMLFile(context_));
     if (!xml->Load(source))
@@ -469,7 +469,7 @@ SharedPtr<UIElement> UI::LoadLayout(Deserializer& source, XMLFile* styleFile)
         return LoadLayout(xml, styleFile);
 }
 
-SharedPtr<UIElement> UI::LoadLayout(XMLFile* file, XMLFile* styleFile)
+SharedPtr<UIElement> SystemUI::LoadLayout(XMLFile* file, XMLFile* styleFile)
 {
     PROFILE(LoadUILayout);
 
@@ -512,41 +512,41 @@ SharedPtr<UIElement> UI::LoadLayout(XMLFile* file, XMLFile* styleFile)
     return root;
 }
 
-bool UI::SaveLayout(Serializer& dest, UIElement* element)
+bool SystemUI::SaveLayout(Serializer& dest, UIElement* element)
 {
     PROFILE(SaveUILayout);
 
     return element && element->SaveXML(dest);
 }
 
-void UI::SetClipboardText(const String& text)
+void SystemUI::SetClipboardText(const String& text)
 {
     clipBoard_ = text;
     if (useSystemClipboard_)
         SDL_SetClipboardText(text.CString());
 }
 
-void UI::SetDoubleClickInterval(float interval)
+void SystemUI::SetDoubleClickInterval(float interval)
 {
     doubleClickInterval_ = Max(interval, 0.0f);
 }
 
-void UI::SetDragBeginInterval(float interval)
+void SystemUI::SetDragBeginInterval(float interval)
 {
     dragBeginInterval_ = Max(interval, 0.0f);
 }
 
-void UI::SetDragBeginDistance(int pixels)
+void SystemUI::SetDragBeginDistance(int pixels)
 {
     dragBeginDistance_ = Max(pixels, 0);
 }
 
-void UI::SetDefaultToolTipDelay(float delay)
+void SystemUI::SetDefaultToolTipDelay(float delay)
 {
     defaultToolTipDelay_ = Max(delay, 0.0f);
 }
 
-void UI::SetMaxFontTextureSize(int size)
+void SystemUI::SetMaxFontTextureSize(int size)
 {
     if (IsPowerOfTwo((unsigned)size) && size >= FONT_TEXTURE_MIN_SIZE)
     {
@@ -558,22 +558,22 @@ void UI::SetMaxFontTextureSize(int size)
     }
 }
 
-void UI::SetNonFocusedMouseWheel(bool nonFocusedMouseWheel)
+void SystemUI::SetNonFocusedMouseWheel(bool nonFocusedMouseWheel)
 {
     nonFocusedMouseWheel_ = nonFocusedMouseWheel;
 }
 
-void UI::SetUseSystemClipboard(bool enable)
+void SystemUI::SetUseSystemClipboard(bool enable)
 {
     useSystemClipboard_ = enable;
 }
 
-void UI::SetUseScreenKeyboard(bool enable)
+void SystemUI::SetUseScreenKeyboard(bool enable)
 {
     useScreenKeyboard_ = enable;
 }
 
-void UI::SetUseMutableGlyphs(bool enable)
+void SystemUI::SetUseMutableGlyphs(bool enable)
 {
     if (enable != useMutableGlyphs_)
     {
@@ -582,7 +582,7 @@ void UI::SetUseMutableGlyphs(bool enable)
     }
 }
 
-void UI::SetForceAutoHint(bool enable)
+void SystemUI::SetForceAutoHint(bool enable)
 {
     if (enable != forceAutoHint_)
     {
@@ -591,24 +591,24 @@ void UI::SetForceAutoHint(bool enable)
     }
 }
 
-IntVector2 UI::GetCursorPosition() const
+IntVector2 SystemUI::GetCursorPosition() const
 {
     return cursor_ ? cursor_->GetPosition() : GetSubsystem<Input>()->GetMousePosition();
 }
 
-UIElement* UI::GetElementAt(const IntVector2& position, bool enabledOnly)
+UIElement* SystemUI::GetElementAt(const IntVector2& position, bool enabledOnly)
 {
     UIElement* result = 0;
     GetElementAt(result, HasModalElement() ? rootModalElement_ : rootElement_, position, enabledOnly);
     return result;
 }
 
-UIElement* UI::GetElementAt(int x, int y, bool enabledOnly)
+UIElement* SystemUI::GetElementAt(int x, int y, bool enabledOnly)
 {
     return GetElementAt(IntVector2(x, y), enabledOnly);
 }
 
-UIElement* UI::GetFrontElement() const
+UIElement* SystemUI::GetFrontElement() const
 {
     const Vector<SharedPtr<UIElement> >& rootChildren = rootElement_->GetChildren();
     int maxPriority = M_MIN_INT;
@@ -631,16 +631,16 @@ UIElement* UI::GetFrontElement() const
     return front;
 }
 
-const Vector<UIElement*> UI::GetDragElements()
+const Vector<UIElement*> SystemUI::GetDragElements()
 {
     // Do not return the element until drag begin event has actually been posted
     if (!dragElementsConfirmed_.Empty())
         return dragElementsConfirmed_;
 
-    for (HashMap<WeakPtr<UIElement>, UI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
+    for (HashMap<WeakPtr<UIElement>, SystemUI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
     {
         WeakPtr<UIElement> dragElement = i->first_;
-        UI::DragData* dragData = i->second_;
+        SystemUI::DragData* dragData = i->second_;
 
         if (!dragElement)
         {
@@ -657,7 +657,7 @@ const Vector<UIElement*> UI::GetDragElements()
     return dragElementsConfirmed_;
 }
 
-UIElement* UI::GetDragElement(unsigned index)
+UIElement* SystemUI::GetDragElement(unsigned index)
 {
     GetDragElements();
     if (index >= dragElementsConfirmed_.Size())
@@ -666,7 +666,7 @@ UIElement* UI::GetDragElement(unsigned index)
     return dragElementsConfirmed_[index];
 }
 
-const String& UI::GetClipboardText() const
+const String& SystemUI::GetClipboardText() const
 {
     if (useSystemClipboard_)
     {
@@ -679,12 +679,12 @@ const String& UI::GetClipboardText() const
     return clipBoard_;
 }
 
-bool UI::HasModalElement() const
+bool SystemUI::HasModalElement() const
 {
     return rootModalElement_->GetNumChildren() > 0;
 }
 
-void UI::Initialize()
+void SystemUI::Initialize()
 {
     Graphics* graphics = GetSubsystem<Graphics>();
 
@@ -694,7 +694,7 @@ void UI::Initialize()
     PROFILE(InitUI);
 
     graphics_ = graphics;
-    UIBatch::posAdjust = Vector3(Graphics::GetPixelUVOffset(), 0.0f);
+    SystemUIBatch::posAdjust = Vector3(Graphics::GetPixelUVOffset(), 0.0f);
 
     rootElement_->SetSize(graphics->GetWidth(), graphics->GetHeight());
     rootModalElement_->SetSize(rootElement_->GetSize());
@@ -704,14 +704,14 @@ void UI::Initialize()
 
     initialized_ = true;
 
-    SubscribeToEvent(E_BEGINFRAME, HANDLER(UI, HandleBeginFrame));
-    SubscribeToEvent(E_POSTUPDATE, HANDLER(UI, HandlePostUpdate));
-    SubscribeToEvent(E_RENDERUPDATE, HANDLER(UI, HandleRenderUpdate));
+    SubscribeToEvent(E_BEGINFRAME, HANDLER(SystemUI, HandleBeginFrame));
+    SubscribeToEvent(E_POSTUPDATE, HANDLER(SystemUI, HandlePostUpdate));
+    SubscribeToEvent(E_RENDERUPDATE, HANDLER(SystemUI, HandleRenderUpdate));
 
     LOGINFO("Initialized user interface");
 }
 
-void UI::Update(float timeStep, UIElement* element)
+void SystemUI::Update(float timeStep, UIElement* element)
 {
     // Keep a weak pointer to the element in case it destroys itself on update
     WeakPtr<UIElement> elementWeak(element);
@@ -726,7 +726,7 @@ void UI::Update(float timeStep, UIElement* element)
         Update(timeStep, children[i]);
 }
 
-void UI::SetVertexData(VertexBuffer* dest, const PODVector<float>& vertexData)
+void SystemUI::SetVertexData(VertexBuffer* dest, const PODVector<float>& vertexData)
 {
     if (vertexData.Empty())
         return;
@@ -740,7 +740,7 @@ void UI::SetVertexData(VertexBuffer* dest, const PODVector<float>& vertexData)
     dest->SetData(&vertexData[0]);
 }
 
-void UI::Render(bool resetRenderTargets, VertexBuffer* buffer, const PODVector<UIBatch>& batches, unsigned batchStart,
+void SystemUI::Render(bool resetRenderTargets, VertexBuffer* buffer, const PODVector<SystemUIBatch>& batches, unsigned batchStart,
     unsigned batchEnd)
 {
     // Engine does not render when window is closed or device is lost
@@ -784,7 +784,7 @@ void UI::Render(bool resetRenderTargets, VertexBuffer* buffer, const PODVector<U
 
     for (unsigned i = batchStart; i < batchEnd; ++i)
     {
-        const UIBatch& batch = batches[i];
+        const SystemUIBatch& batch = batches[i];
         if (batch.vertexStart_ == batch.vertexEnd_)
             continue;
 
@@ -825,7 +825,7 @@ void UI::Render(bool resetRenderTargets, VertexBuffer* buffer, const PODVector<U
     }
 }
 
-void UI::GetBatches(UIElement* element, IntRect currentScissor)
+void SystemUI::GetBatches(UIElement* element, IntRect currentScissor)
 {
     // Set clipping scissor for child elements. No need to draw if zero size
     element->AdjustScissor(currentScissor);
@@ -878,7 +878,7 @@ void UI::GetBatches(UIElement* element, IntRect currentScissor)
     }
 }
 
-void UI::GetElementAt(UIElement*& result, UIElement* current, const IntVector2& position, bool enabledOnly)
+void SystemUI::GetElementAt(UIElement*& result, UIElement* current, const IntVector2& position, bool enabledOnly)
 {
     if (!current)
         return;
@@ -947,7 +947,7 @@ void UI::GetElementAt(UIElement*& result, UIElement* current, const IntVector2&
     }
 }
 
-UIElement* UI::GetFocusableElement(UIElement* element)
+UIElement* SystemUI::GetFocusableElement(UIElement* element)
 {
     while (element)
     {
@@ -958,7 +958,7 @@ UIElement* UI::GetFocusableElement(UIElement* element)
     return element;
 }
 
-void UI::GetCursorPositionAndVisible(IntVector2& pos, bool& visible)
+void SystemUI::GetCursorPositionAndVisible(IntVector2& pos, bool& visible)
 {
     // Prefer software cursor then OS-specific cursor
     if (cursor_ && cursor_->IsVisible())
@@ -979,13 +979,13 @@ void UI::GetCursorPositionAndVisible(IntVector2& pos, bool& visible)
     }
 }
 
-void UI::SetCursorShape(CursorShape shape)
+void SystemUI::SetCursorShape(CursorShape shape)
 {
     if (cursor_)
         cursor_->SetShape(shape);
 }
 
-void UI::ReleaseFontFaces()
+void SystemUI::ReleaseFontFaces()
 {
     LOGDEBUG("Reloading font faces");
 
@@ -996,14 +996,14 @@ void UI::ReleaseFontFaces()
         fonts[i]->ReleaseFaces();
 }
 
-void UI::ProcessHover(const IntVector2& cursorPos, int buttons, int qualifiers, Cursor* cursor)
+void SystemUI::ProcessHover(const IntVector2& cursorPos, int buttons, int qualifiers, Cursor* cursor)
 {
     WeakPtr<UIElement> element(GetElementAt(cursorPos));
 
-    for (HashMap<WeakPtr<UIElement>, UI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
+    for (HashMap<WeakPtr<UIElement>, SystemUI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
     {
         WeakPtr<UIElement> dragElement = i->first_;
-        UI::DragData* dragData = i->second_;
+        SystemUI::DragData* dragData = i->second_;
 
         if (!dragElement)
         {
@@ -1084,7 +1084,7 @@ void UI::ProcessHover(const IntVector2& cursorPos, int buttons, int qualifiers,
     }
 }
 
-void UI::ProcessClickBegin(const IntVector2& cursorPos, int button, int buttons, int qualifiers, Cursor* cursor, bool cursorVisible)
+void SystemUI::ProcessClickBegin(const IntVector2& cursorPos, int button, int buttons, int qualifiers, Cursor* cursor, bool cursorVisible)
 {
     if (cursorVisible)
     {
@@ -1161,17 +1161,17 @@ void UI::ProcessClickBegin(const IntVector2& cursorPos, int button, int buttons,
     }
 }
 
-void UI::ProcessClickEnd(const IntVector2& cursorPos, int button, int buttons, int qualifiers, Cursor* cursor, bool cursorVisible)
+void SystemUI::ProcessClickEnd(const IntVector2& cursorPos, int button, int buttons, int qualifiers, Cursor* cursor, bool cursorVisible)
 {
     if (cursorVisible)
     {
         WeakPtr<UIElement> element(GetElementAt(cursorPos));
 
         // Handle end of drag
-        for (HashMap<WeakPtr<UIElement>, UI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
+        for (HashMap<WeakPtr<UIElement>, SystemUI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
         {
             WeakPtr<UIElement> dragElement = i->first_;
-            UI::DragData* dragData = i->second_;
+            SystemUI::DragData* dragData = i->second_;
 
             if (!dragElement)
             {
@@ -1227,17 +1227,17 @@ void UI::ProcessClickEnd(const IntVector2& cursorPos, int button, int buttons, i
     }
 }
 
-void UI::ProcessMove(const IntVector2& cursorPos, const IntVector2& cursorDeltaPos, int buttons, int qualifiers, Cursor* cursor,
+void SystemUI::ProcessMove(const IntVector2& cursorPos, const IntVector2& cursorDeltaPos, int buttons, int qualifiers, Cursor* cursor,
     bool cursorVisible)
 {
     if (cursorVisible && dragElementsCount_ > 0 && buttons)
     {
         Input* input = GetSubsystem<Input>();
         bool mouseGrabbed = input->IsMouseGrabbed();
-        for (HashMap<WeakPtr<UIElement>, UI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
+        for (HashMap<WeakPtr<UIElement>, SystemUI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
         {
             WeakPtr<UIElement> dragElement = i->first_;
-            UI::DragData* dragData = i->second_;
+            SystemUI::DragData* dragData = i->second_;
 
             if (!dragElement)
             {
@@ -1305,8 +1305,8 @@ void UI::ProcessMove(const IntVector2& cursorPos, const IntVector2& cursorDeltaP
     }
 }
 
-void UI::SendDragOrHoverEvent(StringHash eventType, UIElement* element, const IntVector2& screenPos, const IntVector2& deltaPos,
-    UI::DragData* dragData)
+void SystemUI::SendDragOrHoverEvent(StringHash eventType, UIElement* element, const IntVector2& screenPos, const IntVector2& deltaPos,
+    SystemUI::DragData* dragData)
 {
     if (!element)
         return;
@@ -1337,7 +1337,7 @@ void UI::SendDragOrHoverEvent(StringHash eventType, UIElement* element, const In
     element->SendEvent(eventType, eventData);
 }
 
-void UI::SendClickEvent(StringHash eventType, UIElement* beginElement, UIElement* endElement, const IntVector2& pos, int button,
+void SystemUI::SendClickEvent(StringHash eventType, UIElement* beginElement, UIElement* endElement, const IntVector2& pos, int button,
     int buttons, int qualifiers)
 {
     VariantMap& eventData = GetEventDataMap();
@@ -1355,7 +1355,7 @@ void UI::SendClickEvent(StringHash eventType, UIElement* beginElement, UIElement
     SendEvent(eventType, eventData);
 }
 
-void UI::HandleScreenMode(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleScreenMode(StringHash eventType, VariantMap& eventData)
 {
     using namespace ScreenMode;
 
@@ -1368,7 +1368,7 @@ void UI::HandleScreenMode(StringHash eventType, VariantMap& eventData)
     }
 }
 
-void UI::HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
 {
     using namespace MouseButtonDown;
 
@@ -1389,7 +1389,7 @@ void UI::HandleMouseButtonDown(StringHash eventType, VariantMap& eventData)
         ProcessClickBegin(cursorPos, eventData[P_BUTTON].GetInt(), mouseButtons_, qualifiers_, cursor_, cursorVisible);
 }
 
-void UI::HandleMouseButtonUp(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleMouseButtonUp(StringHash eventType, VariantMap& eventData)
 {
     using namespace MouseButtonUp;
 
@@ -1403,7 +1403,7 @@ void UI::HandleMouseButtonUp(StringHash eventType, VariantMap& eventData)
     ProcessClickEnd(cursorPos, eventData[P_BUTTON].GetInt(), mouseButtons_, qualifiers_, cursor_, cursorVisible);
 }
 
-void UI::HandleMouseMove(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleMouseMove(StringHash eventType, VariantMap& eventData)
 {
     using namespace MouseMove;
 
@@ -1445,7 +1445,7 @@ void UI::HandleMouseMove(StringHash eventType, VariantMap& eventData)
     ProcessMove(cursorPos, DeltaP, mouseButtons_, qualifiers_, cursor_, cursorVisible);
 }
 
-void UI::HandleMouseWheel(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleMouseWheel(StringHash eventType, VariantMap& eventData)
 {
     Input* input = GetSubsystem<Input>();
     if (input->IsMouseGrabbed())
@@ -1493,7 +1493,7 @@ void UI::HandleMouseWheel(StringHash eventType, VariantMap& eventData)
     }
 }
 
-void UI::HandleTouchBegin(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleTouchBegin(StringHash eventType, VariantMap& eventData)
 {
     Input* input = GetSubsystem<Input>();
     if (input->IsMouseGrabbed())
@@ -1516,7 +1516,7 @@ void UI::HandleTouchBegin(StringHash eventType, VariantMap& eventData)
         ProcessClickBegin(pos, touchId, touchId, 0, 0, true);
 }
 
-void UI::HandleTouchEnd(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleTouchEnd(StringHash eventType, VariantMap& eventData)
 {
     using namespace TouchEnd;
 
@@ -1544,7 +1544,7 @@ void UI::HandleTouchEnd(StringHash eventType, VariantMap& eventData)
     ProcessClickEnd(pos, touchId, 0, 0, 0, true);
 }
 
-void UI::HandleTouchMove(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleTouchMove(StringHash eventType, VariantMap& eventData)
 {
     using namespace TouchMove;
 
@@ -1557,7 +1557,7 @@ void UI::HandleTouchMove(StringHash eventType, VariantMap& eventData)
     ProcessMove(pos, deltaPos, touchId, 0, 0, true);
 }
 
-void UI::HandleKeyDown(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleKeyDown(StringHash eventType, VariantMap& eventData)
 {
     using namespace KeyDown;
 
@@ -1632,7 +1632,7 @@ void UI::HandleKeyDown(StringHash eventType, VariantMap& eventData)
     }
 }
 
-void UI::HandleTextInput(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleTextInput(StringHash eventType, VariantMap& eventData)
 {
     using namespace TextInput;
 
@@ -1644,7 +1644,7 @@ void UI::HandleTextInput(StringHash eventType, VariantMap& eventData)
         element->OnTextInput(eventData[P_TEXT].GetString(), mouseButtons_, qualifiers_);
 }
 
-void UI::HandleBeginFrame(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleBeginFrame(StringHash eventType, VariantMap& eventData)
 {
     // If have a cursor, and a drag is not going on, reset the cursor shape. Application logic that wants to apply
     // custom shapes can do it after this, but needs to do it each frame
@@ -1652,19 +1652,19 @@ void UI::HandleBeginFrame(StringHash eventType, VariantMap& eventData)
         cursor_->SetShape(CS_NORMAL);
 }
 
-void UI::HandlePostUpdate(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandlePostUpdate(StringHash eventType, VariantMap& eventData)
 {
     using namespace PostUpdate;
 
     Update(eventData[P_TIMESTEP].GetFloat());
 }
 
-void UI::HandleRenderUpdate(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleRenderUpdate(StringHash eventType, VariantMap& eventData)
 {
     RenderUpdate();
 }
 
-void UI::HandleDropFile(StringHash eventType, VariantMap& eventData)
+void SystemUI::HandleDropFile(StringHash eventType, VariantMap& eventData)
 {
     Input* input = GetSubsystem<Input>();
 
@@ -1693,7 +1693,7 @@ void UI::HandleDropFile(StringHash eventType, VariantMap& eventData)
     }
 }
 
-HashMap<WeakPtr<UIElement>, UI::DragData*>::Iterator UI::DragElementErase(HashMap<WeakPtr<UIElement>, UI::DragData*>::Iterator i)
+HashMap<WeakPtr<UIElement>, SystemUI::DragData*>::Iterator SystemUI::DragElementErase(HashMap<WeakPtr<UIElement>, SystemUI::DragData*>::Iterator i)
 {
     // If running the engine frame in response to an event (re-entering UI frame logic) the dragElements_ may already be empty
     if (dragElements_.Empty())
@@ -1712,7 +1712,7 @@ HashMap<WeakPtr<UIElement>, UI::DragData*>::Iterator UI::DragElementErase(HashMa
     return i;
 }
 
-void UI::ProcessDragCancel()
+void SystemUI::ProcessDragCancel()
 {
     // How to tell difference between drag cancel and new selection on multi-touch?
     if (usingTouchInput_)
@@ -1722,10 +1722,10 @@ void UI::ProcessDragCancel()
     bool cursorVisible;
     GetCursorPositionAndVisible(cursorPos, cursorVisible);
 
-    for (HashMap<WeakPtr<UIElement>, UI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
+    for (HashMap<WeakPtr<UIElement>, SystemUI::DragData*>::Iterator i = dragElements_.Begin(); i != dragElements_.End();)
     {
         WeakPtr<UIElement> dragElement = i->first_;
-        UI::DragData* dragData = i->second_;
+        SystemUI::DragData* dragData = i->second_;
 
         if (dragElement && dragElement->IsEnabled() && dragElement->IsVisible() && !dragData->dragBeginPending)
         {
@@ -1739,7 +1739,7 @@ void UI::ProcessDragCancel()
     }
 }
 
-IntVector2 UI::SumTouchPositions(UI::DragData* dragData, const IntVector2& oldSendPos)
+IntVector2 SystemUI::SumTouchPositions(SystemUI::DragData* dragData, const IntVector2& oldSendPos)
 {
     IntVector2 sendPos = oldSendPos;
     if (usingTouchInput_)

+ 12 - 12
Source/Atomic/UI/SystemUI/UI.h → Source/Atomic/UI/SystemUI/SystemUI.h

@@ -24,7 +24,7 @@
 
 #include "../../Core/Object.h"
 #include "Cursor.h"
-#include "UIBatch.h"
+#include "SystemUIBatch.h"
 
 namespace Atomic
 {
@@ -40,19 +40,19 @@ namespace SystemUI
 {
 
 class Cursor;
-class UIBatch;
+class SystemUIBatch;
 class UIElement;
 
 /// %UI subsystem. Manages the graphical user interface.
-class ATOMIC_API UI : public Object
+class ATOMIC_API SystemUI : public Object
 {
-    OBJECT(UI);
+    OBJECT(SystemUI);
 
 public:
     /// Construct.
-    UI(Context* context);
+    SystemUI(Context* context);
     /// Destruct.
-    virtual ~UI();
+    virtual ~SystemUI();
 
     /// Set cursor UI element.
     void SetCursor(Cursor* cursor);
@@ -166,7 +166,7 @@ public:
     bool HasModalElement() const;
 
     /// Return whether a drag is in progress.
-    bool IsDragging() const { return dragConfirmedCount_ > 0; };
+    bool IsDragging() const { return dragConfirmedCount_ > 0; }
 
     /// Data structure used to represent the drag data associated to a UIElement.
     struct DragData
@@ -194,7 +194,7 @@ private:
     void SetVertexData(VertexBuffer* dest, const PODVector<float>& vertexData);
     /// Render UI batches. Geometry must have been uploaded first.
     void Render
-        (bool resetRenderTargets, VertexBuffer* buffer, const PODVector<UIBatch>& batches, unsigned batchStart, unsigned batchEnd);
+        (bool resetRenderTargets, VertexBuffer* buffer, const PODVector<SystemUIBatch>& batches, unsigned batchStart, unsigned batchEnd);
     /// Generate batches from an UI element recursively. Skip the cursor element.
     void GetBatches(UIElement* element, IntRect currentScissor);
     /// Return UI element at screen position recursively.
@@ -219,7 +219,7 @@ private:
         bool cursorVisible);
     /// Send a UI element drag or hover begin event.
     void SendDragOrHoverEvent
-        (StringHash eventType, UIElement* element, const IntVector2& screenPos, const IntVector2& deltaPos, UI::DragData* dragData);
+        (StringHash eventType, UIElement* element, const IntVector2& screenPos, const IntVector2& deltaPos, SystemUI::DragData* dragData);
     /// Send a UI click or double click event.
     void SendClickEvent
         (StringHash eventType, UIElement* beginElement, UIElement* endElement, const IntVector2& pos, int button, int buttons,
@@ -257,7 +257,7 @@ private:
     /// Handle clean up on a drag cancel.
     void ProcessDragCancel();
     /// Sum touch positions and return the begin position ready to send.
-    IntVector2 SumTouchPositions(UI::DragData* dragData, const IntVector2& oldSendPos);
+    IntVector2 SumTouchPositions(SystemUI::DragData* dragData, const IntVector2& oldSendPos);
 
     /// Graphics subsystem.
     WeakPtr<Graphics> graphics_;
@@ -270,11 +270,11 @@ private:
     /// Currently focused element.
     WeakPtr<UIElement> focusElement_;
     /// UI rendering batches.
-    PODVector<UIBatch> batches_;
+    PODVector<SystemUIBatch> batches_;
     /// UI rendering vertex data.
     PODVector<float> vertexData_;
     /// UI rendering batches for debug draw.
-    PODVector<UIBatch> debugDrawBatches_;
+    PODVector<SystemUIBatch> debugDrawBatches_;
     /// UI rendering vertex data for debug draw.
     PODVector<float> debugVertexData_;
     /// UI vertex buffer.

+ 11 - 11
Source/Atomic/UI/SystemUI/UIBatch.cpp → Source/Atomic/UI/SystemUI/SystemUIBatch.cpp

@@ -32,9 +32,9 @@ namespace Atomic
 namespace SystemUI
 {
 
-Vector3 UIBatch::posAdjust(0.0f, 0.0f, 0.0f);
+Vector3 SystemUIBatch::posAdjust(0.0f, 0.0f, 0.0f);
 
-UIBatch::UIBatch() :
+SystemUIBatch::SystemUIBatch() :
     element_(0),
     blendMode_(BLEND_REPLACE),
     texture_(0),
@@ -46,7 +46,7 @@ UIBatch::UIBatch() :
     SetDefaultColor();
 }
 
-UIBatch::UIBatch(UIElement* element, BlendMode blendMode, const IntRect& scissor, Texture* texture, PODVector<float>* vertexData) :
+SystemUIBatch::SystemUIBatch(UIElement* element, BlendMode blendMode, const IntRect& scissor, Texture* texture, PODVector<float>* vertexData) :
     element_(element),
     blendMode_(blendMode),
     scissor_(scissor),
@@ -59,7 +59,7 @@ UIBatch::UIBatch(UIElement* element, BlendMode blendMode, const IntRect& scissor
     SetDefaultColor();
 }
 
-void UIBatch::SetColor(const Color& color, bool overrideAlpha)
+void SystemUIBatch::SetColor(const Color& color, bool overrideAlpha)
 {
     if (!element_)
         overrideAlpha = true;
@@ -69,7 +69,7 @@ void UIBatch::SetColor(const Color& color, bool overrideAlpha)
         overrideAlpha ? color.ToUInt() : Color(color.r_, color.g_, color.b_, color.a_ * element_->GetDerivedOpacity()).ToUInt();
 }
 
-void UIBatch::SetDefaultColor()
+void SystemUIBatch::SetDefaultColor()
 {
     if (element_)
     {
@@ -83,7 +83,7 @@ void UIBatch::SetDefaultColor()
     }
 }
 
-void UIBatch::AddQuad(int x, int y, int width, int height, int texOffsetX, int texOffsetY, int texWidth, int texHeight)
+void SystemUIBatch::AddQuad(int x, int y, int width, int height, int texOffsetX, int texOffsetY, int texWidth, int texHeight)
 {
     unsigned topLeftColor, topRightColor, bottomLeftColor, bottomRightColor;
 
@@ -166,7 +166,7 @@ void UIBatch::AddQuad(int x, int y, int width, int height, int texOffsetX, int t
     dest[35] = bottomUV;
 }
 
-void UIBatch::AddQuad(const Matrix3x4& transform, int x, int y, int width, int height, int texOffsetX, int texOffsetY,
+void SystemUIBatch::AddQuad(const Matrix3x4& transform, int x, int y, int width, int height, int texOffsetX, int texOffsetY,
     int texWidth, int texHeight)
 {
     unsigned topLeftColor, topRightColor, bottomLeftColor, bottomRightColor;
@@ -248,7 +248,7 @@ void UIBatch::AddQuad(const Matrix3x4& transform, int x, int y, int width, int h
     dest[35] = bottomUV;
 }
 
-void UIBatch::AddQuad(int x, int y, int width, int height, int texOffsetX, int texOffsetY, int texWidth, int texHeight, bool tiled)
+void SystemUIBatch::AddQuad(int x, int y, int width, int height, int texOffsetX, int texOffsetY, int texWidth, int texHeight, bool tiled)
 {
     if (!(element_->HasColorGradient() || element_->GetDerivedColor().ToUInt() & 0xff000000))
         return; // No gradient and alpha is 0, so do not add the quad
@@ -282,7 +282,7 @@ void UIBatch::AddQuad(int x, int y, int width, int height, int texOffsetX, int t
     }
 }
 
-bool UIBatch::Merge(const UIBatch& batch)
+bool SystemUIBatch::Merge(const SystemUIBatch& batch)
 {
     if (batch.blendMode_ != blendMode_ ||
         batch.scissor_ != scissor_ ||
@@ -295,7 +295,7 @@ bool UIBatch::Merge(const UIBatch& batch)
     return true;
 }
 
-unsigned UIBatch::GetInterpolatedColor(int x, int y)
+unsigned SystemUIBatch::GetInterpolatedColor(int x, int y)
 {
     const IntVector2& size = element_->GetSize();
 
@@ -318,7 +318,7 @@ unsigned UIBatch::GetInterpolatedColor(int x, int y)
     }
 }
 
-void UIBatch::AddOrMerge(const UIBatch& batch, PODVector<UIBatch>& batches)
+void SystemUIBatch::AddOrMerge(const SystemUIBatch& batch, PODVector<SystemUIBatch>& batches)
 {
     if (batch.vertexEnd_ == batch.vertexStart_)
         return;

+ 5 - 5
Source/Atomic/UI/SystemUI/UIBatch.h → Source/Atomic/UI/SystemUI/SystemUIBatch.h

@@ -42,13 +42,13 @@ class UIElement;
 static const unsigned UI_VERTEX_SIZE = 6;
 
 /// %UI rendering draw call.
-class ATOMIC_API UIBatch
+class ATOMIC_API SystemUIBatch
 {
 public:
     /// Construct with defaults.
-    UIBatch();
+    SystemUIBatch();
     /// Construct.
-    UIBatch(UIElement* element, BlendMode blendMode, const IntRect& scissor, Texture* texture, PODVector<float>* vertexData);
+    SystemUIBatch(UIElement* element, BlendMode blendMode, const IntRect& scissor, Texture* texture, PODVector<float>* vertexData);
 
     /// Set new color for the batch. Overrides gradient.
     void SetColor(const Color& color, bool overrideAlpha = false);
@@ -62,12 +62,12 @@ public:
     /// Add a quad with tiled texture.
     void AddQuad(int x, int y, int width, int height, int texOffsetX, int texOffsetY, int texWidth, int texHeight, bool tiled);
     /// Merge with another batch.
-    bool Merge(const UIBatch& batch);
+    bool Merge(const SystemUIBatch& batch);
     /// Return an interpolated color for the UI element.
     unsigned GetInterpolatedColor(int x, int y);
 
     /// Add or merge a batch.
-    static void AddOrMerge(const UIBatch& batch, PODVector<UIBatch>& batches);
+    static void AddOrMerge(const SystemUIBatch& batch, PODVector<SystemUIBatch>& batches);
 
     /// Element this batch represents.
     UIElement* element_;

+ 5 - 0
Source/Atomic/UI/SystemUI/UIEvents.h → Source/Atomic/UI/SystemUI/SystemUIEvents.h

@@ -27,6 +27,9 @@
 namespace Atomic
 {
 
+namespace SystemUI
+{
+
 /// Mouse click in the UI.
 EVENT(E_UIMOUSECLICK, UIMouseClick)
 {
@@ -377,3 +380,5 @@ EVENT(E_UIDROPFILE, UIDropFile)
 }
 
 }
+
+}

+ 8 - 8
Source/Atomic/UI/SystemUI/Text.cpp

@@ -111,7 +111,7 @@ void Text::ApplyAttributes()
     UpdateText();
 }
 
-void Text::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void Text::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
     FontFace* face = font_ ? font_->GetFace(fontSize_) : (FontFace*)0;
     if (!face)
@@ -134,17 +134,17 @@ void Text::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData,
     if ((hovering_ && hoverColor_.a_ > 0.0) || (selected_ && selectionColor_.a_ > 0.0f))
     {
         bool both = hovering_ && selected_ && hoverColor_.a_ > 0.0 && selectionColor_.a_ > 0.0f;
-        UIBatch batch(this, BLEND_ALPHA, currentScissor, 0, &vertexData);
+        SystemUIBatch batch(this, BLEND_ALPHA, currentScissor, 0, &vertexData);
         batch.SetColor(both ? selectionColor_.Lerp(hoverColor_, 0.5f) :
             (selected_ && selectionColor_.a_ > 0.0f ? selectionColor_ : hoverColor_));
         batch.AddQuad(0, 0, GetWidth(), GetHeight(), 0, 0);
-        UIBatch::AddOrMerge(batch, batches);
+        SystemUIBatch::AddOrMerge(batch, batches);
     }
 
     // Partial selection batch
     if (!selected_ && selectionLength_ && charLocations_.Size() >= selectionStart_ + selectionLength_ && selectionColor_.a_ > 0.0f)
     {
-        UIBatch batch(this, BLEND_ALPHA, currentScissor, 0, &vertexData);
+        SystemUIBatch batch(this, BLEND_ALPHA, currentScissor, 0, &vertexData);
         batch.SetColor(selectionColor_);
 
         IntVector2 currentStart = charLocations_[selectionStart_].position_;
@@ -173,7 +173,7 @@ void Text::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData,
             batch.AddQuad(currentStart.x_, currentStart.y_, currentEnd.x_ - currentStart.x_, currentEnd.y_ - currentStart.y_, 0, 0);
         }
 
-        UIBatch::AddOrMerge(batch, batches);
+        SystemUIBatch::AddOrMerge(batch, batches);
     }
 
     // Text batch
@@ -182,7 +182,7 @@ void Text::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData,
     for (unsigned n = 0; n < textures.Size() && n < pageGlyphLocations_.Size(); ++n)
     {
         // One batch per texture/page
-        UIBatch pageBatch(this, BLEND_ALPHA, currentScissor, textures[n], &vertexData);
+        SystemUIBatch pageBatch(this, BLEND_ALPHA, currentScissor, textures[n], &vertexData);
 
         const PODVector<GlyphLocation>& pageGlyphLocation = pageGlyphLocations_[n];
 
@@ -210,7 +210,7 @@ void Text::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData,
             break;
         }
 
-        UIBatch::AddOrMerge(pageBatch, batches);
+        SystemUIBatch::AddOrMerge(pageBatch, batches);
     }
 
     // Reset hovering for next frame
@@ -739,7 +739,7 @@ int Text::GetRowStartPosition(unsigned rowIndex) const
     return ret;
 }
 
-void Text::ConstructBatch(UIBatch& pageBatch, const PODVector<GlyphLocation>& pageGlyphLocation, int dx, int dy, Color* color,
+void Text::ConstructBatch(SystemUIBatch& pageBatch, const PODVector<GlyphLocation>& pageGlyphLocation, int dx, int dy, Color* color,
     float depthBias)
 {
     unsigned startDataSize = pageBatch.vertexData_->Size();

+ 2 - 2
Source/Atomic/UI/SystemUI/Text.h

@@ -90,7 +90,7 @@ public:
     /// Apply attribute changes that can not be applied immediately.
     virtual void ApplyAttributes();
     /// Return UI rendering batches.
-    virtual void GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
     /// React to resize.
     virtual void OnResize();
     /// React to indent change.
@@ -204,7 +204,7 @@ protected:
     int GetRowStartPosition(unsigned rowIndex) const;
     /// Contruct batch.
     void ConstructBatch
-        (UIBatch& pageBatch, const PODVector<GlyphLocation>& pageGlyphLocation, int dx = 0, int dy = 0, Color* color = 0,
+        (SystemUIBatch& pageBatch, const PODVector<GlyphLocation>& pageGlyphLocation, int dx = 0, int dy = 0, Color* color = 0,
             float depthBias = 0.0f);
 
     /// Used in Text3D.

+ 2 - 2
Source/Atomic/UI/SystemUI/ToolTip.cpp

@@ -22,7 +22,7 @@
 
 #include "../../Core/Context.h"
 #include "ToolTip.h"
-#include "UI.h"
+#include "SystemUI.h"
 
 namespace Atomic
 {
@@ -71,7 +71,7 @@ void ToolTip::Update(float timeStep)
 
     if (target_->IsHovering())
     {
-        float effectiveDelay = delay_ > 0.0f ? delay_ : GetSubsystem<UI>()->GetDefaultToolTipDelay();
+        float effectiveDelay = delay_ > 0.0f ? delay_ : GetSubsystem<SystemUI>()->GetDefaultToolTipDelay();
 
         if (!parentHovered_)
         {

+ 10 - 10
Source/Atomic/UI/SystemUI/UIElement.cpp

@@ -28,9 +28,9 @@
 #include "../../Resource/ResourceCache.h"
 #include "../../Scene/ObjectAnimation.h"
 #include "Cursor.h"
-#include "UI.h"
+#include "SystemUI.h"
 #include "UIElement.h"
-#include "UIEvents.h"
+#include "SystemUIEvents.h"
 
 #include "../../DebugNew.h"
 
@@ -370,15 +370,15 @@ void UIElement::Update(float timeStep)
 {
 }
 
-void UIElement::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void UIElement::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
     // Reset hovering for next frame
     hovering_ = false;
 }
 
-void UIElement::GetDebugDrawBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void UIElement::GetDebugDrawBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
-    UIBatch batch(this, BLEND_ALPHA, currentScissor, 0, &vertexData);
+    SystemUIBatch batch(this, BLEND_ALPHA, currentScissor, 0, &vertexData);
 
     int horizontalThickness = 1;
     int verticalThickness = 1;
@@ -409,7 +409,7 @@ void UIElement::GetDebugDrawBatches(PODVector<UIBatch>& batches, PODVector<float
     // Bottom
     batch.AddQuad(0, size_.y_ - verticalThickness, size_.x_, verticalThickness, 0, 0);
 
-    UIBatch::AddOrMerge(batch, batches);
+    SystemUIBatch::AddOrMerge(batch, batches);
 }
 
 bool UIElement::IsWithinScissor(const IntRect& currentScissor)
@@ -887,7 +887,7 @@ void UIElement::SetFocus(bool enable)
     if (focusMode_ < FM_FOCUSABLE || !IsVisibleEffective())
         enable = false;
 
-    UI* ui = GetSubsystem<UI>();
+    SystemUI* ui = GetSubsystem<SystemUI>();
     if (enable)
     {
         if (ui->GetFocusElement() != this)
@@ -925,7 +925,7 @@ void UIElement::SetVisible(bool enable)
         // If the focus element becomes effectively hidden, clear focus
         if (!enable)
         {
-            UIElement* focusElement = GetSubsystem<UI>()->GetFocusElement();
+            UIElement* focusElement = GetSubsystem<SystemUI>()->GetFocusElement();
             if (focusElement && !focusElement->IsVisibleEffective())
                 focusElement->SetFocus(false);
         }
@@ -1424,7 +1424,7 @@ float UIElement::GetDerivedOpacity() const
 
 bool UIElement::HasFocus() const
 {
-    return GetSubsystem<UI>()->GetFocusElement() == this;
+    return GetSubsystem<SystemUI>()->GetFocusElement() == this;
 }
 
 bool UIElement::IsVisibleEffective() const
@@ -1661,7 +1661,7 @@ void UIElement::AdjustScissor(IntRect& currentScissor)
     }
 }
 
-void UIElement::GetBatchesWithOffset(IntVector2& offset, PODVector<UIBatch>& batches, PODVector<float>& vertexData,
+void UIElement::GetBatchesWithOffset(IntVector2& offset, PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData,
     IntRect currentScissor)
 {
     Vector2 floatOffset((float)offset.x_, (float)offset.y_);

+ 4 - 4
Source/Atomic/UI/SystemUI/UIElement.h

@@ -25,7 +25,7 @@
 #include "../../Math/Vector2.h"
 #include "../../Resource/XMLFile.h"
 #include "../../Scene/Animatable.h"
-#include "UIBatch.h"
+#include "SystemUIBatch.h"
 
 namespace Atomic
 {
@@ -144,9 +144,9 @@ public:
     /// Update and return screen position.
     virtual const IntVector2& GetScreenPosition() const;
     /// Return UI rendering batches.
-    virtual void GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
     /// Return UI rendering batches for debug draw.
-    virtual void GetDebugDrawBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetDebugDrawBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
     /// React to mouse hover.
     virtual void OnHover(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor);
     /// React to mouse click begin.
@@ -550,7 +550,7 @@ public:
     void AdjustScissor(IntRect& currentScissor);
     /// Get UI rendering batches with a specified offset. Also recurse to child elements.
     void
-        GetBatchesWithOffset(IntVector2& offset, PODVector<UIBatch>& batches, PODVector<float>& vertexData, IntRect currentScissor);
+        GetBatchesWithOffset(IntVector2& offset, PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, IntRect currentScissor);
 
     /// Return color attribute. Uses just the top-left color.
     const Color& GetColorAttr() const { return color_[0]; }

+ 8 - 8
Source/Atomic/UI/SystemUI/Window.cpp

@@ -23,8 +23,8 @@
 #include "../../Core/Context.h"
 #include "../../Input/InputEvents.h"
 #include "Cursor.h"
-#include "UI.h"
-#include "UIEvents.h"
+#include "SystemUI.h"
+#include "SystemUIEvents.h"
 #include "Window.h"
 
 #include "../../DebugNew.h"
@@ -84,7 +84,7 @@ void Window::RegisterObject(Context* context)
     // Instead it should be set false in code when needed
 }
 
-void Window::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
+void Window::GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor)
 {
     if (modal_)
     {
@@ -93,23 +93,23 @@ void Window::GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexDat
         {
             UIElement* rootElement = GetRoot();
             const IntVector2& rootSize = rootElement->GetSize();
-            UIBatch batch(rootElement, BLEND_ALPHA, IntRect(0, 0, rootSize.x_, rootSize.y_), 0, &vertexData);
+            SystemUIBatch batch(rootElement, BLEND_ALPHA, IntRect(0, 0, rootSize.x_, rootSize.y_), 0, &vertexData);
             batch.SetColor(modalShadeColor_);
             batch.AddQuad(0, 0, rootSize.x_, rootSize.y_, 0, 0);
-            UIBatch::AddOrMerge(batch, batches);
+            SystemUIBatch::AddOrMerge(batch, batches);
         }
 
         // Modal frame
         if (modalFrameColor_ != Color::TRANSPARENT && modalFrameSize_ != IntVector2::ZERO)
         {
-            UIBatch batch(this, BLEND_ALPHA, currentScissor, 0, &vertexData);
+            SystemUIBatch batch(this, BLEND_ALPHA, currentScissor, 0, &vertexData);
             int x = GetIndentWidth();
             IntVector2 size = GetSize();
             size.x_ -= x;
             batch.SetColor(modalFrameColor_);
             batch.AddQuad(x - modalFrameSize_.x_, -modalFrameSize_.y_, size.x_ + 2 * modalFrameSize_.x_,
                 size.y_ + 2 * modalFrameSize_.y_, 0, 0);
-            UIBatch::AddOrMerge(batch, batches);
+            SystemUIBatch::AddOrMerge(batch, batches);
         }
     }
 
@@ -281,7 +281,7 @@ void Window::SetResizeBorder(const IntRect& rect)
 
 void Window::SetModal(bool modal)
 {
-    if (GetSubsystem<UI>()->SetModalElement(this, modal))
+    if (GetSubsystem<SystemUI>()->SetModalElement(this, modal))
     {
         modal_ = modal;
 

+ 1 - 1
Source/Atomic/UI/SystemUI/Window.h

@@ -59,7 +59,7 @@ public:
     static void RegisterObject(Context* context);
 
     /// Return UI rendering batches.
-    virtual void GetBatches(PODVector<UIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
+    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
 
     /// React to mouse hover.
     virtual void OnHover(const IntVector2& position, const IntVector2& screenPosition, int buttons, int qualifiers, Cursor* cursor);