GnomeRR.Screen

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object GnomeRR.Screen GnomeRR.Screen GObject.Object->GnomeRR.Screen Gio.AsyncInitable->GnomeRR.Screen Gio.Initable->GnomeRR.Screen

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.AsyncInitable (4), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

new (display)

class

new_async (display, callback, *user_data)

class

new_finish (result)

get_crtc_by_id (id)

get_dpms_mode ()

get_output_by_id (id)

get_output_by_name (name)

get_ranges ()

list_clone_modes ()

list_crtcs ()

list_modes ()

list_outputs ()

refresh ()

set_dpms_mode (mode)

Virtual Methods

Inherited:

GObject.Object (7), Gio.AsyncInitable (2), Gio.Initable (1)

do_changed ()

do_output_connected (output)

do_output_disconnected (output)

Properties

Name

Type

Flags

Short Description

dpms-mode

GnomeRR.DpmsModeType

r/w

The DPMS mode for this GnomeRR.Screen

gdk-display

Gdk.Display

r/w/co

The GDK display connection represented by this GnomeRR.Screen

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

output-connected

This signal is emitted when a display device is connected to a port, or a port is hotplugged with an active output.

output-disconnected

This signal is emitted when a display device is disconnected from a port, or a port output is hot-unplugged.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class GnomeRR.Screen(**kwargs)
Bases:

GObject.Object, Gio.AsyncInitable, Gio.Initable

Abstract:

No

Structure:

GnomeRR.ScreenClass

classmethod new(display)
Parameters:

display (Gdk.Display) – the windowing system connection used to query the display data

Raises:

GLib.Error

Returns:

a unique GnomeRR.Screen instance, specific to the screen, or NULL if this could not be created, for instance if the driver does not support Xrandr 1.2. Each Gdk.Display thus has a single instance of GnomeRR.Screen.

Return type:

GnomeRR.Screen

Creates a unique GnomeRR.Screen instance for the specified display.

classmethod new_async(display, callback, *user_data)
Parameters:

Asynchronously creates a new GnomeRR.Screen instance.

On both success and error, callback will be invoked. You should use GnomeRR.Screen.new_finish() to retrieve the newly created GnomeRR.Screen instance.

classmethod new_finish(result)
Parameters:

result (Gio.AsyncResult) – the result of the asynchronous operation

Raises:

GLib.Error

Returns:

the newly created instance; on error, this function will return NULL and set the given GLib.Error

Return type:

GnomeRR.Screen

Finishes the asynchronous creation of a new GnomeRR.Screen instance.

get_crtc_by_id(id)
Parameters:

id (int) – the identifier of a CRTC

Returns:

the CRTC identified by id

Return type:

GnomeRR.Crtc

Retrieves the CRTC of the screen using the given identifier.

get_dpms_mode()
Raises:

GLib.Error

Returns:

mode:

The current GnomeRR.DpmsMode of this screen

Return type:

(bool, mode: GnomeRR.DpmsMode)

get_output_by_id(id)
Parameters:

id (int) – the identifier of an output

Returns:

the output identified by id

Return type:

GnomeRR.Output

Retrieves the output of a screen using the given identifier.

get_output_by_name(name)
Parameters:

name (str) –

Returns:

the output identified by name

Return type:

GnomeRR.Output

Retrieves the output for the given name.

get_ranges()
Returns:

min_width:

the minimum width

max_width:

the maximum width

min_height:

the minimum height

max_height:

the maximum height

Return type:

(min_width: int, max_width: int, min_height: int, max_height: int)

Get the ranges of the screen

list_clone_modes()
Returns:

the available XRandR clone modes

Return type:

[GnomeRR.Mode]

Lists all available XRandR clone modes.

list_crtcs()
Returns:

the available CRTCs

Return type:

[GnomeRR.Crtc]

List all CRTCs of the given screen.

list_modes()
Returns:

the available XRandR modes

Return type:

[GnomeRR.Mode]

Lists all available XRandR modes.

list_outputs()
Returns:

the available outputs

Return type:

[GnomeRR.Output]

List all outputs of the given screen.

refresh()
Raises:

GLib.Error

Returns:

True if the screen’s configuration changed; otherwise, the function returns False and a None error if the configuration didn’t change, or False and a non-None error if there was an error while refreshing the configuration.

Return type:

bool

Refreshes the screen configuration, and calls the screen’s callback if it exists and if the screen’s configuration changed.

set_dpms_mode(mode)
Parameters:

mode (GnomeRR.DpmsMode) –

Raises:

GLib.Error

Return type:

bool

This method also disables the DPMS timeouts.

do_changed() virtual
do_output_connected(output) virtual
Parameters:

output (GnomeRR.Output) –

do_output_disconnected(output) virtual
Parameters:

output (GnomeRR.Output) –

Signal Details

GnomeRR.Screen.signals.changed(screen)
Signal Name:

changed

Flags:

RUN_FIRST, NO_RECURSE, NO_HOOKS

Parameters:

screen (GnomeRR.Screen) – The object which received the signal

GnomeRR.Screen.signals.output_connected(screen, output)
Signal Name:

output-connected

Flags:

RUN_FIRST, NO_RECURSE, NO_HOOKS

Parameters:

This signal is emitted when a display device is connected to a port, or a port is hotplugged with an active output. The latter can happen if a laptop is docked, and the dock provides a new active output.

The output value is not a GObject.Object. The returned output value can only assume to be valid during the emission of the signal (i.e. within your signal handler only), as it may change later when the screen is modified due to an event from the X server, or due to another place in the application modifying the screen and the output. Therefore, deal with changes to the output right in your signal handler, instead of keeping the output reference for an async or idle function.

GnomeRR.Screen.signals.output_disconnected(screen, output)
Signal Name:

output-disconnected

Flags:

RUN_FIRST, NO_RECURSE, NO_HOOKS

Parameters:

This signal is emitted when a display device is disconnected from a port, or a port output is hot-unplugged. The latter can happen if a laptop is undocked, and the dock provided the output.

The output value is not a GObject.Object. The returned output value can only assume to be valid during the emission of the signal (i.e. within your signal handler only), as it may change later when the screen is modified due to an event from the X server, or due to another place in the application modifying the screen and the output. Therefore, deal with changes to the output right in your signal handler, instead of keeping the output reference for an async or idle function.

Property Details

GnomeRR.Screen.props.dpms_mode
Name:

dpms-mode

Type:

GnomeRR.DpmsModeType

Default Value:

GnomeRR.DpmsModeType.UNKNOWN

Flags:

READABLE, WRITABLE

The DPMS mode for this GnomeRR.Screen

GnomeRR.Screen.props.gdk_display
Name:

gdk-display

Type:

Gdk.Display

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The GDK display connection represented by this GnomeRR.Screen