wl_list_remove(&shell->idle_listener.link);
wl_list_remove(&shell->wake_listener.link);
+ text_backend_destroy(shell->text_backend);
input_panel_destroy(shell);
wl_list_for_each_safe(shell_output, tmp, &shell->output_list, link) {
if (input_panel_setup(shell) < 0)
return -1;
- if (text_backend_init(ec) < 0)
+ shell->text_backend = text_backend_init(ec);
+ if (!shell->text_backend)
return -1;
shell_configuration(shell);
bool showing_input_panels;
bool prepare_event_sent;
+ struct text_backend *text_backend;
+
struct {
struct weston_surface *surface;
pixman_box32_t cursor_rectangle;
container_of(listener, struct ivi_shell, destroy_listener);
struct ivi_shell_surface *ivisurf, *next;
+ text_backend_destroy(shell->text_backend);
input_panel_destroy(shell);
wl_list_for_each_safe(ivisurf, next, &shell->ivi_surface_list, link) {
if (input_panel_setup(shell) < 0)
goto out_settings;
- if (text_backend_init(compositor) < 0)
+ shell->text_backend = text_backend_init(compositor);
+ if (!shell->text_backend)
goto out_settings;
if (wl_global_create(compositor->wl_display,
struct wl_list ivi_surface_list; /* struct ivi_shell_surface::link */
+ struct text_backend *text_backend;
+
struct wl_listener show_input_panel_listener;
struct wl_listener hide_input_panel_listener;
struct wl_listener update_input_panel_listener;
struct clipboard *
clipboard_create(struct weston_seat *seat);
-int
+struct text_backend;
+
+struct text_backend *
text_backend_init(struct weston_compositor *ec);
+void
+text_backend_destroy(struct text_backend *text_backend);
+
struct weston_process;
typedef void (*weston_process_cleanup_func_t)(struct weston_process *process,
int status);
} input_method;
struct wl_listener seat_created_listener;
- struct wl_listener destroy_listener;
};
static void
free(client);
}
-static void
-text_backend_notifier_destroy(struct wl_listener *listener, void *data)
+WL_EXPORT void
+text_backend_destroy(struct text_backend *text_backend)
{
- struct text_backend *text_backend =
- container_of(listener, struct text_backend, destroy_listener);
-
if (text_backend->input_method.client)
wl_client_destroy(text_backend->input_method.client);
free(text_backend->input_method.path);
-
free(text_backend);
}
-WL_EXPORT int
+WL_EXPORT struct text_backend *
text_backend_init(struct weston_compositor *ec)
{
struct text_backend *text_backend;
text_backend = zalloc(sizeof(*text_backend));
if (text_backend == NULL)
- return -1;
+ return NULL;
text_backend->compositor = ec;
wl_signal_add(&ec->seat_created_signal,
&text_backend->seat_created_listener);
- text_backend->destroy_listener.notify = text_backend_notifier_destroy;
- wl_signal_add(&ec->destroy_signal, &text_backend->destroy_listener);
-
text_input_manager_create(ec);
- return 0;
+ return text_backend;
}