2016-06-08 07:25:08 +02:00
|
|
|
/**
|
2017-10-09 15:21:26 +02:00
|
|
|
* @file lv_indev_proc.h
|
2016-06-08 07:25:08 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-10-09 15:21:26 +02:00
|
|
|
#ifndef LV_indev_proc_H
|
|
|
|
#define LV_indev_proc_H
|
2016-06-08 07:25:08 +02:00
|
|
|
|
2017-07-09 15:32:49 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-06-08 07:25:08 +02:00
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
|
|
|
#include "lv_obj.h"
|
2017-10-09 15:21:26 +02:00
|
|
|
#include "../lv_hal/lv_hal_indev.h"
|
2016-06-08 07:25:08 +02:00
|
|
|
|
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
2016-12-18 22:07:03 +01:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2017-05-14 18:49:44 +02:00
|
|
|
LV_ACTION_RES_INV = 0, /*Typically indicates that the object is deleted (become invalid) in the action function*/
|
|
|
|
LV_ACTION_RES_OK, /*The object is valid (no deleted) after the action*/
|
2016-12-18 22:07:03 +01:00
|
|
|
}lv_action_res_t;
|
|
|
|
|
2017-10-09 15:21:26 +02:00
|
|
|
typedef lv_action_res_t ( * lv_action_t) (struct __LV_OBJ_T * obj);
|
2016-12-18 22:07:03 +01:00
|
|
|
|
2016-06-08 07:25:08 +02:00
|
|
|
/**********************
|
|
|
|
* GLOBAL PROTOTYPES
|
|
|
|
**********************/
|
2017-01-13 23:27:49 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the display input subsystem
|
|
|
|
*/
|
2017-10-09 15:21:26 +02:00
|
|
|
void lv_indev_proc_init(void);
|
2017-01-13 23:27:49 +01:00
|
|
|
|
2017-06-21 10:26:23 +02:00
|
|
|
/**
|
2017-10-09 15:21:26 +02:00
|
|
|
* Get the currently processed input device. Can be used in action functions too.
|
|
|
|
* @return pointer to the currently processed input device or NULL if no input device processing right now
|
2017-06-21 10:26:23 +02:00
|
|
|
*/
|
2017-10-09 15:21:26 +02:00
|
|
|
lv_indev_t * lv_indev_get_act(void);
|
2017-06-21 10:26:23 +02:00
|
|
|
|
2017-01-13 23:27:49 +01:00
|
|
|
/**
|
|
|
|
* Reset all display inputs
|
|
|
|
*/
|
2017-10-09 15:21:26 +02:00
|
|
|
void lv_indev_reset(lv_indev_t * indev);
|
2017-01-13 23:27:49 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reset the long press state of a display input
|
2017-10-09 15:21:26 +02:00
|
|
|
* @param indev_proc pointer to a display input
|
2017-01-13 23:27:49 +01:00
|
|
|
*/
|
2017-10-09 15:21:26 +02:00
|
|
|
void lv_indev_reset_lpr(lv_indev_t * indev_proc);
|
2017-01-13 23:27:49 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the last point on display input
|
2017-10-09 15:21:26 +02:00
|
|
|
* @param indev_proc pointer to a display input
|
2017-01-13 23:27:49 +01:00
|
|
|
* @param point pointer to a point to store the result
|
|
|
|
*/
|
2017-10-09 15:21:26 +02:00
|
|
|
void lv_indev_get_point(lv_indev_t * indev_proc, point_t * point);
|
2017-01-13 23:27:49 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if there is dragging on display input or not
|
2017-10-09 15:21:26 +02:00
|
|
|
* @param indev_proc pointer to a display input
|
2017-01-13 23:27:49 +01:00
|
|
|
* @return true: drag is in progress
|
|
|
|
*/
|
2017-10-09 15:21:26 +02:00
|
|
|
bool lv_indev_is_dragging(lv_indev_t * indev_proc);
|
2017-01-13 23:27:49 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the vector of dragging on a display input
|
2017-10-09 15:21:26 +02:00
|
|
|
* @param indev_proc pointer to a display input
|
2017-01-13 23:27:49 +01:00
|
|
|
* @param point pointer to a point to store the vector
|
|
|
|
*/
|
2017-10-09 15:21:26 +02:00
|
|
|
void lv_indev_get_vect(lv_indev_t * indev_proc, point_t * point);
|
2017-01-13 23:27:49 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Do nothing until the next release
|
2017-10-09 15:21:26 +02:00
|
|
|
* @param indev_proc pointer to a display input
|
2017-01-13 23:27:49 +01:00
|
|
|
*/
|
2017-10-09 15:21:26 +02:00
|
|
|
void lv_indev_wait_release(lv_indev_t * indev_proc);
|
2016-06-08 07:25:08 +02:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
2017-07-09 15:32:49 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
2016-12-17 12:02:30 +01:00
|
|
|
#endif
|
2017-07-09 15:32:49 +02:00
|
|
|
|
2017-10-09 15:21:26 +02:00
|
|
|
#endif /*LV_indev_proc_H*/
|