From 47467bfe0e3b41d2244f3c9c304b0dcaa53fb696 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 27 Feb 2023 15:17:09 +1000 Subject: [PATCH] proto: rename connection_setup.done to .finish Avoids ambiguity with the .done events from e.g. the seat or the device. --- proto/protocol.xml | 18 +++++++++--------- src/libei-connection-setup.c | 2 +- src/libeis-connection-setup.c | 4 ++-- test/test_protocol.py | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/proto/protocol.xml b/proto/protocol.xml index 47169be..178c8cf 100644 --- a/proto/protocol.xml +++ b/proto/protocol.xml @@ -89,7 +89,7 @@ The initial connection is a two-step process: An ei_connection_setup object with the special ID 0 is guaranteed to exists. The client must send the appropriate requests to set up - its connection, followed by the .done request. The server replies + its connection, followed by the .finish request. The server replies by creating the ei_connection object with the client-requested version (or any lower version) that is the connection for the remainder of this client. @@ -105,7 +105,7 @@ - send ei_connection_setup.interface for "ei_connection" - send ei_connection_setup.interface for all other supported interfaces - optionally: send ei_connection_setup.name and ei_connection_setup.context_type - - send ei_connection_setup.done + - send ei_connection_setup.finish - receive the ei_connection.connection event and create that object - receive ei_connection.seat (if any seats are available) - .... @@ -149,8 +149,8 @@ - - + + Notify the EIS implementation that configuration is complete. In the future, the EIS implementation responds by sending the @@ -181,7 +181,7 @@ This request is optional, the default client type is context_type.receiver. This request must not be sent more than once and must be sent before - ei_connection_setup.done. + ei_connection_setup.finish. @@ -194,7 +194,7 @@ This request is optional, the default client name is implementation-defined. This request must not be sent more than once and must be sent before - ei_connection_setup.done. + ei_connection_setup.finish. @@ -209,7 +209,7 @@ This request must be sent for the "ei_connection" interface, failing to do so will result in the EIS implementation disconnecting - the client on ei_connection_setup.done. + the client on ei_connection_setup.finish. If the "ei_connection_setup" version is given, the interface of this object is upgraded to the given version. Otherwise, the @@ -223,7 +223,7 @@ not supporting those interfaces. This request must not be sent more than once per interface and must be - sent before ei_connection_setup.done. + sent before ei_connection_setup.finish. @@ -271,7 +271,7 @@ object for all future requests and events. This event is sent at some unspecified time after the client sends the - ei_connection_setup.done request to the EIS implementation. + ei_connection_setup.finish request to the EIS implementation. The ei_connection_setup object will be destroyed by the EIS implementation immediately after this event has been sent, a diff --git a/src/libei-connection-setup.c b/src/libei-connection-setup.c index 8f6ba43..9789dbf 100644 --- a/src/libei-connection-setup.c +++ b/src/libei-connection-setup.c @@ -95,7 +95,7 @@ ei_connection_setup_initialize(struct ei_connection_setup *setup, uint32_t versi ei_connection_setup_request_interface_version(setup, "ei_touchscreen", v->ei_touchscreen); } - ei_connection_setup_request_done(setup); + ei_connection_setup_request_finish(setup); return 0; } diff --git a/src/libeis-connection-setup.c b/src/libeis-connection-setup.c index c4400c8..95bef83 100644 --- a/src/libeis-connection-setup.c +++ b/src/libeis-connection-setup.c @@ -83,7 +83,7 @@ pong(struct eis_connection *connection, void *user_data) } static struct brei_result * -client_msg_done(struct eis_connection_setup *setup) +client_msg_finish(struct eis_connection_setup *setup) { struct eis_client *client = eis_connection_setup_get_client(setup); @@ -199,7 +199,7 @@ client_msg_interface_version(struct eis_connection_setup *setup, const char *nam } static const struct eis_connection_setup_interface interface = { - .done = client_msg_done, + .finish = client_msg_finish, .context_type = client_msg_context_type, .name = client_msg_name, .interface_version = client_msg_interface_version, diff --git a/test/test_protocol.py b/test/test_protocol.py index 0a168f1..3251ed8 100644 --- a/test/test_protocol.py +++ b/test/test_protocol.py @@ -171,7 +171,7 @@ class Ei: self.send(setup.InterfaceVersion("ei_pointer", VERSION_V(1))) self.send(setup.InterfaceVersion("ei_keyboard", VERSION_V(1))) self.send(setup.InterfaceVersion("ei_touchscreen", VERSION_V(1))) - self.send(setup.Done()) + self.send(setup.Finish()) self.dispatch() def wait_for_seat(self, timeout=5) -> bool: @@ -418,7 +418,7 @@ class TestEiProtocol: ei.send( ei.connection_setup.InterfaceVersion(interface, VERSION_V(1)) ) # these are required - ei.send(ei.connection_setup.Done()) + ei.send(ei.connection_setup.Finish()) ei.dispatch() ei.wait_for_connection(timeout=1) @@ -514,7 +514,7 @@ class TestEiProtocol: ei.send( setup.InterfaceVersion("ei_device", VERSION_V(100)) ) # excessive version - ei.send(setup.Done()) + ei.send(setup.Finish()) ei.dispatch() ei.wait_for_seat() @@ -571,7 +571,7 @@ class TestEiProtocol: setup.InterfaceVersion(interface, VERSION_V(1)) ) # these are required # Do not announce ei_seat support - ei.send(setup.Done()) + ei.send(setup.Finish()) ei.dispatch() assert not ei.seats @@ -712,7 +712,7 @@ class TestEiProtocol: assert have_invalid_object_event, "Expected invalid_object event, got none" - def test_disconnect_before_setup_done(self, eis): + def test_disconnect_before_setup_finish(self, eis): ei = eis.ei ei.dispatch() ei.send(ei.connection_setup.ContextType(EiConnectionSetup.EiContextType.SENDER)) @@ -794,7 +794,7 @@ class TestEiProtocol: setup.connect("Connection", on_connection) - ei.send(setup.Done()) + ei.send(setup.Finish()) ei.dispatch() if missing_interface in ["ei_connection", "ei_callback", "ei_pingpong"]: