diff --git a/source/src/dt_app.cpp b/source/src/dt_app.cpp index 641bd03..3d17adf 100644 --- a/source/src/dt_app.cpp +++ b/source/src/dt_app.cpp @@ -1,9 +1,7 @@ #include "dt_app.hpp" -#include -#include -#include -#include +#include +#include using namespace dvsku_toolkit; using namespace dvsku; @@ -25,10 +23,6 @@ dt_gui_mngr& dt_app::get_gui() { return m_gui; } -void dt_app::close() { - dv_window::close(); -} - /////////////////////////////////////////////////////////////////////////////// // PRIVATE diff --git a/source/src/dt_app.hpp b/source/src/dt_app.hpp index e74714f..768e596 100644 --- a/source/src/dt_app.hpp +++ b/source/src/dt_app.hpp @@ -1,10 +1,9 @@ #pragma once -#include "systems\dt_system_mngr.hpp" -#include "gui\dt_gui_mngr.hpp" +#include "systems/dt_system_mngr.hpp" +#include "gui/dt_gui_mngr.hpp" -#include -#include +#include namespace dvsku_toolkit { class dt_app : public dvsku::dv_window { @@ -20,18 +19,12 @@ namespace dvsku_toolkit { public: dt_system_mngr& get_systems(); - dt_gui_mngr& get_gui(); - - void close(); + dt_gui_mngr& get_gui(); private: dt_system_mngr m_systems; dt_gui_mngr m_gui; - friend dt_comp_root; - friend dt_comp_pack; - friend dt_comp_unpack; - private: bool prepare() override final; void release() override final; diff --git a/source/src/dvsku_toolkit.cpp b/source/src/dvsku_toolkit.cpp index fda85b5..4b27e1e 100644 --- a/source/src/dvsku_toolkit.cpp +++ b/source/src/dvsku_toolkit.cpp @@ -14,7 +14,7 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, settings.enable_multi_viewport = true; dt_app app(settings); - app.run(); + app.show(); } catch (...) { return -1; diff --git a/source/src/gui/dt_comp_pack.cpp b/source/src/gui/dt_comp_pack.cpp index 195b92f..fafb806 100644 --- a/source/src/gui/dt_comp_pack.cpp +++ b/source/src/gui/dt_comp_pack.cpp @@ -1,8 +1,6 @@ #include "gui/dt_comp_pack.hpp" #include "dt_app.hpp" -#include - using namespace dvsku_toolkit; /////////////////////////////////////////////////////////////////////////////// @@ -32,17 +30,16 @@ dt_comp_pack::dt_comp_pack(dt_app& app) m_app.set_taskbar_progress(0U); if (result.status == libevp::evp_result_status::ok) { - m_app.play_sound(dvsku::dv_sound_type::success); + dvsku::dv_util_sound::success(); } else if (result.status == libevp::evp_result_status::error) { - m_app.play_sound(dvsku::dv_sound_type::warning); + dvsku::dv_util_sound::warning(); if (!result.message.empty()) { m_app.get_systems().core.has_errors = true; m_app.get_systems().core.errors = result.message; } - } - + } }; m_context.update_callback = [this](float progress) { std::lock_guard guard(m_app.get_systems().core.mutex); @@ -68,10 +65,7 @@ void dt_comp_pack::render() { ImGui::SameLine(0.0f, 5.0f); if (ImGui::Button("Select##Input", { 125.0f, 21.0f })) { - auto result = dvsku::dv_util_dialog::select_dir("Input dir", m_input); - - if (!result.empty()) - m_input = result; + m_input = dvsku::dv_util_dialog::select_dir("Input dir", m_input); } ImGui::Indent(3.0f); @@ -83,10 +77,7 @@ void dt_comp_pack::render() { ImGui::SameLine(0.0f, 5.0f); if (ImGui::Button("Select##Output", { 125.0f, 21.0f })) { - auto result = dvsku::dv_util_dialog::save_file("Output evp", m_output, true, { "EVP (*.evp)", "*.evp" }); - - if (!result.empty()) - m_output = result; + m_output = dvsku::dv_util_dialog::save_file("Output evp", m_output, true, { "EVP (*.evp)", "*.evp" }); } ImGui::Dummy({ 0.0f, 3.0f }); diff --git a/source/src/gui/dt_comp_root.cpp b/source/src/gui/dt_comp_root.cpp index 325d476..174454a 100644 --- a/source/src/gui/dt_comp_root.cpp +++ b/source/src/gui/dt_comp_root.cpp @@ -2,8 +2,6 @@ #include "dvsku_toolkit.hpp" #include "dt_app.hpp" -#include - using namespace dvsku_toolkit; /////////////////////////////////////////////////////////////////////////////// @@ -65,7 +63,7 @@ void dt_comp_root::render() { ImGui::SetCursorPosY(min.y); if (ImGui::Button(ICON_FA_MINUS"##Minimize", { 30.0f, 25.0f })) { - m_app.minimize(); + m_app.iconify(); } ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 6.0f, 6.0f }); @@ -94,7 +92,7 @@ void dt_comp_root::render() { } ImGui::EndChild(); - m_app.m_is_title_bar = ImGui::IsMouseHoveringRect(rectangle.Min, rectangle.Max); + m_app.get_title_bar().mouseover_title_bar = ImGui::IsMouseHoveringRect(rectangle.Min, rectangle.Max); /////////////////////////////////////////////////////////////////////////// // CONTENT diff --git a/source/src/gui/dt_comp_unpack.cpp b/source/src/gui/dt_comp_unpack.cpp index a73906f..26245b6 100644 --- a/source/src/gui/dt_comp_unpack.cpp +++ b/source/src/gui/dt_comp_unpack.cpp @@ -1,8 +1,6 @@ #include "gui/dt_comp_unpack.hpp" #include "dt_app.hpp" -#include - using namespace dvsku_toolkit; /////////////////////////////////////////////////////////////////////////////// @@ -32,10 +30,10 @@ dt_comp_unpack::dt_comp_unpack(dt_app& app) m_app.set_taskbar_progress(0U); if (result.status == libevp::evp_result_status::ok) { - m_app.play_sound(dvsku::dv_sound_type::success); + dvsku::dv_util_sound::success(); } else if (result.status == libevp::evp_result_status::error) { - m_app.play_sound(dvsku::dv_sound_type::warning); + dvsku::dv_util_sound::warning(); if (!result.message.empty()) { m_app.get_systems().core.has_errors = true; @@ -67,10 +65,7 @@ void dt_comp_unpack::render() { ImGui::SameLine(0.0f, 5.0f); if (ImGui::Button("Select##Input", { 125.0f, 21.0f })) { - auto result = dvsku::dv_util_dialog::open_file("Input evp", m_input, { "EVP (*.evp)", "*.evp" }); - - if (!result.empty()) - m_input = result[0]; + m_input = dvsku::dv_util_dialog::open_file("Input evp", m_input, { "EVP (*.evp)", "*.evp" }); } ImGui::Indent(3.0f); @@ -82,10 +77,7 @@ void dt_comp_unpack::render() { ImGui::SameLine(0.0f, 5.0f); if (ImGui::Button("Select##Output", { 125.0f, 21.0f })) { - auto result = dvsku::dv_util_dialog::select_dir("Output dir", m_output); - - if (!result.empty()) - m_output = result; + m_output = dvsku::dv_util_dialog::select_dir("Output dir", m_output); } ImGui::Dummy({ 0.0f, 10.0f }); diff --git a/source/src/gui/dt_modal_errors.cpp b/source/src/gui/dt_modal_errors.cpp index 1c91140..cce6b04 100644 --- a/source/src/gui/dt_modal_errors.cpp +++ b/source/src/gui/dt_modal_errors.cpp @@ -1,8 +1,6 @@ #include "gui/dt_modal_errors.hpp" #include "dt_app.hpp" -#include - using namespace dvsku_toolkit; using namespace dvsku; diff --git a/source/src/gui/dt_modal_errors.hpp b/source/src/gui/dt_modal_errors.hpp index 0e366f8..c91dfae 100644 --- a/source/src/gui/dt_modal_errors.hpp +++ b/source/src/gui/dt_modal_errors.hpp @@ -2,7 +2,7 @@ #include "gui/dt_gui_base.hpp" -#include +#include namespace dvsku_toolkit { class dt_modal_errors : public dt_gui_base { diff --git a/source/src/systems/dt_sys_command.hpp b/source/src/systems/dt_sys_command.hpp index cc2f51c..6885ed6 100644 --- a/source/src/systems/dt_sys_command.hpp +++ b/source/src/systems/dt_sys_command.hpp @@ -2,7 +2,7 @@ #include "systems/dt_system_base.hpp" -#include +#include namespace dvsku_toolkit { class dt_app; diff --git a/source/src/systems/dt_sys_core.hpp b/source/src/systems/dt_sys_core.hpp index 99c67e7..fbd7cae 100644 --- a/source/src/systems/dt_sys_core.hpp +++ b/source/src/systems/dt_sys_core.hpp @@ -2,7 +2,7 @@ #include "systems/dt_system_base.hpp" -#include +#include #include namespace dvsku_toolkit {