Colord.Device

g Colord.Device Colord.Device GObject.Object GObject.Object GObject.Object->Colord.Device

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

error_from_string (error_desc)

class

error_quark ()

class

error_to_string (error_enum)

class

kind_from_string (kind)

class

kind_to_profile_kind (device_kind)

class

kind_to_string (kind_enum)

class

mode_from_string (device_mode)

class

mode_to_string (device_mode)

class

new ()

class

new_with_object_path (object_path)

class

relation_from_string (device_relation)

class

relation_to_string (device_relation)

add_profile (relation, profile, cancellable, callback, *user_data)

add_profile_finish (res)

add_profile_sync (relation, profile, cancellable)

connect (cancellable, callback, *user_data)

connect_finish (res)

connect_sync (cancellable)

equal (device2)

get_colorspace ()

get_connected ()

get_created ()

get_default_profile ()

get_embedded ()

get_enabled ()

get_format ()

get_id ()

get_kind ()

get_metadata ()

get_metadata_item (key)

get_mode ()

get_model ()

get_modified ()

get_object_path ()

get_owner ()

get_profile_for_qualifiers (qualifiers, cancellable, callback, *user_data)

get_profile_for_qualifiers_finish (res)

get_profile_for_qualifiers_sync (qualifiers, cancellable)

get_profile_relation (profile, cancellable, callback, *user_data)

get_profile_relation_finish (res)

get_profile_relation_sync (profile, cancellable)

get_profiles ()

get_profiling_inhibitors ()

get_scope ()

get_seat ()

get_serial ()

get_vendor ()

make_profile_default (profile, cancellable, callback, *user_data)

make_profile_default_finish (res)

make_profile_default_sync (profile, cancellable)

profiling_inhibit (cancellable, callback, *user_data)

profiling_inhibit_finish (res)

profiling_inhibit_sync (cancellable)

profiling_uninhibit (cancellable, callback, *user_data)

profiling_uninhibit_finish (res)

profiling_uninhibit_sync (cancellable)

remove_profile (profile, cancellable, callback, *user_data)

remove_profile_finish (res)

remove_profile_sync (profile, cancellable)

set_colorspace_sync (colorspace, cancellable)

set_enabled (enabled, cancellable, callback, *user_data)

set_enabled_finish (res)

set_enabled_sync (enabled, cancellable)

set_kind_sync (kind, cancellable)

set_mode_sync (mode, cancellable)

set_model_sync (value, cancellable)

set_object_path (object_path)

set_property (key, value, cancellable, callback, *user_data)

set_property_finish (res)

set_property_sync (key, value, cancellable)

set_serial_sync (value, cancellable)

set_vendor_sync (value, cancellable)

to_string ()

Virtual Methods

Inherited:

GObject.Object (7)

do_changed ()

Properties

Name

Type

Flags

Short Description

colorspace

int

r

connected

str

r

created

int

r

embedded

str

r

enabled

bool

r

format

str

r

id

str

r

kind

int

r

mode

int

r

model

str

r

modified

int

r

object-path

str

r/w/c

owner

int

r

profiling-inhibitors

[str]

r

scope

int

r

seat

str

r

serial

str

r

vendor

str

r

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

