whole new time bar, plus some additions to control flow viewer.. this is work in...
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / drawing.c
index 2cd92c2eedafc3d4e36499b9b8310b8912171cc4..8ef1b4300bd9e346446be55c211dfeede78da761 100644 (file)
 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
 #define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
 
+
+GdkColor drawing_colors[NUM_COLORS] =
+{ /* Pixel, R, G, B */
+  { 0, 0, 0, 0 }, /* COL_BLACK */
+  { 0, 0xFFFF, 0xFFFF, 0xFFFF }, /* COL_WHITE */
+  { 0, 0x0fff, 0xffff, 0xfff0 }, /* COL_WAIT_FORK */
+  { 0, 0xffff, 0xffff, 0x0000 }, /* COL_WAIT_CPU */
+  { 0, 0xffff, 0x0000, 0xffff }, /* COL_EXIT */
+  { 0, 0xffff, 0x0000, 0x0000 }, /* COL_WAIT */
+  { 0, 0x0000, 0xffff, 0x0000 }  /* COL_RUN */
+};
+
+
+
 /*****************************************************************************
  *                              drawing functions                            *
  *****************************************************************************/
@@ -44,28 +58,6 @@ static gboolean
 motion_notify_ruler(GtkWidget *widget, GdkEventMotion *event, gpointer user_data);
 
 
-//FIXME Colors will need to be dynamic. Graphic context part not done so far.
-typedef enum 
-{
-  RED,
-  GREEN,
-  BLUE,
-  WHITE,
-  BLACK
-
-} ControlFlowColors;
-
-/* Vector of unallocated colors */
-static GdkColor CF_Colors [] = 
-{
-  { 0, 0xffff, 0x0000, 0x0000 },  // RED
-  { 0, 0x0000, 0xffff, 0x0000 },  // GREEN
-  { 0, 0x0000, 0x0000, 0xffff },  // BLUE
-  { 0, 0xffff, 0xffff, 0xffff },  // WHITE
-  { 0, 0x0000, 0x0000, 0x0000 } // BLACK
-};
-
-
 /* Function responsible for updating the exposed area.
  * It must do an events request to the lttvwindow API to ask for this update.
  * Note : this function cannot clear the background, because it may
@@ -234,7 +226,8 @@ void drawing_chunk_begin(EventsRequest *events_request, LttvTracesetState *tss)
   LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tss);
   LttTime current_time = lttv_traceset_context_get_current_tfc(tsc)->timestamp;
 
-  cfd->drawing->last_start = current_time;
+  cfd->drawing->last_start = LTT_TIME_MIN(current_time,
+                                          events_request->end_time);
 }
 
 
@@ -490,7 +483,7 @@ button_press_event( GtkWidget *widget, GdkEventButton *event, gpointer user_data
         window_end,
         &time);
 
-    lttvwindow_report_current_time(control_flow_data->tab, &time);
+    lttvwindow_report_current_time(control_flow_data->tab, time);
 
   }
 
This page took 0.024118 seconds and 4 git commands to generate.