Browse Source

SystemUI builds

Josh Engebretson 10 years ago
parent
commit
20bb41f2e0
54 changed files with 350 additions and 2134 deletions
  1. 4 3
      Source/Atomic/CMakeLists.txt
  2. 6 8
      Source/Atomic/UI/SystemUI/BorderImage.cpp
  3. 4 4
      Source/Atomic/UI/SystemUI/BorderImage.h
  4. 7 9
      Source/Atomic/UI/SystemUI/Button.cpp
  5. 3 3
      Source/Atomic/UI/SystemUI/Button.h
  6. 6 7
      Source/Atomic/UI/SystemUI/CheckBox.cpp
  7. 3 3
      Source/Atomic/UI/SystemUI/CheckBox.h
  8. 8 10
      Source/Atomic/UI/SystemUI/Cursor.cpp
  9. 7 7
      Source/Atomic/UI/SystemUI/Cursor.h
  10. 13 15
      Source/Atomic/UI/SystemUI/DropDownList.cpp
  11. 3 3
      Source/Atomic/UI/SystemUI/DropDownList.h
  12. 0 491
      Source/Atomic/UI/SystemUI/FileSelector.cpp
  13. 0 192
      Source/Atomic/UI/SystemUI/FileSelector.h
  14. 15 17
      Source/Atomic/UI/SystemUI/Font.cpp
  15. 4 4
      Source/Atomic/UI/SystemUI/Font.h
  16. 8 10
      Source/Atomic/UI/SystemUI/FontFace.cpp
  17. 7 5
      Source/Atomic/UI/SystemUI/FontFace.h
  18. 15 17
      Source/Atomic/UI/SystemUI/FontFaceBitmap.cpp
  19. 5 3
      Source/Atomic/UI/SystemUI/FontFaceBitmap.h
  20. 11 13
      Source/Atomic/UI/SystemUI/FontFaceFreeType.cpp
  21. 3 3
      Source/Atomic/UI/SystemUI/FontFaceFreeType.h
  22. 8 10
      Source/Atomic/UI/SystemUI/LineEdit.cpp
  23. 3 3
      Source/Atomic/UI/SystemUI/LineEdit.h
  24. 12 14
      Source/Atomic/UI/SystemUI/ListView.cpp
  25. 3 3
      Source/Atomic/UI/SystemUI/ListView.h
  26. 9 11
      Source/Atomic/UI/SystemUI/Menu.cpp
  27. 3 3
      Source/Atomic/UI/SystemUI/Menu.h
  28. 13 15
      Source/Atomic/UI/SystemUI/MessageBox.cpp
  29. 3 3
      Source/Atomic/UI/SystemUI/MessageBox.h
  30. 8 10
      Source/Atomic/UI/SystemUI/ScrollBar.cpp
  31. 3 3
      Source/Atomic/UI/SystemUI/ScrollBar.h
  32. 12 14
      Source/Atomic/UI/SystemUI/ScrollView.cpp
  33. 3 3
      Source/Atomic/UI/SystemUI/ScrollView.h
  34. 7 9
      Source/Atomic/UI/SystemUI/Slider.cpp
  35. 3 3
      Source/Atomic/UI/SystemUI/Slider.h
  36. 6 8
      Source/Atomic/UI/SystemUI/Sprite.cpp
  37. 4 4
      Source/Atomic/UI/SystemUI/Sprite.h
  38. 20 15
      Source/Atomic/UI/SystemUI/Text.cpp
  39. 3 3
      Source/Atomic/UI/SystemUI/Text.h
  40. 0 597
      Source/Atomic/UI/SystemUI/Text3D.cpp
  41. 0 191
      Source/Atomic/UI/SystemUI/Text3D.h
  42. 5 7
      Source/Atomic/UI/SystemUI/ToolTip.cpp
  43. 5 5
      Source/Atomic/UI/SystemUI/ToolTip.h
  44. 35 43
      Source/Atomic/UI/SystemUI/UI.cpp
  45. 6 6
      Source/Atomic/UI/SystemUI/UI.h
  46. 5 7
      Source/Atomic/UI/SystemUI/UIBatch.cpp
  47. 5 5
      Source/Atomic/UI/SystemUI/UIBatch.h
  48. 15 17
      Source/Atomic/UI/SystemUI/UIElement.cpp
  49. 6 6
      Source/Atomic/UI/SystemUI/UIElement.h
  50. 2 2
      Source/Atomic/UI/SystemUI/UIEvents.h
  51. 0 174
      Source/Atomic/UI/SystemUI/View3D.cpp
  52. 0 100
      Source/Atomic/UI/SystemUI/View3D.h
  53. 8 10
      Source/Atomic/UI/SystemUI/Window.cpp
  54. 3 3
      Source/Atomic/UI/SystemUI/Window.h

+ 4 - 3
Source/Atomic/CMakeLists.txt

