From 5d8f799a1171f92054d4b45ba130cd7fdad0bd01 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 23 May 2025 14:04:27 +0200 Subject: app: prepare restructuring --- app/CMakeLists.txt | 57 ------------------- app/desktop.in | 10 ---- app/metainfo.xml | 38 ------------- app/mime.xml | 9 --- app/schemas/ch.arknet.Turns.gschema.xml | 25 --------- app/src/main.cpp | 97 --------------------------------- 6 files changed, 236 deletions(-) delete mode 100644 app/CMakeLists.txt delete mode 100644 app/desktop.in delete mode 100644 app/metainfo.xml delete mode 100644 app/mime.xml delete mode 100644 app/schemas/ch.arknet.Turns.gschema.xml delete mode 100644 app/src/main.cpp (limited to 'app') diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt deleted file mode 100644 index a231ec6..0000000 --- a/app/CMakeLists.txt +++ /dev/null @@ -1,57 +0,0 @@ -add_executable("app" - "src/main.cpp" -) - -target_link_libraries("app" PRIVATE - "$<$,$>:gcov>" - - "PkgConfig::gtkmm" - "adwaitamm::adwaitamm" - - "turns::core" - "turns::lang" - - "$<$:-Wl,--whole-archive>" - "turns::ui" - "turns::style" - "$<$:-Wl,--no-whole-archive>" -) - -target_add_glib_resources("app" - PREFIX "/ch/arknet/Turns" - UI_FILES "metainfo.xml" -) - -set_target_properties("app" PROPERTIES - OUTPUT_NAME "turns" -) - -install(TARGETS "app" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -) - -install(FILES - "${CMAKE_CURRENT_SOURCE_DIR}/metainfo.xml" - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo" - RENAME "ch.arknet.Turns.metainfo.xml" -) - -configure_file("desktop.in" - "turns.desktop" -) - -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/turns.desktop" - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" - RENAME "ch.arknet.Turns.desktop" -) - -configure_file("mime.xml" - "turns.xml" -) - -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/turns.xml" - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/mime/packages" - RENAME "ch.arknet.Turns.xml" -) diff --git a/app/desktop.in b/app/desktop.in deleted file mode 100644 index 99c0307..0000000 --- a/app/desktop.in +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Turns -Name[de]=Züge -GenericName=Turn Tracker -Icon=ch.arknet.Turns -StartupNotify=true -Exec=@CMAKE_INSTALL_FULL_BINDIR@/turns %u -Categories=Utility; -MimeType=text/x-turn-order; \ No newline at end of file diff --git a/app/metainfo.xml b/app/metainfo.xml deleted file mode 100644 index 621c1ee..0000000 --- a/app/metainfo.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - ch.arknet.Turns - CC-BY-SA-4.0 - LGPL-2.1-or-later - Turns - Züge - A simple turn order tracker - -

- Turns is an application to track turn order for TTRPGs like Dungeons and Dragons or Call of Cthulhu. -

-
- - - -

This is the first public release

-
-
-
- - keyboard - pointing - - - - Role-playing Games - Tabletop Games - - - Felix Morgner - - felix.morgner@gmail.com - ch.arknet.Turns.desktop - https://source.arknet.ch/fmorgner/turns - https://source.arknet.ch/fmorgner/turns/-/issues - https://source.arknet.ch/fmorgner/turns -
\ No newline at end of file diff --git a/app/mime.xml b/app/mime.xml deleted file mode 100644 index 92e0ff4..0000000 --- a/app/mime.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - Turn order file - - - - - \ No newline at end of file diff --git a/app/schemas/ch.arknet.Turns.gschema.xml b/app/schemas/ch.arknet.Turns.gschema.xml deleted file mode 100644 index d764608..0000000 --- a/app/schemas/ch.arknet.Turns.gschema.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - '#33d17a' - Friendly Disposition Color - The color used to shade friendly participants. - - - '#e01b24' - Hostile Disposition Color - The color used to shade hostile participants. - - - '#9141ac' - Secret Disposition Color - The color used to shade secret participants. - - - false - Skip Defeated Participants - Whether or not defeated participants shall be skipped while stepping through the turn order. - - - \ No newline at end of file diff --git a/app/src/main.cpp b/app/src/main.cpp deleted file mode 100644 index f179cf8..0000000 --- a/app/src/main.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include "turns/core/init.hpp" -#include "turns/core/settings.hpp" -#include "turns/ui/init.hpp" -#include "turns/ui/tracker.hpp" - -#include -#include - -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include - -auto show_about(Glib::RefPtr app) -{ - auto active_window = app->get_active_window(); - auto dialog = Gtk::make_managed("/ch/arknet/Turns/metainfo.xml", ""); - dialog->present(active_window); -} - -auto main(int argc, char * argv[]) -> int -{ - setlocale(LC_ALL, ""); - bindtextdomain("turns", LOCALEDIR); - bind_textdomain_codeset("turns", "UTF-8"); - textdomain("turns"); - - auto app = Adwaita::Application::create("ch.arknet.Turns", Gio::Application::Flags::HANDLES_OPEN); - auto settings = turns::core::get_settings(); - - turns::core::register_types(); - - app->signal_startup().connect([app] { - turns::ui::register_types(); - - auto style_manager = Adwaita::StyleManager::get_default(); - style_manager->set_color_scheme(Adwaita::ColorScheme::PreferLight); - - app->add_action("quit", sigc::mem_fun(*app, &Adwaita::Application::quit)); - app->add_action("about", sigc::bind(&show_about, app)); - app->set_accel_for_action("app.quit", "q"); - app->set_accel_for_action("win.clear", "x"); - app->set_accel_for_action("win.next", "space"); - app->set_accel_for_action("win.previous", "BackSpace"); - app->set_accel_for_action("win.add_participant", "a"); - app->set_accel_for_action("win.open", "o"); - app->set_accel_for_action("win.preferences", "comma"); - app->set_accel_for_action("win.save", "s"); - app->set_accel_for_action("win.save-as", "s"); - }); - - app->signal_activate().connect([app, settings] { - auto window = new turns::ui::Tracker{app, settings}; - window->present(); - }); - - app->signal_open().connect([app, settings](auto files, auto) { - auto windows = app->get_windows(); - auto window = static_cast(nullptr); - - if (windows.empty()) - { - window = new turns::ui::Tracker{app, settings}; - } - else - { - window = dynamic_cast(windows[0]); - } - - window->present(); - window->load(files[0]); - }); - - app->signal_window_removed().connect([](auto window) { - auto tracker = dynamic_cast(window); - if (tracker) - { - delete tracker; - } - }); - - return app->run(argc, argv); -} \ No newline at end of file -- cgit v1.2.3