![]() |
![]() |
![]() |
GNOME Color Manager Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
struct GcmSensor; struct GcmSensorClass; enum GcmSensorError; enum GcmSensorOutputType; enum GcmSensorKind; enum GcmSensorState; #define GCM_SENSOR_ERROR GcmSensor * gcm_sensor_new (void
); void gcm_sensor_button_pressed (GcmSensor *sensor
); void gcm_sensor_set_state (GcmSensor *sensor
,GcmSensorState state
); GcmSensorState gcm_sensor_get_state (GcmSensor *sensor
); gboolean gcm_sensor_dump (GcmSensor *sensor
,GString *data
,GError **error
); gboolean gcm_sensor_set_leds (GcmSensor *sensor
,guint8 value
,GError **error
); gboolean gcm_sensor_set_from_device (GcmSensor *sensor
,GUdevDevice *device
,GError **error
); void gcm_sensor_set_output_type (GcmSensor *sensor
,GcmSensorOutputType output_type
); GcmSensorOutputType gcm_sensor_get_output_type (GcmSensor *sensor
); void gcm_sensor_set_serial_number (GcmSensor *sensor
,const gchar *serial_number
); const gchar * gcm_sensor_get_serial_number (GcmSensor *sensor
); const gchar * gcm_sensor_get_model (GcmSensor *sensor
); const gchar * gcm_sensor_get_vendor (GcmSensor *sensor
); GcmSensorKind gcm_sensor_get_kind (GcmSensor *sensor
); gboolean gcm_sensor_supports_display (GcmSensor *sensor
); gboolean gcm_sensor_supports_projector (GcmSensor *sensor
); gboolean gcm_sensor_supports_printer (GcmSensor *sensor
); gboolean gcm_sensor_supports_spot (GcmSensor *sensor
); gboolean gcm_sensor_is_native (GcmSensor *sensor
); const gchar * gcm_sensor_kind_to_string (GcmSensorKind sensor_kind
); GcmSensorKind gcm_sensor_kind_from_string (const gchar *sensor_kind
); const gchar * gcm_sensor_get_image_display (GcmSensor *sensor
); const gchar * gcm_sensor_get_image_calibrate (GcmSensor *sensor
); const gchar * gcm_sensor_get_image_spotread (GcmSensor *sensor
); void gcm_sensor_get_ambient_async (GcmSensor *sensor
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gcm_sensor_get_ambient_finish (GcmSensor *sensor
,GAsyncResult *res
,gdouble *value
,GError **error
); void gcm_sensor_sample_async (GcmSensor *sensor
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gcm_sensor_sample_finish (GcmSensor *sensor
,GAsyncResult *res
,GcmColorXYZ *value
,GError **error
); gboolean gcm_sensor_get_ambient (GcmSensor *sensor
,GCancellable *cancellable
,gdouble *value
,GError **error
); gboolean gcm_sensor_sample (GcmSensor *sensor
,GCancellable *cancellable
,GcmColorXYZ *value
,GError **error
); GcmSensorPrivate;
GObject +----GcmSensor +----GcmSensorColormunki +----GcmSensorDummy +----GcmSensorHuey
"device" gchar* : Read "image-calibrate" gchar* : Read / Write / Construct "image-display" gchar* : Read / Write / Construct "image-spotread" gchar* : Read / Write / Construct "kind" guint : Read / Write / Construct "model" gchar* : Read "native" gboolean : Read / Write / Construct "serial-number" gchar* : Read / Write "state" guint : Read / Write / Construct "supports-display" gboolean : Read "supports-printer" gboolean : Read "supports-projector" gboolean : Read "supports-spot" gboolean : Read "vendor" gchar* : Read
struct GcmSensorClass { GObjectClass parent_class; /* vtable */ void (*get_ambient_async) (GcmSensor *sensor, GCancellable *cancellable, GAsyncResult *res); gboolean (*get_ambient_finish) (GcmSensor *sensor, GAsyncResult *res, gdouble *value, GError **error); void (*sample_async) (GcmSensor *sensor, GCancellable *cancellable, GAsyncResult *res); gboolean (*sample_finish) (GcmSensor *sensor, GAsyncResult *res, GcmColorXYZ *value, GError **error); gboolean (*set_leds) (GcmSensor *sensor, guint8 value, GError **error); gboolean (*dump) (GcmSensor *sensor, GString *data, GError **error); /* signals */ void (* button_pressed) (void); /* padding for future expansion */ void (*_gcm_reserved1) (void); void (*_gcm_reserved2) (void); void (*_gcm_reserved3) (void); void (*_gcm_reserved4) (void); void (*_gcm_reserved5) (void); };
typedef enum { GCM_SENSOR_ERROR_USER_ABORT, GCM_SENSOR_ERROR_NO_SUPPORT, GCM_SENSOR_ERROR_NO_DATA, GCM_SENSOR_ERROR_INTERNAL } GcmSensorError;
The error code.
typedef enum { GCM_SENSOR_OUTPUT_TYPE_UNKNOWN, GCM_SENSOR_OUTPUT_TYPE_LCD, GCM_SENSOR_OUTPUT_TYPE_CRT, GCM_SENSOR_OUTPUT_TYPE_PROJECTOR } GcmSensorOutputType;
The output type.
typedef enum { GCM_SENSOR_KIND_HUEY, GCM_SENSOR_KIND_COLOR_MUNKI, GCM_SENSOR_KIND_SPYDER, GCM_SENSOR_KIND_DTP20, GCM_SENSOR_KIND_DTP22, GCM_SENSOR_KIND_DTP41, GCM_SENSOR_KIND_DTP51, GCM_SENSOR_KIND_DTP94, GCM_SENSOR_KIND_SPECTRO_SCAN, GCM_SENSOR_KIND_I1_PRO, GCM_SENSOR_KIND_COLORIMTRE_HCFR, GCM_SENSOR_KIND_UNKNOWN } GcmSensorKind;
The sensor type.
typedef enum { GCM_SENSOR_STATE_STARTING, GCM_SENSOR_STATE_IDLE, GCM_SENSOR_STATE_MEASURING } GcmSensorState;
The state of the sensor.
void gcm_sensor_button_pressed (GcmSensor *sensor
);
Causes the ::button-pressed signal to be fired.
Since 2.91.1
void gcm_sensor_set_state (GcmSensor *sensor
,GcmSensorState state
);
Sets the device state.
|
a valid GcmSensor instance |
|
the sensor state, e.g GCM_SENSOR_STATE_IDLE
|
Since 2.91.1
GcmSensorState gcm_sensor_get_state (GcmSensor *sensor
);
Gets if the sensor is state taking a measurement.
|
a valid GcmSensor instance |
Returns : |
TRUE for state. |
Since 2.91.1
gboolean gcm_sensor_dump (GcmSensor *sensor
,GString *data
,GError **error
);
Dumps the unstructured device data to a string.
|
a valid GcmSensor instance |
|
A valid GString for the returned data |
|
a GError or NULL
|
Returns : |
TRUE for success. |
Since 2.91.1
gboolean gcm_sensor_set_leds (GcmSensor *sensor
,guint8 value
,GError **error
);
Sets the LED output state for the device.
|
a valid GcmSensor instance |
|
The LED bitmask |
|
a GError or NULL
|
Returns : |
TRUE for success. |
Since 2.91.1
gboolean gcm_sensor_set_from_device (GcmSensor *sensor
,GUdevDevice *device
,GError **error
);
Set up some details about the sensor from the raw device. We aim to get as much as possible from UDEV.
|
a valid GcmSensor instance |
|
a GUdevDevice |
|
a GError or NULL
|
Returns : |
TRUE for success. |
Since 2.91.1
void gcm_sensor_set_output_type (GcmSensor *sensor
,GcmSensorOutputType output_type
);
Set the output type. Different sensors may do different things depending on the output type.
|
a valid GcmSensor instance |
|
the output type, e.g. GCM_SENSOR_OUTPUT_TYPE_LCD
|
Since 2.91.1
GcmSensorOutputType gcm_sensor_get_output_type (GcmSensor *sensor
);
Returns the set output type. Different sensors may do different things depending on the output type.
|
a valid GcmSensor instance |
Returns : |
the output type, e.g. GCM_SENSOR_OUTPUT_TYPE_LCD
|
Since 2.91.1
void gcm_sensor_set_serial_number (GcmSensor *sensor
,const gchar *serial_number
);
Sets the sensor serial number which can be used to uniquely identify the device.
|
a valid GcmSensor instance |
|
the serial number |
Since 2.91.1
const gchar * gcm_sensor_get_serial_number (GcmSensor *sensor
);
Gets the sensor serial number.
|
a valid GcmSensor instance |
Returns : |
a string. |
Since 2.91.1
const gchar * gcm_sensor_get_model (GcmSensor *sensor
);
Gets the sensor model.
|
a valid GcmSensor instance |
Returns : |
a string. |
Since 2.91.1
const gchar * gcm_sensor_get_vendor (GcmSensor *sensor
);
Gets the sensor vendor.
|
a valid GcmSensor instance |
Returns : |
a string. |
Since 2.91.1
GcmSensorKind gcm_sensor_get_kind (GcmSensor *sensor
);
Returns the sensor kind.
|
a valid GcmSensor instance |
Returns : |
the sensor kind, e.g. GCM_SENSOR_KIND_HUEY
|
Since 2.91.1
gboolean gcm_sensor_supports_display (GcmSensor *sensor
);
Returns if the sensor supports profiling a display.
|
a valid GcmSensor instance |
Returns : |
TRUE or FALSE . |
Since 2.91.1
gboolean gcm_sensor_supports_projector (GcmSensor *sensor
);
Returns if the sensor supports profiling a projector.
|
a valid GcmSensor instance |
Returns : |
TRUE or FALSE . |
Since 2.91.1
gboolean gcm_sensor_supports_printer (GcmSensor *sensor
);
Returns if the sensor supports profiling a printer.
|
a valid GcmSensor instance |
Returns : |
TRUE or FALSE . |
Since 2.91.1
gboolean gcm_sensor_supports_spot (GcmSensor *sensor
);
Returns if the sensor supports getting a spot color.
|
a valid GcmSensor instance |
Returns : |
TRUE or FALSE . |
Since 2.91.1
gboolean gcm_sensor_is_native (GcmSensor *sensor
);
Sensor support can be built in, for instance the HUEY, or rely on external frameworks such as argyllcms. Native sensor support is done internally without calling out to other frameworks.
|
a valid GcmSensor instance |
Returns : |
TRUE for internal, native, support. |
Since 2.91.1
const gchar * gcm_sensor_kind_to_string (GcmSensorKind sensor_kind
);
Gets the sensor kind as a string.
|
a GcmSensorKind |
Returns : |
the sensor kind, e.g. 'huey'. |
Since 2.91.1
GcmSensorKind gcm_sensor_kind_from_string (const gchar *sensor_kind
);
Gets the sensor kind as a enumerated value.
|
the sensor kind, e.g. 'huey'. |
Returns : |
a GcmSensorKind |
Since 2.91.1
const gchar * gcm_sensor_get_image_display (GcmSensor *sensor
);
Since 2.91.1
const gchar * gcm_sensor_get_image_calibrate (GcmSensor *sensor
);
Since 2.91.1
const gchar * gcm_sensor_get_image_spotread (GcmSensor *sensor
);
Since 2.91.1
void gcm_sensor_get_ambient_async (GcmSensor *sensor
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asks the hardware to get the ambient light value.
|
a valid GcmSensor instance |
|
a GCancellable or NULL
|
|
the function to run on completion |
|
the data to pass to callback
|
Since 2.91.1
gboolean gcm_sensor_get_ambient_finish (GcmSensor *sensor
,GAsyncResult *res
,gdouble *value
,GError **error
);
Gets the result from the asynchronous function.
|
a valid GcmSensor instance |
|
the GAsyncResult |
|
the brightness in Lux, return value. |
|
A GError or NULL
|
Returns : |
FALSE for an error |
Since 2.91.1
void gcm_sensor_sample_async (GcmSensor *sensor
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Sample the color and store as a XYZ value.
|
a valid GcmSensor instance |
|
a GCancellable or NULL
|
|
the function to run on completion |
|
the data to pass to callback
|
Since 2.91.1
gboolean gcm_sensor_sample_finish (GcmSensor *sensor
,GAsyncResult *res
,GcmColorXYZ *value
,GError **error
);
Gets the result from the asynchronous function.
|
a valid GcmSensor instance |
|
the GAsyncResult |
|
the brightness in Lux, return value. |
|
A GError or NULL
|
Returns : |
FALSE for an error |
Since 2.91.1
gboolean gcm_sensor_get_ambient (GcmSensor *sensor
,GCancellable *cancellable
,gdouble *value
,GError **error
);
Gets the ambient light reading. Warning: this function is synchronous, and may block. Do not use it in GUI applications.
|
a valid GcmSensor instance |
|
a GCancellable or NULL
|
|
the sensor brightness in Lux. |
|
A GError or NULL
|
Returns : |
TRUE if the ambient value was obtained. |
Since 2.91.1
gboolean gcm_sensor_sample (GcmSensor *sensor
,GCancellable *cancellable
,GcmColorXYZ *value
,GError **error
);
Sample the color and store as a XYZ value. Warning: this function is synchronous, and may block. Do not use it in GUI applications.
|
a valid GcmSensor instance |
|
a GCancellable or NULL
|
|
the sensor brightness in Lux. |
|
A GError or NULL
|
Returns : |
TRUE if the ambient value was obtained. |
Since 2.91.1
"image-calibrate"
property "image-calibrate" gchar* : Read / Write / Construct
Default value: NULL
"image-spotread"
property "image-spotread" gchar* : Read / Write / Construct
Default value: NULL
"button-pressed"
signalvoid user_function (GcmSensor *arg0,
gpointer user_data) : Run Last
|
user data set when the signal handler was connected. |
Since 2.91.1