20 #ifndef ANTKEEPER_APP_DISPLAY_HPP
21 #define ANTKEEPER_APP_DISPLAY_HPP
52 inline void set_name(
const std::string& name) noexcept
72 m_usable_bounds = bounds;
82 m_refresh_rate = rate;
102 m_orientation = orientation;
106 [[nodiscard]]
inline const int&
get_index() const noexcept
112 [[nodiscard]]
inline const std::string&
get_name() const noexcept
126 return m_usable_bounds;
132 return m_refresh_rate;
136 [[nodiscard]]
inline const float&
get_dpi() const noexcept
144 return m_orientation;
156 return m_connected_publisher.channel();
162 return m_disconnected_publisher.channel();
168 return m_orientation_changed_publisher.channel();
179 int m_refresh_rate{0};
182 bool m_connected{
false};
const bool & is_connected() const noexcept
Returns true if the display is connected, false otherwise.
const geom::rectangle< int > & get_bounds() const noexcept
Returns the bounds of the display, in display units.
const std::string & get_name() const noexcept
Returns the name of the display.
void set_bounds(const geom::rectangle< int > &bounds) noexcept
Sets the bounds of the display.
const geom::rectangle< int > & get_usable_bounds() const noexcept
Returns the usable bounds of the display, which excludes areas reserved by the OS for things like men...
event::channel< display_orientation_changed_event > & get_orientation_changed_channel() noexcept
Returns the channel through which display orientation changed events are published.
const int & get_refresh_rate() const noexcept
Returns the refresh rate of the display, in Hz.
const display_orientation & get_orientation() const noexcept
Returns the current orientation of the display.
void set_orientation(display_orientation orientation) noexcept
Sets the orientation of the display.
event::channel< display_disconnected_event > & get_disconnected_channel() noexcept
Returns the channel through which display disconnected events are published.
void set_usable_bounds(const geom::rectangle< int > &bounds) noexcept
Sets the usable bounds of the display, which excludes areas reserved by the OS for things like menus ...
void set_index(int index) noexcept
Sets the index of the display.
void set_dpi(float dpi) noexcept
Sets the DPI of the display.
void set_refresh_rate(int rate) noexcept
Sets the refresh rate of the display.
const float & get_dpi() const noexcept
Returns the DPI of the display.
void set_name(const std::string &name) noexcept
Sets the name of the display.
const int & get_index() const noexcept
Returns the index of the display.
event::channel< display_connected_event > & get_connected_channel() noexcept
Returns the channel through which display connected events are published.
Channel through which messages are published.
Publishes messages to subscribers.
display_orientation
Display orientations.
n-dimensional axis-aligned rectangle.