IBusComponent: IBus Reference Manual

## IBusComponent IBusComponent — Component (executable) specification. |

## Stability Level

Stable, unless otherwise indicated

## Functions

IBusComponent * | ibus_component_new ()
IBusComponent * | ibus_component_new_varargs ()
IBusComponent * | ibus_component_new_from_xml_node ()
IBusComponent * | ibus_component_new_from_file ()
const gchar * | ibus_component_get_name ()
const gchar * | ibus_component_get_description ()
const gchar * | ibus_component_get_version ()
const gchar * | ibus_component_get_license ()
const gchar * | ibus_component_get_author ()
const gchar * | ibus_component_get_homepage ()
const gchar * | ibus_component_get_exec ()
const gchar * | ibus_component_get_textdomain ()
void | ibus_component_add_observed_path ()
void | ibus_component_add_engine ()
GList * | ibus_component_get_engines ()
void | ibus_component_output ()
void | ibus_component_output_engines ()
gboolean | ibus_component_check_modification ()
GList * | ibus_component_get_observed_paths ()

## Properties

char * | author | Read / Write / Construct Only
char * | command-line | Read / Write / Construct Only
char * | description | Read / Write / Construct Only
char * | homepage | Read / Write / Construct Only
char * | license | Read / Write / Construct Only
char * | name | Read / Write / Construct Only
char * | textdomain | Read / Write / Construct Only
char * | version | Read / Write / Construct Only

## Types and Values

struct | IBusComponent

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── IBusObject
                ╰── IBusSerializable
                    ╰── IBusComponent

## Description

An IBusComponent is an executable program. It provides services such as user interface, configuration, and input method engine (IME).

It is recommended that IME developers provide a component XML file and load the XML file by `ibus_component_new_from_file()`.

The format of a component XML file is described at

https://github.com/ibus/ibus/wiki/DevXML

## Functions

### ibus_component_new ()

    IBusComponent *
    ibus_component_new (const gchar *name,
                        const gchar *description,
                        const gchar *version,
                        const gchar *license,
                        const gchar *author,
                        const gchar *homepage,
                        const gchar *command_line,
                        const gchar *textdomain);

Creates a new IBusComponent.

#### Parameters

name | Name of the component. |
description | Detailed description of component. |
version | Component version. |
license | Distribution license of this component. |
author | Author(s) of the component. |
homepage | Homepage of the component. |
command_line | path to component executable. |
textdomain | Domain name for `dgettext()` |

#### Returns

A newly allocated IBusComponent.

### ibus_component_new_varargs ()

    IBusComponent *
    ibus_component_new_varargs (const gchar *first_property_name,
                                ...);

Creates a new IBusComponent. `ibus_component_new_varargs()` supports the va_list format. name property is required. e.g. IBusComponent *component = ibus_component_new_varargs ("name", "ibus-foo", "command_line", "/usr/libexec/ibus-engine-foo --ibus", NULL)

#### Parameters

first_property_name | Name of the first property. |
... | the NULL-terminated arguments of the properties and values. |

#### Returns

A newly allocated IBusComponent.

### ibus_component_new_from_xml_node ()

    IBusComponent *
    ibus_component_new_from_xml_node (XMLNode *node);

Creates a new IBusComponent from an XML tree.

#### Parameters

node | Root node of component XML tree. |

#### Returns

A newly allocated IBusComponent.

### ibus_component_new_from_file ()

    IBusComponent *
    ibus_component_new_from_file (const gchar *filename);

Creates a new IBusComponent from an XML file. Note that a component file usually contains engine descriptions, if it does, `ibus_engine_desc_new_from_xml_node()` will be called to load the engine descriptions.

#### Parameters

filename | An XML file that contains component information. |

#### Returns

A newly allocated IBusComponent.

### ibus_component_get_name ()

    const gchar *
    ibus_component_get_name (IBusComponent *component);

Gets the name property in IBusComponent. It should not be freed.

#### Parameters

component | An IBusComponent |

#### Returns

name property in IBusComponent

### ibus_component_get_description ()

    const gchar *
    ibus_component_get_description (IBusComponent *component);

Gets the description property in IBusComponent. It should not be freed.

#### Parameters

component | An IBusComponent |

#### Returns

description property in IBusComponent

### ibus_component_get_version ()

    const gchar *
    ibus_component_get_version (IBusComponent *component);

Gets the version property in IBusComponent. It should not be freed.

#### Parameters

component | An IBusComponent |

#### Returns

version property in IBusComponent

### ibus_component_get_license ()

    const gchar *
    ibus_component_get_license (IBusComponent *component);

