rtgui_server.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 <rtgui/list.h>
  17. #include <rtgui/dlist.h>
  18. /* RTGUI server definitions */
  19. /* top window definitions in server */
  20. enum
  21. {
  22. WINTITLE_NO = 0x01,
  23. WINTITLE_BORDER = 0x02,
  24. WINTITLE_ACTIVATE = 0x04,
  25. WINTITLE_CLOSEBOX = 0x08,
  26. WINTITLE_MOVE = 0x0C,
  27. WINTITLE_CB_PRESSED = 0x10,
  28. WINTITLE_NOFOCUS = 0x20,
  29. /* window is hidden by default */
  30. WINTITLE_SHOWN = 0x40,
  31. /* window is modaled by other window */
  32. WINTITLE_MODALED = 0x80,
  33. /* window is modaling other window */
  34. WINTITLE_MODALING = 0x100
  35. };
  36. #define WINTITLE_HEIGHT 20
  37. #define WINTITLE_CB_WIDTH 16
  38. #define WINTITLE_CB_HEIGHT 16
  39. #define WINTITLE_BORDER_SIZE 2
  40. struct rtgui_topwin
  41. {
  42. /* the window flag */
  43. rt_uint32_t flag;
  44. /* event mask */
  45. rt_uint32_t mask;
  46. struct rtgui_wintitle* title;
  47. /* the window id */
  48. struct rtgui_win* wid;
  49. /* the thread id */
  50. rt_thread_t tid;
  51. /* the extent information */
  52. rtgui_rect_t extent;
  53. struct rtgui_topwin *parent;
  54. /* we need to iterate the topwin list with usual order(get target window)
  55. * or reversely(painting). So it's better to use a double linked list */
  56. struct rtgui_dlist_node list;
  57. struct rtgui_dlist_node child_list;
  58. /* the monitor rect list */
  59. rtgui_list_t monitor_list;
  60. };
  61. typedef struct rtgui_topwin rtgui_topwin_t;
  62. /* top win manager init */
  63. void rtgui_topwin_init(void);
  64. void rtgui_server_init(void);
  65. /* post an event to server */
  66. void rtgui_server_post_event(struct rtgui_event* event, rt_size_t size);
  67. rt_err_t rtgui_server_post_event_sync(struct rtgui_event* event, rt_size_t size);
  68. #endif