rtgui_server.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * File : rtgui_server.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 __RTGUI_SERVER_H__
  15. #define __RTGUI_SERVER_H__
  16. #include <rtservice.h>
  17. #include <rtgui/list.h>
  18. /* RTGUI server definitions */
  19. /* top window definitions in server */
  20. enum rtgui_topwin_flag
  21. {
  22. WINTITLE_INIT = 0x00,
  23. WINTITLE_ACTIVATE = 0x01,
  24. WINTITLE_NOFOCUS = 0x02,
  25. /* window is hidden by default */
  26. WINTITLE_SHOWN = 0x04,
  27. /* window is modaled by other window */
  28. WINTITLE_MODALED = 0x08,
  29. /* window is modaling other window */
  30. WINTITLE_MODALING = 0x100,
  31. WINTITLE_ONTOP = 0x200,
  32. WINTITLE_ONBTM = 0x400,
  33. };
  34. struct rtgui_topwin
  35. {
  36. /* the window flag */
  37. enum rtgui_topwin_flag flag;
  38. /* event mask */
  39. rt_uint32_t mask;
  40. struct rtgui_wintitle *title;
  41. /* the window id */
  42. struct rtgui_win *wid;
  43. /* which app I belong */
  44. struct rtgui_app *app;
  45. /* the extent information */
  46. rtgui_rect_t extent;
  47. struct rtgui_topwin *parent;
  48. /* we need to iterate the topwin list with usual order(get target window)
  49. * or reversely(painting). So it's better to use a double linked list */
  50. rt_list_t list;
  51. rt_list_t child_list;
  52. /* the monitor rect list */
  53. rtgui_list_t monitor_list;
  54. };
  55. /* top win manager init */
  56. void rtgui_topwin_init(void);
  57. void rtgui_server_init(void);
  58. void rtgui_server_install_show_win_hook(void (*hk)(void));
  59. void rtgui_server_install_act_win_hook(void (*hk)(void));
  60. /* post an event to server */
  61. void rtgui_server_post_event(struct rtgui_event *event, rt_size_t size);
  62. rt_err_t rtgui_server_post_event_sync(struct rtgui_event *event, rt_size_t size);
  63. #endif