19
19
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
20
* Boston, MA 02111-1307, USA.
22
#ifndef __BUS_REGISTRY_H_
23
#define __BUS_REGISTRY_H_
26
#include "factoryproxy.h"
26
#include "component.h"
48
48
typedef struct _BusRegistry BusRegistry;
49
49
typedef struct _BusRegistryClass BusRegistryClass;
54
/* instance members */
55
GList *observed_paths;
58
GHashTable *engine_table;
59
GList *active_engines;
62
#ifdef G_THREADS_ENABLED
64
gboolean thread_running;
71
struct _BusRegistryClass {
72
IBusObjectClass parent;
77
51
GType bus_registry_get_type (void);
78
52
BusRegistry *bus_registry_new (void);
55
* bus_registry_get_components:
56
* @returns: a list of BusComponent objects. The caller has to call g_list_free for the returned list.
79
58
GList *bus_registry_get_components (BusRegistry *registry);
61
* bus_registry_get_components:
62
* @returns: a list of all IBusEngineDesc objects available. The caller has to call g_list_free for the returned list.
80
64
GList *bus_registry_get_engines (BusRegistry *registry);
67
* bus_registry_get_components:
68
* @language: a language name like 'ja'
69
* @returns: a list of IBusEngineDesc objects for the language. The caller has to call g_list_free for the returned list.
81
71
GList *bus_registry_get_engines_by_language
82
72
(BusRegistry *registry,
83
73
const gchar *language);
76
* bus_registry_stop_all_components:
78
* Terminate all component processes.
84
80
void bus_registry_stop_all_components
85
81
(BusRegistry *registry);
87
IBusComponent *bus_registry_lookup_component_by_name
84
* bus_registry_lookup_component_by_name:
85
* @name: a component name such as 'org.freedesktop.IBus.Panel' and 'com.google.IBus.Mozc'
86
* @returns: a BusComponent object, or NULL if such component is not found.
88
BusComponent *bus_registry_lookup_component_by_name
88
89
(BusRegistry *registry,
89
90
const gchar *name);
93
* bus_registry_find_engine_by_name:
94
* @name: an engine name like 'pinyin'
95
* @returns: an IBusEngineDesc object, or NULL if not found.
90
97
IBusEngineDesc *bus_registry_find_engine_by_name
91
98
(BusRegistry *registry,
92
99
const gchar *name);
93
BusFactoryProxy *bus_registry_name_owner_changed(BusRegistry *registry,
102
* bus_registry_name_owner_changed:
103
* @name: a unique or well-known name like ":1.1", "org.freedesktop.IBus.Config", "com.google.IBus.Mozc".
104
* @old_name: a unique name like ":1.1", or empty string "" when the client is started.
105
* @new_name: a unique name like ":1.1", or empty string "" when the client is stopped.
107
* Handle the "name-owner-changed" glib signal from dbusimpl. If a component is stopped, remove a BusFactoryProxy object from the
108
* bus for the component. If a component is started, create a new BusFactoryProxy object for the bus.
110
void bus_registry_name_owner_changed
111
(BusRegistry *registry,
94
112
const gchar *name,
95
113
const gchar *old_name,
96
114
const gchar *new_name);
97
116
#ifdef G_THREADS_ENABLED
98
117
void bus_registry_start_monitor_changes
99
118
(BusRegistry *registry);