X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2FguiControlFlow%2FEvent_Hooks.c;h=111e13409452d240d48b4aefc608bdd2e17e4ac1;hb=14963be07f6a9c7c2db0d988f557b870ebd5dead;hp=ee2891960df68a9774de0d79737c3f56e06bf4c5;hpb=a56a1ba44968b834968a8ab0f39d4f64eb6b5e5c;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c b/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c index ee289196..111e1340 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c @@ -40,66 +40,66 @@ * * This constructor is given as a parameter to the menuitem and toolbar button * registration. It creates the list. - * @param pmParentWindow A pointer to the parent window. + * @param mw A pointer to the parent window. * @return The widget created. */ GtkWidget * -h_guicontrolflow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * key) +h_guicontrolflow(MainWindow *mw, LttvTracesetSelector * s, char * key) { - g_info("h_guicontrolflow, %p, %p, %s", pmParentWindow, s, key); - ControlFlowData *Control_Flow_Data = guicontrolflow() ; + g_info("h_guicontrolflow, %p, %p, %s", mw, s, key); + ControlFlowData *control_flow_data = guicontrolflow() ; - Control_Flow_Data->Parent_Window = pmParentWindow; - TimeWindow *time_window = guicontrolflow_get_time_window(Control_Flow_Data); + control_flow_data->mw = mw; + TimeWindow *time_window = guicontrolflow_get_time_window(control_flow_data); time_window->start_time.tv_sec = 0; time_window->start_time.tv_nsec = 0; time_window->time_width.tv_sec = 0; time_window->time_width.tv_nsec = 0; - LttTime *current_time = guicontrolflow_get_current_time(Control_Flow_Data); + LttTime *current_time = guicontrolflow_get_current_time(control_flow_data); current_time->tv_sec = 0; current_time->tv_nsec = 0; //g_critical("time width1 : %u",time_window->time_width); - get_time_window(pmParentWindow, + get_time_window(mw, time_window); - get_current_time(pmParentWindow, + get_current_time(mw, current_time); //g_critical("time width2 : %u",time_window->time_width); // Unreg done in the GuiControlFlow_Destructor - reg_update_time_window(update_time_window_hook, Control_Flow_Data, - pmParentWindow); - reg_update_current_time(update_current_time_hook, Control_Flow_Data, - pmParentWindow); - return guicontrolflow_get_widget(Control_Flow_Data) ; + reg_update_time_window(update_time_window_hook, control_flow_data, + mw); + reg_update_current_time(update_current_time_hook, control_flow_data, + mw); + return guicontrolflow_get_widget(control_flow_data) ; } int event_selected_hook(void *hook_data, void *call_data) { - ControlFlowData *Control_Flow_Data = (ControlFlowData*) hook_data; - guint *Event_Number = (guint*) call_data; + ControlFlowData *control_flow_data = (ControlFlowData*) hook_data; + guint *event_number = (guint*) call_data; - g_critical("DEBUG : event selected by main window : %u", *Event_Number); + g_critical("DEBUG : event selected by main window : %u", *event_number); -// Control_Flow_Data->Currently_Selected_Event = *Event_Number; -// Control_Flow_Data->Selected_Event = TRUE ; +// control_flow_data->currently_Selected_Event = *event_number; +// control_flow_data->Selected_Event = TRUE ; -// tree_v_set_cursor(Control_Flow_Data); +// tree_v_set_cursor(control_flow_data); } /* Hook called before drawing. Gets the initial context at the beginning of the - * drawing interval and copy it to the context in Event_Request. + * drawing interval and copy it to the context in event_request. */ int draw_before_hook(void *hook_data, void *call_data) { - EventRequest *Event_Request = (EventRequest*)hook_data; + EventRequest *event_request = (EventRequest*)hook_data; //EventsContext Events_Context = (EventsContext*)call_data; - //Event_Request->Events_Context = Events_Context; + //event_request->Events_Context = Events_Context; return 0; } @@ -126,8 +126,8 @@ int draw_before_hook(void *hook_data, void *call_data) */ int draw_event_hook(void *hook_data, void *call_data) { - EventRequest *Event_Request = (EventRequest*)hook_data; - ControlFlowData *control_flow_data = Event_Request->Control_Flow_Data; + EventRequest *event_request = (EventRequest*)hook_data; + ControlFlowData *control_flow_data = event_request->control_flow_data; LttvTracefileContext *tfc = (LttvTracefileContext *)call_data; @@ -149,7 +149,7 @@ int draw_event_hook(void *hook_data, void *call_data) guint y_in = 0, y_out = 0, height = 0, pl_height = 0; ProcessList *process_list = - guicontrolflow_get_process_list(Event_Request->Control_Flow_Data); + guicontrolflow_get_process_list(event_request->control_flow_data); LttField *f = ltt_event_field(e); @@ -167,14 +167,14 @@ int draw_event_hook(void *hook_data, void *call_data) birth = process_out->creation_time; gchar *name = strdup(g_quark_to_string(process_out->name)); - HashedProcessData *Hashed_Process_Data_out = NULL; + HashedProcessData *hashed_process_data_out = NULL; if(processlist_get_process_pixels(process_list, pid_out, &birth, &y_out, &height, - &Hashed_Process_Data_out) == 1) + &hashed_process_data_out) == 1) { /* Process not present */ processlist_add(process_list, @@ -182,14 +182,14 @@ int draw_event_hook(void *hook_data, void *call_data) &birth, name, &pl_height, - &Hashed_Process_Data_out); + &hashed_process_data_out); processlist_get_process_pixels(process_list, pid_out, &birth, &y_out, &height, - &Hashed_Process_Data_out); - drawing_insert_square( Event_Request->Control_Flow_Data->Drawing, y_out, height); + &hashed_process_data_out); + drawing_insert_square( event_request->control_flow_data->Drawing, y_out, height); } g_free(name); @@ -200,14 +200,14 @@ int draw_event_hook(void *hook_data, void *call_data) birth = process_in->creation_time; name = strdup(g_quark_to_string(process_in->name)); - HashedProcessData *Hashed_Process_Data_in = NULL; + HashedProcessData *hashed_process_data_in = NULL; if(processlist_get_process_pixels(process_list, pid_in, &birth, &y_in, &height, - &Hashed_Process_Data_in) == 1) + &hashed_process_data_in) == 1) { /* Process not present */ processlist_add(process_list, @@ -215,15 +215,15 @@ int draw_event_hook(void *hook_data, void *call_data) &birth, name, &pl_height, - &Hashed_Process_Data_in); + &hashed_process_data_in); processlist_get_process_pixels(process_list, pid_in, &birth, &y_in, &height, - &Hashed_Process_Data_in); + &hashed_process_data_in); - drawing_insert_square( Event_Request->Control_Flow_Data->Drawing, y_in, height); + drawing_insert_square( event_request->control_flow_data->Drawing, y_in, height); } g_free(name); @@ -231,16 +231,16 @@ int draw_event_hook(void *hook_data, void *call_data) /* Find pixels corresponding to time of the event. If the time does * not fit in the window, show a warning, not supposed to happend. */ guint x = 0; - guint width = control_flow_data->Drawing->Drawing_Area_V->allocation.width; + guint width = control_flow_data->Drawing->drawing_area->allocation.width; LttTime time = ltt_event_time(e); - LttTime window_end = ltt_time_add(control_flow_data->Time_Window.time_width, - control_flow_data->Time_Window.start_time); + LttTime window_end = ltt_time_add(control_flow_data->time_window.time_width, + control_flow_data->time_window.start_time); convert_time_to_pixels( - control_flow_data->Time_Window.start_time, + control_flow_data->time_window.start_time, window_end, time, width, @@ -250,12 +250,12 @@ int draw_event_hook(void *hook_data, void *call_data) /* draw what represents the event for outgoing process. */ - DrawContext *draw_context_out = Hashed_Process_Data_out->draw_context; - draw_context_out->Current->modify_over->x = x; - draw_context_out->Current->modify_over->y = y_out; + DrawContext *draw_context_out = hashed_process_data_out->draw_context; + draw_context_out->current->modify_over->x = x; + draw_context_out->current->modify_over->y = y_out; draw_context_out->drawable = control_flow_data->Drawing->Pixmap; draw_context_out->pango_layout = control_flow_data->Drawing->pango_layout; - GtkWidget *widget = control_flow_data->Drawing->Drawing_Area_V; + GtkWidget *widget = control_flow_data->Drawing->drawing_area; //draw_context_out->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)]; draw_context_out->gc = gdk_gc_new(control_flow_data->Drawing->Pixmap); gdk_gc_copy(draw_context_out->gc, widget->style->black_gc); @@ -274,33 +274,33 @@ int draw_event_hook(void *hook_data, void *call_data) /* Print status of the process : U, WF, WC, E, W, R */ if(process_out->state->s == LTTV_STATE_UNNAMED) - prop_text_out.Text = "U"; + prop_text_out.text = "U"; else if(process_out->state->s == LTTV_STATE_WAIT_FORK) - prop_text_out.Text = "WF"; + prop_text_out.text = "WF"; else if(process_out->state->s == LTTV_STATE_WAIT_CPU) - prop_text_out.Text = "WC"; + prop_text_out.text = "WC"; else if(process_out->state->s == LTTV_STATE_EXIT) - prop_text_out.Text = "E"; + prop_text_out.text = "E"; else if(process_out->state->s == LTTV_STATE_WAIT) - prop_text_out.Text = "W"; + prop_text_out.text = "W"; else if(process_out->state->s == LTTV_STATE_RUN) - prop_text_out.Text = "R"; + prop_text_out.text = "R"; else - prop_text_out.Text = "U"; + prop_text_out.text = "U"; draw_text((void*)&prop_text_out, (void*)draw_context_out); gdk_gc_unref(draw_context_out->gc); /* Draw the line of the out process */ - if(draw_context_out->Previous->middle->x == -1) + if(draw_context_out->previous->middle->x == -1) { - draw_context_out->Previous->middle->x = Event_Request->x_begin; - g_critical("out middle x_beg : %u",Event_Request->x_begin); + draw_context_out->previous->middle->x = event_request->x_begin; + g_critical("out middle x_beg : %u",event_request->x_begin); } - draw_context_out->Current->middle->x = x; - draw_context_out->Current->middle->y = y_out + height/2; - draw_context_out->Previous->middle->y = y_out + height/2; + draw_context_out->current->middle->x = x; + draw_context_out->current->middle->y = y_out + height/2; + draw_context_out->previous->middle->y = y_out + height/2; draw_context_out->drawable = control_flow_data->Drawing->Pixmap; draw_context_out->pango_layout = control_flow_data->Drawing->pango_layout; //draw_context_out->gc = widget->style->black_gc; @@ -364,12 +364,12 @@ int draw_event_hook(void *hook_data, void *call_data) /* Finally, update the drawing context of the pid_in. */ - DrawContext *draw_context_in = Hashed_Process_Data_in->draw_context; - draw_context_in->Current->modify_over->x = x; - draw_context_in->Current->modify_over->y = y_in; + DrawContext *draw_context_in = hashed_process_data_in->draw_context; + draw_context_in->current->modify_over->x = x; + draw_context_in->current->modify_over->y = y_in; draw_context_in->drawable = control_flow_data->Drawing->Pixmap; draw_context_in->pango_layout = control_flow_data->Drawing->pango_layout; - widget = control_flow_data->Drawing->Drawing_Area_V; + widget = control_flow_data->Drawing->drawing_area; //draw_context_in->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)]; //draw_context_in->gc = widget->style->black_gc; draw_context_in->gc = gdk_gc_new(control_flow_data->Drawing->Pixmap); @@ -388,33 +388,33 @@ int draw_event_hook(void *hook_data, void *call_data) /* Print status of the process : U, WF, WC, E, W, R */ if(process_in->state->s == LTTV_STATE_UNNAMED) - prop_text_in.Text = "U"; + prop_text_in.text = "U"; else if(process_in->state->s == LTTV_STATE_WAIT_FORK) - prop_text_in.Text = "WF"; + prop_text_in.text = "WF"; else if(process_in->state->s == LTTV_STATE_WAIT_CPU) - prop_text_in.Text = "WC"; + prop_text_in.text = "WC"; else if(process_in->state->s == LTTV_STATE_EXIT) - prop_text_in.Text = "E"; + prop_text_in.text = "E"; else if(process_in->state->s == LTTV_STATE_WAIT) - prop_text_in.Text = "W"; + prop_text_in.text = "W"; else if(process_in->state->s == LTTV_STATE_RUN) - prop_text_in.Text = "R"; + prop_text_in.text = "R"; else - prop_text_in.Text = "U"; + prop_text_in.text = "U"; draw_text((void*)&prop_text_in, (void*)draw_context_in); gdk_gc_unref(draw_context_in->gc); /* Draw the line of the in process */ - if(draw_context_in->Previous->middle->x == -1) + if(draw_context_in->previous->middle->x == -1) { - draw_context_in->Previous->middle->x = Event_Request->x_begin; - g_critical("in middle x_beg : %u",Event_Request->x_begin); + draw_context_in->previous->middle->x = event_request->x_begin; + g_critical("in middle x_beg : %u",event_request->x_begin); } - draw_context_in->Current->middle->x = x; - draw_context_in->Previous->middle->y = y_in + height/2; - draw_context_in->Current->middle->y = y_in + height/2; + draw_context_in->current->middle->x = x; + draw_context_in->previous->middle->y = y_in + height/2; + draw_context_in->current->middle->y = y_in + height/2; draw_context_in->drawable = control_flow_data->Drawing->Pixmap; draw_context_in->pango_layout = control_flow_data->Drawing->pango_layout; //draw_context_in->gc = widget->style->black_gc; @@ -503,8 +503,8 @@ int draw_event_hook(void *hook_data, void *call_data) int draw_after_hook(void *hook_data, void *call_data) { - EventRequest *Event_Request = (EventRequest*)hook_data; - ControlFlowData *control_flow_data = Event_Request->Control_Flow_Data; + EventRequest *event_request = (EventRequest*)hook_data; + ControlFlowData *control_flow_data = event_request->control_flow_data; LttvTracefileContext *tfc = (LttvTracefileContext *)call_data; @@ -526,7 +526,7 @@ int draw_after_hook(void *hook_data, void *call_data) guint y_in = 0, y_out = 0, height = 0, pl_height = 0; ProcessList *process_list = - guicontrolflow_get_process_list(Event_Request->Control_Flow_Data); + guicontrolflow_get_process_list(event_request->control_flow_data); LttField *f = ltt_event_field(e); @@ -544,14 +544,14 @@ int draw_after_hook(void *hook_data, void *call_data) birth = process_out->creation_time; gchar *name = strdup(g_quark_to_string(process_out->name)); - HashedProcessData *Hashed_Process_Data_out = NULL; + HashedProcessData *hashed_process_data_out = NULL; if(processlist_get_process_pixels(process_list, pid_out, &birth, &y_out, &height, - &Hashed_Process_Data_out) == 1) + &hashed_process_data_out) == 1) { /* Process not present */ processlist_add(process_list, @@ -559,14 +559,14 @@ int draw_after_hook(void *hook_data, void *call_data) &birth, name, &pl_height, - &Hashed_Process_Data_out); + &hashed_process_data_out); processlist_get_process_pixels(process_list, pid_out, &birth, &y_out, &height, - &Hashed_Process_Data_out); - drawing_insert_square( Event_Request->Control_Flow_Data->Drawing, y_out, height); + &hashed_process_data_out); + drawing_insert_square( event_request->control_flow_data->Drawing, y_out, height); } g_free(name); @@ -577,14 +577,14 @@ int draw_after_hook(void *hook_data, void *call_data) birth = process_in->creation_time; name = strdup(g_quark_to_string(process_in->name)); - HashedProcessData *Hashed_Process_Data_in = NULL; + HashedProcessData *hashed_process_data_in = NULL; if(processlist_get_process_pixels(process_list, pid_in, &birth, &y_in, &height, - &Hashed_Process_Data_in) == 1) + &hashed_process_data_in) == 1) { /* Process not present */ processlist_add(process_list, @@ -592,15 +592,15 @@ int draw_after_hook(void *hook_data, void *call_data) &birth, name, &pl_height, - &Hashed_Process_Data_in); + &hashed_process_data_in); processlist_get_process_pixels(process_list, pid_in, &birth, &y_in, &height, - &Hashed_Process_Data_in); + &hashed_process_data_in); - drawing_insert_square( Event_Request->Control_Flow_Data->Drawing, y_in, height); + drawing_insert_square( event_request->control_flow_data->Drawing, y_in, height); } g_free(name); @@ -608,16 +608,16 @@ int draw_after_hook(void *hook_data, void *call_data) /* Find pixels corresponding to time of the event. If the time does * not fit in the window, show a warning, not supposed to happend. */ //guint x = 0; - //guint width = control_flow_data->Drawing->Drawing_Area_V->allocation.width; + //guint width = control_flow_data->Drawing->drawing_area->allocation.width; //LttTime time = ltt_event_time(e); - //LttTime window_end = ltt_time_add(control_flow_data->Time_Window.time_width, - // control_flow_data->Time_Window.start_time); + //LttTime window_end = ltt_time_add(control_flow_data->time_window.time_width, + // control_flow_data->time_window.start_time); //convert_time_to_pixels( - // control_flow_data->Time_Window.start_time, + // control_flow_data->time_window.start_time, // window_end, // time, // width, @@ -627,12 +627,12 @@ int draw_after_hook(void *hook_data, void *call_data) /* draw what represents the event for outgoing process. */ - DrawContext *draw_context_out = Hashed_Process_Data_out->draw_context; - //draw_context_out->Current->modify_over->x = x; - draw_context_out->Current->modify_over->y = y_out; + DrawContext *draw_context_out = hashed_process_data_out->draw_context; + //draw_context_out->current->modify_over->x = x; + draw_context_out->current->modify_over->y = y_out; draw_context_out->drawable = control_flow_data->Drawing->Pixmap; draw_context_out->pango_layout = control_flow_data->Drawing->pango_layout; - GtkWidget *widget = control_flow_data->Drawing->Drawing_Area_V; + GtkWidget *widget = control_flow_data->Drawing->drawing_area; //draw_context_out->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)]; draw_context_out->gc = widget->style->black_gc; @@ -649,65 +649,65 @@ int draw_after_hook(void *hook_data, void *call_data) /* Print status of the process : U, WF, WC, E, W, R */ if(process_out->state->s == LTTV_STATE_UNNAMED) - prop_text_out.Text = "U"; + prop_text_out.text = "U"; else if(process_out->state->s == LTTV_STATE_WAIT_FORK) - prop_text_out.Text = "WF"; + prop_text_out.text = "WF"; else if(process_out->state->s == LTTV_STATE_WAIT_CPU) - prop_text_out.Text = "WC"; + prop_text_out.text = "WC"; else if(process_out->state->s == LTTV_STATE_EXIT) - prop_text_out.Text = "E"; + prop_text_out.text = "E"; else if(process_out->state->s == LTTV_STATE_WAIT) - prop_text_out.Text = "W"; + prop_text_out.text = "W"; else if(process_out->state->s == LTTV_STATE_RUN) - prop_text_out.Text = "R"; + prop_text_out.text = "R"; else - prop_text_out.Text = "U"; + prop_text_out.text = "U"; draw_text((void*)&prop_text_out, (void*)draw_context_out); - draw_context_out->Current->middle->y = y_out+height/2; - draw_context_out->Current->status = process_out->state->s; + draw_context_out->current->middle->y = y_out+height/2; + draw_context_out->current->status = process_out->state->s; - /* for pid_out : remove Previous, Prev = Current, new Current (default) */ - g_free(draw_context_out->Previous->modify_under); - g_free(draw_context_out->Previous->modify_middle); - g_free(draw_context_out->Previous->modify_over); - g_free(draw_context_out->Previous->under); - g_free(draw_context_out->Previous->middle); - g_free(draw_context_out->Previous->over); - g_free(draw_context_out->Previous); - - draw_context_out->Previous = draw_context_out->Current; + /* for pid_out : remove previous, Prev = current, new current (default) */ + g_free(draw_context_out->previous->modify_under); + g_free(draw_context_out->previous->modify_middle); + g_free(draw_context_out->previous->modify_over); + g_free(draw_context_out->previous->under); + g_free(draw_context_out->previous->middle); + g_free(draw_context_out->previous->over); + g_free(draw_context_out->previous); + + draw_context_out->previous = draw_context_out->current; - draw_context_out->Current = g_new(DrawInfo,1); - draw_context_out->Current->over = g_new(ItemInfo,1); - draw_context_out->Current->over->x = -1; - draw_context_out->Current->over->y = -1; - draw_context_out->Current->middle = g_new(ItemInfo,1); - draw_context_out->Current->middle->x = -1; - draw_context_out->Current->middle->y = -1; - draw_context_out->Current->under = g_new(ItemInfo,1); - draw_context_out->Current->under->x = -1; - draw_context_out->Current->under->y = -1; - draw_context_out->Current->modify_over = g_new(ItemInfo,1); - draw_context_out->Current->modify_over->x = -1; - draw_context_out->Current->modify_over->y = -1; - draw_context_out->Current->modify_middle = g_new(ItemInfo,1); - draw_context_out->Current->modify_middle->x = -1; - draw_context_out->Current->modify_middle->y = -1; - draw_context_out->Current->modify_under = g_new(ItemInfo,1); - draw_context_out->Current->modify_under->x = -1; - draw_context_out->Current->modify_under->y = -1; - draw_context_out->Current->status = LTTV_STATE_UNNAMED; + draw_context_out->current = g_new(DrawInfo,1); + draw_context_out->current->over = g_new(ItemInfo,1); + draw_context_out->current->over->x = -1; + draw_context_out->current->over->y = -1; + draw_context_out->current->middle = g_new(ItemInfo,1); + draw_context_out->current->middle->x = -1; + draw_context_out->current->middle->y = -1; + draw_context_out->current->under = g_new(ItemInfo,1); + draw_context_out->current->under->x = -1; + draw_context_out->current->under->y = -1; + draw_context_out->current->modify_over = g_new(ItemInfo,1); + draw_context_out->current->modify_over->x = -1; + draw_context_out->current->modify_over->y = -1; + draw_context_out->current->modify_middle = g_new(ItemInfo,1); + draw_context_out->current->modify_middle->x = -1; + draw_context_out->current->modify_middle->y = -1; + draw_context_out->current->modify_under = g_new(ItemInfo,1); + draw_context_out->current->modify_under->x = -1; + draw_context_out->current->modify_under->y = -1; + draw_context_out->current->status = LTTV_STATE_UNNAMED; /* Finally, update the drawing context of the pid_in. */ - DrawContext *draw_context_in = Hashed_Process_Data_in->draw_context; - //draw_context_in->Current->modify_over->x = x; - draw_context_in->Current->modify_over->y = y_in; + DrawContext *draw_context_in = hashed_process_data_in->draw_context; + //draw_context_in->current->modify_over->x = x; + draw_context_in->current->modify_over->y = y_in; draw_context_in->drawable = control_flow_data->Drawing->Pixmap; draw_context_in->pango_layout = control_flow_data->Drawing->pango_layout; - widget = control_flow_data->Drawing->Drawing_Area_V; + widget = control_flow_data->Drawing->drawing_area; //draw_context_in->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)]; draw_context_in->gc = widget->style->black_gc; @@ -724,56 +724,56 @@ int draw_after_hook(void *hook_data, void *call_data) /* Print status of the process : U, WF, WC, E, W, R */ if(process_in->state->s == LTTV_STATE_UNNAMED) - prop_text_in.Text = "U"; + prop_text_in.text = "U"; else if(process_in->state->s == LTTV_STATE_WAIT_FORK) - prop_text_in.Text = "WF"; + prop_text_in.text = "WF"; else if(process_in->state->s == LTTV_STATE_WAIT_CPU) - prop_text_in.Text = "WC"; + prop_text_in.text = "WC"; else if(process_in->state->s == LTTV_STATE_EXIT) - prop_text_in.Text = "E"; + prop_text_in.text = "E"; else if(process_in->state->s == LTTV_STATE_WAIT) - prop_text_in.Text = "W"; + prop_text_in.text = "W"; else if(process_in->state->s == LTTV_STATE_RUN) - prop_text_in.Text = "R"; + prop_text_in.text = "R"; else - prop_text_in.Text = "U"; + prop_text_in.text = "U"; draw_text((void*)&prop_text_in, (void*)draw_context_in); - draw_context_in->Current->middle->y = y_in+height/2; - draw_context_in->Current->status = process_in->state->s; - - /* for pid_in : remove Previous, Prev = Current, new Current (default) */ - g_free(draw_context_in->Previous->modify_under); - g_free(draw_context_in->Previous->modify_middle); - g_free(draw_context_in->Previous->modify_over); - g_free(draw_context_in->Previous->under); - g_free(draw_context_in->Previous->middle); - g_free(draw_context_in->Previous->over); - g_free(draw_context_in->Previous); - - draw_context_in->Previous = draw_context_in->Current; + draw_context_in->current->middle->y = y_in+height/2; + draw_context_in->current->status = process_in->state->s; + + /* for pid_in : remove previous, Prev = current, new current (default) */ + g_free(draw_context_in->previous->modify_under); + g_free(draw_context_in->previous->modify_middle); + g_free(draw_context_in->previous->modify_over); + g_free(draw_context_in->previous->under); + g_free(draw_context_in->previous->middle); + g_free(draw_context_in->previous->over); + g_free(draw_context_in->previous); + + draw_context_in->previous = draw_context_in->current; - draw_context_in->Current = g_new(DrawInfo,1); - draw_context_in->Current->over = g_new(ItemInfo,1); - draw_context_in->Current->over->x = -1; - draw_context_in->Current->over->y = -1; - draw_context_in->Current->middle = g_new(ItemInfo,1); - draw_context_in->Current->middle->x = -1; - draw_context_in->Current->middle->y = -1; - draw_context_in->Current->under = g_new(ItemInfo,1); - draw_context_in->Current->under->x = -1; - draw_context_in->Current->under->y = -1; - draw_context_in->Current->modify_over = g_new(ItemInfo,1); - draw_context_in->Current->modify_over->x = -1; - draw_context_in->Current->modify_over->y = -1; - draw_context_in->Current->modify_middle = g_new(ItemInfo,1); - draw_context_in->Current->modify_middle->x = -1; - draw_context_in->Current->modify_middle->y = -1; - draw_context_in->Current->modify_under = g_new(ItemInfo,1); - draw_context_in->Current->modify_under->x = -1; - draw_context_in->Current->modify_under->y = -1; - draw_context_in->Current->status = LTTV_STATE_UNNAMED; + draw_context_in->current = g_new(DrawInfo,1); + draw_context_in->current->over = g_new(ItemInfo,1); + draw_context_in->current->over->x = -1; + draw_context_in->current->over->y = -1; + draw_context_in->current->middle = g_new(ItemInfo,1); + draw_context_in->current->middle->x = -1; + draw_context_in->current->middle->y = -1; + draw_context_in->current->under = g_new(ItemInfo,1); + draw_context_in->current->under->x = -1; + draw_context_in->current->under->y = -1; + draw_context_in->current->modify_over = g_new(ItemInfo,1); + draw_context_in->current->modify_over->x = -1; + draw_context_in->current->modify_over->y = -1; + draw_context_in->current->modify_middle = g_new(ItemInfo,1); + draw_context_in->current->modify_middle->x = -1; + draw_context_in->current->modify_middle->y = -1; + draw_context_in->current->modify_under = g_new(ItemInfo,1); + draw_context_in->current->modify_under->x = -1; + draw_context_in->current->modify_under->y = -1; + draw_context_in->current->status = LTTV_STATE_UNNAMED; } @@ -786,9 +786,9 @@ int draw_after_hook(void *hook_data, void *call_data) gint update_time_window_hook(void *hook_data, void *call_data) { ControlFlowData *control_flow_data = (ControlFlowData*) hook_data; - TimeWindow *Old_Time_Window = + TimeWindow *old_time_window = guicontrolflow_get_time_window(control_flow_data); - TimeWindow *New_Time_Window = ((TimeWindow*)call_data); + TimeWindow *new_time_window = ((TimeWindow*)call_data); /* Two cases : zoom in/out or scrolling */ @@ -798,28 +798,28 @@ gint update_time_window_hook(void *hook_data, void *call_data) */ g_info("Old time window HOOK : %u, %u to %u, %u", - Old_Time_Window->start_time.tv_sec, - Old_Time_Window->start_time.tv_nsec, - Old_Time_Window->time_width.tv_sec, - Old_Time_Window->time_width.tv_nsec); + old_time_window->start_time.tv_sec, + old_time_window->start_time.tv_nsec, + old_time_window->time_width.tv_sec, + old_time_window->time_width.tv_nsec); g_info("New time window HOOK : %u, %u to %u, %u", - New_Time_Window->start_time.tv_sec, - New_Time_Window->start_time.tv_nsec, - New_Time_Window->time_width.tv_sec, - New_Time_Window->time_width.tv_nsec); + new_time_window->start_time.tv_sec, + new_time_window->start_time.tv_nsec, + new_time_window->time_width.tv_sec, + new_time_window->time_width.tv_nsec); - if( New_Time_Window->time_width.tv_sec == Old_Time_Window->time_width.tv_sec - && New_Time_Window->time_width.tv_nsec == Old_Time_Window->time_width.tv_nsec) + if( new_time_window->time_width.tv_sec == old_time_window->time_width.tv_sec + && new_time_window->time_width.tv_nsec == old_time_window->time_width.tv_nsec) { /* Same scale (scrolling) */ g_info("scrolling"); - LttTime *ns = &New_Time_Window->start_time; - LttTime *os = &Old_Time_Window->start_time; - LttTime old_end = ltt_time_add(Old_Time_Window->start_time, - Old_Time_Window->time_width); - LttTime new_end = ltt_time_add(New_Time_Window->start_time, - New_Time_Window->time_width); + LttTime *ns = &new_time_window->start_time; + LttTime *os = &old_time_window->start_time; + LttTime old_end = ltt_time_add(old_time_window->start_time, + old_time_window->time_width); + LttTime new_end = ltt_time_add(new_time_window->start_time, + new_time_window->time_width); //if(nsDrawing->Drawing_Area_V->allocation.width; + guint width = control_flow_data->Drawing->drawing_area->allocation.width; convert_time_to_pixels( *os, old_end, @@ -839,7 +839,7 @@ gint update_time_window_hook(void *hook_data, void *call_data) /* Copy old data to new location */ gdk_draw_drawable (control_flow_data->Drawing->Pixmap, - control_flow_data->Drawing->Drawing_Area_V->style->white_gc, + control_flow_data->Drawing->drawing_area->style->white_gc, control_flow_data->Drawing->Pixmap, x, 0, 0, 0, @@ -852,10 +852,10 @@ gint update_time_window_hook(void *hook_data, void *call_data) width, &x); - *Old_Time_Window = *New_Time_Window; + *old_time_window = *new_time_window; /* Clear the data request background, but not SAFETY */ gdk_draw_rectangle (control_flow_data->Drawing->Pixmap, - control_flow_data->Drawing->Drawing_Area_V->style->white_gc, + control_flow_data->Drawing->drawing_area->style->white_gc, TRUE, x+SAFETY, 0, control_flow_data->Drawing->width - x, // do not overlap @@ -883,7 +883,7 @@ gint update_time_window_hook(void *hook_data, void *call_data) g_info("scrolling near left"); /* Scroll left, keep left part of the screen */ guint x = 0; - guint width = control_flow_data->Drawing->Drawing_Area_V->allocation.width; + guint width = control_flow_data->Drawing->drawing_area->allocation.width; convert_time_to_pixels( *ns, new_end, @@ -893,17 +893,17 @@ gint update_time_window_hook(void *hook_data, void *call_data) /* Copy old data to new location */ gdk_draw_drawable (control_flow_data->Drawing->Pixmap, - control_flow_data->Drawing->Drawing_Area_V->style->white_gc, + control_flow_data->Drawing->drawing_area->style->white_gc, control_flow_data->Drawing->Pixmap, 0, 0, x, 0, -1, -1); - *Old_Time_Window = *New_Time_Window; + *old_time_window = *new_time_window; /* Clean the data request background */ gdk_draw_rectangle (control_flow_data->Drawing->Pixmap, - control_flow_data->Drawing->Drawing_Area_V->style->white_gc, + control_flow_data->Drawing->drawing_area->style->white_gc, TRUE, 0, 0, x, // do not overlap @@ -923,11 +923,11 @@ gint update_time_window_hook(void *hook_data, void *call_data) } else { g_info("scrolling far"); /* Cannot reuse any part of the screen : far jump */ - *Old_Time_Window = *New_Time_Window; + *old_time_window = *new_time_window; gdk_draw_rectangle (control_flow_data->Drawing->Pixmap, - control_flow_data->Drawing->Drawing_Area_V->style->white_gc, + control_flow_data->Drawing->drawing_area->style->white_gc, TRUE, 0, 0, control_flow_data->Drawing->width+SAFETY, // do not overlap @@ -949,10 +949,10 @@ gint update_time_window_hook(void *hook_data, void *call_data) /* Different scale (zoom) */ g_info("zoom"); - *Old_Time_Window = *New_Time_Window; + *old_time_window = *new_time_window; gdk_draw_rectangle (control_flow_data->Drawing->Pixmap, - control_flow_data->Drawing->Drawing_Area_V->style->white_gc, + control_flow_data->Drawing->drawing_area->style->white_gc, TRUE, 0, 0, control_flow_data->Drawing->width+SAFETY, // do not overlap @@ -976,7 +976,7 @@ gint update_time_window_hook(void *hook_data, void *call_data) gint update_current_time_hook(void *hook_data, void *call_data) { - ControlFlowData *control_flow_data = (ControlFlowData*) hook_data; + ControlFlowData *control_flow_data = (ControlFlowData*)hook_data; LttTime* current_time = guicontrolflow_get_current_time(control_flow_data); @@ -984,18 +984,18 @@ gint update_current_time_hook(void *hook_data, void *call_data) TimeWindow time_window; - LttTime time_begin = control_flow_data->Time_Window.start_time; - LttTime width = control_flow_data->Time_Window.time_width; + LttTime time_begin = control_flow_data->time_window.start_time; + LttTime width = control_flow_data->time_window.time_width; LttTime half_width = ltt_time_div(width,2.0); LttTime time_end = ltt_time_add(time_begin, width); LttvTracesetContext * tsc = - get_traceset_context(control_flow_data->Parent_Window); + get_traceset_context(control_flow_data->mw); LttTime trace_start = tsc->Time_Span->startTime; LttTime trace_end = tsc->Time_Span->endTime; - g_info("New Current time HOOK : %u, %u", current_time->tv_sec, + g_info("New current time HOOK : %u, %u", current_time->tv_sec, current_time->tv_nsec); @@ -1021,7 +1021,7 @@ gint update_current_time_hook(void *hook_data, void *call_data) time_window.start_time = time_begin; time_window.time_width = width; - set_time_window(control_flow_data->Parent_Window, &time_window); + set_time_window(control_flow_data->mw, &time_window); } else if(ltt_time_compare(*current_time, time_end) == 1) { @@ -1033,10 +1033,10 @@ gint update_current_time_hook(void *hook_data, void *call_data) time_window.start_time = time_begin; time_window.time_width = width; - set_time_window(control_flow_data->Parent_Window, &time_window); + set_time_window(control_flow_data->mw, &time_window); } - gtk_widget_queue_draw(control_flow_data->Drawing->Drawing_Area_V); + gtk_widget_queue_draw(control_flow_data->Drawing->drawing_area); return 0; } @@ -1054,14 +1054,14 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data) ClosureData *closure_data = (ClosureData*)user_data; ControlFlowData *control_flow_data = - closure_data->event_request->Control_Flow_Data; + closure_data->event_request->control_flow_data; - GtkWidget *widget = control_flow_data->Drawing->Drawing_Area_V; + GtkWidget *widget = control_flow_data->Drawing->drawing_area; /* Get y position of process */ gint y=0, height=0; - processlist_get_pixels_from_data( control_flow_data->Process_List, + processlist_get_pixels_from_data( control_flow_data->process_list, process_info, hashed_process_data, &y, @@ -1077,15 +1077,15 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data) /* Draw the closing line */ DrawContext *draw_context = hashed_process_data->draw_context; - if(draw_context->Previous->middle->x == -1) + if(draw_context->previous->middle->x == -1) { - draw_context->Previous->middle->x = closure_data->event_request->x_begin; + draw_context->previous->middle->x = closure_data->event_request->x_begin; g_critical("out middle x_beg : %u",closure_data->event_request->x_begin); } - draw_context->Current->middle->x = closure_data->event_request->x_end; - draw_context->Current->middle->y = y + height/2; - draw_context->Previous->middle->y = y + height/2; + draw_context->current->middle->x = closure_data->event_request->x_end; + draw_context->current->middle->y = y + height/2; + draw_context->previous->middle->y = y + height/2; draw_context->drawable = control_flow_data->Drawing->Pixmap; draw_context->pango_layout = control_flow_data->Drawing->pango_layout; //draw_context->gc = widget->style->black_gc; @@ -1151,32 +1151,32 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data) hashed_process_data->draw_context->drawable = NULL; hashed_process_data->draw_context->gc = NULL; hashed_process_data->draw_context->pango_layout = NULL; - hashed_process_data->draw_context->Current->over->x = -1; - hashed_process_data->draw_context->Current->over->y = -1; - hashed_process_data->draw_context->Current->middle->x = -1; - hashed_process_data->draw_context->Current->middle->y = -1; - hashed_process_data->draw_context->Current->under->x = -1; - hashed_process_data->draw_context->Current->under->y = -1; - hashed_process_data->draw_context->Current->modify_over->x = -1; - hashed_process_data->draw_context->Current->modify_over->y = -1; - hashed_process_data->draw_context->Current->modify_middle->x = -1; - hashed_process_data->draw_context->Current->modify_middle->y = -1; - hashed_process_data->draw_context->Current->modify_under->x = -1; - hashed_process_data->draw_context->Current->modify_under->y = -1; - hashed_process_data->draw_context->Current->status = LTTV_STATE_UNNAMED; - hashed_process_data->draw_context->Previous->over->x = -1; - hashed_process_data->draw_context->Previous->over->y = -1; - hashed_process_data->draw_context->Previous->middle->x = -1; - hashed_process_data->draw_context->Previous->middle->y = -1; - hashed_process_data->draw_context->Previous->under->x = -1; - hashed_process_data->draw_context->Previous->under->y = -1; - hashed_process_data->draw_context->Previous->modify_over->x = -1; - hashed_process_data->draw_context->Previous->modify_over->y = -1; - hashed_process_data->draw_context->Previous->modify_middle->x = -1; - hashed_process_data->draw_context->Previous->modify_middle->y = -1; - hashed_process_data->draw_context->Previous->modify_under->x = -1; - hashed_process_data->draw_context->Previous->modify_under->y = -1; - hashed_process_data->draw_context->Previous->status = LTTV_STATE_UNNAMED; + hashed_process_data->draw_context->current->over->x = -1; + hashed_process_data->draw_context->current->over->y = -1; + hashed_process_data->draw_context->current->middle->x = -1; + hashed_process_data->draw_context->current->middle->y = -1; + hashed_process_data->draw_context->current->under->x = -1; + hashed_process_data->draw_context->current->under->y = -1; + hashed_process_data->draw_context->current->modify_over->x = -1; + hashed_process_data->draw_context->current->modify_over->y = -1; + hashed_process_data->draw_context->current->modify_middle->x = -1; + hashed_process_data->draw_context->current->modify_middle->y = -1; + hashed_process_data->draw_context->current->modify_under->x = -1; + hashed_process_data->draw_context->current->modify_under->y = -1; + hashed_process_data->draw_context->current->status = LTTV_STATE_UNNAMED; + hashed_process_data->draw_context->previous->over->x = -1; + hashed_process_data->draw_context->previous->over->y = -1; + hashed_process_data->draw_context->previous->middle->x = -1; + hashed_process_data->draw_context->previous->middle->y = -1; + hashed_process_data->draw_context->previous->under->x = -1; + hashed_process_data->draw_context->previous->under->y = -1; + hashed_process_data->draw_context->previous->modify_over->x = -1; + hashed_process_data->draw_context->previous->modify_over->y = -1; + hashed_process_data->draw_context->previous->modify_middle->x = -1; + hashed_process_data->draw_context->previous->modify_middle->y = -1; + hashed_process_data->draw_context->previous->modify_under->x = -1; + hashed_process_data->draw_context->previous->modify_under->y = -1; + hashed_process_data->draw_context->previous->status = LTTV_STATE_UNNAMED; } @@ -1188,17 +1188,17 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data) */ int after_data_request(void *hook_data, void *call_data) { - EventRequest *Event_Request = (EventRequest*)hook_data; - ControlFlowData *control_flow_data = Event_Request->Control_Flow_Data; + EventRequest *event_request = (EventRequest*)hook_data; + ControlFlowData *control_flow_data = event_request->control_flow_data; ProcessList *process_list = - guicontrolflow_get_process_list(Event_Request->Control_Flow_Data); + guicontrolflow_get_process_list(event_request->control_flow_data); ClosureData closure_data; closure_data.event_request = (EventRequest*)hook_data; closure_data.ts = (LttvTraceState*)call_data; - g_hash_table_foreach(process_list->Process_Hash, draw_closure, + g_hash_table_foreach(process_list->process_hash, draw_closure, (void*)&closure_data); }