PhoshRotationManager

PhoshRotationManager — The Rotation Manager

Functions

Properties

PhoshLockscreenManager * lockscreen-manager Read / Write / Construct Only
PhoshRotationManagerMode mode Read / Write
PhoshMonitor * monitor Read / Write
gboolean orientation-locked Read / Write
PhoshSensorProxyManager * sensor-proxy-manager Read / Write / Construct Only
PhoshMonitorTransform transform Read

Types and Values

Object Hierarchy

    GEnum
    ╰── PhoshRotationManagerMode
    GObject
    ╰── PhoshRotationManager

Description

PhoshRotationManager is responsible for managing the rotation of a given PhoshMonitor. Depending on the PhoshRotationManagerMode this can happen by interfacing with a PhoshSensorProxyManager or by setting the PhoshMonitorTransform explicitly. It also takes the “locked” status into account to ensure the lockscreen is rotated accordingly on small phones.

Functions

phosh_rotation_manager_new ()

PhoshRotationManager *
phosh_rotation_manager_new (PhoshSensorProxyManager *sensor_proxy_manager,
                            PhoshLockscreenManager *lockscreen_manager,
                            PhoshMonitor *monitor);

phosh_rotation_manager_set_orientation_locked ()

void
phosh_rotation_manager_set_orientation_locked
                               (PhoshRotationManager *self,
                                gboolean locked);

phosh_rotation_manager_get_orientation_locked ()

gboolean
phosh_rotation_manager_get_orientation_locked
                               (PhoshRotationManager *self);

phosh_rotation_manager_get_mode ()

PhoshRotationManagerMode
phosh_rotation_manager_get_mode (PhoshRotationManager *self);

phosh_rotation_manager_set_mode ()

gboolean
phosh_rotation_manager_set_mode (PhoshRotationManager *self,
                                 PhoshRotationManagerMode mode);

Sets the given mode.

Parameters

self

The PhoshRotationManager

 

mode

The PhoshRotationManagerMode to set

 

Returns

TRUE if setting the mode was possible, otherwise FALSE (e.g. when trying to set PHOSH_ROTATION_MANAGER_MODE_SENSOR without having a sensor.


phosh_rotation_manager_set_transform ()

void
phosh_rotation_manager_set_transform (PhoshRotationManager *self,
                                      PhoshMonitorTransform tranform);

phosh_rotation_manager_get_transform ()

PhoshMonitorTransform
phosh_rotation_manager_get_transform (PhoshRotationManager *self);

phosh_rotation_manager_get_monitor ()

PhoshMonitor *
phosh_rotation_manager_get_monitor (PhoshRotationManager *self);

Parameters

self

The PhoshRotationManager

 

Returns

The PhoshMonitor this manager acts on


phosh_rotation_manager_set_monitor ()

void
phosh_rotation_manager_set_monitor (PhoshRotationManager *self,
                                    PhoshMonitor *monitor);

Types and Values

enum PhoshRotationManagerMode

The mode of a PhoshRotationManager

Members

PHOSH_ROTATION_MANAGER_MODE_OFF

automatic rotation off

 

PHOSH_ROTATION_MANAGER_MODE_SENSOR

rotation driven by sensor orientation

 

PHOSH_TYPE_ROTATION_MANAGER

#define PHOSH_TYPE_ROTATION_MANAGER (phosh_rotation_manager_get_type ())

PhoshRotationManager

typedef struct _PhoshRotationManager PhoshRotationManager;

Property Details

The “lockscreen-manager” property

  “lockscreen-manager”       PhoshLockscreenManager *

The object managing the lock screen.

Owner: PhoshRotationManager

Flags: Read / Write / Construct Only


The “mode” property

  “mode”                     PhoshRotationManagerMode

The current rotation mode.

Owner: PhoshRotationManager

Flags: Read / Write

Default value: PHOSH_ROTATION_MANAGER_MODE_OFF


The “monitor” property

  “monitor”                  PhoshMonitor *

The monitor to rotate.

Owner: PhoshRotationManager

Flags: Read / Write


The “orientation-locked” property

  “orientation-locked”       gboolean

Whether the screen orientation is locked.

Owner: PhoshRotationManager

Flags: Read / Write

Default value: TRUE


The “sensor-proxy-manager” property

  “sensor-proxy-manager”     PhoshSensorProxyManager *

The object inerfacing with iio-sensor-proxy.

Owner: PhoshRotationManager

Flags: Read / Write / Construct Only


The “transform” property

  “transform”                PhoshMonitorTransform

Monitor transform of the rotation monitor.

Owner: PhoshRotationManager

Flags: Read

Default value: PHOSH_MONITOR_TRANSFORM_NORMAL