I spent about two days altering the juce code and have implemented basic gestures and please let me make a suggestion. Don’t assume what user will do with the gestures and confine it to a few classes. Create virtual functions at the Component level. From what you stated above, you are assuming that only ViewPorts need a swipe. Not always the case and please don’t make this assumption. I use swipe to close a sliding panels and to scroll ViewPorts, and probably more uses like spinning a wheel.
Simply do something like this.
virtual void Component::GestureSwipe(…)
virtual void Component::GesturePan(…)
virtual void Component::GestureTouch(…)
This way you are not restricting the user and they will not have to hack the juce code. If they don’t like the default behavior they can override the virtual function and do whatever. I implemented this way to be generic and cross platform. The default behavior (Component class) can be to map them to mouse events as you’re currently doing.
If you’ll hold off a bit, I’ll cleanup my Gesture code within a few weeks and give it to you. This will save you some time.
BTW, you can’t have windows message WM_TOUCH and WM_GESTURE. You have to enable one or the other.