panel.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * File : panel.h
  3. * This file is part of RTGUI in RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2009-10-04 Bernard first version
  13. */
  14. #ifndef __RT_PANEL_H__
  15. #define __RT_PANEL_H__
  16. #include <rtgui/rtgui.h>
  17. #include <rtgui/list.h>
  18. #include <rtgui/image.h>
  19. #include <rtgui/widgets/widget.h>
  20. #include <rtgui/widgets/container.h>
  21. #define RTGUI_PANEL_STATUS_MODAL (1ul << 0) /* panel is modal mode showing */
  22. #define RTGUI_PANEL_IS_MODAL_MODE(panel) (panel->status & RTGUI_PANEL_STATUS_MODAL)
  23. typedef struct rtgui_panel rtgui_panel_t;
  24. #define RTGUI_PANEL_TYPE (rtgui_panel_type_get())
  25. #define RTGUI_PANEL(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_PANEL_TYPE, rtgui_panel_t))
  26. #define RTGUI_IS_PANEL(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_PANEL_TYPE))
  27. struct rtgui_panel
  28. {
  29. rtgui_container_t parent;
  30. struct rt_thread* tid; //panelÏß³Ì
  31. PVOID modal_widget;
  32. rt_uint32_t status; //panelµÄ״̬
  33. rtgui_image_t* image; //±³¾°Í¼Æ¬
  34. };
  35. extern rtgui_rect_t *external_clip_rect;
  36. extern rt_uint32_t external_clip_size;
  37. rtgui_type_t *rtgui_panel_type_get(void);
  38. rtgui_panel_t* rtgui_panel_create(int left, int top, int w, int h);
  39. void rtgui_panel_set(rtgui_panel_t *panel);
  40. rtgui_panel_t* rtgui_panel_get(void);
  41. struct rt_thread* PanelGetActiveThread(void);
  42. void PanelSetActiveThread(struct rt_thread* tid);
  43. rt_bool_t rtgui_panel_event_handler(PVOID wdt,rtgui_event_t *event);
  44. void rtgui_panel_show(rtgui_panel_t *panel);
  45. void rtgui_panel_event_loop(rtgui_panel_t *panel);
  46. extern rtgui_panel_t *rtgui_panel;
  47. #endif