diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2011-08-08 18:57:53 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2011-08-08 18:57:53 -0400 |
commit | e6acb6704d4420ddc21adf47fbb20a256955d998 (patch) | |
tree | ea3c8c422907f205a5afa270b7889ae0e07d5674 | |
parent | 2d47998901f17742c2b73c0e5f306d8a7a3f68d9 (diff) |
Expose event notifications in the track protocol.
A new EVENT message type is added to the track protocol.
The view field carries the event code which the guest wishes to
change. The flags field is 0 or 1 to indicate whether to set or
clear the event. Clients can only use events below CLIENT_EVENTS;
higher-numbered events are reserved for use by the server.
-rw-r--r-- | src/comm.c | 12 | ||||
-rw-r--r-- | src/track.h | 1 |
2 files changed, 13 insertions, 0 deletions
@@ -28,6 +28,7 @@ #include "client.h" #include "display.h" #include "sak.h" +#include "icon.h" static void comm_do_update(struct client *c, struct buffer *b, struct view *v, @@ -170,6 +171,13 @@ comm_sak(struct client *c, struct buffer *b, struct lin_message *m) client_send_message(c, rc ? LINPICKER_SAK_FAILURE : LINPICKER_SAK_SUCCESS); } +static void +comm_event(struct client *c, struct buffer *b, struct lin_message *m) +{ + icon_set(b->bg_view->display, m->view, m->flags); + display_update_seclabel(active_display); +} + void comm_process(struct client *c, struct buffer *b, struct lin_message *m) { @@ -192,7 +200,11 @@ comm_process(struct client *c, struct buffer *b, struct lin_message *m) case LINPICKER_SAK_REQUEST: comm_sak(c, b, m); break; + case LINPICKER_EVENT: + comm_event(c, b, m); + break; default: + FD_LOG(1, "Warning: unknown track message type %d\n"); break; } } diff --git a/src/track.h b/src/track.h index de9dda5..76d4d84 100644 --- a/src/track.h +++ b/src/track.h @@ -40,6 +40,7 @@ #define LINPICKER_DESTROY 3 #define LINPICKER_NAME 4 #define LINPICKER_SAK_REQUEST 5 +#define LINPICKER_EVENT 6 /* Flags for create/update messages */ #define LINPICKER_FLAG_POSITION 1 |