Commit Graph

103 Commits

Author SHA1 Message Date
Jan Arne Petersen 78d00e45cc text: Rename text_model to text_input
Also rename text_model_factory to text_input_manager.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:23:35 -04:00
Jan Arne Petersen 7ef8effca5 text: Order requests and events in a nice way
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:23:14 -04:00
Jan Arne Petersen fa3573852d text: rename text_model::commit to commit_state
Use ::commit_state as a request name to make clear what is commited.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:22:36 -04:00
Jan Arne Petersen 08015b6ba0 editor: Reset text model on reset
There were some reset calls missing, which resulted in wrong preedit
state on input method side.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:21:59 -04:00
Jan Arne Petersen 9d41913eff text: Add example for language/text direction
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:21:34 -04:00
Jan Arne Petersen ece6b5af51 text: Add language and text-direction to protocol
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-05-02 16:21:18 -04:00
Kristian Høgsberg 4172f668e7 Pass argc pointer to parse_options()
This lets us keep argc up to date as the backend picks out arguments
from the argv array.
2013-02-20 15:27:49 -05:00
Jan Arne Petersen 1cc9e08d2f text: Split out cursor_position
Add an extra cursor_position, which also allows to change the anchor
(for slections). Change the index type to int to allow setting it before
the beginning of a commited string.

The cursor should not be moved as a direct repsonse to this event but
atomically on the next commit_string event.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:08:01 -05:00
Jan Arne Petersen 6138197337 text: Add show/hide_input_panel requests
Allows to show/hide the input panel (virtual keyboard) more independent
of focus (some applications might to require additionaly click on a
focused entry to show the input panel).

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:07:35 -05:00
Jan Arne Petersen 0eabcaafae text: Add commit request
Allows for atomic state changes. Updated surrounding text, content type
and micro focus is taken into account all at once at commit.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:07:03 -05:00
Jan Arne Petersen f255165bd4 text: Remove unused requests/events
Put them back in, when we know what arguments they will have.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:06:48 -05:00
Jan Arne Petersen 3fb6e71814 editor: Add support for backspace keysym events
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:02:48 -05:00
Jan Arne Petersen 3489ba9c21 editor: add support for invoke_action
Call invoke_action request when a currently composed word is clicked.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:00:54 -05:00
Jan Arne Petersen 0558a93eee editor: Add content type example
Set the content type purpose to numeric of the second entry.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 17:00:29 -05:00
Jan Arne Petersen 0a1cf393c6 editor: add support for pre-edit styling
Add pango dependency to the example and use pango for text handling.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 16:57:37 -05:00
Jan Arne Petersen 4a17fae8e7 editor: support commit on reset
Commit pending pre-edit text when focus-out or changing the cursor
location.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 16:55:47 -05:00
Jan Arne Petersen c7d2a9839b text: add serial argument to text protocol
The serial argument will allow to ignore outdated events from before a
reset request.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 16:55:37 -05:00
Jan Arne Petersen 4653531e7a text: add pre-edit styling support to protocol
Also add a separate preedit-cursor event and add a commit argument to
preedit-string to allow to support commit on reset. Fix editor and
keyboard example to adapt to the protocol changes.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-02-15 16:55:27 -05:00
Rob Bradford 9d1d32bdd0 editor: Add support for editing text using the keyboard
This simple change allows you to drive the editor using the keyboard
(supporting backspace and delete and left and right arrow keys.) The idea
behind this change is to allow the testing of the interoperation between a
virtual keyboard and real one.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-27 13:19:38 -05:00
Jan Arne Petersen cd99706b61 text: Send more information with keysym events
Send state and modifier from the demo keyboard with the keysym event and
take them into account in the editor example.

Add some helper functions to write and read a modifiers_map array.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-27 13:06:21 -05:00
Jan Arne Petersen d9be93b964 text: Rename and extend text_model key event
Rename the key event in text_model to keysym and add serial, time and
modifiers arguments. Add a modifiers_map event to transfer an array of
0-terminated modifier names, so that a mapping of modifiers to the
modifier bit mask is possible.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-27 13:02:26 -05:00
Jan Arne Petersen 8083e019cd editor: Remove preedit text on startup
There should not be preedit text when a text entry does not have focus.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-08 14:26:43 -05:00
Jan Arne Petersen 25f6db51f0 editor: Initalize editor struct with 0
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-08 14:26:30 -05:00
Jan Arne Petersen 6345faa39a editor: Fix handling of UTF-8 text
Fix display, cursor movement and text deletion for UTF-8 text.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-08 14:26:21 -05:00
John Kåre Alsaker 011a1ce350 Remove some dead code. 2012-10-16 11:29:10 -04:00
Kristian Høgsberg fa80e11c84 Update to new fd and wl_registry APIs
This commit updates the clients and the wayland compositor backend to
use the new wl_registry mechanism and the thread safe fd API.
2012-10-10 21:34:38 -04:00
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