<interface name="wl_input_method_context" version="1">
<description summary="input method context">
- Corresponds to a text model on input method side. An input method context
- is created on text model activation on the input method side. It allows to
- receive information about the text model from the application via events.
+ Corresponds to a text input on input method side. An input method context
+ is created on text input activation on the input method side. It allows to
+ receive information about the text input from the application via events.
Input method contexts do not keep state after deactivation and should be
destroyed after deactivation is handled.
An input method object is responsible to compose text in response to
input from hardware or virtual keyboards. There is one input method
object per seat. On activate there is a new input method context object
- created which allows the input method to communicate with the text model.
+ created which allows the input method to communicate with the text input.
</description>
<event name="activate">
<description summary="activate event">
- A text model was activated. Creates an input method context object
- which allows communication with the text model.
+ A text input was activated. Creates an input method context object
+ which allows communication with the text input.
</description>
<arg name="id" type="new_id" interface="wl_input_method_context"/>
</event>
<event name="deactivate">
<description summary="deactivate event">
- The text model corresponding to the context argument was deactivated.
+ The text input corresponding to the context argument was deactivated.
The input method context should be destroyed after deactivation is
handled.
</description>
<request name="set_toplevel">
<description summary="set the surface type as a keyboard">
- A keyboard surface is only shown, when a text model is active
+ A keyboard surface is only shown when a text input is active.
</description>
<arg name="output" type="object" interface="wl_output"/>
<arg name="position" type="uint"/>
<request name="set_overlay_panel">
<description summary="set the surface type as an overlay panel">
An overlay panel is shown near the input cursor above the application
- window when a text model is active.
+ window when a text input is active.
</description>
</request>
</interface>
struct wl_listener destroy_listener;
struct weston_seat *seat;
- struct text_input *model;
+ struct text_input *input;
struct wl_list link;
struct input_method_context {
struct wl_resource *resource;
- struct text_input *model;
+ struct text_input *input;
struct input_method *input_method;
struct wl_resource *keyboard;
};
static void
-input_method_context_create(struct text_input *model,
+input_method_context_create(struct text_input *input,
struct input_method *input_method);
static void
input_method_context_end_keyboard_grab(struct input_method_context *context);
static void
deactivate_input_method(struct input_method *input_method)
{
- struct text_input *text_input = input_method->model;
+ struct text_input *text_input = input_method->input;
struct weston_compositor *ec = text_input->ec;
if (input_method->context && input_method->input_method_binding) {
}
wl_list_remove(&input_method->link);
- input_method->model = NULL;
+ input_method->input = NULL;
input_method->context = NULL;
if (wl_list_empty(&text_input->input_methods) &&
struct weston_compositor *ec = text_input->ec;
struct text_input *current;
- if (input_method->model == text_input)
+ if (input_method->input == text_input)
return;
- if (input_method->model)
+ if (input_method->input)
deactivate_input_method(input_method);
- input_method->model = text_input;
+ input_method->input = text_input;
wl_list_insert(&text_input->input_methods, &input_method->link);
input_method_init_seat(weston_seat);
{
struct weston_seat *weston_seat = wl_resource_get_user_data(seat);
- if (weston_seat->input_method->model)
+ if (weston_seat->input_method->input)
deactivate_input_method(weston_seat->input_method);
}
struct input_method_context *context =
wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_commit_string(context->model->resource,
+ if (context->input)
+ wl_text_input_send_commit_string(context->input->resource,
serial, text);
}
struct input_method_context *context =
wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_preedit_string(context->model->resource,
+ if (context->input)
+ wl_text_input_send_preedit_string(context->input->resource,
serial, text, commit);
}
struct input_method_context *context =
wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_preedit_styling(context->model->resource,
+ if (context->input)
+ wl_text_input_send_preedit_styling(context->input->resource,
index, length, style);
}
struct input_method_context *context =
wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_preedit_cursor(context->model->resource,
+ if (context->input)
+ wl_text_input_send_preedit_cursor(context->input->resource,
cursor);
}
struct input_method_context *context =
wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_delete_surrounding_text(context->model->resource,
+ if (context->input)
+ wl_text_input_send_delete_surrounding_text(context->input->resource,
index, length);
}
struct input_method_context *context =
wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_cursor_position(context->model->resource,
+ if (context->input)
+ wl_text_input_send_cursor_position(context->input->resource,
index, anchor);
}
struct input_method_context *context =
wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_modifiers_map(context->model->resource, map);
+ if (context->input)
+ wl_text_input_send_modifiers_map(context->input->resource, map);
}
static void
struct input_method_context *context =
wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_keysym(context->model->resource,
+ if (context->input)
+ wl_text_input_send_keysym(context->input->resource,
serial, time, sym, state, modifiers);
}
{
struct input_method_context *context = wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_language(context->model->resource,
+ if (context->input)
+ wl_text_input_send_language(context->input->resource,
serial, language);
}
{
struct input_method_context *context = wl_resource_get_user_data(resource);
- if (context->model)
- wl_text_input_send_text_direction(context->model->resource,
+ if (context->input)
+ wl_text_input_send_text_direction(context->input->resource,
serial, direction);
}
}
static void
-input_method_context_create(struct text_input *model,
+input_method_context_create(struct text_input *input,
struct input_method *input_method)
{
struct input_method_context *context;
&input_method_context_implementation,
context, destroy_input_method_context);
- context->model = model;
+ context->input = input;
context->input_method = input_method;
input_method->context = context;
struct input_method *input_method =
container_of(listener, struct input_method, destroy_listener);
- if (input_method->model)
+ if (input_method->input)
deactivate_input_method(input_method);
wl_global_destroy(input_method->input_method_global);
container_of(listener, struct input_method, keyboard_focus_listener);
struct weston_surface *surface = keyboard->focus;
- if (!input_method->model)
+ if (!input_method->input)
return;
- if (!surface || input_method->model->surface != surface)
+ if (!surface || input_method->input->surface != surface)
deactivate_input_method(input_method);
}
return;
input_method->seat = seat;
- input_method->model = NULL;
+ input_method->input = NULL;
input_method->focus_listener_initialized = 0;
input_method->context = NULL;
input_method->text_backend = text_backend;