port to contact4, minor code changes

This commit is contained in:
Green Sky
2025-03-10 16:31:28 +01:00
parent bb45379199
commit c731d51a46
10 changed files with 94 additions and 76 deletions

View File

@@ -32,12 +32,12 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
}
try {
auto* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1");
auto* cs = PLUG_RESOLVE_INSTANCE(ContactStore4I);
// static store, could be anywhere tho
// construct with fetched dependencies
g_crdtn = std::make_unique<CRDTNotes>();
g_crdtns = std::make_unique<CRDTNotesSync>(*g_crdtn, *cr);
g_crdtns = std::make_unique<CRDTNotesSync>(*g_crdtn, *cs);
// register types
PLUG_PROVIDE_INSTANCE(CRDTNotesSync, plugin_name, g_crdtns.get());

View File

@@ -33,7 +33,7 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
try {
auto* crdtns = PLUG_RESOLVE_INSTANCE(CRDTNotesSync);
auto* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1");
auto* cs = PLUG_RESOLVE_INSTANCE(ContactStore4I);
auto* imguic = PLUG_RESOLVE_INSTANCE_VERSIONED(ImGuiContext, ImGui::GetVersion());
auto* imguimemaf = PLUG_RESOLVE_INSTANCE_VERSIONED(ImGuiMemAllocFunc, ImGui::GetVersion());
auto* imguimemff = PLUG_RESOLVE_INSTANCE_VERSIONED(ImGuiMemFreeFunc, ImGui::GetVersion());
@@ -45,7 +45,7 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
// static store, could be anywhere tho
// construct with fetched dependencies
g_crdtn_imgui = std::make_unique<CRDTNotesImGui>(*crdtns, *cr);
g_crdtn_imgui = std::make_unique<CRDTNotesImGui>(*crdtns, *cs);
// register types
PLUG_PROVIDE_INSTANCE(CRDTNotesImGui, plugin_name, g_crdtn_imgui.get());

View File

@@ -3,7 +3,6 @@
#include <solanaceae/crdtnotes/crdtnotes.hpp>
#include <solanaceae/crdtnotes/crdtnotes_sync.hpp>
#include <solanaceae/crdtnotes_toxsync/crdtnotes_toxsync.hpp>
#include <solanaceae/contact/contact_model3.hpp>
#include <solanaceae/toxcore/tox_interface.hpp>
#include <solanaceae/toxcore/tox_event_interface.hpp>
#include <solanaceae/tox_contacts/tox_contact_model2.hpp>
@@ -37,14 +36,14 @@ SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api)
try {
auto* notes_sync = PLUG_RESOLVE_INSTANCE(CRDTNotesEventI);
auto* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1");
auto* cs = PLUG_RESOLVE_INSTANCE(ContactStore4I);
auto* t = PLUG_RESOLVE_INSTANCE(ToxI);
auto* tep = PLUG_RESOLVE_INSTANCE(ToxEventProviderI);
auto* tcm = PLUG_RESOLVE_INSTANCE(ToxContactModel2);
// static store, could be anywhere tho
// construct with fetched dependencies
g_crdtn_ts = std::make_unique<CRDTNotesToxSync>(*notes_sync, *cr, *t, *tep, *tcm);
g_crdtn_ts = std::make_unique<CRDTNotesToxSync>(*notes_sync, *cs, *t, *tep, *tcm);
// register types
PLUG_PROVIDE_INSTANCE(CRDTNotesToxSync, plugin_name, g_crdtn_ts.get());