2016-06-08 07:25:08 +02:00
|
|
|
/**
|
|
|
|
* @file lv_rect.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LV_LABEL_H
|
|
|
|
#define LV_LABEL_H
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
2016-06-10 15:00:56 +02:00
|
|
|
#include "lv_conf.h"
|
2016-06-08 07:25:08 +02:00
|
|
|
#if USE_LV_LABEL != 0
|
|
|
|
|
|
|
|
#include "../lv_obj/lv_obj.h"
|
|
|
|
#include "../lv_misc/font.h"
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
|
|
|
|
2016-10-07 11:15:46 +02:00
|
|
|
/*Style of label*/
|
2016-06-08 07:25:08 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
2016-10-07 11:15:46 +02:00
|
|
|
lv_objs_t objs; /*Style of ancestor*/
|
|
|
|
/*New style element for this type */
|
2016-06-08 07:25:08 +02:00
|
|
|
font_types_t font;
|
|
|
|
uint16_t letter_space;
|
|
|
|
uint16_t line_space;
|
|
|
|
uint8_t mid :1;
|
|
|
|
}lv_labels_t;
|
|
|
|
|
2016-10-07 11:15:46 +02:00
|
|
|
/*Built-in styles of label*/
|
2016-06-08 07:25:08 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
LV_LABELS_DEF,
|
|
|
|
LV_LABELS_BTN,
|
|
|
|
LV_LABELS_TXT,
|
|
|
|
LV_LABELS_TITLE,
|
|
|
|
}lv_labels_builtin_t;
|
2016-10-07 11:15:46 +02:00
|
|
|
|
|
|
|
/*Data of label*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/*Inherited from 'base_obj' so no inherited ext.*/ /*Ext. of ancestor*/
|
|
|
|
/*New data for this type */
|
|
|
|
char * txt;
|
|
|
|
uint8_t fixw :1;
|
|
|
|
}lv_label_ext_t;
|
2016-06-08 07:25:08 +02:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* GLOBAL PROTOTYPES
|
|
|
|
**********************/
|
|
|
|
/*Create function*/
|
2016-10-07 11:15:46 +02:00
|
|
|
lv_obj_t * lv_label_create(lv_obj_t * par, lv_obj_t * copy);
|
|
|
|
bool lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param);
|
|
|
|
lv_labels_t * lv_labels_get(lv_labels_builtin_t style, lv_labels_t * copy);
|
2016-06-15 10:23:10 +02:00
|
|
|
|
2016-10-07 11:15:46 +02:00
|
|
|
void lv_label_set_text(lv_obj_t * label, const char * text);
|
|
|
|
void lv_label_set_fixw(lv_obj_t * label, bool fixw);
|
|
|
|
const char * lv_label_get_text(lv_obj_t * label);
|
|
|
|
bool lv_label_get_fixw(lv_obj_t * label);
|
|
|
|
void lv_label_get_letter_pos(lv_obj_t * label, uint16_t index, point_t * pos);
|
|
|
|
uint16_t lv_label_get_letter_on(lv_obj_t * label, point_t * pos);
|
2016-06-08 07:25:08 +02:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|