colord Reference Manual: cd-client-sync

## cd-client-sync cd-client-sync — Sync helpers for CdClient |

## Functions

gboolean | cd_client_connect_sync ()
gboolean | cd_client_delete_profile_sync ()
gboolean | cd_client_delete_device_sync ()
CdProfile * | cd_client_find_profile_sync ()
CdProfile * | cd_client_find_profile_by_filename_sync ()
CdProfile * | cd_client_create_profile_sync ()
CdProfile * | cd_client_create_profile_for_icc_sync ()
CdProfile * | cd_client_import_profile_sync ()
CdDevice * | cd_client_create_device_sync ()
GPtrArray * | cd_client_get_devices_sync ()
GPtrArray * | cd_client_get_profiles_sync ()
GPtrArray * | cd_client_get_sensors_sync ()
CdDevice * | cd_client_find_device_sync ()
CdDevice * | cd_client_find_device_by_property_sync ()
CdProfile * | cd_client_get_standard_space_sync ()
GPtrArray * | cd_client_get_devices_by_kind_sync ()
CdProfile * | cd_client_find_profile_by_property_sync ()
CdSensor * | cd_client_find_sensor_sync ()

## Description

These helper functions provide a simple way to use the async functions in command line tools.

See also: CdClient

## Functions

### cd_client_connect_sync ()

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

Connects to the colord daemon.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

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

    gboolean
    cd_client_delete_profile_sync (CdClient *client,
                                   CdProfile *profile,
                                   GCancellable *cancellable,
                                   GError **error);

Deletes a color profile.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
profile | a CdProfile. |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

`TRUE` is the profile was deleted

Since 0.1.8

### cd_client_delete_device_sync ()

    gboolean
    cd_client_delete_device_sync (CdClient *client,
                                  CdDevice *device,
                                  GCancellable *cancellable,
                                  GError **error);

Deletes a color device.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
device | a CdDevice. |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

`TRUE` is the device was deleted

Since 0.1.8

### cd_client_find_profile_sync ()

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

Finds a color profile from its id.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
id | id for the profile |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

A CdProfile object, or `NULL` for error.

[transfer full]

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.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

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.

[transfer full]

Since 0.1.3

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

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
id | identifier for the device |
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` |
error | a GError, or `NULL` |

#### Returns

A CdProfile object, or `NULL` for error.

[transfer full]

Since 0.1.2

### cd_client_create_profile_for_icc_sync ()

    CdProfile *
    cd_client_create_profile_for_icc_sync (CdClient *client,
                                           CdIcc *icc,
                                           CdObjectScope scope,
                                           GCancellable *cancellable,
                                           GError **error);

Creates a color profile from a CdIcc object.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
icc | A CdIcc |
scope | the scope of the profile |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

A CdProfile object, or `NULL` for error.

[transfer full]

Since 1.1.1

### cd_client_import_profile_sync ()

    CdProfile *
    cd_client_import_profile_sync (CdClient *client,
                                   GFile *file,
                                   GCancellable *cancellable,
                                   GError **error);

Imports a color profile into the users home directory.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
file | A GFile |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

A CdProfile object, or `NULL` for error.

[transfer full]

Since 0.1.12

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

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### 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` |
error | a GError, or `NULL` |

#### Returns

A CdDevice object, or `NULL` for error.

[transfer full]

Since 0.1.2

### cd_client_get_devices_sync ()

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

Get an array of the device objects.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

an array of CdDevice objects.

[transfer container][element-type CdDevice]

Since 0.1.0

### cd_client_get_profiles_sync ()

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

Get an array of the profile objects.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

an array of CdProfile objects.

[transfer container][element-type CdProfile]

Since 0.1.0

### cd_client_get_sensors_sync ()

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

Get an array of the sensor objects.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

an array of CdSensor objects.

[transfer container][element-type CdSensor]

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.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
id | The device ID. |
cancellable | a GCancellable or `NULL` |
error | a GError, or `NULL`. |

#### Returns

A CdDevice object, or `NULL` for error.

[transfer full]

Since 0.1.0

### cd_client_find_device_by_property_sync ()

    CdDevice *
    cd_client_find_device_by_property_sync
                                   (CdClient *client,
                                    const gchar *key,
                                    const gchar *value,
                                    GCancellable *cancellable,
                                    GError **error);

Finds a color device that has a property value.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
key | The device property key. |
value | The device property value. |
cancellable | a GCancellable or `NULL` |
error | a GError, or `NULL`. |

#### Returns

A CdDevice object, or `NULL` for error.

[transfer full]

Since 0.1.8

### cd_client_get_standard_space_sync ()

    CdProfile *
    cd_client_get_standard_space_sync (CdClient *client,
                                       CdStandardSpace standard_space,
                                       GCancellable *cancellable,
                                       GError **error);

Finds a standard colorspace.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
standard_space | standard colorspace value |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

A CdProfile object, or `NULL` for error.

[transfer full]

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.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

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.

[transfer container][element-type CdDevice]

Since 0.1.0

### cd_client_find_profile_by_property_sync ()

    CdProfile *
    cd_client_find_profile_by_property_sync
                                   (CdClient *client,
                                    const gchar *key,
                                    const gchar *value,
                                    GCancellable *cancellable,
                                    GError **error);

Finds a color profile that has a property value.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
key | The profile property key. |
value | The profile property value. |
cancellable | a GCancellable or `NULL` |
error | a GError, or `NULL`. |

#### Returns

A CdProfile object, or `NULL` for error.

[transfer full]

Since 0.1.24

### cd_client_find_sensor_sync ()

    CdSensor *
    cd_client_find_sensor_sync (CdClient *client,
                                const gchar *id,
                                GCancellable *cancellable,
                                GError **error);

Finds a color sensor.

WARNING: This function is synchronous, and may block. Do not use it in GUI applications.

#### Parameters

client | a CdClient instance. |
id | The sensor ID. |
cancellable | a GCancellable or `NULL` |
error | a GError, or `NULL`. |

#### Returns

A CdSensor object, or `NULL` for error.

[transfer full]

Since 0.1.26

## Types and Values