-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainpatch.hpp
More file actions
55 lines (42 loc) · 1.03 KB
/
Mainpatch.hpp
File metadata and controls
55 lines (42 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Copyright (C) 2026 Wasted Audio
* SPDX-License-Identifier: ISC
*/
#pragma once
#include "NanoVG.hpp"
#include "Widget.hpp"
#include "PDWidget.hpp"
START_NAMESPACE_DISTRHO
class PDMainpatch : public NanoSubWidget
{
public:
explicit PDMainpatch(Widget* parent);
void addManagedChild(PDWidget* child)
{
managedChildren.push_back(child);
}
bool onMouse(const MouseEvent& ev) override
{
for (auto* child : managedChildren)
child->forwardMouseEvent(ev);
return false;
}
bool onMotion(const MotionEvent& ev) override
{
for (auto* child : managedChildren)
child->forwardMotionEvent(ev);
return false;
}
bool onScroll(const ScrollEvent& ev) override
{
for (auto* child : managedChildren)
child->forwardScrollEvent(ev);
return false;
}
protected:
void onNanoDisplay() override {}
private:
std::vector<PDWidget*> managedChildren;
DISTRHO_LEAK_DETECTOR(PDMainpatch)
};
END_NAMESPACE_DISTRHO