1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

Change lv_drag_direction_t to lv_drag_dir_t and update documentation

This commit is contained in:
Themba Dube 2019-04-05 08:48:39 -04:00
parent 789e7a3a12
commit 5db6b73725
3 changed files with 12 additions and 12 deletions

View File

@ -1030,7 +1030,7 @@ static void indev_drag(lv_indev_proc_t * state)
if(lv_obj_get_drag(drag_obj) == false) return;
lv_drag_direction_t allowed_dirs = lv_obj_get_drag_dir(drag_obj);
lv_drag_dir_t allowed_dirs = lv_obj_get_drag_dir(drag_obj);
/*Count the movement by drag*/
state->types.pointer.drag_sum.x += state->types.pointer.vect.x;
@ -1120,7 +1120,7 @@ static void indev_drag_throw(lv_indev_proc_t * proc)
return;
}
lv_drag_direction_t allowed_dirs = lv_obj_get_drag_dir(drag_obj);
lv_drag_dir_t allowed_dirs = lv_obj_get_drag_dir(drag_obj);
/*Reduce the vectors*/
proc->types.pointer.drag_throw_vect.x =

View File

@ -1104,9 +1104,9 @@ void lv_obj_set_drag(lv_obj_t * obj, bool en)
/**
* Set the directions an object can be dragged in
* @param obj pointer to an object
* @param en true: make the object dragable
* @param drag_dir bitwise OR of allowed directions an object can be dragged in
*/
void lv_obj_set_drag_dir(lv_obj_t * obj, lv_drag_direction_t drag_dir)
void lv_obj_set_drag_dir(lv_obj_t * obj, lv_drag_dir_t drag_dir)
{
obj->drag_dir = drag_dir;
@ -1713,9 +1713,9 @@ bool lv_obj_get_drag(const lv_obj_t * obj)
/**
* Get the directions an object can be dragged
* @param obj pointer to an object
* @return directions an object can be dragged
* @return bitwise OR of allowed directions an object can be dragged in
*/
lv_drag_direction_t lv_obj_get_drag_dir(const lv_obj_t * obj)
lv_drag_dir_t lv_obj_get_drag_dir(const lv_obj_t * obj)
{
return obj->drag_dir;
}

View File

@ -174,7 +174,7 @@ enum {
LV_DRAG_DIR_VER = 0x2
};
typedef uint8_t lv_drag_direction_t;
typedef uint8_t lv_drag_dir_t;
typedef struct _lv_obj_t
{
@ -196,7 +196,7 @@ typedef struct _lv_obj_t
/*Attributes and states*/
uint8_t click : 1; /*1: Can be pressed by an input device*/
uint8_t drag : 1; /*1: Enable the dragging*/
lv_drag_direction_t drag_dir; /* Which directions the object can be dragged in */
lv_drag_dir_t drag_dir : 2; /* Which directions the object can be dragged in */
uint8_t drag_throw : 1; /*1: Enable throwing with drag*/
uint8_t drag_parent : 1; /*1: Parent will be dragged instead*/
uint8_t hidden : 1; /*1: Object is hidden*/
@ -457,9 +457,9 @@ void lv_obj_set_drag(lv_obj_t * obj, bool en);
/**
* Set the directions an object can be dragged in
* @param obj pointer to an object
* @param en true: make the object dragable
* @param drag_dir bitwise OR of allowed drag directions
*/
void lv_obj_set_drag_dir(lv_obj_t * obj, lv_drag_direction_t drag_dir);
void lv_obj_set_drag_dir(lv_obj_t * obj, lv_drag_dir_t drag_dir);
/**
* Enable the throwing of an object after is is dragged
@ -754,9 +754,9 @@ bool lv_obj_get_drag(const lv_obj_t * obj);
/**
* Get the directions an object can be dragged
* @param obj pointer to an object
* @return directions an object can be dragged
* @return bitwise OR of allowed directions an object can be dragged in
*/
lv_drag_direction_t lv_obj_get_drag_dir(const lv_obj_t * obj);
lv_drag_dir_t lv_obj_get_drag_dir(const lv_obj_t * obj);
/**
* Get the drag throw enable attribute of an object