add missing information indicator
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / eventhooks.c
index 4441712a3d88c3ea2337bda5030aaaa38d0b40f6..97020813aa3381fe53c16ca4c01ca78ae48404d5 100644 (file)
@@ -494,8 +494,17 @@ int before_schedchange_hook(void *hook_data, void *call_data)
 
 
         /* Jump over draw if we are at the same x position */
-        if(x == hashed_process_data->x.middle)
+        if(x == hashed_process_data->x.middle &&
+             hashed_process_data->x.middle_used)
         {
+          if(hashed_process_data->x.middle_marked == FALSE) {
+            /* Draw collision indicator */
+            gdk_gc_set_foreground(drawing->gc, &drawing_colors[COL_WHITE]);
+            gdk_draw_point(drawing->pixmap,
+                           drawing->gc,
+                           x,
+                           y+1);
+          }
           /* jump */
         } else {
           DrawContext draw_context;
@@ -527,6 +536,8 @@ int before_schedchange_hook(void *hook_data, void *call_data)
           }
           /* become the last x position */
           hashed_process_data->x.middle = x;
+          hashed_process_data->x.middle_used = TRUE;
+          hashed_process_data->x.middle_marked = FALSE;
         }
       }
     }
@@ -607,8 +618,17 @@ int before_schedchange_hook(void *hook_data, void *call_data)
 
 
         /* Jump over draw if we are at the same x position */
-        if(x == hashed_process_data->x.middle)
+        if(x == hashed_process_data->x.middle &&
+            hashed_process_data->x.middle_used)
         {
+          if(hashed_process_data->x.middle_marked == FALSE) {
+            /* Draw collision indicator */
+            gdk_gc_set_foreground(drawing->gc, &drawing_colors[COL_WHITE]);
+            gdk_draw_point(drawing->pixmap,
+                           drawing->gc,
+                           x,
+                           y+1);
+          }
           /* jump */
         } else {
           DrawContext draw_context;
@@ -641,6 +661,8 @@ int before_schedchange_hook(void *hook_data, void *call_data)
           
           /* become the last x position */
           hashed_process_data->x.middle = x;
+          hashed_process_data->x.middle_used = TRUE;
+          hashed_process_data->x.middle_marked = FALSE;
         }
       }
     }
@@ -1358,16 +1380,27 @@ int after_schedchange_hook(void *hook_data, void *call_data)
     drawing_insert_square( control_flow_data->drawing, y_in, height);
   }
 
+  guint new_x;
+  
   convert_time_to_pixels(
       time_window.start_time,
       end_time,
       evtime,
       width,
-      &hashed_process_data_in->x.middle);
+      &new_x);
+
+  if(hashed_process_data_in->x.middle != new_x) {
+    hashed_process_data_in->x.middle = new_x;
+    hashed_process_data_in->x.middle_used = FALSE;
+    hashed_process_data_in->x.middle_marked = FALSE;
+  }
+
   return 0;
 
 
 
+
+
 #if 0
   EventsRequest *events_request = (EventsRequest*)hook_data;
   ControlFlowData *control_flow_data = events_request->viewer_data;
@@ -1974,8 +2007,17 @@ int before_execmode_hook(void *hook_data, void *call_data)
 
 
     /* Jump over draw if we are at the same x position */
-    if(x == hashed_process_data->x.middle)
+    if(x == hashed_process_data->x.middle &&
+             hashed_process_data->x.middle_used)
     {
+      if(hashed_process_data->x.middle_marked == FALSE) {
+        /* Draw collision indicator */
+        gdk_gc_set_foreground(drawing->gc, &drawing_colors[COL_WHITE]);
+        gdk_draw_point(drawing->pixmap,
+                       drawing->gc,
+                       x,
+                       y+1);
+      }
       /* jump */
     } else {
 
@@ -2007,6 +2049,8 @@ int before_execmode_hook(void *hook_data, void *call_data)
       }
       /* become the last x position */
       hashed_process_data->x.middle = x;
+      hashed_process_data->x.middle_used = TRUE;
+      hashed_process_data->x.middle_marked = FALSE;
     }
   }
   
@@ -2099,13 +2143,22 @@ int after_execmode_hook(void *hook_data, void *call_data)
             &hashed_process_data);
     drawing_insert_square( control_flow_data->drawing, y, height);
   }
