JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::Displays Class Reference

Manages details about connected display devices. More...

#include <juce_Displays.h>

Collaboration diagram for juce::Displays:

Classes

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

Public Member Functions

const DisplayfindDisplayForPoint (Point< int >, bool isPhysical=false) const noexcept
 Returns the Display object representing the display containing a given Point (either in logical or physical pixels). More...
 
const DisplayfindDisplayForRect (Rectangle< int >, bool isPhysical=false) const noexcept
 Returns the Display object representing the display containing a given Rectangle (either in logical or physical pixels). More...
 
const DisplaygetMainDisplay () const noexcept
 Returns the Display object representing the display acting as the user's main screen. More...
 
RectangleList< intgetRectangleList (bool userAreasOnly) const
 Returns a RectangleList made up of all the displays in LOGICAL pixels. More...
 
Rectangle< intgetTotalBounds (bool userAreasOnly) const
 Returns the smallest bounding box which contains all the displays in LOGICAL pixels. More...
 
Rectangle< intlogicalToPhysical (Rectangle< int >, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts a Rectangle from logical to physical pixels. More...
 
template<typename ValueType >
Point< ValueType > logicalToPhysical (Point< ValueType >, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts a Point from logical to physical pixels. More...
 
Rectangle< intphysicalToLogical (Rectangle< int >, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts a Rectangle from physical to logical pixels. More...
 
template<typename ValueType >
Point< ValueType > physicalToLogical (Point< ValueType >, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
 Converts a Point from physical to logical pixels. More...
 

Public Attributes

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

Private Member Functions

 Displays (Desktop &)
 
void findDisplays (float masterScale)
 
void init (Desktop &)
 
void updateToLogical ()
 

Friends

class Desktop
 

Detailed Description

Manages details about connected display devices.

{GUI}

Constructor & Destructor Documentation

◆ Displays()

juce::Displays::Displays ( Desktop )
private

Member Function Documentation

◆ findDisplayForPoint()

const Display& juce::Displays::findDisplayForPoint ( Point< int ,
bool  isPhysical = false 
) const
noexcept

Returns the Display object representing the display containing a given Point (either in logical or physical pixels).

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

◆ findDisplayForRect()

const Display& juce::Displays::findDisplayForRect ( Rectangle< int ,
bool  isPhysical = false 
) const
noexcept

Returns the Display object representing the display containing a given Rectangle (either in logical or physical pixels).

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

Referenced by juce::OpenGLContext::NativeContext::getWindowScaleFactor().

◆ findDisplays()

void juce::Displays::findDisplays ( float  masterScale)
private

◆ getMainDisplay()

const Display& juce::Displays::getMainDisplay ( ) const
noexcept

Returns the Display object representing the display acting as the user's main screen.

Referenced by juce::OpenGLContext::NativeContext::updateWindowPosition().

◆ getRectangleList()

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

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

◆ getTotalBounds()

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

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

◆ init()

void juce::Displays::init ( Desktop )
private

◆ logicalToPhysical() [1/2]

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

Converts a 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.

◆ logicalToPhysical() [2/2]

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

Converts a Point from logical to physical pixels.

◆ physicalToLogical() [1/2]

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

Converts a 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.

◆ physicalToLogical() [2/2]

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

Converts a Point from physical to logical pixels.

◆ updateToLogical()

void juce::Displays::updateToLogical ( )
private

Friends And Related Function Documentation

◆ Desktop

friend class Desktop
friend

Member Data Documentation

◆ displays

Array<Display> juce::Displays::displays

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


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