xtd 1.0.0
Loading...
Searching...
No Matches
screen.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "control.hpp"
6#include <xtd/drawing/rectangle>
7#include <xtd/object>
8#include <cstdint>
9#include <vector>
10
12namespace xtd {
14 namespace forms {
32 class forms_export_ screen : public xtd::object, public xtd::iequatable<screen> {
33 public:
35 screen() = default;
37
39
44 [[nodiscard]] auto bits_per_pixel() const noexcept -> xtd::int32;
45
48 [[nodiscard]] auto bounds() const noexcept -> const xtd::drawing::rectangle&;
49
53 [[nodiscard]] auto device_name() const -> const xtd::string&;
54
57 [[nodiscard]] auto high_resolution() const noexcept -> bool;
58
62 [[nodiscard]] auto pixels_per_inch() const noexcept -> xtd::int32;
63
66 [[nodiscard]] auto primary() const noexcept -> bool;
67
73 [[nodiscard]] auto scale_factor() const noexcept -> double;
74
79 [[nodiscard]] auto working_area() const noexcept -> const xtd::drawing::rectangle&;
81
83
87 [[nodiscard]] static auto all_screens() -> xtd::array<screen>;
88
92 [[nodiscard]] static auto primary_screen() -> screen;
94
96
101 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
105 [[nodiscard]] auto equals(const screen& other) const noexcept -> bool override;
106
109 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::usize override;
111
113
117 [[nodiscard]] static auto create_graphics() -> xtd::drawing::graphics;
118
122 [[nodiscard]] static auto from_control(const xtd::forms::control& control) -> screen;
123
127 [[nodiscard]] static auto from_handle(xtd::intptr handle) -> screen;
128
132 [[nodiscard]] static auto from_point(const xtd::drawing::point& point) -> screen;
133
137 [[nodiscard]] static auto from_rectangle(const xtd::drawing::rectangle& rect) -> screen;
138
142 [[nodiscard]] static auto get_bounds(const xtd::forms::control& control) -> xtd::drawing::rectangle;
143
147 [[nodiscard]] static auto get_bounds(xtd::intptr handle) -> xtd::drawing::rectangle;
148
152 [[nodiscard]] static auto get_bounds(const xtd::drawing::point& point) -> xtd::drawing::rectangle;
153
157 [[nodiscard]] static auto get_bounds(const xtd::drawing::rectangle& rect) -> xtd::drawing::rectangle;
158
168 [[nodiscard]] static auto get_standard_pixels_per_inch() -> xtd::int32;
169
173 [[nodiscard]] static auto get_working_area(const xtd::forms::control& control) -> xtd::drawing::rectangle;
174
178 [[nodiscard]] static auto get_working_area(xtd::intptr handle) -> xtd::drawing::rectangle;
179
183 [[nodiscard]] static auto get_working_area(const xtd::drawing::point& point) -> xtd::drawing::rectangle;
184
188 [[nodiscard]] static auto get_working_area(const xtd::drawing::rectangle& rect) -> xtd::drawing::rectangle;
190
191 private:
192 screen(xtd::int32 bits_per_pixel, const xtd::drawing::rectangle& bounds, const xtd::string& device_name, xtd::int32 pixels_per_inch, bool primary, double scale_factor, const xtd::drawing::rectangle& working_area);
193
194 xtd::int32 bits_per_pixel_ = 0;
195 xtd::drawing::rectangle bounds_;
196 xtd::string device_name_;
197 xtd::int32 pixels_per_inch_ = 96;
198 bool primary_ = false;
199 double scale_factor_ = 1.;
200 xtd::drawing::rectangle working_area_;
201 };
202 }
203}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
auto high_resolution() const noexcept -> bool
Gets a value indicating whether a particular display is high resolution.
auto get_hash_code() const noexcept -> xtd::usize override
Serves as a hash function for a particular type.
auto device_name() const -> const xtd::string &
Gets the device name associated with a display.
static auto primary_screen() -> screen
Gets the primary display.
static auto from_point(const xtd::drawing::point &point) -> screen
Retrieves a screen for the display that contains the specified point.
static auto create_graphics() -> xtd::drawing::graphics
Creates the xtd::drawing::graphics for the screen.
static auto get_standard_pixels_per_inch() -> xtd::int32
Gets the the standard number of pixels per inch of the display.
auto working_area() const noexcept -> const xtd::drawing::rectangle &
Gets the working area of the display. The working area is the desktop area of the display,...
static auto from_control(const xtd::forms::control &control) -> screen
Retrieves a screen for the display that contains the largest portion of the specified control.
auto scale_factor() const noexcept -> double
Gets the scale factor of the display.
static auto from_rectangle(const xtd::drawing::rectangle &rect) -> screen
Retrieves a screen for the display that contains the largest portion of the rectangle.
auto primary() const noexcept -> bool
Gets a value indicating whether a particular display is the primary device.
auto bits_per_pixel() const noexcept -> xtd::int32
Gets the number of bits of memory, associated with one pixel of data.
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
static auto from_handle(xtd::intptr handle) -> screen
Retrieves a screen for the display that contains the largest portion of the object referred to by the...
static auto get_bounds(const xtd::forms::control &control) -> xtd::drawing::rectangle
Retrieves the bounds of the display that contains the largest portion of the specified control.
auto bounds() const noexcept -> const xtd::drawing::rectangle &
Gets the bounds of the display.
static auto all_screens() -> xtd::array< screen >
Gets an array of all displays on the system.
auto pixels_per_inch() const noexcept -> xtd::int32
Gets the number of pixels per inch of the display.
static auto get_working_area(const xtd::forms::control &control) -> xtd::drawing::rectangle
Retrieves the working area for the display that contains the largest region of the specified control....
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
Contains xtd::forms::control control.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
std::intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8