diff options
author | Richard Hughes <richard@hughsie.com> | 2017-08-02 20:11:46 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-08-02 20:11:46 +0100 |
commit | 770039b300bc9f8f9ce377e90cb9c60a616a28a4 (patch) | |
tree | 24ba47c4c734964ed6dfa9b524db96387219bfdb | |
parent | 4367e4dbc4238cc8ff3693a1e8dfbc8542c645c7 (diff) | |
download | colord-770039b300bc9f8f9ce377e90cb9c60a616a28a4.tar.gz |
huey: Make the sensor less exported, i.e. remove useless GtkDoc markup
-rw-r--r-- | src/sensors/huey/huey-ctx.c | 95 | ||||
-rw-r--r-- | src/sensors/huey/huey-ctx.h | 17 | ||||
-rw-r--r-- | src/sensors/huey/huey-device.c | 94 | ||||
-rw-r--r-- | src/sensors/huey/huey-device.h | 10 | ||||
-rw-r--r-- | src/sensors/huey/huey-enum.c | 20 |
5 files changed, 12 insertions, 224 deletions
diff --git a/src/sensors/huey/huey-ctx.c b/src/sensors/huey/huey-ctx.c index 42feb41..fa9052e 100644 --- a/src/sensors/huey/huey-ctx.c +++ b/src/sensors/huey/huey-ctx.c @@ -51,11 +51,6 @@ static void huey_ctx_finalize (GObject *object); * indicates we doing something wrong. */ #define HUEY_XYZ_POST_MULTIPLY_FACTOR 3.428 -/** - * HueyCtxPrivate: - * - * Private #HueyCtx data - **/ typedef struct { CdMat3x3 calibration_crt; @@ -74,29 +69,6 @@ enum { G_DEFINE_TYPE_WITH_PRIVATE (HueyCtx, huey_ctx, G_TYPE_OBJECT) -/** - * huey_ctx_error_quark: - * - * Return value: An error quark. - * - * Since: 0.1.0 - **/ -GQuark -huey_ctx_error_quark (void) -{ - static GQuark quark = 0; - if (!quark) { - quark = g_quark_from_static_string ("huey_ctx_error"); - } - return quark; -} - - -/** - * huey_ctx_get_device: - * - * Since: 0.1.29 - **/ GUsbDevice * huey_ctx_get_device (HueyCtx *ctx) { @@ -105,11 +77,6 @@ huey_ctx_get_device (HueyCtx *ctx) return priv->device; } -/** - * huey_ctx_set_device: - * - * Since: 0.1.29 - **/ void huey_ctx_set_device (HueyCtx *ctx, GUsbDevice *device) { @@ -118,11 +85,6 @@ huey_ctx_set_device (HueyCtx *ctx, GUsbDevice *device) priv->device = g_object_ref (device); } -/** - * huey_ctx_setup: - * - * Since: 0.1.29 - **/ gboolean huey_ctx_setup (HueyCtx *ctx, GError **error) { @@ -172,11 +134,6 @@ huey_ctx_setup (HueyCtx *ctx, GError **error) return TRUE; } -/** - * huey_ctx_get_calibration_lcd: - * - * Since: 0.1.29 - **/ const CdMat3x3 * huey_ctx_get_calibration_lcd (HueyCtx *ctx) { @@ -185,11 +142,6 @@ huey_ctx_get_calibration_lcd (HueyCtx *ctx) return &priv->calibration_lcd; } -/** - * huey_ctx_get_calibration_crt: - * - * Since: 0.1.29 - **/ const CdMat3x3 * huey_ctx_get_calibration_crt (HueyCtx *ctx) { @@ -198,11 +150,6 @@ huey_ctx_get_calibration_crt (HueyCtx *ctx) return &priv->calibration_crt; } -/** - * huey_ctx_get_calibration_value: - * - * Since: 0.1.29 - **/ gfloat huey_ctx_get_calibration_value (HueyCtx *ctx) { @@ -211,11 +158,6 @@ huey_ctx_get_calibration_value (HueyCtx *ctx) return priv->calibration_value; } -/** - * huey_ctx_get_dark_offset: - * - * Since: 0.1.29 - **/ const CdVec3 * huey_ctx_get_dark_offset (HueyCtx *ctx) { @@ -224,11 +166,6 @@ huey_ctx_get_dark_offset (HueyCtx *ctx) return &priv->dark_offset; } -/** - * huey_ctx_get_unlock_string: - * - * Since: 0.1.29 - **/ const gchar * huey_ctx_get_unlock_string (HueyCtx *ctx) { @@ -334,11 +271,6 @@ huey_ctx_convert_device_RGB_to_XYZ (CdColorRGB *src, } -/** - * huey_ctx_take_sample: - * - * Since: 0.1.29 - **/ CdColorXYZ * huey_ctx_take_sample (HueyCtx *ctx, CdSensorCap cap, GError **error) { @@ -357,8 +289,8 @@ huey_ctx_take_sample (HueyCtx *ctx, CdSensorCap cap, GError **error) /* no hardware support */ if (cap == CD_SENSOR_CAP_PROJECTOR) { g_set_error_literal (error, - HUEY_CTX_ERROR, - HUEY_CTX_ERROR_NO_SUPPORT, + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, "Huey cannot measure in projector mode"); return NULL; } @@ -484,9 +416,6 @@ huey_ctx_set_property (GObject *object, guint prop_id, const GValue *value, GPar } } -/* - * huey_ctx_class_init: - */ static void huey_ctx_class_init (HueyCtxClass *klass) { @@ -496,11 +425,6 @@ huey_ctx_class_init (HueyCtxClass *klass) object_class->set_property = huey_ctx_set_property; object_class->finalize = huey_ctx_finalize; - /** - * HueyCtx:device: - * - * Since: 0.1.29 - **/ g_object_class_install_property (object_class, PROP_DEVICE, g_param_spec_object ("device", @@ -509,9 +433,6 @@ huey_ctx_class_init (HueyCtxClass *klass) G_PARAM_READWRITE)); } -/* - * huey_ctx_init: - */ static void huey_ctx_init (HueyCtx *ctx) { @@ -519,9 +440,6 @@ huey_ctx_init (HueyCtx *ctx) cd_mat33_clear (&priv->calibration_lcd); cd_mat33_clear (&priv->calibration_crt); - - /* ensure the remote errors are registered */ - huey_ctx_error_quark (); } static void @@ -537,15 +455,6 @@ huey_ctx_finalize (GObject *object) G_OBJECT_CLASS (huey_ctx_parent_class)->finalize (object); } -/** - * huey_ctx_new: - * - * Creates a new #HueyCtx object. - * - * Return value: a new HueyCtx object. - * - * Since: 0.1.29 - **/ HueyCtx * huey_ctx_new (void) { diff --git a/src/sensors/huey/huey-ctx.h b/src/sensors/huey/huey-ctx.h index cf32e4d..0b84d85 100644 --- a/src/sensors/huey/huey-ctx.h +++ b/src/sensors/huey/huey-ctx.h @@ -29,9 +29,6 @@ G_BEGIN_DECLS -#define HUEY_CTX_ERROR (huey_ctx_error_quark ()) -#define HUEY_CTX_TYPE_ERROR (huey_ctx_error_get_type ()) - #define HUEY_TYPE_CTX (huey_ctx_get_type ()) G_DECLARE_DERIVABLE_TYPE (HueyCtx, huey_ctx, HUEY, CTX, GObject) @@ -50,20 +47,6 @@ struct _HueyCtxClass void (*_huey_ctx_reserved8) (void); }; -/** - * HueyCtxError: - * @HUEY_CTX_ERROR_FAILED: the request failed for an unknown reason - * - * Errors that can be thrown - */ -typedef enum -{ - HUEY_CTX_ERROR_FAILED, - HUEY_CTX_ERROR_NO_SUPPORT, - HUEY_CTX_ERROR_LAST -} HueyCtxError; - -GQuark huey_ctx_error_quark (void); HueyCtx *huey_ctx_new (void); CdColorXYZ *huey_ctx_take_sample (HueyCtx *ctx, diff --git a/src/sensors/huey/huey-device.c b/src/sensors/huey/huey-device.c index 3c72375..d485d95 100644 --- a/src/sensors/huey/huey-device.c +++ b/src/sensors/huey/huey-device.c @@ -33,23 +33,6 @@ /* fudge factor to convert the value of HUEY_CMD_GET_AMBIENT to Lux */ #define HUEY_AMBIENT_UNITS_TO_LUX 125.0f -/** - * huey_device_error_quark: - **/ -GQuark -huey_device_error_quark (void) -{ - static GQuark quark = 0; - if (!quark) - quark = g_quark_from_static_string ("HueyError"); - return quark; -} - -/** - * huey_device_send_data: - * - * Since: 0.1.29 - **/ gboolean huey_device_send_data (GUsbDevice *device, const guint8 *request, @@ -109,8 +92,8 @@ huey_device_send_data (GUsbDevice *device, reply, *reply_read); if (reply[1] != request[0]) { g_set_error (error, - HUEY_DEVICE_ERROR, - HUEY_DEVICE_ERROR_INTERNAL, + G_IO_ERROR, + G_IO_ERROR_FAILED, "wrong command reply, got 0x%02x, " "expected 0x%02x", reply[1], @@ -125,8 +108,8 @@ huey_device_send_data (GUsbDevice *device, /* failure, the return buffer is set to "Locked" */ if (reply[0] == HUEY_RC_LOCKED) { g_set_error_literal (error, - HUEY_DEVICE_ERROR, - HUEY_DEVICE_ERROR_INTERNAL, + G_IO_ERROR, + G_IO_ERROR_NOT_INITIALIZED, "the device is locked"); return FALSE; } @@ -134,8 +117,8 @@ huey_device_send_data (GUsbDevice *device, /* failure, the return buffer is set to "NoCmd" */ if (reply[0] == HUEY_RC_ERROR) { g_set_error (error, - HUEY_DEVICE_ERROR, - HUEY_DEVICE_ERROR_INTERNAL, + G_IO_ERROR, + G_IO_ERROR_FAILED, "failed to issue command: %s", &reply[2]); return FALSE; } @@ -143,8 +126,8 @@ huey_device_send_data (GUsbDevice *device, /* we ignore retry */ if (reply[0] != HUEY_RC_RETRY) { g_set_error (error, - HUEY_DEVICE_ERROR, - HUEY_DEVICE_ERROR_INTERNAL, + G_IO_ERROR, + G_IO_ERROR_FAILED, "return value unknown: 0x%02x", reply[0]); return FALSE; } @@ -152,18 +135,13 @@ huey_device_send_data (GUsbDevice *device, /* no success */ g_set_error (error, - HUEY_DEVICE_ERROR, - HUEY_DEVICE_ERROR_INTERNAL, + G_IO_ERROR, + G_IO_ERROR_FAILED, "gave up retrying after %i reads", HUEY_MAX_READ_RETRIES); return FALSE; } -/** - * huey_device_unlock: - * - * Since: 0.1.29 - **/ gboolean huey_device_unlock (GUsbDevice *device, GError **error) { @@ -209,11 +187,6 @@ huey_device_unlock (GUsbDevice *device, GError **error) return TRUE; } -/** - * huey_device_get_serial_number: - * - * Since: 0.1.29 - **/ gchar * huey_device_get_serial_number (GUsbDevice *device, GError **error) { @@ -232,11 +205,6 @@ huey_device_get_serial_number (GUsbDevice *device, GError **error) return g_strdup_printf ("%" G_GUINT32_FORMAT, tmp); } -/** - * huey_device_get_unlock_string: - * - * Since: 0.1.29 - **/ gchar * huey_device_get_unlock_string (GUsbDevice *device, GError **error) { @@ -256,11 +224,6 @@ huey_device_get_unlock_string (GUsbDevice *device, GError **error) return g_strndup (tmp, sizeof (tmp)); } -/** - * huey_device_set_leds: - * - * Since: 0.1.29 - **/ gboolean huey_device_set_leds (GUsbDevice *device, guint8 value, GError **error) { @@ -284,13 +247,6 @@ huey_device_set_leds (GUsbDevice *device, guint8 value, GError **error) error); } -/** - * huey_device_read_register_byte: - * - * Return value: -1 for error. - * - * Since: 0.1.29 - **/ gdouble huey_device_get_ambient (GUsbDevice *device, GError **error) { @@ -323,11 +279,6 @@ huey_device_get_ambient (GUsbDevice *device, GError **error) return (gdouble) cd_buffer_read_uint16_be (reply+5) / HUEY_AMBIENT_UNITS_TO_LUX; } -/** - * huey_device_read_register_byte: - * - * Since: 0.1.29 - **/ gboolean huey_device_read_register_byte (GUsbDevice *device, guint8 addr, @@ -362,11 +313,6 @@ huey_device_read_register_byte (GUsbDevice *device, return TRUE; } -/** - * huey_device_read_register_string: - * - * Since: 0.1.29 - **/ gboolean huey_device_read_register_string (GUsbDevice *device, guint8 addr, @@ -392,11 +338,6 @@ huey_device_read_register_string (GUsbDevice *device, return TRUE; } -/** - * huey_device_read_register_word: - * - * Since: 0.1.29 - **/ gboolean huey_device_read_register_word (GUsbDevice *device, guint8 addr, @@ -425,11 +366,6 @@ huey_device_read_register_word (GUsbDevice *device, return TRUE; } -/** - * huey_device_read_register_float: - * - * Since: 0.1.29 - **/ gboolean huey_device_read_register_float (GUsbDevice *device, guint8 addr, @@ -455,11 +391,6 @@ huey_device_read_register_float (GUsbDevice *device, return TRUE; } -/** - * huey_device_read_register_vector: - * - * Since: 0.1.29 - **/ gboolean huey_device_read_register_vector (GUsbDevice *device, guint8 addr, @@ -492,11 +423,6 @@ huey_device_read_register_vector (GUsbDevice *device, return TRUE; } -/** - * huey_device_read_register_matrix: - * - * Since: 0.1.29 - **/ gboolean huey_device_read_register_matrix (GUsbDevice *device, guint8 addr, diff --git a/src/sensors/huey/huey-device.h b/src/sensors/huey/huey-device.h index c488132..6f90d89 100644 --- a/src/sensors/huey/huey-device.h +++ b/src/sensors/huey/huey-device.h @@ -28,16 +28,6 @@ G_BEGIN_DECLS -#define HUEY_DEVICE_ERROR huey_device_error_quark() - -typedef enum { - HUEY_DEVICE_ERROR_INTERNAL, - HUEY_DEVICE_ERROR_NO_DATA, - HUEY_DEVICE_ERROR_NO_SUPPORT, - HUEY_DEVICE_ERROR_LAST -} HueyError; - -GQuark huey_device_error_quark (void); gboolean huey_device_send_data (GUsbDevice *device, const guchar *request, gsize request_len, diff --git a/src/sensors/huey/huey-enum.c b/src/sensors/huey/huey-enum.c index 385aaa9..e57397e 100644 --- a/src/sensors/huey/huey-enum.c +++ b/src/sensors/huey/huey-enum.c @@ -19,27 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/** - * SECTION:huey-enum - * @short_description: Types used by huey and libhuey - * - * These helper functions provide a way to marshal enumerated values to - * text and back again. - * - * See also: #CdClient, #CdDevice - */ - #include "config.h" #include <glib.h> #include "huey-enum.h" -/** - * huey_rc_to_string: - * - * Since: 0.1.29 - **/ const gchar * huey_rc_to_string (guchar value) { @@ -58,11 +43,6 @@ huey_rc_to_string (guchar value) return NULL; } -/** - * huey_cmd_code_to_string: - * - * Since: 0.1.29 - **/ const gchar * huey_cmd_code_to_string (guchar value) { |