-
-#if 0
-
-/*// if( histo_new_time_window->time_width.tv_sec == histo_old_time_window->time_width.tv_sec
- && histo_new_time_window->time_width.tv_nsec == histo_old_time_window->time_width.tv_nsec)
- {
- // Same scale (scrolling)
- g_info("scrolling");
- /* For histogram,
- while scrolling no matter far or near ,
- right or left it's necessary to redraw whole screen!*/
-/*// LttTime *ns = &histo_new_time_window->start_time;
- LttTime *nw = &histo_new_time_window->time_width;
- LttTime *os = &histo_old_time_window->start_time;
- LttTime *ow = &histo_old_time_window->time_width;
- LttTime histo_old_end = histo_old_time_window->end_time;
- LttTime histo_new_end = histo_new_time_window->end_time;
- //if(ns<os+w<ns+w)
- //if(ns<os+w && os+w<ns+w)
- //if(ns<histo_old_end && os<ns)
-
- //added for histogram
- gtk_widget_queue_draw(drawing->drawing_area);
-
- drawing->damage_begin = 0;
- drawing->damage_end = drawing->width;
-
- //replaced for hisogram
- histo_request_event(histocontrol_flow_data,drawing->damage_begin,
- drawing->damage_end- drawing->damage_begin);
-/*
- if(ltt_time_compare(*ns, histo_old_end) == -1
- && ltt_time_compare(*os, *ns) == -1)
- {
- g_info("scrolling near right");
- // Scroll right, keep right part of the screen
- guint x = 0;
- guint width = drawing->width;
- histo_convert_time_to_pixels(
- *histo_old_time_window,
- *ns,
- width,
- &x);
-
- // Copy old data to new location
- //replaced for histogram:
- histo_copy_pixmap_region(drawing,NULL,
- drawing->drawing_area->style->black_gc,//drawing->gc,
- NULL,
- x, 0,
- 0, 0, (drawing->width-x)
- , -1);
-
- if(drawing->damage_begin == drawing->damage_end)
- drawing->damage_begin = drawing->width-x;
- else
- drawing->damage_begin = 0;
-
- drawing->damage_end = drawing->width;
-
-//(histo) copy corresponding array region too:
- guint i;
-
- for(i=0; i < histocontrol_flow_data->number_of_process->len-x;i++)
- {
- g_array_index(histocontrol_flow_data->number_of_process, guint, i) =
- g_array_index(histocontrol_flow_data->number_of_process, guint, i+x);
- }
-
- // Clear the data request background, but not SAFETY
-
-
-//not necessary for histo, because in before chunk ,it clears the area
-/* histo_rectangle_pixmap (
- drawing->drawing_area->style->black_gc,
- TRUE,
- drawing->damage_begin, 0,
- drawing->damage_end - drawing->damage_begin, // do not overlap
- -1,drawing);
-*/
- /* gtk_widget_queue_draw(drawing->drawing_area);
- //gtk_widget_queue_draw_area (drawing->drawing_area,
- // 0,0,
- // histocontrol_flow_data->drawing->width,
- // histocontrol_flow_data->drawing->height);
-
- // Get new data for the rest.
- //replaced for hisogram
- histo_request_event(histocontrol_flow_data,drawing->damage_begin,
- drawing->damage_end- drawing->damage_begin);
- } else {
- //if(ns<os<ns+w)
- //if(ns<os && os<ns+w)
- //if(ns<os && os<histo_new_end)
- if(ltt_time_compare(*ns,*os) == -1
- && ltt_time_compare(*os,histo_new_end) == -1)
- {
- g_info("scrolling near left");
- // Scroll left, keep left part of the screen
- guint x = 0;
- guint width = drawing->width;
- histo_convert_time_to_pixels(
- *histo_new_time_window,
- *os,
- width,
- &x);
-
- // Copy old data to new location
- //replaced for histogram
-
- histo_copy_pixmap_region(drawing,NULL,
- drawing->drawing_area->style->black_gc,//drawing->gc,
- NULL,
- 0, 0,
- x, 0, -1, -1);
- //(histo) copy corresponding array region too:
- guint i;
- for(i=histocontrol_flow_data->number_of_process->len; i > x-1;i--)
- {
- g_array_index(histocontrol_flow_data->number_of_process, guint, i) =
- g_array_index(histocontrol_flow_data->number_of_process, guint, i-x);
- }
-
- if(drawing->damage_begin == drawing->damage_end)
- drawing->damage_end = x;
- else
- drawing->damage_end =
- drawing->width;
-
- drawing->damage_begin = 0;
-
-
-//not necessary for histo, because in before chunk ,it clears the area
- /* histo_rectangle_pixmap (drawing->drawing_area->style->black_gc,
- TRUE,
- drawing->damage_begin, 0,
- drawing->damage_end - drawing->damage_begin, // do not overlap
- -1,drawing);
-*/
- /* gtk_widget_queue_draw(drawing->drawing_area);
- //gtk_widget_queue_draw_area (drawing->drawing_area,
- // 0,0,
- // histocontrol_flow_data->drawing->width,
- // histocontrol_flow_data->drawing->height);
-
-
- // Get new data for the rest.
-
-//replaced for hisogram
- histo_request_event(histocontrol_flow_data,drawing->damage_begin,
- drawing->damage_end- drawing->damage_begin);
-
- } else {
- if(ltt_time_compare(*ns,*os) == 0)
- {
- g_info("not scrolling");
- } else {
- g_info("scrolling far");
- // Cannot reuse any part of the screen : far jump
-
- //not necessary for histo, because in before chunk ,it clears the area
- /* histo_rectangle_pixmap (histocontrol_flow_data->drawing->drawing_area->style->black_gc,
- TRUE,
- 0, 0,
- histocontrol_flow_data->drawing->width,//+SAFETY, // do not overlap
- -1,drawing);
-*/
- //gtk_widget_queue_draw_area (drawing->drawing_area,
- // 0,0,
- // histocontrol_flow_data->drawing->width,
- // histocontrol_flow_data->drawing->height);
-/* gtk_widget_queue_draw(drawing->drawing_area);
-
- drawing->damage_begin = 0;
- drawing->damage_end = histocontrol_flow_data->drawing->width;
-/*
- histo_drawing_data_request(histocontrol_flow_data->drawing,
- 0, 0,
- histocontrol_flow_data->drawing->width,
- histocontrol_flow_data->drawing->height);*/
- //replaced for hisogram
- /* histo_request_event(histocontrol_flow_data,drawing->damage_begin,
- drawing->damage_end- drawing->damage_begin);
- }
- }
- }
- } else {
- // Different scale (zoom)
- g_info("zoom");
-
- //not necessary for histo, because in before chunk ,it clears the area
- /*
- histo_rectangle_pixmap (drawing->drawing_area->style->black_gc,
- TRUE,
- 0, 0,
- histocontrol_flow_data->drawing->width+SAFETY, // do not overlap
- -1,drawing);
-*/
- //gtk_widget_queue_draw_area (drawing->drawing_area,
- // 0,0,
- // histocontrol_flow_data->drawing->width,
- // histocontrol_flow_data->drawing->height);
-/*// gtk_widget_queue_draw(drawing->drawing_area);
-
- drawing->damage_begin = 0;
- drawing->damage_end = drawing->width;
-
- //replaced for hisogram
- histo_request_event(histocontrol_flow_data,drawing->damage_begin,
- drawing->damage_end- drawing->damage_begin);
- }
-
- // Update directly when scrolling
- gdk_window_process_updates(drawing->drawing_area->window,
- TRUE);
-
- //show number of event at current time
-
- histo_drawing_update_vertical_ruler(drawing);
-*/
-#endif
-
-//disabled for histogram, always redraw whole screen.