1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/includes/xna/csharp/screen.hpp

47 lines
1.5 KiB
C++
Raw Permalink Normal View History

2024-07-29 22:03:25 -03:00
#ifndef XNA_CSHARP_SCREEN_HPP
#define XNA_CSHARP_SCREEN_HPP
#include "../default.hpp"
#include "../common/numerics.hpp"
namespace xna {
2024-07-30 09:26:27 -03:00
//A simplified port of System.Windows.Forms.Screen.
//Represents a display device or multiple display devices on a single system.
2024-07-29 22:03:25 -03:00
class Screen {
public:
2024-07-30 09:26:27 -03:00
Screen(intptr_t hmonitor, bool primary, Rectangle bounds, Rectangle workingArea, String const& deviceName) :
hmonitor(hmonitor), primary(primary), bounds(bounds), workingArea(workingArea), deviceName(deviceName) {}
2024-07-29 22:03:25 -03:00
2024-07-30 09:26:27 -03:00
//Gets an array of all displays on the system.
2024-07-29 22:03:25 -03:00
static std::vector<uptr<Screen>> AllScreens();
2024-07-30 09:26:27 -03:00
//Gets the bounds of the display.
2024-07-29 22:03:25 -03:00
constexpr Rectangle Bounds() const { return bounds; }
2024-07-30 09:26:27 -03:00
//Gets the working area of the display.The working area is the desktop area of
//the display, excluding taskbars, docked windows, and docked tool bars.
2024-07-29 22:03:25 -03:00
constexpr Rectangle WorkingArea() const { return workingArea; }
2024-07-30 09:26:27 -03:00
//Gets the monitor handler.
2024-07-29 22:03:25 -03:00
constexpr intptr_t HMonitor() const { return hmonitor; }
2024-07-30 09:26:27 -03:00
// Gets a value indicating whether a particular display is the primary device.
2024-07-29 22:03:25 -03:00
constexpr bool Primary() const { return primary; }
2024-07-30 09:26:27 -03:00
// Gets the device name associated with a display.
2024-07-29 22:03:25 -03:00
constexpr String DeviceName() const { return deviceName; }
2024-07-30 09:41:31 -03:00
constexpr bool operator==(Screen const& other) const {
return hmonitor == other.hmonitor;
}
2024-07-29 22:03:25 -03:00
private:
intptr_t hmonitor{ 0 };
bool primary{ false };
Rectangle bounds{};
Rectangle workingArea{};
String deviceName;
2024-07-30 09:26:27 -03:00
};
2024-07-29 22:03:25 -03:00
}
#endif