From 540edb40ef20c2ce40132b3189e183d055dbe711 Mon Sep 17 00:00:00 2001 From: yangxx Date: Fri, 16 Jan 2004 17:52:49 +0000 Subject: [PATCH] state update hooks are added by the main window git-svn-id: http://ltt.polymtl.ca/svn@388 04897980-b3bd-0310-b5e0-8ef037075253 --- .../poly/lttv/modules/gui/mainWin/src/callbacks.c | 9 +++------ .../poly/lttv/modules/gui/mainWin/src/init_module.c | 5 +++++ ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c | 6 ++++-- .../poly/lttv/modules/guiStatistic/guiStatistic.c | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c index 5440d6ec..6abfd51c 100644 --- a/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c +++ b/ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c @@ -323,9 +323,6 @@ void redraw_viewer(MainWindow * mw_data, TimeWindow * time_window) gdk_window_stick(win); gdk_window_unstick(win); - //lttv_state_add_event_hooks( - // (LttvTracesetState*)mw_data->current_tab->traceset_info->traceset_context); - //update time window of each viewer, let viewer insert hooks needed by process_traceset set_time_window(mw_data, time_window); @@ -335,9 +332,6 @@ void redraw_viewer(MainWindow * mw_data, TimeWindow * time_window) ltt_time_add(time_window->start_time,time_window->time_width), max_nb_events); - //lttv_state_remove_event_hooks( - // (LttvTracesetState*)mw_data->current_tab->traceset_info->traceset_context); - //call hooks to show each viewer and let them remove hooks show_viewer(mw_data); @@ -1726,6 +1720,9 @@ void * create_tab(MainWindow * parent, MainWindow* current_window, "Tab_Info", tmp_tab, (GDestroyNotify)tab_destructor); + + lttv_state_add_event_hooks( + (LttvTracesetState*)tmp_tab->traceset_info->traceset_context); gtk_notebook_append_page(notebook, (GtkWidget*)tmp_tab->multi_vpaned, tmp_tab->label); list = gtk_container_get_children(GTK_CONTAINER(notebook)); diff --git a/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c b/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c index 7bf2f5e3..2201eadc 100644 --- a/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c +++ b/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c @@ -113,6 +113,11 @@ void main_window_free(MainWindow * mw) { if(mw){ + while(mw->tab){ + lttv_state_remove_event_hooks( + (LttvTracesetState*)mw->tab->traceset_info->traceset_context); + mw->tab = mw->tab->next; + } g_object_unref(mw->attributes); g_main_window_list = g_slist_remove(g_main_window_list, mw); diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c b/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c index 71fc6e54..0d666cee 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c @@ -110,7 +110,8 @@ void drawing_data_request(Drawing_t *Drawing, LttvHooks *after_traceset = lttv_hooks_new(); lttv_hooks_add(after_traceset, after_data_request, &event_request); lttv_hooks_add(event, draw_event_hook, &event_request); - state_add_event_hooks_api(control_flow_data->Parent_Window); + //Modified by xiangxiu: state update hooks are added by the main window + //state_add_event_hooks_api(control_flow_data->Parent_Window); lttv_hooks_add(after_event, draw_after_hook, &event_request); lttv_process_traceset_seek_time(tsc, start); @@ -126,7 +127,8 @@ void drawing_data_request(Drawing_t *Drawing, //NULL, after_traceset, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, after_traceset, NULL, event, after_event); - state_remove_event_hooks_api(control_flow_data->Parent_Window); + //Modified by xiangxiu: state update hooks are removed by the main window + //state_remove_event_hooks_api(control_flow_data->Parent_Window); lttv_hooks_destroy(after_traceset); lttv_hooks_destroy(event); diff --git a/ltt/branches/poly/lttv/modules/guiStatistic/guiStatistic.c b/ltt/branches/poly/lttv/modules/guiStatistic/guiStatistic.c index 9b130572..c7ed6e6d 100644 --- a/ltt/branches/poly/lttv/modules/guiStatistic/guiStatistic.c +++ b/ltt/branches/poly/lttv/modules/guiStatistic/guiStatistic.c @@ -628,7 +628,7 @@ void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data, } //add state and stats hooks - state_add_event_hooks_api(statistic_viewer_data->mw); //it will be added in the main window + //state_add_event_hooks_api(statistic_viewer_data->mw); //it will be added in the main window stats_add_event_hooks_api(statistic_viewer_data->mw); } @@ -680,7 +680,7 @@ void statistic_remove_context_hooks(StatisticViewerData * statistic_viewer_data, } //remove state and stats hooks - state_remove_event_hooks_api(statistic_viewer_data->mw); //it will be done in the main window + //state_remove_event_hooks_api(statistic_viewer_data->mw); //it will be done in the main window stats_remove_event_hooks_api(statistic_viewer_data->mw); } -- 2.34.1