@@ -23,6 +23,7 @@ endif()
 file (GLOB ATOMIC2D_SOURCE Atomic2D/*.cpp Atomic2D/*.h)
 file (GLOB ATOMIC2D_SOURCE Atomic2D/*.cpp Atomic2D/*.h)
 file (GLOB SCENE_SOURCE Scene/*.cpp Scene/*.h)
 file (GLOB SCENE_SOURCE Scene/*.cpp Scene/*.h)
 file (GLOB UI_SOURCE UI/*.cpp UI/*.h)
 file (GLOB UI_SOURCE UI/*.cpp UI/*.h)
+file (GLOB SYSTEM_UI_SOURCE UI/SystemUI/*.cpp UI/SystemUI/*.h)
 
 
 if (NOT ATOMIC_BUILD_2D)
 if (NOT ATOMIC_BUILD_2D)
   file (GLOB ATOMIC3D_SOURCE Atomic3D/*.cpp Atomic3D/*.h)
   file (GLOB ATOMIC3D_SOURCE Atomic3D/*.cpp Atomic3D/*.h)
@@ -34,11 +35,11 @@ endif()
 file (GLOB GRAPHICS_SOURCE Graphics/*.cpp Graphics/*.h)
 file (GLOB GRAPHICS_SOURCE Graphics/*.cpp Graphics/*.h)
 
 
 if (MSVC)
 if (MSVC)
-    if (ATOMIC_D3D11)  
+    if (ATOMIC_D3D11)
       file (GLOB GRAPHICS_IMPL_SOURCE Graphics/Direct3D11/*.cpp Graphics/Direct3D11/*.h)
       file (GLOB GRAPHICS_IMPL_SOURCE Graphics/Direct3D11/*.cpp Graphics/Direct3D11/*.h)
     else()
     else()
       file (GLOB GRAPHICS_IMPL_SOURCE Graphics/Direct3D9/*.cpp Graphics/Direct3D9/*.h)
       file (GLOB GRAPHICS_IMPL_SOURCE Graphics/Direct3D9/*.cpp Graphics/Direct3D9/*.h)
-    endif()  
+    endif()
 else()
 else()
 
 
 # for kNet
 # for kNet
@@ -67,7 +68,7 @@ set (SOURCE_FILES ${CONTAINER_SOURCE} ${CORE_SOURCE} ${ENGINE_SOURCE} ${INPUT_SO
                   ${GRAPHICS_SOURCE} ${GRAPHICS_IMPL_SOURCE}
                   ${GRAPHICS_SOURCE} ${GRAPHICS_IMPL_SOURCE}
                   ${ATOMIC3D_SOURCE}
                   ${ATOMIC3D_SOURCE}
                   ${ATOMIC2D_SOURCE} ${ENVIRONMENT_SOURCE}
                   ${ATOMIC2D_SOURCE} ${ENVIRONMENT_SOURCE}
-                  ${SCENE_SOURCE} ${UI_SOURCE}
+                  ${SCENE_SOURCE} ${UI_SOURCE} ${SYSTEM_UI_SOURCE}
                   ${PLATFORM_SOURCE})
                   ${PLATFORM_SOURCE})
 
 
 if (NOT EMSCRIPTEN)
 if (NOT EMSCRIPTEN)

+ 6 - 8
Source/Atomic/UI/SystemUI/BorderImage.cpp

@@ -20,16 +20,14 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../Graphics/Texture2D.h"
+#include "../../Resource/ResourceCache.h"
+#include "BorderImage.h"
 
 
-#include "../Core/Context.h"
-#include "../Graphics/Texture2D.h"
-#include "../Resource/ResourceCache.h"
-#include "../UI/BorderImage.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 extern const char* blendModeNames[];
 extern const char* blendModeNames[];

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

@@ -22,17 +22,17 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Graphics/GraphicsDefs.h"
-#include "../UI/UIElement.h"
+#include "../../Graphics/GraphicsDefs.h"
+#include "UIElement.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class Texture;
 class Texture;
 class Texture2D;
 class Texture2D;
 
 
 /// %Image %UI element with optional border.
 /// %Image %UI element with optional border.
-class URHO3D_API BorderImage : public UIElement
+class ATOMIC_API BorderImage : public UIElement
 {
 {
     OBJECT(BorderImage);
     OBJECT(BorderImage);
 
 

+ 7 - 9
Source/Atomic/UI/SystemUI/Button.cpp

@@ -20,17 +20,15 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../Input/InputEvents.h"
+#include "Button.h"
+#include "UI.h"
+#include "UIEvents.h"
 
 
-#include "../Core/Context.h"
-#include "../Input/InputEvents.h"
-#include "../UI/Button.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 extern const char* UI_CATEGORY;
 extern const char* UI_CATEGORY;

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

@@ -22,13 +22,13 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/BorderImage.h"
+#include "BorderImage.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// Push button %UI element.
 /// Push button %UI element.
-class URHO3D_API Button : public BorderImage
+class ATOMIC_API Button : public BorderImage
 {
 {
     OBJECT(Button);
     OBJECT(Button);
 
 

+ 6 - 7
Source/Atomic/UI/SystemUI/CheckBox.cpp

@@ -20,16 +20,15 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
 
 
-#include "../Core/Context.h"
-#include "../Input/InputEvents.h"
-#include "../UI/CheckBox.h"
-#include "../UI/UIEvents.h"
+#include "../../Core/Context.h"
+#include "../../Input/InputEvents.h"
+#include "CheckBox.h"
+#include "UIEvents.h"
 
 
-#include "../DebugNew.h"
+#include "../../DebugNew.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 extern const char* UI_CATEGORY;
 extern const char* UI_CATEGORY;

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

@@ -22,13 +22,13 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/BorderImage.h"
+#include "BorderImage.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// %UI element that can be toggled between unchecked and checked state.
 /// %UI element that can be toggled between unchecked and checked state.
-class URHO3D_API CheckBox : public BorderImage
+class ATOMIC_API CheckBox : public BorderImage
 {
 {
     OBJECT(CheckBox);
     OBJECT(CheckBox);
 
 

+ 8 - 10
Source/Atomic/UI/SystemUI/Cursor.cpp

@@ -20,18 +20,16 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../Graphics/Texture2D.h"
+#include "../../Input/Input.h"
+#include "../../IO/Log.h"
+#include "../../Resource/ResourceCache.h"
+#include "UI.h"
 
 
-#include "../Core/Context.h"
-#include "../Graphics/Texture2D.h"
-#include "../Input/Input.h"
-#include "../IO/Log.h"
-#include "../Resource/ResourceCache.h"
-#include "../UI/UI.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 static const char* shapeNames[] =
 static const char* shapeNames[] =

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

@@ -22,13 +22,13 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Graphics/Texture.h"
-#include "../Resource/Image.h"
-#include "../UI/BorderImage.h"
+#include "../../Graphics/Texture.h"
+#include "../../Resource/Image.h"
+#include "BorderImage.h"
 
 
-#include <SDL/SDL_mouse.h>
+#include <SDL/include/SDL_mouse.h>
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// %Cursor shapes recognized by the UI subsystem.
 /// %Cursor shapes recognized by the UI subsystem.
@@ -50,7 +50,7 @@ enum CursorShape
 };
 };
 
 
 /// %Cursor image and hotspot information.
 /// %Cursor image and hotspot information.
-struct URHO3D_API CursorShapeInfo
+struct ATOMIC_API CursorShapeInfo
 {
 {
     /// Construct with defaults.
     /// Construct with defaults.
     CursorShapeInfo() :
     CursorShapeInfo() :
@@ -89,7 +89,7 @@ struct URHO3D_API CursorShapeInfo
 };
 };
 
 
 /// Mouse cursor %UI element.
 /// Mouse cursor %UI element.
-class URHO3D_API Cursor : public BorderImage
+class ATOMIC_API Cursor : public BorderImage
 {
 {
     OBJECT(Cursor);
     OBJECT(Cursor);
 
 

+ 13 - 15
Source/Atomic/UI/SystemUI/DropDownList.cpp

@@ -20,21 +20,19 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Input/InputEvents.h"
-#include "../IO/Log.h"
-#include "../UI/DropDownList.h"
-#include "../UI/ListView.h"
-#include "../UI/Text.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-#include "../UI/Window.h"
-
-#include "../DebugNew.h"
-
-namespace Urho3D
+#include "../../Core/Context.h"
+#include "../../Input/InputEvents.h"
+#include "../../IO/Log.h"
+#include "DropDownList.h"
+#include "ListView.h"
+#include "Text.h"
+#include "UI.h"
+#include "UIEvents.h"
+#include "Window.h"
+
+#include "../../DebugNew.h"
+
+namespace Atomic
 {
 {
 
 
 extern const char* UI_CATEGORY;
 extern const char* UI_CATEGORY;

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

@@ -22,15 +22,15 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/Menu.h"
+#include "Menu.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class ListView;
 class ListView;
 
 
 /// %Menu %UI element that displays a popup list view.
 /// %Menu %UI element that displays a popup list view.
-class URHO3D_API DropDownList : public Menu
+class ATOMIC_API DropDownList : public Menu
 {
 {
     OBJECT(DropDownList)
     OBJECT(DropDownList)
 
 

+ 0 - 491
Source/Atomic/UI/SystemUI/FileSelector.cpp

@@ -1,491 +0,0 @@
-//
-// Copyright (c) 2008-2015 the Urho3D project.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../IO/File.h"
-#include "../IO/FileSystem.h"
-#include "../Input/InputEvents.h"
-#include "../UI/DropDownList.h"
-#include "../UI/FileSelector.h"
-#include "../UI/LineEdit.h"
-#include "../UI/ListView.h"
-#include "../UI/Text.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-#include "../UI/Window.h"
-
-#include "../DebugNew.h"
-
-namespace Urho3D
-{
-
-static bool CompareEntries(const FileSelectorEntry& lhs, const FileSelectorEntry& rhs)
-{
-    if (lhs.directory_ && !rhs.directory_)
-        return true;
-    if (!lhs.directory_ && rhs.directory_)
-        return false;
-    return lhs.name_.Compare(rhs.name_, false) < 0;
-}
-
-FileSelector::FileSelector(Context* context) :
-    Object(context),
-    directoryMode_(false),
-    ignoreEvents_(false)
-{
-    window_ = new Window(context_);
-    window_->SetLayout(LM_VERTICAL);
-
-    titleLayout = new UIElement(context_);
-    titleLayout->SetLayout(LM_HORIZONTAL);
-    window_->AddChild(titleLayout);
-
-    titleText_ = new Text(context_);
-    titleLayout->AddChild(titleText_);
-
-    closeButton_ = new Button(context_);
-    titleLayout->AddChild(closeButton_);
-
-    pathEdit_ = new LineEdit(context_);
-    window_->AddChild(pathEdit_);
-
-    fileList_ = new ListView(context_);
-    window_->AddChild(fileList_);
-
-    fileNameLayout_ = new UIElement(context_);
-    fileNameLayout_->SetLayout(LM_HORIZONTAL);
-
-    fileNameEdit_ = new LineEdit(context_);
-    fileNameLayout_->AddChild(fileNameEdit_);
-
-    filterList_ = new DropDownList(context_);
-    fileNameLayout_->AddChild(filterList_);
-
-    window_->AddChild(fileNameLayout_);
-
-    separatorLayout_ = new UIElement(context_);
-    window_->AddChild(separatorLayout_);
-
-    buttonLayout_ = new UIElement(context_);
-    buttonLayout_->SetLayout(LM_HORIZONTAL);
-
-    buttonLayout_->AddChild(new UIElement(context_)); // Add spacer
-
-    cancelButton_ = new Button(context_);
-    cancelButtonText_ = new Text(context_);
-    cancelButtonText_->SetAlignment(HA_CENTER, VA_CENTER);
-    cancelButton_->AddChild(cancelButtonText_);
-    buttonLayout_->AddChild(cancelButton_);
-
-    okButton_ = new Button(context_);
-    okButtonText_ = new Text(context_);
-    okButtonText_->SetAlignment(HA_CENTER, VA_CENTER);
-    okButton_->AddChild(okButtonText_);
-    buttonLayout_->AddChild(okButton_);
-
-    window_->AddChild(buttonLayout_);
-
-    Vector<String> defaultFilters;
-    defaultFilters.Push("*.*");
-    SetFilters(defaultFilters, 0);
-    FileSystem* fileSystem = GetSubsystem<FileSystem>();
-    SetPath(fileSystem->GetCurrentDir());
-
-    // Focus the fileselector's filelist initially when created, and bring to front
-    UI* ui = GetSubsystem<UI>();
-    ui->GetRoot()->AddChild(window_);
-    ui->SetFocusElement(fileList_);
-    window_->SetModal(true);
-
-    SubscribeToEvent(filterList_, E_ITEMSELECTED, HANDLER(FileSelector, HandleFilterChanged));
-    SubscribeToEvent(pathEdit_, E_TEXTFINISHED, HANDLER(FileSelector, HandlePathChanged));
-    SubscribeToEvent(fileNameEdit_, E_TEXTFINISHED, HANDLER(FileSelector, HandleOKPressed));
-    SubscribeToEvent(fileList_, E_ITEMSELECTED, HANDLER(FileSelector, HandleFileSelected));
-    SubscribeToEvent(fileList_, E_ITEMDOUBLECLICKED, HANDLER(FileSelector, HandleFileDoubleClicked));
-    SubscribeToEvent(fileList_, E_UNHANDLEDKEY, HANDLER(FileSelector, HandleFileListKey));
-    SubscribeToEvent(okButton_, E_RELEASED, HANDLER(FileSelector, HandleOKPressed));
-    SubscribeToEvent(cancelButton_, E_RELEASED, HANDLER(FileSelector, HandleCancelPressed));
-    SubscribeToEvent(closeButton_, E_RELEASED, HANDLER(FileSelector, HandleCancelPressed));
-    SubscribeToEvent(window_, E_MODALCHANGED, HANDLER(FileSelector, HandleCancelPressed));
-}
-
-FileSelector::~FileSelector()
-{
-    window_->Remove();
-}
-
-void FileSelector::RegisterObject(Context* context)
-{
-    context->RegisterFactory<FileSelector>();
-}
-
-void FileSelector::SetDefaultStyle(XMLFile* style)
-{
-    if (!style)
-        return;
-
-    window_->SetDefaultStyle(style);
-    window_->SetStyle("FileSelector");
-
-    titleText_->SetStyle("FileSelectorTitleText");
-    closeButton_->SetStyle("CloseButton");
-
-    okButtonText_->SetStyle("FileSelectorButtonText");
-    cancelButtonText_->SetStyle("FileSelectorButtonText");
-
-    titleLayout->SetStyle("FileSelectorLayout");
-    fileNameLayout_->SetStyle("FileSelectorLayout");
-    buttonLayout_->SetStyle("FileSelectorLayout");
-    separatorLayout_->SetStyle("EditorSeparator");
-
-    fileList_->SetStyle("FileSelectorListView");
-    fileNameEdit_->SetStyle("FileSelectorLineEdit");
-    pathEdit_->SetStyle("FileSelectorLineEdit");
-
-    filterList_->SetStyle("FileSelectorFilterList");
-
-    okButton_->SetStyle("FileSelectorButton");
-    cancelButton_->SetStyle("FileSelectorButton");
-
-    const Vector<SharedPtr<UIElement> >& filterTexts = filterList_->GetListView()->GetContentElement()->GetChildren();
-    for (unsigned i = 0; i < filterTexts.Size(); ++i)
-        filterTexts[i]->SetStyle("FileSelectorFilterText");
-
-    const Vector<SharedPtr<UIElement> >& listTexts = fileList_->GetContentElement()->GetChildren();
-    for (unsigned i = 0; i < listTexts.Size(); ++i)
-        listTexts[i]->SetStyle("FileSelectorListText");
-
-    UpdateElements();
-}
-
-void FileSelector::SetTitle(const String& text)
-{
-    titleText_->SetText(text);
-}
-
-void FileSelector::SetButtonTexts(const String& okText, const String& cancelText)
-{
-    okButtonText_->SetText(okText);
-    cancelButtonText_->SetText(cancelText);
-}
-
-void FileSelector::SetPath(const String& path)
-{
-    FileSystem* fileSystem = GetSubsystem<FileSystem>();
-    if (fileSystem->DirExists(path))
-    {
-        path_ = AddTrailingSlash(path);
-        SetLineEditText(pathEdit_, path_);
-        RefreshFiles();
-    }
-    else
-    {
-        // If path was invalid, restore the old path to the line edit
-        if (pathEdit_->GetText() != path_)
-            SetLineEditText(pathEdit_, path_);
-    }
-}
-
-void FileSelector::SetFileName(const String& fileName)
-{
-    SetLineEditText(fileNameEdit_, fileName);
-}
-
-void FileSelector::SetFilters(const Vector<String>& filters, unsigned defaultIndex)
-{
-    if (filters.Empty())
-        return;
-
-    ignoreEvents_ = true;
-
-    filters_ = filters;
-    filterList_->RemoveAllItems();
-    for (unsigned i = 0; i < filters_.Size(); ++i)
-    {
-        Text* filterText = new Text(context_);
-        filterList_->AddItem(filterText);
-        filterText->SetText(filters_[i]);
-        filterText->SetStyle("FileSelectorFilterText");
-    }
-    if (defaultIndex > filters.Size())
-        defaultIndex = 0;
-    filterList_->SetSelection(defaultIndex);
-
-    ignoreEvents_ = false;
-
-    if (GetFilter() != lastUsedFilter_)
-        RefreshFiles();
-}
-
-void FileSelector::SetDirectoryMode(bool enable)
-{
-    directoryMode_ = enable;
-}
-
-void FileSelector::UpdateElements()
-{
-    buttonLayout_->SetFixedHeight(Max(okButton_->GetHeight(), cancelButton_->GetHeight()));
-}
-
-XMLFile* FileSelector::GetDefaultStyle() const
-{
-    return window_->GetDefaultStyle(false);
-}
-
-const String& FileSelector::GetTitle() const
-{
-    return titleText_->GetText();
-}
-
-const String& FileSelector::GetFileName() const
-{
-    return fileNameEdit_->GetText();
-}
-
-const String& FileSelector::GetFilter() const
-{
-    Text* selectedFilter = static_cast<Text*>(filterList_->GetSelectedItem());
-    if (selectedFilter)
-        return selectedFilter->GetText();
-    else
-        return String::EMPTY;
-}
-
-unsigned FileSelector::GetFilterIndex() const
-{
-    return filterList_->GetSelection();
-}
-
-void FileSelector::SetLineEditText(LineEdit* edit, const String& text)
-{
-    ignoreEvents_ = true;
-    edit->SetText(text);
-    ignoreEvents_ = false;
-}
-
-void FileSelector::RefreshFiles()
-{
-    FileSystem* fileSystem = GetSubsystem<FileSystem>();
-
-    ignoreEvents_ = true;
-
-    fileList_->RemoveAllItems();
-    fileEntries_.Clear();
-
-    Vector<String> directories;
-    Vector<String> files;
-    fileSystem->ScanDir(directories, path_, "*", SCAN_DIRS, false);
-    fileSystem->ScanDir(files, path_, GetFilter(), SCAN_FILES, false);
-
-    fileEntries_.Reserve(directories.Size() + files.Size());
-
-    for (unsigned i = 0; i < directories.Size(); ++i)
-    {
-        FileSelectorEntry newEntry;
-        newEntry.name_ = directories[i];
-        newEntry.directory_ = true;
-        fileEntries_.Push(newEntry);
-    }
-
-    for (unsigned i = 0; i < files.Size(); ++i)
-    {
-        FileSelectorEntry newEntry;
-        newEntry.name_ = files[i];
-        newEntry.directory_ = false;
-        fileEntries_.Push(newEntry);
-    }
-
-    // Sort and add to the list view
-    // While items are being added, disable layout update for performance optimization
-    Sort(fileEntries_.Begin(), fileEntries_.End(), CompareEntries);
-    UIElement* listContent = fileList_->GetContentElement();
-    listContent->DisableLayoutUpdate();
-    for (unsigned i = 0; i < fileEntries_.Size(); ++i)
-    {
-        String displayName;
-        if (fileEntries_[i].directory_)
-            displayName = "<DIR> " + fileEntries_[i].name_;
-        else
-            displayName = fileEntries_[i].name_;
-
-        Text* entryText = new Text(context_);
-        fileList_->AddItem(entryText);
-        entryText->SetText(displayName);
-        entryText->SetStyle("FileSelectorListText");
-    }
-    listContent->EnableLayoutUpdate();
-    listContent->UpdateLayout();
-
-    ignoreEvents_ = false;
-
-    // Clear filename from the previous dir so that there is no confusion
-    SetFileName(String::EMPTY);
-    lastUsedFilter_ = GetFilter();
-}
-
-bool FileSelector::EnterFile()
-{
-    unsigned index = fileList_->GetSelection();
-    if (index >= fileEntries_.Size())
-        return false;
-
-    if (fileEntries_[index].directory_)
-    {
-        // If a directory double clicked, enter it. Recognize . and .. as a special case
-        const String& newPath = fileEntries_[index].name_;
-        if ((newPath != ".") && (newPath != ".."))
-            SetPath(path_ + newPath);
-        else if (newPath == "..")
-        {
-            String parentPath = GetParentPath(path_);
-            SetPath(parentPath);
-        }
-
-        return true;
-    }
-    else
-    {
-        // Double clicking a file is the same as pressing OK
-        if (!directoryMode_)
-        {
-            using namespace FileSelected;
-
-            VariantMap& eventData = GetEventDataMap();
-            eventData[P_FILENAME] = path_ + fileEntries_[index].name_;
-            eventData[P_FILTER] = GetFilter();
-            eventData[P_OK] = true;
-            SendEvent(E_FILESELECTED, eventData);
-        }
-    }
-
-    return false;
-}
-
-void FileSelector::HandleFilterChanged(StringHash eventType, VariantMap& eventData)
-{
-    if (ignoreEvents_)
-        return;
-
-    if (GetFilter() != lastUsedFilter_)
-        RefreshFiles();
-}
-
-void FileSelector::HandlePathChanged(StringHash eventType, VariantMap& eventData)
-{
-    if (ignoreEvents_)
-        return;
-
-    // Attempt to set path. Restores old if does not exist
-    SetPath(pathEdit_->GetText());
-}
-
-void FileSelector::HandleFileSelected(StringHash eventType, VariantMap& eventData)
-{
-    if (ignoreEvents_)
-        return;
-
-    unsigned index = fileList_->GetSelection();
-    if (index >= fileEntries_.Size())
-        return;
-    // If a file selected, update the filename edit field
-    if (!fileEntries_[index].directory_)
-        SetFileName(fileEntries_[index].name_);
-}
-
-void FileSelector::HandleFileDoubleClicked(StringHash eventType, VariantMap& eventData)
-{
-    if (ignoreEvents_)
-        return;
-
-    if (eventData[ItemDoubleClicked::P_BUTTON] == MOUSEB_LEFT)
-        EnterFile();
-}
-
-void FileSelector::HandleFileListKey(StringHash eventType, VariantMap& eventData)
-{
-    if (ignoreEvents_)
-        return;
-
-    using namespace UnhandledKey;
-
-    int key = eventData[P_KEY].GetInt();
-    if (key == KEY_RETURN || key == KEY_RETURN2 || key == KEY_KP_ENTER)
-    {
-        bool entered = EnterFile();
-        // When a key is used to enter a directory, select the first file if no selection
-        if (entered && !fileList_->GetSelectedItem())
-            fileList_->SetSelection(0);
-    }
-}
-
-void FileSelector::HandleOKPressed(StringHash eventType, VariantMap& eventData)
-{
-    if (ignoreEvents_)
-        return;
-
-    const String& fileName = GetFileName();
-
-    if (!directoryMode_)
-    {
-        if (!fileName.Empty())
-        {
-            using namespace FileSelected;
-
-            VariantMap& newEventData = GetEventDataMap();
-            newEventData[P_FILENAME] = path_ + GetFileName();
-            newEventData[P_FILTER] = GetFilter();
-            newEventData[P_OK] = true;
-            SendEvent(E_FILESELECTED, newEventData);
-        }
-    }
-    else if (eventType == E_RELEASED && !path_.Empty())
-    {
-        using namespace FileSelected;
-
-        VariantMap& newEventData = GetEventDataMap();
-        newEventData[P_FILENAME] = path_;
-        newEventData[P_FILTER] = GetFilter();
-        newEventData[P_OK] = true;
-        SendEvent(E_FILESELECTED, newEventData);
-    }
-}
-
-void FileSelector::HandleCancelPressed(StringHash eventType, VariantMap& eventData)
-{
-    if (ignoreEvents_)
-        return;
-
-    if (eventType == E_MODALCHANGED && eventData[ModalChanged::P_MODAL].GetBool())
-        return;
-
-    using namespace FileSelected;
-
-    VariantMap& newEventData = GetEventDataMap();
-    newEventData[P_FILENAME] = String::EMPTY;
-    newEventData[P_FILTER] = GetFilter();
-    newEventData[P_OK] = false;
-    SendEvent(E_FILESELECTED, newEventData);
-}
-
-}

+ 0 - 192
Source/Atomic/UI/SystemUI/FileSelector.h

@@ -1,192 +0,0 @@
-//
-// Copyright (c) 2008-2015 the Urho3D project.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-#pragma once
-
-#include "../Core/Object.h"
-
-namespace Urho3D
-{
-
-class Button;
-class DropDownList;
-class Font;
-class LineEdit;
-class ListView;
-class ResourceCache;
-class Text;
-class UIElement;
-class Window;
-class XMLFile;
-
-/// %File selector's list entry (file or directory.)
-struct FileSelectorEntry
-{
-    /// Name.
-    String name_;
-    /// Directory flag.
-    bool directory_;
-};
-
-/// %File selector dialog.
-class URHO3D_API FileSelector : public Object
-{
-    OBJECT(FileSelector);
-
-public:
-    /// Construct.
-    FileSelector(Context* context);
-    /// Destruct.
-    virtual ~FileSelector();
-    /// Register object factory.
-    static void RegisterObject(Context* context);
-
-    /// Set fileselector UI style.
-    void SetDefaultStyle(XMLFile* style);
-    /// Set title text.
-    void SetTitle(const String& text);
-    /// Set button texts.
-    void SetButtonTexts(const String& okText, const String& cancelText);
-    /// Set current path.
-    void SetPath(const String& path);
-    /// Set current filename.
-    void SetFileName(const String& fileName);
-    /// Set filters.
-    void SetFilters(const Vector<String>& filters, unsigned defaultIndex);
-    /// Set directory selection mode. Default false.
-    void SetDirectoryMode(bool enable);
-    /// Update elements to layout properly. Call this after manually adjusting the sub-elements.
-    void UpdateElements();
-
-    /// Return the UI style file.
-    XMLFile* GetDefaultStyle() const;
-
-    /// Return fileselector window.
-    Window* GetWindow() const { return window_; }
-
-    /// Return window title text element.
-    Text* GetTitleText() const { return titleText_; }
-
-    /// Return file list.
-    ListView* GetFileList() const { return fileList_; }
-
-    /// Return path editor.
-    LineEdit* GetPathEdit() const { return pathEdit_; }
-
-    /// Return filename editor.
-    LineEdit* GetFileNameEdit() const { return fileNameEdit_; }
-
-    /// Return filter dropdown.
-    DropDownList* GetFilterList() const { return filterList_; }
-
-    /// Return OK button.
-    Button* GetOKButton() const { return okButton_; }
-
-    /// Return cancel button.
-    Button* GetCancelButton() const { return cancelButton_; }
-
-    /// Return close button.
-    Button* GetCloseButton() const { return closeButton_; }
-
-    /// Return window title.
-    const String& GetTitle() const;
-
-    /// Return current path.
-    const String& GetPath() const { return path_; }
-
-    /// Return current filename.
-    const String& GetFileName() const;
-    /// Return current filter.
-    const String& GetFilter() const;
-    /// Return current filter index.
-    unsigned GetFilterIndex() const;
-
-    /// Return directory mode flag.
-    bool GetDirectoryMode() const { return directoryMode_; }
-
-private:
-    /// Set the text of an edit field and ignore the resulting event.
-    void SetLineEditText(LineEdit* edit, const String& text);
-    /// Refresh the directory listing.
-    void RefreshFiles();
-    /// Enter a directory or confirm a file. Return true if a directory entered.
-    bool EnterFile();
-    /// Handle filter changed.
-    void HandleFilterChanged(StringHash eventType, VariantMap& eventData);
-    /// Handle path edited.
-    void HandlePathChanged(StringHash eventType, VariantMap& eventData);
-    /// Handle file selected from the list.
-    void HandleFileSelected(StringHash eventType, VariantMap& eventData);
-    /// Handle file doubleclicked from the list (enter directory / OK the file selection.)
-    void HandleFileDoubleClicked(StringHash eventType, VariantMap& eventData);
-    /// Handle file list key pressed.
-    void HandleFileListKey(StringHash eventType, VariantMap& eventData);
-    /// Handle OK button pressed.
-    void HandleOKPressed(StringHash eventType, VariantMap& eventData);
-    /// Handle cancel button pressed.
-    void HandleCancelPressed(StringHash eventType, VariantMap& eventData);
-
-    /// Fileselector window.
-    SharedPtr<Window> window_;
-    /// Title layout.
-    UIElement* titleLayout;
-    /// Window title text.
-    Text* titleText_;
-    /// File list.
-    ListView* fileList_;
-    /// Path editor.
-    LineEdit* pathEdit_;
-    /// Filename editor.
-    LineEdit* fileNameEdit_;
-    /// Filter dropdown.
-    DropDownList* filterList_;
-    /// OK button.
-    Button* okButton_;
-    /// OK button text.
-    Text* okButtonText_;
-    /// Cancel button.
-    Button* cancelButton_;
-    /// Cancel button text.
-    Text* cancelButtonText_;
-    /// Close button.
-    Button* closeButton_;
-    /// Filename and filter layout.
-    UIElement* fileNameLayout_;
-    /// Separator layout.
-    UIElement* separatorLayout_;
-    /// Button layout.
-    UIElement* buttonLayout_;
-    /// Current directory.
-    String path_;
-    /// Filters.
-    Vector<String> filters_;
-    /// File entries.
-    Vector<FileSelectorEntry> fileEntries_;
-    /// Filter used to get the file list.
-    String lastUsedFilter_;
-    /// Directory mode flag.
-    bool directoryMode_;
-    /// Ignore events flag, used when changing line edits manually.
-    bool ignoreEvents_;
-};
-
-}

+ 15 - 17
Source/Atomic/UI/SystemUI/Font.cpp

@@ -20,23 +20,21 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Core/Profiler.h"
-#include "../Graphics/Graphics.h"
-#include "../IO/Deserializer.h"
-#include "../IO/FileSystem.h"
-#include "../UI/Font.h"
-#include "../UI/FontFaceBitmap.h"
-#include "../UI/FontFaceFreeType.h"
-#include "../Resource/ResourceCache.h"
-#include "../Resource/XMLElement.h"
-#include "../Resource/XMLFile.h"
-
-#include "../DebugNew.h"
-
-namespace Urho3D
+#include "../../Core/Context.h"
+#include "../../Core/Profiler.h"
+#include "../../Graphics/Graphics.h"
+#include "../../IO/Deserializer.h"
+#include "../../IO/FileSystem.h"
+#include "Font.h"
+#include "FontFaceBitmap.h"
+#include "FontFaceFreeType.h"
+#include "../../Resource/ResourceCache.h"
+#include "../../Resource/XMLElement.h"
+#include "../../Resource/XMLFile.h"
+
+#include "../../DebugNew.h"
+
+namespace Atomic
 {
 {
 
 
 static const int MIN_POINT_SIZE = 1;
 static const int MIN_POINT_SIZE = 1;

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

@@ -22,10 +22,10 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Container/ArrayPtr.h"
-#include "../Resource/Resource.h"
+#include "../../Container/ArrayPtr.h"
+#include "../../Resource/Resource.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class FontFace;
 class FontFace;
@@ -43,7 +43,7 @@ enum FONT_TYPE
 };
 };
 
 
 /// %Font resource.
 /// %Font resource.
-class URHO3D_API Font : public Resource
+class ATOMIC_API Font : public Resource
 {
 {
     OBJECT(Font);
     OBJECT(Font);
 
 

+ 8 - 10
Source/Atomic/UI/SystemUI/FontFace.cpp

@@ -20,18 +20,16 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../IO/Log.h"
+#include "../../Graphics/Texture2D.h"
+#include "../../Resource/Image.h"
+#include "Font.h"
+#include "FontFace.h"
 
 
-#include "../Core/Context.h"
-#include "../IO/Log.h"
-#include "../Graphics/Texture2D.h"
-#include "../Resource/Image.h"
-#include "../UI/Font.h"
-#include "../UI/FontFace.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 FontGlyph::FontGlyph() :
 FontGlyph::FontGlyph() :

+ 7 - 5
Source/Atomic/UI/SystemUI/FontFace.h

@@ -22,11 +22,11 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Container/ArrayPtr.h"
-#include "../Container/List.h"
-#include "../Math/AreaAllocator.h"
+#include "../../Container/ArrayPtr.h"
+#include "../../Container/List.h"
+#include "../../Math/AreaAllocator.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class Font;
 class Font;
@@ -60,10 +60,12 @@ struct FontGlyph
 };
 };
 
 
 /// %Font face description.
 /// %Font face description.
-class URHO3D_API FontFace : public RefCounted
+class ATOMIC_API FontFace : public RefCounted
 {
 {
     friend class Font;
     friend class Font;
 
 
+    REFCOUNTED(FontFace)
+
 public:
 public:
     /// Construct.
     /// Construct.
     FontFace(Font* font);
     FontFace(Font* font);

+ 15 - 17
Source/Atomic/UI/SystemUI/FontFaceBitmap.cpp

@@ -20,23 +20,21 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Graphics/Graphics.h"
-#include "../Graphics/Texture2D.h"
-#include "../IO/File.h"
-#include "../IO/FileSystem.h"
-#include "../IO/Log.h"
-#include "../IO/MemoryBuffer.h"
-#include "../Resource/ResourceCache.h"
-#include "../UI/Font.h"
-#include "../UI/FontFaceBitmap.h"
-#include "../UI/UI.h"
-
-#include "../DebugNew.h"
-
-namespace Urho3D
+#include "../../Core/Context.h"
+#include "../../Graphics/Graphics.h"
+#include "../../Graphics/Texture2D.h"
+#include "../../IO/File.h"
+#include "../../IO/FileSystem.h"
+#include "../../IO/Log.h"
+#include "../../IO/MemoryBuffer.h"
+#include "../../Resource/ResourceCache.h"
+#include "Font.h"
+#include "FontFaceBitmap.h"
+#include "UI.h"
+
+#include "../../DebugNew.h"
+
+namespace Atomic
 {
 {
 
 
 FontFaceBitmap::FontFaceBitmap(Font* font) :
 FontFaceBitmap::FontFaceBitmap(Font* font) :

+ 5 - 3
Source/Atomic/UI/SystemUI/FontFaceBitmap.h

@@ -22,17 +22,19 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/FontFace.h"
+#include "FontFace.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class Image;
 class Image;
 class Serializer;
 class Serializer;
 
 
 /// Bitmap font face description.
 /// Bitmap font face description.
-class URHO3D_API FontFaceBitmap : public FontFace
+class ATOMIC_API FontFaceBitmap : public FontFace
 {
 {
+    REFCOUNTED(FontFaceBitmap)
+
 public:
 public:
     /// Construct.
     /// Construct.
     FontFaceBitmap(Font* font);
     FontFaceBitmap(Font* font);

+ 11 - 13
Source/Atomic/UI/SystemUI/FontFaceFreeType.cpp

@@ -20,25 +20,23 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Graphics/Graphics.h"
-#include "../Graphics/Texture2D.h"
-#include "../IO/FileSystem.h"
-#include "../IO/Log.h"
-#include "../IO/MemoryBuffer.h"
-#include "../UI/Font.h"
-#include "../UI/FontFaceFreeType.h"
-#include "../UI/UI.h"
+#include "../../Core/Context.h"
+#include "../../Graphics/Graphics.h"
+#include "../../Graphics/Texture2D.h"
+#include "../../IO/FileSystem.h"
+#include "../../IO/Log.h"
+#include "../../IO/MemoryBuffer.h"
+#include "Font.h"
+#include "FontFaceFreeType.h"
+#include "UI.h"
 
 
 #include <ft2build.h>
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #include FT_FREETYPE_H
 #include FT_TRUETYPE_TABLES_H
 #include FT_TRUETYPE_TABLES_H
 
 
-#include "../DebugNew.h"
+#include "../../DebugNew.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// FreeType library subsystem.
 /// FreeType library subsystem.

+ 3 - 3
Source/Atomic/UI/SystemUI/FontFaceFreeType.h

@@ -22,16 +22,16 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/FontFace.h"
+#include "FontFace.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class FreeTypeLibrary;
 class FreeTypeLibrary;
 class Texture2D;
 class Texture2D;
 
 
 /// Free type font face description.
 /// Free type font face description.
-class URHO3D_API FontFaceFreeType : public FontFace
+class ATOMIC_API FontFaceFreeType : public FontFace
 {
 {
 public:
 public:
     /// Construct.
     /// Construct.

+ 8 - 10
Source/Atomic/UI/SystemUI/LineEdit.cpp

@@ -20,18 +20,16 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../Input/Input.h"
+#include "LineEdit.h"
+#include "Text.h"
+#include "UI.h"
+#include "UIEvents.h"
 
 
-#include "../Core/Context.h"
-#include "../Input/Input.h"
-#include "../UI/LineEdit.h"
-#include "../UI/Text.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 StringHash VAR_DRAGDROPCONTENT("DragDropContent");
 StringHash VAR_DRAGDROPCONTENT("DragDropContent");

+ 3 - 3
Source/Atomic/UI/SystemUI/LineEdit.h

@@ -22,16 +22,16 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/BorderImage.h"
+#include "BorderImage.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class Font;
 class Font;
 class Text;
 class Text;
 
 
 /// Single-line text editor %UI element.
 /// Single-line text editor %UI element.
-class URHO3D_API LineEdit : public BorderImage
+class ATOMIC_API LineEdit : public BorderImage
 {
 {
     OBJECT(LineEdit);
     OBJECT(LineEdit);
 
 

+ 12 - 14
Source/Atomic/UI/SystemUI/ListView.cpp

@@ -20,20 +20,18 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Input/InputEvents.h"
-#include "../IO/Log.h"
-#include "../UI/CheckBox.h"
-#include "../UI/ListView.h"
-#include "../UI/Text.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-
-#include "../DebugNew.h"
-
-namespace Urho3D
+#include "../../Core/Context.h"
+#include "../../Input/InputEvents.h"
+#include "../../IO/Log.h"
+#include "CheckBox.h"
+#include "ListView.h"
+#include "Text.h"
+#include "UI.h"
+#include "UIEvents.h"
+
+#include "../../DebugNew.h"
+
+namespace Atomic
 {
 {
 
 
 static const char* highlightModes[] =
 static const char* highlightModes[] =

+ 3 - 3
Source/Atomic/UI/SystemUI/ListView.h

@@ -22,9 +22,9 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/ScrollView.h"
+#include "ScrollView.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// %ListView selection highlight mode.
 /// %ListView selection highlight mode.
@@ -39,7 +39,7 @@ enum HighlightMode
 };
 };
 
 
 /// Scrollable list %UI element.
 /// Scrollable list %UI element.
-class URHO3D_API ListView : public ScrollView
+class ATOMIC_API ListView : public ScrollView
 {
 {
     OBJECT(ListView);
     OBJECT(ListView);
 
 

+ 9 - 11
Source/Atomic/UI/SystemUI/Menu.cpp

@@ -20,19 +20,17 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../Input/InputEvents.h"
+#include "../../IO/Log.h"
+#include "Menu.h"
+#include "UI.h"
+#include "UIEvents.h"
+#include "Window.h"
 
 
-#include "../Core/Context.h"
-#include "../Input/InputEvents.h"
-#include "../IO/Log.h"
-#include "../UI/Menu.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-#include "../UI/Window.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 const StringHash VAR_SHOW_POPUP("ShowPopup");
 const StringHash VAR_SHOW_POPUP("ShowPopup");

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

@@ -22,13 +22,13 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/Button.h"
+#include "Button.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// %Menu %UI element that optionally shows a popup.
 /// %Menu %UI element that optionally shows a popup.
-class URHO3D_API Menu : public Button
+class ATOMIC_API Menu : public Button
 {
 {
     OBJECT(Menu);
     OBJECT(Menu);
 
 

+ 13 - 15
Source/Atomic/UI/SystemUI/MessageBox.cpp

@@ -20,21 +20,19 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Graphics/Graphics.h"
-#include "../IO/Log.h"
-#include "../Resource/ResourceCache.h"
-#include "../Resource/XMLFile.h"
-#include "../UI/Button.h"
-#include "../UI/MessageBox.h"
-#include "../UI/Text.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-#include "../UI/Window.h"
-
-namespace Urho3D
+#include "../../Core/Context.h"
+#include "../../Graphics/Graphics.h"
+#include "../../IO/Log.h"
+#include "../../Resource/ResourceCache.h"
+#include "../../Resource/XMLFile.h"
+#include "Button.h"
+#include "MessageBox.h"
+#include "Text.h"
+#include "UI.h"
+#include "UIEvents.h"
+#include "Window.h"
+
+namespace Atomic
 {
 {
 
 
 MessageBox::MessageBox(Context* context, const String& messageString, const String& titleString, XMLFile* layoutFile,
 MessageBox::MessageBox(Context* context, const String& messageString, const String& titleString, XMLFile* layoutFile,

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

@@ -22,9 +22,9 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Core/Object.h"
+#include "../../Core/Object.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class Button;
 class Button;
@@ -33,7 +33,7 @@ class UIElement;
 class XMLFile;
 class XMLFile;
 
 
 /// Message box dialog.
 /// Message box dialog.
-class URHO3D_API MessageBox : public Object
+class ATOMIC_API MessageBox : public Object
 {
 {
     OBJECT(MessageBox);
     OBJECT(MessageBox);
 
 

+ 8 - 10
Source/Atomic/UI/SystemUI/ScrollBar.cpp

@@ -20,16 +20,14 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Input/InputEvents.h"
-#include "../UI/Button.h"
-#include "../UI/ScrollBar.h"
-#include "../UI/Slider.h"
-#include "../UI/UIEvents.h"
-
-namespace Urho3D
+#include "../../Core/Context.h"
+#include "../../Input/InputEvents.h"
+#include "Button.h"
+#include "ScrollBar.h"
+#include "Slider.h"
+#include "UIEvents.h"
+
+namespace Atomic
 {
 {
 
 
 static const float DEFAULT_SCROLL_STEP = 0.1f;
 static const float DEFAULT_SCROLL_STEP = 0.1f;

+ 3 - 3
Source/Atomic/UI/SystemUI/ScrollBar.h

@@ -22,16 +22,16 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/UIElement.h"
+#include "UIElement.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class Button;
 class Button;
 class Slider;
 class Slider;
 
 
 /// Scroll bar %UI element with forward and back buttons.
 /// Scroll bar %UI element with forward and back buttons.
-class URHO3D_API ScrollBar : public UIElement
+class ATOMIC_API ScrollBar : public UIElement
 {
 {
     OBJECT(ScrollBar);
     OBJECT(ScrollBar);
 
 

+ 12 - 14
Source/Atomic/UI/SystemUI/ScrollView.cpp

@@ -20,20 +20,18 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Input/InputEvents.h"
-#include "../UI/BorderImage.h"
-#include "../UI/ScrollBar.h"
-#include "../UI/ScrollView.h"
-#include "../UI/Slider.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-
-#include "../DebugNew.h"
-
-namespace Urho3D
+#include "../../Core/Context.h"
+#include "../../Input/InputEvents.h"
+#include "BorderImage.h"
+#include "ScrollBar.h"
+#include "ScrollView.h"
+#include "Slider.h"
+#include "UI.h"
+#include "UIEvents.h"
+
+#include "../../DebugNew.h"
+
+namespace Atomic
 {
 {
 
 
 static const float STEP_FACTOR = 300.0f;
 static const float STEP_FACTOR = 300.0f;

+ 3 - 3
Source/Atomic/UI/SystemUI/ScrollView.h

@@ -22,16 +22,16 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/UIElement.h"
+#include "UIElement.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class BorderImage;
 class BorderImage;
 class ScrollBar;
 class ScrollBar;
 
 
 /// Scrollable %UI element for showing a (possibly large) child element.
 /// Scrollable %UI element for showing a (possibly large) child element.
-class URHO3D_API ScrollView : public UIElement
+class ATOMIC_API ScrollView : public UIElement
 {
 {
     OBJECT(ScrollView);
     OBJECT(ScrollView);
 
 

+ 7 - 9
Source/Atomic/UI/SystemUI/Slider.cpp

@@ -20,17 +20,15 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../Input/InputEvents.h"
+#include "../../IO/Log.h"
+#include "Slider.h"
+#include "UIEvents.h"
 
 
-#include "../Core/Context.h"
-#include "../Input/InputEvents.h"
-#include "../IO/Log.h"
-#include "../UI/Slider.h"
-#include "../UI/UIEvents.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 const char* orientations[] =
 const char* orientations[] =

+ 3 - 3
Source/Atomic/UI/SystemUI/Slider.h

@@ -22,13 +22,13 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/BorderImage.h"
+#include "BorderImage.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// %Slider bar %UI element.
 /// %Slider bar %UI element.
-class URHO3D_API Slider : public BorderImage
+class ATOMIC_API Slider : public BorderImage
 {
 {
     OBJECT(Slider);
     OBJECT(Slider);
 
 

+ 6 - 8
Source/Atomic/UI/SystemUI/Sprite.cpp

@@ -20,16 +20,14 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../Graphics/Texture2D.h"
+#include "../../Resource/ResourceCache.h"
+#include "Sprite.h"
 
 
-#include "../Core/Context.h"
-#include "../Graphics/Texture2D.h"
-#include "../Resource/ResourceCache.h"
-#include "../UI/Sprite.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 extern const char* blendModeNames[];
 extern const char* blendModeNames[];

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

@@ -22,14 +22,14 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Math/Matrix3x4.h"
-#include "../UI/UIElement.h"
+#include "../../Math/Matrix3x4.h"
+#include "UIElement.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// %UI element which allows sub-pixel positioning and size, as well as rotation. Only other Sprites should be added as child elements.
 /// %UI element which allows sub-pixel positioning and size, as well as rotation. Only other Sprites should be added as child elements.
-class URHO3D_API Sprite : public UIElement
+class ATOMIC_API Sprite : public UIElement
 {
 {
     OBJECT(Sprite);
     OBJECT(Sprite);
 
 

+ 20 - 15
Source/Atomic/UI/SystemUI/Text.cpp

@@ -20,22 +20,20 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../Core/Profiler.h"
+#include "../../Graphics/Texture2D.h"
+#include "../../IO/Log.h"
+#include "../../Resource/ResourceCache.h"
+#include "Font.h"
+#include "FontFace.h"
+#include "Text.h"
+//#include "../../Resource/Localization.h"
+#include "../../Resource/ResourceEvents.h"
 
 
-#include "../Core/Context.h"
-#include "../Core/Profiler.h"
-#include "../Graphics/Texture2D.h"
-#include "../IO/Log.h"
-#include "../Resource/ResourceCache.h"
-#include "../UI/Font.h"
-#include "../UI/FontFace.h"
-#include "../UI/Text.h"
-#include "../Resource/Localization.h"
-#include "../Resource/ResourceEvents.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 const char* textEffects[] =
 const char* textEffects[] =
@@ -262,6 +260,7 @@ void Text::DecodeToUnicode()
 
 
 void Text::SetText(const String& text)
 void Text::SetText(const String& text)
 {
 {
+    /*
     if (autoLocalizable_)
     if (autoLocalizable_)
     {
     {
         stringId_ = text;
         stringId_ = text;
@@ -269,9 +268,11 @@ void Text::SetText(const String& text)
         text_ = l10n->Get(stringId_);
         text_ = l10n->Get(stringId_);
     }
     }
     else
     else
-    {
+    {*/
         text_ = text;
         text_ = text;
+    /*
     }
     }
+    */
 
 
     DecodeToUnicode();
     DecodeToUnicode();
     ValidateSelection();
     ValidateSelection();
@@ -307,6 +308,7 @@ void Text::SetWordwrap(bool enable)
 
 
 void Text::SetAutoLocalizable(bool enable)
 void Text::SetAutoLocalizable(bool enable)
 {
 {
+    /*
     if (enable != autoLocalizable_)
     if (enable != autoLocalizable_)
     {
     {
         autoLocalizable_ = enable;
         autoLocalizable_ = enable;
@@ -327,15 +329,18 @@ void Text::SetAutoLocalizable(bool enable)
         ValidateSelection();
         ValidateSelection();
         UpdateText();
         UpdateText();
     }
     }
+    */
 }
 }
 
 
 void Text::HandleChangeLanguage(StringHash eventType, VariantMap& eventData)
 void Text::HandleChangeLanguage(StringHash eventType, VariantMap& eventData)
 {
 {
+    /*
     Localization* l10n = GetSubsystem<Localization>();
     Localization* l10n = GetSubsystem<Localization>();
     text_ = l10n->Get(stringId_);
     text_ = l10n->Get(stringId_);
     DecodeToUnicode();
     DecodeToUnicode();
     ValidateSelection();
     ValidateSelection();
     UpdateText();
     UpdateText();
+    */
 }
 }
 
 
 void Text::SetSelection(unsigned start, unsigned length)
 void Text::SetSelection(unsigned start, unsigned length)

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

@@ -22,9 +22,9 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/UIElement.h"
+#include "UIElement.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 static const int DEFAULT_FONT_SIZE = 12;
 static const int DEFAULT_FONT_SIZE = 12;
@@ -70,7 +70,7 @@ struct GlyphLocation
 };
 };
 
 
 /// %Text %UI element.
 /// %Text %UI element.
