rtgui.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. * File : rtgui.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 __RT_GUI_H__
  15. #define __RT_GUI_H__
  16. #include <rtthread.h>
  17. #include <rtgui/rtgui_config.h>
  18. #define RT_INT16_MAX 32767
  19. #define RT_INT16_MIN (-RT_INT16_MAX-1)
  20. struct rtgui_panel;
  21. struct rtgui_event;
  22. struct rtgui_widget;
  23. struct rtgui_win;
  24. typedef struct rtgui_panel rtgui_panel_t;
  25. typedef struct rtgui_win rtgui_win_t;
  26. typedef struct rtgui_workbench rtgui_workbench_t;
  27. typedef rt_bool_t (*rtgui_event_handler_ptr)(struct rtgui_widget* widget, struct rtgui_event* event);
  28. struct rtgui_point
  29. {
  30. rt_int16_t x, y;
  31. };
  32. typedef struct rtgui_point rtgui_point_t;
  33. extern rtgui_point_t rtgui_empty_point;
  34. struct rtgui_rect
  35. {
  36. rt_int16_t x1, y1, x2, y2;
  37. };
  38. typedef struct rtgui_rect rtgui_rect_t;
  39. #define rtgui_rect_width(r) ((r).x2 - (r).x1)
  40. #define rtgui_rect_height(r) ((r).y2 - (r).y1)
  41. enum RTGUI_MARGIN_STYLE
  42. {
  43. RTGUI_MARGIN_LEFT = 0x01,
  44. RTGUI_MARGIN_RIGHT = 0x02,
  45. RTGUI_MARGIN_TOP = 0x04,
  46. RTGUI_MARGIN_BOTTOM = 0x08,
  47. RTGUI_MARGIN_ALL = RTGUI_MARGIN_LEFT | RTGUI_MARGIN_RIGHT | RTGUI_MARGIN_TOP | RTGUI_MARGIN_BOTTOM
  48. };
  49. enum RTGUI_BORDER_STYLE
  50. {
  51. RTGUI_BORDER_NONE = 0,
  52. RTGUI_BORDER_SIMPLE,
  53. RTGUI_BORDER_RAISE,
  54. RTGUI_BORDER_SUNKEN,
  55. RTGUI_BORDER_BOX,
  56. RTGUI_BORDER_STATIC,
  57. RTGUI_BORDER_EXTRA,
  58. RTGUI_BORDER_UP,
  59. RTGUI_BORDER_DOWN
  60. };
  61. #define RTGUI_BORDER_DEFAULT_WIDTH 2
  62. #define RTGUI_WIDGET_DEFAULT_MARGIN 3
  63. enum RTGUI_ORIENTATION
  64. {
  65. RTGUI_HORIZONTAL = 0x01,
  66. RTGUI_VERTICAL = 0x02,
  67. RTGUI_ORIENTATION_BOTH = RTGUI_HORIZONTAL | RTGUI_VERTICAL
  68. };
  69. enum RTGUI_ALIGN
  70. {
  71. RTGUI_ALIGN_NOT = 0x00,
  72. RTGUI_ALIGN_CENTER_HORIZONTAL = 0x01,
  73. RTGUI_ALIGN_LEFT = RTGUI_ALIGN_NOT,
  74. RTGUI_ALIGN_TOP = RTGUI_ALIGN_NOT,
  75. RTGUI_ALIGN_RIGHT = 0x02,
  76. RTGUI_ALIGN_BOTTOM = 0x04,
  77. RTGUI_ALIGN_CENTER_VERTICAL = 0x08,
  78. RTGUI_ALIGN_EXPAND = 0x10,
  79. RTGUI_ALIGN_STRETCH = 0x20
  80. };
  81. enum RTGUI_ARRAW
  82. {
  83. RTGUI_ARRAW_UP = 0,
  84. RTGUI_ARRAW_DOWN,
  85. RTGUI_ARRAW_LEFT,
  86. RTGUI_ARRAW_RIGHT
  87. };
  88. enum RTGUI_MODAL_CODE
  89. {
  90. RTGUI_MODAL_OK,
  91. RTGUI_MODAL_CANCEL
  92. };
  93. typedef enum RTGUI_MODAL_CODE rtgui_modal_code_t;
  94. #include <rtgui/rtgui_object.h>
  95. #endif