CppPlugins/inc/plugin.h

27 lines
444 B
C
Raw Normal View History

2020-02-20 12:21:43 +01:00
#pragma once
#include <jni.h>
#include <map>
#include <string>
2020-02-20 19:23:28 +01:00
#include "event.h"
2020-02-20 12:21:43 +01:00
2020-02-20 19:23:28 +01:00
//fwd declr
class CppPlugin;
2020-02-20 12:21:43 +01:00
//function pointer
2020-02-20 20:17:00 +01:00
typedef void (*eventfptr)(JNIEnv*, CppPlugin*, Event*);
2020-02-20 12:21:43 +01:00
typedef CppPlugin* (*initfptr)();
2020-02-20 19:23:28 +01:00
class CppPlugin {
public:
void* handle;
2020-02-21 09:57:24 +01:00
std::string name;
2020-02-20 19:23:28 +01:00
virtual void onLoad();
virtual void onEnable();
virtual void onDisable();
virtual std::map<std::string, eventfptr> getEvents();
virtual ~CppPlugin();
};