Commit dc468218 authored by Guido Gunther's avatar Guido Gunther

Monitor: Allow to get rotation by degrees

Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent 58737038
......@@ -375,3 +375,29 @@ phosh_monitor_is_flipped (PhoshMonitor *self)
g_assert_not_reached ();
}
}
/** phosh_monitor_get_rotation
*
* Get the monitor's rotation in degrees
*/
guint
phosh_monitor_get_rotation (PhoshMonitor *self)
{
switch (self->transform) {
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
return 90;
case WL_OUTPUT_TRANSFORM_180:
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
return 180;
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
return 270;
case WL_OUTPUT_TRANSFORM_NORMAL:
case WL_OUTPUT_TRANSFORM_FLIPPED:
return 0;
default:
g_assert_not_reached ();
}
}
......@@ -77,3 +77,4 @@ PhoshMonitorMode * phosh_monitor_get_current_mode (PhoshMonitor *monitor);
gboolean phosh_monitor_is_configured (PhoshMonitor *monitor);
gboolean phosh_monitor_is_builtin (PhoshMonitor *monitor);
gboolean phosh_monitor_is_flipped (PhoshMonitor *monitor);
guint phosh_monitor_get_rotation (PhoshMonitor *monitor);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment