1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00
lvgl/lv_obj/lv_group.h

71 lines
1.8 KiB
C
Raw Normal View History

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
*********************/
#include "lv_conf.h"
2017-07-19 15:19:10 +02:00
#include "lv_obj.h"
/*********************
* DEFINES
*********************/
/*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'*/
#define LV_GROUP_KEY_NEXT 9 /*0x09, '\t'*/
#define LV_GROUP_KEY_PREV 11 /*0x0B, '*/
2017-07-19 15:19:10 +02:00
#if LV_OBJ_GROUP != 0
2017-07-19 15:19:10 +02:00
/**********************
* TYPEDEFS
**********************/
typedef struct
{
ll_dsc_t obj_ll;
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);
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);
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
**********************/
#endif /*LV_OBJ_GROUP != 0*/
2017-07-19 15:19:10 +02:00
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_GROUP_H*/