From 223e3a53f58d92e69d56a6d2b29196e84fcdad1a Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 1 May 2015 02:09:57 +0200 Subject: [PATCH] Move OEngine::Gui::Layout to MWGui --- apps/openmw/CMakeLists.txt | 2 +- apps/openmw/mwbase/windowmanager.hpp | 12 +++--------- apps/openmw/mwgui/hud.hpp | 2 +- .../openengine/gui => apps/openmw/mwgui}/layout.cpp | 5 +---- .../openengine/gui => apps/openmw/mwgui}/layout.hpp | 9 ++++----- apps/openmw/mwgui/mainmenu.cpp | 4 ++-- apps/openmw/mwgui/mainmenu.hpp | 4 ++-- apps/openmw/mwgui/messagebox.hpp | 2 +- apps/openmw/mwgui/tooltips.hpp | 4 ++-- apps/openmw/mwgui/windowbase.hpp | 4 ++-- apps/openmw/mwgui/windowmanagerimp.cpp | 6 +++--- apps/openmw/mwgui/windowmanagerimp.hpp | 6 +++--- libs/openengine/CMakeLists.txt | 6 +----- 13 files changed, 26 insertions(+), 40 deletions(-) rename {libs/openengine/gui => apps/openmw/mwgui}/layout.cpp (98%) rename {libs/openengine/gui => apps/openmw/mwgui}/layout.hpp (94%) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index f352547e0..f049f0387 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -33,7 +33,7 @@ add_openmw_dir (mwrender # ) add_openmw_dir (mwgui - textinput widgets race class birth review windowmanagerimp console dialogue + layout textinput widgets race class birth review windowmanagerimp console dialogue windowbase statswindow messagebox journalwindow charactercreation mapwindow windowpinnablebase tooltips scrollwindow bookwindow formatting inventorywindow container hud countdialog tradewindow settingswindow diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index d5960779c..743577812 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -26,14 +26,6 @@ namespace MyGUI class UString; } -namespace OEngine -{ - namespace GUI - { - class Layout; - } -} - namespace ESM { struct Class; @@ -58,6 +50,8 @@ namespace MWWorld namespace MWGui { + class Layout; + class Console; class SpellWindow; class TradeWindow; @@ -241,7 +235,7 @@ namespace MWBase virtual void addVisitedLocation(const std::string& name, int x, int y) = 0; /// Hides dialog and schedules dialog to be deleted. - virtual void removeDialog(OEngine::GUI::Layout* dialog) = 0; + virtual void removeDialog(MWGui::Layout* dialog) = 0; ///Gracefully attempts to exit the topmost GUI mode /** No guarentee of actually closing the window **/ diff --git a/apps/openmw/mwgui/hud.hpp b/apps/openmw/mwgui/hud.hpp index 263c08774..e717e094e 100644 --- a/apps/openmw/mwgui/hud.hpp +++ b/apps/openmw/mwgui/hud.hpp @@ -16,7 +16,7 @@ namespace MWGui class SpellIcons; class ItemWidget; - class HUD : public OEngine::GUI::Layout, public LocalMapBase + class HUD : public Layout, public LocalMapBase { public: HUD(CustomMarkerCollection& customMarkers, int fpsLevel, DragAndDrop* dragAndDrop); diff --git a/libs/openengine/gui/layout.cpp b/apps/openmw/mwgui/layout.cpp similarity index 98% rename from libs/openengine/gui/layout.cpp rename to apps/openmw/mwgui/layout.cpp index cd94387f9..6bdb1a9f4 100644 --- a/libs/openengine/gui/layout.cpp +++ b/apps/openmw/mwgui/layout.cpp @@ -6,9 +6,7 @@ #include #include -namespace OEngine -{ -namespace GUI +namespace MWGui { void Layout::initialise(const std::string& _layout, MyGUI::Widget* _parent) { @@ -78,4 +76,3 @@ namespace GUI } } -} diff --git a/libs/openengine/gui/layout.hpp b/apps/openmw/mwgui/layout.hpp similarity index 94% rename from libs/openengine/gui/layout.hpp rename to apps/openmw/mwgui/layout.hpp index b0515ccbb..0e7cf3faa 100644 --- a/libs/openengine/gui/layout.hpp +++ b/apps/openmw/mwgui/layout.hpp @@ -1,12 +1,11 @@ -#ifndef OENGINE_MYGUI_LAYOUT_H -#define OENGINE_MYGUI_LAYOUT_H +#ifndef OPENMW_MWGUI_LAYOUT_H +#define OPENMW_MWGUI_LAYOUT_H #include #include #include -namespace OEngine { -namespace GUI +namespace MWGui { /** The Layout class is an utility class used to load MyGUI layouts from xml files, and to manipulate member widgets. @@ -60,5 +59,5 @@ namespace GUI std::string mLayoutName; MyGUI::VectorWidgetPtr mListWindowRoot; }; -}} +} #endif diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index 0a8667d80..d563eacc8 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -30,7 +30,7 @@ namespace MWGui { MainMenu::MainMenu(int w, int h) - : OEngine::GUI::Layout("openmw_mainmenu.layout") + : Layout("openmw_mainmenu.layout") , mButtonBox(0), mWidth (w), mHeight (h) , mSaveGameDialog(NULL) , mBackground(NULL) @@ -80,7 +80,7 @@ namespace MWGui MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu) && MWBase::Environment::get().getStateManager()->getState() == MWBase::StateManager::State_NoGame); - OEngine::GUI::Layout::setVisible (visible); + Layout::setVisible (visible); } void MainMenu::onNewGameConfirmed() diff --git a/apps/openmw/mwgui/mainmenu.hpp b/apps/openmw/mwgui/mainmenu.hpp index cd2050d0f..9089ed1d5 100644 --- a/apps/openmw/mwgui/mainmenu.hpp +++ b/apps/openmw/mwgui/mainmenu.hpp @@ -1,7 +1,7 @@ #ifndef OPENMW_GAME_MWGUI_MAINMENU_H #define OPENMW_GAME_MWGUI_MAINMENU_H -#include +#include "layout.hpp" namespace Gui { @@ -15,7 +15,7 @@ namespace MWGui class SaveGameDialog; class VideoWidget; - class MainMenu : public OEngine::GUI::Layout + class MainMenu : public Layout { int mWidth; int mHeight; diff --git a/apps/openmw/mwgui/messagebox.hpp b/apps/openmw/mwgui/messagebox.hpp index 48a92c844..59d1a0b06 100644 --- a/apps/openmw/mwgui/messagebox.hpp +++ b/apps/openmw/mwgui/messagebox.hpp @@ -51,7 +51,7 @@ namespace MWGui int mLastButtonPressed; }; - class MessageBox : public OEngine::GUI::Layout + class MessageBox : public Layout { public: MessageBox (MessageBoxManager& parMessageBoxManager, const std::string& message); diff --git a/apps/openmw/mwgui/tooltips.hpp b/apps/openmw/mwgui/tooltips.hpp index 71b4a560f..0ddd313df 100644 --- a/apps/openmw/mwgui/tooltips.hpp +++ b/apps/openmw/mwgui/tooltips.hpp @@ -2,7 +2,7 @@ #ifndef MWGUI_TOOLTIPS_H #define MWGUI_TOOLTIPS_H -#include +#include "layout.hpp" #include "../mwworld/ptr.hpp" #include "widgets.hpp" @@ -45,7 +45,7 @@ namespace MWGui bool wordWrap; }; - class ToolTips : public OEngine::GUI::Layout + class ToolTips : public Layout { public: ToolTips(); diff --git a/apps/openmw/mwgui/windowbase.hpp b/apps/openmw/mwgui/windowbase.hpp index bf74c8bf0..195b6c384 100644 --- a/apps/openmw/mwgui/windowbase.hpp +++ b/apps/openmw/mwgui/windowbase.hpp @@ -1,7 +1,7 @@ #ifndef MWGUI_WINDOW_BASE_H #define MWGUI_WINDOW_BASE_H -#include +#include "layout.hpp" namespace MWBase { @@ -13,7 +13,7 @@ namespace MWGui class WindowManager; class DragAndDrop; - class WindowBase: public OEngine::GUI::Layout + class WindowBase: public Layout { public: WindowBase(const std::string& parLayout); diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index ce9735f9d..cf7475d5c 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -422,7 +422,7 @@ namespace MWGui // Delete any dialogs which are no longer in use if (!mGarbageDialogs.empty()) { - for (std::vector::iterator it = mGarbageDialogs.begin(); it != mGarbageDialogs.end(); ++it) + for (std::vector::iterator it = mGarbageDialogs.begin(); it != mGarbageDialogs.end(); ++it) { delete *it; } @@ -722,7 +722,7 @@ namespace MWGui mStatsWindow->updateSkillArea(); } - void WindowManager::removeDialog(OEngine::GUI::Layout*dialog) + void WindowManager::removeDialog(Layout*dialog) { if (!dialog) return; @@ -1566,7 +1566,7 @@ namespace MWGui return mCursorVisible; } - void WindowManager::trackWindow(OEngine::GUI::Layout *layout, const std::string &name) + void WindowManager::trackWindow(Layout *layout, const std::string &name) { MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize(); MyGUI::IntPoint pos(static_cast(Settings::Manager::getFloat(name + " x", "Windows") * viewSize.width), diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 16dab08a9..ec99364c7 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -242,7 +242,7 @@ namespace MWGui virtual void addVisitedLocation(const std::string& name, int x, int y); ///Hides dialog and schedules dialog to be deleted. - virtual void removeDialog(OEngine::GUI::Layout* dialog); + virtual void removeDialog(Layout* dialog); ///Gracefully attempts to exit the topmost GUI mode virtual void exitCurrentGuiMode(); @@ -366,7 +366,7 @@ namespace MWGui bool mConsoleOnlyScripts; std::map mTrackedWindows; - void trackWindow(OEngine::GUI::Layout* layout, const std::string& name); + void trackWindow(Layout* layout, const std::string& name); void onWindowChangeCoord(MyGUI::Window* _sender); std::string mSelectedSpell; @@ -448,7 +448,7 @@ namespace MWGui SFO::CursorManager* mCursorManager; - std::vector mGarbageDialogs; + std::vector mGarbageDialogs; void cleanupGarbage(); GuiWindow mShown; // Currently shown windows in inventory mode diff --git a/libs/openengine/CMakeLists.txt b/libs/openengine/CMakeLists.txt index fa3df0820..b135d0fc6 100644 --- a/libs/openengine/CMakeLists.txt +++ b/libs/openengine/CMakeLists.txt @@ -1,7 +1,3 @@ -set(OENGINE_GUI - gui/layout.cpp -) - set(OENGINE_BULLET bullet/BtOgre.cpp bullet/BtOgreExtras.h @@ -15,7 +11,7 @@ set(OENGINE_BULLET bullet/trace.h ) -set(OENGINE_ALL ${OENGINE_GUI} ${OENGINE_BULLET}) +set(OENGINE_ALL ${OENGINE_BULLET}) set(OENGINE_LIBRARY "oengine") set(OENGINE_LIBRARY ${OENGINE_LIBRARY} PARENT_SCOPE)