2019-02-02 11:30:40 +08:00
|
|
|
#ifndef GESTURE_H
|
|
|
|
#define GESTURE_H
|
2017-12-06 21:43:47 +08:00
|
|
|
|
|
|
|
typedef enum{
|
|
|
|
TOUCH_MOVE,
|
|
|
|
TOUCH_IDLE
|
|
|
|
}ACTION;
|
|
|
|
|
|
|
|
class c_slide_group;
|
|
|
|
class c_gesture{
|
|
|
|
public:
|
2018-12-11 14:30:09 +08:00
|
|
|
c_gesture(c_wnd* root, c_slide_group* group, c_fifo* hid_fifo);
|
2017-12-06 21:43:47 +08:00
|
|
|
void set_page_group(c_slide_group* group){m_slide_group = group;}
|
|
|
|
protected:
|
|
|
|
bool handle_flip(MSG_INFO &msg);
|
|
|
|
bool on_move(int x);
|
|
|
|
bool on_flip(int x);
|
|
|
|
private:
|
|
|
|
int flip_left();
|
|
|
|
int flip_right();
|
|
|
|
void move_left();
|
|
|
|
void move_right();
|
|
|
|
void handle_hid_msg(MSG_INFO &msg);
|
|
|
|
|
|
|
|
int m_down_x;
|
|
|
|
int m_down_y;
|
|
|
|
int m_move_x;
|
|
|
|
int m_move_y;
|
|
|
|
ACTION m_action;
|
|
|
|
|
|
|
|
c_slide_group* m_slide_group;
|
|
|
|
c_wnd* m_root;
|
2018-12-11 14:30:09 +08:00
|
|
|
c_fifo* m_hid_fifo;
|
2017-12-06 21:43:47 +08:00
|
|
|
|
2018-12-11 14:30:09 +08:00
|
|
|
static void* task_handle_msg(void* param);
|
2017-12-06 21:43:47 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|