Step 161: add plugin API and loader

This commit is contained in:
Bill
2026-02-09 19:51:42 -07:00
parent 300cf070b2
commit 898f68543b
6 changed files with 279 additions and 1 deletions

28
editor/src/PluginAPI.h Normal file
View File

@@ -0,0 +1,28 @@
#pragma once
// Step 161: Plugin API definition
#include <string>
struct PluginDescriptor {
std::string name;
std::string version;
std::string apiVersion;
std::string author;
std::string entrySymbol;
};
struct PluginHost {
void* ctx = nullptr;
void (*registerConcept)(void* ctx, const char* name) = nullptr;
void (*registerGenerator)(void* ctx, const char* language) = nullptr;
void (*registerGrammar)(void* ctx, const char* language) = nullptr;
void (*registerAnnotation)(void* ctx, const char* name) = nullptr;
void (*registerPanel)(void* ctx, const char* name) = nullptr;
void (*registerCommand)(void* ctx, const char* commandId) = nullptr;
void (*registerKeybinding)(void* ctx, const char* commandId,
const char* keybinding) = nullptr;
};
using PluginInitFn = bool (*)(const PluginHost* host,
PluginDescriptor* outDescriptor);
using PluginShutdownFn = void (*)();