Gets the license property in IBusComponent. It should not be freed.

#### Parameters

component | An IBusComponent |

#### Returns

license property in IBusComponent

### ibus_component_get_author ()

    const gchar *
    ibus_component_get_author (IBusComponent *component);

Gets the author property in IBusComponent. It should not be freed.

#### Parameters

component | An IBusComponent |

#### Returns

author property in IBusComponent

### ibus_component_get_homepage ()

    const gchar *
    ibus_component_get_homepage (IBusComponent *component);

Gets the homepage property in IBusComponent. It should not be freed.

#### Parameters

component | An IBusComponent |

#### Returns

homepage property in IBusComponent

### ibus_component_get_exec ()

    const gchar *
    ibus_component_get_exec (IBusComponent *component);

Gets the exec property in IBusComponent. It should not be freed.

#### Parameters

component | An IBusComponent |

#### Returns

exec property in IBusComponent

### ibus_component_get_textdomain ()

    const gchar *
    ibus_component_get_textdomain (IBusComponent *component);

Gets the textdomain property in IBusComponent. It should not be freed.

#### Parameters

component | An IBusComponent |

#### Returns

textdomain property in IBusComponent

### ibus_component_add_observed_path ()

    void
    ibus_component_add_observed_path (IBusComponent *component,
                                      const gchar *path,
                                      gboolean access_fs);

Add an observed path to IBusComponent.

#### Parameters

component | An IBusComponent |
path | Observed path to be added. |
access_fs | `TRUE` for filling the file status; `FALSE` otherwise. |

### ibus_component_add_engine ()

    void
    ibus_component_add_engine (IBusComponent *component,
                               IBusEngineDesc *engine);

Add an engine to IBusComponent according to the description in `engine` .

#### Parameters

component | An IBusComponent |
engine | A description of an engine. |

### ibus_component_get_engines ()

    GList *
    ibus_component_get_engines (IBusComponent *component);

Gets the engines of this component.

#### Parameters

component | An IBusComponent. |

#### Returns

A newly allocated GList that contains engines.

[transfer container][element-type IBusEngineDesc]

### ibus_component_output ()

    void
    ibus_component_output (IBusComponent *component,
                           GString *output,
                           gint indent);

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

#### Parameters

component | An IBusComponent. |
output | GString that holds the result. |
indent | level of indent. |

### ibus_component_output_engines ()

    void
    ibus_component_output_engines (IBusComponent *component,
                                   GString *output,
                                   gint indent);

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

#### Parameters

component | An IBusComponent. |
output | GString that holds the result. |
indent | level of indent. |

### ibus_component_check_modification ()

    gboolean
    ibus_component_check_modification (IBusComponent *component);

Check whether the observed paths of component is modified.

#### Parameters

component | An IBusComponent. |

#### Returns

`TRUE` if at least one of the observed paths is modified; `FALSE` otherwise.

### ibus_component_get_observed_paths ()

    GList *
    ibus_component_get_observed_paths (IBusComponent *component);

Gets the observed paths of this component.

#### Parameters

component | An IBusComponent. |

#### Returns

A newly allocated GList that contains observed paths.

[transfer container][element-type IBusObservedPath]

## Types and Values

### struct IBusComponent

    struct IBusComponent {
    };

An IBusComponent stores component information. You can get extended values with g_object_get_properties.

## Property Details

### The `“author”` property

      “author”                   char *

The author of component

Owner: IBusComponent

Flags: Read / Write / Construct Only

Default value: NULL

### The `“command-line”` property

      “command-line”             char *

The exec path of component

Owner: IBusComponent

Flags: Read / Write / Construct Only

Default value: NULL

### The `“description”` property

      “description”              char *

The description of component

Owner: IBusComponent

Flags: Read / Write / Construct Only

Default value: NULL

### The `“homepage”` property

      “homepage”                 char *

The homepage of component

Owner: IBusComponent

Flags: Read / Write / Construct Only

Default value: NULL

### The `“license”` property

      “license”                  char *

The license of component

Owner: IBusComponent

Flags: Read / Write / Construct Only

Default value: NULL

### The `“name”` property

      “name”                     char *

The name of component

Owner: IBusComponent

Flags: Read / Write / Construct Only

Default value: NULL

### The `“textdomain”` property

      “textdomain”               char *

The textdomain of component

Owner: IBusComponent

Flags: Read / Write / Construct Only

Default value: NULL

### The `“version”` property

      “version”                  char *

The version of component

Owner: IBusComponent

Flags: Read / Write / Construct Only

Default value: NULL