From eabeb419e37673ebd79c9c1355eac82068393103 Mon Sep 17 00:00:00 2001 From: keis Date: Sun, 11 Sep 2011 15:58:45 +0200 Subject: remove event formatting from run_parsed_command * split event formatting and sending into separate functions and expose both in events.h * make it possible to format array of strings --- src/events.h | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src/events.h') diff --git a/src/events.h b/src/events.h index 8e89899..73d0712 100644 --- a/src/events.h +++ b/src/events.h @@ -31,18 +31,47 @@ enum event_type { LAST_EVENT }; +typedef struct _Event Event; +struct _Event; + void event_buffer_timeout(guint sec); void replay_buffered_events(); +/* + * build event string + */ +Event * +format_event(int type, const gchar *custom_event, ...) G_GNUC_NULL_TERMINATED; + +Event * +vformat_event(int type, const gchar *custom_event, va_list vargs); + +/* + * send a already formatted event string over the supported interfaces. + * returned event string should be freed by `event_free` + */ void -vsend_event(int type, const gchar *custom_event, va_list vargs); +send_formatted_event(const Event *event); +/* + * frees a event string + */ +void +event_free(Event *event); + +/* + * build event string and send over the supported interfaces + * this is the same as calling `format_event` and then `send_formatted_event` + */ void send_event(int type, const gchar *custom_event, ...) G_GNUC_NULL_TERMINATED; +void +vsend_event(int type, const gchar *custom_event, va_list vargs); + gchar * get_modifier_mask(guint state); -- cgit v1.2.3