Drop ei_next_event_type() and eis_next_event_type()

Replaced by ei_peek_event() and eis_next_event_type()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-08-18 12:42:16 +10:00
parent b052d30978
commit 537fdfde85
5 changed files with 2 additions and 62 deletions

View file

@ -548,16 +548,6 @@ ei_peek_event(struct ei *ei)
return ei_event_ref(e);
}
_public_ enum ei_event_type
ei_next_event_type(struct ei *ei)
{
if (list_empty(&ei->event_queue))
return EI_EVENT_NONE;
struct ei_event *e = list_first_entry(&ei->event_queue, e, link);
return e->type;
}
static void frame_cleanup(Frame **f) {
if (*f)
frame__free_unpacked(*f, NULL);

View file

@ -54,11 +54,6 @@ enum ei_keymap_source {
};
enum ei_event_type {
/**
* No event ever has this type, this type exists only as potential
* return value for ei_next_event_type().
*/
EI_EVENT_NONE = 0,
/**
* The server has approved the connection to this client. The client
* may now add devices with ei_device_add(). Where the server does
@ -68,7 +63,7 @@ enum ei_event_type {
* This event is only sent once after the initial connection
* request.
*/
EI_EVENT_CONNECT,
EI_EVENT_CONNECT = 1,
/**
* The server has disconnected this client - all resources left to
* reference this server are now obsolete. Once this event has been
@ -222,24 +217,6 @@ ei_get_event(struct ei *ei);
struct ei_event *
ei_peek_event(struct ei *ei);
/**
* Return the type of the next event in the event queue or @ref
* EI_EVENT_NONE if none are available. This function does not remove the
* event from the queue.
*
* This is a convenience function and effectively the same as:
* @code
* struct ei_event *event = ei_peek_event(ei);
* enum ei_event_type type = ei_event_get_type(event);
* ei_event_unref(event);
*
* ... now handle the type ...
*
* @endcode
*/
enum ei_event_type
ei_next_event_type(struct ei *ei);
/**
* Release resources associated with this event. This function always
* returns NULL.

View file

@ -90,7 +90,6 @@ _public_ struct eis_event_pointer *
eis_event_get_pointer_event(struct eis_event *e)
{
switch (e->type) {
case EIS_EVENT_NONE:
case EIS_EVENT_CLIENT_CONNECT:
case EIS_EVENT_CLIENT_DISCONNECT:
case EIS_EVENT_DEVICE_ADDED:
@ -117,7 +116,6 @@ _public_ struct eis_event_keyboard *
eis_event_get_keyboard_event(struct eis_event *e)
{
switch (e->type) {
case EIS_EVENT_NONE:
case EIS_EVENT_CLIENT_CONNECT:
case EIS_EVENT_CLIENT_DISCONNECT:
case EIS_EVENT_DEVICE_ADDED:
@ -339,15 +337,6 @@ eis_peek_event(struct eis *eis)
return eis_event_ref(e);
}
_public_ enum eis_event_type
eis_next_event_type(struct eis *eis)
{
if (list_empty(&eis->event_queue))
return EIS_EVENT_NONE;
struct eis_event *e = list_first_entry(&eis->event_queue, e, link);
return e->type;
}
void
eis_add_client(struct eis *eis, struct eis_client *client)
{

View file

@ -49,18 +49,13 @@ enum eis_keymap_type {
};
enum eis_event_type {
/**
* No event ever has this type, this type exists only as potential
* return value for eis_next_event_type().
*/
EIS_EVENT_NONE = 0,
/**
* A client has connected. This is the first event from any new
* client.
* The server is expected to either call eis_event_client_allow() or
* eis_event_client_deny().
*/
EIS_EVENT_CLIENT_CONNECT,
EIS_EVENT_CLIENT_CONNECT = 1,
/**
* The client has disconnected, any pending requests for this client
* should be discarded.
@ -196,9 +191,6 @@ eis_peek_event(struct eis *eis);
struct eis_event *
eis_event_unref(struct eis_event *event);
enum eis_event_type
eis_next_event_type(struct eis *eis);
struct eis_client *
eis_client_ref(struct eis_client *client);

View file

@ -232,8 +232,6 @@ peck_dispatch_eis(struct peck *peck)
log_debug(peck, "EIS event %d\n", eis_event_get_type(e));
switch (eis_event_get_type(e)) {
case EIS_EVENT_NONE:
abort();
case EIS_EVENT_CLIENT_CONNECT:
case EIS_EVENT_CLIENT_DISCONNECT:
if (flag_is_set(peck->eis_behavior, PECK_EIS_BEHAVIOR_ACCEPT_CLIENT) ||
@ -262,8 +260,6 @@ peck_dispatch_eis(struct peck *peck)
e = eis_get_event(eis);
switch (eis_event_get_type(e)) {
case EIS_EVENT_NONE:
abort();
case EIS_EVENT_CLIENT_CONNECT:
peck_handle_eis_connect(peck, e);
break;
@ -321,8 +317,6 @@ peck_dispatch_ei(struct peck *peck)
break;
switch (ei_event_get_type(e)) {
case EI_EVENT_NONE:
abort();
case EI_EVENT_CONNECT:
if (flag_is_set(peck->ei_behavior,
PECK_EI_BEHAVIOR_AUTOCONNNECT))
@ -342,8 +336,6 @@ peck_dispatch_ei(struct peck *peck)
e = ei_get_event(ei);
switch (ei_event_get_type(e)) {
case EI_EVENT_NONE:
abort();
case EI_EVENT_CONNECT:
log_debug(peck, "ei is connected\n");
/* Nothing to do here */