gtkmm 4.14.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gdk::Monitor Class Reference

Object representing an output. More...

#include <gdkmm/monitor.h>

Inheritance diagram for Gdk::Monitor:
Inheritance graph
[legend]

Public Member Functions

 Monitor (Monitor && src) noexcept
 
Monitoroperator= (Monitor && src) noexcept
 
 ~Monitor () noexcept override
 
GdkMonitor * gobj ()
 Provides access to the underlying C GObject. More...
 
const GdkMonitor * gobj () const
 Provides access to the underlying C GObject. More...
 
GdkMonitor * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
Glib::RefPtr< Displayget_display ()
 Gets the display that this monitor belongs to. More...
 
Glib::RefPtr< const Displayget_display () const
 Gets the display that this monitor belongs to. More...
 
void get_geometry (Rectangle & geometry) const
 Retrieves the size and position of the monitor within the display coordinate space. More...
 
int get_width_mm () const
 Gets the width in millimeters of the monitor. More...
 
int get_height_mm () const
 Gets the height in millimeters of the monitor. More...
 
Glib::ustring get_manufacturer () const
 Gets the name or PNP ID of the monitor's manufacturer. More...
 
Glib::ustring get_model () const
 Gets the string identifying the monitor model, if available. More...
 
Glib::ustring get_connector () const
 Gets the name of the monitor's connector, if available. More...
 
int get_scale_factor () const
 Gets the internal scale factor that maps from monitor coordinates to device pixels. More...
 
double get_scale () const
 Gets the internal scale factor that maps from monitor coordinates to device pixels. More...
 
int get_refresh_rate () const
 Gets the refresh rate of the monitor, if available. More...
 
SubpixelLayout get_subpixel_layout () const
 Gets information about the layout of red, green and blue primaries for pixels. More...
 
bool is_valid () const
 Returns true if the monitor object corresponds to a physical monitor. More...
 
Glib::ustring get_description () const
 Gets a string describing the monitor, if available. More...
 
Glib::SignalProxy< void()> signal_invalidate ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_description () const
 A short description of the monitor, meant for display to the user. More...
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Display > > property_display () const
 The Gdk::Display of the monitor. More...
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_manufacturer () const
 The manufacturer name. More...
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_model () const
 The model name. More...
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_connector () const
 The connector name. More...
 
Glib::PropertyProxy_ReadOnly< int > property_scale_factor () const
 The scale factor. More...
 
Glib::PropertyProxy_ReadOnly< double > property_scale () const
 The scale of the monitor. More...
 
Glib::PropertyProxy_ReadOnly< Gdk::Rectangleproperty_geometry () const
 The geometry of the monitor. More...
 
Glib::PropertyProxy_ReadOnly< int > property_width_mm () const
 The width of the monitor, in millimeters. More...
 
Glib::PropertyProxy_ReadOnly< int > property_height_mm () const
 The height of the monitor, in millimeters. More...
 
Glib::PropertyProxy_ReadOnly< int > property_refresh_rate () const
 The refresh rate, in milli-Hertz. More...
 
Glib::PropertyProxy_ReadOnly< SubpixelLayoutproperty_subpixel_layout () const
 The subpixel layout. More...
 
Glib::PropertyProxy_ReadOnly< bool > property_valid () const
 Whether the object is still valid. More...
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 

