topwin.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * File : topwin.h
  3. * This file is part of RT-Thread GUI Engine
  4. * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2009-10-16 Bernard first version
  23. */
  24. #ifndef __RTGUI_TOPWIN_H__
  25. #define __RTGUI_TOPWIN_H__
  26. #include <rtgui/rtgui.h>
  27. #include <rtgui/region.h>
  28. #include <rtgui/event.h>
  29. #include <rtgui/widgets/title.h>
  30. #include <rtgui/rtgui_server.h>
  31. /* add or remove a top win */
  32. rt_err_t rtgui_topwin_add(struct rtgui_event_win_create *event);
  33. rt_err_t rtgui_topwin_remove(struct rtgui_win *wid);
  34. rt_err_t rtgui_topwin_activate(struct rtgui_event_win_activate *event);
  35. rt_err_t rtgui_topwin_activate_topwin(struct rtgui_topwin *win);
  36. /* show a window */
  37. rt_err_t rtgui_topwin_show(struct rtgui_event_win *event);
  38. /* hide a window */
  39. rt_err_t rtgui_topwin_hide(struct rtgui_event_win *event);
  40. /* move a window */
  41. rt_err_t rtgui_topwin_move(struct rtgui_event_win_move *event);
  42. /* resize a window */
  43. void rtgui_topwin_resize(struct rtgui_win *wid, rtgui_rect_t *r);
  44. /* a window is entering modal mode */
  45. rt_err_t rtgui_topwin_modal_enter(struct rtgui_event_win_modal_enter *event);
  46. /* get window at (x, y) */
  47. struct rtgui_topwin *rtgui_topwin_get_wnd(int x, int y);
  48. struct rtgui_topwin *rtgui_topwin_get_wnd_no_modaled(int x, int y);
  49. //void rtgui_topwin_deactivate_win(struct rtgui_topwin* win);
  50. /* window title */
  51. void rtgui_topwin_title_ondraw(struct rtgui_topwin *win);
  52. void rtgui_topwin_title_onmouse(struct rtgui_topwin *win, struct rtgui_event_mouse *event);
  53. /* monitor rect */
  54. void rtgui_topwin_append_monitor_rect(struct rtgui_win *wid, rtgui_rect_t *rect);
  55. void rtgui_topwin_remove_monitor_rect(struct rtgui_win *wid, rtgui_rect_t *rect);
  56. /* get the topwin that is currently focused */
  57. struct rtgui_topwin *rtgui_topwin_get_focus(void);
  58. struct rtgui_topwin *rtgui_topwin_get_topmost_window_shown_all(void);
  59. #endif