#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 *
*****************************************************************************/
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
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);
}
LttTime window_end = ltt_time_add(time_window.time_width,
time_window.start_time);
- convert_time_to_pixels(
- time_window.start_time,
- window_end,
- current_time,
- drawing->width,
- &cursor_x);
-
/* update the screen from the pixmap buffer */
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
event->area.x, event->area.y,
event->area.width, event->area.height);
+
+ if(ltt_time_compare(time_window.start_time, current_time) <= 0 &&
+ ltt_time_compare(window_end, current_time) >= 0)
+ {
+ /* Draw the dotted lines */
+ convert_time_to_pixels(
+ time_window.start_time,
+ window_end,
+ current_time,
+ drawing->width,
+ &cursor_x);
- /* Draw the dotted lines */
- if(drawing->dotted_gc == NULL) {
+ if(drawing->dotted_gc == NULL) {
- drawing->dotted_gc = gdk_gc_new(drawing->drawing_area->window);
- gdk_gc_copy(drawing->dotted_gc, widget->style->white_gc);
-
- gint8 dash_list[] = { 1, 2 };
- gdk_gc_set_line_attributes(drawing->dotted_gc,
- 1,
- GDK_LINE_ON_OFF_DASH,
- GDK_CAP_BUTT,
- GDK_JOIN_MITER);
- gdk_gc_set_dashes(drawing->dotted_gc,
- 0,
- dash_list,
- 2);
- }
+ drawing->dotted_gc = gdk_gc_new(drawing->drawing_area->window);
+ gdk_gc_copy(drawing->dotted_gc, widget->style->white_gc);
+
+ gint8 dash_list[] = { 1, 2 };
+ gdk_gc_set_line_attributes(drawing->dotted_gc,
+ 1,
+ GDK_LINE_ON_OFF_DASH,
+ GDK_CAP_BUTT,
+ GDK_JOIN_MITER);
+ gdk_gc_set_dashes(drawing->dotted_gc,
+ 0,
+ dash_list,
+ 2);
+ }
- drawing_draw_line(NULL, widget->window,
- cursor_x, 0,
- cursor_x, drawing->height,
- drawing->dotted_gc);
+ drawing_draw_line(NULL, widget->window,
+ cursor_x, 0,
+ cursor_x, drawing->height,
+ drawing->dotted_gc);
+ }
return FALSE;
}
window_end,
&time);
- lttvwindow_report_current_time(control_flow_data->tab, &time);
+ lttvwindow_report_current_time(control_flow_data->tab, time);
}
- lttvwindow_report_focus(control_flow_data->tab,
- gtk_widget_get_parent(guicontrolflow_get_widget(control_flow_data)));
-
return FALSE;
}
drawing->ruler_hbox = gtk_hbox_new(FALSE, 1);
drawing->ruler = gtk_drawing_area_new ();
- gtk_widget_add_events(drawing->ruler, GDK_BUTTON_PRESS_MASK);
//gtk_widget_set_size_request(drawing->ruler, -1, 27);
drawing->padding = gtk_drawing_area_new ();
- gtk_widget_add_events(drawing->padding, GDK_BUTTON_PRESS_MASK);
//gtk_widget_set_size_request(drawing->padding, -1, 27);
gtk_box_pack_start(GTK_BOX(drawing->ruler_hbox), drawing->ruler,
TRUE, TRUE, 0);
// drawing->drawing_area->allocation.height,
// -1);
- gtk_widget_add_events(drawing->drawing_area, GDK_BUTTON_PRESS_MASK);
-
g_signal_connect (G_OBJECT(drawing->drawing_area),
"configure_event",
G_CALLBACK (configure_event),
LttTime window_time_interval;
double interval_double, time_double;
+ g_assert(ltt_time_compare(window_time_begin, time) <= 0 &&
+ ltt_time_compare(window_time_end, time) >= 0);
+
window_time_interval = ltt_time_sub(window_time_end,window_time_begin);
time = ltt_time_sub(time, window_time_begin);