## PhoshMonitor

PhoshMonitor — A monitor

## Functions

PhoshMonitor * | phosh_monitor_new_from_wl_output ()
PhoshMonitorMode * | phosh_monitor_get_current_mode ()
gboolean | phosh_monitor_is_configured ()
gboolean | phosh_monitor_is_builtin ()
gboolean | phosh_monitor_is_flipped ()
guint | phosh_monitor_get_transform ()
void | phosh_monitor_set_power_save_mode ()
PhoshMonitorPowerSaveMode | phosh_monitor_get_power_save_mode ()
PhoshMonitorConnectorType | phosh_monitor_connector_type_from_name ()
gboolean | phosh_monitor_connector_is_builtin ()
struct wl_output * | phosh_monitor_get_wl_output ()
float | phosh_monitor_get_fractional_scale ()

## Properties

PhoshMonitorPowerSaveMode | power-mode | Read
gpointer | wl-output | Read / Write / Construct Only

## Signals

void | configured | Run Last

## Types and Values

enum | PhoshMonitorConnectorType
enum | PhoshMonitorTransform
enum | PhoshMonitorPowerSaveMode
#define | PHOSH_TYPE_MONITOR
| PhoshMonitor

## Object Hierarchy

        GEnum
        ├── PhoshMonitorConnectorType
        ├── PhoshMonitorPowerSaveMode
        ╰── PhoshMonitorTransform
        GObject
        ╰── PhoshMonitor

## Description

A rectangualar area in the compositor space, usally corresponds to physical monitor using wl_output and xdg_output Wayland protocols.

## Functions

### phosh_monitor_new_from_wl_output ()

    PhoshMonitor *
    phosh_monitor_new_from_wl_output (gpointer wl_output);

### phosh_monitor_get_current_mode ()

    PhoshMonitorMode *
    phosh_monitor_get_current_mode (PhoshMonitor *self);

### phosh_monitor_is_configured ()

    gboolean
    phosh_monitor_is_configured (PhoshMonitor *self);

#### Parameters

self | A PhoshMonitor |

#### Returns

`TRUE` if the monitor fully configured (received all state updates from the compositor).

### phosh_monitor_is_builtin ()

    gboolean
    phosh_monitor_is_builtin (PhoshMonitor *self);

#### Parameters

self | A PhoshMonitor |

#### Returns

`TRUE` if the monitor built in panel (e.g. laptop panel or phone LCD)

### phosh_monitor_is_flipped ()

    gboolean
    phosh_monitor_is_flipped (PhoshMonitor *self);

#### Parameters

self | A PhoshMonitor |

#### Returns

`TRUE` if the monitor's output is flipped

### phosh_monitor_get_transform ()

    guint
    phosh_monitor_get_transform (PhoshMonitor *self);

#### Parameters

self | A PhoshMonitor |

#### Returns

The monitor's output transform

### phosh_monitor_set_power_save_mode ()

    void
    phosh_monitor_set_power_save_mode (PhoshMonitor *self,
                                       PhoshMonitorPowerSaveMode mode);

Sets monitor's power save mode.

#### Parameters

self | A PhoshMonitor |
mode | The PhoshMonitorPowerSaveMode |

### phosh_monitor_get_power_save_mode ()

    PhoshMonitorPowerSaveMode
    phosh_monitor_get_power_save_mode (PhoshMonitor *self);

#### Parameters

self | A PhoshMonitor |

#### Returns

The current power save mode

### phosh_monitor_connector_type_from_name ()

    PhoshMonitorConnectorType
    phosh_monitor_connector_type_from_name
                                   (const char *name);

### phosh_monitor_connector_is_builtin ()

    gboolean
    phosh_monitor_connector_is_builtin (PhoshMonitorConnectorType type);

### phosh_monitor_get_wl_output ()

    struct wl_output *
    phosh_monitor_get_wl_output (PhoshMonitor *self);

### phosh_monitor_get_fractional_scale ()

    float
    phosh_monitor_get_fractional_scale (PhoshMonitor *self);

