display: Add API to get the PanelOrientationManaged DisplayConfig property
This property indicates whether the builtin panel orientation is managed by an accelerometer, thus shouldn't be managed by the display panel.
This commit is contained in:
parent
1ae3ebcfb2
commit
b91a83c402
3 changed files with 28 additions and 0 deletions
|
@ -1269,6 +1269,23 @@ cc_display_config_dbus_is_scaled_mode_valid (CcDisplayConfig *pself,
|
|||
return is_scaled_mode_allowed (self, mode, scale);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
cc_display_config_dbus_get_panel_orientation_managed (CcDisplayConfig *pself)
|
||||
{
|
||||
CcDisplayConfigDBus *self = CC_DISPLAY_CONFIG_DBUS (pself);
|
||||
gboolean retval;
|
||||
GVariant *v;
|
||||
|
||||
v = g_dbus_proxy_get_cached_property (self->proxy, "PanelOrientationManaged");
|
||||
if (!v)
|
||||
return FALSE;
|
||||
|
||||
retval = g_variant_get_boolean (v);
|
||||
g_variant_unref (v);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
cc_display_config_dbus_init (CcDisplayConfigDBus *self)
|
||||
{
|
||||
|
@ -1565,6 +1582,8 @@ cc_display_config_dbus_class_init (CcDisplayConfigDBusClass *klass)
|
|||
parent_class->is_layout_logical = cc_display_config_dbus_is_layout_logical;
|
||||
parent_class->is_scaled_mode_valid = cc_display_config_dbus_is_scaled_mode_valid;
|
||||
parent_class->set_minimum_size = cc_display_config_dbus_set_minimum_size;
|
||||
parent_class->get_panel_orientation_managed =
|
||||
cc_display_config_dbus_get_panel_orientation_managed;
|
||||
|
||||
pspec = g_param_spec_variant ("state",
|
||||
"GVariant",
|
||||
|
|
|
@ -627,3 +627,9 @@ cc_display_config_is_scaled_mode_valid (CcDisplayConfig *self,
|
|||
g_return_val_if_fail (CC_IS_DISPLAY_MODE (mode), FALSE);
|
||||
return CC_DISPLAY_CONFIG_GET_CLASS (self)->is_scaled_mode_valid (self, mode, scale);
|
||||
}
|
||||
|
||||
gboolean
|
||||
cc_display_config_get_panel_orientation_managed (CcDisplayConfig *self)
|
||||
{
|
||||
return CC_DISPLAY_CONFIG_GET_CLASS (self)->get_panel_orientation_managed (self);
|
||||
}
|
||||
|
|
|
@ -160,6 +160,7 @@ struct _CcDisplayConfigClass
|
|||
gboolean (*is_scaled_mode_valid) (CcDisplayConfig *self,
|
||||
CcDisplayMode *mode,
|
||||
double scale);
|
||||
gboolean (* get_panel_orientation_managed) (CcDisplayConfig *self);
|
||||
};
|
||||
|
||||
|
||||
|
@ -186,6 +187,8 @@ void cc_display_config_set_minimum_size (CcDisplayConfig
|
|||
gboolean cc_display_config_is_scaled_mode_valid (CcDisplayConfig *self,
|
||||
CcDisplayMode *mode,
|
||||
double scale);
|
||||
gboolean cc_display_config_get_panel_orientation_managed
|
||||
(CcDisplayConfig *self);
|
||||
|
||||
const char* cc_display_monitor_get_display_name (CcDisplayMonitor *monitor);
|
||||
gboolean cc_display_monitor_is_active (CcDisplayMonitor *monitor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue