## PhoshMonitorManager

PhoshMonitorManager — The singleton that manages available monitors

## Functions

PhoshMonitorManager * | phosh_monitor_manager_new ()
PhoshMonitor * | phosh_monitor_manager_get_monitor ()
guint | phosh_monitor_manager_get_num_monitors ()
PhoshMonitor * | phosh_monitor_manager_find_monitor ()
void | phosh_monitor_manager_set_monitor_transform ()
void | phosh_monitor_manager_apply_monitor_config ()
void | phosh_monitor_manager_set_sensor_proxy_manager ()
gboolean | phosh_monitor_manager_enable_fallback ()

## Properties

int | n-monitors | Read
PhoshSensorProxyManager * | sensor-proxy-manager | Read / Write

## Signals

void | monitor-added | Run Last
void | monitor-removed | Cleanup

## Types and Values

enum | PhoshMonitorManagerConfigMethod
#define | PHOSH_TYPE_MONITOR_MANAGER
| PhoshMonitorManager

## Object Hierarchy

        GObject
        ╰── GDBusInterfaceSkeleton
            ╰── PhoshDBusDisplayConfigSkeleton
                ╰── PhoshMonitorManager

## Implemented Interfaces

PhoshMonitorManager implements GDBusInterface and PhoshDBusDisplayConfig.

## Description

This keeps track of all monitors and handles the org.gnome.Mutter.DisplayConfig DBus interface via PhoshDBusDisplayConfig. This includes individual monitor configuration as well as blanking/power saving.

## Functions

### phosh_monitor_manager_new ()

    PhoshMonitorManager *
    phosh_monitor_manager_new (PhoshSensorProxyManager *proxy);

### phosh_monitor_manager_get_monitor ()

    PhoshMonitor *
    phosh_monitor_manager_get_monitor (PhoshMonitorManager *self,
                                       guint num);

### phosh_monitor_manager_get_num_monitors ()

    guint
    phosh_monitor_manager_get_num_monitors
                                   (PhoshMonitorManager *self);

### phosh_monitor_manager_find_monitor ()

    PhoshMonitor *
    phosh_monitor_manager_find_monitor (PhoshMonitorManager *self,
                                        const char *name);

### phosh_monitor_manager_set_monitor_transform ()

    void
    phosh_monitor_manager_set_monitor_transform
                                   (PhoshMonitorManager *self,
                                    PhoshMonitor *monitor,
                                    PhoshMonitorTransform transform);

Sets monitor's transform. This will become active after the next call to ``phosh_monitor_manager_apply_monitor_config()``.

#### Parameters

self | A PhoshMonitor |
monitor | The PhoshMonitor to set the tansform on |
transform | The PhoshMonitorTransform to set |

### phosh_monitor_manager_apply_monitor_config ()

    void
    phosh_monitor_manager_apply_monitor_config
                                   (PhoshMonitorManager *self);

Applies a full output configuration

#### Parameters

self | a PhoshMonitorManager |

### phosh_monitor_manager_set_sensor_proxy_manager ()

    void
    phosh_monitor_manager_set_sensor_proxy_manager
                                   (PhoshMonitorManager *self,
                                    PhoshSensorProxyManager *manager);

### phosh_monitor_manager_enable_fallback ()

    gboolean
    phosh_monitor_manager_enable_fallback (PhoshMonitorManager *self);

When all heads are disabled look for a fallback to enable. This can be useful when e.g. only external display is enabled and that gets unplugged.

#### Parameters

self | a PhoshMonitorManager |

#### Returns

`TRUE` if a new head was enabled, `FALSE` otherwise

## Types and Values

### enum PhoshMonitorManagerConfigMethod

Equivalent to the 'method' enum in org.gnome.Mutter.DisplayConfig

#### Members

PHOSH_MONITOR_MANAGER_CONFIG_METHOD_VERIFY | verify the configuration |
PHOSH_MONITOR_MANAGER_CONFIG_METHOD_TEMPORARY | configuration is temporary |
PHOSH_MONITOR_MANAGER_CONFIG_METHOD_PERSISTENT | configuration is permanent |

### PHOSH_TYPE_MONITOR_MANAGER

    #define PHOSH_TYPE_MONITOR_MANAGER                 (phosh_monitor_manager_get_type ())

### PhoshMonitorManager

    typedef struct _PhoshMonitorManager PhoshMonitorManager;

## Property Details

### The `“n-monitors”` property

      “n-monitors”               int

The number of enabled monitors.

Owner: PhoshMonitorManager

Flags: Read

Allowed values: >= 0

Default value: 0

### The `“sensor-proxy-manager”` property

      “sensor-proxy-manager”     PhoshSensorProxyManager *

Sensor Proxy Manager.

Owner: PhoshMonitorManager

Flags: Read / Write

## Signal Details

### The `“monitor-added”` signal

    void
    user_function (PhoshMonitorManager *manager,
                   PhoshMonitor        *monitor,
                   gpointer             user_data)

Emitted whenever a monitor was added.

#### Parameters

manager | The PhoshMonitorManager emitting the signal. |
monitor | The PhoshMonitor being added. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“monitor-removed”` signal

    void
    user_function (PhoshMonitorManager *manager,
                   PhoshMonitor        *monitor,
                   gpointer             user_data)

Emitted whenever a monitor is about to be removed.

#### Parameters

manager | The PhoshMonitorManager emitting the signal. |
monitor | The PhoshMonitor being removed. |
user_data | user data set when the signal handler was connected. |

Flags: Cleanup