rtgui_server.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * File : rtgui_server.h
  3. * This file is part of RT-Thread GUI Engine
  4. * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2009-10-04 Bernard first version
  23. */
  24. #ifndef __RTGUI_SERVER_H__
  25. #define __RTGUI_SERVER_H__
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #include <rtservice.h>
  30. #include <rtgui/list.h>
  31. /* RTGUI server definitions */
  32. /* top window definitions in server */
  33. enum rtgui_topwin_flag
  34. {
  35. WINTITLE_INIT = 0x00,
  36. WINTITLE_ACTIVATE = 0x01,
  37. WINTITLE_NOFOCUS = 0x02,
  38. /* window is hidden by default */
  39. WINTITLE_SHOWN = 0x04,
  40. /* window is modaled by other window */
  41. WINTITLE_MODALED = 0x08,
  42. /* window is modaling other window */
  43. WINTITLE_MODALING = 0x100,
  44. WINTITLE_ONTOP = 0x200,
  45. WINTITLE_ONBTM = 0x400,
  46. };
  47. struct rtgui_topwin
  48. {
  49. /* the window flag */
  50. enum rtgui_topwin_flag flag;
  51. /* event mask */
  52. rt_uint32_t mask;
  53. struct rtgui_wintitle *title;
  54. /* the window id */
  55. struct rtgui_win *wid;
  56. /* which app I belong */
  57. struct rtgui_app *app;
  58. /* the extent information */
  59. rtgui_rect_t extent;
  60. struct rtgui_topwin *parent;
  61. /* we need to iterate the topwin list with usual order(get target window)
  62. * or reversely(painting). So it's better to use a double linked list */
  63. rt_list_t list;
  64. rt_list_t child_list;
  65. /* the monitor rect list */
  66. rtgui_list_t monitor_list;
  67. };
  68. /* top win manager init */
  69. void rtgui_topwin_init(void);
  70. void rtgui_server_init(void);
  71. void rtgui_server_install_show_win_hook(void (*hk)(void));
  72. void rtgui_server_install_act_win_hook(void (*hk)(void));
  73. /* post an event to server */
  74. rt_err_t rtgui_server_post_event(struct rtgui_event *event, rt_size_t size);
  75. rt_err_t rtgui_server_post_event_sync(struct rtgui_event *event, rt_size_t size);
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif