1 /** 2 * @file lv_switch.h 3 * 4 */ 5 6 #ifndef LV_SWITCH_H 7 #define LV_SWITCH_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 #include "../lv_conf_internal.h" 17 18 #if LV_USE_SWITCH != 0 19 20 #include "../core/lv_obj.h" 21 22 /********************* 23 * DEFINES 24 *********************/ 25 26 /** Switch knob extra area correction factor */ 27 #define _LV_SWITCH_KNOB_EXT_AREA_CORRECTION 2 28 29 /********************** 30 * TYPEDEFS 31 **********************/ 32 33 typedef struct { 34 lv_obj_t obj; 35 int32_t anim_state; 36 } lv_switch_t; 37 38 extern const lv_obj_class_t lv_switch_class; 39 40 /********************** 41 * GLOBAL PROTOTYPES 42 **********************/ 43 44 /** 45 * Create a switch object 46 * @param parent pointer to an object, it will be the parent of the new switch 47 * @return pointer to the created switch 48 */ 49 lv_obj_t * lv_switch_create(lv_obj_t * parent); 50 51 /********************** 52 * MACROS 53 **********************/ 54 55 #endif /*LV_USE_SWITCH*/ 56 57 #ifdef __cplusplus 58 } /*extern "C"*/ 59 #endif 60 61 #endif /*LV_SWITCH_H*/ 62