};
struct editor {
- struct text_model_manager *text_model_manager;
+ struct text_model_factory *text_model_factory;
struct display *display;
struct window *window;
struct widget *widget;
entry->widget = editor->widget;
entry->text = strdup(text);
entry->active = 0;
- entry->model = text_model_manager_create_text_model(editor->text_model_manager, surface);
+ entry->model = text_model_factory_create_text_model(editor->text_model_factory, surface);
text_model_add_listener(entry->model, &text_model_listener, entry);
return entry;
{
struct editor *editor = data;
- if (!strcmp(interface, "text_model_manager")) {
- editor->text_model_manager = wl_display_bind(display, id,
- &text_model_manager_interface);
+ if (!strcmp(interface, "text_model_factory")) {
+ editor->text_model_factory = wl_display_bind(display, id,
+ &text_model_factory_interface);
+ } else if (!strcmp(interface, "wl_seat")) {
+ fprintf(stderr, "wl_seat added\n");
}
}
struct input_method {
struct wl_resource *input_method_binding;
struct wl_global *input_method_global;
- struct wl_global *text_model_manager_global;
+ struct wl_global *text_model_factory_global;
struct wl_listener destroy_listener;
struct weston_compositor *ec;
text_model_set_content_type
};
-static void text_model_manager_create_text_model(struct wl_client *client,
+static void text_model_factory_create_text_model(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *surface)
wl_list_insert(&input_method->models, &text_model->link);
};
-static const struct text_model_manager_interface text_model_manager_implementation = {
- text_model_manager_create_text_model
+static const struct text_model_factory_interface text_model_factory_implementation = {
+ text_model_factory_create_text_model
};
static void
-bind_text_model_manager(struct wl_client *client,
+bind_text_model_factory(struct wl_client *client,
void *data,
uint32_t version,
uint32_t id)
/* No checking for duplicate binding necessary.
* No events have to be sent, so we don't need the return value. */
- wl_client_add_object(client, &text_model_manager_interface,
- &text_model_manager_implementation,
+ wl_client_add_object(client, &text_model_factory_interface,
+ &text_model_factory_implementation,
id, input_method);
}
wl_display_remove_global(input_method->ec->wl_display,
input_method->input_method_global);
wl_display_remove_global(input_method->ec->wl_display,
- input_method->text_model_manager_global);
+ input_method->text_model_factory_global);
free(input_method);
}
&input_method_interface,
input_method, bind_input_method);
- input_method->text_model_manager_global =
+ input_method->text_model_factory_global =
wl_display_add_global(ec->wl_display,
- &text_model_manager_interface,
- input_method, bind_text_model_manager);
+ &text_model_factory_interface,
+ input_method, bind_text_model_factory);
input_method->destroy_listener.notify = input_method_notifier_destroy;
wl_signal_add(&ec->destroy_signal, &input_method->destroy_listener);