From e72908ed8d4eeefde92f303b49d375b58476833a Mon Sep 17 00:00:00 2001 From: compudj Date: Fri, 13 Aug 2004 17:06:38 +0000 Subject: [PATCH] add missing information indicator git-svn-id: http://ltt.polymtl.ca/svn@723 04897980-b3bd-0310-b5e0-8ef037075253 --- .../lttv/modules/gui/controlflow/drawing.c | 6 + .../lttv/modules/gui/controlflow/eventhooks.c | 124 ++++++++++++++++-- .../modules/gui/controlflow/processlist.c | 3 + .../modules/gui/controlflow/processlist.h | 6 + 4 files changed, 125 insertions(+), 14 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index 9b977199..b71dafac 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -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; } diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c index 4441712a..97020813 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c @@ -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; + } } } } diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c index 924d8c52..9bedbc99 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c @@ -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, diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h index 808e5fab..a0a2e7fc 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.h @@ -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 ? -- 2.34.1