Get the fractinoal scale determined from the output width and the current logical width.

#### Parameters

self | The monitor |

#### Returns

the fractional scale

## Types and Values

### enum PhoshMonitorConnectorType

This matches the values in drm_mode.h

#### Members

PHOSH_MONITOR_CONNECTOR_TYPE_Unknown | unknown connector type |
PHOSH_MONITOR_CONNECTOR_TYPE_VGA | a VGA connector |
PHOSH_MONITOR_CONNECTOR_TYPE_DVII | a DVII connector |
PHOSH_MONITOR_CONNECTOR_TYPE_DVID | a DVID connector |
PHOSH_MONITOR_CONNECTOR_TYPE_DVIA | a DVIA connector |
PHOSH_MONITOR_CONNECTOR_TYPE_Composite | a Composite connector |
PHOSH_MONITOR_CONNECTOR_TYPE_SVIDEO | a SVIDEO connector |
PHOSH_MONITOR_CONNECTOR_TYPE_LVDS | a LVDS connector |
PHOSH_MONITOR_CONNECTOR_TYPE_Component | a Component connector |
PHOSH_MONITOR_CONNECTOR_TYPE_9PinDIN | a 9PinDIN connector |
PHOSH_MONITOR_CONNECTOR_TYPE_DisplayPort | a DisplayPort connector |
PHOSH_MONITOR_CONNECTOR_TYPE_HDMIA | a HDMIA connector |
PHOSH_MONITOR_CONNECTOR_TYPE_HDMIB | a HDMIB connector |
PHOSH_MONITOR_CONNECTOR_TYPE_TV | a TV connector |
PHOSH_MONITOR_CONNECTOR_TYPE_eDP | a eDP connector |
PHOSH_MONITOR_CONNECTOR_TYPE_VIRTUAL | a Virtual connector |
PHOSH_MONITOR_CONNECTOR_TYPE_DSI | a DSI connector |

### enum PhoshMonitorTransform

the monitors rotation. This corresponds to the values in the org.gnome.Mutter.DisplayConfig DBus protocol.

#### Members

PHOSH_MONITOR_TRANSFORM_NORMAL | normal |
PHOSH_MONITOR_TRANSFORM_90 | 90 degree clockwise |
PHOSH_MONITOR_TRANSFORM_180 | 180 degree clockwise |
PHOSH_MONITOR_TRANSFORM_270 | 270 degree clockwise |
PHOSH_MONITOR_TRANSFORM_FLIPPED | flipped clockwise |
PHOSH_MONITOR_TRANSFORM_FLIPPED_90 | flipped and 90 deg |
PHOSH_MONITOR_TRANSFORM_FLIPPED_180 | flipped and 180 deg |
PHOSH_MONITOR_TRANSFORM_FLIPPED_270 | flipped and 270 deg |

### enum PhoshMonitorPowerSaveMode

The power save mode of a monitor

#### Members

PHOSH_MONITOR_POWER_SAVE_MODE_OFF | The monitor is off (saving power) |
PHOSH_MONITOR_POWER_SAVE_MODE_ON | The monitor is on |

### PHOSH_TYPE_MONITOR

    #define PHOSH_TYPE_MONITOR                 (phosh_monitor_get_type ())

### PhoshMonitor

    typedef struct _PhoshMonitor PhoshMonitor;

## Property Details

### The `“power-mode”` property

      “power-mode”               PhoshMonitorPowerSaveMode

The power save mode for this monitor.

Owner: PhoshMonitor

Flags: Read

Default value: PHOSH_MONITOR_POWER_SAVE_MODE_OFF

### The `“wl-output”` property

      “wl-output”                gpointer

The wayland output associated with this monitor.

Owner: PhoshMonitor

Flags: Read / Write / Construct Only

## Signal Details

### The `“configured”` signal

    void
    user_function (PhoshMonitor *monitor,
                   gpointer      user_data)

Emitted whenever a monitor is fully configured (that is it received all configuration data from the various wayland protocols).

#### Parameters

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

Flags: Run Last