box.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * File : box.h
  3. * This file is part of 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-16 Bernard first version
  13. */
  14. #ifndef __RTGUI_BOX_H__
  15. #define __RTGUI_BOX_H__
  16. #include <rtgui/rtgui.h>
  17. #include <rtgui/widgets/widget.h>
  18. #include <rtgui/widgets/container.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. DECLARE_CLASS_TYPE(box);
  23. /** Gets the type of a box */
  24. #define RTGUI_BOX_TYPE (RTGUI_TYPE(box))
  25. /** Casts the object to an rtgui_box */
  26. #define RTGUI_BOX(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_BOX_TYPE, rtgui_box_t))
  27. /** Checks if the object is an rtgui_box */
  28. #define RTGUI_IS_BOX(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_BOX_TYPE))
  29. struct rtgui_box
  30. {
  31. struct rtgui_object parent;
  32. rt_uint16_t orient;
  33. rt_uint16_t border_size;
  34. struct rtgui_container *container;
  35. };
  36. typedef struct rtgui_box rtgui_box_t;
  37. struct rtgui_box *rtgui_box_create(int orientation, int border_size);
  38. void rtgui_box_destroy(struct rtgui_box *box);
  39. void rtgui_box_layout(rtgui_box_t *box);
  40. void rtgui_box_layout_rect(rtgui_box_t *box, struct rtgui_rect *rect);
  41. #ifdef __cplusplus
  42. }
  43. #endif
  44. #endif