comfortable-swipe/lib/gesture/mouse_swipe_gesture.h
2020-04-17 23:48:58 +08:00

69 lines
1.9 KiB
C++

#ifndef __COMFORTABLE_SWIPE__gesture_mouse_swipe_gesture_h__
#define __COMFORTABLE_SWIPE__gesture_mouse_swipe_gesture_h__
/*
Comfortable Swipe
by Rico Tiongson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "swipe_gesture.h"
#ifdef __cplusplus
extern "C" {
#endif
namespace comfortable_swipe::gesture
{
class mouse_swipe_gesture : public swipe_gesture
{
public:
// constructor
mouse_swipe_gesture(
const char* hold3, // 3 finger mouse down
const char* hold4 // 4 finger mouse down
);
virtual ~mouse_swipe_gesture();
// override begin and end for mousedown
virtual void begin() override;
virtual void update() override;
virtual void end() override;
// provide our own mouse functions
virtual void do_mousedown(const char*);
virtual void do_mouseup(const char*);
virtual bool is_mousedown();
// utility method to parse mouse input given config characters
virtual int parse_mouse_input(const char*);
protected:
// command holders
const char * hold3;
const char * hold4;
// flag we can use to check if mouse is down
bool flag_mousedown;
};
}
#ifdef __cplusplus
}
#endif
#endif /* __COMFORTABLE_SWIPE__gesture_mouse_swipe_gesture_h__ */