2017-07-19 15:19:10 +02:00
|
|
|
/**
|
|
|
|
* @file lv_group.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LV_GROUP_H
|
|
|
|
#define LV_GROUP_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
2017-07-25 09:02:21 +02:00
|
|
|
#include "lv_conf.h"
|
2017-07-19 15:19:10 +02:00
|
|
|
#include "lv_obj.h"
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
2017-07-25 09:02:21 +02:00
|
|
|
/*Predefined keys to control the focused object via lv_group_send(group, c)*/
|
|
|
|
/*For compatibility in signal function define the keys regardless to LV_OBJ_GROUP*/
|
|
|
|
#define LV_GROUP_KEY_UP 17 /*0x11*/
|
|
|
|
#define LV_GROUP_KEY_DOWN 18 /*0x12*/
|
|
|
|
#define LV_GROUP_KEY_RIGHT 19 /*0x13*/
|
|
|
|
#define LV_GROUP_KEY_LEFT 20 /*0x14*/
|
|
|
|
#define LV_GROUP_KEY_ESC 33 /*0x1B*/
|
|
|
|
#define LV_GROUP_KEY_ENTER 10 /*0x0A, '\n'*/
|
2017-11-18 00:18:19 +01:00
|
|
|
#define LV_GROUP_KEY_NEXT 9 /*0x09, '\t'*/
|
|
|
|
#define LV_GROUP_KEY_PREV 11 /*0x0B, '*/
|
2017-07-19 15:19:10 +02:00
|
|
|
|
2017-07-25 09:02:21 +02:00
|
|
|
#if LV_OBJ_GROUP != 0
|
2017-07-19 15:19:10 +02:00
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
ll_dsc_t obj_ll;
|
2017-07-25 09:02:21 +02:00
|
|
|
lv_obj_t ** obj_focus;
|
|
|
|
void (*style_mod)(lv_style_t * style);
|
2017-07-19 15:19:10 +02:00
|
|
|
lv_style_t style_tmp;
|
2017-07-27 12:07:16 +02:00
|
|
|
uint8_t frozen:1;
|
2017-07-19 15:19:10 +02:00
|
|
|
}lv_group_t;
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* GLOBAL PROTOTYPES
|
|
|
|
**********************/
|
|
|
|
lv_group_t * lv_group_create(void);
|
2017-07-25 09:02:21 +02:00
|
|
|
void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj);
|
|
|
|
void lv_group_rem_obj(lv_obj_t * obj);
|
|
|
|
void lv_group_focus_obj(lv_obj_t * obj);
|
|
|
|
void lv_group_focus_next(lv_group_t * group);
|
|
|
|
void lv_group_focus_prev(lv_group_t * group);
|
2017-07-27 12:07:16 +02:00
|
|
|
void lv_group_focus_freeze(lv_group_t * group, bool en);
|
2017-07-25 09:02:21 +02:00
|
|
|
void lv_group_send(lv_group_t * group, char c);
|
|
|
|
lv_style_t * lv_group_mod_style(lv_group_t * group, const lv_style_t * style);
|
|
|
|
lv_obj_t * lv_group_get_focused(lv_group_t * group);
|
2017-07-19 15:19:10 +02:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
2017-07-25 09:02:21 +02:00
|
|
|
#endif /*LV_OBJ_GROUP != 0*/
|
2017-07-19 15:19:10 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /*LV_GROUP_H*/
|