LMMS
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//==============================================================================
36{
37private:
39
40public:
41 //==============================================================================
86
87 //==============================================================================
94 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
95
101 Rectangle<float> physicalToLogical (Rectangle<float> physicalRect,
102 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
103
109 Rectangle<int> logicalToPhysical (Rectangle<int> logicalRect,
110 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
111
117 Rectangle<float> logicalToPhysical (Rectangle<float> logicalRect,
118 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
119
125 template <typename ValueType>
126 Point<ValueType> physicalToLogical (Point<ValueType> physicalPoint,
127 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
128
134 template <typename ValueType>
135 Point<ValueType> logicalToPhysical (Point<ValueType> logicalPoint,
136 const Display* useScaleFactorOfDisplay = nullptr) const noexcept;
137
143 const Display* getDisplayForRect (Rectangle<int> rect, bool isPhysical = false) const noexcept;
144
150 const Display* getDisplayForPoint (Point<int> point, bool isPhysical = false) const noexcept;
151
156
158 RectangleList<int> getRectangleList (bool userAreasOnly) const;
159
161 Rectangle<int> getTotalBounds (bool userAreasOnly) const;
162
165
166 #ifndef DOXYGEN
168 void refresh();
169
170 [[deprecated ("Use the getDisplayForPoint or getDisplayForRect methods instead "
171 "as they can deal with converting between logical and physical pixels.")]]
172 const Display& getDisplayContaining (Point<int> position) const noexcept;
173
174 // These methods have been deprecated - use the methods which return a Display* instead as they will return
175 // nullptr on headless systems with no connected displays
176 [[deprecated]] const Display& findDisplayForRect (Rectangle<int>, bool isPhysical = false) const noexcept;
177 [[deprecated]] const Display& findDisplayForPoint (Point<int>, bool isPhysical = false) const noexcept;
178 [[deprecated]] const Display& getMainDisplay() const noexcept;
179 #endif
180
181private:
182 friend class Desktop;
183
184 void init (Desktop&);
185 void findDisplays (float masterScale);
186
187 void updateToLogical();
188
190};
191
192} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_Array.h:56
Definition juce_BorderSize.h:42
void refresh()
Definition juce_Displays.cpp:190
Display emptyDisplay
Definition juce_Displays.h:189
void updateToLogical()
Definition juce_Displays.cpp:305
Rectangle< int > logicalToPhysical(Rectangle< int > logicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
Definition juce_Displays.cpp:110
const Display & getDisplayContaining(Point< int > position) const noexcept
Definition juce_Displays.cpp:388
friend class Desktop
Definition juce_Displays.h:182
const Display * getDisplayForPoint(Point< int > point, bool isPhysical=false) const noexcept
Definition juce_Displays.cpp:64
const Display * getDisplayForRect(Rectangle< int > rect, bool isPhysical=false) const noexcept
Definition juce_Displays.cpp:39
Array< Display > displays
Definition juce_Displays.h:164
const Display & findDisplayForPoint(Point< int >, bool isPhysical=false) const noexcept
Definition juce_Displays.cpp:422
Rectangle< int > physicalToLogical(Rectangle< int > physicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
Definition juce_Displays.cpp:91
const Display & getMainDisplay() const noexcept
Definition juce_Displays.cpp:430
Displays(Desktop &)
Definition juce_Displays.cpp:29
Rectangle< int > getTotalBounds(bool userAreasOnly) const
Definition juce_Displays.cpp:185
const Display & findDisplayForRect(Rectangle< int >, bool isPhysical=false) const noexcept
Definition juce_Displays.cpp:414
const Display * getPrimaryDisplay() const noexcept
Definition juce_Displays.cpp:163
void findDisplays(float masterScale)
Definition juce_linux_Windowing.cpp:592
RectangleList< int > getRectangleList(bool userAreasOnly) const
Definition juce_Displays.cpp:174
Definition juce_Point.h:42
Definition juce_Rectangle.h:67
Definition juce_RectangleList.h:43
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
#define false
Definition ordinals.h:83
Definition juce_Displays.h:44
BorderSize< int > safeAreaInsets
Definition juce_Displays.h:64
Rectangle< int > userArea
Definition juce_Displays.h:56
Rectangle< int > totalArea
Definition juce_Displays.h:51
Point< int > topLeftPhysical
Definition juce_Displays.h:67
double scale
Definition juce_Displays.h:77
double dpi
Definition juce_Displays.h:84
bool isMain
Definition juce_Displays.h:46
ZCONST uch * init
Definition extract.c:2392
#define const
Definition zconf.h:137