From f81f4e5e78b9fee6a8b728f526f391e2a0e91957 Mon Sep 17 00:00:00 2001 From: chatlanin Date: Thu, 2 Mar 2023 15:25:58 +0300 Subject: [PATCH] add try_engine --- .gitignore | 1 + bin/main.cpp | 4 +- meson.build | 1 + src/core/application/application.cpp | 54 -- src/core/application/application.hpp | 40 - src/core/core.hpp | 14 - .../event/app_event/category/event_type.hpp | 13 - src/core/event/app_event/event.hpp | 33 - src/core/event/event_classificator.hpp | 13 - .../event/system_event/category/key_event.hpp | 38 - .../system_event/category/window_event.hpp | 49 -- src/core/event/system_event/event.hpp | 14 - src/core/gui/gui.cpp | 60 -- src/core/gui/gui.hpp | 17 - src/core/gui/style/fonts.hpp | 46 -- src/core/gui/style/icons.hpp | 719 ------------------ src/core/gui/style/style.hpp | 82 -- src/core/layer/layer.hpp | 33 - src/core/meson.build | 32 - src/core/renderer/renderer.cpp | 14 - src/core/renderer/renderer.hpp | 22 - src/core/renderer/texture/texture.cpp | 27 - src/core/renderer/texture/texture.hpp | 26 - src/core/utils/define.hpp | 67 -- src/core/utils/include.hpp | 40 - src/core/utils/timestap.hpp | 22 - src/core/utils/variable.hpp | 10 - .../graphic_context/graphic_context.cpp | 27 - .../graphic_context/graphic_context.hpp | 18 - src/core/window/window.cpp | 158 ---- src/core/window/window.hpp | 46 -- .../layers/gui/browser/preview/preview.cpp | 49 -- src/engine/sandbox/demo.hpp | 45 -- src/meson.build | 3 +- src/{engine => rrr}/buffer/buffer.hpp | 2 +- src/{engine => rrr}/content/content.cpp | 2 +- src/{engine => rrr}/content/content.hpp | 2 +- src/{engine => rrr}/content/file/file.cpp | 2 +- src/{engine => rrr}/content/file/file.hpp | 4 +- .../content/history/history.cpp | 2 +- .../content/history/history.hpp | 4 +- .../content/navigation/navigation.cpp | 2 +- .../content/navigation/navigation.hpp | 4 +- .../content/preview/preview.cpp | 2 +- .../content/preview/preview.hpp | 4 +- .../layers/gui/browser/history/history.cpp | 14 +- .../layers/gui/browser/history/history.hpp | 10 +- .../gui/browser/navigation/navigation.cpp | 32 +- .../gui/browser/navigation/navigation.hpp | 15 +- .../layers/gui/browser/preview/preview.cpp | 45 ++ .../layers/gui/browser/preview/preview.hpp | 10 +- src/{engine => rrr}/meson.build | 2 +- src/{engine/engine.hpp => rrr/rrr.hpp} | 33 +- subprojects/try_engine.wrap | 6 + 54 files changed, 129 insertions(+), 1905 deletions(-) delete mode 100644 src/core/application/application.cpp delete mode 100644 src/core/application/application.hpp delete mode 100644 src/core/core.hpp delete mode 100644 src/core/event/app_event/category/event_type.hpp delete mode 100644 src/core/event/app_event/event.hpp delete mode 100644 src/core/event/event_classificator.hpp delete mode 100644 src/core/event/system_event/category/key_event.hpp delete mode 100644 src/core/event/system_event/category/window_event.hpp delete mode 100644 src/core/event/system_event/event.hpp delete mode 100644 src/core/gui/gui.cpp delete mode 100644 src/core/gui/gui.hpp delete mode 100644 src/core/gui/style/fonts.hpp delete mode 100644 src/core/gui/style/icons.hpp delete mode 100644 src/core/gui/style/style.hpp delete mode 100644 src/core/layer/layer.hpp delete mode 100644 src/core/meson.build delete mode 100644 src/core/renderer/renderer.cpp delete mode 100644 src/core/renderer/renderer.hpp delete mode 100644 src/core/renderer/texture/texture.cpp delete mode 100644 src/core/renderer/texture/texture.hpp delete mode 100644 src/core/utils/define.hpp delete mode 100644 src/core/utils/include.hpp delete mode 100644 src/core/utils/timestap.hpp delete mode 100644 src/core/utils/variable.hpp delete mode 100644 src/core/window/graphic_context/graphic_context.cpp delete mode 100644 src/core/window/graphic_context/graphic_context.hpp delete mode 100644 src/core/window/window.cpp delete mode 100644 src/core/window/window.hpp delete mode 100644 src/engine/layers/gui/browser/preview/preview.cpp delete mode 100644 src/engine/sandbox/demo.hpp rename src/{engine => rrr}/buffer/buffer.hpp (97%) rename src/{engine => rrr}/content/content.cpp (97%) rename src/{engine => rrr}/content/content.hpp (98%) rename src/{engine => rrr}/content/file/file.cpp (98%) rename src/{engine => rrr}/content/file/file.hpp (98%) rename src/{engine => rrr}/content/history/history.cpp (88%) rename src/{engine => rrr}/content/history/history.hpp (75%) rename src/{engine => rrr}/content/navigation/navigation.cpp (90%) rename src/{engine => rrr}/content/navigation/navigation.hpp (82%) rename src/{engine => rrr}/content/preview/preview.cpp (87%) rename src/{engine => rrr}/content/preview/preview.hpp (73%) rename src/{engine => rrr}/layers/gui/browser/history/history.cpp (55%) rename src/{engine => rrr}/layers/gui/browser/history/history.hpp (72%) rename src/{engine => rrr}/layers/gui/browser/navigation/navigation.cpp (61%) rename src/{engine => rrr}/layers/gui/browser/navigation/navigation.hpp (65%) create mode 100644 src/rrr/layers/gui/browser/preview/preview.cpp rename src/{engine => rrr}/layers/gui/browser/preview/preview.hpp (72%) rename src/{engine => rrr}/meson.build (98%) rename src/{engine/engine.hpp => rrr/rrr.hpp} (59%) create mode 100644 subprojects/try_engine.wrap diff --git a/.gitignore b/.gitignore index 782dcf1..6f43f81 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ subprojects/* !subprojects/glm.wrap !subprojects/gtest.wrap !subprojects/hack.wrap +!subprojects/try_engine.wrap !subprojects/imgui.wrap !subprojects/nlohmann_json.wrap !subprojects/taglib.wrap diff --git a/bin/main.cpp b/bin/main.cpp index b95267f..86292d1 100644 --- a/bin/main.cpp +++ b/bin/main.cpp @@ -1,7 +1,7 @@ -#include "engine/engine.hpp" +#include "rrr/rrr.hpp" auto main(int argc, char* args[]) -> int { - decltype(auto) app = tr::core::create_app(); + decltype(auto) app = try_engine::create(); app.run(); } diff --git a/meson.build b/meson.build index 6ea5ea4..9157828 100644 --- a/meson.build +++ b/meson.build @@ -42,6 +42,7 @@ deps = [ subproject('glfw').get_variable('glfw_dep'), subproject('glad').get_variable('glad_dep'), subproject('hack').get_variable('logger_dep'), + subproject('try_engine').get_variable('try_engine_dep'), subproject('imgui').get_variable('imgui_dep'), subproject('glm').get_variable('glm_dep'), subproject('nlohmann_json').get_variable('nlohmann_json_dep'), diff --git a/src/core/application/application.cpp b/src/core/application/application.cpp deleted file mode 100644 index 5cc809f..0000000 --- a/src/core/application/application.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "application.hpp" - -#include "utils/define.hpp" - -namespace tr::core -{ - application::application() - { - instance = std::unique_ptr(this); - - win = std::make_unique(); - win->set_event_callback(BIND_EVENT_FN(application, on_event)); - - ui = std::make_unique(); - } - - void application::run() - { - while(!glfwWindowShouldClose(win->glfw_window())) - { - win->clear(); - - for (auto l : l_stack) - l->on_update(time::get_time()); - - ui->begin_frame(); - for (auto l : l_stack) - l->gui_render(); - ui->end_frame(); - - win->update(); - } - } - - std::unique_ptr& application::get_window() - { - return win; - } - - std::unique_ptr& application::get() - { - return instance; - } - - void application::attach_layers() - { - for (auto l : l_stack) l->on_attach(); - } - - void application::on_event(system_event::event& e) - { - for(const auto l : l_stack) l->on_event(e); - } -} diff --git a/src/core/application/application.hpp b/src/core/application/application.hpp deleted file mode 100644 index 20ee2a5..0000000 --- a/src/core/application/application.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include "core/window/window.hpp" -#include "core/gui/gui.hpp" -#include "core/layer/layer.hpp" - -namespace tr::core -{ - class application - { - using layers_stack = std::vector; - - public: - application(); - virtual ~application() = default; - - public: - void run(); - void attach_layers(); - std::unique_ptr& get_window(); - static std::unique_ptr& get(); - - public: - template - void push_layer(Args*... args) { (l_stack.push_back(args), ...); } - - private: - inline static std::unique_ptr instance = nullptr; - std::unique_ptr win; - layers_stack l_stack; - - private: - void clear(); - std::unique_ptr ui; - void on_event(system_event::event& e); - }; - - // реализация см. engine - application& create_app(); -} diff --git a/src/core/core.hpp b/src/core/core.hpp deleted file mode 100644 index e0622ce..0000000 --- a/src/core/core.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "core/gui/style/style.hpp" - -#include "core/application/application.hpp" - -#include "event/event_classificator.hpp" -#include "event/system_event/event.hpp" -#include "event/app_event/event.hpp" - -#include "core/renderer/renderer.hpp" -#include "core/renderer/texture/texture.hpp" - -#include "utils/timestap.hpp" diff --git a/src/core/event/app_event/category/event_type.hpp b/src/core/event/app_event/category/event_type.hpp deleted file mode 100644 index 3deabe1..0000000 --- a/src/core/event/app_event/category/event_type.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "core/utils/define.hpp" -#include "core/event/system_event/event.hpp" - -namespace tr::core::app_event -{ - enum class event_type : unsigned int - { - NONE = 0, - SET_LOG, - }; -} diff --git a/src/core/event/app_event/event.hpp b/src/core/event/app_event/event.hpp deleted file mode 100644 index a2fbfe3..0000000 --- a/src/core/event/app_event/event.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include -#include "core/layer/layer.hpp" -#include "category/event_type.hpp" - -namespace tr::core::app_event -{ - using layers_stack = std::vector; - - class event - { - public: - void set_event_callback(layer* l) - { - l_stack.push_back(l); - }; - - void execute(event_type type, std::any value) - { - tbb::parallel_for(tbb::blocked_range(0, l_stack.size()), [&](tbb::blocked_range r) - { - for (int i = r.begin(); i < r.end(); ++i) - l_stack[i]->on_event(type, value); - }); - } - - void print_size(); - - private: - layers_stack l_stack; - }; -} diff --git a/src/core/event/event_classificator.hpp b/src/core/event/event_classificator.hpp deleted file mode 100644 index 77dafce..0000000 --- a/src/core/event/event_classificator.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "core/utils/include.hpp" - -namespace tr::core::system_event::classificator -{ - inline std::string WINDOW_RESIZE() { return "WINDOW_RESIZE"; } - inline std::string WINDOW_CLOSE() { return "WINDOW_CLOSE"; } - inline std::string WINDOW_FOCUS() { return "WINDOW_FOCUS"; } - - inline std::string KEY_PRESSED() { return "KEY_PRESSED"; } - inline std::string KEY_RELEASED() { return "KEY_RELEASED"; } -} diff --git a/src/core/event/system_event/category/key_event.hpp b/src/core/event/system_event/category/key_event.hpp deleted file mode 100644 index c45e0ad..0000000 --- a/src/core/event/system_event/category/key_event.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "utils/define.hpp" -#include "core/event/system_event/event.hpp" -#include "core/event/event_classificator.hpp" - -namespace tr::core::system_event -{ - class key_event : public event - { - protected: - key_event(int kc) : keycode { kc } {} - - public: - inline int get_keycode() const { return keycode; } - - protected: - int keycode; - }; - - class key_pressed_event : public key_event - { - public: - key_pressed_event(int keycode) : key_event(keycode) {} - - public: - EVENT_CLASS_TYPE_FN(classificator::KEY_PRESSED()) - }; - - class key_released_event : public key_event - { - public: - key_released_event(int keycode) : key_event(keycode) {} - - public: - EVENT_CLASS_TYPE_FN(classificator::KEY_RELEASED()) - }; -} diff --git a/src/core/event/system_event/category/window_event.hpp b/src/core/event/system_event/category/window_event.hpp deleted file mode 100644 index 9c767ec..0000000 --- a/src/core/event/system_event/category/window_event.hpp +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#include "utils/define.hpp" -#include "core/event/system_event/event.hpp" -#include "core/event/event_classificator.hpp" - -namespace tr::core::system_event -{ - class window_resize_event : public event - { - public: - window_resize_event(int w, int h) : width { w }, height { h } {} - - public: - EVENT_CLASS_TYPE_FN(classificator::WINDOW_RESIZE()) - - public: - inline unsigned int get_width() const { return width; } - inline unsigned int get_height() const { return height; } - - private: - int width, height; - }; - - class window_close_event : public event - { - public: - window_close_event() = default; - - public: - EVENT_CLASS_TYPE_FN(classificator::WINDOW_CLOSE()) - }; - - class window_focus_event : public event - { - public: - window_focus_event(int f) : focused { f } {} - - public: - EVENT_CLASS_TYPE_FN(classificator::WINDOW_FOCUS()) - - public: - inline int get_focused() { return focused; } - - private: - int focused; - }; -} - diff --git a/src/core/event/system_event/event.hpp b/src/core/event/system_event/event.hpp deleted file mode 100644 index 427872c..0000000 --- a/src/core/event/system_event/event.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "utils/utils.hpp" - -namespace tr::core::system_event -{ - struct event - { - event() = default; - virtual ~event() = default; - - virtual std::string get_name() const = 0; - }; -} diff --git a/src/core/gui/gui.cpp b/src/core/gui/gui.cpp deleted file mode 100644 index 3cbec26..0000000 --- a/src/core/gui/gui.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "gui.hpp" - -#include "style/style.hpp" -#include "core/application/application.hpp" - -namespace tr::core -{ - gui::gui() - { - IMGUI_CHECKVERSION(); - - ImGui::CreateContext(); - ImGui::StyleColorsDark(); - - ImGuiIO& io = ImGui::GetIO(); (void)io; - io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; - io.IniFilename = nullptr; - - ImGuiStyle& style = ImGui::GetStyle(); - if (io.ConfigFlags) - { - style.WindowRounding = 0.0f; - style.Colors[ImGuiCol_WindowBg].w = 1.0f; - } - - auto& app = application::get(); - GLFWwindow* window = app->get_window()->glfw_window(); - - ImGui_ImplGlfw_InitForOpenGL(window, true); - ImGui_ImplOpenGL3_Init("#version 410"); - - style::init(); - } - - gui::~gui() - { - ImGui_ImplOpenGL3_Shutdown(); - ImGui_ImplGlfw_Shutdown(); - ImGui::DestroyContext(); - } - - void gui::begin_frame() - { - ImGui_ImplOpenGL3_NewFrame(); - ImGui_ImplGlfw_NewFrame(); - ImGui::NewFrame(); - } - - void gui::end_frame() - { - ImGuiIO& io = ImGui::GetIO(); - auto& app = application::get(); - io.DisplaySize = ImVec2((float)app->get_window()->width(), (float)app->get_window()->height()); - - ImGui::Render(); - ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); - } -} - - diff --git a/src/core/gui/gui.hpp b/src/core/gui/gui.hpp deleted file mode 100644 index 756af6f..0000000 --- a/src/core/gui/gui.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "core/utils/include.hpp" - -namespace tr::core -{ - class gui - { - public: - gui(); - ~gui(); - - public: - void begin_frame(); - void end_frame(); - }; -} diff --git a/src/core/gui/style/fonts.hpp b/src/core/gui/style/fonts.hpp deleted file mode 100644 index a1813b4..0000000 --- a/src/core/gui/style/fonts.hpp +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include - -#include "imgui.h" - -#include "icons.hpp" - -namespace tr::core::style::fonts -{ - enum font { TEXT_R_0, TEXT_REG_15, TEXT_REG_175, TEXT_REG_2, TEXT_BOLD_0, TEXT_BOLD_2, ICON_0, ICON_05, ICON_075, ICON_2 }; - - // HERE - // эту порнографию с путями нужно решить - inline const std::string PATH = "/mnt/develop/projects/cpp/fonmix/emuse.v.2.0.0/src/core/internal/"; - - inline void init() - { - ImGuiIO& io = ImGui::GetIO(); - float size_pixels = 16.0f; - static const ImWchar icon_ranges[] = { ICON_MIN_FK, ICON_MAX_FK, 0 }; - - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/Ruda/Ruda-Regular.ttf")).c_str(), size_pixels, NULL, io.Fonts->GetGlyphRangesCyrillic()); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/Ruda/Ruda-Regular.ttf")).c_str(), size_pixels * 1.5f, NULL, io.Fonts->GetGlyphRangesCyrillic()); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/Ruda/Ruda-Regular.ttf")).c_str(), size_pixels * 1.75f, NULL, io.Fonts->GetGlyphRangesCyrillic()); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/Ruda/Ruda-Regular.ttf")).c_str(), size_pixels * 2.0f, NULL, io.Fonts->GetGlyphRangesCyrillic()); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/Ruda/Ruda-Bold.ttf")).c_str(), size_pixels, NULL, io.Fonts->GetGlyphRangesCyrillic()); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/Ruda/Ruda-Bold.ttf")).c_str(), size_pixels * 2.0f, NULL, io.Fonts->GetGlyphRangesCyrillic()); - - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/forkawesome-webfont.ttf")).c_str(), size_pixels, NULL, icon_ranges); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/forkawesome-webfont.ttf")).c_str(), size_pixels * 0.50f, NULL, icon_ranges); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/forkawesome-webfont.ttf")).c_str(), size_pixels * 0.75f, NULL, icon_ranges); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/forkawesome-webfont.ttf")).c_str(), size_pixels * 1.1f, NULL, icon_ranges); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/forkawesome-webfont.ttf")).c_str(), size_pixels * 1.25f, NULL, icon_ranges); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/forkawesome-webfont.ttf")).c_str(), size_pixels * 1.5f, NULL, icon_ranges); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/forkawesome-webfont.ttf")).c_str(), size_pixels * 1.65f, NULL, icon_ranges); - io.Fonts->AddFontFromFileTTF((PATH + std::string("/fonts/forkawesome-webfont.ttf")).c_str(), size_pixels * 2.0f, NULL, icon_ranges); - }; - - inline ImFont* GetFont(font f = font::TEXT_R_0) - { - ImGuiIO& io = ImGui::GetIO(); - ImFontAtlas* atlas = io.Fonts; - return atlas->Fonts[f]; - }; -} diff --git a/src/core/gui/style/icons.hpp b/src/core/gui/style/icons.hpp deleted file mode 100644 index 35c5501..0000000 --- a/src/core/gui/style/icons.hpp +++ /dev/null @@ -1,719 +0,0 @@ -#pragma once - -// for use with https://github.com/ForkAwesome/Fork-Awesome/blob/master/fonts/forkawesome-webfont.ttf -#define ICON_MIN_FK 0xf000 -#define ICON_MAX_FK 0xf307 - -namespace tr::core::style::icon -{ - inline const char* ICON_GLASS = "\uf000"; - inline const char* ICON_MUSIC = "\uf001"; - inline const char* ICON_SEARCH = "\uf002"; - inline const char* ICON_ENVELOPE_O = "\uf003"; - inline const char* ICON_HEART = "\uf004"; - inline const char* ICON_STAR = "\uf005"; - inline const char* ICON_STAR_O = "\uf006"; - inline const char* ICON_USER = "\uf007"; - inline const char* ICON_FILM = "\uf008"; - inline const char* ICON_TH_LARGE = "\uf009"; - inline const char* ICON_TH = "\uf00a"; - inline const char* ICON_TH_LIST = "\uf00b"; - inline const char* ICON_CHECK = "\uf00c"; - inline const char* ICON_TIMES = "\uf00d"; - inline const char* ICON_SEARCH_PLUS = "\uf00e"; - inline const char* ICON_SEARCH_MINUS = "\uf010"; - inline const char* ICON_POWER_OFF = "\uf011"; - inline const char* ICON_SIGNAL = "\uf012"; - inline const char* ICON_COG = "\uf013"; - inline const char* ICON_TRASH_O = "\uf014"; - inline const char* ICON_HOME = "\uf015"; - inline const char* ICON_FILE_O = "\uf016"; - inline const char* ICON_CLOCK_O = "\uf017"; - inline const char* ICON_ROAD = "\uf018"; - inline const char* ICON_DOWNLOAD = "\uf019"; - inline const char* ICON_ARROW_CIRCLE_O_DOWN = "\uf01a"; - inline const char* ICON_ARROW_CIRCLE_O_UP = "\uf01b"; - inline const char* ICON_INBOX = "\uf01c"; - inline const char* ICON_PLAY_CIRCLE_O = "\uf01d"; - inline const char* ICON_REPEAT = "\uf01e"; - inline const char* ICON_REFRESH = "\uf021"; - inline const char* ICON_LIST_ALT = "\uf022"; - inline const char* ICON_LOCK = "\uf023"; - inline const char* ICON_FLAG = "\uf024"; - inline const char* ICON_HEADPHONES = "\uf025"; - inline const char* ICON_VOLUME_OFF = "\uf026"; - inline const char* ICON_VOLUME_DOWN = "\uf027"; - inline const char* ICON_VOLUME_UP = "\uf028"; - inline const char* ICON_QRCODE = "\uf029"; - inline const char* ICON_BARCODE = "\uf02a"; - inline const char* ICON_TAG = "\uf02b"; - inline const char* ICON_TAGS = "\uf02c"; - inline const char* ICON_BOOK = "\uf02d"; - inline const char* ICON_BOOKMARK = "\uf02e"; - inline const char* ICON_PRINT = "\uf02f"; - inline const char* ICON_CAMERA = "\uf030"; - inline const char* ICON_FONT = "\uf031"; - inline const char* ICON_BOLD = "\uf032"; - inline const char* ICON_ITALIC = "\uf033"; - inline const char* ICON_TEXT_HEIGHT = "\uf034"; - inline const char* ICON_TEXT_WIDTH = "\uf035"; - inline const char* ICON_ALIGN_LEFT = "\uf036"; - inline const char* ICON_ALIGN_CENTER = "\uf037"; - inline const char* ICON_ALIGN_RIGHT = "\uf038"; - inline const char* ICON_ALIGN_JUSTIFY = "\uf039"; - inline const char* ICON_LIST = "\uf03a"; - inline const char* ICON_OUTDENT = "\uf03b"; - inline const char* ICON_INDENT = "\uf03c"; - inline const char* ICON_VIDEO_CAMERA = "\uf03d"; - inline const char* ICON_PICTURE_O = "\uf03e"; - inline const char* ICON_PENCIL = "\uf040"; - inline const char* ICON_MAP_MARKER = "\uf041"; - inline const char* ICON_ADJUST = "\uf042"; - inline const char* ICON_TINT = "\uf043"; - inline const char* ICON_PENCIL_SQUARE_O = "\uf044"; - inline const char* ICON_SHARE_SQUARE_O = "\uf045"; - inline const char* ICON_CHECK_SQUARE_O = "\uf046"; - inline const char* ICON_ARROWS = "\uf047"; - inline const char* ICON_STEP_BACKWARD = "\uf048"; - inline const char* ICON_FAST_BACKWARD = "\uf049"; - inline const char* ICON_BACKWARD = "\uf04a"; - inline const char* ICON_PLAY = "\uf04b"; - inline const char* ICON_PAUSE = "\uf04c"; - inline const char* ICON_STOP = "\uf04d"; - inline const char* ICON_FORWARD = "\uf04e"; - inline const char* ICON_FAST_FORWARD = "\uf050"; - inline const char* ICON_STEP_FORWARD = "\uf051"; - inline const char* ICON_EJECT = "\uf052"; - inline const char* ICON_CHEVRON_LEFT = "\uf053"; - inline const char* ICON_CHEVRON_RIGHT = "\uf054"; - inline const char* ICON_PLUS_CIRCLE = "\uf055"; - inline const char* ICON_MINUS_CIRCLE = "\uf056"; - inline const char* ICON_TIMES_CIRCLE = "\uf057"; - inline const char* ICON_CHECK_CIRCLE = "\uf058"; - inline const char* ICON_QUESTION_CIRCLE = "\uf059"; - inline const char* ICON_INFO_CIRCLE = "\uf05a"; - inline const char* ICON_CROSSHAIRS = "\uf05b"; - inline const char* ICON_TIMES_CIRCLE_O = "\uf05c"; - inline const char* ICON_CHECK_CIRCLE_O = "\uf05d"; - inline const char* ICON_BAN = "\uf05e"; - inline const char* ICON_ARROW_LEFT = "\uf060"; - inline const char* ICON_ARROW_RIGHT = "\uf061"; - inline const char* ICON_ARROW_UP = "\uf062"; - inline const char* ICON_ARROW_DOWN = "\uf063"; - inline const char* ICON_SHARE = "\uf064"; - inline const char* ICON_EXPAND = "\uf065"; - inline const char* ICON_COMPRESS = "\uf066"; - inline const char* ICON_PLUS = "\uf067"; - inline const char* ICON_MINUS = "\uf068"; - inline const char* ICON_ASTERISK = "\uf069"; - inline const char* ICON_EXCLAMATION_CIRCLE = "\uf06a"; - inline const char* ICON_GIFT = "\uf06b"; - inline const char* ICON_LEAF = "\uf06c"; - inline const char* ICON_FIRE = "\uf06d"; - inline const char* ICON_EYE = "\uf06e"; - inline const char* ICON_EYE_SLASH = "\uf070"; - inline const char* ICON_EXCLAMATION_TRIANGLE = "\uf071"; - inline const char* ICON_PLANE = "\uf072"; - inline const char* ICON_CALENDAR = "\uf073"; - inline const char* ICON_RANDOM = "\uf074"; - inline const char* ICON_COMMENT = "\uf075"; - inline const char* ICON_MAGNET = "\uf076"; - inline const char* ICON_CHEVRON_UP = "\uf077"; - inline const char* ICON_CHEVRON_DOWN = "\uf078"; - inline const char* ICON_RETWEET = "\uf079"; - inline const char* ICON_SHOPPING_CART = "\uf07a"; - inline const char* ICON_FOLDER = "\uf07b"; - inline const char* ICON_FOLDER_OPEN = "\uf07c"; - inline const char* ICON_ARROWS_V = "\uf07d"; - inline const char* ICON_ARROWS_H = "\uf07e"; - inline const char* ICON_BAR_CHART = "\uf080"; - inline const char* ICON_TWITTER_SQUARE = "\uf081"; - inline const char* ICON_FACEBOOK_SQUARE = "\uf082"; - inline const char* ICON_CAMERA_RETRO = "\uf083"; - inline const char* ICON_KEY = "\uf084"; - inline const char* ICON_COGS = "\uf085"; - inline const char* ICON_COMMENTS = "\uf086"; - inline const char* ICON_THUMBS_O_UP = "\uf087"; - inline const char* ICON_THUMBS_O_DOWN = "\uf088"; - inline const char* ICON_STAR_HALF = "\uf089"; - inline const char* ICON_HEART_O = "\uf08a"; - inline const char* ICON_SIGN_OUT = "\uf08b"; - inline const char* ICON_LINKEDIN_SQUARE = "\uf08c"; - inline const char* ICON_THUMB_TACK = "\uf08d"; - inline const char* ICON_inlineAL_LINK = "\uf08e"; - inline const char* ICON_SIGN_IN = "\uf090"; - inline const char* ICON_TROPHY = "\uf091"; - inline const char* ICON_GITHUB_SQUARE = "\uf092"; - inline const char* ICON_UPLOAD = "\uf093"; - inline const char* ICON_LEMON_O = "\uf094"; - inline const char* ICON_PHONE = "\uf095"; - inline const char* ICON_SQUARE_O = "\uf096"; - inline const char* ICON_BOOKMARK_O = "\uf097"; - inline const char* ICON_PHONE_SQUARE = "\uf098"; - inline const char* ICON_TWITTER = "\uf099"; - inline const char* ICON_FACEBOOK = "\uf09a"; - inline const char* ICON_GITHUB = "\uf09b"; - inline const char* ICON_UNLOCK = "\uf09c"; - inline const char* ICON_CREDIT_CARD = "\uf09d"; - inline const char* ICON_RSS = "\uf09e"; - inline const char* ICON_HDD_O = "\uf0a0"; - inline const char* ICON_BULLHORN = "\uf0a1"; - inline const char* ICON_BELL = "\uf0f3"; - inline const char* ICON_CERTIFICATE = "\uf0a3"; - inline const char* ICON_HAND_O_RIGHT = "\uf0a4"; - inline const char* ICON_HAND_O_LEFT = "\uf0a5"; - inline const char* ICON_HAND_O_UP = "\uf0a6"; - inline const char* ICON_HAND_O_DOWN = "\uf0a7"; - inline const char* ICON_ARROW_CIRCLE_LEFT = "\uf0a8"; - inline const char* ICON_ARROW_CIRCLE_RIGHT = "\uf0a9"; - inline const char* ICON_ARROW_CIRCLE_UP = "\uf0aa"; - inline const char* ICON_ARROW_CIRCLE_DOWN = "\uf0ab"; - inline const char* ICON_GLOBE = "\uf0ac"; - inline const char* ICON_GLOBE_E = "\uf304"; - inline const char* ICON_GLOBE_W = "\uf305"; - inline const char* ICON_WRENCH = "\uf0ad"; - inline const char* ICON_TASKS = "\uf0ae"; - inline const char* ICON_FILTER = "\uf0b0"; - inline const char* ICON_BRIEFCASE = "\uf0b1"; - inline const char* ICON_ARROWS_ALT = "\uf0b2"; - inline const char* ICON_USERS = "\uf0c0"; - inline const char* ICON_LINK = "\uf0c1"; - inline const char* ICON_CLOUD = "\uf0c2"; - inline const char* ICON_FLASK = "\uf0c3"; - inline const char* ICON_SCISSORS = "\uf0c4"; - inline const char* ICON_FILES_O = "\uf0c5"; - inline const char* ICON_PAPERCLIP = "\uf0c6"; - inline const char* ICON_FLOPPY_O = "\uf0c7"; - inline const char* ICON_SQUARE = "\uf0c8"; - inline const char* ICON_BARS = "\uf0c9"; - inline const char* ICON_LIST_UL = "\uf0ca"; - inline const char* ICON_LIST_OL = "\uf0cb"; - inline const char* ICON_STRIKETHROUGH = "\uf0cc"; - inline const char* ICON_UNDERLINE = "\uf0cd"; - inline const char* ICON_TABLE = "\uf0ce"; - inline const char* ICON_MAGIC = "\uf0d0"; - inline const char* ICON_TRUCK = "\uf0d1"; - inline const char* ICON_PINTEREST = "\uf0d2"; - inline const char* ICON_PINTEREST_SQUARE = "\uf0d3"; - inline const char* ICON_GOOGLE_PLUS_SQUARE = "\uf0d4"; - inline const char* ICON_GOOGLE_PLUS = "\uf0d5"; - inline const char* ICON_MONEY = "\uf0d6"; - inline const char* ICON_CARET_DOWN = "\uf0d7"; - inline const char* ICON_CARET_UP = "\uf0d8"; - inline const char* ICON_CARET_LEFT = "\uf0d9"; - inline const char* ICON_CARET_RIGHT = "\uf0da"; - inline const char* ICON_COLUMNS = "\uf0db"; - inline const char* ICON_SORT = "\uf0dc"; - inline const char* ICON_SORT_DESC = "\uf0dd"; - inline const char* ICON_SORT_ASC = "\uf0de"; - inline const char* ICON_ENVELOPE = "\uf0e0"; - inline const char* ICON_LINKEDIN = "\uf0e1"; - inline const char* ICON_UNDO = "\uf0e2"; - inline const char* ICON_GAVEL = "\uf0e3"; - inline const char* ICON_TACHOMETER = "\uf0e4"; - inline const char* ICON_COMMENT_O = "\uf0e5"; - inline const char* ICON_COMMENTS_O = "\uf0e6"; - inline const char* ICON_BOLT = "\uf0e7"; - inline const char* ICON_SITEMAP = "\uf0e8"; - inline const char* ICON_UMBRELLA = "\uf0e9"; - inline const char* ICON_CLIPBOARD = "\uf0ea"; - inline const char* ICON_LIGHTBULB_O = "\uf0eb"; - inline const char* ICON_EXCHANGE = "\uf0ec"; - inline const char* ICON_CLOUD_DOWNLOAD = "\uf0ed"; - inline const char* ICON_CLOUD_UPLOAD = "\uf0ee"; - inline const char* ICON_USER_MD = "\uf0f0"; - inline const char* ICON_STETHOSCOPE = "\uf0f1"; - inline const char* ICON_SUITCASE = "\uf0f2"; - inline const char* ICON_BELL_O = "\uf0a2"; - inline const char* ICON_COFFEE = "\uf0f4"; - inline const char* ICON_CUTLERY = "\uf0f5"; - inline const char* ICON_FILE_TEXT_O = "\uf0f6"; - inline const char* ICON_BUILDING_O = "\uf0f7"; - inline const char* ICON_HOSPITAL_O = "\uf0f8"; - inline const char* ICON_AMBULANCE = "\uf0f9"; - inline const char* ICON_MEDKIT = "\uf0fa"; - inline const char* ICON_FIGHTER_JET = "\uf0fb"; - inline const char* ICON_BEER = "\uf0fc"; - inline const char* ICON_H_SQUARE = "\uf0fd"; - inline const char* ICON_PLUS_SQUARE = "\uf0fe"; - inline const char* ICON_ANGLE_DOUBLE_LEFT = "\uf100"; - inline const char* ICON_ANGLE_DOUBLE_RIGHT = "\uf101"; - inline const char* ICON_ANGLE_DOUBLE_UP = "\uf102"; - inline const char* ICON_ANGLE_DOUBLE_DOWN = "\uf103"; - inline const char* ICON_ANGLE_LEFT = "\uf104"; - inline const char* ICON_ANGLE_RIGHT = "\uf105"; - inline const char* ICON_ANGLE_UP = "\uf106"; - inline const char* ICON_ANGLE_DOWN = "\uf107"; - inline const char* ICON_DESKTOP = "\uf108"; - inline const char* ICON_LAPTOP = "\uf109"; - inline const char* ICON_TABLET = "\uf10a"; - inline const char* ICON_MOBILE = "\uf10b"; - inline const char* ICON_CIRCLE_O = "\uf10c"; - inline const char* ICON_QUOTE_LEFT = "\uf10d"; - inline const char* ICON_QUOTE_RIGHT = "\uf10e"; - inline const char* ICON_SPINNER = "\uf110"; - inline const char* ICON_CIRCLE = "\uf111"; - inline const char* ICON_REPLY = "\uf112"; - inline const char* ICON_GITHUB_ALT = "\uf113"; - inline const char* ICON_FOLDER_O = "\uf114"; - inline const char* ICON_FOLDER_OPEN_O = "\uf115"; - inline const char* ICON_SMILE_O = "\uf118"; - inline const char* ICON_FROWN_O = "\uf119"; - inline const char* ICON_MEH_O = "\uf11a"; - inline const char* ICON_GAMEPAD = "\uf11b"; - inline const char* ICON_KEYBOARD_O = "\uf11c"; - inline const char* ICON_FLAG_O = "\uf11d"; - inline const char* ICON_FLAG_CHECKERED = "\uf11e"; - inline const char* ICON_TERMINAL = "\uf120"; - inline const char* ICON_CODE = "\uf121"; - inline const char* ICON_REPLY_ALL = "\uf122"; - inline const char* ICON_STAR_HALF_O = "\uf123"; - inline const char* ICON_LOCATION_ARROW = "\uf124"; - inline const char* ICON_CROP = "\uf125"; - inline const char* ICON_CODE_FORK = "\uf126"; - inline const char* ICON_CHAIN_BROKEN = "\uf127"; - inline const char* ICON_QUESTION = "\uf128"; - inline const char* ICON_INFO = "\uf129"; - inline const char* ICON_EXCLAMATION = "\uf12a"; - inline const char* ICON_SUPERSCRIPT = "\uf12b"; - inline const char* ICON_SUBSCRIPT = "\uf12c"; - inline const char* ICON_ERASER = "\uf12d"; - inline const char* ICON_PUZZLE_PIECE = "\uf12e"; - inline const char* ICON_MICROPHONE = "\uf130"; - inline const char* ICON_MICROPHONE_SLASH = "\uf131"; - inline const char* ICON_SHIELD = "\uf132"; - inline const char* ICON_CALENDAR_O = "\uf133"; - inline const char* ICON_FIRE_EXTINGUISHER = "\uf134"; - inline const char* ICON_ROCKET = "\uf135"; - inline const char* ICON_MAXCDN = "\uf136"; - inline const char* ICON_CHEVRON_CIRCLE_LEFT = "\uf137"; - inline const char* ICON_CHEVRON_CIRCLE_RIGHT = "\uf138"; - inline const char* ICON_CHEVRON_CIRCLE_UP = "\uf139"; - inline const char* ICON_CHEVRON_CIRCLE_DOWN = "\uf13a"; - inline const char* ICON_HTML5 = "\uf13b"; - inline const char* ICON_CSS3 = "\uf13c"; - inline const char* ICON_ANCHOR = "\uf13d"; - inline const char* ICON_UNLOCK_ALT = "\uf13e"; - inline const char* ICON_BULLSEYE = "\uf140"; - inline const char* ICON_ELLIPSIS_H = "\uf141"; - inline const char* ICON_ELLIPSIS_V = "\uf142"; - inline const char* ICON_RSS_SQUARE = "\uf143"; - inline const char* ICON_PLAY_CIRCLE = "\uf144"; - inline const char* ICON_TICKET = "\uf145"; - inline const char* ICON_MINUS_SQUARE = "\uf146"; - inline const char* ICON_MINUS_SQUARE_O = "\uf147"; - inline const char* ICON_LEVEL_UP = "\uf148"; - inline const char* ICON_LEVEL_DOWN = "\uf149"; - inline const char* ICON_CHECK_SQUARE = "\uf14a"; - inline const char* ICON_PENCIL_SQUARE = "\uf14b"; - inline const char* ICON_inlineAL_LINK_SQUARE = "\uf14c"; - inline const char* ICON_SHARE_SQUARE = "\uf14d"; - inline const char* ICON_COMPASS = "\uf14e"; - inline const char* ICON_CARET_SQUARE_O_DOWN = "\uf150"; - inline const char* ICON_CARET_SQUARE_O_UP = "\uf151"; - inline const char* ICON_CARET_SQUARE_O_RIGHT = "\uf152"; - inline const char* ICON_EUR = "\uf153"; - inline const char* ICON_GBP = "\uf154"; - inline const char* ICON_USD = "\uf155"; - inline const char* ICON_INR = "\uf156"; - inline const char* ICON_JPY = "\uf157"; - inline const char* ICON_RUB = "\uf158"; - inline const char* ICON_KRW = "\uf159"; - inline const char* ICON_BTC = "\uf15a"; - inline const char* ICON_FILE = "\uf15b"; - inline const char* ICON_FILE_TEXT = "\uf15c"; - inline const char* ICON_SORT_ALPHA_ASC = "\uf15d"; - inline const char* ICON_SORT_ALPHA_DESC = "\uf15e"; - inline const char* ICON_SORT_AMOUNT_ASC = "\uf160"; - inline const char* ICON_SORT_AMOUNT_DESC = "\uf161"; - inline const char* ICON_SORT_NUMERIC_ASC = "\uf162"; - inline const char* ICON_SORT_NUMERIC_DESC = "\uf163"; - inline const char* ICON_THUMBS_UP = "\uf164"; - inline const char* ICON_THUMBS_DOWN = "\uf165"; - inline const char* ICON_YOUTUBE_SQUARE = "\uf166"; - inline const char* ICON_YOUTUBE = "\uf167"; - inline const char* ICON_XING = "\uf168"; - inline const char* ICON_XING_SQUARE = "\uf169"; - inline const char* ICON_YOUTUBE_PLAY = "\uf16a"; - inline const char* ICON_DROPBOX = "\uf16b"; - inline const char* ICON_STACK_OVERFLOW = "\uf16c"; - inline const char* ICON_INSTAGRAM = "\uf16d"; - inline const char* ICON_FLICKR = "\uf16e"; - inline const char* ICON_ADN = "\uf170"; - inline const char* ICON_BITBUCKET = "\uf171"; - inline const char* ICON_BITBUCKET_SQUARE = "\uf172"; - inline const char* ICON_TUMBLR = "\uf173"; - inline const char* ICON_TUMBLR_SQUARE = "\uf174"; - inline const char* ICON_LONG_ARROW_DOWN = "\uf175"; - inline const char* ICON_LONG_ARROW_UP = "\uf176"; - inline const char* ICON_LONG_ARROW_LEFT = "\uf177"; - inline const char* ICON_LONG_ARROW_RIGHT = "\uf178"; - inline const char* ICON_APPLE = "\uf179"; - inline const char* ICON_PROJECTS = "\uf17a"; - inline const char* ICON_ANDROID = "\uf17b"; - inline const char* ICON_LINUX = "\uf17c"; - inline const char* ICON_DRIBBBLE = "\uf17d"; - inline const char* ICON_SKYPE = "\uf17e"; - inline const char* ICON_FOURSQUARE = "\uf180"; - inline const char* ICON_TRELLO = "\uf181"; - inline const char* ICON_FEMALE = "\uf182"; - inline const char* ICON_MALE = "\uf183"; - inline const char* ICON_GRATIPAY = "\uf184"; - inline const char* ICON_SUN_O = "\uf185"; - inline const char* ICON_MOON_O = "\uf186"; - inline const char* ICON_ARCHIVE = "\uf187"; - inline const char* ICON_BUG = "\uf188"; - inline const char* ICON_VK = "\uf189"; - inline const char* ICON_WEIBO = "\uf18a"; - inline const char* ICON_RENREN = "\uf18b"; - inline const char* ICON_PAGELINES = "\uf18c"; - inline const char* ICON_STACK_EXCHANGE = "\uf18d"; - inline const char* ICON_ARROW_CIRCLE_O_RIGHT = "\uf18e"; - inline const char* ICON_ARROW_CIRCLE_O_LEFT = "\uf190"; - inline const char* ICON_CARET_SQUARE_O_LEFT = "\uf191"; - inline const char* ICON_DOT_CIRCLE_O = "\uf192"; - inline const char* ICON_WHEELCHAIR = "\uf193"; - inline const char* ICON_VIMEO_SQUARE = "\uf194"; - inline const char* ICON_TRY = "\uf195"; - inline const char* ICON_PLUS_SQUARE_O = "\uf196"; - inline const char* ICON_SPACE_SHUTTLE = "\uf197"; - inline const char* ICON_SLACK = "\uf198"; - inline const char* ICON_ENVELOPE_SQUARE = "\uf199"; - inline const char* ICON_WORDPRESS = "\uf19a"; - inline const char* ICON_OPENID = "\uf19b"; - inline const char* ICON_UNIVERSITY = "\uf19c"; - inline const char* ICON_GRADUATION_CAP = "\uf19d"; - inline const char* ICON_YAHOO = "\uf19e"; - inline const char* ICON_GOOGLE = "\uf1a0"; - inline const char* ICON_REDDIT = "\uf1a1"; - inline const char* ICON_REDDIT_SQUARE = "\uf1a2"; - inline const char* ICON_STUMBLEUPON_CIRCLE = "\uf1a3"; - inline const char* ICON_STUMBLEUPON = "\uf1a4"; - inline const char* ICON_DELICIOUS = "\uf1a5"; - inline const char* ICON_DIGG = "\uf1a6"; - inline const char* ICON_DRUPAL = "\uf1a9"; - inline const char* ICON_JOOMLA = "\uf1aa"; - inline const char* ICON_LANGUAGE = "\uf1ab"; - inline const char* ICON_FAX = "\uf1ac"; - inline const char* ICON_BUILDING = "\uf1ad"; - inline const char* ICON_CHILD = "\uf1ae"; - inline const char* ICON_PAW = "\uf1b0"; - inline const char* ICON_SPOON = "\uf1b1"; - inline const char* ICON_CUBE = "\uf1b2"; - inline const char* ICON_CUBES = "\uf1b3"; - inline const char* ICON_BEHANCE = "\uf1b4"; - inline const char* ICON_BEHANCE_SQUARE = "\uf1b5"; - inline const char* ICON_STEAM = "\uf1b6"; - inline const char* ICON_STEAM_SQUARE = "\uf1b7"; - inline const char* ICON_RECYCLE = "\uf1b8"; - inline const char* ICON_CAR = "\uf1b9"; - inline const char* ICON_TAXI = "\uf1ba"; - inline const char* ICON_TREE = "\uf1bb"; - inline const char* ICON_SPOTIFY = "\uf1bc"; - inline const char* ICON_DEVIANTART = "\uf1bd"; - inline const char* ICON_SOUNDCLOUD = "\uf1be"; - inline const char* ICON_DATABASE = "\uf1c0"; - inline const char* ICON_FILE_PDF_O = "\uf1c1"; - inline const char* ICON_FILE_WORD_O = "\uf1c2"; - inline const char* ICON_FILE_EXCEL_O = "\uf1c3"; - inline const char* ICON_FILE_POWERPOINT_O = "\uf1c4"; - inline const char* ICON_SAVE = "\uf0c7"; - inline const char* ICON_FILE_IMAGE_O = "\uf1c5"; - inline const char* ICON_FILE_ARCHIVE_O = "\uf1c6"; - inline const char* ICON_FILE_AUDIO_O = "\uf1c7"; - inline const char* ICON_FILE_VIDEO_O = "\uf1c8"; - inline const char* ICON_FILE_CODE_O = "\uf1c9"; - inline const char* ICON_VINE = "\uf1ca"; - inline const char* ICON_CODEPEN = "\uf1cb"; - inline const char* ICON_JSFIDDLE = "\uf1cc"; - inline const char* ICON_LIFE_RING = "\uf1cd"; - inline const char* ICON_CIRCLE_O_NOTCH = "\uf1ce"; - inline const char* ICON_REBEL = "\uf1d0"; - inline const char* ICON_EMPIRE = "\uf1d1"; - inline const char* ICON_GIT_SQUARE = "\uf1d2"; - inline const char* ICON_GIT = "\uf1d3"; - inline const char* ICON_HACKER_NEWS = "\uf1d4"; - inline const char* ICON_TENCENT_WEIBO = "\uf1d5"; - inline const char* ICON_QQ = "\uf1d6"; - inline const char* ICON_WEIXIN = "\uf1d7"; - inline const char* ICON_PAPER_PLANE = "\uf1d8"; - inline const char* ICON_PAPER_PLANE_O = "\uf1d9"; - inline const char* ICON_HISTORY = "\uf1da"; - inline const char* ICON_CIRCLE_THIN = "\uf1db"; - inline const char* ICON_HEADER = "\uf1dc"; - inline const char* ICON_PARAGRAPH = "\uf1dd"; - inline const char* ICON_SLIDERS = "\uf1de"; - inline const char* ICON_SHARE_ALT = "\uf1e0"; - inline const char* ICON_SHARE_ALT_SQUARE = "\uf1e1"; - inline const char* ICON_BOMB = "\uf1e2"; - inline const char* ICON_FUTBOL_O = "\uf1e3"; - inline const char* ICON_TTY = "\uf1e4"; - inline const char* ICON_BINOCULARS = "\uf1e5"; - inline const char* ICON_PLUG = "\uf1e6"; - inline const char* ICON_SLIDESHARE = "\uf1e7"; - inline const char* ICON_TWITCH = "\uf1e8"; - inline const char* ICON_YELP = "\uf1e9"; - inline const char* ICON_NEWSPAPER_O = "\uf1ea"; - inline const char* ICON_WIFI = "\uf1eb"; - inline const char* ICON_CALCULATOR = "\uf1ec"; - inline const char* ICON_PAYPAL = "\uf1ed"; - inline const char* ICON_GOOGLE_WALLET = "\uf1ee"; - inline const char* ICON_CC_VISA = "\uf1f0"; - inline const char* ICON_CC_MASTERCARD = "\uf1f1"; - inline const char* ICON_CC_DISCOVER = "\uf1f2"; - inline const char* ICON_CC_AMEX = "\uf1f3"; - inline const char* ICON_CC_PAYPAL = "\uf1f4"; - inline const char* ICON_CC_STRIPE = "\uf1f5"; - inline const char* ICON_BELL_SLASH = "\uf1f6"; - inline const char* ICON_BELL_SLASH_O = "\uf1f7"; - inline const char* ICON_TRASH = "\uf1f8"; - inline const char* ICON_COPYRIGHT = "\uf1f9"; - inline const char* ICON_AT = "\uf1fa"; - inline const char* ICON_EYEDROPPER = "\uf1fb"; - inline const char* ICON_PAINT_BRUSH = "\uf1fc"; - inline const char* ICON_BIRTHDAY_CAKE = "\uf1fd"; - inline const char* ICON_AREA_CHART = "\uf1fe"; - inline const char* ICON_PIE_CHART = "\uf200"; - inline const char* ICON_LINE_CHART = "\uf201"; - inline const char* ICON_LASTFM = "\uf202"; - inline const char* ICON_LASTFM_SQUARE = "\uf203"; - inline const char* ICON_TOGGLE_OFF = "\uf204"; - inline const char* ICON_TOGGLE_ON = "\uf205"; - inline const char* ICON_BICYCLE = "\uf206"; - inline const char* ICON_BUS = "\uf207"; - inline const char* ICON_IOXHOST = "\uf208"; - inline const char* ICON_ANGELLIST = "\uf209"; - inline const char* ICON_CC = "\uf20a"; - inline const char* ICON_ILS = "\uf20b"; - inline const char* ICON_MEANPATH = "\uf20c"; - inline const char* ICON_BUYSELLADS = "\uf20d"; - inline const char* ICON_CONNECTDEVELOP = "\uf20e"; - inline const char* ICON_DASHCUBE = "\uf210"; - inline const char* ICON_FORUMBEE = "\uf211"; - inline const char* ICON_LEANPUB = "\uf212"; - inline const char* ICON_SELLSY = "\uf213"; - inline const char* ICON_SHIRTSINBULK = "\uf214"; - inline const char* ICON_SIMPLYBUILT = "\uf215"; - inline const char* ICON_SKYATLAS = "\uf216"; - inline const char* ICON_CART_PLUS = "\uf217"; - inline const char* ICON_CART_ARROW_DOWN = "\uf218"; - inline const char* ICON_DIAMOND = "\uf219"; - inline const char* ICON_SHIP = "\uf21a"; - inline const char* ICON_USER_SECRET = "\uf21b"; - inline const char* ICON_MOTORCYCLE = "\uf21c"; - inline const char* ICON_STREET_VIEW = "\uf21d"; - inline const char* ICON_HEARTBEAT = "\uf21e"; - inline const char* ICON_VENUS = "\uf221"; - inline const char* ICON_MARS = "\uf222"; - inline const char* ICON_MERCURY = "\uf223"; - inline const char* ICON_TRANSGENDER = "\uf224"; - inline const char* ICON_TRANSGENDER_ALT = "\uf225"; - inline const char* ICON_VENUS_DOUBLE = "\uf226"; - inline const char* ICON_MARS_DOUBLE = "\uf227"; - inline const char* ICON_VENUS_MARS = "\uf228"; - inline const char* ICON_MARS_STROKE = "\uf229"; - inline const char* ICON_MARS_STROKE_V = "\uf22a"; - inline const char* ICON_MARS_STROKE_H = "\uf22b"; - inline const char* ICON_NEUTER = "\uf22c"; - inline const char* ICON_GENDERLESS = "\uf22d"; - inline const char* ICON_FACEBOOK_OFFICIAL = "\uf230"; - inline const char* ICON_PINTEREST_P = "\uf231"; - inline const char* ICON_WHATSAPP = "\uf232"; - inline const char* ICON_SERVER = "\uf233"; - inline const char* ICON_USER_PLUS = "\uf234"; - inline const char* ICON_USER_TIMES = "\uf235"; - inline const char* ICON_BED = "\uf236"; - inline const char* ICON_VIACOIN = "\uf237"; - inline const char* ICON_TRAIN = "\uf238"; - inline const char* ICON_SUBWAY = "\uf239"; - inline const char* ICON_MEDIUM = "\uf23a"; - inline const char* ICON_MEDIUM_SQUARE = "\uf2f8"; - inline const char* ICON_Y_COMBINATOR = "\uf23b"; - inline const char* ICON_OPTIN_MONSTER = "\uf23c"; - inline const char* ICON_OPENCART = "\uf23d"; - inline const char* ICON_EXPEDITEDSSL = "\uf23e"; - inline const char* ICON_BATTERY_FULL = "\uf240"; - inline const char* ICON_BATTERY_THREE_QUARTERS = "\uf241"; - inline const char* ICON_BATTERY_HALF = "\uf242"; - inline const char* ICON_BATTERY_QUARTER = "\uf243"; - inline const char* ICON_BATTERY_EMPTY = "\uf244"; - inline const char* ICON_MOUSE_POINTER = "\uf245"; - inline const char* ICON_I_CURSOR = "\uf246"; - inline const char* ICON_OBJECT_GROUP = "\uf247"; - inline const char* ICON_OBJECT_UNGROUP = "\uf248"; - inline const char* ICON_STICKY_NOTE = "\uf249"; - inline const char* ICON_STICKY_NOTE_O = "\uf24a"; - inline const char* ICON_CC_JCB = "\uf24b"; - inline const char* ICON_CC_DINERS_CLUB = "\uf24c"; - inline const char* ICON_CLONE = "\uf24d"; - inline const char* ICON_BALANCE_SCALE = "\uf24e"; - inline const char* ICON_HOURGLASS_O = "\uf250"; - inline const char* ICON_HOURGLASS_START = "\uf251"; - inline const char* ICON_HOURGLASS_HALF = "\uf252"; - inline const char* ICON_HOURGLASS_END = "\uf253"; - inline const char* ICON_HOURGLASS = "\uf254"; - inline const char* ICON_HAND_ROCK_O = "\uf255"; - inline const char* ICON_HAND_PAPER_O = "\uf256"; - inline const char* ICON_HAND_SCISSORS_O = "\uf257"; - inline const char* ICON_HAND_LIZARD_O = "\uf258"; - inline const char* ICON_HAND_SPOCK_O = "\uf259"; - inline const char* ICON_HAND_POINTER_O = "\uf25a"; - inline const char* ICON_HAND_PEACE_O = "\uf25b"; - inline const char* ICON_TRADEMARK = "\uf25c"; - inline const char* ICON_REGISTERED = "\uf25d"; - inline const char* ICON_CREATIVE_COMMONS = "\uf25e"; - inline const char* ICON_GG = "\uf260"; - inline const char* ICON_GG_CIRCLE = "\uf261"; - inline const char* ICON_TRIPADVISOR = "\uf262"; - inline const char* ICON_ODNOKLASSNIKI = "\uf263"; - inline const char* ICON_ODNOKLASSNIKI_SQUARE = "\uf264"; - inline const char* ICON_GET_POCKET = "\uf265"; - inline const char* ICON_WIKIPEDIA_W = "\uf266"; - inline const char* ICON_SAFARI = "\uf267"; - inline const char* ICON_CHROME = "\uf268"; - inline const char* ICON_FIREFOX = "\uf269"; - inline const char* ICON_OPERA = "\uf26a"; - inline const char* ICON_INTERNET_EXPLORER = "\uf26b"; - inline const char* ICON_TELEVISION = "\uf26c"; - inline const char* ICON_CONTAO = "\uf26d"; - inline const char* ICON_500PX = "\uf26e"; - inline const char* ICON_AMAZON = "\uf270"; - inline const char* ICON_CALENDAR_PLUS_O = "\uf271"; - inline const char* ICON_CALENDAR_MINUS_O = "\uf272"; - inline const char* ICON_CALENDAR_TIMES_O = "\uf273"; - inline const char* ICON_CALENDAR_CHECK_O = "\uf274"; - inline const char* ICON_INDUSTRY = "\uf275"; - inline const char* ICON_MAP_PIN = "\uf276"; - inline const char* ICON_MAP_SIGNS = "\uf277"; - inline const char* ICON_MAP_O = "\uf278"; - inline const char* ICON_MAP = "\uf279"; - inline const char* ICON_COMMENTING = "\uf27a"; - inline const char* ICON_COMMENTING_O = "\uf27b"; - inline const char* ICON_HOUZZ = "\uf27c"; - inline const char* ICON_VIMEO = "\uf27d"; - inline const char* ICON_BLACK_TIE = "\uf27e"; - inline const char* ICON_FONTICONS = "\uf280"; - inline const char* ICON_REDDIT_ALIEN = "\uf281"; - inline const char* ICON_EDGE = "\uf282"; - inline const char* ICON_CREDIT_CARD_ALT = "\uf283"; - inline const char* ICON_CODIEPIE = "\uf284"; - inline const char* ICON_MODX = "\uf285"; - inline const char* ICON_FORT_AWESOME = "\uf286"; - inline const char* ICON_USB = "\uf287"; - inline const char* ICON_PRODUCT_HUNT = "\uf288"; - inline const char* ICON_MIXCLOUD = "\uf289"; - inline const char* ICON_SCRIBD = "\uf28a"; - inline const char* ICON_PAUSE_CIRCLE = "\uf28b"; - inline const char* ICON_PAUSE_CIRCLE_O = "\uf28c"; - inline const char* ICON_STOP_CIRCLE = "\uf28d"; - inline const char* ICON_STOP_CIRCLE_O = "\uf28e"; - inline const char* ICON_SHOPPING_BAG = "\uf290"; - inline const char* ICON_SHOPPING_BASKET = "\uf291"; - inline const char* ICON_HASHTAG = "\uf292"; - inline const char* ICON_BLUETOOTH = "\uf293"; - inline const char* ICON_BLUETOOTH_B = "\uf294"; - inline const char* ICON_PERCENT = "\uf295"; - inline const char* ICON_GITLAB = "\uf296"; - inline const char* ICON_WPBEGINNER = "\uf297"; - inline const char* ICON_WPFORMS = "\uf298"; - inline const char* ICON_ENVIRA = "\uf299"; - inline const char* ICON_UNIVERSAL_ACCESS = "\uf29a"; - inline const char* ICON_WHEELCHAIR_ALT = "\uf29b"; - inline const char* ICON_QUESTION_CIRCLE_O = "\uf29c"; - inline const char* ICON_BLIND = "\uf29d"; - inline const char* ICON_AUDIO_DESCRIPTION = "\uf29e"; - inline const char* ICON_VOLUME_CONTROL_PHONE = "\uf2a0"; - inline const char* ICON_BRAILLE = "\uf2a1"; - inline const char* ICON_ASSISTIVE_LISTENING_SYSTEMS = "\uf2a2"; - inline const char* ICON_AMERICAN_SIGN_LANGUAGE_INTERPRETING = "\uf2a3"; - inline const char* ICON_DEAF = "\uf2a4"; - inline const char* ICON_GLIDE = "\uf2a5"; - inline const char* ICON_GLIDE_G = "\uf2a6"; - inline const char* ICON_SIGN_LANGUAGE = "\uf2a7"; - inline const char* ICON_LOW_VISION = "\uf2a8"; - inline const char* ICON_VIADEO = "\uf2a9"; - inline const char* ICON_VIADEO_SQUARE = "\uf2aa"; - inline const char* ICON_SNAPCHAT = "\uf2ab"; - inline const char* ICON_SNAPCHAT_GHOST = "\uf2ac"; - inline const char* ICON_SNAPCHAT_SQUARE = "\uf2ad"; - inline const char* ICON_FIRST_ORDER = "\uf2b0"; - inline const char* ICON_YOAST = "\uf2b1"; - inline const char* ICON_THEMEISLE = "\uf2b2"; - inline const char* ICON_GOOGLE_PLUS_OFFICIAL = "\uf2b3"; - inline const char* ICON_FONT_AWESOME = "\uf2b4"; - inline const char* ICON_HANDSHAKE_O = "\uf2b5"; - inline const char* ICON_ENVELOPE_OPEN = "\uf2b6"; - inline const char* ICON_ENVELOPE_OPEN_O = "\uf2b7"; - inline const char* ICON_LINODE = "\uf2b8"; - inline const char* ICON_ADDRESS_BOOK = "\uf2b9"; - inline const char* ICON_ADDRESS_BOOK_O = "\uf2ba"; - inline const char* ICON_ADDRESS_CARD = "\uf2bb"; - inline const char* ICON_ADDRESS_CARD_O = "\uf2bc"; - inline const char* ICON_USER_CIRCLE = "\uf2bd"; - inline const char* ICON_USER_CIRCLE_O = "\uf2be"; - inline const char* ICON_USER_O = "\uf2c0"; - inline const char* ICON_ID_BADGE = "\uf2c1"; - inline const char* ICON_ID_CARD = "\uf2c2"; - inline const char* ICON_ID_CARD_O = "\uf2c3"; - inline const char* ICON_QUORA = "\uf2c4"; - inline const char* ICON_FREE_CODE_CAMP = "\uf2c5"; - inline const char* ICON_TELEGRAM = "\uf2c6"; - inline const char* ICON_THERMOMETER_FULL = "\uf2c7"; - inline const char* ICON_THERMOMETER_THREE_QUARTERS = "\uf2c8"; - inline const char* ICON_THERMOMETER_HALF = "\uf2c9"; - inline const char* ICON_THERMOMETER_QUARTER = "\uf2ca"; - inline const char* ICON_THERMOMETER_EMPTY = "\uf2cb"; - inline const char* ICON_SHOWER = "\uf2cc"; - inline const char* ICON_BATH = "\uf2cd"; - inline const char* ICON_PODCAST = "\uf2ce"; - inline const char* ICON_WINDOW_MAXIMIZE = "\uf2d0"; - inline const char* ICON_WINDOW_MINIMIZE = "\uf2d1"; - inline const char* ICON_WINDOW_RESTORE = "\uf2d2"; - inline const char* ICON_WINDOW_CLOSE = "\uf2d3"; - inline const char* ICON_WINDOW_CLOSE_O = "\uf2d4"; - inline const char* ICON_BANDCAMP = "\uf2d5"; - inline const char* ICON_GRAV = "\uf2d6"; - inline const char* ICON_ETSY = "\uf2d7"; - inline const char* ICON_IMDB = "\uf2d8"; - inline const char* ICON_RAVELRY = "\uf2d9"; - inline const char* ICON_EERCAST = "\uf2da"; - inline const char* ICON_MICROCHIP = "\uf2db"; - inline const char* ICON_SNOWFLAKE_O = "\uf2dc"; - inline const char* ICON_SUPERPOWERS = "\uf2dd"; - inline const char* ICON_WPEXPLORER = "\uf2de"; - inline const char* ICON_MEETUP = "\uf2e0"; - inline const char* ICON_MASTODON = "\uf2e1"; - inline const char* ICON_MASTODON_ALT = "\uf2e2"; - inline const char* ICON_FORK_AWESOME = "\uf2e3"; - inline const char* ICON_PEERTUBE = "\uf2e4"; - inline const char* ICON_DIASPORA = "\uf2e5"; - inline const char* ICON_FRIENDICA = "\uf2e6"; - inline const char* ICON_GNU_SOCIAL = "\uf2e7"; - inline const char* ICON_LIBERAPAY_SQUARE = "\uf2e8"; - inline const char* ICON_LIBERAPAY = "\uf2e9"; - inline const char* ICON_SCUTTLEBUTT = "\uf2ea"; - inline const char* ICON_HUBZILLA = "\uf2eb"; - inline const char* ICON_SOCIAL_HOME = "\uf2ec"; - inline const char* ICON_ARTSTATION = "\uf2ed"; - inline const char* ICON_DISCORD = "\uf2ee"; - inline const char* ICON_DISCORD_ALT = "\uf2ef"; - inline const char* ICON_PATREON = "\uf2f0"; - inline const char* ICON_SNOWDRIFT = "\uf2f1"; - inline const char* ICON_ACTIVITYPUB = "\uf2f2"; - inline const char* ICON_ETHEREUM = "\uf2f3"; - inline const char* ICON_KEYBASE = "\uf2f4"; - inline const char* ICON_SHAARLI = "\uf2f5"; - inline const char* ICON_SHAARLI_O = "\uf2f6"; - inline const char* ICON_KEY_MODERN = "\uf2f7"; - inline const char* ICON_XMPP = "\uf2f9"; - inline const char* ICON_ARCHIVE_ORG = "\uf2fc"; - inline const char* ICON_FREEDOMBOX = "\uf2fd"; - inline const char* ICON_FACEBOOK_MESSENGER = "\uf2fe"; - inline const char* ICON_DEBIAN = "\uf2ff"; - inline const char* ICON_MASTODON_SQUARE = "\uf300"; - inline const char* ICON_TIPEEE = "\uf301"; - inline const char* ICON_REACT = "\uf302"; - inline const char* ICON_DOGMAZIC = "\uf303"; - inline const char* ICON_NEXTCLOUD = "\uf306"; - inline const char* ICON_NEXTCLOUD_SQUARE = "\uf307"; -} // namespace Icon diff --git a/src/core/gui/style/style.hpp b/src/core/gui/style/style.hpp deleted file mode 100644 index bc41e7b..0000000 --- a/src/core/gui/style/style.hpp +++ /dev/null @@ -1,82 +0,0 @@ -#pragma once - -#include "imgui.h" - -#include "icons.hpp" -#include "fonts.hpp" - -namespace tr::core::style -{ - inline void init() - { - /* use this - https://www.unknowncheats.me/forum/c-and-c-/189635-imgui-style-settings.html */ - ImGuiStyle& st = ImGui::GetStyle(); - - st.WindowPadding = ImVec2(5.0f, 5.0f); - st.WindowRounding = 0.0f; - st.FramePadding = ImVec2(5.0f, 5.0f); - st.FrameRounding = 0.0f; - st.ItemSpacing = ImVec2(8.0f, 8.0f); - st.ItemInnerSpacing = ImVec2(8.0f, 6.0f); - st.IndentSpacing = 25.0f; - st.ScrollbarSize = 12.0f; - st.ScrollbarRounding = 0.0f; - st.GrabMinSize = 5.0f; - st.GrabRounding = 0.0f; - st.TabRounding = 0.0f; - st.WindowBorderSize = 0.0f; - st.ChildRounding = 0.0f; - st.PopupRounding = 0.0f; - st.PopupBorderSize = 0.0f; - st.WindowMenuButtonPosition = ImGuiDir_None; - - /* tab */ - st.Colors[ImGuiCol_Tab] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); - st.Colors[ImGuiCol_TabHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_TabActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - - /* title */ - st.Colors[ImGuiCol_TitleBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); - st.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); - st.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f); - - st.Colors[ImGuiCol_Text] = ImVec4(0.80f, 0.80f, 0.83f, 1.00f); - st.Colors[ImGuiCol_TextDisabled] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); - st.Colors[ImGuiCol_ChildBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); - st.Colors[ImGuiCol_PopupBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f); - st.Colors[ImGuiCol_Border] = ImVec4(0.80f, 0.80f, 0.83f, 0.88f); - st.Colors[ImGuiCol_BorderShadow] = ImVec4(0.92f, 0.91f, 0.88f, 0.00f); - st.Colors[ImGuiCol_FrameBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); - st.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); - st.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); - st.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f); - st.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); - st.Colors[ImGuiCol_CheckMark] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f); - st.Colors[ImGuiCol_SliderGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f); - st.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); - st.Colors[ImGuiCol_Button] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); - st.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_ButtonActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_Header] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_HeaderActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); - st.Colors[ImGuiCol_Separator] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_SeparatorHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_SeparatorActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - st.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - st.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); - st.Colors[ImGuiCol_PlotLines] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f); - st.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f); - st.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f); - st.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f); - st.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.25f, 1.00f, 0.00f, 0.43f); - st.Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(1.00f, 0.98f, 0.95f, 0.73f); - st.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.00f); - - fonts::init(); - }; -}; diff --git a/src/core/layer/layer.hpp b/src/core/layer/layer.hpp deleted file mode 100644 index 58df856..0000000 --- a/src/core/layer/layer.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include "core/utils/include.hpp" -#include "core/event/system_event/event.hpp" -#include "core/event/app_event/category/event_type.hpp" - -namespace tr::core -{ - class layer - { - using time = time::timestep; - - public: - layer(const std::string& name_) : name { name_ } {}; - virtual ~layer() = default; - - layer(const layer&) = delete; - layer(layer&) = delete; - - public: - virtual void on_attach() {}; - virtual void on_detach() {}; - virtual void gui_render() {}; - virtual void on_event(system_event::event&) {}; - virtual void on_event(app_event::event_type, std::any) {}; - virtual void on_update(time) = 0; - const std::string& get_name() const { return name; }; - - protected: - std::string name; - }; -} - diff --git a/src/core/meson.build b/src/core/meson.build deleted file mode 100644 index fc17d83..0000000 --- a/src/core/meson.build +++ /dev/null @@ -1,32 +0,0 @@ -headers = [ - 'application/application.hpp', - 'window/window.hpp', - 'window/graphic_context/graphic_context.hpp', - 'renderer/renderer.hpp', - 'renderer/texture/texture.hpp', - 'gui/gui.hpp', -] - -sources = [ - 'application/application.cpp', - 'window/window.cpp', - 'window/graphic_context/graphic_context.cpp', - 'renderer/renderer.cpp', - 'renderer/texture/texture.cpp', - 'gui/gui.cpp', -] - -lib = library( - 'core', - include_directories : inc, - sources: [headers, sources], - dependencies : deps, - cpp_args: args -) - -core_dep = declare_dependency( - include_directories: inc, - link_with: lib, -) - -deps += core_dep diff --git a/src/core/renderer/renderer.cpp b/src/core/renderer/renderer.cpp deleted file mode 100644 index ec64292..0000000 --- a/src/core/renderer/renderer.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "renderer.hpp" - -namespace tr::core -{ - void renderer::set_color(const glm::vec4& color) - { - glClearColor(color.r, color.g, color.b, color.a); - } - - void renderer::clear() - { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - } -} diff --git a/src/core/renderer/renderer.hpp b/src/core/renderer/renderer.hpp deleted file mode 100644 index 3bac019..0000000 --- a/src/core/renderer/renderer.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "core/utils/include.hpp" - -/* -renderer - некий объект отрисовки и разукраски всей сцены. -Т.е. в нем все компоненты, которые нужны для создания на сцене чего-либо: -шейдера, шейдерные программы, буфера вершин, вспомогательные функции установки цвета и его очистки и т.п. - -Может использоваться в разных частях программы, где нужно что-то создать и отрисовать или перекрасить и удалить. -Относимся к этому, как к набору кисточек и ластиков при помощи которых что-то делаем на экране, рисуем или стираем. -*/ - -namespace tr::core -{ - class renderer - { - public: - static void set_color(const glm::vec4&); - static void clear(); - }; -} diff --git a/src/core/renderer/texture/texture.cpp b/src/core/renderer/texture/texture.cpp deleted file mode 100644 index 6793373..0000000 --- a/src/core/renderer/texture/texture.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "texture.hpp" - -namespace tr::core -{ - texture::~texture() - { - glDeleteTextures(1, &texture_id); - } - - void texture::make() - { - if (!texture_id) - { - glGenTextures(1, &texture_id); - glBindTexture(GL_TEXTURE_2D, texture_id); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - } - } - - void texture::draw(ImVec2 pos, ImVec2 size) - { - // ImGui::Image(reinterpret_cast(static_cast(texture)), ImVec2(pos.x + 100, pos.y + 100)); - ImGui::GetWindowDrawList()->AddImage(reinterpret_cast(static_cast(texture_id)), pos, size); - } -} diff --git a/src/core/renderer/texture/texture.hpp b/src/core/renderer/texture/texture.hpp deleted file mode 100644 index 17bbf67..0000000 --- a/src/core/renderer/texture/texture.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "core/utils/include.hpp" - -namespace tr::core -{ - class texture - { - public: - texture() = default; - ~texture(); - - public: - template - void bind(Image& image) - { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.cols, image.rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.data); - } - - void draw(ImVec2 pos, ImVec2 size); - void make(); - - private: - GLuint texture_id = 0; - }; -} diff --git a/src/core/utils/define.hpp b/src/core/utils/define.hpp deleted file mode 100644 index b3d31a3..0000000 --- a/src/core/utils/define.hpp +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once - -#define BIT(x)\ - (1 << x) - -#define EVENT_CLASS_TYPE_FN(type)\ - virtual std::string get_name() const override { return type; } - -#define BIND_EVENT_FN(app, x)\ - std::bind(&app::x, this, std::placeholders::_1) - -#define BASE_TYPE_DEFINE(time, event_manager)\ - using time = core::time::timestep;\ - using event_manager = tr::core::app_event::event;\ - using app_event = tr::core::app_event::event_type;\ - using system_event = tr::core::system_event::event - - -#define BASE_WINDOW_FLAGS()\ - if (f.no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar;\ - if (f.no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;\ - if (!f.no_menu) window_flags |= ImGuiWindowFlags_MenuBar;\ - if (f.no_move) window_flags |= ImGuiWindowFlags_NoMove;\ - if (f.no_resize) window_flags |= ImGuiWindowFlags_NoResize;\ - if (f.no_collapse) window_flags |= ImGuiWindowFlags_NoCollapse;\ - if (f.no_nav) window_flags |= ImGuiWindowFlags_NoNav;\ - if (f.no_background) window_flags |= ImGuiWindowFlags_NoBackground;\ - if (f.no_bring_to_front) window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus - -#define SET_EVENT_MANAGER_IMPL()\ - void set_event_manager(event_manager* em_)\ - {\ - em = em_;\ - em->set_event_callback(this);\ - } - -#define BASE_OVERIDE_IMPL()\ - void on_attach() override;\ - void on_detach() override;\ - void gui_render() override;\ - void on_event(tr::core::system_event::event& e) override;\ - void on_event(tr::core::app_event::event_type type, std::any value) override;\ - void on_update(time t) override - -#define CONSTRUCT_IMPL(name)\ - name() : core::layer { ""#name"" } { BASE_WINDOW_FLAGS(); };\ - ~name() = default - -#define FLAGS_STRUCT_DEFINED()\ - struct flags\ - {\ - bool p_open = false;\ - bool no_titlebar = true;\ - bool no_scrollbar = true;\ - bool no_menu = true;\ - bool no_move = true;\ - bool no_resize = true;\ - bool no_collapse = true;\ - bool no_nav = false;\ - bool no_background = false;\ - bool no_bring_to_front = false;\ - bool no_docking = true;\ - } f;\ - ImGuiWindowFlags window_flags = 0 - -#define BEGIN_IMGUI_WIN() if (!ImGui::Begin(name.c_str(), &f.p_open, window_flags)) ImGui::End() -#define END_IMGUI_WIN() ImGui::End() diff --git a/src/core/utils/include.hpp b/src/core/utils/include.hpp deleted file mode 100644 index 97099d9..0000000 --- a/src/core/utils/include.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#define GLFW_INCLUDE_NONE -#include "GLFW/glfw3.h" -#include "glad.h" -#include "glm/glm.hpp" -#include "logger/logger.hpp" -#include "imgui.h" -#include "imgui_impl_glfw.h" -#include "imgui_impl_opengl3.h" - -#include "variable.hpp" -#include "timestap.hpp" - -template -using event_callback = std::function; - -#include "nlohmann/json.hpp" -using JSON = nlohmann::json; - -namespace tr::core::time -{ - inline timestep get_time() - { - static float frame_time = 0.0f; - float t = (float)glfwGetTime(); - timestep ts = t - frame_time; - frame_time = t; - - return ts; - } -} diff --git a/src/core/utils/timestap.hpp b/src/core/utils/timestap.hpp deleted file mode 100644 index 23a7f89..0000000 --- a/src/core/utils/timestap.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -namespace tr::core::time -{ - template - class timestep - { - public: - timestep(Time data_ = 0.0f) : data { data_ } {} - - operator Time() const { return data; } - - Time get_seconds() const { return data; } - Time get_milliseconds() const { return data * 1000.0f; } - - private: - Time data; - }; -} - - - diff --git a/src/core/utils/variable.hpp b/src/core/utils/variable.hpp deleted file mode 100644 index c395f4f..0000000 --- a/src/core/utils/variable.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include -#include - -namespace tr::core::utils::var -{ - inline const std::string PROJECT_NAME = "rrr.v2"; -} - diff --git a/src/core/window/graphic_context/graphic_context.cpp b/src/core/window/graphic_context/graphic_context.cpp deleted file mode 100644 index d8e1756..0000000 --- a/src/core/window/graphic_context/graphic_context.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "graphic_context.hpp" - -namespace tr::core -{ - graphic_context::graphic_context(GLFWwindow* w) : win { w } {} - - void graphic_context::init() - { - glfwMakeContextCurrent(win); - int status = gladLoadGLLoader((GLADloadproc)glfwGetProcAddress); - - hack::log(": ")("Glad loader status", status == 1 ? "true" : "false"); - hack::log(": ")("OpenGL Info"); - hack::log(": ")(" Vendor", glGetString(GL_VENDOR)); - hack::log(": ")(" Renderer", glGetString(GL_RENDERER)); - hack::log(": ")(" Version", glGetString(GL_VERSION)); - hack::log(": ")(" GLSL Version", glGetString(GL_SHADING_LANGUAGE_VERSION)); - - glfwSwapInterval(1); - } - - void graphic_context::swap_buffers() - { - glfwSwapBuffers(win); - } -} - diff --git a/src/core/window/graphic_context/graphic_context.hpp b/src/core/window/graphic_context/graphic_context.hpp deleted file mode 100644 index 03a5f3b..0000000 --- a/src/core/window/graphic_context/graphic_context.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "core/utils/include.hpp" - -namespace tr::core -{ - class graphic_context - { - public: - graphic_context(GLFWwindow*); - - void init(); - void swap_buffers(); - - private: - GLFWwindow* win; - }; -} diff --git a/src/core/window/window.cpp b/src/core/window/window.cpp deleted file mode 100644 index ac3c2c6..0000000 --- a/src/core/window/window.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include "window.hpp" - -#include "renderer/renderer.hpp" -#include "event/system_event/category/key_event.hpp" -#include "event/system_event/category/window_event.hpp" - -namespace tr::core -{ - window::window() - { - if (!glfwInit()) - exit(EXIT_FAILURE); - - set_hint(); - set_window(); - set_context(); - set_pointer(); - set_key_callback(); - set_window_callback(); - - hack::log(": ")("Creating window", win_data.title); - hack::log(" = ")("w", win_data.width); - hack::log(" = ")("h", win_data.height); - } - - window::~window() - { - glfwDestroyWindow(win); - glfwTerminate(); - hack::warn(": ")("destroy", "window", win_data.title); - } - - void window::set_hint() - { - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); - glfwWindowHint(GLFW_SAMPLES, 4); - } - - void window::set_window() - { - win_data.title = utils::var::PROJECT_NAME; - - win = glfwCreateWindow( - glfwGetVideoMode(glfwGetPrimaryMonitor())->width, - glfwGetVideoMode(glfwGetPrimaryMonitor())->height, - win_data.title.c_str(), - nullptr, nullptr - ); - - if(win == NULL) - { - hack::error()("Failed to create GLFW window"); - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwGetWindowSize(win, &win_data.width, &win_data.height); - } - - void window::set_context() - { - context = std::make_unique(win); - context->init(); - } - - void window::set_pointer() - { - glfwSetWindowUserPointer(win, &win_data); - } - - void window::set_event_callback(const event_callback& cb) - { - win_data.callback = cb; - } - - GLFWwindow* window::glfw_window() const - { - return win; - } - - int window::width() const - { - return win_data.width; - } - - int window::height() const - { - return win_data.height; - } - - void window::update() - { - glfwPollEvents(); - context->swap_buffers(); - } - - void window::clear() const - { - renderer::set_color({ 0.1f, 0.1f, 0.1f, 1 }); - renderer::clear(); - } - - void window::set_key_callback() - { - glfwSetKeyCallback(win, [](GLFWwindow* w, int key, int scancode, int action, int mods) - { - auto data = static_cast(glfwGetWindowUserPointer(w)); - - switch (action) - { - case GLFW_PRESS: - { - system_event::key_pressed_event e { key }; - data->callback(e); - break; - } - case GLFW_RELEASE: - { - system_event::key_released_event e { key }; - data->callback(e); - break; - } - } - }); - } - - void window::set_window_callback() - { - glfwSetWindowSizeLimits(win, win_data.width, win_data.height, GLFW_DONT_CARE, GLFW_DONT_CARE); - - glfwSetWindowSizeCallback(win, [](GLFWwindow* w, int width, int height) - { - auto data = static_cast(glfwGetWindowUserPointer(w)); - data->width = width; - data->height = height; - - system_event::window_resize_event e { width, height }; - data->callback(e); - }); - - glfwSetWindowCloseCallback(win, [](GLFWwindow* w) - { - auto data = static_cast(glfwGetWindowUserPointer(w)); - system_event::window_close_event e; - data->callback(e); - }); - - glfwSetWindowFocusCallback(win, [](GLFWwindow* w, int focused) - { - auto data = static_cast(glfwGetWindowUserPointer(w)); - system_event::window_focus_event e { focused }; - data->callback(e); - }); - } -} diff --git a/src/core/window/window.hpp b/src/core/window/window.hpp deleted file mode 100644 index 228c0b8..0000000 --- a/src/core/window/window.hpp +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include "core/utils/include.hpp" -#include "graphic_context/graphic_context.hpp" -#include "core/event/system_event/event.hpp" - -namespace tr::core -{ - class window - { - public: - window(); - ~window(); - - public: - void update(); - GLFWwindow* glfw_window() const; - void clear() const ; - int width() const; - int height() const; - void set_event_callback(const event_callback&); - void set_window_callback(); - - private: - // ни каких unique_ptr тут неполучится - // т.к. glfwCreateWindow maloc-ом выделяет память - // что не есть хорошо для умных указателей - GLFWwindow* win; - std::unique_ptr context; - - struct window_data - { - std::string title; - int width, height; - event_callback callback; - } win_data; - - private: - void set_hint(); - void set_window(); - void set_context(); - void set_pointer(); - void set_key_callback(); - }; -} - diff --git a/src/engine/layers/gui/browser/preview/preview.cpp b/src/engine/layers/gui/browser/preview/preview.cpp deleted file mode 100644 index 5f45122..0000000 --- a/src/engine/layers/gui/browser/preview/preview.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "preview.hpp" - -namespace tr::layers::gui -{ - void preview::on_attach() - { - BASE_WINDOW_FLAGS(); - } - - void preview::on_detach() - { - - } - - void preview::gui_render() - { - ImGui::SetNextWindowPos(ImVec2(pos_x, pos_y)); - ImGui::SetNextWindowSize(ImVec2(width, height)); - - BEGIN_IMGUI_WIN(); - - - END_IMGUI_WIN(); - } - - void preview::on_event(system_event& e) - { - if (e.get_name() == core::system_event::classificator::WINDOW_RESIZE()) - { - height = core::application::get()->get_window()->height() - 40.f; - width = core::application::get()->get_window()->width() / 3.f; - pos_x = core::application::get()->get_window()->width() - core::application::get()->get_window()->width() / 3.f; - } - } - - void preview::on_event(app_event e, std::any value) - { - switch (e) { - default: - break; - } - } - - void preview::on_update(time t) - { - - } -} - diff --git a/src/engine/sandbox/demo.hpp b/src/engine/sandbox/demo.hpp deleted file mode 100644 index 8b4b2f6..0000000 --- a/src/engine/sandbox/demo.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -#include "core/core.hpp" - -namespace tr::sandbox::gui -{ - class demo : public core::layer - { - using time = core::time::timestep; - using event_manager = tr::core::app_event::event; - - public: - demo() : core::layer { "sandbox ui demo" } { }; - ~demo() = default; - - public: - void on_attach() override { hack::log()(name); } - void on_detach() override { hack::log()(name); } - void gui_render() override { ImGui::ShowDemoWindow(&show); } - void on_update(time t) override - { - // tr::core::event e; - // callback(e); - }; - - void on_event(tr::core::system_event::event& e) override - { - hack::log()(e.get_name()); - } - - void on_event(tr::core::app_event::event_type type, std::any value) override - { - } - - void set_event_manager(event_manager* em_) - { - em = em_; - em->set_event_callback(this); - }; - - private: - bool show = true; - event_manager* em; - }; -} diff --git a/src/meson.build b/src/meson.build index fbd21de..917e9a6 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,4 +1,3 @@ inc += include_directories('.') -subdir('core') -subdir('engine') +subdir('rrr') diff --git a/src/engine/buffer/buffer.hpp b/src/rrr/buffer/buffer.hpp similarity index 97% rename from src/engine/buffer/buffer.hpp rename to src/rrr/buffer/buffer.hpp index 9700980..e306626 100644 --- a/src/engine/buffer/buffer.hpp +++ b/src/rrr/buffer/buffer.hpp @@ -11,7 +11,7 @@ // value - это то, что тебя там ждет. // т.е. буфер хранит наши прошщлые похождения // и это отображается в history -namespace tr::database +namespace rrr::database { struct content_hash { diff --git a/src/engine/content/content.cpp b/src/rrr/content/content.cpp similarity index 97% rename from src/engine/content/content.cpp rename to src/rrr/content/content.cpp index b584632..c678063 100644 --- a/src/engine/content/content.cpp +++ b/src/rrr/content/content.cpp @@ -1,6 +1,6 @@ #include "content.hpp" -namespace tr +namespace rrr { void content::set_pwd(std::filesystem::path p) { diff --git a/src/engine/content/content.hpp b/src/rrr/content/content.hpp similarity index 98% rename from src/engine/content/content.hpp rename to src/rrr/content/content.hpp index 37482bc..7310574 100644 --- a/src/engine/content/content.hpp +++ b/src/rrr/content/content.hpp @@ -6,7 +6,7 @@ #include "history/history.hpp" #include "preview/preview.hpp" -namespace tr +namespace rrr { enum class TYPE_WIN { diff --git a/src/engine/content/file/file.cpp b/src/rrr/content/file/file.cpp similarity index 98% rename from src/engine/content/file/file.cpp rename to src/rrr/content/file/file.cpp index c0a249a..1cdcdf8 100644 --- a/src/engine/content/file/file.cpp +++ b/src/rrr/content/file/file.cpp @@ -1,6 +1,6 @@ #include "file.hpp" -namespace tr +namespace rrr { file::file(std::filesystem::path path_, file_type type_, bool is_link_) : id { ++hack::utils::counter::id }, path { path_ }, type { type_ }, is_link { is_link_ } {} diff --git a/src/engine/content/file/file.hpp b/src/rrr/content/file/file.hpp similarity index 98% rename from src/engine/content/file/file.hpp rename to src/rrr/content/file/file.hpp index 9a77256..67a7775 100644 --- a/src/engine/content/file/file.hpp +++ b/src/rrr/content/file/file.hpp @@ -5,7 +5,7 @@ #include #include -namespace tr +namespace rrr { // FILE - файл // DIR - дирректория @@ -42,7 +42,7 @@ namespace tr }; } -namespace tr::file_utils +namespace rrr::file_utils { using files = std::vector; diff --git a/src/engine/content/history/history.cpp b/src/rrr/content/history/history.cpp similarity index 88% rename from src/engine/content/history/history.cpp rename to src/rrr/content/history/history.cpp index e5ad554..179aa03 100644 --- a/src/engine/content/history/history.cpp +++ b/src/rrr/content/history/history.cpp @@ -1,6 +1,6 @@ #include "history.hpp" -namespace tr::content_type +namespace rrr::content_type { void history::fill(std::filesystem::path PWD) { diff --git a/src/engine/content/history/history.hpp b/src/rrr/content/history/history.hpp similarity index 75% rename from src/engine/content/history/history.hpp rename to src/rrr/content/history/history.hpp index 1051543..9d1b15e 100644 --- a/src/engine/content/history/history.hpp +++ b/src/rrr/content/history/history.hpp @@ -1,8 +1,8 @@ #pragma once -#include "engine/content/file/file.hpp" +#include "rrr/content/file/file.hpp" -namespace tr::content_type +namespace rrr::content_type { using files = std::vector; diff --git a/src/engine/content/navigation/navigation.cpp b/src/rrr/content/navigation/navigation.cpp similarity index 90% rename from src/engine/content/navigation/navigation.cpp rename to src/rrr/content/navigation/navigation.cpp index 976a9a1..4b3b91f 100644 --- a/src/engine/content/navigation/navigation.cpp +++ b/src/rrr/content/navigation/navigation.cpp @@ -1,6 +1,6 @@ #include "navigation.hpp" -namespace tr::content_type +namespace rrr::content_type { void navigation::fill(std::filesystem::path PWD) { diff --git a/src/engine/content/navigation/navigation.hpp b/src/rrr/content/navigation/navigation.hpp similarity index 82% rename from src/engine/content/navigation/navigation.hpp rename to src/rrr/content/navigation/navigation.hpp index 5be2ff0..134f485 100644 --- a/src/engine/content/navigation/navigation.hpp +++ b/src/rrr/content/navigation/navigation.hpp @@ -2,9 +2,9 @@ #include -#include "engine/content/file/file.hpp" +#include "rrr/content/file/file.hpp" -namespace tr::content_type +namespace rrr::content_type { using files = std::vector; diff --git a/src/engine/content/preview/preview.cpp b/src/rrr/content/preview/preview.cpp similarity index 87% rename from src/engine/content/preview/preview.cpp rename to src/rrr/content/preview/preview.cpp index bc50bcc..07e4072 100644 --- a/src/engine/content/preview/preview.cpp +++ b/src/rrr/content/preview/preview.cpp @@ -1,6 +1,6 @@ #include "preview.hpp" -namespace tr::content_type +namespace rrr::content_type { void preview::fill(std::filesystem::path PWD) { diff --git a/src/engine/content/preview/preview.hpp b/src/rrr/content/preview/preview.hpp similarity index 73% rename from src/engine/content/preview/preview.hpp rename to src/rrr/content/preview/preview.hpp index e984b37..8f7a0b6 100644 --- a/src/engine/content/preview/preview.hpp +++ b/src/rrr/content/preview/preview.hpp @@ -1,8 +1,8 @@ #pragma once -#include "engine/content/file/file.hpp" +#include "rrr/content/file/file.hpp" -namespace tr::content_type +namespace rrr::content_type { using files = std::vector; diff --git a/src/engine/layers/gui/browser/history/history.cpp b/src/rrr/layers/gui/browser/history/history.cpp similarity index 55% rename from src/engine/layers/gui/browser/history/history.cpp rename to src/rrr/layers/gui/browser/history/history.cpp index 856b461..8a7fb0c 100644 --- a/src/engine/layers/gui/browser/history/history.cpp +++ b/src/rrr/layers/gui/browser/history/history.cpp @@ -1,6 +1,6 @@ #include "history.hpp" -namespace tr::layers::gui +namespace rrr::layers::gui { void history::on_attach() { @@ -25,19 +25,15 @@ namespace tr::layers::gui void history::on_event(system_event& e) { - if (e.get_name() == core::system_event::classificator::WINDOW_RESIZE()) + if (e.get_name() == try_engine::system_event::classificator::WINDOW_RESIZE()) { - height = core::application::get()->get_window()->height() - 40.f; - width = core::application::get()->get_window()->width() / 3.f; + height = try_engine::application::get()->get_window()->height() - 40.f; + width = try_engine::application::get()->get_window()->width() / 3.f; } } - void history::on_event(app_event e, std::any value) + void history::on_event(std::any e, std::any value) { - switch (e) { - default: - break; - } } void history::on_update(time t) diff --git a/src/engine/layers/gui/browser/history/history.hpp b/src/rrr/layers/gui/browser/history/history.hpp similarity index 72% rename from src/engine/layers/gui/browser/history/history.hpp rename to src/rrr/layers/gui/browser/history/history.hpp index 130b303..e0ab35f 100644 --- a/src/engine/layers/gui/browser/history/history.hpp +++ b/src/rrr/layers/gui/browser/history/history.hpp @@ -1,13 +1,13 @@ #pragma once -#include "core/core.hpp" -#include "engine/content/content.hpp" +#include "try_engine/try_engine.hpp" +#include "rrr/content/content.hpp" -namespace tr::layers::gui +namespace rrr::layers::gui { - class history : public core::layer + class history : public try_engine::layer { - BASE_TYPE_DEFINE(time, event_manager); + BASE_TYPE_DEFINE(); public: CONSTRUCT_IMPL(history); diff --git a/src/engine/layers/gui/browser/navigation/navigation.cpp b/src/rrr/layers/gui/browser/navigation/navigation.cpp similarity index 61% rename from src/engine/layers/gui/browser/navigation/navigation.cpp rename to src/rrr/layers/gui/browser/navigation/navigation.cpp index 6b4cc88..ad794fc 100644 --- a/src/engine/layers/gui/browser/navigation/navigation.cpp +++ b/src/rrr/layers/gui/browser/navigation/navigation.cpp @@ -1,10 +1,11 @@ #include "navigation.hpp" -namespace tr::layers::gui +namespace rrr::layers::gui { void navigation::on_attach() { BASE_WINDOW_FLAGS(); + data = cnt->get(TYPE_WIN::NAVIGATION); } @@ -24,6 +25,9 @@ namespace tr::layers::gui auto padding = -60.f; const ImVec4 type_color = ImVec4(0.35f, 0.35f, 0.35f, 1.0f); + // HERE начинаем тут + // стилизуем ссылки + // делаем навигацию for (auto& item : *data) { ImGui::PushID(item.id); @@ -34,13 +38,17 @@ namespace tr::layers::gui ImGui::SetCursorPos(ImVec2(pos.x, pos.y + padding)); if (ImGui::Selectable(buf, item.id == selected, 0, ImVec2(width, 60))) selected = item.id; - + + font = atlas->Fonts[1]; + ImGui::PushFont(font); ImGui::PushStyleColor(ImGuiCol_Text, type_color); + ImGui::TextUnformatted(item.path.filename().string().data()); + + pos.y += font->FontSize + 4.f; + ImGui::PopStyleColor(); - - pos.y += 24.f; - + ImGui::PopFont(); ImGui::PopID(); } @@ -50,20 +58,16 @@ namespace tr::layers::gui void navigation::on_event(system_event& e) { - if (e.get_name() == core::system_event::classificator::WINDOW_RESIZE()) + if (e.get_name() == try_engine::system_event::classificator::WINDOW_RESIZE()) { - height = core::application::get()->get_window()->height() - 40.f; - width = core::application::get()->get_window()->width() / 3.f - padding_between_window; - pos_x = core::application::get()->get_window()->width() / 3.f + padding_between_window / 2.f; + height = try_engine::application::get()->get_window()->height() - 40.f; + width = try_engine::application::get()->get_window()->width() / 3.f - padding_between_window; + pos_x = try_engine::application::get()->get_window()->width() / 3.f + padding_between_window / 2.f; } } - void navigation::on_event(app_event e, std::any value) + void navigation::on_event(std::any e, std::any value) { - switch (e) { - default: - break; - } } void navigation::on_update(time t) diff --git a/src/engine/layers/gui/browser/navigation/navigation.hpp b/src/rrr/layers/gui/browser/navigation/navigation.hpp similarity index 65% rename from src/engine/layers/gui/browser/navigation/navigation.hpp rename to src/rrr/layers/gui/browser/navigation/navigation.hpp index d267af1..9b48fd5 100644 --- a/src/engine/layers/gui/browser/navigation/navigation.hpp +++ b/src/rrr/layers/gui/browser/navigation/navigation.hpp @@ -1,13 +1,13 @@ #pragma once -#include "core/core.hpp" -#include "engine/content/content.hpp" +#include "try_engine/try_engine.hpp" +#include "rrr/content/content.hpp" -namespace tr::layers::gui +namespace rrr::layers::gui { - class navigation : public core::layer + class navigation : public try_engine::layer { - BASE_TYPE_DEFINE(time, event_manager); + BASE_TYPE_DEFINE(); public: CONSTRUCT_IMPL(navigation); @@ -36,6 +36,11 @@ namespace tr::layers::gui float padding_between_window = 2.f; int selected = 0; + + private: + ImGuiIO& io = ImGui::GetIO(); + ImFontAtlas* atlas = io.Fonts; + ImFont* font; }; } diff --git a/src/rrr/layers/gui/browser/preview/preview.cpp b/src/rrr/layers/gui/browser/preview/preview.cpp new file mode 100644 index 0000000..f3ade54 --- /dev/null +++ b/src/rrr/layers/gui/browser/preview/preview.cpp @@ -0,0 +1,45 @@ +#include "preview.hpp" + +namespace rrr::layers::gui +{ + void preview::on_attach() + { + BASE_WINDOW_FLAGS(); + } + + void preview::on_detach() + { + + } + + void preview::gui_render() + { + ImGui::SetNextWindowPos(ImVec2(pos_x, pos_y)); + ImGui::SetNextWindowSize(ImVec2(width, height)); + + BEGIN_IMGUI_WIN(); + + + END_IMGUI_WIN(); + } + + void preview::on_event(system_event& e) + { + if (e.get_name() == try_engine::system_event::classificator::WINDOW_RESIZE()) + { + height = try_engine::application::get()->get_window()->height() - 40.f; + width = try_engine::application::get()->get_window()->width() / 3.f; + pos_x = try_engine::application::get()->get_window()->width() - try_engine::application::get()->get_window()->width() / 3.f; + } + } + + void preview::on_event(std::any e, std::any value) + { + } + + void preview::on_update(time t) + { + + } +} + diff --git a/src/engine/layers/gui/browser/preview/preview.hpp b/src/rrr/layers/gui/browser/preview/preview.hpp similarity index 72% rename from src/engine/layers/gui/browser/preview/preview.hpp rename to src/rrr/layers/gui/browser/preview/preview.hpp index 59e1973..9ce25ab 100644 --- a/src/engine/layers/gui/browser/preview/preview.hpp +++ b/src/rrr/layers/gui/browser/preview/preview.hpp @@ -1,13 +1,13 @@ #pragma once -#include "core/core.hpp" -#include "engine/content/content.hpp" +#include "try_engine/try_engine.hpp" +#include "rrr/content/content.hpp" -namespace tr::layers::gui +namespace rrr::layers::gui { - class preview : public core::layer + class preview : public try_engine::layer { - BASE_TYPE_DEFINE(time, event_manager); + BASE_TYPE_DEFINE(); public: CONSTRUCT_IMPL(preview); diff --git a/src/engine/meson.build b/src/rrr/meson.build similarity index 98% rename from src/engine/meson.build rename to src/rrr/meson.build index f1064d3..5adbdd1 100644 --- a/src/engine/meson.build +++ b/src/rrr/meson.build @@ -1,5 +1,5 @@ headers = [ - 'engine.hpp', + 'rrr.hpp', 'content/content.hpp', 'content/file/file.hpp', diff --git a/src/engine/engine.hpp b/src/rrr/rrr.hpp similarity index 59% rename from src/engine/engine.hpp rename to src/rrr/rrr.hpp index 129f7ea..d7839d2 100644 --- a/src/engine/engine.hpp +++ b/src/rrr/rrr.hpp @@ -1,4 +1,4 @@ -#include "core/core.hpp" +#include "try_engine/try_engine.hpp" #include "content/content.hpp" @@ -6,18 +6,14 @@ #include "layers/gui/browser/history/history.hpp" #include "layers/gui/browser/preview/preview.hpp" -#include "sandbox/demo.hpp" - -#define NO_DEMO - -namespace tr +namespace rrr { - using event_manager = tr::core::app_event::event; + using event_manager = try_engine::app_event::event; - class engine : public core::application + class engine : public try_engine::application { public: - engine() + engine(std::string app_name) : try_engine::application{ app_name } { // HERE // убрать это в релизе @@ -32,26 +28,25 @@ namespace tr { (args->set_event_manager(&em), ...); (args->set_content(&cnt), ...); - core::application::push_layer(args...); + try_engine::application::push_layer(args...); } private: event_manager em; content cnt; }; +} - inline core::application& core::create_app() +namespace try_engine +{ + inline application& create() { - static engine e; - -#if defined DEMO - e.push_layer(new sandbox::gui::demo{}); -#endif + static rrr::engine e { "rrr.v2" }; e.push_layer( - new tr::layers::gui::history{}, - new tr::layers::gui::navigation{}, - new tr::layers::gui::preview{} + new rrr::layers::gui::history{}, + new rrr::layers::gui::navigation{}, + new rrr::layers::gui::preview{} ); e.attach_layers(); diff --git a/subprojects/try_engine.wrap b/subprojects/try_engine.wrap new file mode 100644 index 0000000..f16123f --- /dev/null +++ b/subprojects/try_engine.wrap @@ -0,0 +1,6 @@ +[wrap-git] +url = https://gitcast.ru/chatlanin/try_engine.git +revision = master + +[provide] +try_engine = try_engine_dep