xtd 0.2.0
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 object, public iequatable<screen> {
33 public:
35 screen() = default;
36 screen(const screen&) = default;
37 screen& operator =(const screen&) = default;
39
41
46 int32 bits_per_pixel() const noexcept;
47
50 const drawing::rectangle& bounds() const noexcept;
51
55 const xtd::string& device_name() const;
56
59 bool high_resolution() const noexcept;
60
64 int32 pixels_per_inch() const noexcept;
65
68 bool primary() const noexcept;
69
75 double scale_factor() const noexcept;
76
81 const drawing::rectangle& working_area() const noexcept;
83
85
89 static xtd::array<screen> all_screens();
90
94 static screen primary_screen();
96
98
103 bool equals(const xtd::object& obj) const noexcept override;
107 bool equals(const screen& other) const noexcept override;
108
111 xtd::size get_hash_code() const noexcept override;
113
115
119 static drawing::graphics create_graphics();
120
124 static screen from_control(const control& control);
125
129 static screen from_handle(intptr handle);
130
134 static screen from_point(const drawing::point& point);
135
139 static screen from_rectangle(const drawing::rectangle& rect);
140
144 static drawing::rectangle get_bounds(const control& control);
145
149 static drawing::rectangle get_bounds(intptr handle);
150
154 static drawing::rectangle get_bounds(const drawing::point& point);
155
159 static drawing::rectangle get_bounds(const drawing::rectangle& rect);
160
170 static int32 get_standard_pixels_per_inch();
171
175 static drawing::rectangle get_working_area(const control& control);
176
180 static drawing::rectangle get_working_area(intptr handle);
181
185 static drawing::rectangle get_working_area(const drawing::point& point);
186
190 static drawing::rectangle get_working_area(const drawing::rectangle& rect);
192
193 private:
194 screen(int32 bits_per_pixel, const drawing::rectangle& bounds, const xtd::string& device_name, int32 pixels_per_inch, bool primary, double scale_factor, const drawing::rectangle& working_area);
195
196 int32 bits_per_pixel_ = 0;
197 drawing::rectangle bounds_;
198 xtd::string device_name_;
199 int32 pixels_per_inch_ = 96;
200 bool primary_ = false;
201 double scale_factor_ = 1.;
202 drawing::rectangle working_area_;
203 };
204 }
205}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
Represents a display device or multiple display devices on a single system.
Definition screen.hpp:32
int32 bits_per_pixel() const noexcept
Gets the number of bits of memory, associated with one pixel of data.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:43
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::forms::style_sheets::control class.