[gnome-control-center] display: Add 'is_preferred()' mode getter
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] display: Add 'is_preferred()' mode getter
- Date: Mon, 27 Jun 2022 16:48:06 +0000 (UTC)
commit 6087c0397b9133d09830fa4aca20498df154a480
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Jun 23 13:01:53 2022 +0200
display: Add 'is_preferred()' mode getter
panels/display/cc-display-config-dbus.c | 9 +++++++++
panels/display/cc-display-config.c | 6 ++++++
panels/display/cc-display-config.h | 2 ++
3 files changed, 17 insertions(+)
---
diff --git a/panels/display/cc-display-config-dbus.c b/panels/display/cc-display-config-dbus.c
index 83a49ade9..fc38fd83b 100644
--- a/panels/display/cc-display-config-dbus.c
+++ b/panels/display/cc-display-config-dbus.c
@@ -124,6 +124,14 @@ cc_display_mode_dbus_is_interlaced (CcDisplayMode *pself)
return !!(self->flags & MODE_INTERLACED);
}
+static gboolean
+cc_display_mode_dbus_is_preferred (CcDisplayMode *pself)
+{
+ CcDisplayModeDBus *self = CC_DISPLAY_MODE_DBUS (pself);
+
+ return !!(self->flags & MODE_PREFERRED);
+}
+
static int
cc_display_mode_dbus_get_freq (CcDisplayMode *pself)
{
@@ -169,6 +177,7 @@ cc_display_mode_dbus_class_init (CcDisplayModeDBusClass *klass)
parent_class->get_supported_scales = cc_display_mode_dbus_get_supported_scales;
parent_class->get_preferred_scale = cc_display_mode_dbus_get_preferred_scale;
parent_class->is_interlaced = cc_display_mode_dbus_is_interlaced;
+ parent_class->is_preferred = cc_display_mode_dbus_is_preferred;
parent_class->get_freq = cc_display_mode_dbus_get_freq;
parent_class->get_freq_f = cc_display_mode_dbus_get_freq_f;
}
diff --git a/panels/display/cc-display-config.c b/panels/display/cc-display-config.c
index a78b33fc9..9346dc3de 100644
--- a/panels/display/cc-display-config.c
+++ b/panels/display/cc-display-config.c
@@ -114,6 +114,12 @@ cc_display_mode_is_interlaced (CcDisplayMode *self)
return CC_DISPLAY_MODE_GET_CLASS (self)->is_interlaced (self);
}
+gboolean
+cc_display_mode_is_preferred (CcDisplayMode *self)
+{
+ return CC_DISPLAY_MODE_GET_CLASS (self)->is_preferred (self);
+}
+
int
cc_display_mode_get_freq (CcDisplayMode *self)
{
diff --git a/panels/display/cc-display-config.h b/panels/display/cc-display-config.h
index d83fa8edc..dbaaa5cc5 100644
--- a/panels/display/cc-display-config.h
+++ b/panels/display/cc-display-config.h
@@ -81,6 +81,7 @@ struct _CcDisplayModeClass
GArray* (*get_supported_scales) (CcDisplayMode *self);
double (*get_preferred_scale) (CcDisplayMode *self);
gboolean (*is_interlaced) (CcDisplayMode *self);
+ gboolean (*is_preferred) (CcDisplayMode *self);
int (*get_freq) (CcDisplayMode *self);
double (*get_freq_f) (CcDisplayMode *self);
};
@@ -247,6 +248,7 @@ void cc_display_mode_get_resolution (CcDisplayMode *
GArray* cc_display_mode_get_supported_scales (CcDisplayMode *self);
double cc_display_mode_get_preferred_scale (CcDisplayMode *self);
gboolean cc_display_mode_is_interlaced (CcDisplayMode *mode);
+gboolean cc_display_mode_is_preferred (CcDisplayMode *mode);
int cc_display_mode_get_freq (CcDisplayMode *mode);
double cc_display_mode_get_freq_f (CcDisplayMode *mode);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]