diff --git a/proto/protocol.xml b/proto/protocol.xml index 77aaf7f..1c01c90 100644 --- a/proto/protocol.xml +++ b/proto/protocol.xml @@ -61,6 +61,10 @@ than 0xff000000. - 'object_id': a previously allocated object id + Protocol XML: + - a request or event marked as type="destructor" causes the object to be + destroyed immediately after that message has been sent. + 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 @@ -69,6 +73,37 @@ (or any lower version) that is the connection for the remainder of this client. + Version negotiation for interfaces is also handled in the ei_connection_setup + object. The client announces which interfaces are supported and their + respective version, future server-created objects will use that version or any + lower version. + + In summary, a typical client connection does: + - connect to the socket + - read ei_connection_setup.version for object id 0 + - 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 + - receive the ei_connection.connection event and create that object + - receive ei_connection.seat (if any seats are available) + - .... + - receive ei_connection.disconnect and close the socket + + As of version 1 for most interfaces, the typical object tree looks like this: + - ei_connection_setup (destroyed after .connection) + - ei_connection + - ei_seat + - ei_device + - ei_pointer + - ei_keyboard + - ei_device + - ei_touchscreen + - ei_device + - ei_seat + - ei_device + - ei_callback (destroyed after .done) + - ei_callback (destroyed after .done) --> @@ -78,18 +113,18 @@ id 0 and only exists until the connection has been set up, see the ei_connection_setup.connection event. - Once set up, the connection setup hands over to the main - ei_connection object which is the top-level object for all future - requests and events. + Once the ei_connection.connection event has been sent the connection setup + is destroyed by the EIS implementation. + + Notify the EIS implementation that configuration is complete. - The ei_conection_setup object will be destroyed by the - EIS implementation after this request is processed and - the client must not attempt to use it after that point. + In the future, the EIS implementation responds by sending the + ei_connection_setup.connection event. @@ -110,7 +145,8 @@ Notify the EIS implementation of the type of this context. This request is optional, the default client type is context_type.receiver. - This request must not be sent more than once. + This request must not be sent more than once and must be sent before + ei_connection_setup.done. @@ -122,7 +158,8 @@ for the EIS implementation to use this name. This request is optional, the default client name is implementation-defined. - This request must not be sent more than once. + This request must not be sent more than once and must be sent before + ei_connection_setup.done. @@ -146,12 +183,15 @@ A client must not provide a ei_connection_setup version higher than ei_connection_setup.version. - This request must not be sent more than once per interface. + This request must not be sent more than once per interface and must be + sent before ei_connection_setup.done. + + The highest supported version of the ei_connection_setup @@ -197,8 +237,13 @@ The core connection object. This is the top-level object for any communication with the EIS implementation. + + Note that for a client to receive objects of this type, it must announce + support for this interface in ei_connection_setup.interface. + + The sync request asks the EIS implementation to emit the 'done' event @@ -214,6 +259,12 @@ The callback_data passed in the callback is always zero. + + Note that for a client to use this request it must announce + support for this interface in ei_connection_setup.interface. It is + a protocol violation to request sync without having announced the + "ei_callback" interface and the EIS implementation must disconnect + the client. @@ -225,12 +276,22 @@ This is a courtesy request to allow the EIS implementation to distinquish between a client disconnecting on purpose and one disconnecting through the socket becoming invalid. + + Immediately after sending this request, the client may destroy the + ei_connection object and it should close the socket. The EIS implementation + will treat the connection as already disconnected on receipt and does not + send the ei_connection.disconnect event in response to this request. > + + - A reason why a client was disconnected. + A reason why a client was disconnected. This enum is intended to + provide information to the client on whether it was disconnected as + part of normal operations or as result of an error on either the client + or EIS implementation side. @@ -265,6 +326,10 @@ Notification that a new seat has been added. + A seat is a set of input devices that logically belong together. + + This event is only sent if the client announced support for the + "ei_seat" interface in ei_connection_setup.interface. The interface version is equal or less to the client-supported version in ei_connection_setup.interface for the "ei_seat" interface. @@ -276,10 +341,16 @@ + Interface for ensuring a roundtrip to the EIS implementation. Clients can handle the 'done' event to get notified when - the related request is done. + the related request that created the ei_callback object is done. + + Note that for a client to receive objects of this type, it must announce + support for this interface in ei_connection_setup.interface. + + Notify the client when the related request is done. Immediately after this event @@ -303,8 +374,13 @@ Immediately after creation of the ei_seat object, the EIS implementation sends a burst of events with information about this seat. This burst of events is terminated by the ei_seat.done event. + + Note that for a client to receive objects of this type, it must announce + support for this interface in ei_connection_setup.interface. + + Notification that the client is no longer interested in this seat. @@ -345,10 +421,16 @@ + + This seat has been removed and a client should release all associated resources. + + This ei_seat object will be destroyed by the EIS implementation immmediately after + after this event is sent and as such the client must not attempt to use + it after that point. @@ -356,6 +438,8 @@ The name of this seat, if any. This event is optional and sent once immediately after object creation. + + It is a protocol violation to send this event after the ei_seat.done event. @@ -363,6 +447,8 @@ A bitmask of the capabilities of this seat. + + It is a protocol violation to send this event after the ei_seat.done event. @@ -371,6 +457,8 @@ Notification that the initial burst of events is complete and the client can set up this seat now. + + It is a protocol violation to send this event more than once. @@ -378,6 +466,8 @@ Notification that a new device has been added. + This event is only sent if the client announced support for the + "ei_device" interface in ei_connection_setup.interface. The interface version is equal or less to the client-supported version in ei_connection_setup.interface for the "ei_device" interface. @@ -388,30 +478,90 @@ + + Note that for a client to receive objects of this type, it must announce + support for this interface in ei_connection_setup.interface. + + + + Notification that the client is no longer interested in this device. + + Note that releasing a device does not guarantee another device becomes available. + The EIS implementation will release any resources related to this device and send the ei_device.destroyed event once complete. + + Notify the EIS implementation that the given device is about to start + sending events. This should be seen more as a transactional boundary than a + time-based boundary. The primary use-cases for this are to allow for setup on + the EIS implementation side and/or UI updates to indicate that a device is + sending events now and for out-of-band information to sync with a given event + sequence. + + There is no actual requirement that events start immediately once emulation + starts and there is no requirement that a client calls ei_device.stop_emulating + after the most recent events. + For example, in a synergy-like use-case the client would call + ei_device.start_emulating once the pointer moves into the the screen and + ei_device.stop_emulating once the pointer moves out of the screen. + + The sequence number identifies this transaction between start/stop emulating. + It must go up by at least 1 on each call to ei_device.start_emulating. + Wraparound must be handled by the EIS implementation but Callers must ensure + that detection of wraparound is reasonably. + + It is a protocol violation to request start_emulating after start_emulating without an + intermediate stop_emulating. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + + + Notify the EIS implementation that the given device is no longer sending + events. See ei_device.start_emulating for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + - - + + Generate a frame event to group the current set of events + into a logical hardware event. This function must be called after any + other event on any of ei_pointer, ei_keyboard or ei_touchscreen has been generated. + + The given timestamp applies to all events in the current frame. + The timestamp must be in microseconds of CLOCK_MONOTONIC. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + + + + + This device has been removed and a client should release all associated resources. + + This ei_device object will be destroyed by the EIS implementation immmediately after + after this event is sent and as such the client must not attempt to use + it after that point. @@ -419,6 +569,8 @@ The name of this device, if any. This event is optional and sent once immediately after object creation. + + It is a protocol violation to send this event after the ei_device.done event. @@ -433,11 +585,28 @@ A bitmask of the capabilties of this device. + + This event must be is sent once immediately after object creation. + It is a protocol violation to send this event after the ei_device.done event. + + If the device type is device_type.virtual, the device is a + virtual device representing input as applied on the EIS implementation's + screen. A relative virtual device generates input events in logical pixels, + an absolute virtual device generates input events in logical pixels on one + of the device's regions. Virtual devices do not have a size. + + If the device type is device_type.physical, the device is a + representation of a physical device as if connected to the EIS + implementation's host computer. A relative physical device generates input + events in mm, an absolute physical device generates input events in mm + within the device's specified physical size. Physical devices do not have + regions and no ei_device.region events are sent for such devices. + @@ -445,37 +614,107 @@ The device type, one of virtual or physical. + + This event must be is sent once immediately after object creation. + It is a protocol violation to send this event after the ei_device.done event. - The device dimensions in mm. + The device dimensions in mm. This event is optional and sent once immediately + after object creation. + + It is a protocol violation to send this event after the ei_device.done event. - - - - - + + Notifies the client of one region. The number of regions is constant for a device + and all regions are announced immediately after object creation. + + A region is rectangular and defined by an x/y offset and a width and a height. + A region defines the area on an EIS desktop layout that is accessible by + this device - this region may not be the full area of the desktop. + Input events may only be sent for points within the regions. + + The use of regions is private to the EIS compositor and coordinates may not + match the size of the actual desktop. For example, a compositor may set a + 1920x1080 region to represent a 4K monitor and transparently map input + events into the respective true pixels. + + Absolute devices may have different regions, it is up to the libei client + to send events through the correct device to target the right pixel. For + example, a dual-head setup my have two absolute devices, the first with a + zero offset region spanning the first screen, the second with a nonzero + offset spanning the second screen. + + The physical scale denotes a constant factor that needs to be applied to + any relative movement on this region for that movement to match the same + *physical* movement on another region. + + This event is optional and sent immediately after object creation. Where a device + has multiple regions, this event is sent once for each region. + It is a protocol violation to send this event after the ei_device.done event. + + + + + + + + Notification that a new device has a pointer interface. + + This event is only sent if the client announced support for the + "ei_pointer" interface in ei_connection_setup.interface. + The interface version is equal or less to the client-supported + version in ei_connection_setup.interface for the "ei_pointer" + interface. + + This event is optional and sent immediately after object creation. + It is a protocol violation to send this event after the ei_device.done event. + + + Notification that a new device has a keyboard interface. + + This event is only sent if the client announced support for the + "ei_keyboard" interface in ei_connection_setup.interface. + The interface version is equal or less to the client-supported + version in ei_connection_setup.interface for the "ei_keyboard" + interface. + + This event is optional and sent immediately after object creation. + It is a protocol violation to send this event after the ei_device.done event. + + + Notification that a new device has a keyboard interface. + + This event is only sent if the client announced support for the + "ei_touchscreen" interface in ei_connection_setup.interface. + The interface version is equal or less to the client-supported + version in ei_connection_setup.interface for the "ei_touchscreen" + interface. + + This event is optional and sent immediately after object creation. + It is a protocol violation to send this event after the ei_device.done event. + @@ -484,6 +723,8 @@ Notification that the initial burst of events is complete and the client can set up this device now. + + It is a protocol violation to send this event more than once per device. @@ -494,22 +735,47 @@ + + See the ei_device.start_emulating request for details. + + It is a protocol violation to send this event for a client + of an ei_connection_setup.context_type other than receiver. + > + + See the ei_device.stop_emulating request for details. + + It is a protocol violation to send this event for a client + of an ei_connection_setup.context_type other than receiver. + - - + + See the ei_device.frame request for details. + + It is a protocol violation to send this event for a client + of an ei_connection_setup.context_type other than receiver. + + + + Interface for pointer and absolute pointer requests and events. This interface + is available on devices with the ei_device.capability pointer or pointer_absolute. + + Note that for a client to receive objects of this type, it must announce + support for this interface in ei_connection_setup.interface. + + Notification that the client is no longer interested in this pointer. @@ -519,29 +785,82 @@ - - + + Generate a relative motion event on this pointer. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + + + - - + + Generate an absolute motion event on this pointer. The x/y + coordinates must be within the device's regions or the event + is silently discarded. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + + + - - + + Generate a a smooth (pixel-precise) scroll event on this pointer. + Clients must not send ei_pointer.scroll_discrete events for the same event, + the EIS implementation is responsible for emulation of discrete + scroll events. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + + + - - + + Generate a a discrete (e.g. wheel) scroll event on this pointer. + Clients must not send ei_pointer.scroll events for the same event, + the EIS implementation is responsible for emulation of smooth + scroll events. + + A discrete scroll event is based logical scroll units (equivalent to one + mouse wheel click). The value for one scroll unit is 120, a fraction or + multiple thereof represents a fraction or multiple of a wheel click. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + + + - - - + + Generate a a scroll stop or cancel event on this pointer. + + A scroll stop event notifies the server that the interaction causing a + scroll motion previously triggered with ei_pointer.scroll or + ei_pointer.scroll_discrete has stopped. For example, if all + fingers are lifted off a touchpad, two-finger scrolling has logically + stopped. The server may use this information to e.g. start kinetic scrolling + previously based on the previous finger speed. + + If is_cancel is nonzero, the event represents a cancellation of the + current interaction. This indicates that the interaction has stopped to the + point where further (server-emulated) scroll events from this device are wrong. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + + + + @@ -550,44 +869,94 @@ - + + Generate a button event on this pointer. + + The button codes must match the defines in linux/input-event-codes.h. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + + + + This pointer has been removed and a client should release all associated resources. + + This ei_pointer object will be destroyed by the EIS implementation immmediately after + after this event is sent and as such the client must not attempt to use + it after that point. + + See the ei_pointer.motion_relative request for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver. + + + See the ei_pointer.motion_absolute request for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver. + + + See the ei_pointer.scroll request for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver. + + + See the ei_pointer.scroll_discrete request for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver. + + + + See the ei_pointer.scroll_stop request for details. + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver. + + + See the ei_pointer.button request for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver. + @@ -596,8 +965,15 @@ + Interface for keyboard requests and events. This interface + is available on devices with the ei_device.capability keyboard. + + Note that for a client to receive objects of this type, it must announce + support for this interface in ei_connection_setup.interface. + + Notification that the client is no longer interested in this keyboard. @@ -607,10 +983,20 @@ - + + + Notification that this device has a keymap. + + The keymap is constant for the lifetime of the device. Key events on + this device correspond to the given keymap. + + This event is sent immediately after the ei_keyboard object is created + and before the ei_device.done event. It is a protocol violation to send this + event after the ei_device.done event. + @@ -622,23 +1008,48 @@ + + Generate a key event on this keyboard. + + The key codes must match the defines in linux/input-event-codes.h. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than sender. + + + This keyboard has been removed and a client should release all associated resources. + + This ei_keyboard object will be destroyed by the EIS implementation immmediately after + after this event is sent and as such the client must not attempt to use + it after that point. + + See the ei_keyboard.key request for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver. + + + Notification that the EIS implementation has changed modifier + states on this device. Future ei_keyboard.key requests must take the + new modifier state into account. + @@ -648,8 +1059,15 @@ + Interface for touchscreen requests and events. This interface + is available on devices with the ei_device.capability touchscreen. + + Note that for a client to receive objects of this type, it must announce + support for this interface in ei_connection_setup.interface. + + Notification that the client is no longer interested in this touch. @@ -663,10 +1081,13 @@ Notifies the EIS implementation about a new touch logically down at the given coordinates. The touchid is a unique id for this touch. Touchids may be re-used after ei_touchscreen.up. + + The x/y coordinates must be within the device's regions or the event and future + ei_touchscreen.motion events with the same touchid are silently discarded. - - + + @@ -674,10 +1095,13 @@ Notifies the EIS implementation about an existing touch changing position to the given coordinates. The touchid is the unique id for this touch previously sent with ei_touchscreen.down. + + The x/y coordinates must be within the device's regions or the event is + silently discarded. - - + + @@ -691,17 +1115,25 @@ + + This touch has been removed and a client should release all associated resources. + + This ei_touchscreen object will be destroyed by the EIS implementation immmediately after + after this event is sent and as such the client must not attempt to use + it after that point. - See the ei_touchscreen.down request for details. This event is - for ei receiver contexts. + See the ei_touchscreen.down request for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver. @@ -710,8 +1142,10 @@ - See the ei_touchscreen.motion request for details. This event is - for ei receiver contexts. + See the ei_touchscreen.motion request for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver. @@ -720,8 +1154,10 @@ - See the ei_touchscreen.up request for details. This event is - for ei receiver contexts. + See the ei_touchscreen.up request for details. + + It is a protocol violation to send this request for a client + of an ei_connection_setup.context_type other than receiver.