mywidget.h 873 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __MY_WIDGET_H__
  2. #define __MY_WIDGET_H__
  3. #include <rtgui/rtgui.h>
  4. #include <rtgui/widgets/widget.h>
  5. #define MYWIDGET_STATUS_ON 1
  6. #define MYWIDGET_STATUS_OFF 0
  7. /** Gets the type of a button */
  8. #define RTGUI_MYWIDGET_TYPE (rtgui_mywidget_type_get())
  9. /** Casts the object to an rtgui_button */
  10. #define RTGUI_MYWIDGET(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_MYWIDGET_TYPE, rtgui_mywidget_t))
  11. /** Checks if the object is an rtgui_button */
  12. #define RTGUI_IS_MYWIDGET(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_MYWIDGET_TYPE))
  13. /* 个性化控件 */
  14. struct rtgui_mywidget
  15. {
  16. struct rtgui_widget parent;
  17. /* 状态:ON、OFF */
  18. rt_uint8_t status;
  19. };
  20. typedef struct rtgui_mywidget rtgui_mywidget_t;
  21. struct rtgui_mywidget* rtgui_mywidget_create(rtgui_rect_t* r);
  22. void rtgui_mywidget_destroy(struct rtgui_mywidget* me);
  23. #endif