mikroSDK Reference Manual
lv_imgbtn.h
Go to the documentation of this file.
1
6#ifndef LV_IMGBTN_H
7#define LV_IMGBTN_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16#include "../../../lvgl.h"
17
18#if LV_USE_IMGBTN != 0
19
20/*********************
21 * DEFINES
22 *********************/
23typedef enum {
24 LV_IMGBTN_STATE_RELEASED,
25 LV_IMGBTN_STATE_PRESSED,
26 LV_IMGBTN_STATE_DISABLED,
27 LV_IMGBTN_STATE_CHECKED_RELEASED,
28 LV_IMGBTN_STATE_CHECKED_PRESSED,
29 LV_IMGBTN_STATE_CHECKED_DISABLED,
30 _LV_IMGBTN_STATE_NUM,
31} lv_imgbtn_state_t;
32
33/**********************
34 * TYPEDEFS
35 **********************/
36/*Data of image button*/
37typedef struct {
38 lv_obj_t obj;
39 const void * img_src_mid[_LV_IMGBTN_STATE_NUM]; /*Store center images to each state*/
40 const void * img_src_left[_LV_IMGBTN_STATE_NUM]; /*Store left side images to each state*/
41 const void * img_src_right[_LV_IMGBTN_STATE_NUM]; /*Store right side images to each state*/
42 lv_img_cf_t act_cf; /*Color format of the currently active image*/
43} lv_imgbtn_t;
44
45extern const lv_obj_class_t lv_imgbtn_class;
46
47/**********************
48 * GLOBAL PROTOTYPES
49 **********************/
50
56lv_obj_t * lv_imgbtn_create(lv_obj_t * parent);
57
58/*======================
59 * Add/remove functions
60 *=====================*/
61
62/*=====================
63 * Setter functions
64 *====================*/
65
77void lv_imgbtn_set_src(lv_obj_t * imgbtn, lv_imgbtn_state_t state, const void * src_left, const void * src_mid,
78 const void * src_right);
79
80
86void lv_imgbtn_set_state(lv_obj_t * imgbtn, lv_imgbtn_state_t state);
87
88/*=====================
89 * Getter functions
90 *====================*/
91
98const void * lv_imgbtn_get_src_left(lv_obj_t * imgbtn, lv_imgbtn_state_t state);
99
106const void * lv_imgbtn_get_src_middle(lv_obj_t * imgbtn, lv_imgbtn_state_t state);
107
114const void * lv_imgbtn_get_src_right(lv_obj_t * imgbtn, lv_imgbtn_state_t state);
115
116
117/*=====================
118 * Other functions
119 *====================*/
120
121/**********************
122 * MACROS
123 **********************/
124
125#endif /*LV_USE_IMGBTN*/
126
127#ifdef __cplusplus
128} /*extern "C"*/
129#endif
130
131#endif /*LV_IMGBTN_H*/
Definition lv_obj_class.h:49
Definition lv_obj.h:174