-class URHO3D_API Text : public UIElement
+class ATOMIC_API Text : public UIElement
 {
 {
     OBJECT(Text);
     OBJECT(Text);
 
 

+ 0 - 597
Source/Atomic/UI/SystemUI/Text3D.cpp

@@ -1,597 +0,0 @@
-//
-// Copyright (c) 2008-2015 the Urho3D project.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Graphics/Camera.h"
-#include "../Graphics/Geometry.h"
-#include "../Graphics/Material.h"
-#include "../Graphics/Technique.h"
-#include "../Graphics/VertexBuffer.h"
-#include "../IO/Log.h"
-#include "../Resource/ResourceCache.h"
-#include "../Scene/Node.h"
-#include "../UI/Font.h"
-#include "../UI/Text.h"
-#include "../UI/Text3D.h"
-
-namespace Urho3D
-{
-
-extern const char* horizontalAlignments[];
-extern const char* verticalAlignments[];
-extern const char* textEffects[];
-extern const char* faceCameraModeNames[];
-extern const char* GEOMETRY_CATEGORY;
-
-static const float TEXT_SCALING = 1.0f / 128.0f;
-static const float DEFAULT_EFFECT_DEPTH_BIAS = 0.1f;
-
-Text3D::Text3D(Context* context) :
-    Drawable(context, DRAWABLE_GEOMETRY),
-    text_(context),
-    vertexBuffer_(new VertexBuffer(context_)),
-    customWorldTransform_(Matrix3x4::IDENTITY),
-    faceCameraMode_(FC_NONE),
-    textDirty_(true),
-    geometryDirty_(true),
-    usingSDFShader_(false)
-{
-    text_.SetUsedInText3D(true);
-    text_.SetEffectDepthBias(DEFAULT_EFFECT_DEPTH_BIAS);
-}
-
-Text3D::~Text3D()
-{
-}
-
-void Text3D::RegisterObject(Context* context)
-{
-    context->RegisterFactory<Text3D>(GEOMETRY_CATEGORY);
-
-    ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
-    MIXED_ACCESSOR_ATTRIBUTE("Font", GetFontAttr, SetFontAttr, ResourceRef, ResourceRef(Font::GetTypeStatic()), AM_DEFAULT);
-    MIXED_ACCESSOR_ATTRIBUTE("Material", GetMaterialAttr, SetMaterialAttr, ResourceRef, ResourceRef(Material::GetTypeStatic()),
-        AM_DEFAULT);
-    ATTRIBUTE("Font Size", int, text_.fontSize_, DEFAULT_FONT_SIZE, AM_DEFAULT);
-    ATTRIBUTE("Text", String, text_.text_, String::EMPTY, AM_DEFAULT);
-    ENUM_ATTRIBUTE("Text Alignment", text_.textAlignment_, horizontalAlignments, HA_LEFT, AM_DEFAULT);
-    ATTRIBUTE("Row Spacing", float, text_.rowSpacing_, 1.0f, AM_DEFAULT);
-    ATTRIBUTE("Word Wrap", bool, text_.wordWrap_, false, AM_DEFAULT);
-    ACCESSOR_ATTRIBUTE("Can Be Occluded", IsOccludee, SetOccludee, bool, true, AM_DEFAULT);
-    ENUM_ATTRIBUTE("Face Camera Mode", faceCameraMode_, faceCameraModeNames, FC_NONE, AM_DEFAULT);
-    ACCESSOR_ATTRIBUTE("Draw Distance", GetDrawDistance, SetDrawDistance, float, 0.0f, AM_DEFAULT);
-    ACCESSOR_ATTRIBUTE("Width", GetWidth, SetWidth, int, 0, AM_DEFAULT);
-    ENUM_ACCESSOR_ATTRIBUTE("Horiz Alignment", GetHorizontalAlignment, SetHorizontalAlignment, HorizontalAlignment,
-        horizontalAlignments, HA_LEFT, AM_DEFAULT);
-    ENUM_ACCESSOR_ATTRIBUTE("Vert Alignment", GetVerticalAlignment, SetVerticalAlignment, VerticalAlignment, verticalAlignments,
-        VA_TOP, AM_DEFAULT);
-    ACCESSOR_ATTRIBUTE("Color", GetColorAttr, SetColor, Color, Color::WHITE, AM_DEFAULT);
-    ATTRIBUTE("Top Left Color", Color, text_.color_[0], Color::WHITE, AM_DEFAULT);
-    ATTRIBUTE("Top Right Color", Color, text_.color_[1], Color::WHITE, AM_DEFAULT);
-    ATTRIBUTE("Bottom Left Color", Color, text_.color_[2], Color::WHITE, AM_DEFAULT);
-    ATTRIBUTE("Bottom Right Color", Color, text_.color_[3], Color::WHITE, AM_DEFAULT);
-    ENUM_ATTRIBUTE("Text Effect", text_.textEffect_, textEffects, TE_NONE, AM_DEFAULT);
-    ACCESSOR_ATTRIBUTE("Effect Color", GetEffectColor, SetEffectColor, Color, Color::BLACK, AM_DEFAULT);
-    ATTRIBUTE("Effect Depth Bias", float, text_.effectDepthBias_, DEFAULT_EFFECT_DEPTH_BIAS, AM_DEFAULT);
-    COPY_BASE_ATTRIBUTES(Drawable);
-}
-
-void Text3D::ApplyAttributes()
-{
-    text_.ApplyAttributes();
-    MarkTextDirty();
-    UpdateTextBatches();
-    UpdateTextMaterials();
-}
-
-void Text3D::UpdateBatches(const FrameInfo& frame)
-{
-    distance_ = frame.camera_->GetDistance(GetWorldBoundingBox().Center());
-
-    if (faceCameraMode_ != FC_NONE)
-    {
-        Vector3 worldPosition = node_->GetWorldPosition();
-        customWorldTransform_ = Matrix3x4(worldPosition, frame.camera_->GetFaceCameraRotation(
-            worldPosition, node_->GetWorldRotation(), faceCameraMode_), node_->GetWorldScale());
-        worldBoundingBoxDirty_ = true;
-    }
-
-    for (unsigned i = 0; i < batches_.Size(); ++i)
-    {
-        batches_[i].distance_ = distance_;
-        batches_[i].worldTransform_ = faceCameraMode_ != FC_NONE ? &customWorldTransform_ : &node_->GetWorldTransform();
-    }
-}
-
-void Text3D::UpdateGeometry(const FrameInfo& frame)
-{
-    if (geometryDirty_)
-    {
-        for (unsigned i = 0; i < batches_.Size(); ++i)
-        {
-            Geometry* geometry = geometries_[i];
-            geometry->SetDrawRange(TRIANGLE_LIST, 0, 0, uiBatches_[i].vertexStart_,
-                (uiBatches_[i].vertexEnd_ - uiBatches_[i].vertexStart_) / UI_VERTEX_SIZE);
-        }
-    }
-
-    if ((geometryDirty_ || vertexBuffer_->IsDataLost()) && uiVertexData_.Size())
-    {
-        unsigned vertexCount = uiVertexData_.Size() / UI_VERTEX_SIZE;
-        if (vertexBuffer_->GetVertexCount() != vertexCount)
-            vertexBuffer_->SetSize(vertexCount, MASK_POSITION | MASK_COLOR | MASK_TEXCOORD1);
-        vertexBuffer_->SetData(&uiVertexData_[0]);
-    }
-
-    geometryDirty_ = false;
-}
-
-UpdateGeometryType Text3D::GetUpdateGeometryType()
-{
-    if (geometryDirty_ || vertexBuffer_->IsDataLost())
-        return UPDATE_MAIN_THREAD;
-    else
-        return UPDATE_NONE;
-}
-
-void Text3D::SetMaterial(Material* material)
-{
-    material_ = material;
-
-    UpdateTextMaterials(true);
-}
-
-bool Text3D::SetFont(const String& fontName, int size)
-{
-    bool success = text_.SetFont(fontName, size);
-
-    // Changing font requires materials to be re-evaluated. Material evaluation can not be done in worker threads,
-    // so UI batches must be brought up-to-date immediately
-    MarkTextDirty();
-    UpdateTextBatches();
-    UpdateTextMaterials();
-
-    return success;
-}
-
-bool Text3D::SetFont(Font* font, int size)
-{
-    bool success = text_.SetFont(font, size);
-
-    MarkTextDirty();
-    UpdateTextBatches();
-    UpdateTextMaterials();
-
-    return success;
-}
-
-void Text3D::SetText(const String& text)
-{
-    text_.SetText(text);
-
-    // Changing text requires materials to be re-evaluated, in case the font is multi-page
-    MarkTextDirty();
-    UpdateTextBatches();
-    UpdateTextMaterials();
-}
-
-void Text3D::SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign)
-{
-    text_.SetAlignment(hAlign, vAlign);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetHorizontalAlignment(HorizontalAlignment align)
-{
-    text_.SetHorizontalAlignment(align);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetVerticalAlignment(VerticalAlignment align)
-{
-    text_.SetVerticalAlignment(align);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetTextAlignment(HorizontalAlignment align)
-{
-    text_.SetTextAlignment(align);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetRowSpacing(float spacing)
-{
-    text_.SetRowSpacing(spacing);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetWordwrap(bool enable)
-{
-    text_.SetWordwrap(enable);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetTextEffect(TextEffect textEffect)
-{
-    text_.SetTextEffect(textEffect);
-
-    MarkTextDirty();
-    UpdateTextMaterials(true);
-}
-
-void Text3D::SetEffectColor(const Color& effectColor)
-{
-    text_.SetEffectColor(effectColor);
-
-    MarkTextDirty();
-    UpdateTextMaterials();
-}
-
-void Text3D::SetEffectDepthBias(float bias)
-{
-    text_.SetEffectDepthBias(bias);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetWidth(int width)
-{
-    text_.SetMinWidth(width);
-    text_.SetWidth(width);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetColor(const Color& color)
-{
-    text_.SetColor(color);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetColor(Corner corner, const Color& color)
-{
-    text_.SetColor(corner, color);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetOpacity(float opacity)
-{
-    text_.SetOpacity(opacity);
-
-    MarkTextDirty();
-}
-
-void Text3D::SetFaceCameraMode(FaceCameraMode mode)
-{
-    if (mode != faceCameraMode_)
-    {
-        faceCameraMode_ = mode;
-
-        // Bounding box must be recalculated
-        OnMarkedDirty(node_);
-    }
-}
-
-Material* Text3D::GetMaterial() const
-{
-    return material_;
-}
-
-Font* Text3D::GetFont() const
-{
-    return text_.GetFont();
-}
-
-int Text3D::GetFontSize() const
-{
-    return text_.GetFontSize();
-}
-
-const String& Text3D::GetText() const
-{
-    return text_.GetText();
-}
-
-HorizontalAlignment Text3D::GetHorizontalAlignment() const
-{
-    return text_.GetHorizontalAlignment();
-}
-
-VerticalAlignment Text3D::GetVerticalAlignment() const
-{
-    return text_.GetVerticalAlignment();
-}
-
-HorizontalAlignment Text3D::GetTextAlignment() const
-{
-    return text_.GetTextAlignment();
-}
-
-float Text3D::GetRowSpacing() const
-{
-    return text_.GetRowSpacing();
-}
-
-bool Text3D::GetWordwrap() const
-{
-    return text_.GetWordwrap();
-}
-
-TextEffect Text3D::GetTextEffect() const
-{
-    return text_.GetTextEffect();
-}
-
-const Color& Text3D::GetEffectColor() const
-{
-    return text_.GetEffectColor();
-}
-
-float Text3D::GetEffectDepthBias() const
-{
-    return text_.GetEffectDepthBias();
-}
-
-int Text3D::GetWidth() const
-{
-    return text_.GetWidth();
-}
-
-int Text3D::GetRowHeight() const
-{
-    return text_.GetRowHeight();
-}
-
-unsigned Text3D::GetNumRows() const
-{
-    return text_.GetNumRows();
-}
-
-unsigned Text3D::GetNumChars() const
-{
-    return text_.GetNumChars();
-}
-
-int Text3D::GetRowWidth(unsigned index) const
-{
-    return text_.GetRowWidth(index);
-}
-
-IntVector2 Text3D::GetCharPosition(unsigned index)
-{
-    return text_.GetCharPosition(index);
-}
-
-IntVector2 Text3D::GetCharSize(unsigned index)
-{
-    return text_.GetCharSize(index);
-}
-
-const Color& Text3D::GetColor(Corner corner) const
-{
-    return text_.GetColor(corner);
-}
-
-float Text3D::GetOpacity() const
-{
-    return text_.GetOpacity();
-}
-
-void Text3D::OnNodeSet(Node* node)
-{
-    Drawable::OnNodeSet(node);
-
-    if (node)
-        customWorldTransform_ = node->GetWorldTransform();
-}
-
-void Text3D::OnWorldBoundingBoxUpdate()
-{
-    if (textDirty_)
-        UpdateTextBatches();
-
-    // In face camera mode, use the last camera rotation to build the world bounding box
-    worldBoundingBox_ = boundingBox_.Transformed(faceCameraMode_ != FC_NONE ? Matrix3x4(node_->GetWorldPosition(),
-        customWorldTransform_.Rotation(), node_->GetWorldScale()) : node_->GetWorldTransform());
-}
-
-void Text3D::MarkTextDirty()
-{
-    textDirty_ = true;
-
-    OnMarkedDirty(node_);
-    MarkNetworkUpdate();
-}
-
-void Text3D::SetMaterialAttr(const ResourceRef& value)
-{
-    ResourceCache* cache = GetSubsystem<ResourceCache>();
-    SetMaterial(cache->GetResource<Material>(value.name_));
-}
-
-void Text3D::SetFontAttr(const ResourceRef& value)
-{
-    ResourceCache* cache = GetSubsystem<ResourceCache>();
-    text_.font_ = cache->GetResource<Font>(value.name_);
-}
-
-ResourceRef Text3D::GetMaterialAttr() const
-{
-    return GetResourceRef(material_, Material::GetTypeStatic());
-}
-
-ResourceRef Text3D::GetFontAttr() const
-{
-    return GetResourceRef(text_.font_, Font::GetTypeStatic());
-}
-
-void Text3D::UpdateTextBatches()
-{
-    uiBatches_.Clear();
-    uiVertexData_.Clear();
-
-    text_.GetBatches(uiBatches_, uiVertexData_, IntRect::ZERO);
-
-    Vector3 offset(Vector3::ZERO);
-
-    switch (text_.GetHorizontalAlignment())
-    {
-    case HA_LEFT:
-        break;
-
-    case HA_CENTER:
-        offset.x_ -= (float)text_.GetWidth() * 0.5f;
-        break;
-
-    case HA_RIGHT:
-        offset.x_ -= (float)text_.GetWidth();
-        break;
-    }
-
-    switch (text_.GetVerticalAlignment())
-    {
-    case VA_TOP:
-        break;
-
-    case VA_CENTER:
-        offset.y_ -= (float)text_.GetHeight() * 0.5f;
-        break;
-
-    case VA_BOTTOM:
-        offset.y_ -= (float)text_.GetHeight();
-        break;
-    }
-
-    boundingBox_.defined_ = false;
-    boundingBox_.min_ = boundingBox_.max_ = Vector3::ZERO;
-
-    for (unsigned i = 0; i < uiVertexData_.Size(); i += UI_VERTEX_SIZE)
-    {
-        Vector3& position = *(reinterpret_cast<Vector3*>(&uiVertexData_[i]));
-        position += offset;
-        position *= TEXT_SCALING;
-        position.y_ = -position.y_;
-        boundingBox_.Merge(position);
-    }
-
-    textDirty_ = false;
-    geometryDirty_ = true;
-}
-
-void Text3D::UpdateTextMaterials(bool forceUpdate)
-{
-    Font* font = GetFont();
-    bool isSDFFont = font ? font->IsSDFFont() : false;
-
-    batches_.Resize(uiBatches_.Size());
-    geometries_.Resize(uiBatches_.Size());
-
-    for (unsigned i = 0; i < batches_.Size(); ++i)
-    {
-        if (!geometries_[i])
-        {
-            Geometry* geometry = new Geometry(context_);
-            geometry->SetVertexBuffer(0, vertexBuffer_, MASK_POSITION | MASK_COLOR | MASK_TEXCOORD1);
-            batches_[i].geometry_ = geometries_[i] = geometry;
-        }
-
-        if (!batches_[i].material_ || forceUpdate || isSDFFont != usingSDFShader_)
-        {
-            // If material not defined, create a reasonable default from scratch
-            if (!material_)
-            {
-                Material* material = new Material(context_);
-                Technique* tech = new Technique(context_);
-                Pass* pass = tech->CreatePass("alpha");
-                pass->SetVertexShader("Text");
-                pass->SetPixelShader("Text");
-
-                if (isSDFFont)
-                {
-                    switch (GetTextEffect())
-                    {
-                    case TE_NONE:
-                        pass->SetPixelShaderDefines("SIGNED_DISTANCE_FIELD");
-                        break;
-
-                    case TE_SHADOW:
-                        pass->SetPixelShaderDefines("SIGNED_DISTANCE_FIELD TEXT_EFFECT_SHADOW");
-                        break;
-
-                    case TE_STROKE:
-                        pass->SetPixelShaderDefines("SIGNED_DISTANCE_FIELD TEXT_EFFECT_STROKE");
-                        break;
-                    }
-                }
-
-                pass->SetBlendMode(BLEND_ALPHA);
-                pass->SetDepthWrite(false);
-                material->SetTechnique(0, tech);
-                material->SetCullMode(CULL_NONE);
-                batches_[i].material_ = material;
-            }
-            else
-                batches_[i].material_ = material_->Clone();
-
-            // Note: custom material is assumed to use the right kind of shader; it is not modified to define SIGNED_DISTANCE_FIELD
-            usingSDFShader_ = isSDFFont;
-        }
-
-        Material* material = batches_[i].material_;
-        Texture* texture = uiBatches_[i].texture_;
-        material->SetTexture(TU_DIFFUSE, texture);
-
-        if (isSDFFont)
-        {
-            switch (GetTextEffect())
-            {
-            case TE_SHADOW:
-                if (texture)
-                {
-                    Vector2 shadowOffset(0.5f / texture->GetWidth(), 0.5f / texture->GetHeight());
-                    material->SetShaderParameter("ShadowOffset", shadowOffset);
-                }
-                material->SetShaderParameter("ShadowColor", GetEffectColor());
-                break;
-
-            case TE_STROKE:
-                material->SetShaderParameter("StrokeColor", GetEffectColor());
-                break;
-
-            default:
-                break;
-            }
-        }
-    }
-}
-
-}

+ 0 - 191
Source/Atomic/UI/SystemUI/Text3D.h

@@ -1,191 +0,0 @@
-//
-// Copyright (c) 2008-2015 the Urho3D project.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-#pragma once
-
-#include "../Graphics/Drawable.h"
-#include "../Graphics/VertexBuffer.h"
-#include "../Math/Matrix3x4.h"
-#include "../UI/Text.h"
-
-namespace Urho3D
-{
-
-class Text;
-
-/// 3D text component.
-class URHO3D_API Text3D : public Drawable
-{
-    OBJECT(Text3D);
-
-public:
-    /// Construct.
-    Text3D(Context* context);
-    /// Destruct.
-    ~Text3D();
-    /// Register object factory. Drawable must be registered first.
-    static void RegisterObject(Context* context);
-
-    /// Apply attribute changes that can not be applied immediately.
-    virtual void ApplyAttributes();
-    /// Calculate distance and prepare batches for rendering. May be called from worker thread(s), possibly re-entrantly.
-    virtual void UpdateBatches(const FrameInfo& frame);
-    /// Prepare geometry for rendering. Called from a worker thread if possible (no GPU update.)
-    virtual void UpdateGeometry(const FrameInfo& frame);
-    /// Return whether a geometry update is necessary, and if it can happen in a worker thread.
-    virtual UpdateGeometryType GetUpdateGeometryType();
-
-    /// Set font and font size and use signed distance field font. Return true if successful.
-    bool SetFont(const String& fontName, int size = DEFAULT_FONT_SIZE);
-    /// Set font and font size and use signed distance field font. Return true if successful.
-    bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE);
-    /// Set material.
-    void SetMaterial(Material* material);
-    /// Set text. Text is assumed to be either ASCII or UTF8-encoded.
-    void SetText(const String& text);
-    /// Set horizontal and vertical alignment.
-    void SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign);
-    /// Set horizontal alignment.
-    void SetHorizontalAlignment(HorizontalAlignment align);
-    /// Set vertical alignment.
-    void SetVerticalAlignment(VerticalAlignment align);
-    /// Set row alignment.
-    void SetTextAlignment(HorizontalAlignment align);
-    /// Set row spacing, 1.0 for original font spacing.
-    void SetRowSpacing(float spacing);
-    /// Set wordwrap. In wordwrap mode the text element will respect its current width. Otherwise it resizes itself freely.
-    void SetWordwrap(bool enable);
-    /// Set text effect.
-    void SetTextEffect(TextEffect textEffect);
-    /// Set effect color.
-    void SetEffectColor(const Color& effectColor);
-    /// Set effect Z bias.
-    void SetEffectDepthBias(float bias);
-    /// Set text width. Only has effect in word wrap mode.
-    void SetWidth(int width);
-    /// Set color on all corners.
-    void SetColor(const Color& color);
-    /// Set color on one corner.
-    void SetColor(Corner corner, const Color& color);
-    /// Set opacity.
-    void SetOpacity(float opacity);
-    /// Set how the text should rotate in relation to the camera. Default is to not rotate (FC_NONE.)
-    void SetFaceCameraMode(FaceCameraMode mode);
-
-    /// Return font.
-    Font* GetFont() const;
-    /// Return material.
-    Material* GetMaterial() const;
-    /// Return font size.
-    int GetFontSize() const;
-    /// Return text.
-    const String& GetText() const;
-    /// Return row alignment.
-    HorizontalAlignment GetTextAlignment() const;
-    /// Return horizontal alignment.
-    HorizontalAlignment GetHorizontalAlignment() const;
-    /// Return vertical alignment.
-    VerticalAlignment GetVerticalAlignment() const;
-    /// Return row spacing.
-    float GetRowSpacing() const;
-    /// Return wordwrap mode.
-    bool GetWordwrap() const;
-    /// Return text effect.
-    TextEffect GetTextEffect() const;
-    /// Return effect color.
-    const Color& GetEffectColor() const;
-    /// Return effect depth bias.
-    float GetEffectDepthBias() const;
-    /// Return text width.
-    int GetWidth() const;
-    /// Return row height.
-    int GetRowHeight() const;
-    /// Return number of rows.
-    unsigned GetNumRows() const;
-    /// Return number of characters.
-    unsigned GetNumChars() const;
-    /// Return width of row by index.
-    int GetRowWidth(unsigned index) const;
-    /// Return position of character by index relative to the text element origin.
-    IntVector2 GetCharPosition(unsigned index);
-    /// Return size of character by index.
-    IntVector2 GetCharSize(unsigned index);
-    /// Return corner color.
-    const Color& GetColor(Corner corner) const;
-    /// Return opacity.
-    float GetOpacity() const;
-
-    /// Return how the text rotates in relation to the camera.
-    FaceCameraMode GetFaceCameraMode() const { return faceCameraMode_; }
-
-    /// Set font attribute.
-    void SetFontAttr(const ResourceRef& value);
-    /// Return font attribute.
-    ResourceRef GetFontAttr() const;
-    /// Set material attribute.
-    void SetMaterialAttr(const ResourceRef& value);
-    /// Return material attribute.
-    ResourceRef GetMaterialAttr() const;
-
-    /// Get color attribute. Uses just the top-left color.
-    const Color& GetColorAttr() const { return text_.color_[0]; }
-
-protected:
-    /// Handle node being assigned.
-    virtual void OnNodeSet(Node* node);
-    /// Recalculate the world-space bounding box.
-    virtual void OnWorldBoundingBoxUpdate();
-
-private:
-    /// Mark text & geometry dirty.
-    void MarkTextDirty();
-    /// Update text %UI batches.
-    void UpdateTextBatches();
-    /// Create materials for text rendering. May only be called from the main thread. Text %UI batches must be up-to-date.
-    void UpdateTextMaterials(bool forceUpdate = false);
-
-    /// Internally used text element.
-    Text text_;
-    /// Geometries.
-    Vector<SharedPtr<Geometry> > geometries_;
-    /// Vertex buffer.
-    SharedPtr<VertexBuffer> vertexBuffer_;
-    /// Material to use as a base for the text material(s).
-    SharedPtr<Material> material_;
-    /// Text UI batches.
-    PODVector<UIBatch> uiBatches_;
-    /// Text vertex data.
-    PODVector<float> uiVertexData_;
-    /// Custom world transform for facing the camera automatically.
-    Matrix3x4 customWorldTransform_;
-    /// Text rotation mode in relation to the camera.
-    FaceCameraMode faceCameraMode_;
-    /// Text needs update flag.
-    bool textDirty_;
-    /// Geometry dirty flag.
-    bool geometryDirty_;
-    /// Flag for whether currently using SDF shader defines in the generated material.
-    bool usingSDFShader_;
-};
-
-}
-

+ 5 - 7
Source/Atomic/UI/SystemUI/ToolTip.cpp

@@ -20,13 +20,11 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "ToolTip.h"
+#include "UI.h"
 
 
-#include "../Core/Context.h"
-#include "../UI/ToolTip.h"
-#include "../UI/UI.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 extern const char* UI_CATEGORY;
 extern const char* UI_CATEGORY;
@@ -107,4 +105,4 @@ void ToolTip::SetDelay(float delay)
     delay_ = delay;
     delay_ = delay;
 }
 }
 
 
-}
+}

+ 5 - 5
Source/Atomic/UI/SystemUI/ToolTip.h

@@ -22,14 +22,14 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Graphics/GraphicsDefs.h"
-#include "../UI/UIElement.h"
+#include "../../Graphics/GraphicsDefs.h"
+#include "UIElement.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// Tooltip %UI element.
 /// Tooltip %UI element.
-class URHO3D_API ToolTip : public UIElement
+class ATOMIC_API ToolTip : public UIElement
 {
 {
     OBJECT(ToolTip)
     OBJECT(ToolTip)
 
 
@@ -63,4 +63,4 @@ private:
     IntVector2 originalPosition_;
     IntVector2 originalPosition_;
 };
 };
 
 
-}
+}

+ 35 - 43
Source/Atomic/UI/SystemUI/UI.cpp

@@ -20,49 +20,44 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Core/CoreEvents.h"
-#include "../Core/Profiler.h"
-#include "../Container/Sort.h"
-#include "../Graphics/Graphics.h"
-#include "../Graphics/GraphicsEvents.h"
-#include "../Graphics/Shader.h"
-#include "../Graphics/ShaderVariation.h"
-#include "../Graphics/Texture2D.h"
-#include "../Graphics/VertexBuffer.h"
-#include "../Input/Input.h"
-#include "../Input/InputEvents.h"
-#include "../IO/Log.h"
-#include "../Math/Matrix3x4.h"
-#include "../Resource/ResourceCache.h"
-#include "../UI/CheckBox.h"
-#include "../UI/Cursor.h"
-#include "../UI/DropDownList.h"
-#include "../UI/FileSelector.h"
-#include "../UI/Font.h"
-#include "../UI/LineEdit.h"
-#include "../UI/ListView.h"
-#include "../UI/MessageBox.h"
-#include "../UI/ScrollBar.h"
-#include "../UI/Slider.h"
-#include "../UI/Sprite.h"
-#include "../UI/Text.h"
-#include "../UI/Text3D.h"
-#include "../UI/ToolTip.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-#include "../UI/Window.h"
-#include "../UI/View3D.h"
-
-#include <SDL/SDL.h>
-
-#include "../DebugNew.h"
+#include "../../Core/Context.h"
+#include "../../Core/CoreEvents.h"
+#include "../../Core/Profiler.h"
+#include "../../Container/Sort.h"
+#include "../../Graphics/Graphics.h"
+#include "../../Graphics/GraphicsEvents.h"
+#include "../../Graphics/Shader.h"
+#include "../../Graphics/ShaderVariation.h"
+#include "../../Graphics/Texture2D.h"
+#include "../../Graphics/VertexBuffer.h"
+#include "../../Input/Input.h"
+#include "../../Input/InputEvents.h"
+#include "../../IO/Log.h"
+#include "../../Math/Matrix3x4.h"
+#include "../../Resource/ResourceCache.h"
+#include "CheckBox.h"
+#include "Cursor.h"
+#include "DropDownList.h"
+#include "Font.h"
+#include "LineEdit.h"
+#include "ListView.h"
+#include "MessageBox.h"
+#include "ScrollBar.h"
+#include "Slider.h"
+#include "Sprite.h"
+#include "Text.h"
+#include "ToolTip.h"
+#include "UI.h"
+#include "UIEvents.h"
+#include "Window.h"
+
+#include <SDL/include/SDL.h>
+
+#include "../../DebugNew.h"
 
 
 #define TOUCHID_MASK(id) (1 << id)
 #define TOUCHID_MASK(id) (1 << id)
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 StringHash VAR_ORIGIN("Origin");
 StringHash VAR_ORIGIN("Origin");
@@ -1778,9 +1773,7 @@ void RegisterUILibrary(Context* context)
     CheckBox::RegisterObject(context);
     CheckBox::RegisterObject(context);
     Cursor::RegisterObject(context);
     Cursor::RegisterObject(context);
     Text::RegisterObject(context);
     Text::RegisterObject(context);
-    Text3D::RegisterObject(context);
     Window::RegisterObject(context);
     Window::RegisterObject(context);
-    View3D::RegisterObject(context);
     LineEdit::RegisterObject(context);
     LineEdit::RegisterObject(context);
     Slider::RegisterObject(context);
     Slider::RegisterObject(context);
     ScrollBar::RegisterObject(context);
     ScrollBar::RegisterObject(context);
@@ -1788,7 +1781,6 @@ void RegisterUILibrary(Context* context)
     ListView::RegisterObject(context);
     ListView::RegisterObject(context);
     Menu::RegisterObject(context);
     Menu::RegisterObject(context);
     DropDownList::RegisterObject(context);
     DropDownList::RegisterObject(context);
-    FileSelector::RegisterObject(context);
     MessageBox::RegisterObject(context);
     MessageBox::RegisterObject(context);
     ToolTip::RegisterObject(context);
     ToolTip::RegisterObject(context);
 }
 }

+ 6 - 6
Source/Atomic/UI/SystemUI/UI.h

@@ -22,11 +22,11 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Core/Object.h"
-#include "../UI/Cursor.h"
-#include "../UI/UIBatch.h"
+#include "../../Core/Object.h"
+#include "Cursor.h"
+#include "UIBatch.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class Cursor;
 class Cursor;
@@ -40,7 +40,7 @@ class XMLElement;
 class XMLFile;
 class XMLFile;
 
 
 /// %UI subsystem. Manages the graphical user interface.
 /// %UI subsystem. Manages the graphical user interface.
-class URHO3D_API UI : public Object
+class ATOMIC_API UI : public Object
 {
 {
     OBJECT(UI);
     OBJECT(UI);
 
 
@@ -334,6 +334,6 @@ private:
 };
 };
 
 
 /// Register UI library objects.
 /// Register UI library objects.
-void URHO3D_API RegisterUILibrary(Context* context);
+void ATOMIC_API RegisterUILibrary(Context* context);
 
 
 }
 }

