[gnome-color-manager] trivial: Apply a metric truckload of gtk-doc additions and updates



commit 6580143d94e2e9a26106a5909faca97e0fd11485
Author: Richard Hughes <richard hughsie com>
Date:   Sun Jul 25 11:34:54 2010 +0100

    trivial: Apply a metric truckload of gtk-doc additions and updates

 docs/api/libcolor-glib-docs.sgml  |   30 ++++---
 libcolor-glib/gcm-buffer.c        |   20 ++--
 libcolor-glib/gcm-color.c         |   16 ++--
 libcolor-glib/gcm-color.h         |    8 +-
 libcolor-glib/gcm-common.c        |   90 ++++++++++++++---
 libcolor-glib/gcm-common.h        |   24 +++---
 libcolor-glib/gcm-ddc-client.c    |   42 +++++++-
 libcolor-glib/gcm-ddc-common.c    |    6 +-
 libcolor-glib/gcm-ddc-device.c    |   15 +--
 libcolor-glib/gcm-edid.c          |   85 ++++++++++++++++-
 libcolor-glib/gcm-enum.c          |    7 ++
 libcolor-glib/gcm-image.c         |    2 +-
 libcolor-glib/gcm-profile-store.c |    2 +-
 libcolor-glib/gcm-profile-store.h |    2 +-
 libcolor-glib/gcm-profile.c       |    4 +-
 libcolor-glib/gcm-sensor-dummy.c  |    2 +-
 libcolor-glib/gcm-sensor-huey.c   |    2 +-
 libcolor-glib/gcm-usb.c           |    8 +-
 libcolor-glib/gcm-version.h.in    |    7 ++
 libcolor-glib/gcm-x11-output.c    |  190 ++++++++++++++++++++++++++++++-------
 libcolor-glib/gcm-x11-output.h    |    6 +-
 libcolor-glib/gcm-x11-screen.c    |   36 +++++--
 libcolor-glib/gcm-x11-screen.h    |    3 +
 libcolor-glib/libcolor-glib.h     |    1 +
 src/Makefile.am                   |    2 +
 src/cc-color-panel.c              |   31 +++---
 src/gcm-device-xrandr.c           |   19 ++++-
 src/gcm-device-xrandr.h           |    2 +-
 tools/gcm-ddc-util.c              |    1 -
 tools/gcm-dump-edid.c             |    4 +-
 tools/gcm-dump-profile.c          |    4 +-
 tools/gcm-dump-sensor.c           |    3 +-
 tools/gcm-sensor-colormunki.c     |    5 +-
 33 files changed, 511 insertions(+), 168 deletions(-)
---
diff --git a/docs/api/libcolor-glib-docs.sgml b/docs/api/libcolor-glib-docs.sgml
index ef6ef59..c88f1f2 100644
--- a/docs/api/libcolor-glib-docs.sgml
+++ b/docs/api/libcolor-glib-docs.sgml
@@ -35,33 +35,37 @@
     <xi:include href="xml/gcm-device.xml"/>
     <xi:include href="xml/gcm-client.xml"/>
 -->
-    <xi:include href="xml/gcm-sensor-dummy.xml"/>
-    <xi:include href="xml/gcm-x11-output.xml"/>
-    <xi:include href="xml/gcm-x11-screen.xml"/>
-    <xi:include href="xml/gcm-edid.xml"/>
-    <xi:include href="xml/gcm-ddc-control.xml"/>
-    <xi:include href="xml/gcm-profile.xml"/>
+    <xi:include href="xml/gcm-brightness.xml"/>
     <xi:include href="xml/gcm-clut.xml"/>
-    <xi:include href="xml/gcm-tables.xml"/>
+    <xi:include href="xml/gcm-ddc-client.xml"/>
+    <xi:include href="xml/gcm-ddc-control.xml"/>
     <xi:include href="xml/gcm-ddc-device.xml"/>
-    <xi:include href="xml/gcm-sensor-client.xml"/>
+    <xi:include href="xml/gcm-dmi.xml"/>
+    <xi:include href="xml/gcm-edid.xml"/>
     <xi:include href="xml/gcm-image.xml"/>
-    <xi:include href="xml/gcm-sensor-huey.xml"/>
     <xi:include href="xml/gcm-profile-store.xml"/>
+    <xi:include href="xml/gcm-profile.xml"/>
+    <xi:include href="xml/gcm-sensor-client.xml"/>
+    <xi:include href="xml/gcm-sensor-dummy.xml"/>
+    <xi:include href="xml/gcm-sensor-huey.xml"/>
     <xi:include href="xml/gcm-sensor.xml"/>
-    <xi:include href="xml/gcm-dmi.xml"/>
-    <xi:include href="xml/gcm-brightness.xml"/>
+    <xi:include href="xml/gcm-tables.xml"/>
+    <xi:include href="xml/gcm-usb.xml"/>
+    <xi:include href="xml/gcm-x11-output.xml"/>
+    <xi:include href="xml/gcm-x11-screen.xml"/>
     <xi:include href="xml/gcm-xyz.xml"/>
-    <xi:include href="xml/gcm-ddc-client.xml"/>
 
   </chapter>
 
   <chapter>
     <title>libcolor-glib helpers</title>
     <xi:include href="xml/egg-debug.xml"/>
-    <xi:include href="xml/gcm-version.xml"/>
+    <xi:include href="xml/gcm-buffer.xml"/>
     <xi:include href="xml/gcm-common.xml"/>
+    <xi:include href="xml/gcm-color.xml"/>
     <xi:include href="xml/gcm-ddc-common.xml"/>
+    <xi:include href="xml/gcm-enum.xml"/>
+    <xi:include href="xml/gcm-version.xml"/>
   </chapter>
 
   <chapter id="object-tree">
diff --git a/libcolor-glib/gcm-buffer.c b/libcolor-glib/gcm-buffer.c
index 6a1d684..4eb6aef 100644
--- a/libcolor-glib/gcm-buffer.c
+++ b/libcolor-glib/gcm-buffer.c
@@ -21,9 +21,9 @@
 
 /**
  * SECTION:gcm-buffer
- * @short_description: buffer functionality
+ * @short_description: Routines to read and write LE and BE values to a data buffer.
  *
- * Functions to manipulate buffer.
+ * Functions to manipulate a raw data buffer.
  */
 
 #include "config.h"
@@ -34,7 +34,7 @@
 
 /**
  * gcm_buffer_write_uint16_be:
- * @data: the writable data buffer
+ * @buffer: the writable data buffer
  * @value: the value to write
  *
  * Writes a big endian value into a data buffer.
@@ -49,7 +49,7 @@ gcm_buffer_write_uint16_be (guchar *buffer, guint16 value)
 
 /**
  * gcm_buffer_write_uint16_le:
- * @data: the writable data buffer
+ * @buffer: the writable data buffer
  * @value: the value to write
  *
  * Writes a little endian value into a data buffer.
@@ -64,7 +64,7 @@ gcm_buffer_write_uint16_le (guchar *buffer, guint16 value)
 
 /**
  * gcm_buffer_read_uint16_be:
- * @data: the writable data buffer
+ * @buffer: the writable data buffer
  *
  * Reads a big endian value from a data buffer.
  * NOTE: No validation is done on the buffer to ensure it's valid.
@@ -79,7 +79,7 @@ gcm_buffer_read_uint16_be (const guchar *buffer)
 
 /**
  * gcm_buffer_read_uint16_le:
- * @data: the writable data buffer
+ * @buffer: the writable data buffer
  *
  * Reads a big endian value from a data buffer.
  * NOTE: No validation is done on the buffer to ensure it's valid.
@@ -94,7 +94,7 @@ gcm_buffer_read_uint16_le (const guchar *buffer)
 
 /**
  * gcm_buffer_write_uint32_be:
- * @data: the writable data buffer
+ * @buffer: the writable data buffer
  * @value: the value to write
  *
  * Writes a big endian value into a data buffer.
@@ -111,7 +111,7 @@ gcm_buffer_write_uint32_be (guchar *buffer, guint32 value)
 
 /**
  * gcm_buffer_write_uint32_le:
- * @data: the writable data buffer
+ * @buffer: the writable data buffer
  * @value: the value to write
  *
  * Writes a little endian value into a data buffer.
@@ -128,7 +128,7 @@ gcm_buffer_write_uint32_le (guchar *buffer, guint32 value)
 
 /**
  * gcm_buffer_read_uint32_be:
- * @data: the writable data buffer
+ * @buffer: the writable data buffer
  *
  * Reads a big endian value from a data buffer.
  * NOTE: No validation is done on the buffer to ensure it's valid.
@@ -143,7 +143,7 @@ gcm_buffer_read_uint32_be (const guchar *buffer)
 
 /**
  * gcm_buffer_read_uint32_le:
- * @data: the writable data buffer
+ * @buffer: the writable data buffer
  *
  * Reads a big endian value from a data buffer.
  * NOTE: No validation is done on the buffer to ensure it's valid.
diff --git a/libcolor-glib/gcm-color.c b/libcolor-glib/gcm-color.c
index c6b7bb2..df12329 100644
--- a/libcolor-glib/gcm-color.c
+++ b/libcolor-glib/gcm-color.c
@@ -71,11 +71,11 @@ gcm_color_copy_RGB (GcmColorRGB *src, GcmColorRGB *dest)
  * Convert from one color format to another.
  **/
 void
