[PATCH v2 22/28] text: Rename text_input to wl_text_input

Jan Arne Petersen jpetersen at openismus.com
Thu Apr 18 07:47:36 PDT 2013


From: Jan Arne Petersen <jpetersen at openismus.com>

Signed-off-by: Jan Arne Petersen <jpetersen at openismus.com>
---
 clients/editor.c   | 118 ++++++++++++++++++++++++++---------------------------
 clients/keyboard.c |  10 ++---
 protocol/text.xml  |   8 ++--
 src/control.c      |   2 +-
 src/text-backend.c |  34 +++++++--------
 tests/text-test.c  |  50 +++++++++++------------
 6 files changed, 111 insertions(+), 111 deletions(-)

diff --git a/clients/editor.c b/clients/editor.c
index 56205af..f6e6084 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -59,7 +59,7 @@ struct text_entry {
 		uint32_t delete_index;
 		uint32_t delete_length;
 	} pending_commit;
-	struct text_input *text_input;
+	struct wl_text_input *text_input;
 	PangoLayout *layout;
 	struct {
 		xkb_mod_mask_t shift_mask;
@@ -72,7 +72,7 @@ struct text_entry {
 };
 
 struct editor {
-	struct text_input_manager *text_input_manager;
+	struct wl_text_input_manager *text_input_manager;
 	struct display *display;
 	struct window *window;
 	struct widget *widget;
@@ -135,7 +135,7 @@ static void text_entry_update(struct text_entry *entry);
 
 static void
 text_input_commit_string(void *data,
-			 struct text_input *text_input,
+			 struct wl_text_input *text_input,
 			 uint32_t serial,
 			 const char *text)
 {
@@ -168,7 +168,7 @@ text_input_commit_string(void *data,
 
 static void
 text_input_preedit_string(void *data,
-			  struct text_input *text_input,
+			  struct wl_text_input *text_input,
 			  uint32_t serial,
 			  const char *text,
 			  const char *commit)
@@ -184,13 +184,13 @@ text_input_preedit_string(void *data,
 	entry->preedit_info.attr_list = NULL;
 
 	text_entry_update(entry);
-	
+
 	widget_schedule_redraw(entry->widget);
 }
 
 static void
 text_input_delete_surrounding_text(void *data,
-				   struct text_input *text_input,
+				   struct wl_text_input *text_input,
 				   int32_t index,
 				   uint32_t length)
 {
@@ -217,7 +217,7 @@ text_input_delete_surrounding_text(void *data,
 
 static void
 text_input_cursor_position(void *data,
-			   struct text_input *text_input,
+			   struct wl_text_input *text_input,
 			   int32_t index,
 			   int32_t anchor)
 {
@@ -229,7 +229,7 @@ text_input_cursor_position(void *data,
 
 static void
 text_input_preedit_styling(void *data,
-			   struct text_input *text_input,
+			   struct wl_text_input *text_input,
 			   uint32_t index,
 			   uint32_t length,
 			   uint32_t style)
@@ -242,24 +242,24 @@ text_input_preedit_styling(void *data,
 		entry->preedit_info.attr_list = pango_attr_list_new();
 
 	switch (style) {
-		case TEXT_INPUT_PREEDIT_STYLE_DEFAULT:
-		case TEXT_INPUT_PREEDIT_STYLE_UNDERLINE:
+		case WL_TEXT_INPUT_PREEDIT_STYLE_DEFAULT:
+		case WL_TEXT_INPUT_PREEDIT_STYLE_UNDERLINE:
 			attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
 			break;
-		case TEXT_INPUT_PREEDIT_STYLE_INCORRECT:
+		case WL_TEXT_INPUT_PREEDIT_STYLE_INCORRECT:
 			attr1 = pango_attr_underline_new(PANGO_UNDERLINE_ERROR);
 			attr2 = pango_attr_underline_color_new(65535, 0, 0);
 			break;
-		case TEXT_INPUT_PREEDIT_STYLE_SELECTION:
+		case WL_TEXT_INPUT_PREEDIT_STYLE_SELECTION:
 			attr1 = pango_attr_background_new(0.3 * 65535, 0.3 * 65535, 65535);
 			attr2 = pango_attr_foreground_new(65535, 65535, 65535);
 			break;
-		case TEXT_INPUT_PREEDIT_STYLE_HIGHLIGHT:
-		case TEXT_INPUT_PREEDIT_STYLE_ACTIVE:
+		case WL_TEXT_INPUT_PREEDIT_STYLE_HIGHLIGHT:
+		case WL_TEXT_INPUT_PREEDIT_STYLE_ACTIVE:
 			attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
 			attr2 = pango_attr_weight_new(PANGO_WEIGHT_BOLD);
 			break;
-		case TEXT_INPUT_PREEDIT_STYLE_INACTIVE:
+		case WL_TEXT_INPUT_PREEDIT_STYLE_INACTIVE:
 			attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
 			attr2 = pango_attr_foreground_new(0.3 * 65535, 0.3 * 65535, 0.3 * 65535);
 			break;
@@ -280,7 +280,7 @@ text_input_preedit_styling(void *data,
 
 static void
 text_input_preedit_cursor(void *data,
-			  struct text_input *text_input,
+			  struct wl_text_input *text_input,
 			  int32_t index)
 {
 	struct text_entry *entry = data;
@@ -290,7 +290,7 @@ text_input_preedit_cursor(void *data,
 
 static void
 text_input_modifiers_map(void *data,
-			 struct text_input *text_input,
+			 struct wl_text_input *text_input,
 			 struct wl_array *map)
 {
 	struct text_entry *entry = data;
@@ -300,7 +300,7 @@ text_input_modifiers_map(void *data,
 
 static void
 text_input_keysym(void *data,
-		  struct text_input *text_input,
+		  struct wl_text_input *text_input,
 		  uint32_t serial,
 		  uint32_t time,
 		  uint32_t key,
@@ -372,7 +372,7 @@ text_input_keysym(void *data,
 
 static void
 text_input_enter(void *data,
-		 struct text_input *text_input,
+		 struct wl_text_input *text_input,
 		 struct wl_surface *surface)
 {
 	struct text_entry *entry = data;
@@ -390,7 +390,7 @@ text_input_enter(void *data,
 
 static void
 text_input_leave(void *data,
-		 struct text_input *text_input)
+		 struct wl_text_input *text_input)
 {
 	struct text_entry *entry = data;
 
@@ -398,21 +398,21 @@ text_input_leave(void *data,
 
 	entry->active = 0;
 
-	text_input_hide_input_panel(text_input);
+	wl_text_input_hide_input_panel(text_input);
 
 	widget_schedule_redraw(entry->widget);
 }
 
 static void
 text_input_input_panel_state(void *data,
-			     struct text_input *text_input,
+			     struct wl_text_input *text_input,
 			     uint32_t state)
 {
 }
 
 static void
 text_input_language(void *data,
-		    struct text_input *text_input,
+		    struct wl_text_input *text_input,
 		    uint32_t serial,
 		    const char *language)
 {
@@ -421,7 +421,7 @@ text_input_language(void *data,
 
 static void
 text_input_text_direction(void *data,
-			  struct text_input *text_input,
+			  struct wl_text_input *text_input,
 			  uint32_t serial,
 			  uint32_t direction)
 {
@@ -431,21 +431,21 @@ text_input_text_direction(void *data,
 
 
 	switch (direction) {
-		case TEXT_INPUT_TEXT_DIRECTION_LTR:
+		case WL_TEXT_INPUT_TEXT_DIRECTION_LTR:
 			pango_direction = PANGO_DIRECTION_LTR;
 			break;
-		case TEXT_INPUT_TEXT_DIRECTION_RTL:
+		case WL_TEXT_INPUT_TEXT_DIRECTION_RTL:
 			pango_direction = PANGO_DIRECTION_RTL;
 			break;
-		case TEXT_INPUT_TEXT_DIRECTION_AUTO:
+		case WL_TEXT_INPUT_TEXT_DIRECTION_AUTO:
 		default:
 			pango_direction = PANGO_DIRECTION_NEUTRAL;
 	}
-	
+
 	pango_context_set_base_dir(context, pango_direction);
 }
 
-static const struct text_input_listener text_input_listener = {
+static const struct wl_text_input_listener text_input_listener = {
 	text_input_enter,
 	text_input_leave,
 	text_input_modifiers_map,
@@ -474,8 +474,8 @@ text_entry_create(struct editor *editor, const char *text)
 	entry->active = 0;
 	entry->cursor = strlen(text);
 	entry->anchor = entry->cursor;
-	entry->text_input = text_input_manager_create_text_input(editor->text_input_manager);
-	text_input_add_listener(entry->text_input, &text_input_listener, entry);
+	entry->text_input = wl_text_input_manager_create_text_input(editor->text_input_manager);
+	wl_text_input_add_listener(entry->text_input, &text_input_listener, entry);
 
 	widget_set_redraw_handler(entry->widget, text_entry_redraw_handler);
 	widget_set_button_handler(entry->widget, text_entry_button_handler);
@@ -487,7 +487,7 @@ static void
 text_entry_destroy(struct text_entry *entry)
 {
 	widget_destroy(entry->widget);
-	text_input_destroy(entry->text_input);
+	wl_text_input_destroy(entry->text_input);
 	g_clear_object(&entry->layout);
 	free(entry->text);
 	free(entry);
@@ -555,25 +555,25 @@ text_entry_activate(struct text_entry *entry,
 	struct wl_surface *surface = window_get_wl_surface(entry->window);
 
 	if (entry->click_to_show && entry->active) {
-		text_input_show_input_panel(entry->text_input);
+		wl_text_input_show_input_panel(entry->text_input);
 
 		return;
 	}
 
 	if (!entry->click_to_show)
-		text_input_show_input_panel(entry->text_input);
+		wl_text_input_show_input_panel(entry->text_input);
 
-	text_input_activate(entry->text_input,
-			    seat,
-			    surface);
+	wl_text_input_activate(entry->text_input,
+			       seat,
+			       surface);
 }
 
 static void
 text_entry_deactivate(struct text_entry *entry,
 		      struct wl_seat *seat)
 {
-	text_input_deactivate(entry->text_input,
-			      seat);
+	wl_text_input_deactivate(entry->text_input,
+				 seat);
 }
 
 static void
@@ -582,7 +582,7 @@ text_entry_update_layout(struct text_entry *entry)
 	char *text;
 	PangoAttrList *attr_list;
 
-	assert(((unsigned int)entry->cursor) <= strlen(entry->text) +
+	assert((entry->cursor) <= strlen(entry->text) +
 	       (entry->preedit.text ? strlen(entry->preedit.text) : 0));
 
 	if (entry->preedit.text) {
@@ -644,24 +644,24 @@ text_entry_update(struct text_entry *entry)
 {
 	struct rectangle cursor_rectangle;
 
-	text_input_set_content_type(entry->text_input,
-				    TEXT_INPUT_CONTENT_HINT_NONE,
-				    entry->content_purpose);
+	wl_text_input_set_content_type(entry->text_input,
+				       WL_TEXT_INPUT_CONTENT_HINT_NONE,
+				       entry->content_purpose);
 
-	text_input_set_surrounding_text(entry->text_input,
-					entry->text,
-					entry->cursor,
-					entry->anchor);
+	wl_text_input_set_surrounding_text(entry->text_input,
+					   entry->text,
+					   entry->cursor,
+					   entry->anchor);
 
 	if (entry->preferred_language)
-		text_input_set_preferred_language(entry->text_input,
-						  entry->preferred_language);
+		wl_text_input_set_preferred_language(entry->text_input,
+						     entry->preferred_language);
 
 	text_entry_get_cursor_rectangle(entry, &cursor_rectangle);
-	text_input_set_cursor_rectangle(entry->text_input, cursor_rectangle.x, cursor_rectangle.y,
-					cursor_rectangle.width, cursor_rectangle.height);
+	wl_text_input_set_cursor_rectangle(entry->text_input, cursor_rectangle.x, cursor_rectangle.y,
+					   cursor_rectangle.width, cursor_rectangle.height);
 
-	text_input_commit_state(entry->text_input, ++entry->serial);
+	wl_text_input_commit_state(entry->text_input, ++entry->serial);
 }
 
 static void
@@ -722,7 +722,7 @@ text_entry_commit_and_reset(struct text_entry *entry)
 		free(commit);
 	}
 
-	text_input_reset(entry->text_input);
+	wl_text_input_reset(entry->text_input);
 	text_entry_update(entry);
 	entry->reset_serial = entry->serial;
 }
@@ -768,9 +768,9 @@ text_entry_try_invoke_preedit_action(struct text_entry *entry,
 	}
 
 	if (state == WL_POINTER_BUTTON_STATE_RELEASED)
-		text_input_invoke_action(entry->text_input,
-					 button,
-					 cursor - entry->cursor);
+		wl_text_input_invoke_action(entry->text_input,
+					    button,
+					    cursor - entry->cursor);
 
 	return 1;
 }
@@ -1123,10 +1123,10 @@ global_handler(struct display *display, uint32_t name,
 {
 	struct editor *editor = data;
 
-	if (!strcmp(interface, "text_input_manager")) {
+	if (!strcmp(interface, "wl_text_input_manager")) {
 		editor->text_input_manager =
 			display_bind(display, name,
-				     &text_input_manager_interface, 1);
+				     &wl_text_input_manager_interface, 1);
 	}
 }
 
@@ -1172,7 +1172,7 @@ main(int argc, char *argv[])
 	if (preferred_language)
 		editor.entry->preferred_language = strdup(preferred_language);
 	editor.editor = text_entry_create(&editor, "Numeric");
-	editor.editor->content_purpose = TEXT_INPUT_CONTENT_PURPOSE_NUMBER;
+	editor.editor->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER;
 	editor.editor->click_to_show = click_to_show;
 
 	window_set_title(editor.window, "Text Editor");
diff --git a/clients/keyboard.c b/clients/keyboard.c
index 4fc8e73..6c5ddd7 100644
--- a/clients/keyboard.c
+++ b/clients/keyboard.c
@@ -212,7 +212,7 @@ static const struct layout normal_layout = {
 	12,
 	4,
 	"en",
-	TEXT_INPUT_TEXT_DIRECTION_LTR
+	WL_TEXT_INPUT_TEXT_DIRECTION_LTR
 };
 
 static const struct layout numeric_layout = {
@@ -221,7 +221,7 @@ static const struct layout numeric_layout = {
 	12,
 	2,
 	"en",
-	TEXT_INPUT_TEXT_DIRECTION_LTR
+	WL_TEXT_INPUT_TEXT_DIRECTION_LTR
 };
 
 static const struct layout arabic_layout = {
@@ -230,7 +230,7 @@ static const struct layout arabic_layout = {
 	13,
 	4,
 	"ar",
-	TEXT_INPUT_TEXT_DIRECTION_RTL
+	WL_TEXT_INPUT_TEXT_DIRECTION_RTL
 };
 
 static const char *style_labels[] = {
@@ -315,8 +315,8 @@ static const struct layout *
 get_current_layout(struct virtual_keyboard *keyboard)
 {
 	switch (keyboard->content_purpose) {
-		case TEXT_INPUT_CONTENT_PURPOSE_DIGITS:
-		case TEXT_INPUT_CONTENT_PURPOSE_NUMBER:
+		case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS:
+		case WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER:
 			return &numeric_layout;
 		default:
 			if (keyboard->preferred_language &&
diff --git a/protocol/text.xml b/protocol/text.xml
index 58a6ab5..508c315 100644
--- a/protocol/text.xml
+++ b/protocol/text.xml
@@ -26,11 +26,11 @@
     THIS SOFTWARE.
   </copyright>
 
-  <interface name="text_input" version="1">
+  <interface name="wl_text_input" version="1">
     <description summary="text input">
       An object used for text input. Adds support for text input and input 
       methods to applications. A text-input object is created from a
-      text_input_manager and corresponds typically to a text entry in an
+      wl_text_input_manager and corresponds typically to a text entry in an
       application.
       Requests are used to activate/deactivate the text-input object and set
       state information like surrounding and selected text or the content type.
@@ -318,7 +318,7 @@
     </event>
   </interface>
 
-  <interface name="text_input_manager" version="1">
+  <interface name="wl_text_input_manager" version="1">
     <description summary="text input manager">
       A factory for text-input objects. This object is a global singleton.
     </description>
@@ -326,7 +326,7 @@
       <description summary="create text input">
         Creates a new text-input object.
       </description>
-      <arg name="id" type="new_id" interface="text_input"/>
+      <arg name="id" type="new_id" interface="wl_text_input"/>
     </request>
   </interface>
 </protocol>
diff --git a/src/control.c b/src/control.c
index fe8c495..adbdaa9 100644
--- a/src/control.c
+++ b/src/control.c
@@ -48,7 +48,7 @@ set_input_method(struct wl_client *client,
 {
 	struct control *control = resource->data;
 
-	wl_signal_emit(&control->compositor->set_input_method_signal, path);
+	wl_signal_emit(&control->compositor->set_input_method_signal, (void *)path);
 }
 
 static const struct weston_control_interface control_implementation = {
diff --git a/src/text-backend.c b/src/text-backend.c
index e965a0d..3464c8b 100644
--- a/src/text-backend.c
+++ b/src/text-backend.c
@@ -127,7 +127,7 @@ deactivate_text_input(struct text_input *text_input,
 		input_method->model = NULL;
 		input_method->context = NULL;
 		wl_signal_emit(&ec->hide_input_panel_signal, ec);
-		text_input_send_leave(&text_input->resource);
+		wl_text_input_send_leave(&text_input->resource);
 	}
 }
 
@@ -197,7 +197,7 @@ text_input_activate(struct wl_client *client,
 		wl_signal_emit(&ec->update_input_panel_signal, &text_input->cursor_rectangle);
 	}
 
-	text_input_send_enter(&text_input->resource, &text_input->surface->resource);
+	wl_text_input_send_enter(&text_input->resource, &text_input->surface->resource);
 }
 
 static void
@@ -336,7 +336,7 @@ text_input_set_preferred_language(struct wl_client *client,
 	}
 }
 
-static const struct text_input_interface text_input_implementation = {
+static const struct wl_text_input_interface text_input_implementation = {
 	text_input_activate,
 	text_input_deactivate,
 	text_input_show_input_panel,
@@ -360,7 +360,7 @@ static void text_input_manager_create_text_input(struct wl_client *client,
 	text_input = calloc(1, sizeof *text_input);
 
 	text_input->resource.object.id = id;
-	text_input->resource.object.interface = &text_input_interface;
+	text_input->resource.object.interface = &wl_text_input_interface;
 	text_input->resource.object.implementation =
 		(void (**)(void)) &text_input_implementation;
 
@@ -374,7 +374,7 @@ static void text_input_manager_create_text_input(struct wl_client *client,
 	wl_client_add_resource(client, &text_input->resource);
 };
 
-static const struct text_input_manager_interface text_input_manager_implementation = {
+static const struct wl_text_input_manager_interface text_input_manager_implementation = {
 	text_input_manager_create_text_input
 };
 
@@ -388,7 +388,7 @@ bind_text_input_manager(struct wl_client *client,
 
 	/* 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_input_manager_interface,
+	wl_client_add_object(client, &wl_text_input_manager_interface,
 			     &text_input_manager_implementation,
 			     id, text_input_manager);
 }
@@ -416,7 +416,7 @@ text_input_manager_create(struct weston_compositor *ec)
 
 	text_input_manager->text_input_manager_global =
 		wl_display_add_global(ec->wl_display,
-				      &text_input_manager_interface,
+				      &wl_text_input_manager_interface,
 				      text_input_manager, bind_text_input_manager);
 
 	text_input_manager->destroy_listener.notify = text_input_manager_notifier_destroy;
@@ -438,7 +438,7 @@ input_method_context_commit_string(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_commit_string(&context->model->resource, serial, text);
+	wl_text_input_send_commit_string(&context->model->resource, serial, text);
 }
 
 static void
@@ -450,7 +450,7 @@ input_method_context_preedit_string(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_preedit_string(&context->model->resource, serial, text, commit);
+	wl_text_input_send_preedit_string(&context->model->resource, serial, text, commit);
 }
 
 static void
@@ -462,7 +462,7 @@ input_method_context_preedit_styling(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_preedit_styling(&context->model->resource, index, length, style);
+	wl_text_input_send_preedit_styling(&context->model->resource, index, length, style);
 }
 
 static void
@@ -472,7 +472,7 @@ input_method_context_preedit_cursor(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_preedit_cursor(&context->model->resource, cursor);
+	wl_text_input_send_preedit_cursor(&context->model->resource, cursor);
 }
 
 static void
@@ -483,7 +483,7 @@ input_method_context_delete_surrounding_text(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_delete_surrounding_text(&context->model->resource, index, length);
+	wl_text_input_send_delete_surrounding_text(&context->model->resource, index, length);
 }
 
 static void
@@ -494,7 +494,7 @@ input_method_context_cursor_position(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_cursor_position(&context->model->resource, index, anchor);
+	wl_text_input_send_cursor_position(&context->model->resource, index, anchor);
 }
 
 static void
@@ -504,7 +504,7 @@ input_method_context_modifiers_map(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_modifiers_map(&context->model->resource, map);
+	wl_text_input_send_modifiers_map(&context->model->resource, map);
 }
 
 static void
@@ -518,7 +518,7 @@ input_method_context_keysym(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_keysym(&context->model->resource, serial, time,
+	wl_text_input_send_keysym(&context->model->resource, serial, time,
 			       sym, state, modifiers);
 }
 
@@ -642,7 +642,7 @@ input_method_context_language(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_language(&context->model->resource, serial, language);
+	wl_text_input_send_language(&context->model->resource, serial, language);
 }
 
 static void
@@ -653,7 +653,7 @@ input_method_context_text_direction(struct wl_client *client,
 {
 	struct input_method_context *context = resource->data;
 
-	text_input_send_text_direction(&context->model->resource, serial, direction);
+	wl_text_input_send_text_direction(&context->model->resource, serial, direction);
 }
 
 
diff --git a/tests/text-test.c b/tests/text-test.c
index d8ffc38..48f2b5a 100644
--- a/tests/text-test.c
+++ b/tests/text-test.c
@@ -33,7 +33,7 @@ struct text_input_state {
 
 static void
 text_input_commit_string(void *data,
-			 struct text_input *text_input,
+			 struct wl_text_input *text_input,
 			 uint32_t serial,
 			 const char *text)
 {
@@ -41,7 +41,7 @@ text_input_commit_string(void *data,
 
 static void
 text_input_preedit_string(void *data,
-			  struct text_input *text_input,
+			  struct wl_text_input *text_input,
 			  uint32_t serial,
 			  const char *text,
 			  const char *commit)
@@ -50,7 +50,7 @@ text_input_preedit_string(void *data,
 
 static void
 text_input_delete_surrounding_text(void *data,
-				   struct text_input *text_input,
+				   struct wl_text_input *text_input,
 				   int32_t index,
 				   uint32_t length)
 {
@@ -58,7 +58,7 @@ text_input_delete_surrounding_text(void *data,
 
 static void
 text_input_cursor_position(void *data,
-			   struct text_input *text_input,
+			   struct wl_text_input *text_input,
 			   int32_t index,
 			   int32_t anchor)
 {
@@ -66,7 +66,7 @@ text_input_cursor_position(void *data,
 
 static void
 text_input_preedit_styling(void *data,
-			   struct text_input *text_input,
+			   struct wl_text_input *text_input,
 			   uint32_t index,
 			   uint32_t length,
 			   uint32_t style)
@@ -75,21 +75,21 @@ text_input_preedit_styling(void *data,
 
 static void
 text_input_preedit_cursor(void *data,
-			  struct text_input *text_input,
+			  struct wl_text_input *text_input,
 			  int32_t index)
 {
 }
 
 static void
 text_input_modifiers_map(void *data,
-			 struct text_input *text_input,
+			 struct wl_text_input *text_input,
 			 struct wl_array *map)
 {
 }
 
 static void
 text_input_keysym(void *data,
-		  struct text_input *text_input,
+		  struct wl_text_input *text_input,
 		  uint32_t serial,
 		  uint32_t time,
 		  uint32_t sym,
@@ -100,7 +100,7 @@ text_input_keysym(void *data,
 
 static void
 text_input_enter(void *data,
-		 struct text_input *text_input,
+		 struct wl_text_input *text_input,
 		 struct wl_surface *surface)
 
 {
@@ -113,7 +113,7 @@ text_input_enter(void *data,
 
 static void
 text_input_leave(void *data,
-		 struct text_input *text_input)
+		 struct wl_text_input *text_input)
 {
 	struct text_input_state *state = data;
 
@@ -122,14 +122,14 @@ text_input_leave(void *data,
 
 static void
 text_input_input_panel_state(void *data,
-			     struct text_input *text_input,
+			     struct wl_text_input *text_input,
 			     uint32_t state)
 {
 }
 
 static void
 text_input_language(void *data,
-		    struct text_input *text_input,
+		    struct wl_text_input *text_input,
 		    uint32_t serial,
 		    const char *language)
 {
@@ -137,13 +137,13 @@ text_input_language(void *data,
 
 static void
 text_input_text_direction(void *data,
-			  struct text_input *text_input,
+			  struct wl_text_input *text_input,
 			  uint32_t serial,
 			  uint32_t direction)
 {
 }
 
-static const struct text_input_listener text_input_listener = {
+static const struct wl_text_input_listener text_input_listener = {
 	text_input_enter,
 	text_input_leave,
 	text_input_modifiers_map,
@@ -163,8 +163,8 @@ TEST(text_test)
 {
 	struct client *client;
 	struct global *global;
-	struct text_input_manager *factory;
-	struct text_input *text_input;
+	struct wl_text_input_manager *factory;
+	struct wl_text_input *text_input;
 	struct text_input_state state;
 
 	client = client_create(100, 100, 100, 100);
@@ -172,17 +172,17 @@ TEST(text_test)
 
 	factory = NULL;
 	wl_list_for_each(global, &client->global_list, link) {
-		if (strcmp(global->interface, "text_input_manager") == 0)
+		if (strcmp(global->interface, "wl_text_input_manager") == 0)
 			factory = wl_registry_bind(client->wl_registry,
 						   global->name,
-						   &text_input_manager_interface, 1);
+						   &wl_text_input_manager_interface, 1);
 	}
 
 	assert(factory);
 
 	memset(&state, 0, sizeof state);
-	text_input = text_input_manager_create_text_input(factory);
-	text_input_add_listener(text_input, &text_input_listener, &state);
+	text_input = wl_text_input_manager_create_text_input(factory);
+	wl_text_input_add_listener(text_input, &text_input_listener, &state);
 
 	/* Make sure our test surface has keyboard focus. */
 	wl_test_activate_surface(client->test->wl_test,
@@ -191,19 +191,19 @@ TEST(text_test)
 	assert(client->input->keyboard->focus == client->surface);
 
 	/* Activate test model and make sure we get enter event. */
-	text_input_activate(text_input, client->input->wl_seat,
-			    client->surface->wl_surface);
+	wl_text_input_activate(text_input, client->input->wl_seat,
+			       client->surface->wl_surface);
 	client_roundtrip(client);
 	assert(state.activated == 1 && state.deactivated == 0);
 
 	/* Deactivate test model and make sure we get leave event. */
-	text_input_deactivate(text_input, client->input->wl_seat);
+	wl_text_input_deactivate(text_input, client->input->wl_seat);
 	client_roundtrip(client);
 	assert(state.activated == 1 && state.deactivated == 1);
 
 	/* Activate test model again. */
-	text_input_activate(text_input, client->input->wl_seat,
-			    client->surface->wl_surface);
+	wl_text_input_activate(text_input, client->input->wl_seat,
+			       client->surface->wl_surface);
 	client_roundtrip(client);
 	assert(state.activated == 2 && state.deactivated == 1);
 
-- 
1.8.1.4



More information about the wayland-devel mailing list