CdClient

CdClient — Main client object for accessing the colord daemon

Functions

GQuark cd_client_error_quark ()
CdClient * cd_client_new ()
void cd_client_connect ()
gboolean cd_client_connect_finish ()
void cd_client_create_device ()
CdDevice * cd_client_create_device_finish ()
void cd_client_create_profile ()
CdProfile * cd_client_create_profile_finish ()
void cd_client_create_profile_for_icc ()
CdProfile * cd_client_create_profile_for_icc_finish ()
void cd_client_import_profile ()
CdProfile * cd_client_import_profile_finish ()
void cd_client_delete_device ()
gboolean cd_client_delete_device_finish ()
void cd_client_delete_profile ()
gboolean cd_client_delete_profile_finish ()
void cd_client_find_device ()
CdDevice * cd_client_find_device_finish ()
void cd_client_find_device_by_property ()
CdDevice * cd_client_find_device_by_property_finish ()
void cd_client_find_profile ()
CdProfile * cd_client_find_profile_finish ()
void cd_client_find_profile_by_filename ()
CdProfile * cd_client_find_profile_by_filename_finish ()
void cd_client_get_standard_space ()
CdProfile * cd_client_get_standard_space_finish ()
void cd_client_get_devices ()
GPtrArray * cd_client_get_devices_finish ()
void cd_client_get_devices_by_kind ()
GPtrArray * cd_client_get_devices_by_kind_finish ()
void cd_client_get_profiles ()
GPtrArray * cd_client_get_profiles_finish ()
void cd_client_get_sensors ()
GPtrArray * cd_client_get_sensors_finish ()
void cd_client_find_profile_by_property ()
CdProfile * cd_client_find_profile_by_property_finish ()
void cd_client_find_sensor ()
CdSensor * cd_client_find_sensor_finish ()
gboolean cd_client_get_connected ()
gboolean cd_client_get_has_server ()
const gchar * cd_client_get_daemon_version ()
const gchar * cd_client_get_system_vendor ()
const gchar * cd_client_get_system_model ()

Properties

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── CdClient

Description

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

See also: CdDevice

Functions

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_connect ()

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

Connects to the colord daemon.

Parameters

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.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

success

Since: 0.1.6


cd_client_create_device ()

void
cd_client_create_device (CdClient *client,
                         const gchar *id,
                         CdObjectScope scope,
                         GHashTable *properties,
                         GCancellable *cancellable,
                         GAsyncReadyCallback callback,
                         gpointer user_data);

Creates a color device.

Parameters

client

a CdClient instance.

 

id

identifier for the device

 

scope

the scope of the device

 

properties

properties to set on the device, or NULL.

[element-type utf8 utf8][allow-none]

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_create_device_finish ()

