💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.3 KiB

  1. /*
  2. * Copyright (C) 2023 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code 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 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code 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
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_APP_WINDOW_EVENTS_HPP
  20. #define ANTKEEPER_APP_WINDOW_EVENTS_HPP
  21. #include "math/vector.hpp"
  22. namespace app {
  23. class window;
  24. /**
  25. * Event generated when a window has been requested to close.
  26. */
  27. struct window_closed_event
  28. {
  29. /// Pointer to the window that has been requested to close.
  30. window* window;
  31. };
  32. /**
  33. * Event generated when a window has gained or lost focus.
  34. */
  35. struct window_focus_changed_event
  36. {
  37. /// Pointer to the window that has gained or lost focus.
  38. window* window;
  39. /// `true` if the window is in focus, `false` otherwise.
  40. bool in_focus;
  41. };
  42. /**
  43. * Event generated when a window has been moved.
  44. */
  45. struct window_moved_event
  46. {
  47. /// Pointer to the window that has been moved.
  48. window* window;
  49. /// Position of the window, in display units.
  50. math::vector<int, 2> position;
  51. };
  52. /**
  53. * Event generated when a window has been maximized.
  54. */
  55. struct window_maximized_event
  56. {
  57. /// Pointer to the window that has been maximized.
  58. window* window;
  59. };
  60. /**
  61. * Event generated when a window has been minimized.
  62. */
  63. struct window_minimized_event
  64. {
  65. /// Pointer to the window that has been minimized.
  66. window* window;
  67. };
  68. /**
  69. * Event generated when a window has been restored.
  70. */
  71. struct window_restored_event
  72. {
  73. /// Pointer to the window that has been restored.
  74. window* window;
  75. };
  76. /**
  77. * Event generated when a window has been resized.
  78. */
  79. struct window_resized_event
  80. {
  81. /// Pointer to the window that has been resized.
  82. window* window;
  83. /// Window size, in display units.
  84. math::vector<int, 2> size;
  85. };
  86. } // namespace app
  87. #endif // ANTKEEPER_APP_WINDOW_EVENTS_HPP