"</node>";
static IBusEngine *
-_ibus_factory_create_engine (IBusFactory *factory,
- const gchar *engine_name)
+ibus_factory_real_create_engine (IBusFactory *factory,
+ const gchar *engine_name)
{
GType engine_type;
gchar *object_path = NULL;
IBUS_SERVICE_CLASS (class)->service_method_call = ibus_factory_service_method_call;
IBUS_SERVICE_CLASS (class)->service_get_property = ibus_factory_service_get_property;
IBUS_SERVICE_CLASS (class)->service_set_property = ibus_factory_service_set_property;
- class->create_engine = _ibus_factory_create_engine;
+ class->create_engine = ibus_factory_real_create_engine;
ibus_service_class_add_interfaces (IBUS_SERVICE_CLASS (class), introspection_xml);
* IBusFactory::create-engine:
* @factory: the factory which received the signal
* @engine_name: the engine_name which received the signal
- * @returns: (transfer none): An IBusEngine
+ * @returns: (transfer full): An IBusEngine
*
* The ::create-engine signal is a signal to create IBusEngine
* with @engine_name, which gets emitted when IBusFactory
* received CreateEngine dbus method. The callback functions
* will be called until a callback returns a non-null object
- * of IBusEngine. */
+ * of IBusEngine.
+ */
factory_signals[CREATE_ENGINE] =
g_signal_new (I_("create-engine"),
G_TYPE_FROM_CLASS (gobject_class),
GList *list;
list = g_list_copy (factory->priv->engine_list);
- g_list_foreach (list, (GFunc) ibus_object_destroy, NULL);
- g_list_free (factory->priv->engine_list);
- g_list_free (list);
+ g_list_free_full (list, (GDestroyNotify)ibus_object_destroy);
+ g_list_free(factory->priv->engine_list);
factory->priv->engine_list = NULL;
if (factory->priv->engine_table) {
{
g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
- IBusEngine *object = g_object_new (IBUS_TYPE_FACTORY,
- "object-path", IBUS_PATH_FACTORY,
- "connection", connection,
- NULL);
+ IBusFactory *object = g_object_new (IBUS_TYPE_FACTORY,
+ "object-path", IBUS_PATH_FACTORY,
+ "connection", connection,
+ NULL);
return IBUS_FACTORY (object);
}
g_hash_table_insert (factory->priv->engine_table, g_strdup (engine_name), (gpointer) engine_type);
}
+
+IBusEngine *
+ibus_factory_create_engine (IBusFactory *factory,
+ const gchar *engine_name)
+{
+ IBusEngine *engine = NULL;
+
+ g_assert (engine_name != NULL);
+
+ g_signal_emit (factory, factory_signals[CREATE_ENGINE],
+ 0, engine_name, &engine);
+
+ return engine;
+}