summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-07-25 08:20:05 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-07-25 08:20:05 +0200
commit10a8d40e12b30beec0781deb0af894f66fe3561f (patch)
tree43e5ce91406175c0ed141010affff8302e3fa5e1
parent075837dc248ee36ec5abe7026bbb44b3c0609d29 (diff)
downloadturns-10a8d40e12b30beec0781deb0af894f66fe3561f.tar.xz
turns-10a8d40e12b30beec0781deb0af894f66fe3561f.zip
turns: add initialization functions
-rw-r--r--app/src/application.cpp12
-rw-r--r--core/CMakeLists.txt1
-rw-r--r--core/include/turns/core/init.hpp11
-rw-r--r--core/src/init.cpp15
-rw-r--r--ui/CMakeLists.txt1
-rw-r--r--ui/include/turns/ui/init.hpp11
-rw-r--r--ui/src/init.cpp15
7 files changed, 58 insertions, 8 deletions
diff --git a/app/src/application.cpp b/app/src/application.cpp
index c0aba86..1635cec 100644
--- a/app/src/application.cpp
+++ b/app/src/application.cpp
@@ -1,6 +1,7 @@
#include "turns/app/application.hpp"
-#include "turns/ui/widgets/turn_order_view.hpp"
+#include "turns/core/init.hpp"
+#include "turns/ui/init.hpp"
#include "turns/ui/windows/tracker.hpp"
#include <sigc++/functors/mem_fun.h>
@@ -16,6 +17,8 @@ namespace turns::app
{
Gtk::init_gtkmm_internals();
adw_init();
+ core::register_types();
+ app::register_types();
return std::shared_ptr<application>{new application{}};
}
@@ -65,13 +68,6 @@ namespace turns::app
m_application->set_accel_for_action("win.next", "<Primary>space");
m_application->set_accel_for_action("win.previous", "<Primary>BackSpace");
m_application->set_accel_for_action("win.add_participant", "<Primary>a");
-
- register_derived_widgets();
- }
-
- auto application::register_derived_widgets() -> void
- {
- static_cast<void>(widgets::turn_order_view{});
}
} // namespace turns::app \ No newline at end of file
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 4928843..245c7f7 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -2,6 +2,7 @@
add_library("core"
"src/disposition.cpp"
+ "src/init.cpp"
"src/participant.cpp"
"src/turn_order.cpp"
)
diff --git a/core/include/turns/core/init.hpp b/core/include/turns/core/init.hpp
new file mode 100644
index 0000000..f0dc70e
--- /dev/null
+++ b/core/include/turns/core/init.hpp
@@ -0,0 +1,11 @@
+#ifndef TURNS_CORE_INIT_HPP
+#define TURNS_CORE_INIT_HPP
+
+namespace turns::core
+{
+
+ auto register_types() -> void;
+
+} // namespace turns::core
+
+#endif \ No newline at end of file
diff --git a/core/src/init.cpp b/core/src/init.cpp
new file mode 100644
index 0000000..258aceb
--- /dev/null
+++ b/core/src/init.cpp
@@ -0,0 +1,15 @@
+#include "turns/core/init.hpp"
+
+#include "turns/core/participant.hpp"
+#include "turns/core/turn_order.hpp"
+
+namespace turns::core
+{
+
+ auto register_types() -> void
+ {
+ static_cast<void>(participant{});
+ static_cast<void>(turn_order{});
+ }
+
+} // namespace turns::core \ No newline at end of file
diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt
index e3d8941..2532059 100644
--- a/ui/CMakeLists.txt
+++ b/ui/CMakeLists.txt
@@ -1,6 +1,7 @@
# Library
add_library("ui"
+ "src/init.cpp"
"src/widgets/participant_row.cpp"
"src/widgets/turn_order_view.cpp"
"src/windows/participant_editor.cpp"
diff --git a/ui/include/turns/ui/init.hpp b/ui/include/turns/ui/init.hpp
new file mode 100644
index 0000000..09a0f40
--- /dev/null
+++ b/ui/include/turns/ui/init.hpp
@@ -0,0 +1,11 @@
+#ifndef TURNS_UI_INIT_HPP
+#define TURNS_UI_INIT_HPP
+
+namespace turns::app
+{
+
+ auto register_types() -> void;
+
+} // namespace turns::aop
+
+#endif \ No newline at end of file
diff --git a/ui/src/init.cpp b/ui/src/init.cpp
new file mode 100644
index 0000000..f10521a
--- /dev/null
+++ b/ui/src/init.cpp
@@ -0,0 +1,15 @@
+#include "turns/core/init.hpp"
+
+#include "turns/ui/widgets/participant_row.hpp"
+#include "turns/ui/widgets/turn_order_view.hpp"
+
+namespace turns::app
+{
+
+ auto register_types() -> void
+ {
+ static_cast<void>(widgets::participant_row{{}});
+ static_cast<void>(widgets::turn_order_view{{}});
+ }
+
+} // namespace turns::core \ No newline at end of file