Protected Member Functions

 Monitor ()
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gdk::Monitorwrap (GdkMonitor * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

Object representing an output.

Gdk::Monitor objects represent the individual outputs that are associated with a Gdk::Display. Display has APIs to enumerate monitors with Display::get_n_monitors() and Display::get_monitor() and to find particular monitors with Display::get_monitor_at_surface().

Since gtkmm 3.22:

Constructor & Destructor Documentation

◆ Monitor() [1/2]

Gdk::Monitor::Monitor ( Monitor &&  src)
noexcept

◆ ~Monitor()

Gdk::Monitor::~Monitor ( )
overridenoexcept

◆ Monitor() [2/2]

Gdk::Monitor::Monitor ( )
protected

Member Function Documentation

◆ get_connector()

Glib::ustring Gdk::Monitor::get_connector ( ) const

Gets the name of the monitor's connector, if available.

These are strings such as "eDP-1", or "HDMI-2". They depend on software and hardware configuration, and should not be relied on as stable identifiers of a specific monitor.

Returns
The name of the connector.

◆ get_description()

Glib::ustring Gdk::Monitor::get_description ( ) const

Gets a string describing the monitor, if available.

This can be used to identify a monitor in the UI.

Since gtkmm 4.10:
Returns
The monitor description.

◆ get_display() [1/2]

Glib::RefPtr< Display > Gdk::Monitor::get_display ( )

Gets the display that this monitor belongs to.

Returns
The display.

◆ get_display() [2/2]

Glib::RefPtr< const Display > Gdk::Monitor::get_display ( ) const

Gets the display that this monitor belongs to.

Returns
The display.

◆ get_geometry()

void Gdk::Monitor::get_geometry ( Rectangle geometry) const

Retrieves the size and position of the monitor within the display coordinate space.

The returned geometry is in ”application pixels”, not in ”device pixels” (see get_scale()).

Parameters
geometryA Gdk::Rectangle to be filled with the monitor geometry.

◆ get_height_mm()

int Gdk::Monitor::get_height_mm ( ) const

Gets the height in millimeters of the monitor.

Returns
The physical height of the monitor.

◆ get_manufacturer()

Glib::ustring Gdk::Monitor::get_manufacturer ( ) const

Gets the name or PNP ID of the monitor's manufacturer.

Note that this value might also vary depending on actual display backend.

The PNP ID registry is located at https://uefi.org/pnp_id_list.

Returns
The name of the manufacturer.

◆ get_model()

Glib::ustring Gdk::Monitor::get_model ( ) const

Gets the string identifying the monitor model, if available.

Returns
The monitor model.

◆ get_refresh_rate()

int Gdk::Monitor::get_refresh_rate ( ) const

Gets the refresh rate of the monitor, if available.

The value is in milli-Hertz, so a refresh rate of 60Hz is returned as 60000.

Returns
The refresh rate in milli-Hertz, or 0.

◆ get_scale()

double Gdk::Monitor::get_scale ( ) const

Gets the internal scale factor that maps from monitor coordinates to device pixels.

This can be used if you want to create pixel based data for a particular monitor, but most of the time you’re drawing to a surface where it is better to use Gdk::Surface::get_scale() instead.

Since gtkmm 4.14:
Returns
The scale.

◆ get_scale_factor()

int Gdk::Monitor::get_scale_factor ( ) const

Gets the internal scale factor that maps from monitor coordinates to device pixels.

On traditional systems this is 1, but on very high density outputs it can be a higher value (often 2).

This can be used if you want to create pixel based data for a particular monitor, but most of the time you’re drawing to a surface where it is better to use Gdk::Surface::get_scale_factor() instead.

Returns
The scale factor.

◆ get_subpixel_layout()

SubpixelLayout Gdk::Monitor::get_subpixel_layout ( ) const

Gets information about the layout of red, green and blue primaries for pixels.

Returns
The subpixel layout.

◆ get_type()

static GType Gdk::Monitor::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ get_width_mm()

int Gdk::Monitor::get_width_mm ( ) const

Gets the width in millimeters of the monitor.

Returns
The physical width of the monitor.

◆ gobj() [1/2]

GdkMonitor * Gdk::Monitor::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GdkMonitor * Gdk::Monitor::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ gobj_copy()

GdkMonitor * Gdk::Monitor::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ is_valid()

bool Gdk::Monitor::is_valid ( ) const

Returns true if the monitor object corresponds to a physical monitor.

The monitor becomes invalid when the physical monitor is unplugged or removed.

Returns
true if the object corresponds to a physical monitor.

◆ operator=()

Monitor & Gdk::Monitor::operator= ( Monitor &&  src)
noexcept

◆ property_connector()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Monitor::property_connector ( ) const

The connector name.

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_description()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Monitor::property_description ( ) const

A short description of the monitor, meant for display to the user.

Since gtkmm 4.10:

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_display()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Display > > Gdk::Monitor::property_display ( ) const

The Gdk::Display of the monitor.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_geometry()

Glib::PropertyProxy_ReadOnly< Gdk::Rectangle > Gdk::Monitor::property_geometry ( ) const

The geometry of the monitor.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_height_mm()

Glib::PropertyProxy_ReadOnly< int > Gdk::Monitor::property_height_mm ( ) const

The height of the monitor, in millimeters.

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_manufacturer()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Monitor::property_manufacturer ( ) const

The manufacturer name.

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_model()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Monitor::property_model ( ) const

The model name.

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_refresh_rate()

Glib::PropertyProxy_ReadOnly< int > Gdk::Monitor::property_refresh_rate ( ) const

The refresh rate, in milli-Hertz.

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_scale()

Glib::PropertyProxy_ReadOnly< double > Gdk::Monitor::property_scale ( ) const

The scale of the monitor.

Since gtkmm 4.14:

Default value: 1

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_scale_factor()

Glib::PropertyProxy_ReadOnly< int > Gdk::Monitor::property_scale_factor ( ) const

The scale factor.

The scale factor is the next larger integer, compared to Gdk::Surface::property_scale().

Default value: 1

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_subpixel_layout()

Glib::PropertyProxy_ReadOnly< SubpixelLayout > Gdk::Monitor::property_subpixel_layout ( ) const

The subpixel layout.

Default value: Gdk::SubpixelLayout::UNKNOWN

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_valid()

Glib::PropertyProxy_ReadOnly< bool > Gdk::Monitor::property_valid ( ) const

Whether the object is still valid.

Default value: true

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_width_mm()

Glib::PropertyProxy_ReadOnly< int > Gdk::Monitor::property_width_mm ( ) const

The width of the monitor, in millimeters.

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ signal_invalidate()

Glib::SignalProxy< void()> Gdk::Monitor::signal_invalidate ( )
Slot Prototype:
void on_my_invalidate()

Flags: Run First

Emitted when the output represented by monitor gets disconnected.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gdk::Monitor > wrap ( GdkMonitor *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.