X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2FguiControlFlow%2FCFV.c;h=6ac2b729cee4f9300ab37a265dd7151370657524;hb=a6b3623edf87fccfbaf201e70c720d52f89a77fe;hp=d49bd13112102cfd1821c020268b66b9a1c2aeb4;hpb=41a769851adc36c024821e859ed6569409f71d8f;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/CFV.c b/ltt/branches/poly/lttv/modules/guiControlFlow/CFV.c index d49bd131..6ac2b729 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/CFV.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/CFV.c @@ -10,6 +10,9 @@ #include "CFV-private.h" +#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format) +#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format) + extern GSList *gControl_Flow_Data_List; /***************************************************************************** @@ -24,17 +27,17 @@ extern GSList *gControl_Flow_Data_List; * @return The widget created. */ ControlFlowData * -GuiControlFlow(void) +guicontrolflow(void) { GtkWidget *Process_List_Widget, *Drawing_Widget; ControlFlowData* Control_Flow_Data = g_new(ControlFlowData,1) ; /* Create the Drawing */ - Control_Flow_Data->Drawing = Drawing_construct(Control_Flow_Data); + Control_Flow_Data->Drawing = drawing_construct(Control_Flow_Data); Drawing_Widget = - Drawing_getWidget(Control_Flow_Data->Drawing); + drawing_get_widget(Control_Flow_Data->Drawing); /* TEST DATA, TO BE READ FROM THE TRACE */ Control_Flow_Data->Number_Of_Events = 1000 ; @@ -47,10 +50,10 @@ GuiControlFlow(void) /* Create the Process list */ - Control_Flow_Data->Process_List = ProcessList_construct(); + Control_Flow_Data->Process_List = processlist_construct(); Process_List_Widget = - ProcessList_getWidget(Control_Flow_Data->Process_List); + processlist_get_widget(Control_Flow_Data->Process_List); Control_Flow_Data->Inside_HBox_V = gtk_hbox_new(0, 0); @@ -113,8 +116,13 @@ GuiControlFlow(void) G_OBJECT(Control_Flow_Data->Scrolled_Window_VC), "Control_Flow_Data", Control_Flow_Data, - (GDestroyNotify)GuiControlFlow_Destructor); - + (GDestroyNotify)guicontrolflow_destructor); + + g_object_set_data( + G_OBJECT(Drawing_Widget), + "Control_Flow_Data", + Control_Flow_Data); + gControl_Flow_Data_List = g_slist_append( gControl_Flow_Data_List, Control_Flow_Data); @@ -130,50 +138,60 @@ GuiControlFlow(void) /* Destroys widget also */ void -GuiControlFlow_Destructor_Full(ControlFlowData *Control_Flow_Data) +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); - - GuiControlFlow_Destructor(Control_Flow_Data); + //Control_Flow_Data->Parent_Window = NULL; + //FIXME guicontrolflow_destructor(Control_Flow_Data); } +/* When this destructor is called, the widgets are already disconnected */ void -GuiControlFlow_Destructor(ControlFlowData *Control_Flow_Data) +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("widget still exists"); + /* Process List is removed with it's widget */ //ProcessList_destroy(Control_Flow_Data->Process_List); - unreg_update_time_window(Update_Time_Window_Hook, + if(Control_Flow_Data->Parent_Window != NULL) + { + unreg_update_time_window(update_time_window_hook, Control_Flow_Data, - Control_Flow_Data->Scrolled_Window_VC->parent); + Control_Flow_Data->Parent_Window); - unreg_update_current_time(Update_Current_Time_Hook, + unreg_update_current_time(update_current_time_hook, Control_Flow_Data, - Control_Flow_Data->Scrolled_Window_VC->parent); - + Control_Flow_Data->Parent_Window); + } + g_info("CFV.c : guicontrolflow_destructor, %p", Control_Flow_Data); g_slist_remove(gControl_Flow_Data_List,Control_Flow_Data); g_free(Control_Flow_Data); } -GtkWidget *GuiControlFlow_get_Widget(ControlFlowData *Control_Flow_Data) +GtkWidget *guicontrolflow_get_widget(ControlFlowData *Control_Flow_Data) { return Control_Flow_Data->Scrolled_Window_VC ; } -ProcessList *GuiControlFlow_get_Process_List +ProcessList *guicontrolflow_get_process_list (ControlFlowData *Control_Flow_Data) { return Control_Flow_Data->Process_List ; } -TimeWindow *GuiControlFlow_get_Time_Window(ControlFlowData *Control_Flow_Data) +TimeWindow *guicontrolflow_get_time_window(ControlFlowData *Control_Flow_Data) { return &Control_Flow_Data->Time_Window; } -LttTime *GuiControlFlow_get_Current_Time(ControlFlowData *Control_Flow_Data) +LttTime *guicontrolflow_get_current_time(ControlFlowData *Control_Flow_Data) { return &Control_Flow_Data->Current_Time; }