-
+  
+  guint new_x;
+  
   convert_time_to_pixels(
       time_window.start_time,
       end_time,
       evtime,
       width,
-      &hashed_process_data->x.over);
+      &new_x);
+
+  if(hashed_process_data->x.middle != new_x) {
+    hashed_process_data->x.middle = new_x;
+    hashed_process_data->x.middle_used = FALSE;
+    hashed_process_data->x.middle_marked = FALSE;
+  }
+
   return 0;
 }
 
@@ -2226,8 +2279,17 @@ int before_process_hook(void *hook_data, void *call_data)
 
 
       /* Jump over draw if we are at the same x position */
-      if(x == hashed_process_data->x.middle)
-      {
+      if(x == hashed_process_data->x.middle &&
+             hashed_process_data->x.middle_used)
+      { 
+        if(hashed_process_data->x.middle_marked == FALSE) {
+          /* Draw collision indicator */
+          gdk_gc_set_foreground(drawing->gc, &drawing_colors[COL_WHITE]);
+          gdk_draw_point(drawing->pixmap,
+                         drawing->gc,
+                         x,
+                         y+1);
+        }
         /* jump */
       } else {
         DrawContext draw_context;
@@ -2259,6 +2321,8 @@ int before_process_hook(void *hook_data, void *call_data)
         }
         /* become the last x position */
         hashed_process_data->x.middle = x;
+        hashed_process_data->x.middle_used = TRUE;
+        hashed_process_data->x.middle_marked = FALSE;
       }
     }
 
@@ -2379,9 +2443,22 @@ int after_process_hook(void *hook_data, void *call_data)
         evtime,
         width,
         &new_x);
-    hashed_process_data_child->x.over = new_x;
-    hashed_process_data_child->x.middle = new_x;
-    hashed_process_data_child->x.under = new_x;
+
+    if(hashed_process_data_child->x.over != new_x) {
+      hashed_process_data_child->x.over = new_x;
+      hashed_process_data_child->x.over_used = FALSE;
+      hashed_process_data_child->x.over_marked = FALSE;
+    }
+    if(hashed_process_data_child->x.middle != new_x) {
+      hashed_process_data_child->x.middle = new_x;
+      hashed_process_data_child->x.middle_used = FALSE;
+      hashed_process_data_child->x.middle_marked = FALSE;
+    }
+    if(hashed_process_data_child->x.under != new_x) {
+      hashed_process_data_child->x.under = new_x;
+      hashed_process_data_child->x.under_used = FALSE;
+      hashed_process_data_child->x.under_marked = FALSE;
+    }
 
   } else if(sub_id == 3) { /* exit */
 
@@ -2440,7 +2517,13 @@ int after_process_hook(void *hook_data, void *call_data)
         evtime,
         width,
         &new_x);
-    hashed_process_data->x.middle = new_x;
+    if(hashed_process_data->x.middle != new_x) {
+      hashed_process_data->x.middle = new_x;
+      hashed_process_data->x.middle_used = FALSE;
+      hashed_process_data->x.middle_marked = FALSE;
+    }
+
+
   }
   return 0;
 
@@ -2973,7 +3056,16 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data)
         }
 #endif //0
 
-        if(x == hashed_process_data->x.middle) {
+        if(x == hashed_process_data->x.middle &&
+            hashed_process_data->x.middle_used) {
+          if(hashed_process_data->x.middle_marked == FALSE) {
+            /* Draw collision indicator */
+            gdk_gc_set_foreground(drawing->gc, &drawing_colors[COL_WHITE]);
+            gdk_draw_point(drawing->pixmap,
+                           drawing->gc,
+                           x,
+                           draw_context.drawinfo.y.over);
+          }
           /* Jump */
         } else {
           draw_context.drawinfo.start.x = hashed_process_data->x.middle;
@@ -2982,7 +3074,11 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data)
           draw_line((void*)&prop_line, (void*)&draw_context);
 
            /* become the last x position */
-          hashed_process_data->x.middle = x;
+          if(x != hashed_process_data->x.middle) {
+            hashed_process_data->x.middle = x;
+            /* but don't use the pixel */
+            hashed_process_data->x.middle_used = FALSE;
+          }
         }
       }
     }
This page took 0.027155 seconds and 4 git commands to generate.