Files
GP2040-CE/headers/addonmanager.h
Luke A 1cd95437c8 Hotkeys, Crash, Menu Fix + Tidying (#1324)
* Fix for hotkeys not allowing repeats.

Re-arrange on the main menu screen code.

Added virtual to GPEvent destructors to make sure we are calling all the way up the chain.

* Lock-up fixes, new/delete was happening while the update() function was being called by display

Some code clean-ups, moved all of the gpscreen destructors to virtual so we do not have to switch() the delete function.

Moved some init functions around so we always call init() first

* Add ability to exit menu with pin-based menu toggle. Fix rapid-press of menu toggle
2025-03-26 14:22:36 -04:00

36 lines
662 B
C++

#ifndef _ADDONMANAGER_H_
#define _ADDONMANAGER_H_
#include "gpaddon.h"
#include <vector>
enum ADDON_PROCESS {
CORE0_INPUT,
CORE0_USBREPORT,
CORE1_ALWAYS,
CORE1_LOOP
};
struct AddonBlock {
GPAddon * ptr;
ADDON_PROCESS process;
};
class AddonManager {
public:
AddonManager() {}
~AddonManager() {}
bool LoadAddon(GPAddon*);
bool LoadUSBAddon(GPAddon*);
void ReinitializeAddons();
void PreprocessAddons();
void ProcessAddons();
void PostprocessAddons(bool);
GPAddon * GetAddon(std::string); // hack for NeoPicoLED
private:
std::vector<AddonBlock*> addons; // addons currently loaded
};
#endif