-gcm_color_convert_RGBint_to_RGB (GcmColorRGBint *rgb_int, GcmColorRGB *rgb)
+gcm_color_convert_RGBint_to_RGB (GcmColorRGBint *src, GcmColorRGB *dest)
 {
-	rgb->R = (gdouble) rgb_int->R / 255.0f;
-	rgb->G = (gdouble) rgb_int->G / 255.0f;
-	rgb->B = (gdouble) rgb_int->B / 255.0f;
+	dest->R = (gdouble) src->R / 255.0f;
+	dest->G = (gdouble) src->G / 255.0f;
+	dest->B = (gdouble) src->B / 255.0f;
 }
 
 /**
@@ -86,11 +86,11 @@ gcm_color_convert_RGBint_to_RGB (GcmColorRGBint *rgb_int, GcmColorRGB *rgb)
  * Convert from one color format to another.
  **/
 void
-gcm_color_convert_RGB_to_RGBint (GcmColorRGB *rgb, GcmColorRGBint *rgb_int)
+gcm_color_convert_RGB_to_RGBint (GcmColorRGB *src, GcmColorRGBint *dest)
 {
-	rgb_int->R = (gdouble) rgb->R * 255.0f;
-	rgb_int->G = (gdouble) rgb->G * 255.0f;
-	rgb_int->B = (gdouble) rgb->B * 255.0f;
+	dest->R = (gdouble) src->R * 255.0f;
+	dest->G = (gdouble) src->G * 255.0f;
+	dest->B = (gdouble) src->B * 255.0f;
 }
 
 /**
diff --git a/libcolor-glib/gcm-color.h b/libcolor-glib/gcm-color.h
index a6ed886..a663be3 100644
--- a/libcolor-glib/gcm-color.h
+++ b/libcolor-glib/gcm-color.h
@@ -62,10 +62,10 @@ void		 gcm_color_copy_XYZ			(GcmColorXYZ		*src,
 							 GcmColorXYZ		*dest);
 void		 gcm_color_copy_RGB			(GcmColorRGB		*src,
 							 GcmColorRGB		*dest);
-void		 gcm_color_convert_RGBint_to_RGB	(GcmColorRGBint		*rgb_int,
-							 GcmColorRGB		*rgb);
-void		 gcm_color_convert_RGB_to_RGBint	(GcmColorRGB		*rgb,
-							 GcmColorRGBint		*rgb_int);
+void		 gcm_color_convert_RGBint_to_RGB	(GcmColorRGBint		*src,
+							 GcmColorRGB		*dest);
+void		 gcm_color_convert_RGB_to_RGBint	(GcmColorRGB		*src,
+							 GcmColorRGBint		*dest);
 void		 gcm_color_convert_Yxy_to_XYZ		(GcmColorYxy		*src,
 							 GcmColorXYZ		*dest);
 void		 gcm_color_convert_XYZ_to_Yxy		(GcmColorXYZ		*src,
diff --git a/libcolor-glib/gcm-common.c b/libcolor-glib/gcm-common.c
index 04c29bc..c90f15a 100644
--- a/libcolor-glib/gcm-common.c
+++ b/libcolor-glib/gcm-common.c
@@ -35,6 +35,9 @@
 
 /**
  * gcm_vec3_clear:
+ * @src: the source vector
+ *
+ * Clears a vector, setting all it's values to zero.
  **/
 void
 gcm_vec3_clear (GcmVec3 *src)
@@ -46,9 +49,15 @@ gcm_vec3_clear (GcmVec3 *src)
 
 /**
  * gcm_vec3_scalar_multiply:
+ * @src: the source
+ * @value: the scalar multiplier
+ * @dest: the destination
+ *
+ * Multiplies a vector with a scalar.
+ * The arguments @src and @dest can be the same value.
  **/
 void
