{
//time_window->start_time = main_win->current_tab->time_window.start_time;
//time_window->time_width = main_win->current_tab->time_window.time_width;
- *time_interval = *(LTTV_TRACESET_CONTEXT(main_win->traceset_info->traceset_context)->Time_Span);
+ *time_interval = *(LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
+ traceset_context)->Time_Span);
}
{
LttvAttributeValue value;
LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->attributes,
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
"hooks/updatetraceset", LTTV_POINTER, &value));
tmp = (LttvHooks*)*(value.v_pointer);
if(tmp == NULL){
{
LttvAttributeValue value;
LttvHooks * tmp;
- g_assert(lttv_iattribute_find_by_path(main_win->attributes,
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
"hooks/updatetraceset", LTTV_POINTER, &value));
tmp = (LttvHooks*)*(value.v_pointer);
if(tmp == NULL) return;
}
+/**
+ * Function to redraw each viewer belonging to the current tab
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void update_traceset(MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/updatetraceset", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_call(tmp, NULL);
+}
+
+
/**
* Function to register a hook function for a viewer to set/update its
* filter.
}
+/**
+ * Function to register a hook function for a viewer to show
+ *the content of the viewer.
+ * It will be called by the constructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void reg_show_viewer(LttvHook hook, gpointer hook_data,
+ MainWindow *main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/showviewer", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL){
+ tmp = lttv_hooks_new();
+ *(value.v_pointer) = tmp;
+ }
+ lttv_hooks_add(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to unregister a viewer's hook function which is used to
+ * show the content of the viewer..
+ * It will be called by the destructor of the viewer.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void unreg_show_viewer(LttvHook hook, gpointer hook_data,
+ MainWindow * main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/showviewer", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+
+/**
+ * Function to show each viewer in the current tab.
+ * It will be called by main window after it called process_traceset
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void show_viewer(MainWindow *main_win)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
+ "hooks/showviewer", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_call(tmp, NULL);
+}
+
+
/**
* Function to set the focused pane (viewer).
* It will be called by a viewer's signal handle associated with
void set_focused_pane(MainWindow *main_win, gpointer paned)
{
- gtk_custom_set_focus((GtkWidget*)main_win->current_tab->custom,paned);
+ gtk_multi_vpaned_set_focus((GtkWidget*)main_win->current_tab->multi_vpaned,paned);
}
void process_traceset_api(MainWindow *main_win, LttTime start,
LttTime end, unsigned maxNumEvents)
{
- lttv_process_traceset_seek_time(main_win->traceset_info->traceset_context, start);
- lttv_process_traceset(main_win->traceset_info->traceset_context, end, maxNumEvents);
+ lttv_process_traceset_seek_time(main_win->current_tab->traceset_info->
+ traceset_context, start);
+ lttv_process_traceset(main_win->current_tab->traceset_info->
+ traceset_context, end, maxNumEvents);
}
/**
LttvHooks *after_event)
{
LttvTracesetContext * tsc =
- LTTV_TRACESET_CONTEXT(main_win->traceset_info->traceset_context);
+ LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
+ traceset_context);
lttv_traceset_context_add_hooks(tsc,before_traceset,after_traceset,
check_trace,before_trace,after_trace,
check_tracefile,before_tracefile,after_tracefile,
LttvHooks *after_event)
{
LttvTracesetContext * tsc =
- LTTV_TRACESET_CONTEXT(main_win->traceset_info->traceset_context);
+ LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->traceset_context);
lttv_traceset_context_remove_hooks(tsc,before_traceset,after_traceset,
check_trace,before_trace,after_trace,
check_tracefile,before_tracefile,after_tracefile,
void state_add_event_hooks_api(MainWindow *main_win )
{
lttv_state_add_event_hooks(
- (LttvTracesetState*)main_win->traceset_info->traceset_context);
+ (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context);
}
void state_remove_event_hooks_api(MainWindow *main_win )
{
lttv_state_remove_event_hooks(
- (LttvTracesetState*)main_win->traceset_info->traceset_context);
+ (LttvTracesetState*)main_win->current_tab->traceset_info->traceset_context);
}
void stats_add_event_hooks_api(MainWindow *main_win )
{
lttv_stats_add_event_hooks(
- (LttvTracesetStats*)main_win->traceset_info->traceset_context);
+ (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context);
}
void stats_remove_event_hooks_api(MainWindow *main_win )
{
lttv_stats_remove_event_hooks(
- (LttvTracesetStats*)main_win->traceset_info->traceset_context);
+ (LttvTracesetStats*)main_win->current_tab->traceset_info->traceset_context);
}
/**
LttvTracesetStats* get_traceset_stats_api(MainWindow *main_win)
{
- return main_win->traceset_info->traceset_context;
+ return main_win->current_tab->traceset_info->traceset_context;
+}
+
+
+LttvTracesetContext* get_traceset_context(MainWindow *main_win)
+{
+ return (LttvTracesetContext*)main_win->current_tab->traceset_info->traceset_context;
}