The ::changed signal is emitted when the device data has changed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Colord.Device(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Colord.DeviceClass

classmethod error_from_string(error_desc)[source]
Parameters:

error_desc (str) –

Returns:

enumerated value

Return type:

Colord.DeviceError

Converts a string to a Colord.DeviceError.

New in version 0.1.26.

classmethod error_quark()[source]
Returns:

An error quark.

Return type:

int

New in version 0.1.0.

classmethod error_to_string(error_enum)[source]
Parameters:

error_enum (Colord.DeviceError) –

Returns:

identifier string

Return type:

str

Converts a Colord.DeviceError to a string.

New in version 0.1.26.

classmethod kind_from_string(kind)[source]
Parameters:

kind (str) –

Returns:

enumerated value

Return type:

Colord.DeviceKind

Converts a string to a Colord.DeviceKind.

New in version 0.1.0.

classmethod kind_to_profile_kind(device_kind)[source]
Parameters:

device_kind (Colord.DeviceKind) – A Colord.DeviceKind

Returns:

a Colord.ProfileKind

Return type:

Colord.ProfileKind

Gets the most suitable profile kind for a device kind.

New in version 0.1.6.

classmethod kind_to_string(kind_enum)[source]
Parameters:

kind_enum (Colord.DeviceKind) –

Returns:

identifier string

Return type:

str

Converts a Colord.DeviceKind to a string.

New in version 0.1.0.

classmethod mode_from_string(device_mode)[source]
Parameters:

device_mode (str) –

Return type:

Colord.DeviceMode

classmethod mode_to_string(device_mode)[source]
Parameters:

device_mode (Colord.DeviceMode) –

Return type:

str

classmethod new()[source]
Returns:

a new Colord.Device object.

Return type:

Colord.Device

Creates a new Colord.Device object.

New in version 0.1.0.

classmethod new_with_object_path(object_path)[source]
Parameters:

object_path (str) – The colord object path.

Returns:

a new device object.

Return type:

Colord.Device

Creates a new Colord.Device object with a known object path.

New in version 0.1.8.

classmethod relation_from_string(device_relation)[source]
Parameters:

device_relation (str) –

Return type:

Colord.DeviceRelation

classmethod relation_to_string(device_relation)[source]
Parameters:

device_relation (Colord.DeviceRelation) –

Return type:

str

add_profile(relation, profile, cancellable, callback, *user_data)[source]
Parameters:

Adds a profile to a device.

New in version 0.1.8.

add_profile_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

success

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.1.8.

add_profile_sync(relation, profile, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False.

Return type:

bool

Adds a profile to a device.

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

New in version 0.1.3.

connect(cancellable, callback, *user_data)[source]
Parameters:

Connects to the object and fills up initial properties.

New in version 0.1.8.

connect_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

success

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.1.8.

connect_sync(cancellable)[source]
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None

Raises:

GLib.Error

Returns:

True for success, else False.

Return type:

bool

Connects to the object and fills up initial properties.

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

New in version 0.1.8.

equal(device2)[source]
Parameters:

device2 (Colord.Device) – another Colord.Device instance.

Returns:

True if the devices are the same device

Return type:

bool

Tests two devices for equality.

New in version 0.1.8.

get_colorspace()[source]
Returns:

A colorspace, e.g. Colord.Colorspace.RGB

Return type:

Colord.Colorspace

Gets the device colorspace.

New in version 0.1.1.

get_connected()[source]
Returns:

True if properties are valid

Return type:

bool

Gets if the device has been connected.

New in version 0.1.9.

get_created()[source]
Returns:

A value in microseconds, or 0 for invalid

Return type:

int

Gets the device creation date.

New in version 0.1.0.

get_default_profile()[source]
Returns:

A Colord.Profile's or None

Return type:

Colord.Profile

Gets the default device profile. A profile will not be returned if the device is being profiled or is disabled.

New in version 0.1.1.

get_embedded()[source]
Returns:

True if embedded.

Return type:

bool

Returns if the device is embedded in the computer and cannot be removed.

New in version 0.1.27.

get_enabled()[source]
Returns:

True if the device is enabled

Return type:

bool

Gets the device enabled state.

New in version 0.1.26.

get_format()[source]
Returns:

A string, or None for invalid

Return type:

str

Gets the device format.

New in version 0.1.9.

get_id()[source]
Returns:

A string, or None for invalid

Return type:

str

Gets the device ID.

New in version 0.1.0.

get_kind()[source]
Returns:

A device kind, e.g. Colord.DeviceKind.DISPLAY

Return type:

Colord.DeviceKind

Gets the device kind.

New in version 0.1.0.

get_metadata()[source]
Returns:

a GLib.HashTable.

Return type:

{str: str}

Returns the device metadata.

New in version 0.1.5.

get_metadata_item(key)[source]
Parameters:

key (str) – a key for the metadata dictionary

Returns:

the metadata value, or None if not set.

Return type:

str

Returns the device metadata for a specific key.

New in version 0.1.5.

get_mode()[source]
Returns:

A colorspace, e.g. Colord.DeviceMode.VIRTUAL

Return type:

Colord.DeviceMode

Gets the device mode.

New in version 0.1.2.

get_model()[source]
Returns:

A string, or None for invalid

Return type:

str

Gets the device model.

New in version 0.1.0.

get_modified()[source]
Returns:

A value in microseconds, or 0 for invalid

Return type:

int

Gets the device modified date.

New in version 0.1.1.

get_object_path()[source]
Returns:

the object path, or None

Return type:

str

Gets the object path for the device.

New in version 0.1.0.

get_owner()[source]
Returns:

The UID of the user that created the device

Return type:

int

Gets the device owner.

New in version 0.1.13.

get_profile_for_qualifiers(qualifiers, cancellable, callback, *user_data)[source]
Parameters:

Gets the preferred profile for some qualifiers.

New in version 0.1.8.

get_profile_for_qualifiers_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

a Colord.Profile or None

Return type:

Colord.Profile

Gets the result from the asynchronous function.

New in version 0.1.8.

get_profile_for_qualifiers_sync(qualifiers, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

a Colord.Profile or None

Return type:

Colord.Profile

Gets the preferred profile for some qualifiers.

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

New in version 0.1.8.

get_profile_relation(profile, cancellable, callback, *user_data)[source]
Parameters:

Gets the property relationship to the device.

New in version 0.1.8.

get_profile_relation_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

success

Return type:

Colord.DeviceRelation

Gets the result from the asynchronous function.

New in version 0.1.8.

get_profile_relation_sync(profile, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False.

Return type:

Colord.DeviceRelation

Gets the property relationship to the device.

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

New in version 0.1.8.

get_profiles()[source]
Returns:

An array of Colord.Profile's

Return type:

[Colord.Profile]

Gets the device profiles.

New in version 0.1.0.

get_profiling_inhibitors()[source]
Returns:

A strv, or None for invalid

Return type:

[str]

Gets any profiling inhibitors for the device.

New in version 0.1.17.

get_scope()[source]
Returns:

An object scope, e.g. Colord.ObjectScope.TEMP

Return type:

Colord.ObjectScope

Gets the device scope.

New in version 0.1.10.

get_seat()[source]
Returns:

A string, or None for invalid

Return type:

str

Gets the device seat identifier.

New in version 0.1.24.

get_serial()[source]
Returns:

A string, or None for invalid

Return type:

str

Gets the device serial number.

New in version 0.1.0.

get_vendor()[source]
Returns:

A string, or None for invalid

Return type:

str

Gets the device vendor.

New in version 0.1.1.

make_profile_default(profile, cancellable, callback, *user_data)[source]
Parameters:

Makes an already added profile default for a device.

New in version 0.1.8.

make_profile_default_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

success

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.1.8.

make_profile_default_sync(profile, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False.

Return type:

bool

Makes an already added profile default for a device.

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

New in version 0.1.8.

profiling_inhibit(cancellable, callback, *user_data)[source]
Parameters:

Sets up the device for profiling and causes no profiles to be returned if Colord.Device.get_profile_for_qualifiers_sync() is used.

New in version 0.1.8.

profiling_inhibit_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

success

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.1.8.

profiling_inhibit_sync(cancellable)[source]
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None

Raises:

GLib.Error

Returns:

True for success, else False.

Return type:

bool

Sets up the device for profiling and causes no profiles to be returned if Colord.Device.get_profile_for_qualifiers_sync() is used.

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

New in version 0.1.1.

profiling_uninhibit(cancellable, callback, *user_data)[source]
Parameters:

Restores the device after profiling and causes normal profiles to be returned if Colord.Device.get_profile_for_qualifiers_sync() is used.

New in version 0.1.8.

profiling_uninhibit_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

success

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.1.8.

profiling_uninhibit_sync(cancellable)[source]
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable or None

Raises:

GLib.Error

Returns:

True for success, else False.

Return type:

bool

Sets up the device for profiling and causes no profiles to be returned if Colord.Device.get_profile_for_qualifiers_sync() is used.

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

New in version 0.1.1.

remove_profile(profile, cancellable, callback, *user_data)[source]
Parameters:

Removes a profile from a device.

New in version 0.1.8.

remove_profile_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

success

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.1.8.

remove_profile_sync(profile, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False.

Return type:

bool

Removes a profile from a device.

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

New in version 0.1.2.

set_colorspace_sync(colorspace, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False and error is used

Return type:

bool

Sets the device kind.

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

New in version 0.1.1.

set_enabled(enabled, cancellable, callback, *user_data)[source]
Parameters:

Enables or disables a device.

New in version 0.1.26.

set_enabled_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

success

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.1.26.

set_enabled_sync(enabled, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False.

Return type:

bool

Enables or disables a device.

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

New in version 0.1.26.

set_kind_sync(kind, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False and error is used

Return type:

bool

Sets the device kind.

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

New in version 0.1.0.

set_mode_sync(mode, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False and error is used

Return type:

bool

Sets the device mode.

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

New in version 0.1.2.

set_model_sync(value, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False and error is used

Return type:

bool

Sets the device model.

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

New in version 0.1.0.

set_object_path(object_path)[source]
Parameters:

object_path (str) – The colord object path.

Sets the object path of the device.

New in version 0.1.8.

set_property(key, value, cancellable, callback, *user_data)[source]
Parameters:

Sets a property on the device.

New in version 0.1.8.

set_property_finish(res)[source]
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

success

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.1.8.

set_property_sync(key, value, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False.

Return type:

bool

Sets an object property.

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

New in version 0.1.8.

set_serial_sync(value, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False and error is used

Return type:

bool

Sets the device serial number.

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

New in version 0.1.1.

set_vendor_sync(value, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success, else False and error is used

Return type:

bool

Sets the device vendor.

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

New in version 0.1.1.

to_string()[source]
Returns:

text representation of Colord.Device

Return type:

str

Converts the device to a string description.

New in version 0.1.0.

do_changed() virtual

Signal Details

Colord.Device.signals.changed(device)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:

device (Colord.Device) – The object which received the signal

The ::changed signal is emitted when the device data has changed.

New in version 0.1.0.

Property Details

Colord.Device.props.colorspace
Name:

colorspace

Type:

int

Default Value:

0

Flags:

READABLE

The device colorspace, e.g. Colord.Colorspace.RGB.

New in version 0.1.1.

Colord.Device.props.connected
Name:

connected

Type:

str

Default Value:

None

Flags:

READABLE

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

New in version 0.1.9.

Colord.Device.props.created
Name:

created

Type:

int

Default Value:

0

Flags:

READABLE

The time the device was created.

New in version 0.1.0.

Colord.Device.props.embedded
Name:

embedded

Type:

str

Default Value:

None

Flags:

READABLE

If the device is embedded in the device and cannot be removed.

New in version 0.1.27.

Colord.Device.props.enabled
Name:

enabled

Type:

bool

Default Value:

False

Flags:

READABLE

The device enabled state.

New in version 0.1.26.

Colord.Device.props.format
Name:

format

Type:

str

Default Value:

None

Flags:

READABLE

The device format.

New in version 0.1.9.

Colord.Device.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE

The device ID.

New in version 0.1.0.

Colord.Device.props.kind
Name:

kind

Type:

int

Default Value:

0

Flags:

READABLE

The device kind, e.g. Colord.DeviceKind.DISPLAY.

New in version 0.1.0.

Colord.Device.props.mode
Name:

mode

Type:

int

Default Value:

0

Flags:

READABLE

The device colorspace, e.g. Colord.DeviceMode.VIRTUAL.

New in version 0.1.2.

Colord.Device.props.model
Name:

model

Type:

str

Default Value:

None

Flags:

READABLE

The device model.

New in version 0.1.0.

Colord.Device.props.modified
Name:

modified

Type:

int

Default Value:

0

Flags:

READABLE

The last time the device was modified.

New in version 0.1.1.

Colord.Device.props.object_path
Name:

object-path

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The object path of the remote object

New in version 0.1.8.

Colord.Device.props.owner
Name:

owner

Type:

int

Default Value:

0

Flags:

READABLE

The device owner, e.g. 500.

New in version 0.1.13.

Colord.Device.props.profiling_inhibitors
Name:

profiling-inhibitors

Type:

[str]

Default Value:

[]

Flags:

READABLE

Colord.Device.props.scope
Name:

scope

Type:

int

Default Value:

0

Flags:

READABLE

The device scope, e.g. Colord.ObjectScope.TEMP.

New in version 0.1.10.

Colord.Device.props.seat
Name:

seat

Type:

str

Default Value:

None

Flags:

READABLE

The device seat identifier.

New in version 0.1.24.

Colord.Device.props.serial
Name:

serial

Type:

str

Default Value:

None

Flags:

READABLE

The device serial number.

New in version 0.1.1.

Colord.Device.props.vendor
Name:

vendor

Type:

str

Default Value:

None

Flags:

READABLE

The device vendor.

New in version 0.1.1.