From f7ca026db025ef1175966eb7fd939552ce8b9ffb Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 2 May 2015 01:50:19 -0700 Subject: [PATCH] Code cleanup: moving poly::ui to xe::ui --- src/poly/sources.gypi | 1 - src/poly/ui/sources.gypi | 20 -------------- src/xenia/gpu/gl4/gl4_profiler_display.cc | 27 ++++++++++--------- src/xenia/gpu/gl4/wgl_control.cc | 8 +++--- src/xenia/gpu/gl4/wgl_control.h | 12 ++++----- src/xenia/gpu/trace_viewer_main.cc | 24 ++++++++--------- src/{poly => xenia}/ui/control.cc | 6 ++--- src/{poly => xenia}/ui/control.h | 12 ++++----- src/{poly => xenia}/ui/loop.h | 10 +++---- src/xenia/ui/main_window.cc | 2 +- src/xenia/ui/main_window.h | 10 +++---- src/{poly => xenia}/ui/menu_item.cc | 10 +++---- src/{poly => xenia}/ui/menu_item.h | 12 ++++----- src/xenia/ui/sources.gypi | 15 +++++++++++ src/{poly => xenia}/ui/ui_event.h | 10 +++---- src/{poly => xenia}/ui/win32/sources.gypi | 0 src/{poly => xenia}/ui/win32/win32_control.cc | 8 +++--- src/{poly => xenia}/ui/win32/win32_control.h | 14 +++++----- src/{poly => xenia}/ui/win32/win32_loop.cc | 6 ++--- src/{poly => xenia}/ui/win32/win32_loop.h | 12 ++++----- .../ui/win32/win32_menu_item.cc | 6 ++--- .../ui/win32/win32_menu_item.h | 12 ++++----- src/{poly => xenia}/ui/win32/win32_window.cc | 11 ++++---- src/{poly => xenia}/ui/win32/win32_window.h | 14 +++++----- src/{poly => xenia}/ui/window.h | 14 +++++----- 25 files changed, 134 insertions(+), 142 deletions(-) delete mode 100644 src/poly/ui/sources.gypi rename src/{poly => xenia}/ui/control.cc (97%) rename src/{poly => xenia}/ui/control.h (96%) rename src/{poly => xenia}/ui/loop.h (86%) rename src/{poly => xenia}/ui/menu_item.cc (91%) rename src/{poly => xenia}/ui/menu_item.h (89%) rename src/{poly => xenia}/ui/ui_event.h (94%) rename src/{poly => xenia}/ui/win32/sources.gypi (100%) rename src/{poly => xenia}/ui/win32/win32_control.cc (98%) rename src/{poly => xenia}/ui/win32/win32_control.h (87%) rename src/{poly => xenia}/ui/win32/win32_loop.cc (96%) rename src/{poly => xenia}/ui/win32/win32_loop.h (85%) rename src/{poly => xenia}/ui/win32/win32_menu_item.cc (92%) rename src/{poly => xenia}/ui/win32/win32_menu_item.h (81%) rename src/{poly => xenia}/ui/win32/win32_window.cc (96%) rename src/{poly => xenia}/ui/win32/win32_window.h (85%) rename src/{poly => xenia}/ui/window.h (90%) diff --git a/src/poly/sources.gypi b/src/poly/sources.gypi index e92720344..5a881e449 100644 --- a/src/poly/sources.gypi +++ b/src/poly/sources.gypi @@ -62,6 +62,5 @@ ], 'includes': [ - 'ui/sources.gypi', ], } diff --git a/src/poly/ui/sources.gypi b/src/poly/ui/sources.gypi deleted file mode 100644 index 74d1b4d52..000000000 --- a/src/poly/ui/sources.gypi +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2014 Ben Vanik. All Rights Reserved. -{ - 'sources': [ - 'control.cc', - 'control.h', - 'loop.h', - 'menu_item.cc', - 'menu_item.h', - 'ui_event.h', - 'window.h', - ], - - 'conditions': [ - ['OS == "win"', { - 'includes': [ - 'win32/sources.gypi', - ], - }], - ], -} diff --git a/src/xenia/gpu/gl4/gl4_profiler_display.cc b/src/xenia/gpu/gl4/gl4_profiler_display.cc index cc8fb84af..686505a1f 100644 --- a/src/xenia/gpu/gl4/gl4_profiler_display.cc +++ b/src/xenia/gpu/gl4/gl4_profiler_display.cc @@ -142,7 +142,8 @@ GL4ProfilerDisplay::GL4ProfilerDisplay(WGLControl* control) vao_(0), font_texture_(0), font_handle_(0), - vertex_buffer_(MICROPROFILE_MAX_VERTICES * sizeof(Vertex) * 10, sizeof(Vertex)), + vertex_buffer_(MICROPROFILE_MAX_VERTICES * sizeof(Vertex) * 10, + sizeof(Vertex)), draw_command_count_(0) { if (!SetupFont() || !SetupState() || !SetupShaders()) { // Hrm. @@ -150,32 +151,32 @@ GL4ProfilerDisplay::GL4ProfilerDisplay(WGLControl* control) } // Pass through mouse events. - control->on_mouse_down.AddListener([](poly::ui::MouseEvent& e) { - Profiler::OnMouseDown(e.button() == poly::ui::MouseEvent::Button::kLeft, - e.button() == poly::ui::MouseEvent::Button::kRight); + control->on_mouse_down.AddListener([](xe::ui::MouseEvent& e) { + Profiler::OnMouseDown(e.button() == xe::ui::MouseEvent::Button::kLeft, + e.button() == xe::ui::MouseEvent::Button::kRight); e.set_handled(true); }); - control->on_mouse_up.AddListener([](poly::ui::MouseEvent& e) { + control->on_mouse_up.AddListener([](xe::ui::MouseEvent& e) { Profiler::OnMouseUp(); e.set_handled(true); }); - control->on_mouse_move.AddListener([](poly::ui::MouseEvent& e) { + control->on_mouse_move.AddListener([](xe::ui::MouseEvent& e) { Profiler::OnMouseMove(e.x(), e.y()); e.set_handled(true); }); - control->on_mouse_wheel.AddListener([](poly::ui::MouseEvent& e) { + control->on_mouse_wheel.AddListener([](xe::ui::MouseEvent& e) { Profiler::OnMouseWheel(e.x(), e.y(), -e.dy()); e.set_handled(true); }); // Watch for toggle/mode keys and such. - control->on_key_down.AddListener([](poly::ui::KeyEvent& e) { + control->on_key_down.AddListener([](xe::ui::KeyEvent& e) { Profiler::OnKeyDown(e.key_code()); - //e.set_handled(true); + // e.set_handled(true); }); - control->on_key_up.AddListener([](poly::ui::KeyEvent& e) { + control->on_key_up.AddListener([](xe::ui::KeyEvent& e) { Profiler::OnKeyUp(e.key_code()); - //e.set_handled(true); + // e.set_handled(true); }); } @@ -258,7 +259,7 @@ struct VertexData { \n\ };\n\ "; const std::string vertex_shader_source = header + - "\n\ + "\n\ layout(location = 0) uniform mat4 projection_matrix; \n\ struct VertexFetch { \n\ vec2 pos; \n\ @@ -274,7 +275,7 @@ void main() { \n\ } \n\ "; const std::string fragment_shader_source = header + - "\n\ + "\n\ layout(location = 1, bindless_sampler) uniform sampler2D font_texture; \n\ layout(location = 2) uniform float font_height; \n\ layout(location = 0) in VertexData vtx; \n\ diff --git a/src/xenia/gpu/gl4/wgl_control.cc b/src/xenia/gpu/gl4/wgl_control.cc index 2c584a7bb..bb810e432 100644 --- a/src/xenia/gpu/gl4/wgl_control.cc +++ b/src/xenia/gpu/gl4/wgl_control.cc @@ -21,8 +21,8 @@ namespace gl4 { extern "C" GLEWContext* glewGetContext(); extern "C" WGLEWContext* wglewGetContext(); -WGLControl::WGLControl(poly::ui::Loop* loop) - : poly::ui::win32::Win32Control(Flags::kFlagOwnPaint), loop_(loop) {} +WGLControl::WGLControl(xe::ui::Loop* loop) + : xe::ui::win32::Win32Control(Flags::kFlagOwnPaint), loop_(loop) {} WGLControl::~WGLControl() = default; @@ -70,7 +70,7 @@ bool WGLControl::Create() { return true; } -void WGLControl::OnLayout(poly::ui::UIEvent& e) { Control::ResizeToFill(); } +void WGLControl::OnLayout(xe::ui::UIEvent& e) { Control::ResizeToFill(); } LRESULT WGLControl::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { @@ -89,7 +89,7 @@ LRESULT WGLControl::WndProc(HWND hWnd, UINT message, WPARAM wParam, current_paint_callback_ = nullptr; } - poly::ui::UIEvent e(this); + xe::ui::UIEvent e(this); OnPaint(e); // TODO(benvanik): profiler present. diff --git a/src/xenia/gpu/gl4/wgl_control.h b/src/xenia/gpu/gl4/wgl_control.h index bced21022..a3c1e5b9e 100644 --- a/src/xenia/gpu/gl4/wgl_control.h +++ b/src/xenia/gpu/gl4/wgl_control.h @@ -13,17 +13,17 @@ #include #include "poly/threading.h" -#include "poly/ui/loop.h" -#include "poly/ui/win32/win32_control.h" #include "xenia/gpu/gl4/gl_context.h" +#include "xenia/ui/loop.h" +#include "xenia/ui/win32/win32_control.h" namespace xe { namespace gpu { namespace gl4 { -class WGLControl : public poly::ui::win32::Win32Control { +class WGLControl : public xe::ui::win32::Win32Control { public: - WGLControl(poly::ui::Loop* loop); + WGLControl(xe::ui::Loop* loop); ~WGLControl() override; GLContext* context() { return &context_; } @@ -33,13 +33,13 @@ class WGLControl : public poly::ui::win32::Win32Control { protected: bool Create() override; - void OnLayout(poly::ui::UIEvent& e) override; + void OnLayout(xe::ui::UIEvent& e) override; LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) override; private: - poly::ui::Loop* loop_; + xe::ui::Loop* loop_; GLContext context_; std::function current_paint_callback_; }; diff --git a/src/xenia/gpu/trace_viewer_main.cc b/src/xenia/gpu/trace_viewer_main.cc index 9681a7396..f52b76595 100644 --- a/src/xenia/gpu/trace_viewer_main.cc +++ b/src/xenia/gpu/trace_viewer_main.cc @@ -767,7 +767,7 @@ class TraceReader { class TracePlayer : public TraceReader { public: - TracePlayer(poly::ui::Loop* loop, GraphicsSystem* graphics_system) + TracePlayer(xe::ui::Loop* loop, GraphicsSystem* graphics_system) : loop_(loop), graphics_system_(graphics_system), current_frame_index_(0), @@ -827,7 +827,7 @@ class TracePlayer : public TraceReader { } private: - poly::ui::Loop* loop_; + xe::ui::Loop* loop_; GraphicsSystem* graphics_system_; int current_frame_index_; int current_command_index_; @@ -2213,7 +2213,7 @@ int trace_viewer_main(std::vector& args) { } auto control = window->child(0); - control->on_key_char.AddListener([graphics_system](poly::ui::KeyEvent& e) { + control->on_key_char.AddListener([graphics_system](xe::ui::KeyEvent& e) { auto& io = ImGui::GetIO(); if (e.key_code() > 0 && e.key_code() < 0x10000) { if (e.key_code() == 0x74 /* VK_F5 */) { @@ -2224,41 +2224,41 @@ int trace_viewer_main(std::vector& args) { } e.set_handled(true); }); - control->on_mouse_down.AddListener([](poly::ui::MouseEvent& e) { + control->on_mouse_down.AddListener([](xe::ui::MouseEvent& e) { auto& io = ImGui::GetIO(); io.MousePos = ImVec2(float(e.x()), float(e.y())); switch (e.button()) { - case poly::ui::MouseEvent::Button::kLeft: + case xe::ui::MouseEvent::Button::kLeft: io.MouseDown[0] = true; break; - case poly::ui::MouseEvent::Button::kRight: + case xe::ui::MouseEvent::Button::kRight: io.MouseDown[1] = true; break; } }); - control->on_mouse_move.AddListener([](poly::ui::MouseEvent& e) { + control->on_mouse_move.AddListener([](xe::ui::MouseEvent& e) { auto& io = ImGui::GetIO(); io.MousePos = ImVec2(float(e.x()), float(e.y())); }); - control->on_mouse_up.AddListener([](poly::ui::MouseEvent& e) { + control->on_mouse_up.AddListener([](xe::ui::MouseEvent& e) { auto& io = ImGui::GetIO(); io.MousePos = ImVec2(float(e.x()), float(e.y())); switch (e.button()) { - case poly::ui::MouseEvent::Button::kLeft: + case xe::ui::MouseEvent::Button::kLeft: io.MouseDown[0] = false; break; - case poly::ui::MouseEvent::Button::kRight: + case xe::ui::MouseEvent::Button::kRight: io.MouseDown[1] = false; break; } }); - control->on_mouse_wheel.AddListener([](poly::ui::MouseEvent& e) { + control->on_mouse_wheel.AddListener([](xe::ui::MouseEvent& e) { auto& io = ImGui::GetIO(); io.MousePos = ImVec2(float(e.x()), float(e.y())); io.MouseWheel += float(e.dy() / 120.0f); }); - control->on_paint.AddListener([&](poly::ui::UIEvent& e) { + control->on_paint.AddListener([&](xe::ui::UIEvent& e) { static bool imgui_setup = false; if (!imgui_setup) { ImImpl_Setup(); diff --git a/src/poly/ui/control.cc b/src/xenia/ui/control.cc similarity index 97% rename from src/poly/ui/control.cc rename to src/xenia/ui/control.cc index 6684f9c18..4a8bffafd 100644 --- a/src/poly/ui/control.cc +++ b/src/xenia/ui/control.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include "poly/ui/control.h" +#include "xenia/ui/control.h" #include "poly/assert.h" -namespace poly { +namespace xe { namespace ui { Control::Control(uint32_t flags) @@ -129,4 +129,4 @@ void Control::OnMouseWheel(MouseEvent& e) { } } // namespace ui -} // namespace poly +} // namespace xe diff --git a/src/poly/ui/control.h b/src/xenia/ui/control.h similarity index 96% rename from src/poly/ui/control.h rename to src/xenia/ui/control.h index 4386e8dac..c83582e96 100644 --- a/src/poly/ui/control.h +++ b/src/xenia/ui/control.h @@ -7,16 +7,16 @@ ****************************************************************************** */ -#ifndef POLY_UI_CONTROL_H_ -#define POLY_UI_CONTROL_H_ +#ifndef XENIA_UI_CONTROL_H_ +#define XENIA_UI_CONTROL_H_ #include #include #include "poly/delegate.h" -#include "poly/ui/ui_event.h" +#include "xenia/ui/ui_event.h" -namespace poly { +namespace xe { namespace ui { class Control { @@ -129,6 +129,6 @@ class Control { }; } // namespace ui -} // namespace poly +} // namespace xe -#endif // POLY_UI_CONTROL_H_ +#endif // XENIA_UI_CONTROL_H_ diff --git a/src/poly/ui/loop.h b/src/xenia/ui/loop.h similarity index 86% rename from src/poly/ui/loop.h rename to src/xenia/ui/loop.h index 9cf2415fb..7cfe4bfa2 100644 --- a/src/poly/ui/loop.h +++ b/src/xenia/ui/loop.h @@ -7,12 +7,12 @@ ****************************************************************************** */ -#ifndef POLY_UI_LOOP_H_ -#define POLY_UI_LOOP_H_ +#ifndef XENIA_UI_LOOP_H_ +#define XENIA_UI_LOOP_H_ #include -namespace poly { +namespace xe { namespace ui { class Loop { @@ -27,6 +27,6 @@ class Loop { }; } // namespace ui -} // namespace poly +} // namespace xe -#endif // POLY_UI_LOOP_H_ +#endif // XENIA_UI_LOOP_H_ diff --git a/src/xenia/ui/main_window.cc b/src/xenia/ui/main_window.cc index a24514104..86814f34f 100644 --- a/src/xenia/ui/main_window.cc +++ b/src/xenia/ui/main_window.cc @@ -46,7 +46,7 @@ bool MainWindow::Initialize() { return false; } Resize(1280, 720); - on_key_down.AddListener([this](poly::ui::KeyEvent& e) { + on_key_down.AddListener([this](KeyEvent& e) { bool handled = true; switch (e.key_code()) { case 0x73: { // VK_F4 diff --git a/src/xenia/ui/main_window.h b/src/xenia/ui/main_window.h index 093731a95..d8e9d739a 100644 --- a/src/xenia/ui/main_window.h +++ b/src/xenia/ui/main_window.h @@ -10,12 +10,12 @@ #ifndef XENIA_UI_MAIN_WINDOW_H_ #define XENIA_UI_MAIN_WINDOW_H_ -#include "poly/ui/window.h" +#include "xenia/ui/window.h" #include "xenia/xbox.h" // TODO(benvanik): only on windows. -#include "poly/ui/win32/win32_loop.h" -#include "poly/ui/win32/win32_window.h" +#include "xenia/ui/win32/win32_loop.h" +#include "xenia/ui/win32/win32_window.h" namespace xe { class Emulator; @@ -24,8 +24,8 @@ class Emulator; namespace xe { namespace ui { -using PlatformLoop = poly::ui::win32::Win32Loop; -using PlatformWindow = poly::ui::win32::Win32Window; +using PlatformLoop = xe::ui::win32::Win32Loop; +using PlatformWindow = xe::ui::win32::Win32Window; class MainWindow : public PlatformWindow { public: diff --git a/src/poly/ui/menu_item.cc b/src/xenia/ui/menu_item.cc similarity index 91% rename from src/poly/ui/menu_item.cc rename to src/xenia/ui/menu_item.cc index 623251f98..86f9d525a 100644 --- a/src/poly/ui/menu_item.cc +++ b/src/xenia/ui/menu_item.cc @@ -7,9 +7,9 @@ ****************************************************************************** */ -#include "poly/ui/menu_item.h" +#include "xenia/ui/menu_item.h" -namespace poly { +namespace xe { namespace ui { MenuItem::MenuItem(Type type) : type_(type), parent_item_(nullptr) {} @@ -41,9 +41,7 @@ void MenuItem::RemoveChild(MenuItem* child_item) { } } -void MenuItem::OnSelected(UIEvent& e) { - on_selected(e); -} +void MenuItem::OnSelected(UIEvent& e) { on_selected(e); } } // namespace ui -} // namespace poly +} // namespace xe diff --git a/src/poly/ui/menu_item.h b/src/xenia/ui/menu_item.h similarity index 89% rename from src/poly/ui/menu_item.h rename to src/xenia/ui/menu_item.h index 1da156e42..44b9abdbb 100644 --- a/src/poly/ui/menu_item.h +++ b/src/xenia/ui/menu_item.h @@ -7,16 +7,16 @@ ****************************************************************************** */ -#ifndef POLY_UI_MENU_ITEM_H_ -#define POLY_UI_MENU_ITEM_H_ +#ifndef XENIA_UI_MENU_ITEM_H_ +#define XENIA_UI_MENU_ITEM_H_ #include #include #include "poly/delegate.h" -#include "poly/ui/ui_event.h" +#include "xenia/ui/ui_event.h" -namespace poly { +namespace xe { namespace ui { class Window; @@ -56,6 +56,6 @@ class MenuItem { }; } // namespace ui -} // namespace poly +} // namespace xe -#endif // POLY_UI_MENU_ITEM_H_ +#endif // XENIA_UI_MENU_ITEM_H_ diff --git a/src/xenia/ui/sources.gypi b/src/xenia/ui/sources.gypi index f2c3a3d99..70be615d7 100644 --- a/src/xenia/ui/sources.gypi +++ b/src/xenia/ui/sources.gypi @@ -1,7 +1,22 @@ # Copyright 2014 Ben Vanik. All Rights Reserved. { 'sources': [ + 'control.cc', + 'control.h', + 'loop.h', 'main_window.cc', 'main_window.h', + 'menu_item.cc', + 'menu_item.h', + 'ui_event.h', + 'window.h', + ], + + 'conditions': [ + ['OS == "win"', { + 'includes': [ + 'win32/sources.gypi', + ], + }], ], } diff --git a/src/poly/ui/ui_event.h b/src/xenia/ui/ui_event.h similarity index 94% rename from src/poly/ui/ui_event.h rename to src/xenia/ui/ui_event.h index 641eddf90..706dd7778 100644 --- a/src/poly/ui/ui_event.h +++ b/src/xenia/ui/ui_event.h @@ -7,10 +7,10 @@ ****************************************************************************** */ -#ifndef POLY_UI_UI_EVENT_H_ -#define POLY_UI_UI_EVENT_H_ +#ifndef XENIA_UI_UI_EVENT_H_ +#define XENIA_UI_UI_EVENT_H_ -namespace poly { +namespace xe { namespace ui { class Control; @@ -84,6 +84,6 @@ class MouseEvent : public UIEvent { }; } // namespace ui -} // namespace poly +} // namespace xe -#endif // POLY_UI_UI_EVENT_H_ +#endif // XENIA_UI_UI_EVENT_H_ diff --git a/src/poly/ui/win32/sources.gypi b/src/xenia/ui/win32/sources.gypi similarity index 100% rename from src/poly/ui/win32/sources.gypi rename to src/xenia/ui/win32/sources.gypi diff --git a/src/poly/ui/win32/win32_control.cc b/src/xenia/ui/win32/win32_control.cc similarity index 98% rename from src/poly/ui/win32/win32_control.cc rename to src/xenia/ui/win32/win32_control.cc index acbb68fb8..4a8a6bc5e 100644 --- a/src/poly/ui/win32/win32_control.cc +++ b/src/xenia/ui/win32/win32_control.cc @@ -7,9 +7,9 @@ ****************************************************************************** */ -#include "poly/ui/win32/win32_control.h" +#include "xenia/ui/win32/win32_control.h" -namespace poly { +namespace xe { namespace ui { namespace win32 { @@ -182,7 +182,7 @@ LRESULT CALLBACK Win32Control::WndProcThunk(HWND hWnd, UINT message, if (message == WM_NCCREATE) { auto create_struct = reinterpret_cast(lParam); control = reinterpret_cast(create_struct->lpCreateParams); - SetWindowLongPtr(hWnd, GWLP_USERDATA, (__int3264)(LONG_PTR)control); + SetWindowLongPtr(hWnd, GWLP_USERDATA, (__int3264)(LONG_PTR) control); } else { control = reinterpret_cast(GetWindowLongPtr(hWnd, GWLP_USERDATA)); @@ -365,4 +365,4 @@ bool Win32Control::HandleKeyboard(UINT message, WPARAM wParam, LPARAM lParam) { } // namespace win32 } // namespace ui -} // namespace poly +} // namespace xe diff --git a/src/poly/ui/win32/win32_control.h b/src/xenia/ui/win32/win32_control.h similarity index 87% rename from src/poly/ui/win32/win32_control.h rename to src/xenia/ui/win32/win32_control.h index f46de9afe..f25e2890d 100644 --- a/src/poly/ui/win32/win32_control.h +++ b/src/xenia/ui/win32/win32_control.h @@ -7,15 +7,15 @@ ****************************************************************************** */ -#ifndef POLY_UI_WIN32_WIN32_CONTROL_H_ -#define POLY_UI_WIN32_WIN32_CONTROL_H_ +#ifndef XENIA_UI_WIN32_WIN32_CONTROL_H_ +#define XENIA_UI_WIN32_WIN32_CONTROL_H_ #include #include -#include "poly/ui/control.h" +#include "xenia/ui/control.h" -namespace poly { +namespace xe { namespace ui { namespace win32 { @@ -52,7 +52,7 @@ class Win32Control : public Control { void OnResize(UIEvent& e) override; static LRESULT CALLBACK - WndProcThunk(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + WndProcThunk(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); @@ -65,6 +65,6 @@ class Win32Control : public Control { } // namespace win32 } // namespace ui -} // namespace poly +} // namespace xe -#endif // POLY_UI_WIN32_WIN32_CONTROL_H_ +#endif // XENIA_UI_WIN32_WIN32_CONTROL_H_ diff --git a/src/poly/ui/win32/win32_loop.cc b/src/xenia/ui/win32/win32_loop.cc similarity index 96% rename from src/poly/ui/win32/win32_loop.cc rename to src/xenia/ui/win32/win32_loop.cc index ca409d5cf..7e20d138a 100644 --- a/src/poly/ui/win32/win32_loop.cc +++ b/src/xenia/ui/win32/win32_loop.cc @@ -7,11 +7,11 @@ ****************************************************************************** */ -#include "poly/ui/win32/win32_loop.h" +#include "xenia/ui/win32/win32_loop.h" #include "poly/assert.h" -namespace poly { +namespace xe { namespace ui { namespace win32 { @@ -89,4 +89,4 @@ void Win32Loop::AwaitQuit() { quit_fence_.Wait(); } } // namespace win32 } // namespace ui -} // namespace poly +} // namespace xe diff --git a/src/poly/ui/win32/win32_loop.h b/src/xenia/ui/win32/win32_loop.h similarity index 85% rename from src/poly/ui/win32/win32_loop.h rename to src/xenia/ui/win32/win32_loop.h index aa953d57e..6eddfc971 100644 --- a/src/poly/ui/win32/win32_loop.h +++ b/src/xenia/ui/win32/win32_loop.h @@ -7,8 +7,8 @@ ****************************************************************************** */ -#ifndef POLY_UI_WIN32_WIN32_LOOP_H_ -#define POLY_UI_WIN32_WIN32_LOOP_H_ +#ifndef XENIA_UI_WIN32_WIN32_LOOP_H_ +#define XENIA_UI_WIN32_WIN32_LOOP_H_ #include #include @@ -19,9 +19,9 @@ #include #include "poly/threading.h" -#include "poly/ui/loop.h" +#include "xenia/ui/loop.h" -namespace poly { +namespace xe { namespace ui { namespace win32 { @@ -45,6 +45,6 @@ class Win32Loop : public Loop { } // namespace win32 } // namespace ui -} // namespace poly +} // namespace xe -#endif // POLY_UI_WIN32_WIN32_LOOP_H_ +#endif // XENIA_UI_WIN32_WIN32_LOOP_H_ diff --git a/src/poly/ui/win32/win32_menu_item.cc b/src/xenia/ui/win32/win32_menu_item.cc similarity index 92% rename from src/poly/ui/win32/win32_menu_item.cc rename to src/xenia/ui/win32/win32_menu_item.cc index c0bc37ec0..c2371e39c 100644 --- a/src/poly/ui/win32/win32_menu_item.cc +++ b/src/xenia/ui/win32/win32_menu_item.cc @@ -7,9 +7,9 @@ ****************************************************************************** */ -#include "poly/ui/win32/win32_menu_item.h" +#include "xenia/ui/win32/win32_menu_item.h" -namespace poly { +namespace xe { namespace ui { namespace win32 { @@ -34,4 +34,4 @@ void Win32MenuItem::OnChildRemoved(MenuItem* generic_child_item) { } // namespace win32 } // namespace ui -} // namespace poly +} // namespace xe diff --git a/src/poly/ui/win32/win32_menu_item.h b/src/xenia/ui/win32/win32_menu_item.h similarity index 81% rename from src/poly/ui/win32/win32_menu_item.h rename to src/xenia/ui/win32/win32_menu_item.h index b155bacce..b592fbe7a 100644 --- a/src/poly/ui/win32/win32_menu_item.h +++ b/src/xenia/ui/win32/win32_menu_item.h @@ -7,15 +7,15 @@ ****************************************************************************** */ -#ifndef POLY_UI_WIN32_WIN32_MENU_ITEM_H_ -#define POLY_UI_WIN32_WIN32_MENU_ITEM_H_ +#ifndef XENIA_UI_WIN32_WIN32_MENU_ITEM_H_ +#define XENIA_UI_WIN32_WIN32_MENU_ITEM_H_ #include #include -#include "poly/ui/menu_item.h" +#include "xenia/ui/menu_item.h" -namespace poly { +namespace xe { namespace ui { namespace win32 { @@ -35,6 +35,6 @@ class Win32MenuItem : public MenuItem { } // namespace win32 } // namespace ui -} // namespace poly +} // namespace xe -#endif // POLY_UI_WIN32_WIN32_MENU_ITEM_H_ +#endif // XENIA_UI_WIN32_WIN32_MENU_ITEM_H_ diff --git a/src/poly/ui/win32/win32_window.cc b/src/xenia/ui/win32/win32_window.cc similarity index 96% rename from src/poly/ui/win32/win32_window.cc rename to src/xenia/ui/win32/win32_window.cc index 3f3a33e82..826d44ae0 100644 --- a/src/poly/ui/win32/win32_window.cc +++ b/src/xenia/ui/win32/win32_window.cc @@ -7,7 +7,7 @@ ****************************************************************************** */ -#include "poly/ui/win32/win32_window.h" +#include "xenia/ui/win32/win32_window.h" #include #include @@ -15,7 +15,7 @@ #include "poly/logging.h" -namespace poly { +namespace xe { namespace ui { namespace win32 { @@ -58,9 +58,8 @@ bool Win32Window::Create() { // Create window. hwnd_ = CreateWindowEx(window_ex_style, L"XeniaWindowClass", L"Xenia", - window_style, rc.left, rc.top, - rc.right - rc.left, rc.bottom - rc.top, nullptr, - nullptr, hInstance, this); + window_style, rc.left, rc.top, rc.right - rc.left, + rc.bottom - rc.top, nullptr, nullptr, hInstance, this); if (!hwnd_) { PLOGE("CreateWindow failed"); return false; @@ -210,4 +209,4 @@ LRESULT Win32Window::WndProc(HWND hWnd, UINT message, WPARAM wParam, } // namespace win32 } // namespace ui -} // namespace poly +} // namespace xe diff --git a/src/poly/ui/win32/win32_window.h b/src/xenia/ui/win32/win32_window.h similarity index 85% rename from src/poly/ui/win32/win32_window.h rename to src/xenia/ui/win32/win32_window.h index 5d172afca..af6d26965 100644 --- a/src/poly/ui/win32/win32_window.h +++ b/src/xenia/ui/win32/win32_window.h @@ -7,15 +7,15 @@ ****************************************************************************** */ -#ifndef POLY_UI_WIN32_WIN32_WINDOW_H_ -#define POLY_UI_WIN32_WIN32_WINDOW_H_ +#ifndef XENIA_UI_WIN32_WIN32_WINDOW_H_ +#define XENIA_UI_WIN32_WIN32_WINDOW_H_ #include -#include "poly/ui/win32/win32_control.h" -#include "poly/ui/window.h" +#include "xenia/ui/win32/win32_control.h" +#include "xenia/ui/window.h" -namespace poly { +namespace xe { namespace ui { namespace win32 { @@ -50,6 +50,6 @@ class Win32Window : public Window { } // namespace win32 } // namespace ui -} // namespace poly +} // namespace xe -#endif // POLY_UI_WIN32_WIN32_WINDOW_H_ +#endif // XENIA_UI_WIN32_WIN32_WINDOW_H_ diff --git a/src/poly/ui/window.h b/src/xenia/ui/window.h similarity index 90% rename from src/poly/ui/window.h rename to src/xenia/ui/window.h index 62302f548..6371a4af5 100644 --- a/src/poly/ui/window.h +++ b/src/xenia/ui/window.h @@ -7,16 +7,16 @@ ****************************************************************************** */ -#ifndef POLY_UI_WINDOW_H_ -#define POLY_UI_WINDOW_H_ +#ifndef XENIA_UI_WINDOW_H_ +#define XENIA_UI_WINDOW_H_ #include #include "poly/delegate.h" -#include "poly/ui/control.h" -#include "poly/ui/ui_event.h" +#include "xenia/ui/control.h" +#include "xenia/ui/ui_event.h" -namespace poly { +namespace xe { namespace ui { template @@ -79,6 +79,6 @@ class Window : public T { }; } // namespace ui -} // namespace poly +} // namespace xe -#endif // POLY_UI_WINDOW_H_ +#endif // XENIA_UI_WINDOW_H_