Customize system menu items through dedicated API (#677)

Document new interface changes.
This commit is contained in:
vldmr11080
2019-11-12 11:48:14 +01:00
committed by Enrico Giordani
parent 9f78af29bf
commit be86cd4028
17 changed files with 350 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "powertoys_events.h"
#include "system_menu_helper.h"
#include <interface/powertoy_module_interface.h>
#include <string>
#include <memory>
@@ -12,6 +13,7 @@ class PowertoyModule;
struct PowertoyModuleDeleter {
void operator()(PowertoyModuleIface* module) const {
if (module) {
powertoys_events().unregister_system_menu_action(module);
powertoys_events().unregister_receiver(module);
module->destroy();
}
@@ -38,6 +40,9 @@ public:
powertoys_events().register_receiver(*want_signals, module);
}
}
if (SystemMenuHelperInstace().HasCustomConfig(module)) {
powertoys_events().register_system_menu_action(module);
}
}
const std::wstring& get_name() const {