[gnome-desktop] GnomeRR: gnome_rr_output_get_min_backlight_step
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop] GnomeRR: gnome_rr_output_get_min_backlight_step
- Date: Mon, 21 Oct 2013 21:26:31 +0000 (UTC)
commit b778fb5efc2c580b977f0915722b4c771f8cdfff
Author: Asad Mehmood <asad78611 googlemail com>
Date: Thu Oct 17 16:21:42 2013 +0100
GnomeRR: gnome_rr_output_get_min_backlight_step
Allows gnome-settings-daemon to read the min_backlight_step
so that it can support displays with less than 10 steps
https://bugzilla.gnome.org/show_bug.cgi?id=710380
libgnome-desktop/gnome-rr.c | 15 +++++++++++++++
libgnome-desktop/gnome-rr.h | 1 +
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c
index 5e011d3..5772a11 100644
--- a/libgnome-desktop/gnome-rr.c
+++ b/libgnome-desktop/gnome-rr.c
@@ -77,6 +77,7 @@ struct GnomeRROutput
char * edid_file;
int backlight;
+ int min_backlight_step;
gboolean is_primary;
gboolean is_presentation;
@@ -1271,6 +1272,7 @@ output_initialize (GnomeRROutput *output, GVariant *info)
g_variant_lookup (properties, "height-mm", "i", &output->height_mm);
g_variant_lookup (properties, "display-name", "s", &output->display_name);
g_variant_lookup (properties, "backlight", "i", &output->backlight);
+ g_variant_lookup (properties, "min-backlight-step", "i", &output->min_backlight_step);
g_variant_lookup (properties, "primary", "b", &output->is_primary);
g_variant_lookup (properties, "presentation", "b", &output->is_presentation);
@@ -1446,6 +1448,19 @@ gnome_rr_output_get_backlight (GnomeRROutput *output)
}
/**
+ * gnome_rr_output_get_min_backlight_step:
+ *
+ * Returns: The minimum backlight step available in percent
+ */
+int
+gnome_rr_output_get_min_backlight_step (GnomeRROutput *output)
+{
+ g_return_val_if_fail (output != NULL, -1);
+
+ return output->min_backlight_step;
+}
+
+/**
* gnome_rr_output_set_backlight:
* @value: the absolute value which is 0 >= this <= 100
*
diff --git a/libgnome-desktop/gnome-rr.h b/libgnome-desktop/gnome-rr.h
index a0d42f7..0443342 100644
--- a/libgnome-desktop/gnome-rr.h
+++ b/libgnome-desktop/gnome-rr.h
@@ -154,6 +154,7 @@ void gnome_rr_output_get_physical_size (GnomeRROutput *outpu
int *height_mm);
gint gnome_rr_output_get_backlight (GnomeRROutput *output);
+gint gnome_rr_output_get_min_backlight_step(GnomeRROutput *output);
gboolean gnome_rr_output_set_backlight (GnomeRROutput *output,
gint value,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]