aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/label/lv_label_private.h
blob: 81a2e68ec383f12ff0ca106254eb807e16f6c8cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
 * @file lv_label_private.h
 *
 */

#ifndef LV_LABEL_PRIVATE_H
#define LV_LABEL_PRIVATE_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/

#include "../../draw/lv_draw_label_private.h"
#include "../../core/lv_obj_private.h"
#include "lv_label.h"

#if LV_USE_LABEL != 0

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

struct lv_label_t {
    lv_obj_t obj;
    char * text;
    union {
        char * tmp_ptr; /**< Pointer to the allocated memory containing the character replaced by dots */
        char tmp[LV_LABEL_DOT_NUM + 1]; /**< Directly store the characters if <=4 characters */
    } dot;
    uint32_t dot_end;  /**< The real text length, used in dot mode */

#if LV_LABEL_LONG_TXT_HINT
    lv_draw_label_hint_t hint;
#endif

#if LV_LABEL_TEXT_SELECTION
    uint32_t sel_start;
    uint32_t sel_end;
#endif

    lv_point_t size_cache;              /**< Text size cache */
    lv_point_t offset;                  /**< Text draw position offset */
    lv_label_long_mode_t long_mode : 3; /**< Determine what to do with the long texts */
    uint8_t static_txt : 1;             /**< Flag to indicate the text is static */
    uint8_t expand : 1;                 /**< Ignore real width (used by the library with LV_LABEL_LONG_SCROLL) */
    uint8_t dot_tmp_alloc : 1;          /**< 1: dot is allocated, 0: dot directly holds up to 4 chars */
    uint8_t invalid_size_cache : 1;     /**< 1: Recalculate size and update cache */
};


/**********************
 * GLOBAL PROTOTYPES
 **********************/

/**********************
 *      MACROS
 **********************/

#endif /* LV_USE_LABEL != 0 */

#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif /*LV_LABEL_PRIVATE_H*/