trace_v = lttv_trace_new(trace);
traceset = mw_data->current_tab->traceset_info->traceset;
if(mw_data->current_tab->traceset_info->traceset_context != NULL){
- lttv_context_fini(LTTV_TRACESET_CONTEXT(mw_data->current_tab->
- traceset_info->traceset_context));
- g_object_unref(mw_data->current_tab->traceset_info->traceset_context);
+ //remove state update hooks
+ lttv_state_remove_event_hooks(
+ (LttvTracesetState*)mw_data->current_tab->traceset_info->
+ traceset_context);
+ lttv_context_fini(LTTV_TRACESET_CONTEXT(mw_data->current_tab->
+ traceset_info->traceset_context));
+ g_object_unref(mw_data->current_tab->traceset_info->traceset_context);
}
lttv_traceset_add(traceset, trace_v);
mw_data->current_tab->traceset_info->traceset_context =
lttv_context_init(
LTTV_TRACESET_CONTEXT(mw_data->current_tab->traceset_info->
traceset_context),traceset);
+ //add state update hooks
+ lttv_state_add_event_hooks(
+ (LttvTracesetState*)mw_data->current_tab->traceset_info->traceset_context);
+
+
add_trace_into_traceset_selector(mw_data->current_tab->multi_vpaned, trace);
gtk_widget_destroy((GtkWidget*)file_selector);
ltt_trace_close(lttv_trace(trace_v));
if(mw_data->current_tab->traceset_info->traceset_context != NULL){
+ //remove state update hooks
+ lttv_state_remove_event_hooks(
+ (LttvTracesetState*)mw_data->current_tab->traceset_info->
+ traceset_context);
lttv_context_fini(LTTV_TRACESET_CONTEXT(mw_data->current_tab->
traceset_info->traceset_context));
g_object_unref(mw_data->current_tab->traceset_info->traceset_context);
lttv_trace_destroy(trace_v);
mw_data->current_tab->traceset_info->traceset_context =
g_object_new(LTTV_TRACESET_STATS_TYPE, NULL);
- lttv_context_init(
+ lttv_context_init(
LTTV_TRACESET_CONTEXT(mw_data->current_tab->
traceset_info->traceset_context),traceset);
+ //add state update hooks
+ lttv_state_add_event_hooks(
+ (LttvTracesetState*)mw_data->current_tab->traceset_info->traceset_context);
//update current tab
update_traceset(mw_data);
if(nb_trace > 1){
}
if(tab_instance->traceset_info->traceset_context != NULL){
+ //remove state update hooks
+ lttv_state_remove_event_hooks(
+ (LttvTracesetState*)tab_instance->traceset_info->
+ traceset_context);
lttv_context_fini(LTTV_TRACESET_CONTEXT(tab_instance->traceset_info->
traceset_context));
g_object_unref(tab_instance->traceset_info->traceset_context);
lttv_context_init(
LTTV_TRACESET_CONTEXT(tmp_tab->traceset_info->traceset_context),
tmp_tab->traceset_info->traceset);
-
+ //add state update hooks
+ lttv_state_add_event_hooks(
+ (LttvTracesetState*)tmp_tab->traceset_info->traceset_context);
+
+
//determine the current_time and time_window of the tab
if(mw_data->current_tab){
// Will have to read directly at the main window level, as we want
tmp_tab,
(GDestroyNotify)tab_destructor);
- //add state update hooks
- lttv_state_add_event_hooks(
- (LttvTracesetState*)tmp_tab->traceset_info->traceset_context);
-
- //insert tab into notebook
+ //insert tab into notebook
gtk_notebook_append_page(notebook, (GtkWidget*)tmp_tab->multi_vpaned, tmp_tab->label);
list = gtk_container_get_children(GTK_CONTAINER(notebook));
gtk_notebook_set_current_page(notebook,g_list_length(list)-1);
+++ /dev/null
-/*
- * Initial main.c file generated by Glade. Edit as required.
- * Glade will not overwrite this file.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <gmodule.h>
-
-#include "interface.h"
-#include "support.h"
-#include <lttvwindow/mainWindow.h>
-#include "callbacks.h"
-
-/* global variable */
-systemView * gSysView;
-
-typedef view_constructor (* constructor)();
-constructor get_constructor = NULL;
-typedef void (*call_Event_Selected_Hook)(void * call_data);
-call_Event_Selected_Hook selected_hook = NULL;
-GModule *gm;
-view_constructor gConstructor = NULL;
-
-int
-main (int argc, char *argv[])
-{
- GModule *gm;
- GtkWidget * ToolMenuTitle_menu, *insert_view;
- GtkWidget *window1;
- mainWindow * mw = g_new(mainWindow, 1);
- gSysView = g_new(systemView, 1);
-
-#ifdef ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-#endif
-
- gtk_set_locale ();
- gtk_init (&argc, &argv);
-
- add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
- add_pixmap_directory ("pixmaps");
- add_pixmap_directory ("../pixmaps");
-
- /*
- * The following code was added by Glade to create one of each component
- * (except popup menus), just so that you see something after building
- * the project. Delete any components that you don't want shown initially.
- */
- window1 = create_MWindow ();
- gtk_widget_show (window1);
-
- mw->MWindow = window1;
- mw->SystemView = gSysView;
- mw->Tab = NULL;
- mw->CurrentTab = NULL;
- // mw->Attributes = lttv_attributes_new();
-
- //test
-
- gm = g_module_open("/home1/yangxx/poly/lttv/modules/libguiEvents.la",0);
- printf("Main : the address of gm : %d\n", gm);
- if(!g_module_symbol(gm, "get_constructor", (gpointer)&get_constructor)){
- g_error("can not get constructor\n");
- }
- if(!g_module_symbol(gm, "call_Event_Selected_Hook", (gpointer)&selected_hook)){
- g_error("can not get selected hook\n");
- }
-
- gConstructor = get_constructor();
- ToolMenuTitle_menu = lookup_widget(mw->MWindow,"ToolMenuTitle_menu");
- insert_view = gtk_menu_item_new_with_mnemonic ("insert_view");
- gtk_widget_show (insert_view);
- gtk_container_add (GTK_CONTAINER (ToolMenuTitle_menu), insert_view);
- g_signal_connect ((gpointer) insert_view, "activate",
- G_CALLBACK (insertViewTest),
- NULL);
- //end
-
- gSysView->EventDB = NULL;
- gSysView->SystemInfo = NULL;
- gSysView->Options = NULL;
- gSysView->Window = mw;
- gSysView->Next = NULL;
-
- g_object_set_data(G_OBJECT(window1), "systemView", (gpointer)gSysView);
- g_object_set_data(G_OBJECT(window1), "mainWindow", (gpointer)mw);
-
- gtk_main ();
- return 0;
-}
-
--- /dev/null
+/*
+ * Initial main.c file generated by Glade. Edit as required.
+ * Glade will not overwrite this file.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <gmodule.h>
+
+#include "interface.h"
+#include "support.h"
+#include <lttvwindow/mainWindow.h>
+#include "callbacks.h"
+
+/* global variable */
+systemView * gSysView;
+
+typedef view_constructor (* constructor)();
+constructor get_constructor = NULL;
+typedef void (*call_Event_Selected_Hook)(void * call_data);
+call_Event_Selected_Hook selected_hook = NULL;
+GModule *gm;
+view_constructor gConstructor = NULL;
+
+int
+main (int argc, char *argv[])
+{
+ GModule *gm;
+ GtkWidget * ToolMenuTitle_menu, *insert_view;
+ GtkWidget *window1;
+ mainWindow * mw = g_new(mainWindow, 1);
+ gSysView = g_new(systemView, 1);
+
+#ifdef ENABLE_NLS
+ bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+#endif
+
+ gtk_set_locale ();
+ gtk_init (&argc, &argv);
+
+ add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
+ add_pixmap_directory ("pixmaps");
+ add_pixmap_directory ("../pixmaps");
+
+ /*
+ * The following code was added by Glade to create one of each component
+ * (except popup menus), just so that you see something after building
+ * the project. Delete any components that you don't want shown initially.
+ */
+ window1 = create_MWindow ();
+ gtk_widget_show (window1);
+
+ mw->MWindow = window1;
+ mw->SystemView = gSysView;
+ mw->Tab = NULL;
+ mw->CurrentTab = NULL;
+ // mw->Attributes = lttv_attributes_new();
+
+ //test
+
+ gm = g_module_open("/home1/yangxx/poly/lttv/modules/libguiEvents.la",0);
+ printf("Main : the address of gm : %d\n", gm);
+ if(!g_module_symbol(gm, "get_constructor", (gpointer)&get_constructor)){
+ g_error("can not get constructor\n");
+ }
+ if(!g_module_symbol(gm, "call_Event_Selected_Hook", (gpointer)&selected_hook)){
+ g_error("can not get selected hook\n");
+ }
+
+ gConstructor = get_constructor();
+ ToolMenuTitle_menu = lookup_widget(mw->MWindow,"ToolMenuTitle_menu");
+ insert_view = gtk_menu_item_new_with_mnemonic ("insert_view");
+ gtk_widget_show (insert_view);
+ gtk_container_add (GTK_CONTAINER (ToolMenuTitle_menu), insert_view);
+ g_signal_connect ((gpointer) insert_view, "activate",
+ G_CALLBACK (insertViewTest),
+ NULL);
+ //end
+
+ gSysView->EventDB = NULL;
+ gSysView->SystemInfo = NULL;
+ gSysView->Options = NULL;
+ gSysView->Window = mw;
+ gSysView->Next = NULL;
+
+ g_object_set_data(G_OBJECT(window1), "systemView", (gpointer)gSysView);
+ g_object_set_data(G_OBJECT(window1), "mainWindow", (gpointer)mw);
+
+ gtk_main ();
+ return 0;
+}
+