KiCad PCB EDA Suite
Loading...
Searching...
No Matches
touchpad.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef KIPLATFORM_TOUCHPAD_H_
21#define KIPLATFORM_TOUCHPAD_H_
22
23#include <functional>
24#include <memory>
25
26#include <wx/gdicmn.h>
27
28class wxWindow;
29
30namespace KIPLATFORM
31{
32namespace UI
33{
38{
39 double panX;
40 double panY;
41 double zoomFactor;
42 wxPoint zoomAnchor;
43};
44
45
50{
51public:
52 virtual ~TOUCHPAD_GESTURE_HANDLER() = default;
53};
54
55
56using TOUCHPAD_GESTURE_CALLBACK = std::function<void( const TOUCHPAD_GESTURE& )>;
57
62
70std::unique_ptr<TOUCHPAD_GESTURE_HANDLER> CreateTouchpadGestureHandler(
71 wxWindow* aInputWindow, TOUCHPAD_GESTURE_CALLBACK aCallback );
72}
73}
74
75#endif // KIPLATFORM_TOUCHPAD_H_
Owns a platform touchpad input registration for the lifetime of an input window.
Definition touchpad.h:50
bool IsNativeTouchpadGestureAvailable()
Check whether this port provides the native touchpad gesture APIs.
std::unique_ptr< TOUCHPAD_GESTURE_HANDLER > CreateTouchpadGestureHandler(wxWindow *aInputWindow, TOUCHPAD_GESTURE_CALLBACK aCallback)
Register a window for native touchpad pan and pinch gestures when the port supports it.
std::function< void(const TOUCHPAD_GESTURE &)> TOUCHPAD_GESTURE_CALLBACK
Definition touchpad.h:56
A pan and zoom update produced by a native touchpad gesture recognizer.
Definition touchpad.h:38