rtgui_system.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * File : rtgui_system.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_SYSTEM_H__
  15. #define __RTGUI_SYSTEM_H__
  16. #include <rtthread.h>
  17. #include <rtgui/rtgui.h>
  18. struct rtgui_dc;
  19. struct rtgui_event;
  20. struct rtgui_widget;
  21. struct rtgui_timer;
  22. typedef void (*rtgui_timeout_func)(struct rtgui_timer *timer, void *parameter);
  23. struct rtgui_timer
  24. {
  25. /* context thread id */
  26. rt_thread_t tid;
  27. /* rt timer */
  28. struct rt_timer timer;
  29. /* timeout function and user data */
  30. rtgui_timeout_func timeout;
  31. void *user_data;
  32. };
  33. typedef struct rtgui_timer rtgui_timer_t;
  34. rtgui_timer_t *rtgui_timer_create(rt_int32_t time, rt_base_t flag, rtgui_timeout_func timeout, void *parameter);
  35. void rtgui_timer_destory(rtgui_timer_t *timer);
  36. void rtgui_timer_start(rtgui_timer_t *timer);
  37. void rtgui_timer_stop(rtgui_timer_t *timer);
  38. /* rtgui system initialization function */
  39. void rtgui_system_server_init(void);
  40. void *rtgui_malloc(rt_size_t size);
  41. void rtgui_free(void *ptr);
  42. void *rtgui_realloc(void *ptr, rt_size_t size);
  43. #ifdef _WIN32_NATIVE
  44. #define rtgui_enter_critical()
  45. #define rtgui_exit_critical()
  46. #else
  47. #define rtgui_enter_critical rt_enter_critical
  48. #define rtgui_exit_critical rt_exit_critical
  49. #endif
  50. rt_thread_t rtgui_get_server(void);
  51. void rtgui_set_mainwin_rect(struct rtgui_rect *rect);
  52. void rtgui_get_mainwin_rect(struct rtgui_rect *rect);
  53. void rtgui_get_screen_rect(struct rtgui_rect *rect);
  54. void rtgui_screen_lock(rt_int32_t timeout);
  55. void rtgui_screen_unlock(void);
  56. struct rtgui_event;
  57. rt_err_t rtgui_send(rt_thread_t tid, struct rtgui_event *event, rt_size_t event_size);
  58. rt_err_t rtgui_send_urgent(rt_thread_t tid, struct rtgui_event *event, rt_size_t event_size);
  59. rt_err_t rtgui_send_sync(rt_thread_t tid, struct rtgui_event *event, rt_size_t event_size);
  60. rt_err_t rtgui_ack(struct rtgui_event *event, rt_int32_t status);
  61. rt_err_t rtgui_recv(struct rtgui_event *event, rt_size_t event_size);
  62. rt_err_t rtgui_recv_nosuspend(struct rtgui_event *event, rt_size_t event_size);
  63. rt_err_t rtgui_recv_filter(rt_uint32_t type, struct rtgui_event *event, rt_size_t event_size);
  64. #endif