add missing information indicator
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 13 Aug 2004 17:06:38 +0000 (17:06 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 13 Aug 2004 17:06:38 +0000 (17:06 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@723 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c
ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c
ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c
ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h

index 9b977199fa973dc971395f2876cef4958302e82a..b71dafacfab65307aaf54ff45d2798ebd7a1a70a 100644 (file)
@@ -384,8 +384,14 @@ static void set_last_start(gpointer key, gpointer value, gpointer user_data)
   guint x = (guint)user_data;
 
   hashed_process_data->x.over = x;
+  hashed_process_data->x.over_used = FALSE;
+  hashed_process_data->x.over_marked = FALSE;
   hashed_process_data->x.middle = x;
+  hashed_process_data->x.middle_used = FALSE;
+  hashed_process_data->x.middle_marked = FALSE;
   hashed_process_data->x.under = x;
+  hashed_process_data->x.under_used = FALSE;
+  hashed_process_data->x.under_marked = FALSE;
 
   return;
 }
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;
+          }
         }
       }
     }
index 924d8c52501b795eb673f579433b98304250ff9f..9bedbc99f4c5cbe815d34edc73e917e49731b467 100644 (file)
@@ -490,8 +490,11 @@ int processlist_add(  ProcessList *process_list,
    * overriden by the new state before anything is drawn.
    */
   hashed_process_data->x.over = 0;
+  hashed_process_data->x.over_used = FALSE;
   hashed_process_data->x.middle = 0;
+  hashed_process_data->x.middle_used = FALSE;
   hashed_process_data->x.under = 0;
+  hashed_process_data->x.under_used = FALSE;
   
   /* Add a new row to the model */
   gtk_list_store_append ( process_list->list_store,
index 808e5fab4d4e5656aa2fae5d22a066edec142085..a0a2e7fc364c71c0ad8bee40d5bbda1fc1393aa7 100644 (file)
@@ -60,8 +60,14 @@ typedef struct _HashedProcessData {
   /* Information on current drawing */
   struct {
     guint over;
+    gboolean over_used;    /* inform the user that information is incomplete */
+    gboolean over_marked;  /* inform the user that information is incomplete */
     guint middle;
+    gboolean middle_used;  /* inform the user that information is incomplete */
+    gboolean middle_marked;/* inform the user that information is incomplete */
     guint under;
+    gboolean under_used;   /* inform the user that information is incomplete */
+    gboolean under_marked; /* inform the user that information is incomplete */
   } x; /* last x position saved by after state update */
 
   // FIXME : add info on last event ?
This page took 0.0318 seconds and 4 git commands to generate.