diff --git a/doc/code/gui.md b/doc/code/gui.md index 6c548c2b653..3f1a4afb17b 100644 --- a/doc/code/gui.md +++ b/doc/code/gui.md @@ -51,7 +51,7 @@ qmlRegisterType("yay.sfttech.openage", 1, 0, "ResourceAmount 2. Specializations `struct Wrap` and `struct Unwrap` must be defined: ```cpp -namespace qtsdl { +namespace qtgui { template<> struct Wrap { using Type = ResourceAmountLink; @@ -61,13 +61,13 @@ template<> struct Unwrap { using Type = ResourceAmount; }; -} // namespace qtsdl +} // namespace qtgui ``` 3. Also ResourceAmount needs a public member to be added: ```cpp public: - qtsdl::GuiItemLink *gui_link + qtgui::GuiItemLink *gui_link ``` 4. Declare and implement needed properties and signals in the `ResourceAmountLink` using Qt property syntax. @@ -78,7 +78,7 @@ There is a class `GeneratorParameters` in `libopenage/` directory. It has a big list of parameters of different types like `generation_seed`, `player_radius`, `player_names`, etc. So, we're not going to write a Qt property for each one: -1. `GeneratorParameters` must derive from the `qtsdl::GuiPropertyMap`. +1. `GeneratorParameters` must derive from the `qtgui::GuiPropertyMap`. 2. `GeneratorParameters` should set its initial values like so: ```cpp @@ -96,7 +96,7 @@ qmlRegisterType("yay.sfttech.openage", 1, 0, "Generator 4. Specializations `struct Wrap` and `struct Unwrap` must be defined: ```cpp -namespace qtsdl { +namespace qtgui { template<> struct Wrap { using Type = GeneratorParametersLink; @@ -106,7 +106,7 @@ template<> struct Unwrap { using Type = GeneratorParameters; }; -} // namespace qtsdl +} // namespace qtgui ``` That results into a `ListModel`-like QML type with `display` and `edit` roles. diff --git a/libopenage/renderer/gui/guisys/link/gui_item.h b/libopenage/renderer/gui/guisys/link/gui_item.h index 450d3dc796c..9f8a5bd59f0 100644 --- a/libopenage/renderer/gui/guisys/link/gui_item.h +++ b/libopenage/renderer/gui/guisys/link/gui_item.h @@ -15,14 +15,14 @@ #include #include "renderer/gui/guisys/link/gui_item_link.h" -#include "renderer/gui/guisys/link/qtsdl_checked_static_cast.h" +#include "renderer/gui/guisys/link/qtgui_checked_static_cast.h" #include "renderer/gui/guisys/private/livereload/deferred_initial_constant_property_values.h" namespace qtgui { /** - * Cleans a text from unneeded content like "qtsdl". + * Cleans a text from unneeded content like "qtgui". */ QString name_tidier(const char *name); diff --git a/libopenage/renderer/gui/guisys/link/gui_item_link.h b/libopenage/renderer/gui/guisys/link/gui_item_link.h index 0bd7b8d61f2..0965aa2b4d5 100644 --- a/libopenage/renderer/gui/guisys/link/gui_item_link.h +++ b/libopenage/renderer/gui/guisys/link/gui_item_link.h @@ -5,7 +5,7 @@ #include #include -#include "renderer/gui/guisys/link/qtsdl_checked_static_cast.h" +#include "renderer/gui/guisys/link/qtgui_checked_static_cast.h" namespace qtgui { diff --git a/libopenage/renderer/gui/guisys/link/gui_property_map_impl.cpp b/libopenage/renderer/gui/guisys/link/gui_property_map_impl.cpp index 1a8e8b7db36..d6204ae7194 100644 --- a/libopenage/renderer/gui/guisys/link/gui_property_map_impl.cpp +++ b/libopenage/renderer/gui/guisys/link/gui_property_map_impl.cpp @@ -5,7 +5,7 @@ #include #include -#include "renderer/gui/guisys/link/qtsdl_checked_static_cast.h" +#include "renderer/gui/guisys/link/qtgui_checked_static_cast.h" namespace qtgui { diff --git a/libopenage/renderer/gui/guisys/link/qtsdl_checked_static_cast.h b/libopenage/renderer/gui/guisys/link/qtgui_checked_static_cast.h similarity index 100% rename from libopenage/renderer/gui/guisys/link/qtsdl_checked_static_cast.h rename to libopenage/renderer/gui/guisys/link/qtgui_checked_static_cast.h diff --git a/libopenage/renderer/gui/guisys/private/gui_application_impl.cpp b/libopenage/renderer/gui/guisys/private/gui_application_impl.cpp index c0ef0dd1b7b..fb8674b69ea 100644 --- a/libopenage/renderer/gui/guisys/private/gui_application_impl.cpp +++ b/libopenage/renderer/gui/guisys/private/gui_application_impl.cpp @@ -2,12 +2,12 @@ #include "gui_application_impl.h" -#include #include +#include #include -#include #include +#include namespace qtgui { @@ -41,22 +41,20 @@ void GuiApplicationImpl::processEvents() { } namespace { - int argc = 1; - char arg[] = "qtsdl"; - char *argv = &arg[0]; -} +int argc = 1; +char arg[] = "qtgui"; +char *argv = &arg[0]; +} // namespace -GuiApplicationImpl::GuiApplicationImpl() - : +GuiApplicationImpl::GuiApplicationImpl() : #ifndef NDEBUG owner{std::this_thread::get_id()}, #endif - app{argc, &argv} -{ + app{argc, &argv} { // Set locale back to POSIX for the decimal point parsing (see qcoreapplication.html#locale-settings). std::locale::global(std::locale().combine>(std::locale::classic())); qInfo() << "Compiled with Qt" << QT_VERSION_STR << "and run with Qt" << qVersion(); } -} // namespace qtsdl +} // namespace qtgui diff --git a/libopenage/renderer/gui/guisys/private/gui_application_impl.h b/libopenage/renderer/gui/guisys/private/gui_application_impl.h index 7294cf88279..f772c77a0f8 100644 --- a/libopenage/renderer/gui/guisys/private/gui_application_impl.h +++ b/libopenage/renderer/gui/guisys/private/gui_application_impl.h @@ -2,8 +2,8 @@ #pragma once -#include #include +#include #include @@ -12,7 +12,7 @@ namespace qtgui { /** * Houses gui logic event queue. * - * To launch it in a dedicated thread, use qtsdl::GuiDedicatedThread instead. + * To launch it in a dedicated thread, use qtgui::GuiDedicatedThread instead. */ class GuiApplicationImpl { public: @@ -25,8 +25,8 @@ class GuiApplicationImpl { private: GuiApplicationImpl(); - GuiApplicationImpl(const GuiApplicationImpl&) = delete; - GuiApplicationImpl& operator=(const GuiApplicationImpl&) = delete; + GuiApplicationImpl(const GuiApplicationImpl &) = delete; + GuiApplicationImpl &operator=(const GuiApplicationImpl &) = delete; #ifndef NDEBUG const std::thread::id owner; diff --git a/libopenage/renderer/gui/guisys/private/opengl_debug_logger.h b/libopenage/renderer/gui/guisys/private/opengl_debug_logger.h index f2763c96e74..3c297e197f4 100644 --- a/libopenage/renderer/gui/guisys/private/opengl_debug_logger.h +++ b/libopenage/renderer/gui/guisys/private/opengl_debug_logger.h @@ -40,4 +40,4 @@ gl_debug_parameters get_current_opengl_debug_parameters(QOpenGLContext ¤t_ */ void apply_opengl_debug_parameters(gl_debug_parameters params, QOpenGLContext ¤t_dest_context); -} // namespace qtsdl +} // namespace qtgui diff --git a/libopenage/renderer/gui/guisys/public/gui_application.cpp b/libopenage/renderer/gui/guisys/public/gui_application.cpp index 08a93aa42d7..80cba97bd22 100644 --- a/libopenage/renderer/gui/guisys/public/gui_application.cpp +++ b/libopenage/renderer/gui/guisys/public/gui_application.cpp @@ -8,13 +8,11 @@ namespace qtgui { -GuiApplication::GuiApplication() - : +GuiApplication::GuiApplication() : application{GuiApplicationImpl::get()} { } -GuiApplication::GuiApplication(std::shared_ptr application) - : +GuiApplication::GuiApplication(std::shared_ptr application) : application{application} { } @@ -24,4 +22,4 @@ void GuiApplication::process_events() { this->application->processEvents(); } -} // namespace qtsdl +} // namespace qtgui