Step 161: add plugin API and loader
This commit is contained in:
28
editor/src/PluginAPI.h
Normal file
28
editor/src/PluginAPI.h
Normal 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 (*)();
|
||||
Reference in New Issue
Block a user