progressbar.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef __RTGUI_PROGRESSBAR_H__
  2. #define __RTGUI_PROGRESSBAR_H__
  3. #include <rtgui/rtgui.h>
  4. #include <rtgui/widgets/widget.h>
  5. /** Gets the type of a progressbar */
  6. #define RTGUI_PROGRESSBAR_TYPE (rtgui_progressbar_type_get())
  7. /** Casts the object to a rtgui_progressbar */
  8. #define RTGUI_PROGRESSBAR(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PROGRESSBAR_TYPE, rtgui_progressbar_t))
  9. /** Checks if the object is a rtgui_progressbar */
  10. #define RTGUI_IS_PROGRESSBAR(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PROGRESSBAR_TYPE))
  11. #define DEFAULT_WIDTH 100
  12. #define DEFAULT_HEIGHT 20
  13. struct rtgui_progressbar
  14. {
  15. struct rtgui_widget parent;
  16. int orientation;
  17. int range;
  18. int position;
  19. };
  20. typedef struct rtgui_progressbar rtgui_progressbar_t;
  21. rtgui_type_t *rtgui_progressbar_type_get(void);
  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