progressbar.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef __RTGUI_PROGRESSBAR_H__
  2. #define __RTGUI_PROGRESSBAR_H__
  3. #include <rtgui/rtgui.h>
  4. #include <rtgui/widgets/widget.h>
  5. DECLARE_CLASS_TYPE(progressbar);
  6. /** Gets the type of a progressbar */
  7. #define RTGUI_PROGRESSBAR_TYPE (RTGUI_TYPE(progressbar))
  8. /** Casts the object to a rtgui_progressbar */
  9. #define RTGUI_PROGRESSBAR(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PROGRESSBAR_TYPE, rtgui_progressbar_t))
  10. /** Checks if the object is a rtgui_progressbar */
  11. #define RTGUI_IS_PROGRESSBAR(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PROGRESSBAR_TYPE))
  12. #define DEFAULT_WIDTH 100
  13. #define DEFAULT_HEIGHT 20
  14. struct rtgui_progressbar
  15. {
  16. struct rtgui_widget parent;
  17. int orient;
  18. int range;
  19. int position;
  20. };
  21. typedef struct rtgui_progressbar rtgui_progressbar_t;
  22. struct rtgui_progressbar* rtgui_progressbar_create(int orientation, int range, rtgui_rect_t* r);
  23. void rtgui_progressbar_destroy(struct rtgui_progressbar* p_bar);
  24. rt_bool_t rtgui_progressbar_event_handler(struct rtgui_widget* widget,
  25. struct rtgui_event* event);
  26. void rtgui_progressbar_set_value(struct rtgui_progressbar *p_bar, int value);
  27. int rtgui_progressbar_get_value(struct rtgui_progressbar *p_bar);
  28. void rtgui_progressbar_set_range(struct rtgui_progressbar *p_bar, int range);
  29. int rtgui_progressbar_get_range(struct rtgui_progressbar *p_bar);
  30. #endif