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
Classes | Public Member Functions | Public Attributes | Friends | List of all members
juce::Displays Class Reference

Manages details about connected display devices. More...

#include "juce_Displays.h"

Classes

struct  Display
 Represents a connected display device. More...
 

Public Member Functions

Rectangle< intphysicalToLogical (Rectangle< int > physicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts an integer Rectangle from physical to logical pixels.
 
Rectangle< floatphysicalToLogical (Rectangle< float > physicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts a floating-point Rectangle from physical to logical pixels.
 
Rectangle< intlogicalToPhysical (Rectangle< int > logicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts an integer Rectangle from logical to physical pixels.
 
Rectangle< floatlogicalToPhysical (Rectangle< float > logicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts a floating-point Rectangle from logical to physical pixels.
 
template<typename ValueType >
Point< ValueType > physicalToLogical (Point< ValueType > physicalPoint, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts a Point from physical to logical pixels.
 
template<typename ValueType >
Point< ValueType > logicalToPhysical (Point< ValueType > logicalPoint, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts a Point from logical to physical pixels.
 
const DisplaygetDisplayForRect (Rectangle< int > rect, bool isPhysical=false) const noexcept
 Returns the Display object representing the display containing a given Rectangle (either in logical or physical pixels), or nullptr if there are no connected displays.
 
const DisplaygetDisplayForPoint (Point< int > point, bool isPhysical=false) const noexcept
 Returns the Display object representing the display containing a given Point (either in logical or physical pixels), or nullptr if there are no connected displays.
 
const DisplaygetPrimaryDisplay () const noexcept
 Returns the Display object representing the display acting as the user's main screen, or nullptr if there are no connected displays.
 
RectangleList< intgetRectangleList (bool userAreasOnly) const
 Returns a RectangleList made up of all the displays in LOGICAL pixels.
 
Rectangle< intgetTotalBounds (bool userAreasOnly) const
 Returns the smallest bounding box which contains all the displays in LOGICAL pixels.
 

Public Attributes

Array< Displaydisplays
 An Array containing the Display objects for all of the connected displays.
 

Friends

class Desktop
 

Detailed Description

Manages details about connected display devices.

@tags{GUI}

Definition at line 35 of file juce_Displays.h.


Class Documentation

◆ juce::Displays::Display

struct juce::Displays::Display

Represents a connected display device.

Definition at line 43 of file juce_Displays.h.

Class Members
double dpi The DPI of the display.

This is the number of physical pixels per inch. To get the number of logical pixels per inch, divide this by the Display::scale value.

bool isMain This will be true if this is the user's main display device.
BorderSize< int > keyboardInsets Represents the area of this display in logical pixels that is obscured by an onscreen keyboard.

This is currently only supported on iOS, and on Android 11+.

This will only return the bounds of the keyboard when it is in 'docked' mode. If the keyboard is floating (e.g. on an iPad using the split keyboard mode), no insets will be reported.

BorderSize< int > safeAreaInsets Represents the area of this display in logical pixels that is not functional for displaying content.

On mobile devices this may be the area covered by display cutouts and notches, where you still want to draw a background but should not position important content.

double scale The scale factor of this display.

For higher-resolution displays, or displays with a user-defined scale factor set, this may be a value other than 1.0.

This value is used to convert between physical and logical pixels. For example, a Component with size 10x10 will use 20x20 physical pixels on a display with a scale factor of 2.0.

Point< int > topLeftPhysical The top-left of this display in physical coordinates.
Rectangle< int > totalArea The total area of this display in logical pixels including any OS-dependent objects like the taskbar, menu bar, etc.
Rectangle< int > userArea The total area of this display in logical pixels which isn't covered by OS-dependent objects like the taskbar, menu bar, etc.
optional< double > verticalFrequencyHz The vertical refresh rate of the display if applicable.

Currently this is only used on Linux for display rate repainting.

Member Function Documentation

◆ getDisplayForPoint()

const Displays::Display * juce::Displays::getDisplayForPoint ( Point< int point,
bool  isPhysical = false 
) const
noexcept

Returns the Display object representing the display containing a given Point (either in logical or physical pixels), or nullptr if there are no connected displays.

If the Point lies outside all the displays then the nearest one will be returned.

Definition at line 64 of file juce_Displays.cpp.

◆ getDisplayForRect()

const Displays::Display * juce::Displays::getDisplayForRect ( Rectangle< int rect,
bool  isPhysical = false 
) const
noexcept

Returns the Display object representing the display containing a given Rectangle (either in logical or physical pixels), or nullptr if there are no connected displays.

If the Rectangle lies outside all the displays then the nearest one will be returned.

Definition at line 39 of file juce_Displays.cpp.

◆ getPrimaryDisplay()

const Displays::Display * juce::Displays::getPrimaryDisplay ( ) const
noexcept

Returns the Display object representing the display acting as the user's main screen, or nullptr if there are no connected displays.

Definition at line 163 of file juce_Displays.cpp.

◆ getRectangleList()

RectangleList< int > juce::Displays::getRectangleList ( bool  userAreasOnly) const

Returns a RectangleList made up of all the displays in LOGICAL pixels.

Definition at line 171 of file juce_Displays.cpp.

◆ getTotalBounds()

Rectangle< int > juce::Displays::getTotalBounds ( bool  userAreasOnly) const

Returns the smallest bounding box which contains all the displays in LOGICAL pixels.

Definition at line 182 of file juce_Displays.cpp.

◆ logicalToPhysical() [1/3]

template<typename ValueType >
Point< ValueType > juce::Displays::logicalToPhysical ( Point< ValueType >  logicalPoint,
const Display useScaleFactorOfDisplay = nullptr 
) const
noexcept

Converts a Point from logical to physical pixels.

If useScaleFactorOfDisplay is not null then its scale factor will be used for the conversion regardless of the display that the Point to be converted is on.

Definition at line 147 of file juce_Displays.cpp.

◆ logicalToPhysical() [2/3]

Rectangle< float > juce::Displays::logicalToPhysical ( Rectangle< float logicalRect,
const Display useScaleFactorOfDisplay = nullptr 
) const
noexcept

Converts a floating-point Rectangle from logical to physical pixels.

If useScaleFactorOfDisplay is not null then its scale factor will be used for the conversion regardless of the display that the Rectangle to be converted is on.

Definition at line 115 of file juce_Displays.cpp.

◆ logicalToPhysical() [3/3]

Rectangle< int > juce::Displays::logicalToPhysical ( Rectangle< int logicalRect,
const Display useScaleFactorOfDisplay = nullptr 
) const
noexcept

Converts an integer Rectangle from logical to physical pixels.

If useScaleFactorOfDisplay is not null then its scale factor will be used for the conversion regardless of the display that the Rectangle to be converted is on.

Definition at line 110 of file juce_Displays.cpp.

◆ physicalToLogical() [1/3]

template<typename ValueType >
Point< ValueType > juce::Displays::physicalToLogical ( Point< ValueType >  physicalPoint,
const Display useScaleFactorOfDisplay = nullptr 
) const
noexcept

Converts a Point from physical to logical pixels.

If useScaleFactorOfDisplay is not null then its scale factor will be used for the conversion regardless of the display that the Point to be converted is on.

Definition at line 130 of file juce_Displays.cpp.

◆ physicalToLogical() [2/3]

Rectangle< float > juce::Displays::physicalToLogical ( Rectangle< float physicalRect,
const Display useScaleFactorOfDisplay = nullptr 
) const
noexcept

Converts a floating-point Rectangle from physical to logical pixels.

If useScaleFactorOfDisplay is not null then its scale factor will be used for the conversion regardless of the display that the Rectangle to be converted is on.

Definition at line 96 of file juce_Displays.cpp.

◆ physicalToLogical() [3/3]

Rectangle< int > juce::Displays::physicalToLogical ( Rectangle< int physicalRect,
const Display useScaleFactorOfDisplay = nullptr 
) const
noexcept

Converts an integer Rectangle from physical to logical pixels.

If useScaleFactorOfDisplay is not null then its scale factor will be used for the conversion regardless of the display that the Rectangle to be converted is on.

Definition at line 91 of file juce_Displays.cpp.

Friends And Related Symbol Documentation

◆ Desktop

friend class Desktop
friend

Definition at line 199 of file juce_Displays.h.

Member Data Documentation

◆ displays

Array<Display> juce::Displays::displays

An Array containing the Display objects for all of the connected displays.

Definition at line 181 of file juce_Displays.h.


The documentation for this class was generated from the following files: