| colord Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#define CD_SENSOR_ERROR #define CD_SENSOR_TYPE_ERROR enum CdSensorError; void (*_cd_sensor_reserved1) (void); void (*_cd_sensor_reserved2) (void); void (*_cd_sensor_reserved3) (void); void (*_cd_sensor_reserved4) (void); void (*_cd_sensor_reserved5) (void); void (*_cd_sensor_reserved6) (void); void (*_cd_sensor_reserved7) (void); void (*_cd_sensor_reserved8) (void); void (*button_pressed) (CdSensor *sensor); void cd_sensor_connect (CdSensor *sensor,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean cd_sensor_connect_finish (CdSensor *sensor,GAsyncResult *res,GError **error); gboolean cd_sensor_equal (CdSensor *sensor1,CdSensor *sensor2); GQuark cd_sensor_error_quark (void); guint cd_sensor_get_caps (CdSensor *sensor); gboolean cd_sensor_get_connected (CdSensor *sensor); CdSensorKind cd_sensor_get_kind (CdSensor *sensor); gboolean cd_sensor_get_locked (CdSensor *sensor); CdSensorCap cd_sensor_get_mode (CdSensor *sensor); const gchar * cd_sensor_get_model (CdSensor *sensor); gboolean cd_sensor_get_native (CdSensor *sensor); const gchar * cd_sensor_get_object_path (CdSensor *sensor); const gchar * cd_sensor_get_option (CdSensor *sensor,const gchar *key); GHashTable * cd_sensor_get_options (CdSensor *sensor); void cd_sensor_get_sample (CdSensor *sensor,CdSensorCap cap,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); CdColorXYZ * cd_sensor_get_sample_finish (CdSensor *sensor,GAsyncResult *res,GError **error); const gchar * cd_sensor_get_serial (CdSensor *sensor); CdSensorState cd_sensor_get_state (CdSensor *sensor); const gchar * cd_sensor_get_vendor (CdSensor *sensor); gboolean cd_sensor_has_cap (CdSensor *sensor,CdSensorCap cap); void cd_sensor_lock (CdSensor *sensor,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean cd_sensor_lock_finish (CdSensor *sensor,GAsyncResult *res,GError **error); CdSensor * cd_sensor_new (void); CdSensor * cd_sensor_new_with_object_path (const gchar *object_path); void cd_sensor_set_object_path (CdSensor *sensor,const gchar *object_path); void cd_sensor_set_options (CdSensor *sensor,GHashTable *values,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean cd_sensor_set_options_finish (CdSensor *sensor,GAsyncResult *res,GError **error); gchar * cd_sensor_to_string (CdSensor *sensor); void cd_sensor_unlock (CdSensor *sensor,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean cd_sensor_unlock_finish (CdSensor *sensor,GAsyncResult *res,GError **error);
A helper GObject to use for accessing colord sensors, and to be notified when it is changed.
See also: CdClient
typedef enum {
CD_SENSOR_ERROR_FAILED,
CD_SENSOR_ERROR_LAST
} CdSensorError;
Errors that can be thrown
void cd_sensor_connect (CdSensor *sensor,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Connects to the sensor.
|
a CdSensor instance |
|
a GCancellable or NULL
|
|
the function to run on completion |
|
the data to pass to callback
|
Since 0.1.8
gboolean cd_sensor_connect_finish (CdSensor *sensor,GAsyncResult *res,GError **error);
Gets the result from the asynchronous function.
|
a CdSensor instance |
|
the GAsyncResult |
|
A GError or NULL
|
Returns : |
TRUE if we could connect to to the sensor |
Since 0.1.8
gboolean cd_sensor_equal (CdSensor *sensor1,CdSensor *sensor2);
Tests two sensors for equality.
|
one CdSensor instance. |
|
another CdSensor instance. |
Returns : |
TRUE if the sensors are the same device |
Since 0.1.8
guint cd_sensor_get_caps (CdSensor *sensor);
Returns the sensor metadata.
|
a CdSensor instance. |
Returns : |
a GHashTable, free with g_hash_table_unref(). |
Since 0.1.6
gboolean cd_sensor_get_connected (CdSensor *sensor);
Gets if the sensor has been connected.
|
a CdSensor instance. |
Returns : |
TRUE if properties are valid |
Since 0.1.9
CdSensorKind cd_sensor_get_kind (CdSensor *sensor);
Gets the sensor kind.
|
a CdSensor instance. |
Returns : |
A CdSensorKind, e.g. CD_SENSOR_KIND_HUEY
|
Since 0.1.6
gboolean cd_sensor_get_locked (CdSensor *sensor);
Returns if the sensor is locked.
|
a CdSensor instance. |
Returns : |
TRUE if VCGT is valid. |
Since 0.1.6
CdSensorCap cd_sensor_get_mode (CdSensor *sensor);
Gets the sensor operating mode.
|
a CdSensor instance. |
Returns : |
A CdSensorCap, e.g. CD_SENSOR_CAP_AMBIENT
|
Since 0.1.6
const gchar * cd_sensor_get_model (CdSensor *sensor);
Gets the sensor model.
|
a CdSensor instance. |
Returns : |
A string, or NULL for invalid |
Since 0.1.6
gboolean cd_sensor_get_native (CdSensor *sensor);
Returns if the sensor has a native driver.
|
a CdSensor instance. |
Returns : |
TRUE if VCGT is valid. |
Since 0.1.6
const gchar * cd_sensor_get_object_path (CdSensor *sensor);
Gets the object path for the sensor.
|
a CdSensor instance. |
Returns : |
the object path, or NULL
|
Since 0.1.6
const gchar * cd_sensor_get_option (CdSensor *sensor,const gchar *key);
Gets a specific sensor option.
|
a CdSensor instance. |
|
a key to search for. |
Returns : |
A const string, or NULL of not found. |
Since 0.1.20
GHashTable * cd_sensor_get_options (CdSensor *sensor);
Gets any sensor options.
|
a CdSensor instance. |
Returns : |
A refcounted GHashTable of (string, GVariant). [transfer full] |
Since 0.1.20
void cd_sensor_get_sample (CdSensor *sensor,CdSensorCap cap,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Gets a color sample from a sensor
|
a CdSensor instance. |
|
a CdSensorCap |
|
a GCancellable, or NULL
|
|
the function to run on completion |
|
the data to pass to callback
|
Since 0.1.8
CdColorXYZ * cd_sensor_get_sample_finish (CdSensor *sensor,GAsyncResult *res,GError **error);
Gets the result from the asynchronous function.
|
a CdSensor instance. |
|
the GAsyncResult |
|
A GError or NULL
|
Returns : |
the XYZ reading, or NULL
|
Since 0.1.8
const gchar * cd_sensor_get_serial (CdSensor *sensor);
Gets the sensor serial number.
|
a CdSensor instance. |
Returns : |
A string, or NULL for invalid |
Since 0.1.6
CdSensorState cd_sensor_get_state (CdSensor *sensor);
Gets the sensor state.
|
a CdSensor instance. |
Returns : |
A CdSensorState, e.g. CD_SENSOR_STATE_IDLE
|
Since 0.1.6
const gchar * cd_sensor_get_vendor (CdSensor *sensor);
Gets the sensor vendor.
|
a CdSensor instance. |
Returns : |
A string, or NULL for invalid |
Since 0.1.6
void cd_sensor_lock (CdSensor *sensor,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Locks the device so we can use it.
|
a CdSensor instance. |
|
a GCancellable, or NULL
|
|
the function to run on completion |
|
the data to pass to callback
|
Since 0.1.8
gboolean cd_sensor_lock_finish (CdSensor *sensor,GAsyncResult *res,GError **error);
Gets the result from the asynchronous function.
|
a CdSensor instance. |
|
the GAsyncResult |
|
A GError or NULL
|
Returns : |
success |
Since 0.1.8
CdSensor * cd_sensor_new (void);
Creates a new CdSensor object.
Returns : |
a new CdSensor object. |
Since 0.1.6
CdSensor * cd_sensor_new_with_object_path (const gchar *object_path);
Creates a new CdSensor object with a known object path.
|
The colord object path. |
Returns : |
a new sensor object. |
Since 0.1.8
void cd_sensor_set_object_path (CdSensor *sensor,const gchar *object_path);
Sets the object path of the sensor.
|
a CdSensor instance. |
|
The colord object path. |
Since 0.1.8
void cd_sensor_set_options (CdSensor *sensor,GHashTable *values,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Sets options on the sensor device.
|
a CdSensor instance. |
|
a GCancellable, or NULL
|
|
the function to run on completion |
|
the data to pass to callback
|
Since 0.1.20
gboolean cd_sensor_set_options_finish (CdSensor *sensor,GAsyncResult *res,GError **error);
Gets the result from the asynchronous function.
|
a CdSensor instance. |
|
the GAsyncResult |
|
A GError or NULL
|
Returns : |
success |
Since 0.1.20
void cd_sensor_unlock (CdSensor *sensor,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Unlocks the sensor for use by other programs.
|
a CdSensor instance. |
|
a GCancellable, or NULL
|
|
the function to run on completion |
|
the data to pass to callback
|
Since 0.1.8
gboolean cd_sensor_unlock_finish (CdSensor *sensor,GAsyncResult *res,GError **error);
Gets the result from the asynchronous function.
|
a CdSensor instance. |
|
the GAsyncResult |
|
A GError or NULL
|
Returns : |
success |
Since 0.1.8