The first and the third callback function is called when the user performs appropriate action from the application's UI. The second callback function is called during the application's UI creation.
The application's UI is afterwards created by the <span style="font-family: Courier New,Courier,monospace">view_create_base_gui()</span> function. Its source code is not listed
within this documentation, as it is not a subject of this document. At the end of the initialization phase, a callback function is attached to each of the available system events within the
- <span style="font-family: Courier New,Courier,monospace">__add_system_event_handlers()</span> function.
+ <span style="font-family: Courier New,Courier,monospace">__add_system_event_handlers()</span> function (see the function's listing below).
+ </p>
+ <p>
+ For reference of all model related functions that are not listed here refer to the <a href="#model">Model</a> section.
</p>
<pre class="prettyprint">
</pre>
<pre class="prettyprint">
+static void __add_system_event_handlers(void)
+{
+ int i;
+ /* Iteration over all available system events. */
+ for (i = 0; i < model_get_system_events_count(); i++) {
+ system_ev_info_s *ev_info = NULL;
+
+ /* System's event information structure is obtained. */
+ if (!model_get_system_event_info(i, &ev_info))
+ continue;
+
+ /* Event's handler is created and a callback function is attached. */
+ model_add_system_event_handler(ev_info, __system_event_cb, (void *)ev_info);
+ }
+}
+</pre>
+
+ <p>
+ The implementation of callback functions attached in the <span style="font-family: Courier New,Courier,monospace">controller_init()</span> function is described below.
+ </p>
+
+<pre class="prettyprint">
static void __controller_event_do_publish_cb(const char *event_name)
{
controller_log(DLOG_INFO, "Event publishing: '%s'.", event_name);