]> git.tdb.fi Git - ext/subsurface.git/blobdiff - profile.c
Add menu item and dialog to select which events to display
[ext/subsurface.git] / profile.c
index 11b01b5035a0e4a1581287cfa3c277cc304f1cf2..56716f5f767c11646d0edaade51d2b9b4d1b427f 100644 (file)
--- a/profile.c
+++ b/profile.c
@@ -174,6 +174,15 @@ static struct ev_select *ev_namelist;
 static int evn_allocated;
 static int evn_used;
 
+void evn_foreach(void (*callback)(const char *, int *, void *), void *data)
+{
+       int i;
+
+       for (i = 0; i < evn_used; i++) {
+               callback(ev_namelist[i].ev_name, &ev_namelist[i].plot_ev, data);
+       }
+}
+
 void remember_event(const char *eventname)
 {
        int i=0, len;
@@ -202,6 +211,17 @@ static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, st
        int i, depth = 0;
        int x,y;
 
+       /* is plotting this event disabled? */
+       if (event->name) {
+               for (i = 0; i < evn_used; i++) {
+                       if (! strcmp(event->name, ev_namelist[i].ev_name)) {
+                               if (ev_namelist[i].plot_ev)
+                                       break;
+                               else
+                                       return;
+                       }
+               }
+       }
        for (i = 0; i < pi->nr; i++) {
                struct plot_data *data = pi->entry + i;
                if (event->time.seconds < data->sec)