+ 5 - 7
Source/Atomic/UI/SystemUI/UIBatch.cpp

@@ -20,15 +20,13 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Graphics/Graphics.h"
+#include "../../Graphics/Texture.h"
+#include "UIElement.h"
 
 
-#include "../Graphics/Graphics.h"
-#include "../Graphics/Texture.h"
-#include "../UI/UIElement.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 Vector3 UIBatch::posAdjust(0.0f, 0.0f, 0.0f);
 Vector3 UIBatch::posAdjust(0.0f, 0.0f, 0.0f);

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

@@ -22,11 +22,11 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Math/Color.h"
-#include "../Math/Rect.h"
-#include "../Graphics/GraphicsDefs.h"
+#include "../../Math/Color.h"
+#include "../../Math/Rect.h"
+#include "../../Graphics/GraphicsDefs.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 class PixelShader;
 class PixelShader;
@@ -38,7 +38,7 @@ class UIElement;
 static const unsigned UI_VERTEX_SIZE = 6;
 static const unsigned UI_VERTEX_SIZE = 6;
 
 
 /// %UI rendering draw call.
 /// %UI rendering draw call.
-class URHO3D_API UIBatch
+class ATOMIC_API UIBatch
 {
 {
 public:
 public:
     /// Construct with defaults.
     /// Construct with defaults.

+ 15 - 17
Source/Atomic/UI/SystemUI/UIElement.cpp

@@ -20,23 +20,21 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Core/CoreEvents.h"
-#include "../Container/HashSet.h"
-#include "../Container/Sort.h"
-#include "../IO/Log.h"
-#include "../Resource/ResourceCache.h"
-#include "../Scene/ObjectAnimation.h"
-#include "../UI/Cursor.h"
-#include "../UI/UI.h"
-#include "../UI/UIElement.h"
-#include "../UI/UIEvents.h"
-
-#include "../DebugNew.h"
-
-namespace Urho3D
+#include "../../Core/Context.h"
+#include "../../Core/CoreEvents.h"
+#include "../../Container/HashSet.h"
+#include "../../Container/Sort.h"
+#include "../../IO/Log.h"
+#include "../../Resource/ResourceCache.h"
+#include "../../Scene/ObjectAnimation.h"
+#include "Cursor.h"
+#include "UI.h"
+#include "UIElement.h"
+#include "UIEvents.h"
+
+#include "../../DebugNew.h"
+
+namespace Atomic
 {
 {
 
 
 const char* horizontalAlignments[] =
 const char* horizontalAlignments[] =

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

@@ -22,12 +22,12 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Math/Vector2.h"
-#include "../Resource/XMLFile.h"
-#include "../Scene/Animatable.h"
-#include "../UI/UIBatch.h"
+#include "../../Math/Vector2.h"
+#include "../../Resource/XMLFile.h"
+#include "../../Scene/Animatable.h"
+#include "UIBatch.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// %UI element horizontal alignment.
 /// %UI element horizontal alignment.
@@ -109,7 +109,7 @@ class Cursor;
 class ResourceCache;
 class ResourceCache;
 
 
 /// Base class for %UI elements.
 /// Base class for %UI elements.
-class URHO3D_API UIElement : public Animatable
+class ATOMIC_API UIElement : public Animatable
 {
 {
     OBJECT(UIElement);
     OBJECT(UIElement);
     BASEOBJECT(UIElement);
     BASEOBJECT(UIElement);

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

@@ -22,9 +22,9 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../Core/Object.h"
+#include "../../Core/Object.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// Mouse click in the UI.
 /// Mouse click in the UI.

+ 0 - 174
Source/Atomic/UI/SystemUI/View3D.cpp

@@ -1,174 +0,0 @@
-//
-// Copyright (c) 2008-2015 the Urho3D project.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Graphics/Camera.h"
-#include "../Graphics/Graphics.h"
-#include "../Graphics/Octree.h"
-#include "../Graphics/Texture2D.h"
-#include "../Graphics/Zone.h"
-#include "../Scene/Scene.h"
-#include "../UI/View3D.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-
-namespace Urho3D
-{
-
-extern const char* UI_CATEGORY;
-
-View3D::View3D(Context* context) :
-    Window(context),
-    ownScene_(true),
-    rttFormat_(Graphics::GetRGBFormat()),
-    autoUpdate_(true)
-{
-    renderTexture_ = new Texture2D(context_);
-    depthTexture_ = new Texture2D(context_);
-    viewport_ = new Viewport(context_);
-}
-
-View3D::~View3D()
-{
-    ResetScene();
-}
-
-void View3D::RegisterObject(Context* context)
-{
-    context->RegisterFactory<View3D>(UI_CATEGORY);
-
-    COPY_BASE_ATTRIBUTES(Window);
-    // The texture format is API specific, so do not register it as a serializable attribute
-    ACCESSOR_ATTRIBUTE("Auto Update", GetAutoUpdate, SetAutoUpdate, bool, true, AM_FILE);
-    UPDATE_ATTRIBUTE_DEFAULT_VALUE("Clip Children", true);
-    UPDATE_ATTRIBUTE_DEFAULT_VALUE("Is Enabled", true);
-}
-
-void View3D::OnResize()
-{
-    int width = GetWidth();
-    int height = GetHeight();
-
-    if (width > 0 && height > 0)
-    {
-        renderTexture_->SetSize(width, height, rttFormat_, TEXTURE_RENDERTARGET);
-        depthTexture_->SetSize(width, height, Graphics::GetDepthStencilFormat(), TEXTURE_DEPTHSTENCIL);
-        RenderSurface* surface = renderTexture_->GetRenderSurface();
-        surface->SetViewport(0, viewport_);
-        surface->SetUpdateMode(autoUpdate_ ? SURFACE_UPDATEALWAYS : SURFACE_MANUALUPDATE);
-        surface->SetLinkedDepthStencil(depthTexture_->GetRenderSurface());
-
-        SetTexture(renderTexture_);
-        SetImageRect(IntRect(0, 0, width, height));
-
-        if (!autoUpdate_)
-            surface->QueueUpdate();
-    }
-}
-
-void View3D::SetView(Scene* scene, Camera* camera, bool ownScene)
-{
-    ResetScene();
-
-    scene_ = scene;
-    cameraNode_ = camera ? camera->GetNode() : 0;
-    ownScene_ = ownScene;
-
-    viewport_->SetScene(scene_);
-    viewport_->SetCamera(camera);
-    QueueUpdate();
-}
-
-void View3D::SetFormat(unsigned format)
-{
-    if (format != rttFormat_)
-    {
-        rttFormat_ = format;
-        OnResize();
-    }
-}
-
-void View3D::SetAutoUpdate(bool enable)
-{
-    if (enable != autoUpdate_)
-    {
-        autoUpdate_ = enable;
-        RenderSurface* surface = renderTexture_->GetRenderSurface();
-        if (surface)
-            surface->SetUpdateMode(autoUpdate_ ? SURFACE_UPDATEALWAYS : SURFACE_MANUALUPDATE);
-    }
-}
-
-void View3D::QueueUpdate()
-{
-    if (!autoUpdate_)
-    {
-        RenderSurface* surface = renderTexture_->GetRenderSurface();
-        if (surface)
-            surface->QueueUpdate();
-    }
-}
-
-Scene* View3D::GetScene() const
-{
-    return scene_;
-}
-
-Node* View3D::GetCameraNode() const
-{
-    return cameraNode_;
-}
-
-Texture2D* View3D::GetRenderTexture() const
-{
-    return renderTexture_;
-}
-
-Texture2D* View3D::GetDepthTexture() const
-{
-    return depthTexture_;
-}
-
-Viewport* View3D::GetViewport() const
-{
-    return viewport_;
-}
-
-void View3D::ResetScene()
-{
-    if (!scene_)
-        return;
-
-    if (!ownScene_)
-    {
-        RefCount* refCount = scene_->RefCountPtr();
-        ++refCount->refs_;
-        scene_ = 0;
-        --refCount->refs_;
-    }
-    else
-        scene_ = 0;
-}
-
-}

+ 0 - 100
Source/Atomic/UI/SystemUI/View3D.h

@@ -1,100 +0,0 @@
-//
-// Copyright (c) 2008-2015 the Urho3D project.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-#pragma once
-
-#include "../UI/Window.h"
-
-namespace Urho3D
-{
-
-class Camera;
-class Node;
-class Scene;
-class Texture2D;
-class Viewport;
-
-/// %UI element which renders a 3D scene.
-class URHO3D_API View3D : public Window
-{
-    OBJECT(View3D);
-
-public:
-    /// Construct.
-    View3D(Context* context);
-    /// Destruct.
-    ~View3D();
-    /// Register object factory.
-    static void RegisterObject(Context* context);
-
-    /// React to resize.
-    virtual void OnResize();
-
-    /// Define the scene and camera to use in rendering. When ownScene is true the View3D will take ownership of them with shared pointers.
-    void SetView(Scene* scene, Camera* camera, bool ownScene = true);
-    /// Set render texture pixel format. Default is RGB.
-    void SetFormat(unsigned format);
-    /// Set render target auto update mode. Default is true.
-    void SetAutoUpdate(bool enable);
-    /// Queue manual update on the render texture.
-    void QueueUpdate();
-
-    /// Return render texture pixel format.
-    unsigned GetFormat() const { return rttFormat_; }
-
-    /// Return whether render target updates automatically.
-    bool GetAutoUpdate() const { return autoUpdate_; }
-
-    /// Return scene.
-    Scene* GetScene() const;
-    /// Return camera scene node.
-    Node* GetCameraNode() const;
-    /// Return render texture.
-    Texture2D* GetRenderTexture() const;
-    /// Return depth stencil texture.
-    Texture2D* GetDepthTexture() const;
-    /// Return viewport.
-    Viewport* GetViewport() const;
-
-private:
-    /// Reset scene.
-    void ResetScene();
-
-    /// Renderable texture.
-    SharedPtr<Texture2D> renderTexture_;
-    /// Depth stencil texture.
-    SharedPtr<Texture2D> depthTexture_;
-    /// Viewport.
-    SharedPtr<Viewport> viewport_;
-    /// Scene.
-    SharedPtr<Scene> scene_;
-    /// Camera scene node.
-    SharedPtr<Node> cameraNode_;
-    /// Own scene.
-    bool ownScene_;
-    /// Render texture format.
-    unsigned rttFormat_;
-    /// Render texture auto update mode.
-    bool autoUpdate_;
-};
-
-}

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

@@ -20,18 +20,16 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include "../Precompiled.h"
+#include "../../Core/Context.h"
+#include "../../Input/InputEvents.h"
+#include "Cursor.h"
+#include "UI.h"
+#include "UIEvents.h"
+#include "Window.h"
 
 
-#include "../Core/Context.h"
-#include "../Input/InputEvents.h"
-#include "../UI/Cursor.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-#include "../UI/Window.h"
+#include "../../DebugNew.h"
 
 
-#include "../DebugNew.h"
-
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 static const int DEFAULT_RESIZE_BORDER = 4;
 static const int DEFAULT_RESIZE_BORDER = 4;

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

@@ -22,9 +22,9 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "../UI/BorderImage.h"
+#include "BorderImage.h"
 
 
-namespace Urho3D
+namespace Atomic
 {
 {
 
 
 /// %Window movement and resizing modes.
 /// %Window movement and resizing modes.
@@ -43,7 +43,7 @@ enum WindowDragMode
 };
 };
 
 
 /// %Window %UI element that can optionally by moved or resized.
 /// %Window %UI element that can optionally by moved or resized.
-class URHO3D_API Window : public BorderImage
+class ATOMIC_API Window : public BorderImage
 {
 {
     OBJECT(Window);
     OBJECT(Window);