cd-client

cd-client — Main client object for accessing the colord daemon

Synopsis

#define             CD_CLIENT_ERROR
#define             CD_CLIENT_TYPE_ERROR
void                (*device_added)                     (CdClient *client,
                                                         CdDevice *device);
void                (*device_removed)                   (CdClient *client,
                                                         CdDevice *device);
void                (*device_changed)                   (CdClient *client,
                                                         CdDevice *device);
void                (*profile_added)                    (CdClient *client,
                                                         CdProfile *profile);
void                (*profile_removed)                  (CdClient *client,
                                                         CdProfile *profile);
void                (*profile_changed)                  (CdClient *client,
                                                         CdProfile *profile);
void                (*sensor_added)                     (CdClient *client,
                                                         CdSensor *sensor);
void                (*sensor_removed)                   (CdClient *client,
                                                         CdSensor *sensor);
void                (*sensor_changed)                   (CdClient *client,
                                                         CdSensor *sensor);
void                (*changed)                          (CdProfile *profile);
void                (*_cd_client_reserved1)             (void);
void                (*_cd_client_reserved2)             (void);
void                (*_cd_client_reserved3)             (void);
void                (*_cd_client_reserved4)             (void);
void                (*_cd_client_reserved5)             (void);
void                (*_cd_client_reserved6)             (void);
void                (*_cd_client_reserved7)             (void);
void                (*_cd_client_reserved8)             (void);
enum                CdClientError;
GQuark              cd_client_error_quark               (void);
CdClient *          cd_client_new                       (void);
CdDevice *          cd_client_create_device_sync        (CdClient *client,
                                                         const gchar *id,
                                                         CdObjectScope scope,
                                                         GHashTable *properties,
                                                         GCancellable *cancellable,
                                                         GError **error);
CdProfile *         cd_client_create_profile_sync       (CdClient *client,
                                                         const gchar *id,
                                                         CdObjectScope scope,
                                                         GHashTable *properties,
                                                         GCancellable *cancellable,
                                                         GError **error);
gboolean            cd_client_delete_device_sync        (CdClient *client,
                                                         const gchar *id,
                                                         GCancellable *cancellable,
                                                         GError **error);
gboolean            cd_client_delete_profile_sync       (CdClient *client,
                                                         const gchar *id,
                                                         GCancellable *cancellable,
                                                         GError **error);
CdDevice *          cd_client_find_device_sync          (CdClient *client,
                                                         const gchar *id,
                                                         GCancellable *cancellable,
                                                         GError **error);
CdProfile *         cd_client_find_profile_sync         (CdClient *client,
                                                         const gchar *id,
                                                         GCancellable *cancellable,
                                                         GError **error);
CdProfile *         cd_client_find_profile_by_filename_sync
                                                        (CdClient *client,
                                                         const gchar *filename,
                                                         GCancellable *cancellable,
                                                         GError **error);
