From 195a87b8ab8e9c677cb31f400f02b3b8c2fd976e Mon Sep 17 00:00:00 2001 From: Green Sky Date: Fri, 12 Apr 2024 19:03:30 +0200 Subject: [PATCH] add object store and expose to plugins --- .gitmodules | 3 +++ external/CMakeLists.txt | 2 ++ external/solanaceae_object_store | 1 + src/CMakeLists.txt | 2 ++ src/main_screen.cpp | 2 ++ src/main_screen.hpp | 3 +++ 6 files changed, 13 insertions(+) create mode 160000 external/solanaceae_object_store diff --git a/.gitmodules b/.gitmodules index 06f552c2..4d17134d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,3 +20,6 @@ [submodule "external/solanaceae_plugin"] path = external/solanaceae_plugin url = https://github.com/Green-Sky/solanaceae_plugin.git +[submodule "external/solanaceae_object_store"] + path = external/solanaceae_object_store + url = https://github.com/Green-Sky/solanaceae_object_store.git diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 59914aba..0daa5d95 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -12,6 +12,8 @@ add_subdirectory(./toxcore) add_subdirectory(./solanaceae_toxcore) add_subdirectory(./solanaceae_tox) +add_subdirectory(./solanaceae_object_store) + add_subdirectory(./sdl) add_subdirectory(./imgui) diff --git a/external/solanaceae_object_store b/external/solanaceae_object_store new file mode 160000 index 00000000..4d3ffb81 --- /dev/null +++ b/external/solanaceae_object_store @@ -0,0 +1 @@ +Subproject commit 4d3ffb8192623740f6e170855ee1cffd428b78da diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6328a18f..2dc82cf6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,6 +82,8 @@ target_link_libraries(tomato PUBLIC solanaceae_tox_contacts solanaceae_tox_messages + solanaceae_object_store + SDL3::SDL3 imgui diff --git a/src/main_screen.cpp b/src/main_screen.cpp index e84a2c91..7fcaf2b5 100644 --- a/src/main_screen.cpp +++ b/src/main_screen.cpp @@ -49,6 +49,8 @@ MainScreen::MainScreen(SDL_Renderer* renderer_, std::string save_path, std::stri std::cout << "own address: " << tc.toxSelfGetAddressStr() << "\n"; { // setup plugin instances + g_provideInstance("ObjectStore2", "host", &os); + g_provideInstance("ConfigModelI", "host", &conf); g_provideInstance("Contact3Registry", "1", "host", &cr); g_provideInstance("RegistryMessageModel", "host", &rmm); diff --git a/src/main_screen.hpp b/src/main_screen.hpp index 27f7d7bd..1ecc9cf1 100644 --- a/src/main_screen.hpp +++ b/src/main_screen.hpp @@ -2,6 +2,7 @@ #include "./screen.hpp" +#include #include #include #include @@ -43,6 +44,8 @@ extern "C" { struct MainScreen final : public Screen { SDL_Renderer* renderer; + ObjectStore2 os; + SimpleConfigModel conf; Contact3Registry cr; RegistryMessageModel rmm;