JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_Displays.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
35class JUCE_API Displays
36{
37private:
39
40public:
41 //==============================================================================
103
104 //==============================================================================
110 Rectangle<int> physicalToLogical (Rectangle<int> physicalRect,
111 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
112
118 Rectangle<float> physicalToLogical (Rectangle<float> physicalRect,
119 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
120
126 Rectangle<int> logicalToPhysical (Rectangle<int> logicalRect,
127 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
128
134 Rectangle<float> logicalToPhysical (Rectangle<float> logicalRect,
135 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
136
142 template <typename ValueType>
143 Point<ValueType> physicalToLogical (Point<ValueType> physicalPoint,
144 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
145
151 template <typename ValueType>
152 Point<ValueType> logicalToPhysical (Point<ValueType> logicalPoint,
153 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
154
160 const Display* getDisplayForRect (Rectangle<int> rect, bool isPhysical = false) const noexcept;
161
167 const Display* getDisplayForPoint (Point<int> point, bool isPhysical = false) const noexcept;
168
172 const Display* getPrimaryDisplay() const noexcept;
173
175 RectangleList<int> getRectangleList (bool userAreasOnly) const;
176
178 Rectangle<int> getTotalBounds (bool userAreasOnly) const;
179
181 Array<Display> displays;
182
183 #ifndef DOXYGEN
185 void refresh();
186
187 [[deprecated ("Use the getDisplayForPoint or getDisplayForRect methods instead "
188 "as they can deal with converting between logical and physical pixels.")]]
189 const Display& getDisplayContaining (Point<int> position) const noexcept;
190
191 // These methods have been deprecated - use the methods which return a Display* instead as they will return
192 // nullptr on headless systems with no connected displays
193 [[deprecated]] const Display& findDisplayForRect (Rectangle<int>, bool isPhysical = false) const noexcept;
194 [[deprecated]] const Display& findDisplayForPoint (Point<int>, bool isPhysical = false) const noexcept;
195 [[deprecated]] const Display& getMainDisplay() const noexcept;
196 #endif
197
198private:
199 friend class Desktop;
200
201 void init (Desktop&);
202 void findDisplays (float masterScale);
203
204 void updateToLogical();
205
206 Display emptyDisplay;
207};
208
209} // namespace juce
Holds a resizable array of primitive or copy-by-value objects.
Definition juce_Array.h:56
Specifies a set of gaps to be left around the sides of a rectangle.
Describes and controls aspects of the computer's desktop.
Manages details about connected display devices.
BorderSize< int > safeAreaInsets
Represents the area of this display in logical pixels that is not functional for displaying content.
BorderSize< int > keyboardInsets
Represents the area of this display in logical pixels that is obscured by an onscreen keyboard.
Rectangle< int > userArea
The total area of this display in logical pixels which isn't covered by OS-dependent objects like the...
Rectangle< int > totalArea
The total area of this display in logical pixels including any OS-dependent objects like the taskbar,...
Point< int > topLeftPhysical
The top-left of this display in physical coordinates.
double scale
The scale factor of this display.
std::optional< double > verticalFrequencyHz
The vertical refresh rate of the display if applicable.
double dpi
The DPI of the display.
bool isMain
This will be true if this is the user's main display device.
Represents a connected display device.
A pair of (x, y) coordinates.
Definition juce_Point.h:42
Maintains a set of rectangles as a complex region.
Manages a rectangle and allows geometric operations to be performed on it.
JUCE Namespace.