Fully implement IContextMenu

Although all of this stuff is completely untested, and since no host on
Linux uses it we'll likely never know whether this implementation is
correct.
This commit is contained in:
Robbert van der Helm
2021-01-07 16:43:13 +01:00
parent 83d45eef27
commit f944bf4a39
5 changed files with 66 additions and 22 deletions
@@ -46,17 +46,23 @@ class Vst3ContextMenuProxyImpl : public Vst3ContextMenuProxy {
addItem(const Steinberg::Vst::IContextMenuItem& item,
Steinberg::Vst::IContextMenuTarget* target) override;
tresult PLUGIN_API
removeItem(const Item& item,
removeItem(const Steinberg::Vst::IContextMenuItem& item,
Steinberg::Vst::IContextMenuTarget* target) override;
tresult PLUGIN_API popup(Steinberg::UCoord x, Steinberg::UCoord y) override;
/**
* The targets passed when to `addItem` calls made by the plugin. This way
* we can call these same targets later.
* we can call these same targets later. The key here is the item's tag.
*/
std::map<int32, Steinberg::IPtr<Steinberg::Vst::IContextMenuTarget>>
context_menu_targets;
private:
Vst3Bridge& bridge;
/**
* The items passed when to `addItem` calls made by the plugin. This way we
* can call these same targets later.
*/
std::vector<Steinberg::Vst::IContextMenuItem> items;
};