CdDevice *
cd_client_create_device_finish (CdClient *client,
                                GAsyncResult *res,
                                GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdDevice or NULL.

[transfer full]

Since: 0.1.8


cd_client_create_profile ()

void
cd_client_create_profile (CdClient *client,
                          const gchar *id,
                          CdObjectScope scope,
                          GHashTable *properties,
                          GCancellable *cancellable,
                          GAsyncReadyCallback callback,
                          gpointer user_data);

Creates a color profile.

Parameters

client

a CdClient instance.

 

id

identifier for the profile

 

scope

the scope of the profile

 

properties

properties to set on the profile, or NULL.

[element-type utf8 utf8][allow-none]

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_create_profile_finish ()

CdProfile *
cd_client_create_profile_finish (CdClient *client,
                                 GAsyncResult *res,
                                 GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdProfile or NULL.

[transfer full]

Since: 0.1.8


cd_client_create_profile_for_icc ()

void
cd_client_create_profile_for_icc (CdClient *client,
                                  CdIcc *icc,
                                  CdObjectScope scope,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Creates a color profile for an CdIcc Object.

Parameters

client

a CdClient instance.

 

icc

CdIcc object

 

scope

the scope of the profile

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 1.1.1


cd_client_create_profile_for_icc_finish ()

CdProfile *
cd_client_create_profile_for_icc_finish
                               (CdClient *client,
                                GAsyncResult *res,
                                GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdProfile or NULL.

[transfer full]

Since: 1.1.1


cd_client_import_profile ()

void
cd_client_import_profile (CdClient *client,
                          GFile *file,
                          GCancellable *cancellable,
                          GAsyncReadyCallback callback,
                          gpointer user_data);

Imports a color profile into the users home directory.

If the profile should be accessable for all users, then call cd_profile_install_system_wide() on the result.

Parameters

client

a CdClient instance.

 

file

a GFile

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.12


cd_client_import_profile_finish ()

CdProfile *
cd_client_import_profile_finish (CdClient *client,
                                 GAsyncResult *res,
                                 GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdProfile or NULL.

[transfer full]

Since: 0.1.12


cd_client_delete_device ()

void
cd_client_delete_device (CdClient *client,
                         CdDevice *device,
                         GCancellable *cancellable,
                         GAsyncReadyCallback callback,
                         gpointer user_data);

Deletes a device.

Parameters

client

a CdClient instance.

 

device

a CdDevice

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_delete_device_finish ()

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

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

success

Since: 0.1.8


cd_client_delete_profile ()

void
cd_client_delete_profile (CdClient *client,
                          CdProfile *profile,
                          GCancellable *cancellable,
                          GAsyncReadyCallback callback,
                          gpointer user_data);

Deletes a profile.

Parameters

client

a CdClient instance.

 

profile

a CdProfile

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_delete_profile_finish ()

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

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

success

Since: 0.1.8


cd_client_find_device ()

void
cd_client_find_device (CdClient *client,
                       const gchar *id,
                       GCancellable *cancellable,
                       GAsyncReadyCallback callback,
                       gpointer user_data);

Finds a device by an ID.

Parameters

client

a CdClient instance.

 

id

a device id

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_find_device_finish ()

CdDevice *
cd_client_find_device_finish (CdClient *client,
                              GAsyncResult *res,
                              GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdDevice or NULL.

[transfer full]

Since: 0.1.8


cd_client_find_device_by_property ()

void
cd_client_find_device_by_property (CdClient *client,
                                   const gchar *key,
                                   const gchar *value,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Finds a color device that has a property value.

Parameters

client

a CdClient instance.

 

key

the device property key

 

value

the device property value

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_find_device_by_property_finish ()

CdDevice *
cd_client_find_device_by_property_finish
                               (CdClient *client,
                                GAsyncResult *res,
                                GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdDevice or NULL.

[transfer full]

Since: 0.1.8


cd_client_find_profile ()

void
cd_client_find_profile (CdClient *client,
                        const gchar *id,
                        GCancellable *cancellable,
                        GAsyncReadyCallback callback,
                        gpointer user_data);

Finds a profile by an ID.

Parameters

client

a CdClient instance.

 

id

a profile id

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_find_profile_finish ()

CdProfile *
cd_client_find_profile_finish (CdClient *client,
                               GAsyncResult *res,
                               GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdProfile or NULL.

[transfer full]

Since: 0.1.8


cd_client_find_profile_by_filename ()

void
cd_client_find_profile_by_filename (CdClient *client,
                                    const gchar *filename,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Finds a profile by a filename.

Parameters

client

a CdClient instance.

 

filename

a profile filename

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_find_profile_by_filename_finish ()

CdProfile *
cd_client_find_profile_by_filename_finish
                               (CdClient *client,
                                GAsyncResult *res,
                                GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdProfile or NULL.

[transfer full]

Since: 0.1.8


cd_client_get_standard_space ()

void
cd_client_get_standard_space (CdClient *client,
                              CdStandardSpace standard_space,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Finds a standard profile space.

Parameters

client

a CdStandardSpace instance.

 

standard_space

a profile id

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_get_standard_space_finish ()

CdProfile *
cd_client_get_standard_space_finish (CdClient *client,
                                     GAsyncResult *res,
                                     GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdProfile or NULL.

[transfer full]

Since: 0.1.8


cd_client_get_devices ()

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

Gets an array of color devices.

Parameters

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.8


cd_client_get_devices_finish ()

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

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

the devices.

[element-type CdDevice][transfer full]

Since: 0.1.8


cd_client_get_devices_by_kind ()

void
cd_client_get_devices_by_kind (CdClient *client,
                               CdDeviceKind kind,
                               GCancellable *cancellable,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

Gets an array of color devices.

Parameters

client

a CdClient instance.

 

kind

the type of device.

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.8


cd_client_get_devices_by_kind_finish ()

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

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

the devices.

[element-type CdDevice][transfer full]

Since: 0.1.8


cd_client_get_profiles ()

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

Gets an array of color profiles.

Parameters

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.8


cd_client_get_profiles_finish ()

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

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

the profiles.

[element-type CdProfile][transfer full]

Since: 0.1.8


cd_client_get_sensors ()

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

Gets an array of color sensors.

Parameters

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.8


cd_client_get_sensors_finish ()

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

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

the sensors.

[element-type CdSensor][transfer full]

Since: 0.1.8


cd_client_find_profile_by_property ()

void
cd_client_find_profile_by_property (CdClient *client,
                                    const gchar *key,
                                    const gchar *value,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Finds a color profile that has a property value.

Parameters

client

a CdClient instance.

 

key

the profile property key

 

value

the profile property value

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.24


cd_client_find_profile_by_property_finish ()

CdProfile *
cd_client_find_profile_by_property_finish
                               (CdClient *client,
                                GAsyncResult *res,
                                GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdProfile or NULL.

[transfer full]

Since: 0.1.24


cd_client_find_sensor ()

void
cd_client_find_sensor (CdClient *client,
                       const gchar *id,
                       GCancellable *cancellable,
                       GAsyncReadyCallback callback,
                       gpointer user_data);

Finds a sensor by an ID.

Parameters

client

a CdClient instance.

 

id

a sensor id

 

cancellable

a GCancellable, or NULL

 

callback

the function to run on completion

 

user_data

the data to pass to callback

 

Since: 0.1.26


cd_client_find_sensor_finish ()

CdSensor *
cd_client_find_sensor_finish (CdClient *client,
                              GAsyncResult *res,
                              GError **error);

Gets the result from the asynchronous function.

Parameters

client

a CdClient instance.

 

res

the GAsyncResult

 

error

A GError or NULL

 

Returns

a CdSensor or NULL.

[transfer full]

Since: 0.1.26


cd_client_get_connected ()

gboolean
cd_client_get_connected (CdClient *client);

Gets if the client has been connected.

Parameters

client

a CdClient instance.

 

Returns

TRUE if properties are valid

Since: 0.1.9


cd_client_get_has_server ()

gboolean
cd_client_get_has_server (CdClient *client);

Gets if the colord server is currently running. WARNING: This function may block for up to 5 seconds waiting for the daemon to start if it is not already running.

Parameters

client

a CdClient instance.

 

Returns

TRUE if the colord process is running

Since: 0.1.12


cd_client_get_daemon_version ()

const gchar *
cd_client_get_daemon_version (CdClient *client);

Get colord daemon version.

Parameters

client

a CdClient instance.

 

Returns

string containing the daemon version, e.g. "0.1.0"

Since: 0.1.0


cd_client_get_system_vendor ()

const gchar *
cd_client_get_system_vendor (CdClient *client);

Get system vendor.

Parameters

client

a CdClient instance.

 

Returns

string containing the system vendor, e.g. "Lenovo"

Since: 1.0.2


cd_client_get_system_model ()

const gchar *
cd_client_get_system_model (CdClient *client);

Get system model.

Parameters

client

a CdClient instance.

 

Returns

string containing the system model, e.g. "T61"

Since: 1.0.2

Types and Values

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 ())

CD_TYPE_CLIENT

#define CD_TYPE_CLIENT (cd_client_get_type ())

struct CdClientClass

struct CdClientClass {
	GObjectClass		 parent_class;
	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)              (CdClient		*client);
};

CdClient

typedef struct _CdClient CdClient;

Property Details

The “connected” property

  “connected”                gchar *

The if the object path has been connected as is valid for use.

Flags: Read

Default value: NULL

Since: 0.1.9


The “daemon-version” property

  “daemon-version”           gchar *

The daemon version.

Flags: Read

Default value: NULL

Since: 0.1.0


The “system-model” property

  “system-model”             gchar *

The system model.

Flags: Read

Default value: NULL

Since: 1.0.2


The “system-vendor” property

  “system-vendor”            gchar *

The system vendor.

Flags: Read

Default value: NULL

Since: 1.0.2

Signal Details

The “changed” signal

void
user_function (CdClient *client,
               gpointer  user_data)

The ::changed signal is emitted when properties may have changed.

Parameters

client

the CdDevice instance that emitted the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.0


The “device-added” signal

void
user_function (CdClient *client,
               CdDevice *device,
               gpointer  user_data)

The ::device-added signal is emitted when a device is added.

Parameters

client

the CdClient instance that emitted the signal

 

device

the CdDevice that was added.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.0


The “device-changed” signal

void
user_function (CdClient *client,
               CdDevice *device,
               gpointer  user_data)

The ::device-changed signal is emitted when a device is changed.

Parameters

client

the CdClient instance that emitted the signal

 

device

the CdDevice that was changed.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.2


The “device-removed” signal

void
user_function (CdClient *client,
               CdDevice *device,
               gpointer  user_data)

The ::device-added signal is emitted when a device is removed.

Parameters

client

the CdClient instance that emitted the signal

 

device

the CdDevice that was removed.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.0


The “profile-added” signal

void
user_function (CdClient  *client,
               CdProfile *profile,
               gpointer   user_data)

The ::profile-added signal is emitted when a profile is added.

Parameters

client

the CdClient instance that emitted the signal

 

profile

the CdProfile that was added.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.2


The “profile-changed” signal

void
user_function (CdClient  *client,
               CdProfile *profile,
               gpointer   user_data)

The ::profile-changed signal is emitted when a profile is changed.

Parameters

client

the CdClient instance that emitted the signal

 

profile

the CdProfile that was removed.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.2


The “profile-removed” signal

void
user_function (CdClient  *client,
               CdProfile *profile,
               gpointer   user_data)

The ::profile-added signal is emitted when a profile is removed.

Parameters

client

the CdClient instance that emitted the signal

 

profile

the CdProfile that was removed.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.2


The “sensor-added” signal

void
user_function (CdClient *client,
               CdSensor *sensor,
               gpointer  user_data)

The ::sensor-added signal is emitted when a sensor is added.

Parameters

client

the CdClient instance that emitted the signal

 

sensor

the CdSensor that was added.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.6


The “sensor-changed” signal

void
user_function (CdClient *client,
               CdSensor *sensor,
               gpointer  user_data)

The ::sensor-changed signal is emitted when a sensor is changed.

Parameters

client

the CdClient instance that emitted the signal

 

sensor

the CdSensor that was removed.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.6


The “sensor-removed” signal

void
user_function (CdClient *client,
               CdSensor *sensor,
               gpointer  user_data)

The ::sensor-added signal is emitted when a sensor is removed.

Parameters

client

the CdClient instance that emitted the signal

 

sensor

the CdSensor that was removed.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.1.6