-gcm_vec3_scalar_multiply (GcmVec3 *src, gdouble value, GcmVec3 *dest)
+gcm_vec3_scalar_multiply (const GcmVec3 *src, gdouble value, GcmVec3 *dest)
 {
 	dest->v0 = src->v0 * value;
 	dest->v1 = src->v1 * value;
@@ -57,9 +66,14 @@ gcm_vec3_scalar_multiply (GcmVec3 *src, gdouble value, GcmVec3 *dest)
 
 /**
  * gcm_vec3_to_string:
+ * @src: the source
+ *
+ * Obtains a string representaton of a vector.
+ *
+ * Return value: the string. Free with g_free()
  **/
 gchar *
-gcm_vec3_to_string (GcmVec3 *src)
+gcm_vec3_to_string (const GcmVec3 *src)
 {
 	return g_strdup_printf ("\n/ %0 .3f \\\n"
 				"| %0 .3f |\n"
@@ -69,30 +83,43 @@ gcm_vec3_to_string (GcmVec3 *src)
 
 /**
  * gcm_vec3_get_data:
+ * @src: the vector source
+ *
+ * Gets the raw data for the vector.
+ *
+ * Return value: the pointer to the data segment.
  **/
 gdouble *
-gcm_vec3_get_data (GcmVec3 *src)
+gcm_vec3_get_data (const GcmVec3 *src)
 {
 	return (gdouble *) src;
 }
 
 /**
  * gcm_mat33_clear:
+ * @src: the source
+ *
+ * Clears a matrix value, setting all it's values to zero.
  **/
 void
-gcm_mat33_clear (GcmMat3x3 *dest)
+gcm_mat33_clear (const GcmMat3x3 *src)
 {
 	guint i;
-	gdouble *temp = (gdouble *) dest;
+	gdouble *temp = (gdouble *) src;
 	for (i=0; i<3*3; i++)
 		temp[i] = 0.0f;
 }
 
 /**
  * gcm_mat33_to_string:
+ * @src: the source
+ *
+ * Obtains a string representaton of a matrix.
+ *
+ * Return value: the string. Free with g_free()
  **/
 gchar *
-gcm_mat33_to_string (GcmMat3x3 *src)
+gcm_mat33_to_string (const GcmMat3x3 *src)
 {
 	return g_strdup_printf ("\n/ %0 .3f  %0 .3f  %0 .3f \\\n"
 				"| %0 .3f  %0 .3f  %0 .3f |\n"
@@ -104,31 +131,46 @@ gcm_mat33_to_string (GcmMat3x3 *src)
 
 /**
  * gcm_mat33_get_data:
+ * @src: the matrix source
+ *
+ * Gets the raw data for the matrix.
+ *
+ * Return value: the pointer to the data segment.
  **/
 gdouble *
-gcm_mat33_get_data (GcmMat3x3 *src)
+gcm_mat33_get_data (const GcmMat3x3 *src)
 {
 	return (gdouble *) src;
 }
 
 /**
  * gcm_mat33_set_identity:
+ * @src: the source
+ *
+ * Sets the matrix to an identity value.
  **/
 void
-gcm_mat33_set_identity (GcmMat3x3 *dest)
+gcm_mat33_set_identity (GcmMat3x3 *src)
 {
-	gcm_mat33_clear (dest);
-	dest->m00 = 1.0f;
-	dest->m11 = 1.0f;
-	dest->m22 = 1.0f;
+	gcm_mat33_clear (src);
+	src->m00 = 1.0f;
+	src->m11 = 1.0f;
+	src->m22 = 1.0f;
 }
 
 /**
  * gcm_mat33_vector_multiply:
+ * @mat_src: the matrix source
+ * @vec_src: the vector source
+ * @vec_dest: the destination vector
+ *
+ * Multiplies a matrix with a vector.
+ * The arguments @vec_src and @vec_dest cannot be the same value.
  **/
 void
-gcm_mat33_vector_multiply (GcmMat3x3 *mat_src, GcmVec3 *vec_src, GcmVec3 *vec_dest)
+gcm_mat33_vector_multiply (const GcmMat3x3 *mat_src, const GcmVec3 *vec_src, GcmVec3 *vec_dest)
 {
+	g_return_if_fail (vec_src != vec_src);
 	vec_dest->v0 = mat_src->m00 * vec_src->v0 +
 		       mat_src->m01 * vec_src->v1 +
 		       mat_src->m02 * vec_src->v2;
@@ -142,14 +184,23 @@ gcm_mat33_vector_multiply (GcmMat3x3 *mat_src, GcmVec3 *vec_src, GcmVec3 *vec_de
 
 /**
  * gcm_mat33_matrix_multiply:
+ * @mat_src1: the matrix source
+ * @mat_src2: the other matrix source
+ * @mat_dest: the destination
+ *
+ * Multiply (convolve) one matrix with another.
+ * The arguments @mat_src1 cannot be the same as @mat_dest, and
+ * @mat_src2 cannot be the same as @mat_dest.
  **/
 void
-gcm_mat33_matrix_multiply (GcmMat3x3 *mat_src1, GcmMat3x3 *mat_src2, GcmMat3x3 *mat_dest)
+gcm_mat33_matrix_multiply (const GcmMat3x3 *mat_src1, const GcmMat3x3 *mat_src2, GcmMat3x3 *mat_dest)
 {
 	guint8 i, j, k;
 	gdouble *src1 = gcm_mat33_get_data (mat_src1);
 	gdouble *src2 = gcm_mat33_get_data (mat_src2);
 	gdouble *dest = gcm_mat33_get_data (mat_dest);
+	g_return_if_fail (mat_src1 != mat_dest);
+	g_return_if_fail (mat_src2 != mat_dest);
 
 	for (i=0; i<3; i++) {
 		for (j=0; j<3; j++) {
@@ -162,14 +213,21 @@ gcm_mat33_matrix_multiply (GcmMat3x3 *mat_src1, GcmMat3x3 *mat_src2, GcmMat3x3 *
 
 /**
  * gcm_mat33_reciprocal:
+ * @src: the source
+ * @dest: the destination
  *
- * Return value: FALSE if det is zero (singular)
+ * Inverts the matrix.
+ * The arguments @src and @dest cannot be the same value.
+ *
+ * Return value: %FALSE if det is zero (singular).
  **/
 gboolean
-gcm_mat33_reciprocal (GcmMat3x3 *src, GcmMat3x3 *dest)
+gcm_mat33_reciprocal (const GcmMat3x3 *src, GcmMat3x3 *dest)
 {
 	double det = 0;
 
+	g_return_val_if_fail (src != dest, FALSE);
+
 	det  = src->m00 * (src->m11 * src->m22 - src->m12 * src->m21);
 	det -= src->m01 * (src->m10 * src->m22 - src->m12 * src->m20);
 	det += src->m02 * (src->m10 * src->m21 - src->m11 * src->m20);
diff --git a/libcolor-glib/gcm-common.h b/libcolor-glib/gcm-common.h
index 4cb20f0..acdb33e 100644
--- a/libcolor-glib/gcm-common.h
+++ b/libcolor-glib/gcm-common.h
@@ -41,22 +41,22 @@ typedef struct {
 } GcmVec3;
 
 void		 gcm_vec3_clear			(GcmVec3		*src);
-void		 gcm_vec3_scalar_multiply	(GcmVec3		*src,
+void		 gcm_vec3_scalar_multiply	(const GcmVec3		*src,
 						 gdouble		 value,
 						 GcmVec3		*dest);
-gchar		*gcm_vec3_to_string		(GcmVec3		*src);
-gdouble		*gcm_vec3_get_data		(GcmVec3		*src);
-void		 gcm_mat33_clear		(GcmMat3x3		*dest);
-gchar		*gcm_mat33_to_string		(GcmMat3x3		*src);
-gdouble		*gcm_mat33_get_data		(GcmMat3x3		*src);
-void		 gcm_mat33_set_identity		(GcmMat3x3		*dest);
-void		 gcm_mat33_vector_multiply	(GcmMat3x3		*mat_src,
-						 GcmVec3		*vec_src,
+gchar		*gcm_vec3_to_string		(const GcmVec3		*src);
+gdouble		*gcm_vec3_get_data		(const GcmVec3		*src);
+void		 gcm_mat33_clear		(const GcmMat3x3	*src);
+gchar		*gcm_mat33_to_string		(const GcmMat3x3	*src);
+gdouble		*gcm_mat33_get_data		(const GcmMat3x3	*src);
+void		 gcm_mat33_set_identity		(GcmMat3x3		*src);
+void		 gcm_mat33_vector_multiply	(const GcmMat3x3	*mat_src,
+						 const GcmVec3		*vec_src,
 						 GcmVec3		*vec_dest);
-void		 gcm_mat33_matrix_multiply	(GcmMat3x3		*mat_src1,
-						 GcmMat3x3		*mat_src2,
+void		 gcm_mat33_matrix_multiply	(const GcmMat3x3	*mat_src1,
+						 const GcmMat3x3	*mat_src2,
 						 GcmMat3x3		*mat_dest);
-gboolean	 gcm_mat33_reciprocal		(GcmMat3x3		*src,
+gboolean	 gcm_mat33_reciprocal		(const GcmMat3x3	*src,
 						 GcmMat3x3		*dest);
 
 
diff --git a/libcolor-glib/gcm-ddc-client.c b/libcolor-glib/gcm-ddc-client.c
index af79c85..7fe1fc8 100644
--- a/libcolor-glib/gcm-ddc-client.c
+++ b/libcolor-glib/gcm-ddc-client.c
@@ -21,9 +21,10 @@
 
 /**
  * SECTION:gcm-ddc-client
- * @short_description: For managing different i2c devices
+ * @short_description: For managing all the #GcmDdcDevice's.
  *
- * A GObject to use for accessing devices.
+ * A GObject to use for managing a list of #GcmDdcDevice's.
+ * A #GcmDdcClient will contain many #GcmDdcDevice's.
  */
 
 #include "config.h"
@@ -125,6 +126,14 @@ out:
 
 /**
  * gcm_ddc_client_close:
+ * @client: a valid #GcmDdcClient instance
+ * @error: a valid #GError, or %NULL
+ *
+ * Closes the client, releasing all devices.
+ *
+ * Return value: %TRUE for success.
+ *
+ * Since: 0.0.1
  **/
 gboolean
 gcm_ddc_client_close (GcmDdcClient *client, GError **error)
@@ -149,6 +158,15 @@ out:
 
 /**
  * gcm_ddc_client_get_devices:
+ * @client: a valid #GcmDdcClient instance
+ * @error: a valid #GError, or %NULL
+ *
+ * Get all the #GcmDdcDevice's from the client.
+ * If the client has not been loaded it will be done automatically.
+ *
+ * Return value: a #GPtrArray of #GcmDdcDevice's, free with g_ptr_array_unref()
+ *
+ * Since: 0.0.1
  **/
 GPtrArray *
 gcm_ddc_client_get_devices (GcmDdcClient *client, GError **error)
@@ -172,6 +190,16 @@ out:
 
 /**
  * gcm_ddc_client_get_device_from_edid:
+ * @client: a valid #GcmDdcClient instance
+ * @edid_md5: a EDID checksum
+ * @error: a valid #GError, or %NULL
+ *
+ * Get a DDC device from it's EDID value.
+ * If the client has not been loaded it will be done automatically.
+ *
+ * Return value: A refcounted #GcmDdcDevice, or %NULL.
+ *
+ * Since: 0.0.1
  **/
 GcmDdcDevice *
 gcm_ddc_client_get_device_from_edid (GcmDdcClient *client, const gchar *edid_md5, GError **error)
@@ -218,6 +246,12 @@ out:
 
 /**
  * gcm_ddc_client_set_verbose:
+ * @client: a valid #GcmDdcClient instance
+ * @verbose: the logging setting, e.g. %GCM_VERBOSE_PROTOCOL.
+ *
+ * Sets the logging level for this instance.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_ddc_client_set_verbose (GcmDdcClient *client, GcmVerbose verbose)
@@ -327,9 +361,7 @@ gcm_ddc_client_finalize (GObject *object)
 /**
  * gcm_ddc_client_new:
  *
- * GcmDdcClient is a nice GObject wrapper for gcm.
- *
- * Return value: A new %GcmDdcClient instance
+ * Return value: A new #GcmDdcClient instance
  *
  * Since: 0.0.1
  **/
diff --git a/libcolor-glib/gcm-ddc-common.c b/libcolor-glib/gcm-ddc-common.c
index 465a09a..d175701 100644
--- a/libcolor-glib/gcm-ddc-common.c
+++ b/libcolor-glib/gcm-ddc-common.c
@@ -21,7 +21,7 @@
 
 /**
  * SECTION:gcm-ddc-common
- * @short_description: Common functionality
+ * @short_description: Common functionality for DDC/CI objects
  *
  * A GObject to use for common shizzle.
  */
@@ -136,6 +136,8 @@ static const GcmDescription vcp_descriptions[] = {
 
 /**
  * gcm_get_vcp_description_from_index:
+ *
+ * Since: 0.0.1
  **/
 const gchar *
 gcm_get_vcp_description_from_index (guchar idx)
@@ -154,6 +156,8 @@ gcm_get_vcp_description_from_index (guchar idx)
 
 /**
  * gcm_get_vcp_index_from_description:
+ *
+ * Since: 0.0.1
  **/
 guchar
 gcm_get_vcp_index_from_description (const gchar *description)
diff --git a/libcolor-glib/gcm-ddc-device.c b/libcolor-glib/gcm-ddc-device.c
index a115a7e..f7a3347 100644
--- a/libcolor-glib/gcm-ddc-device.c
+++ b/libcolor-glib/gcm-ddc-device.c
@@ -21,9 +21,10 @@
 
 /**
  * SECTION:gcm-ddc-device
- * @short_description: For managing different i2c devices
+ * @short_description: For managing a specific i2c devices using DDC/CI.
  *
- * A GObject to use for accessing a device using I2C.
+ * A GObject to use for controlling I2C devices with DDC/CI.
+ * A #GcmDdcDevice will contain many #GcmDdcControl's.
  */
 
 #include "config.h"
@@ -339,10 +340,9 @@ out:
 
 /**
  * gcm_ddc_device_read:
- *
  * @device: A valid #GcmDdcDevice
  * @data: the data location to read into
- * @length: the length of the @data buffer
+ * @data_length: the length of the @data buffer
  * @recieved_length: the amount of data that was copied
  * @error: a #GError, or %NULL
  *
@@ -623,7 +623,6 @@ out:
 
 /**
  * gcm_ddc_device_save:
- *
  * @device: A valid #GcmDdcDevice
  * @error: a #GError, or %NULL
  *
@@ -804,9 +803,9 @@ out:
  * @id: the device ID, e.g. GCM_DDC_CONTROL_ID_BRIGHTNESS
  * @error: a #GError, or %NULL
  *
- * Gets a #GcmControl object from the ID.
+ * Gets a #GcmDdcControl object from the ID.
  *
- * Return value: %NULL, or a #GcmControl which needs to be freed with g_object_unref().
+ * Return value: %NULL, or a #GcmDdcControl which needs to be freed with g_object_unref().
  *
  * Since: 0.0.1
  **/
@@ -1132,8 +1131,6 @@ gcm_ddc_device_finalize (GObject *object)
 /**
  * gcm_ddc_device_new:
  *
- * GcmDdcDevice is a nice GObject wrapper for gcm.
- *
  * Return value: A new %GcmDdcDevice instance
  *
  * Since: 0.0.1
diff --git a/libcolor-glib/gcm-edid.c b/libcolor-glib/gcm-edid.c
index bfa5826..819d51a 100644
--- a/libcolor-glib/gcm-edid.c
+++ b/libcolor-glib/gcm-edid.c
@@ -95,6 +95,13 @@ G_DEFINE_TYPE (GcmEdid, gcm_edid, G_TYPE_OBJECT)
 
 /**
  * gcm_edid_get_monitor_name:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Gets the monitor name.
+ *
+ * Return value: a null terminaled string value
+ *
+ * Since: 0.0.1
  **/
 const gchar *
 gcm_edid_get_monitor_name (GcmEdid *edid)
@@ -105,6 +112,13 @@ gcm_edid_get_monitor_name (GcmEdid *edid)
 
 /**
  * gcm_edid_get_vendor_name:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Gets the vendor name.
+ *
+ * Return value: a null terminaled string value
+ *
+ * Since: 0.0.1
  **/
 const gchar *
 gcm_edid_get_vendor_name (GcmEdid *edid)
@@ -119,6 +133,13 @@ gcm_edid_get_vendor_name (GcmEdid *edid)
 
 /**
  * gcm_edid_get_serial_number:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Gets the device serial number.
+ *
+ * Return value: a null terminaled string value
+ *
+ * Since: 0.0.1
  **/
 const gchar *
 gcm_edid_get_serial_number (GcmEdid *edid)
@@ -129,6 +150,13 @@ gcm_edid_get_serial_number (GcmEdid *edid)
 
 /**
  * gcm_edid_get_eisa_id:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Gets the EISA ID.
+ *
+ * Return value: a null terminaled string value
+ *
+ * Since: 0.0.1
  **/
 const gchar *
 gcm_edid_get_eisa_id (GcmEdid *edid)
@@ -139,6 +167,14 @@ gcm_edid_get_eisa_id (GcmEdid *edid)
 
 /**
  * gcm_edid_get_checksum:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Gets the EDID MD5 checksum, which is often useful to compare binary
+ * blobs.
+ *
+ * Return value: a null terminaled string value
+ *
+ * Since: 0.0.1
  **/
 const gchar *
 gcm_edid_get_checksum (GcmEdid *edid)
@@ -149,6 +185,13 @@ gcm_edid_get_checksum (GcmEdid *edid)
 
 /**
  * gcm_edid_get_pnp_id:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Gets the device PNP ID..
+ *
+ * Return value: a null terminaled string value
+ *
+ * Since: 0.0.1
  **/
 const gchar *
 gcm_edid_get_pnp_id (GcmEdid *edid)
@@ -159,6 +202,13 @@ gcm_edid_get_pnp_id (GcmEdid *edid)
 
 /**
  * gcm_edid_get_width:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Gets the width of the panel.
+ *
+ * Return value: the width in mm.
+ *
+ * Since: 0.0.1
  **/
 guint
 gcm_edid_get_width (GcmEdid *edid)
@@ -169,6 +219,13 @@ gcm_edid_get_width (GcmEdid *edid)
 
 /**
  * gcm_edid_get_height:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Gets the panel height.
+ *
+ * Return value: the height in mm.
+ *
+ * Since: 0.0.1
  **/
 guint
 gcm_edid_get_height (GcmEdid *edid)
@@ -179,6 +236,13 @@ gcm_edid_get_height (GcmEdid *edid)
 
 /**
  * gcm_edid_get_gamma:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Gets the monitor gamma.
+ *
+ * Return value: the gamma value, although this is typically 2.2
+ *
+ * Since: 0.0.1
  **/
 gfloat
 gcm_edid_get_gamma (GcmEdid *edid)
@@ -189,6 +253,11 @@ gcm_edid_get_gamma (GcmEdid *edid)
 
 /**
  * gcm_edid_reset:
+ * @edid: a valid #GcmEdid instance
+ *
+ * Resets all the cached values in this object.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_edid_reset (GcmEdid *edid)
@@ -287,6 +356,17 @@ gcm_edid_parse_string (const guint8 *data)
 
 /**
  * gcm_edid_parse:
+ * @edid: a valid #GcmEdid instance
+ * @data: the EDID block
+ * @length: the data length, typically a multiple of 128
+ * @error: a valid #GError or %NULL
+ *
+ * Parses an EDID block, checking for sanity and decoding anything
+ * important.
+ *
+ * Return value: %TRUE for success.
+ *
+ * Since: 0.0.1
  **/
 gboolean
 gcm_edid_parse (GcmEdid *edid, const guint8 *data, gsize length, GError **error)
@@ -301,6 +381,7 @@ gcm_edid_parse (GcmEdid *edid, const guint8 *data, gsize length, GError **error)
 
 	g_return_val_if_fail (GCM_IS_EDID (edid), FALSE);
 	g_return_val_if_fail (data != NULL, FALSE);
+	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
 	/* check header */
 	if (data[0] != 0x00 || data[1] != 0xff) {
@@ -613,7 +694,9 @@ gcm_edid_finalize (GObject *object)
 /**
  * gcm_edid_new:
  *
- * Return value: a new GcmEdid object.
+ * Return value: a new #GcmEdid object.
+ *
+ * Since: 0.0.1
  **/
 GcmEdid *
 gcm_edid_new (void)
diff --git a/libcolor-glib/gcm-enum.c b/libcolor-glib/gcm-enum.c
index fa4f83d..5d485c2 100644
--- a/libcolor-glib/gcm-enum.c
+++ b/libcolor-glib/gcm-enum.c
@@ -19,6 +19,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+/**
+ * SECTION:gcm-enum
+ * @short_description: Common routines to convert enumerated values to strings and vice versa.
+ *
+ * Functions to convert enumerated values to strings and vice versa.
+ */
+
 #include "config.h"
 
 #include "gcm-enum.h"
diff --git a/libcolor-glib/gcm-image.c b/libcolor-glib/gcm-image.c
index 4a6d8ad..0dbc8ee 100644
--- a/libcolor-glib/gcm-image.c
+++ b/libcolor-glib/gcm-image.c
@@ -21,7 +21,7 @@
 
 /**
  * SECTION:gcm-image
- * @short_description: a color managed #GtkImage.
+ * @short_description: A color managed #GtkImage.
  *
  * This object is used to convert an image using one, two or three ICC profiles.
  */
diff --git a/libcolor-glib/gcm-profile-store.c b/libcolor-glib/gcm-profile-store.c
index 2e6c464..a7bc04c 100644
--- a/libcolor-glib/gcm-profile-store.c
+++ b/libcolor-glib/gcm-profile-store.c
@@ -21,7 +21,7 @@
 
 /**
  * SECTION:gcm-profile-store
- * @short_description: object to hold an array of profiles.
+ * @short_description: Object to search for profiles and keep a list up to date.
  *
  * This object holds an array of %GcmProfiles, and watches both the directories
  * for changes.
diff --git a/libcolor-glib/gcm-profile-store.h b/libcolor-glib/gcm-profile-store.h
index ee23c51..618bce0 100644
--- a/libcolor-glib/gcm-profile-store.h
+++ b/libcolor-glib/gcm-profile-store.h
@@ -80,7 +80,7 @@ GcmProfile	*gcm_profile_store_get_by_checksum	(GcmProfileStore	*profile_store,
 							 const gchar		*checksum);
 GPtrArray	*gcm_profile_store_get_array		(GcmProfileStore	*profile_store);
 gboolean	 gcm_profile_store_search		(GcmProfileStore	*profile_store,
-							 GcmProfileSearchFlags	 search_flags);
+							 GcmProfileSearchFlags	 flags);
 gboolean	 gcm_profile_store_search_path		(GcmProfileStore	*profile_store,
 							 const gchar		*path);
 
diff --git a/libcolor-glib/gcm-profile.c b/libcolor-glib/gcm-profile.c
index c3ae0dd..7a4817e 100644
--- a/libcolor-glib/gcm-profile.c
+++ b/libcolor-glib/gcm-profile.c
@@ -230,8 +230,6 @@ gcm_profile_get_file (GcmProfile *profile)
  *
  * Sets the file to be used when reading the profile.
  *
- * Return value: %TRUE for success
- *
  * Since: 0.0.1
  **/
 void
@@ -383,7 +381,7 @@ gcm_profile_get_manufacturer (GcmProfile *profile)
 /**
  * gcm_profile_set_manufacturer:
  * @profile: A valid #GcmProfile
- * @model: the profile manufacturer.
+ * @manufacturer: the profile manufacturer.
  *
  * Sets the device manufacturer name.
  *
diff --git a/libcolor-glib/gcm-sensor-dummy.c b/libcolor-glib/gcm-sensor-dummy.c
index 0f3f0f8..5bf1faf 100644
--- a/libcolor-glib/gcm-sensor-dummy.c
+++ b/libcolor-glib/gcm-sensor-dummy.c
@@ -21,7 +21,7 @@
 
 /**
  * SECTION:gcm-sensor-dummy
- * @short_description: functionality to talk to a dummy sensor_client.
+ * @short_description: Userspace driver for a dummy sensor.
  *
  * This object contains all the low level logic for imaginary hardware.
  */
diff --git a/libcolor-glib/gcm-sensor-huey.c b/libcolor-glib/gcm-sensor-huey.c
index eb24e0c..fd3f3eb 100644
--- a/libcolor-glib/gcm-sensor-huey.c
+++ b/libcolor-glib/gcm-sensor-huey.c
@@ -21,7 +21,7 @@
 
 /**
  * SECTION:gcm-sensor-huey
- * @short_description: functionality to talk to the HUEY sensor_client.
+ * @short_description: Userspace driver for the HUEY colorimeter.
  *
  * This object contains all the low level logic for the HUEY hardware.
  */
diff --git a/libcolor-glib/gcm-usb.c b/libcolor-glib/gcm-usb.c
index 891ff0f..57fa4d0 100644
--- a/libcolor-glib/gcm-usb.c
+++ b/libcolor-glib/gcm-usb.c
@@ -236,8 +236,6 @@ static GSourceFuncs gcm_usb_source_funcs = {
  * Connects up usb-1 with the GLib event loop. This functionality
  * allows you to submit async requests using usb, and the callbacks
  * just kinda happen at the right time.
- *
- * Return value: %TRUE for success
  **/
 void
 gcm_usb_attach_to_context (GcmUsb *usb, GMainContext *context)
@@ -333,6 +331,10 @@ gcm_usb_get_device_handle (GcmUsb *usb)
 /**
  * gcm_usb_connect:
  * @usb:  a #GcmUsb instance
+ * @vendor_id: the vendor ID to connect to
+ * @product_id: the product ID to connect to
+ * @configuration: the configuration index to use, usually '1'
+ * @interface: the configuration interface to use, usually '0'
  * @error:  a #GError, or %NULL
  *
  * Connects to a specific device.
@@ -380,7 +382,7 @@ gcm_usb_connect (GcmUsb *usb, guint vendor_id, guint product_id, guint configura
 		ret = FALSE;
 		goto out;
 	}
-	retval = libusb_claim_interface (priv->handle, 0);
+	retval = libusb_claim_interface (priv->handle, interface);
 	if (retval < 0) {
 		g_set_error (error, GCM_USB_ERROR,
 			     GCM_USB_ERROR_INTERNAL,
diff --git a/libcolor-glib/gcm-version.h.in b/libcolor-glib/gcm-version.h.in
index c890d03..b58ffa9 100644
--- a/libcolor-glib/gcm-version.h.in
+++ b/libcolor-glib/gcm-version.h.in
@@ -19,6 +19,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+/**
+ * SECTION:gcm-version
+ * @short_description: Simple versioning helper macros.
+ *
+ * Simple versioning helper macros.
+ */
+
 #if !defined (__LIBCOLOR_GLIB_H_INSIDE__) && !defined (LIBCOLOR_GLIB_COMPILATION)
 #error "Only <libcolor-glib.h> can be included directly."
 #endif
diff --git a/libcolor-glib/gcm-x11-output.c b/libcolor-glib/gcm-x11-output.c
index 24b20e0..6c72727 100644
--- a/libcolor-glib/gcm-x11-output.c
+++ b/libcolor-glib/gcm-x11-output.c
@@ -22,7 +22,7 @@
 
 /**
  * SECTION:gcm-x11-output
- * @short_description: Object to interact with the XServer
+ * @short_description: An object to interact with the XServer output.
  *
  * This object talks to the currently running X Server.
  */
@@ -74,26 +74,47 @@ G_DEFINE_TYPE (GcmX11Output, gcm_x11_output, G_TYPE_OBJECT)
 
 /**
  * gcm_x11_output_set_name:
+ * @output: a valid %GcmX11Output instance
+ * @display: the #Display
+ *
+ * Sets the display.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_set_display (GcmX11Output *output, gpointer display)
 {
 	g_return_if_fail (GCM_IS_X11_OUTPUT (output));
+	g_return_if_fail (output->priv->display == NULL);
 	output->priv->display = display;
 }
 
 /**
  * gcm_x11_output_set_name:
+ * @output: a valid %GcmX11Output instance
+ * @name: the display name, for instance "lvds"
+ *
+ * Sets the interal panel name.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_set_name (GcmX11Output *output, const gchar *name)
 {
 	g_return_if_fail (GCM_IS_X11_OUTPUT (output));
+	g_return_if_fail (output->priv->name == NULL);
 	output->priv->name = g_strdup (name);
 }
 
 /**
  * gcm_x11_output_get_name:
+ * @output: a valid %GcmX11Output instance
+ *
+ * Gets the panel name.
+ *
+ * Return value: the panel name
+ *
+ * Since: 0.0.1
  **/
 const gchar *
 gcm_x11_output_get_name (GcmX11Output *output)
@@ -104,56 +125,64 @@ gcm_x11_output_get_name (GcmX11Output *output)
 
 /**
  * gcm_x11_output_set_id:
+ * @output: a valid %GcmX11Output instance
+ * @id: the xrandr ID for the output
+ *
+ * Sets the ID of the output.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_set_id (GcmX11Output *output, guint id)
 {
 	g_return_if_fail (GCM_IS_X11_OUTPUT (output));
+	g_return_if_fail (output->priv->id == 0);
 	output->priv->id = id;
 }
 
 /**
- * gcm_x11_output_get_id:
- **/
-guint
-gcm_x11_output_get_id (GcmX11Output *output)
-{
-	g_return_val_if_fail (GCM_IS_X11_OUTPUT (output), 0);
-	return output->priv->id;
-}
-
-/**
  * gcm_x11_output_set_crtc_id:
+ * @output: a valid %GcmX11Output instance
+ * @crtc_id: the CRCT id
+ *
+ * Sets the CRTC (specific control on an output) id.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_set_crtc_id (GcmX11Output *output, guint crtc_id)
 {
 	g_return_if_fail (GCM_IS_X11_OUTPUT (output));
+	g_return_if_fail (output->priv->crtc_id == 0);
 	output->priv->crtc_id = crtc_id;
 }
 
 /**
- * gcm_x11_output_get_crtc_id:
- **/
-guint
-gcm_x11_output_get_crtc_id (GcmX11Output *output)
-{
-	g_return_val_if_fail (GCM_IS_X11_OUTPUT (output), 0);
-	return output->priv->crtc_id;
-}
-
-/**
  * gcm_x11_output_set_gamma_size:
+ * @output: a valid %GcmX11Output instance
+ * @gamma_size: the size of the gamma ramp.
+ *
+ * Sets the size of the gamma ramp.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_set_gamma_size (GcmX11Output *output, guint gamma_size)
 {
 	g_return_if_fail (GCM_IS_X11_OUTPUT (output));
+	g_return_if_fail (output->priv->gamma_size == 0);
 	output->priv->gamma_size = gamma_size;
 }
 
 /**
  * gcm_x11_output_get_gamma_size:
+ * @output: a valid %GcmX11Output instance
+ *
+ * Gets the size of the gamma ramps.
+ *
+ * Return value: the size. This is normally 256 or 1024.
+ *
+ * Since: 0.0.1
  **/
 guint
 gcm_x11_output_get_gamma_size (GcmX11Output *output)
@@ -164,16 +193,31 @@ gcm_x11_output_get_gamma_size (GcmX11Output *output)
 
 /**
  * gcm_x11_output_set_primary:
+ * @output: a valid %GcmX11Output instance
+ * @primary: if the panel is the primary screen
+ *
+ * Sets if the panel is the most important primary screen.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_set_primary (GcmX11Output *output, gboolean primary)
 {
 	g_return_if_fail (GCM_IS_X11_OUTPUT (output));
+	g_return_if_fail (!output->priv->primary);
 	output->priv->primary = primary;
 }
 
 /**
  * gcm_x11_output_get_primary:
+ * @output: a valid %GcmX11Output instance
+ *
+ * Gets if the panel is the primary most important screen.
+ * There should only ever be one primary screen in a #GcmX11Screen.
+ *
+ * Return value: %TRUE for the primary screen.
+ *
+ * Since: 0.0.1
  **/
 gboolean
 gcm_x11_output_get_primary (GcmX11Output *output)
@@ -184,6 +228,14 @@ gcm_x11_output_get_primary (GcmX11Output *output)
 
 /**
  * gcm_x11_output_set_connected:
+ * @output: a valid %GcmX11Output instance
+ * @connected: the devices connected state
+ *
+ * Sets if the device is connected, i.e. has an actual physical device
+ * plugged into the port.
+ * NOTE: a device can be conncted even if it is powered off or in sleep mode.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_set_connected (GcmX11Output *output, gboolean connected)
@@ -194,6 +246,15 @@ gcm_x11_output_set_connected (GcmX11Output *output, gboolean connected)
 
 /**
  * gcm_x11_output_get_connected:
+ * @output: a valid %GcmX11Output instance
+ *
+ * Gets if the output is connected. This function should return %TRUE
+ * most of the time as non-connected outputs should not have been added
+ * to the #GcmX11Screen.
+ *
+ * Return value: if the device is connected.
+ *
+ * Since: 0.0.1
  **/
 gboolean
 gcm_x11_output_get_connected (GcmX11Output *output)
@@ -204,6 +265,14 @@ gcm_x11_output_get_connected (GcmX11Output *output)
 
 /**
  * gcm_x11_output_set_position:
+ * @output: a valid %GcmX11Output instance
+ * @x: the x cordinate
+ * @y: the y cordinate
+ *
+ * Sets the position of the display relative to the absolute size of all
+ * the #GcmX11Output's.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_set_position (GcmX11Output *output, guint x, guint y)
@@ -215,6 +284,14 @@ gcm_x11_output_set_position (GcmX11Output *output, guint x, guint y)
 
 /**
  * gcm_x11_output_get_position:
+ * @output: a valid %GcmX11Output instance
+ * @x: the returned x cordinate, or %NULL
+ * @y: the returned y cordinate, or %NULL
+ *
+ * Gets the position of the panel relative to the absolute size of all
+ * the #GcmX11Output's.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_get_position (GcmX11Output *output, guint *x, guint *y)
@@ -228,6 +305,13 @@ gcm_x11_output_get_position (GcmX11Output *output, guint *x, guint *y)
 
 /**
  * gcm_x11_output_set_size:
+ * @output: a valid %GcmX11Output instance
+ * @width: the output width in pixels
+ * @height: the output height in pixels
+ *
+ * Sets the size of the output.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_set_size (GcmX11Output *output, guint width, guint height)
@@ -239,6 +323,13 @@ gcm_x11_output_set_size (GcmX11Output *output, guint width, guint height)
 
 /**
  * gcm_x11_output_get_size:
+ * @output: a valid %GcmX11Output instance
+ * @width: the returned output width in pixels, or %NULL
+ * @height: the returned output height in pixels, or %NULL
+ *
+ * Gets the output size.
+ *
+ * Since: 0.0.1
  **/
 void
 gcm_x11_output_get_size (GcmX11Output *output, guint *width, guint *height)
@@ -284,6 +375,16 @@ out:
 
 /**
  * gcm_x11_output_get_edid_data:
+ * @output: a valid %GcmX11Output instance
+ * @data: the returned data, free with g_free()
+ * @length: the size of the returned @data in bytes
+ * @error: A #GError, or %NULL
+ *
+ * Gets the EDID data for the output.
+ *
+ * Return value: %TRUE for success.
+ *
+ * Since: 0.0.1
  **/
 gboolean
 gcm_x11_output_get_edid_data (GcmX11Output *output, guint8 **data, gsize *length, GError **error)
@@ -323,6 +424,10 @@ out:
 /**
  * gcm_x11_output_set_gamma:
  * @output: a valid %GcmX11Output instance
+ * @length: the data arrays length, or %NULL.
+ * @red: the red channel data array
+ * @green: the red channel data array
+ * @blue: the red channel data array
  * @error: a %GError, or %NULL
  *
  * Sets the gamma ramps for the given output.
@@ -330,7 +435,7 @@ out:
  * Return value: %TRUE for success.
  **/
 gboolean
-gcm_x11_output_set_gamma (GcmX11Output *output, guint size, guint16 *red, guint16 *green, guint16 *blue, GError **error)
+gcm_x11_output_set_gamma (GcmX11Output *output, guint length, guint16 *red, guint16 *green, guint16 *blue, GError **error)
 {
 	guint copy_size;
 	XRRCrtcGamma *gamma;
@@ -341,13 +446,17 @@ gcm_x11_output_set_gamma (GcmX11Output *output, guint size, guint16 *red, guint1
 	g_return_val_if_fail (green != NULL, FALSE);
 	g_return_val_if_fail (blue != NULL, FALSE);
 
-	return TRUE;
-
-	if (size != output->priv->gamma_size)
+	/* not what we're expecting */
+	if (length != output->priv->gamma_size) {
+		g_set_error (error,
+			     GCM_X11_OUTPUT_ERROR, GCM_X11_OUTPUT_ERROR_INTERNAL,
+			     "gamma size incorrect: %i, expected %i",
+			     length, output->priv->gamma_size);
 		return FALSE;
+	}
 
-	gamma = XRRAllocGamma (output->priv->gamma_size);
-	copy_size = output->priv->gamma_size * sizeof (guint16);
+	gamma = XRRAllocGamma (length);
+	copy_size = length * sizeof (guint16);
 	memcpy (gamma->red, red, copy_size);
 	memcpy (gamma->green, green, copy_size);
 	memcpy (gamma->blue, blue, copy_size);
@@ -367,9 +476,21 @@ gcm_x11_output_set_gamma (GcmX11Output *output, guint size, guint16 *red, guint1
 
 /**
  * gcm_x11_output_get_gamma:
+ * @output: a valid %GcmX11Output instance
+ * @length: the returned data arrays size, or %NULL.
+ * @red: the returned red channel data array, or %NULL. Free with g_free().
+ * @green: the returned red channel data array, or %NULL. Free with g_free().
+ * @blue: the returned red channel data array, or %NULL. Free with g_free().
+ * @error: a %GError, or %NULL
+ *
+ * Gets the gamma ramps for the given output.
+ *
+ * Return value: %TRUE for success.
+ *
+ * Since: 0.0.1
  **/
 gboolean
-gcm_x11_output_get_gamma (GcmX11Output *output, guint *size, guint16 **red, guint16 **green, guint16 **blue, GError **error)
+gcm_x11_output_get_gamma (GcmX11Output *output, guint *length, guint16 **red, guint16 **green, guint16 **blue, GError **error)
 {
 	guint copy_size;
 	guint16 *r, *g, *b;
@@ -404,8 +525,8 @@ gcm_x11_output_get_gamma (GcmX11Output *output, guint *size, guint16 **red, guin
 		memcpy (b, gamma->blue, copy_size);
 		*blue = b;
 	}
-	if (size)
-		*size = output->priv->gamma_size;
+	if (length != NULL)
+		*length = output->priv->gamma_size;
 	XRRFreeGamma (gamma);
 	return TRUE;
 }
@@ -413,8 +534,7 @@ gcm_x11_output_get_gamma (GcmX11Output *output, guint *size, guint16 **red, guin
 
 /**
  * gcm_x11_output_get_profile_data:
- *
- * @x11: a valid %GcmX11Output instance
+ * @output: a valid %GcmX11Output instance
  * @data: the data that is returned from the XServer. Free with g_free()
  * @length: the size of the returned data, or %NULL if you don't care
  * @error: a %GError that is set in the result of an error, or %NULL
@@ -481,7 +601,7 @@ out:
 
 /**
  * gcm_x11_output_set_profile:
- * @x11: a valid %GcmX11Output instance
+ * @output: a valid %GcmX11Output instance
  * @filename: the filename of the ICC profile
  * @error: a %GError that is set in the result of an error, or %NULL
  *
@@ -519,7 +639,7 @@ out:
 
 /**
  * gcm_x11_output_set_profile_data:
- * @x11: a valid %GcmX11Output instance
+ * @output: a valid %GcmX11Output instance
  * @data: the data that is to be set to the XServer
  * @length: the size of the data
  * @error: a %GError that is set in the result of an error, or %NULL
@@ -565,7 +685,7 @@ out:
 
 /**
  * gcm_x11_output_remove_profile:
- * @x11: a valid %GcmX11Output instance
+ * @output: a valid %GcmX11Output instance
  * @error: a %GError that is set in the result of an error, or %NULL
  *
  * Sets the ICC profile data to the specified output.
diff --git a/libcolor-glib/gcm-x11-output.h b/libcolor-glib/gcm-x11-output.h
index dac019a..7d4446c 100644
--- a/libcolor-glib/gcm-x11-output.h
+++ b/libcolor-glib/gcm-x11-output.h
@@ -62,10 +62,8 @@ void		 gcm_x11_output_set_name		(GcmX11Output		*output,
 const gchar	*gcm_x11_output_get_name		(GcmX11Output		*output);
 void		 gcm_x11_output_set_id			(GcmX11Output		*output,
 							 guint			 id);
-guint		 gcm_x11_output_get_id			(GcmX11Output		*output);
 void		 gcm_x11_output_set_crtc_id		(GcmX11Output		*output,
 							 guint			 crtc_id);
-guint		 gcm_x11_output_get_crtc_id		(GcmX11Output		*output);
 void		 gcm_x11_output_set_gamma_size		(GcmX11Output		*output,
 							 guint			 gamma_size);
 guint		 gcm_x11_output_get_gamma_size		(GcmX11Output		*output);
@@ -88,13 +86,13 @@ void		 gcm_x11_output_set_connected		(GcmX11Output		*output,
 							 gboolean		 connected);
 gboolean	 gcm_x11_output_get_connected		(GcmX11Output		*output);
 gboolean	 gcm_x11_output_get_gamma		(GcmX11Output		*output,
-							 guint			*size,
+							 guint			*length,
 							 guint16		**red,
 							 guint16		**green,
 							 guint16		**blue,
 							 GError			**error);
 gboolean	 gcm_x11_output_set_gamma		(GcmX11Output		*output,
-							 guint			 size,
+							 guint			 length,
 							 guint16		*red,
 							 guint16		*green,
 							 guint16		*blue,
diff --git a/libcolor-glib/gcm-x11-screen.c b/libcolor-glib/gcm-x11-screen.c
index 811a85f..a85022c 100644
--- a/libcolor-glib/gcm-x11-screen.c
+++ b/libcolor-glib/gcm-x11-screen.c
@@ -22,9 +22,10 @@
 
 /**
  * SECTION:gcm-x11-screen
- * @short_description: Object to interact with the XServer
+ * @short_description: An object to interact with the XServer screen.
  *
  * This object talks to the currently running X Server.
+ * The #GcmX11Screen objwect will contain one or many #GcmX11Outputs.
  */
 
 #include "config.h"
@@ -338,7 +339,7 @@ gcm_x11_screen_get_output_by_name (GcmX11Screen *screen, const gchar *name, GErr
 
 /**
  * gcm_x11_screen_get_profile_data:
- * @x11: a valid %GcmX11Screen instance
+ * @screen: a valid %GcmX11Screen instance
  * @data: the data that is returned from the XServer. Free with g_free()
  * @length: the size of the returned data, or %NULL if you don't care
  * @error: a %GError that is set in the result of an error, or %NULL
@@ -399,7 +400,7 @@ out:
 
 /**
  * gcm_x11_screen_set_profile:
- * @x11: a valid %GcmX11Screen instance
+ * @screen: a valid %GcmX11Screen instance
  * @filename: the filename of the ICC profile
  * @error: a %GError that is set in the result of an error, or %NULL
  *
@@ -437,7 +438,7 @@ out:
 
 /**
  * gcm_x11_screen_set_profile_data:
- * @x11: a valid %GcmX11Screen instance
+ * @screen: a valid %GcmX11Screen instance
  * @data: the data that is to be set to the XServer
  * @length: the size of the data
  * @error: a %GError that is set in the result of an error, or %NULL
@@ -484,7 +485,7 @@ out:
 
 /**
  * gcm_x11_screen_set_protocol_version:
- * @x11: a valid %GcmX11Screen instance
+ * @screen: a valid %GcmX11Screen instance
  * @major: the major version
  * @minor: the minor version
  * @error: a %GError that is set in the result of an error, or %NULL
@@ -533,7 +534,7 @@ out:
 
 /**
  * gcm_x11_screen_remove_protocol_version:
- * @x11: a valid %GcmX11Screen instance
+ * @screen: a valid %GcmX11Screen instance
  * @error: a %GError that is set in the result of an error, or %NULL
  *
  * Removes the ICC profile version data from the XServer.
@@ -576,8 +577,7 @@ out:
 
 /**
  * gcm_x11_screen_get_protocol_version:
- *
- * @x11: a valid %GcmX11Screen instance
+ * @screen: a valid %GcmX11Screen instance
  * @major: the major version
  * @minor: the minor version
  * @error: a %GError that is set in the result of an error, or %NULL
@@ -638,7 +638,7 @@ out:
 
 /**
  * gcm_x11_screen_remove_profile:
- * @x11: a valid %GcmX11Screen instance
+ * @screen: a valid %GcmX11Screen instance
  * @error: a %GError that is set in the result of an error, or %NULL
  *
  * Removes the ICC profile data from the XServer.
@@ -680,6 +680,24 @@ out:
 }
 
 /**
+ * gcm_x11_screen_get_randr_version:
+ * @screen: a valid %GcmX11Screen instance
+ * @major: the returned XRandR version major, or %NULL
+ * @minor: the returned XRandR version minor, or %NULL
+ *
+ * Gets the XRandR version from the server.
+ **/
+void
+gcm_x11_screen_get_randr_version (GcmX11Screen *screen, guint *major, guint *minor)
+{
+	g_return_if_fail (GCM_IS_X11_SCREEN (screen));
+	if (major != NULL)
+		*major = screen->priv->rr_major_version;
+	if (minor != NULL)
+		*minor = screen->priv->rr_minor_version;
+}
+
+/**
  * gcm_x11_screen_class_init:
  **/
 static void
diff --git a/libcolor-glib/gcm-x11-screen.h b/libcolor-glib/gcm-x11-screen.h
index 52f7e54..c17bd0c 100644
--- a/libcolor-glib/gcm-x11-screen.h
+++ b/libcolor-glib/gcm-x11-screen.h
@@ -90,6 +90,9 @@ gboolean	 gcm_x11_screen_get_protocol_version	(GcmX11Screen		*screen,
 							 guint			*major,
 							 guint			*minor,
 							 GError			**error);
+void		 gcm_x11_screen_get_randr_version	(GcmX11Screen		*screen,
+							 guint			*major,
+							 guint			*minor);
 
 G_END_DECLS
 
diff --git a/libcolor-glib/libcolor-glib.h b/libcolor-glib/libcolor-glib.h
index 6f66ecb..39ab6b2 100644
--- a/libcolor-glib/libcolor-glib.h
+++ b/libcolor-glib/libcolor-glib.h
@@ -28,6 +28,7 @@
 
 #define __LIBCOLOR_GLIB_H_INSIDE__
 
+#include <gcm-buffer.h>
 #include <gcm-common.h>
 #include <gcm-color.h>
 #include <gcm-ddc-common.h>
diff --git a/src/Makefile.am b/src/Makefile.am
index 59bff3d..a8848e8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,6 +33,8 @@ dist_introspection_DATA = org.gnome.ColorManager.xml
 
 ccpanelsdir = $(PANELS_DIR)
 ccpanels_LTLIBRARIES = libcolor.la
+ccpanels_CFLAGS =					\
+	$(WARNINGFLAGS_C)
 
 noinst_LIBRARIES = libgcmshared.a
 libgcmshared_a_SOURCES =				\
diff --git a/src/cc-color-panel.c b/src/cc-color-panel.c
index 0f9ddce..d8f8e4c 100644
--- a/src/cc-color-panel.c
+++ b/src/cc-color-panel.c
@@ -1372,8 +1372,6 @@ cc_color_panel_set_calibrate_button_sensitivity (CcColorPanel *panel)
 	GtkWidget *widget;
 	const gchar *tooltip;
 	GcmDeviceKind kind;
-	gboolean connected;
-	gboolean xrandr_fallback;
 	gboolean has_vte = TRUE;
 
 	/* TRANSLATORS: this is when the button is sensitive */
@@ -1402,16 +1400,16 @@ cc_color_panel_set_calibrate_button_sensitivity (CcColorPanel *panel)
 	if (kind == GCM_DEVICE_KIND_DISPLAY) {
 
 		/* are we disconnected */
-		connected = gcm_device_get_connected (panel->priv->current_device);
-		if (!connected) {
+		ret = gcm_device_get_connected (panel->priv->current_device);
+		if (!ret) {
 			/* TRANSLATORS: this is when the button is insensitive */
 			tooltip = _("Cannot create profile: The display device is not connected");
 			goto out;
 		}
 
 		/* are we not XRandR 1.3 compat */
-		xrandr_fallback = gcm_device_xrandr_get_fallback (GCM_DEVICE_XRANDR (panel->priv->current_device));
-		if (xrandr_fallback) {
+		ret = gcm_device_xrandr_get_xrandr13 (GCM_DEVICE_XRANDR (panel->priv->current_device));
+		if (!ret) {
 			/* TRANSLATORS: this is when the button is insensitive */
 			tooltip = _("Cannot create profile: The display driver does not support XRandR 1.3");
 			goto out;
@@ -1523,19 +1521,20 @@ cc_color_panel_devices_treeview_clicked_cb (GtkTreeSelection *selection, CcColor
 
 	/* show broken devices */
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "label_problems"));
+	gtk_widget_hide (widget);
 	if (kind == GCM_DEVICE_KIND_DISPLAY) {
-		ret = gcm_device_xrandr_get_fallback (GCM_DEVICE_XRANDR (panel->priv->current_device));
+		ret = gcm_device_get_connected (panel->priv->current_device);
 		if (ret) {
-			/* TRANSLATORS: Some shitty binary drivers do not support per-head gamma controls.
-			 * Whilst this does not matter if you only have one monitor attached, it means you
-			 * can't color correct additional monitors or projectors. */
-			gtk_label_set_label (GTK_LABEL (widget), _("Per-device settings not supported. Check your display driver."));
-			gtk_widget_show (widget);
-		} else {
-			gtk_widget_hide (widget);
+			ret = gcm_device_xrandr_get_xrandr13 (GCM_DEVICE_XRANDR (panel->priv->current_device));
+			if (!ret) {
+				/* TRANSLATORS: Some shitty binary drivers do not support per-head gamma controls.
+				* Whilst this does not matter if you only have one monitor attached, it means you
+				* can't color correct additional monitors or projectors. */
+				gtk_label_set_label (GTK_LABEL (widget),
+						     _("Per-device settings not supported. Check your display driver."));
+				gtk_widget_show (widget);
+			}
 		}
-	} else {
-		gtk_widget_hide (widget);
 	}
 
 	/* set device labels */
diff --git a/src/gcm-device-xrandr.c b/src/gcm-device-xrandr.c
index 31f8988..d4dcde1 100644
--- a/src/gcm-device-xrandr.c
+++ b/src/gcm-device-xrandr.c
@@ -58,6 +58,7 @@ struct _GcmDeviceXrandrPrivate
 	GSettings			*settings;
 	GcmX11Screen			*screen;
 	gboolean			 remove_atom;
+	gboolean			 randr_13;
 };
 
 enum {
@@ -237,6 +238,7 @@ gcm_device_xrandr_set_from_output (GcmDevice *device, GcmX11Output *output, GErr
 	const gchar *model;
 	guint8 *data = NULL;
 	gsize length;
+	guint major, minor;
 	GcmDeviceXrandrPrivate *priv = GCM_DEVICE_XRANDR(device)->priv;
 
 	/* parse the EDID to get a output specific name */
@@ -283,6 +285,10 @@ gcm_device_xrandr_set_from_output (GcmDevice *device, GcmX11Output *output, GErr
 		      "native-device", output_name,
 		      NULL);
 
+	/* is XRandR 1.3 compatible */
+	gcm_x11_screen_get_randr_version (priv->screen, &major, &minor);
+	priv->randr_13 = (major >= 1 && minor >= 3);
+
 	/* success */
 	ret = TRUE;
 out:
@@ -294,6 +300,18 @@ out:
 
 /**
  * gcm_device_xrandr_apply_for_output:
+ * @device_xrandr: a valid #GcmDeviceXrandr instance
+ *
+ * Return value: %TRUE if the display supports XRandr 1.3;
+ **/
+gboolean
+gcm_device_xrandr_get_xrandr13 (GcmDeviceXrandr *device_xrandr)
+{
+	return device_xrandr->priv->randr_13;
+}
+
+/**
+ * gcm_device_xrandr_apply_for_output:
  *
  * Return value: %TRUE for success;
  **/
@@ -675,7 +693,6 @@ gcm_device_xrandr_finalize (GObject *object)
 	g_object_unref (priv->dmi);
 	g_object_unref (priv->settings);
 	g_object_unref (priv->screen);
-	g_object_unref (priv->screen);
 
 	G_OBJECT_CLASS (gcm_device_xrandr_parent_class)->finalize (object);
 }
diff --git a/src/gcm-device-xrandr.h b/src/gcm-device-xrandr.h
index 58434be..d47fa04 100644
--- a/src/gcm-device-xrandr.h
+++ b/src/gcm-device-xrandr.h
@@ -58,7 +58,7 @@ void		 gcm_device_xrandr_set_remove_atom	(GcmDeviceXrandr	*device_xrandr,
 const gchar	*gcm_device_xrandr_get_native_device	(GcmDeviceXrandr	*device_xrandr);
 const gchar	*gcm_device_xrandr_get_eisa_id		(GcmDeviceXrandr	*device_xrandr);
 const gchar	*gcm_device_xrandr_get_edid_md5		(GcmDeviceXrandr	*device_xrandr);
-gboolean	 gcm_device_xrandr_get_fallback		(GcmDeviceXrandr	*device_xrandr);
+gboolean	 gcm_device_xrandr_get_xrandr13		(GcmDeviceXrandr	*device_xrandr);
 gboolean	 gcm_device_xrandr_is_primary		(GcmDeviceXrandr	*device_xrandr);
 
 G_END_DECLS
diff --git a/tools/gcm-ddc-util.c b/tools/gcm-ddc-util.c
index 2a3faf8..136f331 100644
--- a/tools/gcm-ddc-util.c
+++ b/tools/gcm-ddc-util.c
@@ -21,7 +21,6 @@
 
 #include <config.h>
 #include <glib/gstdio.h>
-
 #include <libcolor-glib.h>
 
 /**
diff --git a/tools/gcm-dump-edid.c b/tools/gcm-dump-edid.c
index 20d4d2b..c04cf03 100644
--- a/tools/gcm-dump-edid.c
+++ b/tools/gcm-dump-edid.c
@@ -24,9 +24,7 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <locale.h>
-
-#include "gcm-edid.h"
-#include "gcm-x11-screen.h"
+#include <libcolor-glib.h>
 
 /**
  * gcm_dump_edid_filename:
diff --git a/tools/gcm-dump-profile.c b/tools/gcm-dump-profile.c
index 6b991ab..d41200f 100644
--- a/tools/gcm-dump-profile.c
+++ b/tools/gcm-dump-profile.c
@@ -24,9 +24,7 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <locale.h>
-
-#include "gcm-enum.h"
-#include "gcm-profile.h"
+#include <libcolor-glib.h>
 
 /**
  * gcm_dump_profile_filename:
diff --git a/tools/gcm-dump-sensor.c b/tools/gcm-dump-sensor.c
index 202d211..e1aaeea 100644
--- a/tools/gcm-dump-sensor.c
+++ b/tools/gcm-dump-sensor.c
@@ -23,8 +23,7 @@
 
 #include <glib/gi18n.h>
 #include <locale.h>
-
-#include "gcm-sensor-client.h"
+#include <libcolor-glib.h>
 
 /**
  * main:
diff --git a/tools/gcm-sensor-colormunki.c b/tools/gcm-sensor-colormunki.c
index 557c3d1..9e7f9c0 100644
--- a/tools/gcm-sensor-colormunki.c
+++ b/tools/gcm-sensor-colormunki.c
@@ -30,11 +30,10 @@
 
 #include <glib-object.h>
 #include <libusb-1.0/libusb.h>
+#include <libcolor-glib.h>
 
 #include "egg-debug.h"
-#include "gcm-common.h"
-#include "gcm-buffer.h"
-#include "gcm-usb.h"
+
 #include "gcm-sensor-colormunki.h"
 
 static void     gcm_sensor_colormunki_finalize	(GObject     *object);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]