(gpointer)viewer);
}
+/* Stop all the processings and call gtk_main_quit() */
+static void mainwindow_quit()
+{
+ lttvwindowtraces_unregister_requests(g_quark_from_string("stats"));
+ lttvwindowtraces_unregister_requests(g_quark_from_string("state"));
+ lttvwindowtraces_unregister_computation_hooks(g_quark_from_string("stats"));
+ lttvwindowtraces_unregister_computation_hooks(g_quark_from_string("state"));
+
+ gtk_main_quit();
+}
+
+
/* insert_viewer function constructs an instance of a viewer first,
* then inserts the widget of the instance into the container of the
* main window
current_time_change_manager(tab, new_current_time);
//FIXME : we delete the filter tree, when it should be updated.
- lttv_filter_tree_destroy(tab->filter);
+ lttv_filter_destroy(tab->filter);
tab->filter = NULL;
#if 0
* 0 : filters updated
* 1 : no filter hooks to update; not an error.
*/
-
+#if 0
int SetFilter(Tab * tab, gpointer filter)
{
LttvHooks * tmp;
return 0;
}
-
+#endif //0
/**
}
-static void events_request_free(EventsRequest *events_request)
-{
- if(events_request == NULL) return;
-
- if(events_request->start_position != NULL)
- lttv_traceset_context_position_destroy(events_request->start_position);
- if(events_request->end_position != NULL)
- lttv_traceset_context_position_destroy(events_request->end_position);
- if(events_request->hooks != NULL)
- g_array_free(events_request->hooks, TRUE);
- if(events_request->before_chunk_traceset != NULL)
- lttv_hooks_destroy(events_request->before_chunk_traceset);
- if(events_request->before_chunk_trace != NULL)
- lttv_hooks_destroy(events_request->before_chunk_trace);
- if(events_request->before_chunk_tracefile != NULL)
- lttv_hooks_destroy(events_request->before_chunk_tracefile);
- if(events_request->event != NULL)
- lttv_hooks_destroy(events_request->event);
- if(events_request->event_by_id != NULL)
- lttv_hooks_by_id_destroy(events_request->event_by_id);
- if(events_request->after_chunk_tracefile != NULL)
- lttv_hooks_destroy(events_request->after_chunk_tracefile);
- if(events_request->after_chunk_trace != NULL)
- lttv_hooks_destroy(events_request->after_chunk_trace);
- if(events_request->after_chunk_traceset != NULL)
- lttv_hooks_destroy(events_request->after_chunk_traceset);
- if(events_request->before_request != NULL)
- lttv_hooks_destroy(events_request->before_request);
- if(events_request->after_request != NULL)
- lttv_hooks_destroy(events_request->after_request);
-
- g_free(events_request);
-}
-
-
-
/* lttvwindow_process_pending_requests
*
* This internal function gets called by g_idle, taking care of the pending
}
/* 0.2 Seek tracefiles positions to context position */
+ //g_assert(lttv_process_traceset_seek_position(tsc, sync_position) == 0);
lttv_process_traceset_synchronize_tracefiles(tsc);
-
+
/* Events processing algorithm implementation */
/* Warning : the gtk_events_pending takes a LOT of cpu time. So what we do
lttv_process_traceset_middle(tsc,
events_request->start_time,
G_MAXUINT, NULL);
+#ifdef DEBUG
+ g_assert(seek_count < LTTV_STATE_SAVE_INTERVAL);
+#endif //DEBUG
} else {
/* 1.1. Use current postition as start position */
if(events_request->start_position != NULL)
lttv_traceset_context_position_destroy(events_request->start_position);
- events_request->start_position = lttv_traceset_context_position_new();
+ events_request->start_position = lttv_traceset_context_position_new(tsc);
lttv_traceset_context_position_save(tsc, events_request->start_position);
/* 1.2. Remove start time */
}
-
/* C Unlock Traces */
{
- //lttv_process_traceset_get_sync_data(tsc);
+ lttv_process_traceset_get_sync_data(tsc);
+ //lttv_traceset_context_position_save(tsc, sync_position);
guint iter_trace;
lttvwindowtraces_unlock(trace_v);
}
}
-
#if 0
//set the cursor back to normal
gdk_window_set_cursor(win, NULL);
strcpy(label,"Page");
if(get_label(mw_data, label,"Get the name of the tab","Please input tab's name"))
return (create_tab (mw_data, copy_tab, notebook, label));
+ else
+ return NULL;
}
void
on_quit_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
- gtk_main_quit ();
+ mainwindow_quit();
}
g_info("There are now : %d windows\n",g_slist_length(g_main_window_list));
if(g_slist_length(g_main_window_list) == 0)
- gtk_main_quit ();
+ mainwindow_quit();
}
gboolean
LttTime start_time = new_time_window.start_time;
LttTime end_time = new_time_window.end_time;
+ g_assert(ltt_time_compare(start_time, end_time) < 0);
+
/* Set scrollbar */
GtkAdjustment *adjustment = gtk_range_get_adjustment(GTK_RANGE(tab->scrollbar));
LttTime upper = ltt_time_sub(time_span.end_time, time_span.start_time);
tab->current_time_manager_lock = FALSE;
}
+void current_position_change_manager(Tab *tab,
+ LttvTracesetContextPosition *pos)
+{
+ LttvTracesetContext *tsc =
+ LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
+ TimeInterval time_span = tsc->time_span;
+
+ g_assert(lttv_process_traceset_seek_position(tsc, pos) == 0);
+ LttTime new_time = lttv_traceset_context_position_get_time(pos);
+
+ current_time_change_manager(tab, new_time);
+
+ set_current_position(tab, pos);
+}
+
+
void
on_MEntry5_value_changed (GtkSpinButton *spinbutton,
gpointer user_data)
}
id = gtk_dialog_run(GTK_DIALOG(dialogue));
- GtkTreeModel **store_model = (GtkTreeModel**)&store; /* for strict aliasing */
+ GtkTreeModel **store_model = (GtkTreeModel**)&store;
switch(id){
case GTK_RESPONSE_ACCEPT:
case GTK_RESPONSE_OK:
tab->viewer_container = gtk_vbox_new(TRUE, 2);
tab->scrollbar = gtk_hscrollbar_new(NULL);
//tab->multivpaned = gtk_multi_vpaned_new();
+ tab->time_window.start_time = ltt_time_zero;
+ tab->time_window.end_time = ltt_time_zero;
+ tab->time_window.time_width = ltt_time_zero;
+ tab->current_time = ltt_time_zero;
gtk_box_pack_start(GTK_BOX(tab->vbox),
tab->viewer_container,