summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2016-11-19 17:08:58 (GMT)
committer Daniel Silverstone <dsilvers@digital-scurf.org>2016-11-19 17:08:58 (GMT)
commitc367d92d41291e2fb88bac81159bf2a2cdc096fe (patch)
treea8b0cc028c0cec7f312fd1199f17c6ba38b29201
parent56bc77504bd6e45b52cedd5a293d57c076ad9c98 (diff)
downloadlibdom-c367d92d41291e2fb88bac81159bf2a2cdc096fe.tar.gz
libdom-c367d92d41291e2fb88bac81159bf2a2cdc096fe.tar.bz2
Add support to retrieve if an event is in dispatch
-rw-r--r--include/dom/events/event.h8
-rw-r--r--src/events/event.c13
2 files changed, 21 insertions, 0 deletions
diff --git a/include/dom/events/event.h b/include/dom/events/event.h
index 93c2955..5bb0814 100644
--- a/include/dom/events/event.h
+++ b/include/dom/events/event.h
@@ -97,4 +97,12 @@ dom_exception _dom_event_init_ns(dom_event *evt, dom_string *namespace,
(dom_event *) (e), (dom_string *) (n), \
(dom_string *) (t), (bool) (b), (bool) (c))
+dom_exception _dom_event_in_dispatch(dom_event *evt, bool *result);
+#define dom_event_in_dispatch(e,r) _dom_event_in_dispatch( \
+ (dom_event *) (e), (bool *) (r))
+
+dom_exception _dom_event_is_initialised(dom_event *evt, bool *result);
+#define dom_event_is_initialised(e,r) _dom_event_is_initialised( \
+ (dom_event *) (e), (bool *) (r))
+
#endif
diff --git a/src/events/event.c b/src/events/event.c
index 821c5e7..62a5739 100644
--- a/src/events/event.c
+++ b/src/events/event.c
@@ -337,3 +337,16 @@ dom_exception _dom_event_init_ns(dom_event *evt, dom_string *namespace,
return DOM_NO_ERR;
}
+/**
+ * Return whether or not the event is in dispatch currently.
+ *
+ * \param evt The event object
+ * \param result Pointer to result object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_event_in_dispatch(dom_event *evt, bool *result)
+{
+ *result = evt->in_dispatch;
+
+ return DOM_NO_ERR;
+}