From: compudj Date: Sat, 17 Jan 2004 04:03:13 +0000 (+0000) Subject: CFV-private.h attribute name change X-Git-Tag: v0.12.20~3099 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ba90bc77f7ef2ffc59cc08b6234c61274cdd4396;p=lttv.git CFV-private.h attribute name change git-svn-id: http://ltt.polymtl.ca/svn@390 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/CFV-private.h b/ltt/branches/poly/lttv/modules/guiControlFlow/CFV-private.h index 108259af..591d1ade 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/CFV-private.h +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/CFV-private.h @@ -5,33 +5,22 @@ struct _ControlFlowData { - GtkWidget *Scrolled_Window_VC; - MainWindow *Parent_Window; + GtkWidget *scrolled_window; + MainWindow *mw; - ProcessList *Process_List; + ProcessList *process_list; Drawing_t *Drawing; - //GtkWidget *HBox_V; - //GtkWidget *Inside_HBox_V; - GtkWidget *HPaned; + GtkWidget *h_paned; - GtkAdjustment *VAdjust_C ; - - /* Trace information */ - //TraceSet *Trace_Set; - //TraceStatistics *Trace_Statistics; + GtkAdjustment *v_adjust ; /* Shown events information */ - guint First_Event, Last_Event; - TimeWindow Time_Window; - LttTime Current_Time; - + TimeWindow time_window; + LttTime current_time; - /* TEST DATA, TO BE READ FROM THE TRACE */ - gint Number_Of_Events ; - guint Currently_Selected_Event ; - gboolean Selected_Event ; - guint Number_Of_Process; + //guint Currently_Selected_Event ; + guint number_of_process; } ; diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/CFV.c b/ltt/branches/poly/lttv/modules/guiControlFlow/CFV.c index 13a2bac9..a8ea21dc 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/CFV.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/CFV.c @@ -29,7 +29,7 @@ extern GSList *gControl_Flow_Data_List; ControlFlowData * guicontrolflow(void) { - GtkWidget *Process_List_Widget, *Drawing_Widget;//, *button; + GtkWidget *process_list_Widget, *Drawing_Widget;//, *button; ControlFlowData* Control_Flow_Data = g_new(ControlFlowData,1) ; @@ -39,40 +39,21 @@ guicontrolflow(void) Drawing_Widget = drawing_get_widget(Control_Flow_Data->Drawing); - /* TEST DATA, TO BE READ FROM THE TRACE */ - Control_Flow_Data->Number_Of_Events = 1000 ; - Control_Flow_Data->Currently_Selected_Event = FALSE ; - Control_Flow_Data->Selected_Event = 0; - Control_Flow_Data->Number_Of_Process = 10; - - /* FIXME register Event_Selected_Hook */ - - + Control_Flow_Data->number_of_process = 0; /* Create the Process list */ - Control_Flow_Data->Process_List = processlist_construct(); + Control_Flow_Data->process_list = processlist_construct(); - Process_List_Widget = - processlist_get_widget(Control_Flow_Data->Process_List); + process_list_Widget = + processlist_get_widget(Control_Flow_Data->process_list); //Control_Flow_Data->Inside_HBox_V = gtk_hbox_new(0, 0); - Control_Flow_Data->HPaned = gtk_hpaned_new(); + Control_Flow_Data->h_paned = gtk_hpaned_new(); - //gtk_box_pack_start( - // GTK_BOX(Control_Flow_Data->Inside_HBox_V), - // Process_List_Widget, FALSE, TRUE, 0); // FALSE TRUE - //gtk_box_pack_start( - // GTK_BOX(Control_Flow_Data->Inside_HBox_V), - // Drawing_Widget, TRUE, TRUE, 0); - - //button = gtk_button_new(); - //gtk_button_set_relief(button, GTK_RELIEF_NONE); - //gtk_container_set_border_width(GTK_CONTAINER(button),0); - //gtk_container_add(GTK_CONTAINER(button), Drawing_Widget); - gtk_paned_pack1(GTK_PANED(Control_Flow_Data->HPaned), Process_List_Widget, FALSE, TRUE); - gtk_paned_pack2(GTK_PANED(Control_Flow_Data->HPaned), Drawing_Widget, TRUE, TRUE); - - Control_Flow_Data->VAdjust_C = + gtk_paned_pack1(GTK_PANED(Control_Flow_Data->h_paned), process_list_Widget, FALSE, TRUE); + gtk_paned_pack2(GTK_PANED(Control_Flow_Data->h_paned), Drawing_Widget, TRUE, TRUE); + + Control_Flow_Data->v_adjust = GTK_ADJUSTMENT(gtk_adjustment_new( 0.0, /* Value */ 0.0, /* Lower */ 0.0, /* Upper */ @@ -80,33 +61,19 @@ guicontrolflow(void) 0.0, /* Page inc. */ 0.0)); /* page size */ - Control_Flow_Data->Scrolled_Window_VC = + Control_Flow_Data->scrolled_window = gtk_scrolled_window_new (NULL, - Control_Flow_Data->VAdjust_C); + Control_Flow_Data->v_adjust); gtk_scrolled_window_set_policy( - GTK_SCROLLED_WINDOW(Control_Flow_Data->Scrolled_Window_VC) , + GTK_SCROLLED_WINDOW(Control_Flow_Data->scrolled_window) , GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_add_with_viewport( - GTK_SCROLLED_WINDOW(Control_Flow_Data->Scrolled_Window_VC), - //Control_Flow_Data->Inside_HBox_V); - Control_Flow_Data->HPaned); + GTK_SCROLLED_WINDOW(Control_Flow_Data->scrolled_window), + Control_Flow_Data->h_paned); - //g_signal_connect (G_OBJECT (Control_Flow_Data->Drawing_Area_V), - // "expose_event", - // G_CALLBACK (expose_event_cb), - // Control_Flow_Data); - - - - //g_signal_connect (G_OBJECT (Control_Flow_Data->VAdjust_C), - // "value-changed", - // G_CALLBACK (v_scroll_cb), - // Control_Flow_Data); - - /* Set the size of the drawing area */ //Drawing_Resize(Drawing, h, w); @@ -115,14 +82,12 @@ guicontrolflow(void) gtk_widget_show(Drawing_Widget); - //gtk_widget_show(button); - gtk_widget_show(Process_List_Widget); - //gtk_widget_show(Control_Flow_Data->Inside_HBox_V); - gtk_widget_show(Control_Flow_Data->HPaned); - gtk_widget_show(Control_Flow_Data->Scrolled_Window_VC); + gtk_widget_show(process_list_Widget); + gtk_widget_show(Control_Flow_Data->h_paned); + gtk_widget_show(Control_Flow_Data->scrolled_window); g_object_set_data_full( - G_OBJECT(Control_Flow_Data->Scrolled_Window_VC), + G_OBJECT(Control_Flow_Data->scrolled_window), "Control_Flow_Data", Control_Flow_Data, (GDestroyNotify)guicontrolflow_destructor); @@ -151,9 +116,9 @@ guicontrolflow_destructor_full(ControlFlowData *Control_Flow_Data) { g_info("CFV.c : guicontrolflow_destructor_full, %p", Control_Flow_Data); /* May already have been done by GTK window closing */ - if(GTK_IS_WIDGET(Control_Flow_Data->Scrolled_Window_VC)) - gtk_widget_destroy(Control_Flow_Data->Scrolled_Window_VC); - //Control_Flow_Data->Parent_Window = NULL; + if(GTK_IS_WIDGET(Control_Flow_Data->scrolled_window)) + gtk_widget_destroy(Control_Flow_Data->scrolled_window); + //Control_Flow_Data->mw = NULL; //FIXME guicontrolflow_destructor(Control_Flow_Data); } @@ -164,21 +129,21 @@ guicontrolflow_destructor(ControlFlowData *Control_Flow_Data) guint index; g_info("CFV.c : guicontrolflow_destructor, %p", Control_Flow_Data); - g_info("%p, %p, %p", update_time_window_hook, Control_Flow_Data, Control_Flow_Data->Parent_Window); - if(GTK_IS_WIDGET(Control_Flow_Data->Scrolled_Window_VC)) + g_info("%p, %p, %p", update_time_window_hook, Control_Flow_Data, Control_Flow_Data->mw); + if(GTK_IS_WIDGET(Control_Flow_Data->scrolled_window)) g_info("widget still exists"); /* Process List is removed with it's widget */ - //ProcessList_destroy(Control_Flow_Data->Process_List); - if(Control_Flow_Data->Parent_Window != NULL) + //ProcessList_destroy(Control_Flow_Data->process_list); + if(Control_Flow_Data->mw != NULL) { unreg_update_time_window(update_time_window_hook, Control_Flow_Data, - Control_Flow_Data->Parent_Window); + Control_Flow_Data->mw); unreg_update_current_time(update_current_time_hook, Control_Flow_Data, - Control_Flow_Data->Parent_Window); + Control_Flow_Data->mw); } g_info("CFV.c : guicontrolflow_destructor, %p", Control_Flow_Data); g_slist_remove(gControl_Flow_Data_List,Control_Flow_Data); @@ -187,22 +152,22 @@ guicontrolflow_destructor(ControlFlowData *Control_Flow_Data) GtkWidget *guicontrolflow_get_widget(ControlFlowData *Control_Flow_Data) { - return Control_Flow_Data->Scrolled_Window_VC ; + return Control_Flow_Data->scrolled_window ; } ProcessList *guicontrolflow_get_process_list (ControlFlowData *Control_Flow_Data) { - return Control_Flow_Data->Process_List ; + return Control_Flow_Data->process_list ; } TimeWindow *guicontrolflow_get_time_window(ControlFlowData *Control_Flow_Data) { - return &Control_Flow_Data->Time_Window; + return &Control_Flow_Data->time_window; } LttTime *guicontrolflow_get_current_time(ControlFlowData *Control_Flow_Data) { - return &Control_Flow_Data->Current_Time; + return &Control_Flow_Data->current_time; } diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c b/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c index 9242cbe1..7a116cb9 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c @@ -60,29 +60,29 @@ void drawing_data_request(Drawing_t *Drawing, "Control_Flow_Data"); LttTime start, end; - 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); g_critical("req : window_end : %u, %u", window_end.tv_sec, window_end.tv_nsec); - g_critical("req : time width : %u, %u", control_flow_data->Time_Window.time_width.tv_sec, - control_flow_data->Time_Window.time_width.tv_nsec); + g_critical("req : time width : %u, %u", control_flow_data->time_window.time_width.tv_sec, + control_flow_data->time_window.time_width.tv_nsec); g_critical("x is : %i, x+width is : %i", x, x+width); convert_pixels_to_time(Drawing->Drawing_Area_V->allocation.width, x, - &control_flow_data->Time_Window.start_time, + &control_flow_data->time_window.start_time, &window_end, &start); convert_pixels_to_time(Drawing->Drawing_Area_V->allocation.width, x + width, - &control_flow_data->Time_Window.start_time, + &control_flow_data->time_window.start_time, &window_end, &end); LttvTracesetContext * tsc = - get_traceset_context(control_flow_data->Parent_Window); + get_traceset_context(control_flow_data->mw); //send_test_process( //guicontrolflow_get_process_list(Drawing->Control_Flow_Data), @@ -111,7 +111,7 @@ void drawing_data_request(Drawing_t *Drawing, lttv_hooks_add(after_traceset, after_data_request, &event_request); lttv_hooks_add(event, draw_event_hook, &event_request); //Modified by xiangxiu: state update hooks are added by the main window - //state_add_event_hooks_api(control_flow_data->Parent_Window); + //state_add_event_hooks_api(control_flow_data->mw); lttv_hooks_add(after_event, draw_after_hook, &event_request); lttv_process_traceset_seek_time(tsc, start); @@ -128,7 +128,7 @@ void drawing_data_request(Drawing_t *Drawing, NULL, NULL, NULL, NULL, NULL, NULL, NULL, after_traceset, NULL, event, after_event); //Modified by xiangxiu: state update hooks are removed by the main window - //state_remove_event_hooks_api(control_flow_data->Parent_Window); + //state_remove_event_hooks_api(control_flow_data->mw); lttv_hooks_destroy(after_traceset); lttv_hooks_destroy(event); @@ -156,8 +156,8 @@ configure_event( GtkWidget *widget, GdkEventConfigure *event, * has updated the time interval before this configure gets * executed. */ - get_time_window(Drawing->Control_Flow_Data->Parent_Window, - &Drawing->Control_Flow_Data->Time_Window); + get_time_window(Drawing->Control_Flow_Data->mw, + &Drawing->Control_Flow_Data->time_window); /* New Pixmap, size of the configure event */ //GdkPixmap *Pixmap = gdk_pixmap_new(widget->window, @@ -180,7 +180,7 @@ configure_event( GtkWidget *widget, GdkEventConfigure *event, widget->allocation.width + SAFETY, widget->allocation.height + SAFETY, //ProcessList_get_height - // (GuiControlFlow_get_Process_List(Drawing->Control_Flow_Data)), + // (GuiControlFlow_get_process_list(Drawing->Control_Flow_Data)), -1); Drawing->width = widget->allocation.width; Drawing->height = widget->allocation.height; @@ -285,16 +285,16 @@ expose_event( GtkWidget *widget, GdkEventExpose *event, gpointer user_data ) g_critical("drawing expose event"); guint x=0; - LttTime* Current_Time = + LttTime* current_time = guicontrolflow_get_current_time(control_flow_data); - 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, - *Current_Time, + *current_time, widget->allocation.width, &x); @@ -335,19 +335,19 @@ button_press_event( GtkWidget *widget, GdkEventButton *event, gpointer user_data { LttTime time; - 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); /* left mouse button click */ g_critical("x click is : %f", event->x); convert_pixels_to_time(widget->allocation.width, (guint)event->x, - &control_flow_data->Time_Window.start_time, + &control_flow_data->time_window.start_time, &window_end, &time); - set_current_time(control_flow_data->Parent_Window, &time); + set_current_time(control_flow_data->mw, &time); } diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c b/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c index ee289196..6de44ffb 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c @@ -49,7 +49,7 @@ h_guicontrolflow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * ke g_info("h_guicontrolflow, %p, %p, %s", pmParentWindow, s, key); ControlFlowData *Control_Flow_Data = guicontrolflow() ; - Control_Flow_Data->Parent_Window = pmParentWindow; + Control_Flow_Data->mw = pmParentWindow; TimeWindow *time_window = guicontrolflow_get_time_window(Control_Flow_Data); time_window->start_time.tv_sec = 0; time_window->start_time.tv_nsec = 0; @@ -235,12 +235,12 @@ int draw_event_hook(void *hook_data, void *call_data) 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, @@ -612,12 +612,12 @@ int draw_after_hook(void *hook_data, void *call_data) //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, @@ -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->Pixmap, control_flow_data->Drawing->Drawing_Area_V->style->white_gc, @@ -899,7 +899,7 @@ gint update_time_window_hook(void *hook_data, void *call_data) 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, @@ -923,7 +923,7 @@ 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, @@ -949,7 +949,7 @@ 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, @@ -984,13 +984,13 @@ 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; @@ -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,7 +1033,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); } gtk_widget_queue_draw(control_flow_data->Drawing->Drawing_Area_V); @@ -1061,7 +1061,7 @@ void draw_closure(gpointer key, gpointer value, gpointer user_data) /* 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, diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.h b/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.h index c3f29089..8d615a47 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.h +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.h @@ -35,7 +35,7 @@ typedef struct _EventRequest -void send_test_data(ProcessList *Process_List, Drawing_t *Drawing); +void send_test_data(ProcessList *process_list, Drawing_t *Drawing); GtkWidget *h_guicontrolflow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * key); diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.c b/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.c index fcf36282..1ae7db4e 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.c @@ -165,44 +165,44 @@ ProcessList *processlist_construct(void) GtkTreeViewColumn *column; GtkCellRenderer *renderer; - ProcessList* Process_List = g_new(ProcessList,1); + ProcessList* process_list = g_new(ProcessList,1); - Process_List->Number_Of_Process = 0; + process_list->number_of_process = 0; /* Create the Process list */ - Process_List->Store_M = gtk_list_store_new ( N_COLUMNS, + process_list->Store_M = gtk_list_store_new ( N_COLUMNS, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_ULONG, G_TYPE_ULONG); - Process_List->Process_List_VC = + process_list->process_list_VC = gtk_tree_view_new_with_model - (GTK_TREE_MODEL (Process_List->Store_M)); + (GTK_TREE_MODEL (process_list->Store_M)); - g_object_unref (G_OBJECT (Process_List->Store_M)); + g_object_unref (G_OBJECT (process_list->Store_M)); gtk_tree_sortable_set_sort_func( - GTK_TREE_SORTABLE(Process_List->Store_M), + GTK_TREE_SORTABLE(process_list->Store_M), PID_COLUMN, process_sort_func, NULL, NULL); gtk_tree_sortable_set_sort_column_id( - GTK_TREE_SORTABLE(Process_List->Store_M), + GTK_TREE_SORTABLE(process_list->Store_M), PID_COLUMN, GTK_SORT_ASCENDING); - Process_List->Process_Hash = g_hash_table_new_full( + process_list->Process_Hash = g_hash_table_new_full( hash_fct, equ_fct, destroy_hash_key, destroy_hash_data ); gtk_tree_view_set_headers_visible( - GTK_TREE_VIEW(Process_List->Process_List_VC), FALSE); + GTK_TREE_VIEW(process_list->process_list_VC), FALSE); /* Create a column, associating the "text" attribute of the * cell_renderer to the first column of the model */ @@ -216,7 +216,7 @@ ProcessList *processlist_construct(void) gtk_tree_view_column_set_alignment (column, 0.0); gtk_tree_view_column_set_fixed_width (column, 45); gtk_tree_view_append_column ( - GTK_TREE_VIEW (Process_List->Process_List_VC), column); + GTK_TREE_VIEW (process_list->process_list_VC), column); column = gtk_tree_view_column_new_with_attributes ( "PID", renderer, @@ -224,7 +224,7 @@ ProcessList *processlist_construct(void) PID_COLUMN, NULL); gtk_tree_view_append_column ( - GTK_TREE_VIEW (Process_List->Process_List_VC), column); + GTK_TREE_VIEW (process_list->process_list_VC), column); column = gtk_tree_view_column_new_with_attributes ( "Birth sec", @@ -233,7 +233,7 @@ ProcessList *processlist_construct(void) BIRTH_S_COLUMN, NULL); gtk_tree_view_append_column ( - GTK_TREE_VIEW (Process_List->Process_List_VC), column); + GTK_TREE_VIEW (process_list->process_list_VC), column); //gtk_tree_view_column_set_visible(column, 0); // @@ -243,31 +243,31 @@ ProcessList *processlist_construct(void) BIRTH_NS_COLUMN, NULL); gtk_tree_view_append_column ( - GTK_TREE_VIEW (Process_List->Process_List_VC), column); + GTK_TREE_VIEW (process_list->process_list_VC), column); //gtk_tree_view_column_set_visible(column, 0); g_object_set_data_full( - G_OBJECT(Process_List->Process_List_VC), - "Process_List_Data", - Process_List, + G_OBJECT(process_list->process_list_VC), + "process_list_Data", + process_list, (GDestroyNotify)processlist_destroy); - Process_List->Test_Process_Sent = 0; + process_list->Test_Process_Sent = 0; - return Process_List; + return process_list; } -void processlist_destroy(ProcessList *Process_List) +void processlist_destroy(ProcessList *process_list) { - g_hash_table_destroy(Process_List->Process_Hash); - Process_List->Process_Hash = NULL; + g_hash_table_destroy(process_list->Process_Hash); + process_list->Process_Hash = NULL; - g_free(Process_List); + g_free(process_list); } -GtkWidget *processlist_get_widget(ProcessList *Process_List) +GtkWidget *processlist_get_widget(ProcessList *process_list) { - return Process_List->Process_List_VC; + return process_list->process_list_VC; } @@ -296,7 +296,7 @@ void destroy_hash_data(gpointer data) g_free(data); } -int processlist_add( ProcessList *Process_List, +int processlist_add( ProcessList *process_list, guint pid, LttTime *birth, gchar *name, @@ -357,41 +357,41 @@ int processlist_add( ProcessList *Process_List, Hashed_Process_Data->draw_context->Previous->status = LTTV_STATE_UNNAMED; /* Add a new row to the model */ - gtk_list_store_append ( Process_List->Store_M, &iter); + gtk_list_store_append ( process_list->Store_M, &iter); //g_critical ( "iter before : %s", gtk_tree_path_to_string ( // gtk_tree_model_get_path ( - // GTK_TREE_MODEL(Process_List->Store_M), + // GTK_TREE_MODEL(process_list->Store_M), // &iter))); - gtk_list_store_set ( Process_List->Store_M, &iter, + gtk_list_store_set ( process_list->Store_M, &iter, PROCESS_COLUMN, name, PID_COLUMN, pid, BIRTH_S_COLUMN, birth->tv_sec, BIRTH_NS_COLUMN, birth->tv_nsec, -1); Hashed_Process_Data->RowRef = gtk_tree_row_reference_new ( - GTK_TREE_MODEL(Process_List->Store_M), + GTK_TREE_MODEL(process_list->Store_M), gtk_tree_model_get_path( - GTK_TREE_MODEL(Process_List->Store_M), + GTK_TREE_MODEL(process_list->Store_M), &iter)); - g_hash_table_insert( Process_List->Process_Hash, + g_hash_table_insert( process_list->Process_Hash, (gpointer)Process_Info, (gpointer)Hashed_Process_Data); //g_critical ( "iter after : %s", gtk_tree_path_to_string ( // gtk_tree_model_get_path ( - // GTK_TREE_MODEL(Process_List->Store_M), + // GTK_TREE_MODEL(process_list->Store_M), // &iter))); - Process_List->Number_Of_Process++; + process_list->number_of_process++; - *height = get_cell_height(GTK_TREE_VIEW(Process_List->Process_List_VC)) - * Process_List->Number_Of_Process ; + *height = get_cell_height(GTK_TREE_VIEW(process_list->process_list_VC)) + * process_list->number_of_process ; return 0; } -int processlist_remove( ProcessList *Process_List, +int processlist_remove( ProcessList *process_list, guint pid, LttTime *birth) { @@ -406,17 +406,17 @@ int processlist_remove( ProcessList *Process_List, if(Hashed_Process_Data = (HashedProcessData*)g_hash_table_lookup( - Process_List->Process_Hash, + process_list->Process_Hash, &Process_Info)) { gtk_tree_model_get_iter ( - GTK_TREE_MODEL(Process_List->Store_M), + GTK_TREE_MODEL(process_list->Store_M), &iter, gtk_tree_row_reference_get_path( (GtkTreeRowReference*)Hashed_Process_Data->RowRef) ); - gtk_list_store_remove (Process_List->Store_M, &iter); + gtk_list_store_remove (process_list->Store_M, &iter); g_free(Hashed_Process_Data->draw_context->Previous->modify_under); g_free(Hashed_Process_Data->draw_context->Previous->modify_middle); @@ -435,10 +435,10 @@ int processlist_remove( ProcessList *Process_List, g_free(Hashed_Process_Data->draw_context); g_free(Hashed_Process_Data); - g_hash_table_remove(Process_List->Process_Hash, + g_hash_table_remove(process_list->Process_Hash, &Process_Info); - Process_List->Number_Of_Process--; + process_list->number_of_process--; return 0; } else { @@ -447,14 +447,14 @@ int processlist_remove( ProcessList *Process_List, } -guint processlist_get_height(ProcessList *Process_List) +guint processlist_get_height(ProcessList *process_list) { - return get_cell_height(GTK_TREE_VIEW(Process_List->Process_List_VC)) - * Process_List->Number_Of_Process ; + return get_cell_height(GTK_TREE_VIEW(process_list->process_list_VC)) + * process_list->number_of_process ; } -gint processlist_get_process_pixels( ProcessList *Process_List, +gint processlist_get_process_pixels( ProcessList *process_list, guint pid, LttTime *birth, guint *y, guint *height, @@ -470,7 +470,7 @@ gint processlist_get_process_pixels( ProcessList *Process_List, if(Hashed_Process_Data = (HashedProcessData*)g_hash_table_lookup( - Process_List->Process_Hash, + process_list->Process_Hash, &Process_Info)) { tree_path = gtk_tree_row_reference_get_path( @@ -478,7 +478,7 @@ gint processlist_get_process_pixels( ProcessList *Process_List, path_indices = gtk_tree_path_get_indices (tree_path); *height = get_cell_height( - GTK_TREE_VIEW(Process_List->Process_List_VC)); + GTK_TREE_VIEW(process_list->process_list_VC)); *y = *height * path_indices[0]; *pmHashed_Process_Data = Hashed_Process_Data; return 0; @@ -490,7 +490,7 @@ gint processlist_get_process_pixels( ProcessList *Process_List, } -gint processlist_get_pixels_from_data( ProcessList *Process_List, +gint processlist_get_pixels_from_data( ProcessList *process_list, ProcessInfo *process_info, HashedProcessData *Hashed_Process_Data, guint *y, @@ -504,7 +504,7 @@ gint processlist_get_pixels_from_data( ProcessList *Process_List, path_indices = gtk_tree_path_get_indices (tree_path); *height = get_cell_height( - GTK_TREE_VIEW(Process_List->Process_List_VC)); + GTK_TREE_VIEW(process_list->process_list_VC)); *y = *height * path_indices[0]; return 0; diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.h b/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.h index 625c9bcb..bd8f97ee 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.h +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.h @@ -36,13 +36,13 @@ typedef struct _HashedProcessData { struct _ProcessList { - GtkWidget *Process_List_VC; + GtkWidget *process_list_VC; GtkListStore *Store_M; /* A hash table by PID to speed up process position find in the list */ GHashTable *Process_Hash; - guint Number_Of_Process; + guint number_of_process; gboolean Test_Process_Sent; }; @@ -51,25 +51,25 @@ struct _ProcessList { typedef struct _ProcessList ProcessList; ProcessList *processlist_construct(void); -void processlist_destroy(ProcessList *Process_List); -GtkWidget *processlist_get_widget(ProcessList *Process_List); +void processlist_destroy(ProcessList *process_list); +GtkWidget *processlist_get_widget(ProcessList *process_list); // out : success (0) and height -int processlist_add(ProcessList *Process_List, guint pid, LttTime *birth, +int processlist_add(ProcessList *process_list, guint pid, LttTime *birth, gchar *name, guint *height, HashedProcessData **Hashed_Process_Data); // out : success (0) and height -int processlist_remove(ProcessList *Process_List, guint pid, LttTime *birth); +int processlist_remove(ProcessList *process_list, guint pid, LttTime *birth); -guint processlist_get_height(ProcessList *Process_List); +guint processlist_get_height(ProcessList *process_list); // Returns 0 on success -gint processlist_get_process_pixels(ProcessList *Process_List, +gint processlist_get_process_pixels(ProcessList *process_list, guint pid, LttTime *birth, guint *y, guint *height, HashedProcessData **Hashed_Process_Data); -gint processlist_get_pixels_from_data( ProcessList *Process_List, +gint processlist_get_pixels_from_data( ProcessList *process_list, ProcessInfo *process_info, HashedProcessData *Hashed_Process_Data, guint *y, diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/test.c b/ltt/branches/poly/lttv/modules/guiControlFlow/test.c index 7f5f097f..4fb61eb4 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/test.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/test.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) guint ev_sel = 444 ; /* Horizontal scrollbar and it's adjustment */ GtkWidget *VScroll_VC; - GtkAdjustment *VAdjust_C ; + GtkAdjustment *v_adjust ; /* Initialize i18n support */ gtk_set_locale (); @@ -45,7 +45,7 @@ int main(int argc, char **argv) //gtk_box_pack_start(GTK_BOX(VBox_V), ListViewer, FALSE, TRUE, 0); Control_Flow_Data = guicontrolflow(); - CF_Viewer = Control_Flow_Data->Scrolled_Window_VC; + CF_Viewer = Control_Flow_Data->scrolled_window; gtk_box_pack_start(GTK_BOX(VBox_V), CF_Viewer, TRUE, TRUE, 0); /* Create horizontal scrollbar and pack it */ @@ -79,7 +79,7 @@ void add_test_process(ControlFlowData *Control_Flow_Data) int i; gchar *process[] = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" }; - for(i=0; iNumber_Of_Process; i++) + for(i=0; inumber_of_process; i++) { /* Add a new row to the model */ gtk_list_store_append (Control_Flow_Data->Store_M, &iter); @@ -110,7 +110,7 @@ void test_draw(ControlFlowData *Control_Flow_Data) #ifdef DEBUG void test_draw() { - gint cell_height = get_cell_height(GTK_TREE_VIEW(Control_Flow_Data->Process_List_VC)); + gint cell_height = get_cell_height(GTK_TREE_VIEW(Control_Flow_Data->process_list_VC)); GdkGC *GC = gdk_gc_new(widget->window); GdkColor color = CF_Colors[GREEN]; @@ -229,7 +229,7 @@ void test_draw_item(Drawing_t *Drawing, #ifdef NOTUSE /* NOTE : no drawing data should be sent there, since the drawing widget * has not been initialized */ -void send_test_drawing(ProcessList *Process_List, +void send_test_drawing(ProcessList *process_list, Drawing_t *Drawing, GdkPixmap *Pixmap, gint x, gint y, // y not used here? @@ -268,7 +268,7 @@ void send_test_drawing(ProcessList *Process_List, birth.tv_sec = 12000; birth.tv_nsec = 55500; g_info("we have : x : %u, y : %u, width : %u, height : %u", x, y, width, height); - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 1, &birth, &y, @@ -287,7 +287,7 @@ void send_test_drawing(ProcessList *Process_List, birth.tv_sec = 14000; birth.tv_nsec = 55500; - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 156, &birth, &y, @@ -306,7 +306,7 @@ void send_test_drawing(ProcessList *Process_List, birth.tv_sec = 12000; birth.tv_nsec = 55700; - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 10, &birth, &y, @@ -336,7 +336,7 @@ void send_test_drawing(ProcessList *Process_List, birth.tv_sec = i*12000; birth.tv_nsec = i*55700; - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, i, &birth, &y, @@ -355,7 +355,7 @@ void send_test_drawing(ProcessList *Process_List, birth.tv_sec = 12000; birth.tv_nsec = 55600; - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 10, &birth, &y, @@ -411,7 +411,7 @@ void send_test_drawing(ProcessList *Process_List, g_free(gc); } -void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) +void send_test_process(ProcessList *process_list, Drawing_t *Drawing) { guint height, y; int i; @@ -421,16 +421,16 @@ void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) LttTime birth; - if(Process_List->Test_Process_Sent) return; + if(process_list->Test_Process_Sent) return; birth.tv_sec = 12000; birth.tv_nsec = 55500; - processlist_add(Process_List, + processlist_add(process_list, 1, &birth, &y); - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 1, &birth, &y, @@ -442,11 +442,11 @@ void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) birth.tv_sec = 14000; birth.tv_nsec = 55500; - processlist_add(Process_List, + processlist_add(process_list, 156, &birth, &y); - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 156, &birth, &y, @@ -458,11 +458,11 @@ void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) birth.tv_sec = 12000; birth.tv_nsec = 55700; - processlist_add(Process_List, + processlist_add(process_list, 10, &birth, &height); - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 10, &birth, &y, @@ -478,11 +478,11 @@ void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) birth.tv_sec = i*12000; birth.tv_nsec = i*55700; - processlist_add(Process_List, + processlist_add(process_list, i, &birth, &height); - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, i, &birth, &y, @@ -497,11 +497,11 @@ void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) birth.tv_sec = 12000; birth.tv_nsec = 55600; - processlist_add(Process_List, + processlist_add(process_list, 10, &birth, &y); - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 10, &birth, &y, @@ -510,11 +510,11 @@ void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) //g_critical("y : %u, height : %u", y, height); - processlist_add(Process_List, + processlist_add(process_list, 10000, &birth, &height); - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 10000, &birth, &y, @@ -527,11 +527,11 @@ void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) //g_critical("height : %u", height); - processlist_get_process_pixels(Process_List, + processlist_get_process_pixels(process_list, 10000, &birth, &y, &height); - processlist_remove( Process_List, + processlist_remove( process_list, 10000, &birth); @@ -539,7 +539,7 @@ void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) if(got_RowRef = (GtkTreeRowReference*)g_hash_table_lookup( - Process_List->Process_Hash, + process_list->Process_Hash, &Process_Info)) { g_critical("key found"); @@ -551,7 +551,7 @@ void send_test_process(ProcessList *Process_List, Drawing_t *Drawing) } - Process_List->Test_Process_Sent = TRUE; + process_list->Test_Process_Sent = TRUE; } #endif//NOTUSE