Commit 6040dbe4 authored by Cosimo Cecchi's avatar Cosimo Cecchi

gnome-rr: add API to check whether rotation is supported

Export a method on GnomeRROutputInfo to check which rotation options are
supported.

https://bugzilla.gnome.org/show_bug.cgi?id=721672
parent 11f32f15
......@@ -193,6 +193,7 @@ gnome_rr_config_load_current (GnomeRRConfig *config, GError **error)
output->priv->height = gnome_rr_mode_get_height (mode);
output->priv->rate = gnome_rr_mode_get_freq (mode);
output->priv->rotation = gnome_rr_crtc_get_current_rotation (crtc);
output->priv->available_rotations = gnome_rr_crtc_get_rotations (crtc);
if (output->priv->x == 0 && output->priv->y == 0) {
if (clone_width == -1) {
......
......@@ -73,6 +73,7 @@ void gnome_rr_output_info_set_refresh_rate (GnomeRROutputInfo *self, int rate);
GnomeRRRotation gnome_rr_output_info_get_rotation (GnomeRROutputInfo *self);
void gnome_rr_output_info_set_rotation (GnomeRROutputInfo *self, GnomeRRRotation rotation);
gboolean gnome_rr_output_info_supports_rotation (GnomeRROutputInfo *self, GnomeRRRotation rotation);
gboolean gnome_rr_output_info_is_connected (GnomeRROutputInfo *self);
const char *gnome_rr_output_info_get_vendor (GnomeRROutputInfo *self);
......
......@@ -154,6 +154,13 @@ void gnome_rr_output_info_set_rotation (GnomeRROutputInfo *self, GnomeRRRotation
self->priv->rotation = rotation;
}
gboolean gnome_rr_output_info_supports_rotation (GnomeRROutputInfo *self, GnomeRRRotation rotation)
{
g_return_val_if_fail (GNOME_IS_RR_OUTPUT_INFO (self), FALSE);
return (self->priv->available_rotations & rotation);
}
/**
* gnome_rr_output_info_is_connected:
*
......
......@@ -62,6 +62,7 @@ struct _GnomeRROutputInfoPrivate
int x;
int y;
GnomeRRRotation rotation;
GnomeRRRotation available_rotations;
gboolean connected;
char * vendor;
......
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