IBus.Registry

g GObject.InitiallyUnowned GObject.InitiallyUnowned IBus.Object IBus.Object GObject.InitiallyUnowned->IBus.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned IBus.Serializable IBus.Serializable IBus.Object->IBus.Serializable IBus.Registry IBus.Registry IBus.Serializable->IBus.Registry

Subclasses:

None

Methods

Inherited:

IBus.Serializable (7), IBus.Object (2), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

check_modification ()

get_components ()

get_observed_paths ()

load ()

load_cache (is_user)

load_cache_file (filename)

load_in_dir (dirname)

output (output, indent)

save_cache (is_user)

save_cache_file (filename)

start_monitor_changes ()

Virtual Methods

Inherited:

IBus.Serializable (3), IBus.Object (1), GObject.Object (7)

Properties

None

Signals

Inherited:

IBus.Object (1), GObject.Object (1)

Name

Short Description

changed

Emitted when any observed paths are changed.

Fields

Inherited:

IBus.Object (1), GObject.Object (1)

Name

Type

Access

Description

parent

IBus.Serializable

r

Class Details

class IBus.Registry(**kwargs)
Bases:

IBus.Serializable

Abstract:

No

Structure:

IBus.RegistryClass

An IBus.Registry loads IBus component files and generates the cache files.

see_also: IBus.Component

classmethod new()
Returns:

A newly allocated IBus.Registry.

Return type:

IBus.Registry

Creates a new IBus.Registry

check_modification()
Returns:

True if mtime is changed; False otherwise.

Return type:

bool

Check if the registry is updated.

get_components()
Returns:

a list of IBus.Component objects. The caller has to call g_list_free() for the returned list.

Return type:

[IBus.Component]

List components.

get_observed_paths()
Returns:

a list of IBus.ObservedPath objects. The caller has to call g_list_free() for the returned list.

Return type:

[IBus.ObservedPath]

List observed paths.

load()

Read all XML files in a IBus component directory (typically /usr/share/ibus/component/ *.xml) and update the registry object. IBUS_COMPONENT_PATH environment valuable is also available for the custom component directories, whose delimiter is ‘:’.

load_cache(is_user)
Parameters:

is_user (bool) – True if the registry cache is loaded in the user directory.

Returns:

True if the cache exists and is loaded successfully, False otherwise.

Return type:

bool

Load the user or system registry cache.

load_cache_file(filename)
Parameters:

filename (str) – The file path of the registry cache

Returns:

True if the cache exists and is loaded successfully, False otherwise.

Return type:

bool

Load the registry cache filename.

load_in_dir(dirname)
Parameters:

dirname (str) – IBus component directory which includes XML files.

Read all XML files in dirname, create a IBus.Component object for each file, and add the component objects to the registry. If dirname is “/usr/share/ibus/component”, this API and IBus.Registry.load() are same.

output(output, indent)
Parameters:

Output IBus.Registry as an XML-formatted string. The output string can be then shown on the screen or written to file.

save_cache(is_user)
Parameters:

is_user (bool) – True if the registry cache is saved in the user directory.

Returns:

True if the cache is saved successfully, False otherwise.

Return type:

bool

Save the registry in a user directory or system directory.

save_cache_file(filename)
Parameters:

filename (str) – The file path of the registry cache

Returns:

True if the cache is saved successfully, False otherwise.

Return type:

bool

Save the registry cache filename.

start_monitor_changes()

Start to monitor observed paths.

Signal Details

IBus.Registry.signals.changed(registry)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:

registry (IBus.Registry) – The object which received the signal

Emitted when any observed paths are changed. A method is not associated in this class. the “changed” signal would be handled in other classes.

See also: IBus.Registry.start_monitor_changes().