LMMS
Loading...
Searching...
No Matches
juce::Displays Class Reference

#include <juce_Displays.h>

Classes

struct  Display

Public Member Functions

Rectangle< intphysicalToLogical (Rectangle< int > physicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
Rectangle< float > physicalToLogical (Rectangle< float > physicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
Rectangle< intlogicalToPhysical (Rectangle< int > logicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
Rectangle< float > logicalToPhysical (Rectangle< float > logicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
template<typename ValueType>
Point< ValueType > physicalToLogical (Point< ValueType > physicalPoint, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
template<typename ValueType>
Point< ValueType > logicalToPhysical (Point< ValueType > logicalPoint, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
const DisplaygetDisplayForRect (Rectangle< int > rect, bool isPhysical=false) const noexcept
const DisplaygetDisplayForPoint (Point< int > point, bool isPhysical=false) const noexcept
const DisplaygetPrimaryDisplay () const noexcept
RectangleList< intgetRectangleList (bool userAreasOnly) const
Rectangle< intgetTotalBounds (bool userAreasOnly) const
void refresh ()
const DisplaygetDisplayContaining (Point< int > position) const noexcept
const DisplayfindDisplayForRect (Rectangle< int >, bool isPhysical=false) const noexcept
const DisplayfindDisplayForPoint (Point< int >, bool isPhysical=false) const noexcept
const DisplaygetMainDisplay () const noexcept

Public Attributes

Array< Displaydisplays

Private Member Functions

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

Private Attributes

Display emptyDisplay

Friends

class Desktop

Detailed Description

Manages details about connected display devices.

@tags{GUI}

Constructor & Destructor Documentation

◆ Displays()

juce::Displays::Displays ( Desktop & desktop)
private

Member Function Documentation

◆ findDisplayForPoint()

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

◆ findDisplayForRect()

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

◆ findDisplays()

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

◆ getDisplayContaining()

const Displays::Display & juce::Displays::getDisplayContaining ( Point< int > position) const
noexcept

◆ 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.

◆ 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.

◆ getMainDisplay()

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

◆ 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.

◆ 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 & desktop)
private

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ refresh()

void juce::Displays::refresh ( )

◆ updateToLogical()

void juce::Displays::updateToLogical ( )
private

This is called when the displays Array has been filled out with the info for all connected displays and the totalArea and userArea Rectangles need to be converted from physical to logical coordinates.

◆ 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.

◆ emptyDisplay

Display juce::Displays::emptyDisplay
private

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