GPtrArray *         cd_client_get_devices_sync          (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GError **error);
void                cd_client_get_devices               (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
GPtrArray *         cd_client_get_devices_finish        (CdClient *client,
                                                         GAsyncResult *res,
                                                         GError **error);
GPtrArray *         cd_client_get_profiles_sync         (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GError **error);
void                cd_client_get_profiles              (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
GPtrArray *         cd_client_get_profiles_finish       (CdClient *client,
                                                         GAsyncResult *res,
                                                         GError **error);
GPtrArray *         cd_client_get_sensors_sync          (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GError **error);
void                cd_client_get_sensors               (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
GPtrArray *         cd_client_get_sensors_finish        (CdClient *client,
                                                         GAsyncResult *res,
                                                         GError **error);
GPtrArray *         cd_client_get_devices_by_kind_sync  (CdClient *client,
                                                         CdDeviceKind kind,
                                                         GCancellable *cancellable,
                                                         GError **error);
void                cd_client_connect                   (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            cd_client_connect_finish            (CdClient *client,
                                                         GAsyncResult *res,
                                                         GError **error);
gboolean            cd_client_connect_sync              (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GError **error);
const gchar *       cd_client_get_daemon_version        (CdClient *client);
                    CdClientPrivate;

Description

A helper GObject to use for accessing colord information, and to be notified when it is changed.

See also: CdDevice

Details

CD_CLIENT_ERROR

#define CD_CLIENT_ERROR		(cd_client_error_quark ())


CD_CLIENT_TYPE_ERROR

#define CD_CLIENT_TYPE_ERROR (cd_client_error_get_type ())


device_added ()

void                (*device_added)                     (CdClient *client,
                                                         CdDevice *device);


device_removed ()

void                (*device_removed)                   (CdClient *client,
                                                         CdDevice *device);


device_changed ()

void                (*device_changed)                   (CdClient *client,
                                                         CdDevice *device);


profile_added ()

void                (*profile_added)                    (CdClient *client,
                                                         CdProfile *profile);


profile_removed ()

void                (*profile_removed)                  (CdClient *client,
                                                         CdProfile *profile);


profile_changed ()

void                (*profile_changed)                  (CdClient *client,
                                                         CdProfile *profile);


sensor_added ()

void                (*sensor_added)                     (CdClient *client,
                                                         CdSensor *sensor);


sensor_removed ()

void                (*sensor_removed)                   (CdClient *client,
                                                         CdSensor *sensor);


sensor_changed ()

void                (*sensor_changed)                   (CdClient *client,
                                                         CdSensor *sensor);


changed ()

void                (*changed)                          (CdProfile *profile);


_cd_client_reserved1 ()

void                (*_cd_client_reserved1)             (void);


_cd_client_reserved2 ()

void                (*_cd_client_reserved2)             (void);


_cd_client_reserved3 ()

void                (*_cd_client_reserved3)             (void);


_cd_client_reserved4 ()

void                (*_cd_client_reserved4)             (void);


_cd_client_reserved5 ()

void                (*_cd_client_reserved5)             (void);


_cd_client_reserved6 ()

void                (*_cd_client_reserved6)             (void);


_cd_client_reserved7 ()

void                (*_cd_client_reserved7)             (void);


_cd_client_reserved8 ()

void                (*_cd_client_reserved8)             (void);


enum CdClientError

typedef enum
{
	CD_CLIENT_ERROR_FAILED,
	CD_CLIENT_ERROR_LAST
} CdClientError;

Errors that can be thrown

CD_CLIENT_ERROR_FAILED

the transaction failed for an unknown reason

CD_CLIENT_ERROR_LAST


cd_client_error_quark ()

GQuark              cd_client_error_quark               (void);

Returns :

An error quark.

Since 0.1.0


cd_client_new ()

CdClient *          cd_client_new                       (void);

Creates a new CdClient object.

Returns :

a new CdClient object.

Since 0.1.0


cd_client_create_device_sync ()

CdDevice *          cd_client_create_device_sync        (CdClient *client,
                                                         const gchar *id,
                                                         CdObjectScope scope,
                                                         GHashTable *properties,
                                                         GCancellable *cancellable,
                                                         GError **error);

Creates a color device.

client :

a CdClient instance.

id :

identifier for the device

scope :

the scope of the device

properties :

properties to set on the device, or NULL

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

A CdDevice object, or NULL for error

Since 0.1.2


cd_client_create_profile_sync ()

CdProfile *         cd_client_create_profile_sync       (CdClient *client,
                                                         const gchar *id,
                                                         CdObjectScope scope,
                                                         GHashTable *properties,
                                                         GCancellable *cancellable,
                                                         GError **error);

Creates a color profile.

client :

a CdClient instance.

id :

identifier for the device

scope :

the scope of the profile

properties :

properties to set on the profile, or NULL

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

A CdProfile object, or NULL for error

Since 0.1.2


cd_client_delete_device_sync ()

gboolean            cd_client_delete_device_sync        (CdClient *client,
                                                         const gchar *id,
                                                         GCancellable *cancellable,
                                                         GError **error);

Deletes a color device.

client :

a CdClient instance.

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

TRUE is the device was deleted

Since 0.1.0


cd_client_delete_profile_sync ()

gboolean            cd_client_delete_profile_sync       (CdClient *client,
                                                         const gchar *id,
                                                         GCancellable *cancellable,
                                                         GError **error);

Deletes a color profile.

client :

a CdClient instance.

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

TRUE is the profile was deleted

Since 0.1.0


cd_client_find_device_sync ()

CdDevice *          cd_client_find_device_sync          (CdClient *client,
                                                         const gchar *id,
                                                         GCancellable *cancellable,
                                                         GError **error);

Finds a color device.

client :

a CdClient instance.

id :

identifier for the device

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

A CdDevice object, or NULL for error

Since 0.1.0


cd_client_find_profile_sync ()

CdProfile *         cd_client_find_profile_sync         (CdClient *client,
                                                         const gchar *id,
                                                         GCancellable *cancellable,
                                                         GError **error);

Finds a color profile.

client :

a CdClient instance.

id :

identifier for the filename

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

A CdProfile object, or NULL for error

Since 0.1.0


cd_client_find_profile_by_filename_sync ()

CdProfile *         cd_client_find_profile_by_filename_sync
                                                        (CdClient *client,
                                                         const gchar *filename,
                                                         GCancellable *cancellable,
                                                         GError **error);

Finds a color profile from its filename.

client :

a CdClient instance.

filename :

filename for the profile

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

A CdProfile object, or NULL for error

Since 0.1.3


cd_client_get_devices_sync ()

GPtrArray *         cd_client_get_devices_sync          (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GError **error);

Get an array of the device objects.

client :

a CdClient instance.

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

an array of CdDevice objects, free with g_ptr_array_unref(). [transfer full]

Since 0.1.0


cd_client_get_devices ()

void                cd_client_get_devices               (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Gets a transacton ID from the daemon.

client :

a CdClient instance

cancellable :

a GCancellable or NULL

callback :

the function to run on completion

user_data :

the data to pass to callback

Since 0.1.2


cd_client_get_devices_finish ()

GPtrArray *         cd_client_get_devices_finish        (CdClient *client,
                                                         GAsyncResult *res,
                                                         GError **error);

Gets the result from the asynchronous function.

client :

a CdClient instance

res :

the GAsyncResult

error :

A GError or NULL

Returns :

the devices, or NULL if unset, free with g_ptr_array_unref()

Since 0.1.2


cd_client_get_profiles_sync ()

GPtrArray *         cd_client_get_profiles_sync         (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GError **error);

Get an array of the profile objects.

client :

a CdClient instance.

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

an array of CdProfile objects, free with g_ptr_array_unref(). [transfer full]

Since 0.1.0


cd_client_get_profiles ()

void                cd_client_get_profiles              (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Gets a transacton ID from the daemon.

client :

a CdClient instance

cancellable :

a GCancellable or NULL

callback :

the function to run on completion

user_data :

the data to pass to callback

Since 0.1.2


cd_client_get_profiles_finish ()

GPtrArray *         cd_client_get_profiles_finish       (CdClient *client,
                                                         GAsyncResult *res,
                                                         GError **error);

Gets the result from the asynchronous function.

client :

a CdClient instance

res :

the GAsyncResult

error :

A GError or NULL

Returns :

the profiles, or NULL if unset, free with g_ptr_array_unref()

Since 0.1.2


cd_client_get_sensors_sync ()

GPtrArray *         cd_client_get_sensors_sync          (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GError **error);

Get an array of the sensor objects.

client :

a CdClient instance.

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

an array of CdSensor objects, free with g_ptr_array_unref(). [transfer full]

Since 0.1.0


cd_client_get_sensors ()

void                cd_client_get_sensors               (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Gets a transacton ID from the daemon.

client :

a CdClient instance

cancellable :

a GCancellable or NULL

callback :

the function to run on completion

user_data :

the data to pass to callback

Since 0.1.2


cd_client_get_sensors_finish ()

GPtrArray *         cd_client_get_sensors_finish        (CdClient *client,
                                                         GAsyncResult *res,
                                                         GError **error);

Gets the result from the asynchronous function.

client :

a CdClient instance

res :

the GAsyncResult

error :

A GError or NULL

Returns :

the sensors, or NULL if unset, free with g_ptr_array_unref()

Since 0.1.2


cd_client_get_devices_by_kind_sync ()

GPtrArray *         cd_client_get_devices_by_kind_sync  (CdClient *client,
                                                         CdDeviceKind kind,
                                                         GCancellable *cancellable,
                                                         GError **error);

Get an array of the device objects of a specified kind.

client :

a CdClient instance.

kind :

a CdDeviceKind, e.g. CD_DEVICE_KIND_DISPLAY

cancellable :

a GCancellable, or NULL

error :

a GError, or NULL

Returns :

an array of CdDevice objects, free with g_ptr_array_unref(). [transfer full]

Since 0.1.0


cd_client_connect ()

void                cd_client_connect                   (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Connects to the colord daemon.

client :

a CdClient instance

cancellable :

a GCancellable or NULL

callback :

the function to run on completion

user_data :

the data to pass to callback

Since 0.1.6


cd_client_connect_finish ()

gboolean            cd_client_connect_finish            (CdClient *client,
                                                         GAsyncResult *res,
                                                         GError **error);

Gets the result from the asynchronous function.

client :

a CdClient instance

res :

the GAsyncResult

error :

A GError or NULL

Returns :

TRUE if we could connect to to the daemon

Since 0.1.6


cd_client_connect_sync ()

gboolean            cd_client_connect_sync              (CdClient *client,
                                                         GCancellable *cancellable,
                                                         GError **error);

Connects to the colord daemon.

client :

a CdClient instance.

cancellable :

a GCancellable or NULL

error :

a GError, or NULL.

Returns :

TRUE for success, else FALSE.

Since 0.1.0


cd_client_get_daemon_version ()

const gchar *       cd_client_get_daemon_version        (CdClient *client);

Get colord daemon version.

client :

a CdClient instance.

Returns :

string containing the daemon version, e.g. 0.1.0

Since 0.1.0


CdClientPrivate

typedef struct _CdClientPrivate CdClientPrivate;

Private CdClient data