add object store and expose to plugins

This commit is contained in:
Green Sky 2024-04-12 19:03:30 +02:00
parent b38a1a2507
commit 195a87b8ab
No known key found for this signature in database
6 changed files with 13 additions and 0 deletions

3
.gitmodules vendored
View File

@ -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

View File

@ -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)

1
external/solanaceae_object_store vendored Submodule

@ -0,0 +1 @@
Subproject commit 4d3ffb8192623740f6e170855ee1cffd428b78da

View File

@ -82,6 +82,8 @@ target_link_libraries(tomato PUBLIC
solanaceae_tox_contacts
solanaceae_tox_messages
solanaceae_object_store
SDL3::SDL3
imgui

View File

@ -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>("ObjectStore2", "host", &os);
g_provideInstance<ConfigModelI>("ConfigModelI", "host", &conf);
g_provideInstance<Contact3Registry>("Contact3Registry", "1", "host", &cr);
g_provideInstance<RegistryMessageModel>("RegistryMessageModel", "host", &rmm);

View File

@ -2,6 +2,7 @@
#include "./screen.hpp"
#include <solanaceae/object_store/object_store.hpp>
#include <solanaceae/util/simple_config_model.hpp>
#include <solanaceae/contact/contact_model3.hpp>
#include <solanaceae/message3/registry_message_model.hpp>
@ -43,6 +44,8 @@ extern "C" {
struct MainScreen final : public Screen {
SDL_Renderer* renderer;
ObjectStore2 os;
SimpleConfigModel conf;
Contact3Registry cr;
RegistryMessageModel rmm;