ob_statusbar.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * @file ob_card.c
  3. *
  4. */
  5. /*********************
  6. * INCLUDES
  7. *********************/
  8. #include "lv_conf.h"
  9. #include "config.h"
  10. #if USE_OB_STATUSBAR != 0
  11. #include "ob_statusbar.h"
  12. /**********************
  13. * STATIC VARIABLES
  14. **********************/
  15. static lv_signal_func_t ancestor_signal;
  16. /**********************
  17. * GLOBAL FUNCTIONS
  18. **********************/
  19. lv_obj_t * ob_statusbar_create(lv_obj_t * par, lv_obj_t * copy) {
  20. /*Create the ancestor of statubar*/
  21. lv_obj_t * new_statusbar = lv_obj_create(par, copy);
  22. lv_mem_assert(new_statusbar);
  23. if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_func(new_statusbar);
  24. /*Allocate the statusbar type specific extended data*/
  25. ob_statusbar_ext_t * ext = lv_obj_allocate_ext_attr(new_statusbar, sizeof(ob_statusbar_ext_t));
  26. lv_mem_assert(ext);
  27. /*Initialize the allocated 'ext' */
  28. ext->bAlarm = -1;
  29. ext->bBluetooth = -1;
  30. ext->bWifi = -1;
  31. ext->batteryLevel = -1;
  32. return new_statusbar;
  33. }
  34. #endif