rtgui_system.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #define rtgui_enter_critical rt_enter_critical
  44. #define rtgui_exit_critical rt_exit_critical
  45. #endif