rtgui_server.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 rtgui_topwin_flag
  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. WINTITLE_ONTOP = 0x200,
  36. WINTITLE_ONBTM = 0x400,
  37. };
  38. #define WINTITLE_HEIGHT 20
  39. #define WINTITLE_CB_WIDTH 16
  40. #define WINTITLE_CB_HEIGHT 16
  41. #define WINTITLE_BORDER_SIZE 2
  42. struct rtgui_topwin
  43. {
  44. /* the window flag */
  45. enum rtgui_topwin_flag flag;
  46. /* event mask */
  47. rt_uint32_t mask;
  48. struct rtgui_wintitle* title;
  49. /* the window id */
  50. struct rtgui_win* wid;
  51. /* the thread id */
  52. rt_thread_t tid;
  53. /* the extent information */
  54. rtgui_rect_t extent;
  55. struct rtgui_topwin *parent;
  56. /* we need to iterate the topwin list with usual order(get target window)
  57. * or reversely(painting). So it's better to use a double linked list */
  58. struct rtgui_dlist_node list;
  59. struct rtgui_dlist_node child_list;
  60. /* the monitor rect list */
  61. rtgui_list_t monitor_list;
  62. };
  63. typedef struct rtgui_topwin rtgui_topwin_t;
  64. /* top win manager init */
  65. void rtgui_topwin_init(void);
  66. void rtgui_server_init(void);
  67. /* post an event to server */
  68. void rtgui_server_post_event(struct rtgui_event* event, rt_size_t size);
  69. rt_err_t rtgui_server_post_event_sync(struct rtgui_event* event, rt_size_t size);
  70. #endif