Commit Graph

77 Commits

Author SHA1 Message Date
Philipp Brüschweiler
70f83679ee editor: more intuitive cursor positioning
Compute the nearest glyph edge instead of taking the one to the
left of the cursor.

Also fixes a segfault when trying to compute the position for an empty
buffer.
2012-10-04 11:31:21 -04:00
Philipp Brüschweiler
9f897c7a5f editor: take text offset into account when computing cursor position 2012-10-04 11:31:19 -04:00
Philipp Brüschweiler
b8911dcdd7 editor: make selection a lighter shade of blue, much easier to read 2012-10-04 11:31:17 -04:00
Philipp Brüschweiler
237358be93 editor: fix assert to take preedit string into account 2012-10-04 11:31:14 -04:00
Jan Arne Petersen
680275fbf1 text: Rename de/activate to enter/leave
Also add a surface argument to the enter event.
2012-09-25 11:24:49 -04:00
Jan Arne Petersen
80ad1a943d editor: Fix selection anchor on text deletion
When text is deleted adjust selection anchor.
2012-09-25 11:24:49 -04:00
Jan Arne Petersen
e386dd22c4 editor: Delete selected text before adding new
When inserting new text, delete selected text first.
2012-09-25 11:24:49 -04:00
Jan Arne Petersen
8aba11d057 editor, keyboard: Add support for arrow keys
Add support for arrow keys on the virtual keyboard and make it possible
to move around the cursor in the editor example.
2012-09-25 11:24:49 -04:00
Jan Arne Petersen
c1e481efb1 text: Add reset requets to protocol
Add a reset request to the text_model interface and a reset event to the
input_method_context interface. Use it to reset the pre-edit buffers in
the example keyboard when the cursor is moved in the example editor
client.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:52:53 -04:00
Jan Arne Petersen
ce8a4433f5 text: Add support for control keys to the protocol
Add key event to the text_model interface and a key request to the
input_method_context interface. Implement it in the example editor
client and the example keyboard.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:52:41 -04:00
Jan Arne Petersen
e202bae9d3 text: Add delete_surrounding_text to protocol
Add delete_surrounding_text event in the text_model interface and the
request in the input_method_context interface. Implement it in the
example editor client and in the example keyboard so that the backspace
key works with it.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:51:08 -04:00
Jan Arne Petersen
43f4aa8cab text: Add support for pre-edit string
Add support of preedit-string to the example editor client. Also add a
preedit_string request to the input_method_context interface and use
that in the example weston keyboard to first create a pre-edit string
when entering keys and commit it on space.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:50:44 -04:00
Jan Arne Petersen
cb08f4d844 text: Fix set_surrounding_text request
Add cursor and anchor positions as arguments to the set_surrounding_text
request. The cursor and anchor positions are relative to the surrounded
text, so it does not make sense to have that separate. Remove the
separate set_cursor_index and set_selected_text requests. Also update
the corresponding event in input-method-context and add support for it
in the weston example keyboard.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:38:00 -04:00
Jan Arne Petersen
c1fbcb7c38 editor: Add support for setting a preedit
Add support for setting a preedit text to the editor example.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:36:04 -04:00
Jan Arne Petersen
0e5bd45100 editor: Add support for selection
Make it possible to select text and render the selection to the editor
example.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:35:56 -04:00
Jan Arne Petersen
09e7c96574 editor: Insert commit-string at cursor
Instead of appending at the end, insert the commit-string at the cursor
position.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:35:49 -04:00
Jan Arne Petersen
7e634a0ea7 editor: Add support for cursor
Add support for setting, moving and rendering a cursor.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:35:42 -04:00
Jan Arne Petersen
b9eb02c46f editor: Extract text handling into text_layout
Create a text_layout struct and functions for handling simple text
layouts.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:35:37 -04:00
Jan Arne Petersen
f80bc06a8e editor: Make text_entry a widget
Simplify the example client by making text_entry a widget.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:35:20 -04:00
Jan Arne Petersen
4c26518ad1 text: Remove surface arg in create_text_model
Remove the wl_surface argument from create_text_model request. The
wl_surface is specified as an argument in the activate request instead.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-09-12 16:28:04 -04:00
Jan Arne Petersen
e829adc514 text: Assign text_model to a wl_seat
Add a wl_seat argument to the activate and deactivate requests of
text_method.

On activation a text_model gets assigned to the input_method of the
wl_seat specified in the activate request.
2012-08-10 13:00:52 -04:00
Jan Arne Petersen
de3b6a15c0 text: Add activate/deactivate events
Let the client know when a text model gets activated or deactiavted.
2012-08-10 13:00:52 -04:00
Jan Arne Petersen
5196374218 text: Rename text_model_manager to factory
The text_model_manager interface is just used to create text_model
instances. It is more a factory than a manager so rename it to
text_model_factory.
2012-08-10 13:00:52 -04:00
Jan Arne Petersen
72f6082313 text: Add missing callbacks for text_model events
Add all required callbacks for the text_model_listener in the editor
example.
2012-08-10 13:00:52 -04:00
Philipp Brüschweiler
f25602bdc0 Extract the text_model_manager interface from input_method
This is necessary because all clients need a way to create
text_models, but only one client at a time can be bound to
the input_method global (else we don't know to whom we are
supposed to send events).
2012-07-22 12:06:10 -04:00
Philipp Brüschweiler
591cfca4e8 editor: deactivate old text model before activating the new one 2012-07-22 11:47:31 -04:00
Jan Arne Petersen
cba9e470ba text: Add example clients for text protocol 2012-06-21 16:41:12 -04:00