panel.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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/region.h>
  19. struct rtgui_panel_thread
  20. {
  21. /* thread id */
  22. rt_thread_t tid;
  23. /* the list of thread */
  24. rtgui_list_t list;
  25. /* monitor rect list */
  26. rtgui_list_t monitor_list;
  27. };
  28. typedef struct rtgui_panel_thread rtgui_panel_thread_list_t;
  29. struct rtgui_panel
  30. {
  31. char name[RTGUI_NAME_MAX];
  32. /* the extent of panel */
  33. rtgui_rect_t extent;
  34. /* the list of panel */
  35. rtgui_list_t sibling;
  36. /* the thread list in this panel */
  37. rtgui_list_t thread_list;
  38. /* the workbench manager thread */
  39. rt_thread_t wm_thread;
  40. /* is focusable */
  41. rt_bool_t is_focusable;
  42. };
  43. /* find panel by name */
  44. struct rtgui_panel* rtgui_panel_find(char* name);
  45. /* add or remove application thread from specified panel */
  46. rtgui_panel_t* rtgui_panel_thread_add(char* name, rt_thread_t tid);
  47. void rtgui_panel_thread_remove(rtgui_panel_t* panel, rt_thread_t tid);
  48. rt_thread_t rtgui_panel_get_active_thread(rtgui_panel_t* panel);
  49. void rtgui_panel_set_active_thread(rtgui_panel_t* panel, rt_thread_t tid);
  50. rtgui_panel_t* rtgui_panel_get_contain(int x, int y);
  51. void rtgui_panel_set_wm(rtgui_panel_t* panel, rt_thread_t wm);
  52. void rtgui_panel_append_monitor_rect(rtgui_panel_t* panel, rt_thread_t tid, rtgui_rect_t* rect);
  53. void rtgui_panel_remove_monitor_rect(rtgui_panel_t* panel, rt_thread_t tid, rtgui_rect_t* rect);
  54. #endif