/* copy reopens a trace */
LttTrace *ltt_trace_copy(LttTrace *self);
+char * ltt_trace_name(LttTrace *t);
+
void ltt_trace_close(LttTrace *t);
stats.h\
textDump.h\
toolbar.h\
- traceset.h
+ traceset.h\
+ lttvfilter.h
#include <stdio.h>
#include <ltt/ltt.h>
#include <gtk/gtk.h>
+#include <lttv/lttvfilter.h>
typedef struct _MainWindow MainWindow;
typedef struct _Tab Tab;
/* constructor of the viewer */
-typedef GtkWidget * (*lttv_constructor)(MainWindow * main_window);
+typedef GtkWidget * (*lttv_constructor)(MainWindow * main_window,
+ LttvTracesetSelector * s, char *key);
typedef lttv_constructor view_constructor;
typedef struct _TimeWindow {
GtkPaned * first_pane;
GtkPaned * last_pane;
GtkPaned * focused_pane;
+ GtkPaned * iter;
guint num_children;
GtkWidget * vbox;
void gtk_multi_vpaned_widget_move_up(GtkMultiVPaned * multi_vpaned);
void gtk_multi_vpaned_widget_move_down(GtkMultiVPaned * multi_vpaned);
void gtk_multi_vpaned_set_adjust(GtkMultiVPaned * multi_vpaned, gboolean first_time);
-
-
+void gtk_multi_vpaned_set_data(GtkMultiVPaned * multi_vpaned, char * key, gpointer value);
+gpointer gtk_multi_vpaned_get_data(GtkMultiVPaned * multi_vpaned, char * key);
+GtkWidget * gtk_multi_vpaned_get_widget(GtkMultiVPaned * multi_vpaned);
+GtkWidget * gtk_multi_vpaned_get_first_widget(GtkMultiVPaned * multi_vpaned);
+GtkWidget * gtk_multi_vpaned_get_next_widget(GtkMultiVPaned * multi_vpaned);
#ifdef __cplusplus
}
--- /dev/null
+#ifndef LTTV_FILTER_H
+#define LTTV_FILTER_H
+
+#include <ltt/ltt.h>
+
+
+typedef struct _LttvTracesetSelector LttvTracesetSelector;
+typedef struct _LttvTraceSelector LttvTraceSelector;
+typedef struct _LttvTracefileSelector LttvTracefileSelector;
+
+
+LttvTracesetSelector *lttv_traceset_selector_new(char * name);
+LttvTraceSelector *lttv_trace_selector_new(LttTrace *t);
+LttvTracefileSelector *lttv_tracefile_selector_new(LttTracefile *t);
+void lttv_traceset_selector_destroy(LttvTracesetSelector *s);
+void lttv_trace_selector_destroy(LttvTraceSelector *t);
+void lttv_tracefile_selector_destroy(LttvTracefileSelector *t);
+
+
+void lttv_traceset_selector_add(LttvTracesetSelector *s, LttvTraceSelector *t);
+unsigned lttv_traceset_selector_number(LttvTracesetSelector *s);
+LttvTraceSelector *lttv_traceset_selector_get(LttvTracesetSelector *s, unsigned i);
+void lttv_traceset_selector_remove(LttvTracesetSelector *s, unsigned i);
+
+
+void lttv_trace_selector_add(LttvTraceSelector *s, LttvTracefileSelector *t);
+unsigned lttv_trace_selector_number(LttvTraceSelector *s);
+LttvTracefileSelector *lttv_trace_selector_get(LttvTraceSelector *s, unsigned i);
+void lttv_trace_selector_remove(LttvTraceSelector *s, unsigned i);
+
+void lttv_trace_selector_set_selected(LttvTraceSelector *s, gboolean g);
+void lttv_tracefile_selector_set_selected(LttvTracefileSelector *s, gboolean g);
+gboolean lttv_trace_selector_get_selected(LttvTraceSelector *s);
+gboolean lttv_tracefile_selector_get_selected(LttvTracefileSelector *s);
+char * lttv_trace_selector_get_name(LttvTraceSelector *s);
+char * lttv_tracefile_selector_get_name(LttvTracefileSelector *s);
+
+#endif // LTTV_FILTER_H
+
LttvTraceset *lttv_traceset_new();
+char * lttv_traceset_name(LttvTraceset * s);
+
LttvTrace *lttv_trace_new(LttTrace *t);
LttvTraceset *lttv_traceset_copy(LttvTraceset *s_orig);
return t;
}
+char * ltt_trace_name(LttTrace *t)
+{
+ return t->pathname;
+}
+
+
/******************************************************************************
* When we copy a trace, we want all the opening actions to happen again :
* the trace will be reopened and totally independant from the original.
interface.c \
callbacks.c \
gtkmultivpaned.c \
- gtkdirsel.c
+ gtkdirsel.c \
+ lttvfilter.c
noinst_HEADERS = \
support.h \
#include <lttv/module.h>
#include <lttv/gtkdirsel.h>
#include <lttv/iattribute.h>
+#include <lttv/lttvfilter.h>
#define PATH_LENGTH 256
#define DEFAULT_TIME_WIDTH_S 1
-extern LttTrace *g_init_trace ;
+extern LttvTrace *g_init_trace ;
/** Array containing instanced objects. */
char * get_unload_module(char ** loaded_module_name, int nb_module);
char * get_remove_trace(char ** all_trace_name, int nb_trace);
char * get_selection(char ** all_name, int nb, char *title, char * column_title);
+void get_filter_selection(LttvTracesetSelector *s, char *title, char * column_title);
void * create_tab(MainWindow * parent, MainWindow * current_window,
GtkNotebook * notebook, char * label);
void insert_viewer(GtkWidget* widget, view_constructor constructor);
+void update_filter(LttvTracesetSelector *s, GtkTreeStore *store );
+
+void checkbox_changed(GtkTreeView *treeview,
+ GtkTreePath *arg1,
+ GtkTreeViewColumn *arg2,
+ gpointer user_data);
+void remove_trace_from_traceset_selector(GtkMultiVPaned * paned, unsigned i);
+void add_trace_into_traceset_selector(GtkMultiVPaned * paned, LttTrace * trace);
+
+LttvTracesetSelector * construct_traceset_selector(LttvTraceset * traceset);
+
+enum {
+ CHECKBOX_COLUMN,
+ NAME_COLUMN,
+ TOTAL_COLUMNS
+};
enum
{
};
+LttvTracesetSelector * construct_traceset_selector(LttvTraceset * traceset)
+{
+ LttvTracesetSelector * s;
+ LttvTraceSelector * trace;
+ LttvTracefileSelector * tracefile;
+ int i, j, nb_trace, nb_tracefile, nb_control, nb_per_cpu;
+ LttvTrace * trace_v;
+ LttTrace * t;
+ LttTracefile *tf;
+
+ s = lttv_traceset_selector_new(lttv_traceset_name(traceset));
+ nb_trace = lttv_traceset_number(traceset);
+ for(i=0;i<nb_trace;i++){
+ trace_v = lttv_traceset_get(traceset, i);
+ t = lttv_trace(trace_v);
+ trace = lttv_trace_selector_new(t);
+ lttv_traceset_selector_add(s, trace);
+ nb_control = ltt_trace_control_tracefile_number(t);
+ nb_per_cpu = ltt_trace_per_cpu_tracefile_number(t);
+ nb_tracefile = nb_control + nb_per_cpu;
+
+ for(j = 0 ; j < nb_tracefile ; j++) {
+ if(j < nb_control)
+ tf = ltt_trace_control_tracefile_get(t, j);
+ else
+ tf = ltt_trace_per_cpu_tracefile_get(t, j - nb_control);
+ tracefile = lttv_tracefile_selector_new(tf);
+ lttv_trace_selector_add(trace, tracefile);
+ }
+ }
+ return s;
+}
+
void
insert_viewer_wrap(GtkWidget *menuitem, gpointer user_data)
{
GtkMultiVPaned * multi_vpaned;
MainWindow * mw_data;
GtkWidget * viewer;
+ LttvTracesetSelector * s;
mw_data = get_window_data_struct(widget);
if(!mw_data->current_tab) return;
multi_vpaned = mw_data->current_tab->multi_vpaned;
- viewer = (GtkWidget*)constructor(mw_data);
+ s = construct_traceset_selector(mw_data->current_tab->traceset_info->traceset);
+ viewer = (GtkWidget*)constructor(mw_data, s, "Traceset_Selector");
if(viewer)
{
gtk_multi_vpaned_widget_add(multi_vpaned, viewer);
}
+void add_trace_into_traceset_selector(GtkMultiVPaned * paned, LttTrace * t)
+{
+ int j, nb_tracefile, nb_control, nb_per_cpu;
+ LttvTracesetSelector * s;
+ LttvTraceSelector * trace;
+ LttvTracefileSelector * tracefile;
+ LttTracefile * tf;
+ GtkWidget * w;
+
+ w = gtk_multi_vpaned_get_first_widget(paned);
+ while(w){
+ s = g_object_get_data(G_OBJECT(w), "Traceset_Selector");
+
+ trace = lttv_trace_selector_new(t);
+ lttv_traceset_selector_add(s, trace);
+ nb_control = ltt_trace_control_tracefile_number(t);
+ nb_per_cpu = ltt_trace_per_cpu_tracefile_number(t);
+ nb_tracefile = nb_control + nb_per_cpu;
+
+ for(j = 0 ; j < nb_tracefile ; j++) {
+ if(j < nb_control)
+ tf = ltt_trace_control_tracefile_get(t, j);
+ else
+ tf = ltt_trace_per_cpu_tracefile_get(t, j - nb_control);
+ tracefile = lttv_tracefile_selector_new(tf);
+ lttv_trace_selector_add(trace, tracefile);
+ }
+
+ w = gtk_multi_vpaned_get_next_widget(paned);
+ }
+}
+
void add_trace(GtkWidget * widget, gpointer user_data)
{
LttTrace *trace;
g_object_new(LTTV_TRACESET_STATS_TYPE, NULL);
lttv_context_init(
LTTV_TRACESET_CONTEXT(mw_data->current_tab->traceset_info->
- traceset_context),traceset);
+ traceset_context),traceset);
+ add_trace_into_traceset_selector(mw_data->current_tab->multi_vpaned, trace);
+
+ gtk_widget_destroy((GtkWidget*)file_selector);
+
+ //update current tab
+ // set_current_time(mw_data, &(mw_data->current_tab->current_time));
+ break;
case GTK_RESPONSE_REJECT:
case GTK_RESPONSE_CANCEL:
default:
gtk_widget_destroy((GtkWidget*)file_selector);
break;
}
- g_printf("add a trace to a trace set\n");
+}
+
+void remove_trace_from_traceset_selector(GtkMultiVPaned * paned, unsigned i)
+{
+ LttvTracesetSelector * s;
+ LttvTraceSelector * t;
+ GtkWidget * w;
+
+ w = gtk_multi_vpaned_get_first_widget(paned);
+ while(w){
+ s = g_object_get_data(G_OBJECT(w), "Traceset_Selector");
+ t = lttv_traceset_selector_get(s,i);
+ lttv_traceset_selector_remove(s, i);
+ lttv_trace_selector_destroy(t);
+ w = gtk_multi_vpaned_get_next_widget(paned);
+ }
}
void remove_trace(GtkWidget * widget, gpointer user_data)
gint i, nb_trace;
char ** name, *remove_trace_name;
MainWindow * mw_data = get_window_data_struct(widget);
+ LttvTracesetSelector * s;
+ LttvTraceSelector * t;
+ GtkWidget * w;
+ gboolean selected;
nb_trace =lttv_traceset_number(mw_data->current_tab->traceset_info->traceset);
name = g_new(char*,nb_trace);
if(remove_trace_name){
for(i=0; i<nb_trace; i++){
if(strcmp(remove_trace_name,name[i]) == 0){
- 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);
+ //unselect the trace from the current viewer
+ w = gtk_multi_vpaned_get_widget(mw_data->current_tab->multi_vpaned);
+ s = g_object_get_data(G_OBJECT(w), "Traceset_Selector");
+ t = lttv_traceset_selector_get(s,i);
+ lttv_trace_selector_set_selected(t, FALSE);
+
+ //check if other viewers select the trace
+ w = gtk_multi_vpaned_get_first_widget(mw_data->current_tab->multi_vpaned);
+ while(w){
+ s = g_object_get_data(G_OBJECT(w), "Traceset_Selector");
+ t = lttv_traceset_selector_get(s,i);
+ selected = lttv_trace_selector_get_selected(t);
+ if(selected)break;
+ w = gtk_multi_vpaned_get_next_widget(mw_data->current_tab->multi_vpaned);
+ }
+
+ //if no viewer selects the trace, remove it
+ if(!selected){
+ remove_trace_from_traceset_selector(mw_data->current_tab->multi_vpaned, i);
+
+ traceset = mw_data->current_tab->traceset_info->traceset;
+ trace_v = lttv_traceset_get(traceset, i);
+ if(lttv_trace_get_ref_number(trace_v) <= 1)
+ ltt_trace_close(lttv_trace(trace_v));
+
+ 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);
+ }
+ lttv_traceset_remove(traceset, i);
+ 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_TRACESET_CONTEXT(mw_data->current_tab->
+ traceset_info->traceset_context),traceset);
+ //update current tab
+ // set_current_time(mw_data, &(mw_data->current_tab->current_time));
}
- lttv_traceset_remove(traceset, i);
- mw_data->current_tab->traceset_info->traceset_context =
- g_object_new(LTTV_TRACESET_STATS_TYPE, NULL);
- lttv_context_init(
- LTTV_TRACESET_CONTEXT(mw_data->current_tab->
- traceset_info->traceset_context),traceset);
break;
}
}
}
g_free(name);
- g_printf("remove a trace from a trace set\n");
}
void save(GtkWidget * widget, gpointer user_data)
delete_viewer((GtkWidget*)menuitem, user_data);
}
+void
+on_trace_filter_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
+ LttvTracesetSelector * s;
+ GtkWidget * w = gtk_multi_vpaned_get_widget(mw_data->current_tab->multi_vpaned);
+
+ s = g_object_get_data(G_OBJECT(w), "Traceset_Selector");
+ if(!s){
+ g_printf("There is no viewer yet\n");
+ return;
+ }
+ get_filter_selection(s, "Configure trace and tracefile filter", "Select traces and tracefiles");
+}
+
+void
+on_trace_facility_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ g_printf("Trace facility selector: %s\n");
+}
void
on_load_module_activate (GtkMenuItem *menuitem,
mw->current_tab = tab;
}
+void checkbox_changed(GtkTreeView *treeview,
+ GtkTreePath *arg1,
+ GtkTreeViewColumn *arg2,
+ gpointer user_data)
+{
+ GtkTreeStore * store = (GtkTreeStore *)gtk_tree_view_get_model (treeview);
+ GtkTreeIter iter;
+ gboolean value;
+
+ if (gtk_tree_model_get_iter ((GtkTreeModel *)store, &iter, arg1)){
+ gtk_tree_model_get ((GtkTreeModel *)store, &iter, CHECKBOX_COLUMN, &value, -1);
+ value = value? FALSE : TRUE;
+ gtk_tree_store_set (GTK_TREE_STORE (store), &iter, CHECKBOX_COLUMN, value, -1);
+ }
+
+}
+
+void update_filter(LttvTracesetSelector *s, GtkTreeStore *store )
+{
+ GtkTreeIter iter, child_iter;
+ int i, j;
+ LttvTraceSelector * trace;
+ LttvTracefileSelector * tracefile;
+ gboolean value, value1;
+
+ if(gtk_tree_model_get_iter_first((GtkTreeModel*)store, &iter)){
+ i = 0;
+ do{
+ trace = lttv_traceset_selector_get(s, i);
+ gtk_tree_model_get ((GtkTreeModel*)store, &iter, CHECKBOX_COLUMN, &value,-1);
+ if(value){
+ j = 0;
+ if(gtk_tree_model_iter_children ((GtkTreeModel*)store, &child_iter, &iter)){
+ do{
+ tracefile = lttv_trace_selector_get(trace, j);
+ gtk_tree_model_get ((GtkTreeModel*)store, &child_iter, CHECKBOX_COLUMN, &value1,-1);
+ lttv_tracefile_selector_set_selected(tracefile,value1);
+ j++;
+ }while(gtk_tree_model_iter_next((GtkTreeModel*)store, &child_iter));
+ }
+ }
+ lttv_trace_selector_set_selected(trace,value);
+ i++;
+ }while(gtk_tree_model_iter_next((GtkTreeModel*)store, &iter));
+ }
+}
+
+void get_filter_selection(LttvTracesetSelector *s,char *title, char * column_title)
+{
+ GtkWidget * dialogue;
+ GtkTreeStore * store;
+ GtkWidget * tree;
+ GtkWidget * scroll_win;
+ GtkCellRenderer * renderer;
+ GtkTreeViewColumn * column;
+ GtkTreeIter iter, child_iter;
+ int i, j, id, nb_trace, nb_tracefile;
+ LttvTraceSelector * trace;
+ LttvTracefileSelector * tracefile;
+ char * name;
+ gboolean checked;
+
+ dialogue = gtk_dialog_new_with_buttons(title,
+ NULL,
+ GTK_DIALOG_MODAL,
+ GTK_STOCK_OK,GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL,GTK_RESPONSE_REJECT,
+ NULL);
+ gtk_window_set_default_size((GtkWindow*)dialogue, 300, 100);
+
+ store = gtk_tree_store_new (TOTAL_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_STRING);
+ tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
+ g_object_unref (G_OBJECT (store));
+ g_signal_connect (G_OBJECT (tree), "row-activated",
+ G_CALLBACK (checkbox_changed),
+ NULL);
+
+
+ renderer = gtk_cell_renderer_toggle_new ();
+ gtk_cell_renderer_toggle_set_radio((GtkCellRendererToggle *)renderer, FALSE);
+
+ g_object_set (G_OBJECT (renderer),"activatable", TRUE, NULL);
+
+ column = gtk_tree_view_column_new_with_attributes ("Checkbox",
+ renderer,
+ "active", CHECKBOX_COLUMN,
+ NULL);
+ gtk_tree_view_column_set_alignment (column, 0.5);
+ gtk_tree_view_column_set_fixed_width (column, 20);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
+
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (column_title,
+ renderer,
+ "text", NAME_COLUMN,
+ NULL);
+ gtk_tree_view_column_set_alignment (column, 0.0);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
+ gtk_tree_view_set_headers_visible(GTK_TREE_VIEW (tree), FALSE);
+
+ scroll_win = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_win),
+ GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
+ gtk_container_add (GTK_CONTAINER (scroll_win), tree);
+
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialogue)->vbox), scroll_win,TRUE, TRUE,0);
+
+ gtk_widget_show(scroll_win);
+ gtk_widget_show(tree);
+
+ nb_trace = lttv_traceset_selector_number(s);
+ for(i=0;i<nb_trace;i++){
+ trace = lttv_traceset_selector_get(s, i);
+ name = lttv_trace_selector_get_name(trace);
+ gtk_tree_store_append (store, &iter, NULL);
+ checked = lttv_trace_selector_get_selected(trace);
+ gtk_tree_store_set (store, &iter,
+ CHECKBOX_COLUMN,checked,
+ NAME_COLUMN,name,
+ -1);
+ nb_tracefile = lttv_trace_selector_number(trace);
+ for(j=0;j<nb_tracefile;j++){
+ tracefile = lttv_trace_selector_get(trace, j);
+ name = lttv_tracefile_selector_get_name(tracefile);
+ gtk_tree_store_append (store, &child_iter, &iter);
+ checked = lttv_tracefile_selector_get_selected(tracefile);
+ gtk_tree_store_set (store, &child_iter,
+ CHECKBOX_COLUMN, checked,
+ NAME_COLUMN,name,
+ -1);
+ }
+ }
+
+ id = gtk_dialog_run(GTK_DIALOG(dialogue));
+ switch(id){
+ case GTK_RESPONSE_ACCEPT:
+ case GTK_RESPONSE_OK:
+ update_filter(s, store);
+ case GTK_RESPONSE_REJECT:
+ case GTK_RESPONSE_CANCEL:
+ default:
+ gtk_widget_destroy(dialogue);
+ break;
+ }
+}
+
char * get_remove_trace(char ** all_trace_name, int nb_trace)
{
return get_selection(all_trace_name, nb_trace,
for(i = 0 ; i < nb ; i++) {
trace = lttv_traceset_get(tab_instance->traceset_info->traceset, i);
ref_count = lttv_trace_get_ref_number(trace);
- if(ref_count <= 1)
+ if(ref_count <= 1){
ltt_trace_close(lttv_trace(trace));
+ }
+ lttv_trace_destroy(trace);
}
}
lttv_traceset_destroy(tab_instance->traceset_info->traceset);
lttv_traceset_copy(mw_data->current_tab->traceset_info->traceset);
}else{
tmp_tab->traceset_info->traceset = lttv_traceset_new();
+ /* Add the command line trace */
+ if(g_init_trace != NULL)
+ lttv_traceset_add(tmp_tab->traceset_info->traceset, g_init_trace);
}
-
- /* Add the command line trace */
- if(g_init_trace != NULL && parent == NULL)
- lttv_traceset_add(tmp_tab->traceset_info->traceset, g_init_trace);
}
//FIXME copy not implemented in lower level
tmp_tab->traceset_info->traceset_context =
on_remove_viewer_activate (GtkMenuItem *menuitem,
gpointer user_data);
+void
+on_trace_filter_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+on_trace_facility_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
void
on_load_module_activate (GtkMenuItem *menuitem,
gpointer user_data);
multi_vpaned->first_pane = NULL;
multi_vpaned->last_pane = NULL;
multi_vpaned->focused_pane = NULL;
+ multi_vpaned->iter = NULL;
multi_vpaned->num_children = 0;
multi_vpaned->vbox = NULL;
return GTK_WIDGET (g_object_new (gtk_multi_vpaned_get_type (), NULL));
}
+GtkWidget * gtk_multi_vpaned_get_widget(GtkMultiVPaned * multi_vpaned)
+{
+ if(multi_vpaned->focused_pane == NULL)return NULL;
+ return (GtkWidget*)multi_vpaned->focused_pane->child2;
+}
+
+GtkWidget * gtk_multi_vpaned_get_first_widget(GtkMultiVPaned * multi_vpaned)
+{
+ if(multi_vpaned->first_pane == NULL)return NULL;
+ multi_vpaned->iter = multi_vpaned->first_pane;
+ return multi_vpaned->first_pane->child2;
+}
+
+GtkWidget * gtk_multi_vpaned_get_next_widget(GtkMultiVPaned * multi_vpaned)
+{
+ if(multi_vpaned->iter != multi_vpaned->last_pane){
+ multi_vpaned->iter = (GtkPaned *)multi_vpaned->iter->child1;
+ return multi_vpaned->iter->child2;
+ }else {
+ return NULL;
+ }
+}
+
+void gtk_multi_vpaned_set_data(GtkMultiVPaned * multi_vpaned,char * key, gpointer value)
+{
+ g_object_set_data(G_OBJECT(multi_vpaned->focused_pane), key, value);
+}
+
+gpointer gtk_multi_vpaned_get_data(GtkMultiVPaned * multi_vpaned,char * key)
+{
+ if(multi_vpaned->focused_pane == NULL)return NULL;
+ return g_object_get_data(G_OBJECT(multi_vpaned->focused_pane), key);
+}
void gtk_multi_vpaned_set_focus (GtkWidget * widget, gpointer user_data)
{
GtkWidget *FileMenuTitle_menu;
GtkWidget *FileMenuNewTitle;
GtkWidget *FileMenuNewTitle_menu;
- GtkWidget *EmptyTraceset;
+ // GtkWidget *EmptyTraceset;
GtkWidget *CloneTraceset;
GtkWidget *FileMenuNewSep;
GtkWidget *Tab;
GtkWidget *MoveViewerDown;
GtkWidget *RemoveViewer;
GtkWidget *ToolMenuSeparator;
+ GtkWidget *Filter;
+ // GtkWidget *Facility;
+ GtkWidget *ToolMenuSeparator1;
// GtkWidget *insert_viewer_test;
GtkWidget *PluginMenuTitle;
GtkWidget *PluginMenuTitle_menu;
FileMenuNewTitle_menu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (FileMenuNewTitle), FileMenuNewTitle_menu);
- EmptyTraceset = gtk_menu_item_new_with_mnemonic ("Empty trace set");
- gtk_widget_show (EmptyTraceset);
- gtk_container_add (GTK_CONTAINER (FileMenuNewTitle_menu), EmptyTraceset);
+ // EmptyTraceset = gtk_menu_item_new_with_mnemonic ("Empty trace set");
+ // gtk_widget_show (EmptyTraceset);
+ // gtk_container_add (GTK_CONTAINER (FileMenuNewTitle_menu), EmptyTraceset);
- CloneTraceset = gtk_menu_item_new_with_mnemonic ("Clone trace set");
+ // CloneTraceset = gtk_menu_item_new_with_mnemonic ("Clone trace set");
+ CloneTraceset = gtk_menu_item_new_with_mnemonic ("New window");
gtk_widget_show (CloneTraceset);
gtk_container_add (GTK_CONTAINER (FileMenuNewTitle_menu), CloneTraceset);
gtk_container_add (GTK_CONTAINER (ToolMenuTitle_menu), ToolMenuSeparator);
gtk_widget_set_sensitive (ToolMenuSeparator, FALSE);
+ Filter = gtk_menu_item_new_with_mnemonic ("Trace Filter Selector");
+ gtk_widget_show (Filter);
+ gtk_container_add (GTK_CONTAINER (ToolMenuTitle_menu), Filter);
+
+ // Facility = gtk_menu_item_new_with_mnemonic ("Facility Selector");
+ // gtk_widget_show (Facility);
+ // gtk_container_add (GTK_CONTAINER (ToolMenuTitle_menu), Facility);
+
+ ToolMenuSeparator1 = gtk_menu_item_new ();
+ gtk_widget_show (ToolMenuSeparator1);
+ gtk_container_add (GTK_CONTAINER (ToolMenuTitle_menu), ToolMenuSeparator1);
+ gtk_widget_set_sensitive (ToolMenuSeparator1, FALSE);
+
// insert_viewer_test = gtk_menu_item_new_with_mnemonic ("Insert viewer test");
// gtk_widget_show (insert_viewer_test);
// gtk_container_add (GTK_CONTAINER (ToolMenuTitle_menu), insert_viewer_test);
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
"",
- "New window with empty trace set", NULL,
+ "New window", NULL,
+ //"New window with empty trace set", NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE);
gtk_widget_show (tlbEmptyTraceset);
g_signal_connect ((gpointer) MWindow, "destroy",
G_CALLBACK (on_MWindow_destroy),
NULL);
- g_signal_connect ((gpointer) EmptyTraceset, "activate",
- G_CALLBACK (on_empty_traceset_activate),
- NULL);
+ // g_signal_connect ((gpointer) EmptyTraceset, "activate",
+ // G_CALLBACK (on_empty_traceset_activate),
+ // NULL);
g_signal_connect ((gpointer) CloneTraceset, "activate",
G_CALLBACK (on_clone_traceset_activate),
NULL);
g_signal_connect ((gpointer) RemoveViewer, "activate",
G_CALLBACK (on_remove_viewer_activate),
NULL);
+ g_signal_connect ((gpointer) Filter, "activate",
+ G_CALLBACK (on_trace_filter_activate),
+ NULL);
+ // g_signal_connect ((gpointer) Facility, "activate",
+ // G_CALLBACK (on_trace_facility_activate),
+ // NULL);
// g_signal_connect ((gpointer) insert_viewer_test, "activate",
// G_CALLBACK (on_insert_viewer_test_activate),
// NULL);
GLADE_HOOKUP_OBJECT (MWindow, FileMenuTitle_menu, "FileMenuTitle_menu");
GLADE_HOOKUP_OBJECT (MWindow, FileMenuNewTitle, "FileMenuNewTitle");
GLADE_HOOKUP_OBJECT (MWindow, FileMenuNewTitle_menu, "FileMenuNewTitle_menu");
- GLADE_HOOKUP_OBJECT (MWindow, EmptyTraceset, "EmptyTraceset");
+ // GLADE_HOOKUP_OBJECT (MWindow, EmptyTraceset, "EmptyTraceset");
GLADE_HOOKUP_OBJECT (MWindow, CloneTraceset, "CloneTraceset");
GLADE_HOOKUP_OBJECT (MWindow, FileMenuNewSep, "FileMenuNewSep");
GLADE_HOOKUP_OBJECT (MWindow, Tab, "Tab");
GLADE_HOOKUP_OBJECT (MWindow, MoveViewerDown, "MoveViewerDown");
GLADE_HOOKUP_OBJECT (MWindow, RemoveViewer, "RemoveViewer");
GLADE_HOOKUP_OBJECT (MWindow, ToolMenuSeparator, "ToolMenuSeparator");
+ GLADE_HOOKUP_OBJECT (MWindow, Filter, "Filter");
+ // GLADE_HOOKUP_OBJECT (MWindow, Facility, "Facility");
+ GLADE_HOOKUP_OBJECT (MWindow, ToolMenuSeparator1, "ToolMenuSeparator1");
// GLADE_HOOKUP_OBJECT (MWindow, insert_viewer_test, "insert_viewer_test");
GLADE_HOOKUP_OBJECT (MWindow, PluginMenuTitle, "PluginMenuTitle");
GLADE_HOOKUP_OBJECT (MWindow, PluginMenuTitle_menu, "PluginMenuTitle_menu");
--- /dev/null
+
+#include <lttv/lttvfilter.h>
+#include <stdio.h>
+
+struct _LttvTracesetSelector {
+ char * traceset_name;
+ GPtrArray *traces;
+};
+
+
+struct _LttvTraceSelector {
+ char * trace_name;
+ GPtrArray * tracefiles;
+ gboolean selected;
+};
+
+struct _LttvTracefileSelector {
+ char * tracefile_name;
+ gboolean selected;
+};
+
+
+LttvTracesetSelector *lttv_traceset_selector_new(char * name)
+{
+ LttvTracesetSelector *s;
+
+ s = g_new(LttvTracesetSelector, 1);
+ if(name)
+ s->traceset_name = g_strdup(name);
+ else
+ s->traceset_name = NULL;
+ s->traces = g_ptr_array_new();
+ return s;
+}
+
+LttvTraceSelector *lttv_trace_selector_new(LttTrace *t)
+{
+ LttvTraceSelector * trace;
+
+ trace = g_new(LttvTraceSelector, 1);
+ trace->trace_name = g_strdup(ltt_trace_name(t));
+ trace->tracefiles = g_ptr_array_new();
+ trace->selected = TRUE;
+ return trace;
+}
+
+LttvTracefileSelector *lttv_tracefile_selector_new(LttTracefile *t)
+{
+ LttvTracefileSelector * tracefile;
+
+ tracefile = g_new(LttvTracefileSelector, 1);
+ tracefile->tracefile_name = g_strdup(ltt_tracefile_name(t));
+ tracefile->selected = TRUE;
+ return tracefile;
+}
+
+
+void lttv_traceset_selector_destroy(LttvTracesetSelector *s)
+{
+ int i;
+ LttvTraceSelector * t;
+
+ for(i=0;i<s->traces->len;i++){
+ t = (LttvTraceSelector*)s->traces->pdata[i];
+ lttv_trace_selector_destroy(t);
+ }
+ g_ptr_array_free(s->traces, TRUE);
+ if(s->traceset_name) g_free(s->traceset_name);
+ g_free(s);
+}
+
+void lttv_trace_selector_destroy(LttvTraceSelector *s)
+{
+ int i;
+ LttvTracefileSelector * t;
+
+ for(i=0;i<s->tracefiles->len;i++){
+ t = (LttvTracefileSelector*)s->tracefiles->pdata[i];
+ lttv_tracefile_selector_destroy(t);
+ }
+ if(s->trace_name) g_free(s->trace_name);
+ g_free(s);
+}
+
+void lttv_tracefile_selector_destroy(LttvTracefileSelector *t)
+{
+ if(t->tracefile_name) g_free(t->tracefile_name);
+ g_free(t);
+}
+
+void lttv_traceset_selector_add(LttvTracesetSelector *s, LttvTraceSelector *t)
+{
+ g_ptr_array_add(s->traces, t);
+}
+
+void lttv_trace_selector_add(LttvTraceSelector *s, LttvTracefileSelector *t)
+{
+ g_ptr_array_add(s->tracefiles, t);
+}
+
+
+unsigned lttv_traceset_selector_number(LttvTracesetSelector *s)
+{
+ return s->traces->len;
+}
+
+unsigned lttv_trace_selector_number(LttvTraceSelector *s)
+{
+ return s->tracefiles->len;
+}
+
+LttvTraceSelector *lttv_traceset_selector_get(LttvTracesetSelector *s, unsigned i)
+{
+ g_assert(s->traces->len > i);
+ return ((LttvTraceSelector *)s->traces->pdata[i]);
+}
+
+LttvTracefileSelector *lttv_trace_selector_get(LttvTraceSelector *s, unsigned i)
+{
+ g_assert(s->tracefiles->len > i);
+ return ((LttvTracefileSelector *)s->tracefiles->pdata[i]);
+}
+
+void lttv_traceset_selector_remove(LttvTracesetSelector *s, unsigned i)
+{
+ g_assert(s->traces->len > i);
+ g_ptr_array_remove_index(s->traces, i);
+}
+
+void lttv_trace_selector_remove(LttvTraceSelector *s, unsigned i)
+{
+ g_assert(s->tracefiles->len > i);
+ g_ptr_array_remove_index(s->tracefiles, i);
+}
+
+
+void lttv_trace_selector_set_selected(LttvTraceSelector *s, gboolean g)
+{
+ s->selected = g;
+}
+
+void lttv_tracefile_selector_set_selected(LttvTracefileSelector *s, gboolean g)
+{
+ s->selected = g;
+}
+
+gboolean lttv_trace_selector_get_selected(LttvTraceSelector *s)
+{
+ return s->selected;
+}
+
+gboolean lttv_tracefile_selector_get_selected(LttvTracefileSelector *s)
+{
+ return s->selected;
+}
+
+char * lttv_trace_selector_get_name(LttvTraceSelector *s)
+{
+ return s->trace_name;
+}
+
+char * lttv_tracefile_selector_get_name(LttvTracefileSelector *s)
+{
+ return s->tracefile_name;
+}
* @return The widget created.
*/
GtkWidget *
-hGuiControlFlow(MainWindow *pmParentWindow)
+hGuiControlFlow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * key)
{
g_critical("hGuiControlFlow");
ControlFlowData *Control_Flow_Data = GuiControlFlow() ;
void send_test_data(ProcessList *Process_List, Drawing_t *Drawing);
-GtkWidget *hGuiControlFlow(MainWindow *pmParentWindow);
+GtkWidget *hGuiControlFlow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * key);
int Event_Selected_Hook(void *hook_data, void *call_data);
} EventViewerData ;
//! Event Viewer's constructor hook
-GtkWidget *h_gui_events(MainWindow *parent_window);
+GtkWidget *h_gui_events(MainWindow *parent_window, LttvTracesetSelector * s, char* key);
//! Event Viewer's constructor
-EventViewerData *gui_events(MainWindow *parent_window);
+EventViewerData *gui_events(MainWindow *parent_window, LttvTracesetSelector *s, char *key);
//! Event Viewer's destructor
void gui_events_destructor(EventViewerData *event_viewer_data);
void gui_events_free(EventViewerData *event_viewer_data);
* @return The widget created.
*/
GtkWidget *
-h_gui_events(MainWindow * parent_window)
+h_gui_events(MainWindow * parent_window, LttvTracesetSelector * s, char* key)
{
- EventViewerData* event_viewer_data = gui_events(parent_window) ;
+ EventViewerData* event_viewer_data = gui_events(parent_window, s, key) ;
if(event_viewer_data)
return event_viewer_data->hbox_v;
* @return The Event viewer data created.
*/
EventViewerData *
-gui_events(MainWindow *parent_window)
+gui_events(MainWindow *parent_window, LttvTracesetSelector * s,char* key )
{
LttTime start, end;
GtkTreeViewColumn *column;
// tree_v_set_cursor(event_viewer_data);
+ g_object_set_data(
+ G_OBJECT(event_viewer_data->hbox_v),
+ key,
+ s);
+
g_object_set_data_full(
G_OBJECT(event_viewer_data->hbox_v),
"event_viewer_data",
typedef struct _StatisticViewerData StatisticViewerData;
//! Statistic Viewer's constructor hook
-GtkWidget *h_gui_statistic(MainWindow *parent_window);
+GtkWidget *h_gui_statistic(MainWindow *parent_window, LttvTracesetSelector * s, char* key);
//! Statistic Viewer's constructor
-StatisticViewerData *gui_statistic(MainWindow *parent_window);
+StatisticViewerData *gui_statistic(MainWindow *parent_window,LttvTracesetSelector * s, char* key);
//! Statistic Viewer's destructor
void gui_statistic_destructor(StatisticViewerData *statistic_viewer_data);
void gui_statistic_free(StatisticViewerData *statistic_viewer_data);
* @return The widget created.
*/
GtkWidget *
-h_gui_statistic(MainWindow * parent_window)
+h_gui_statistic(MainWindow * parent_window, LttvTracesetSelector * s, char* key)
{
- StatisticViewerData* statistic_viewer_data = gui_statistic(parent_window) ;
+ StatisticViewerData* statistic_viewer_data = gui_statistic(parent_window, s, key) ;
if(statistic_viewer_data)
return statistic_viewer_data->hpaned_v;
* @return The Statistic viewer data created.
*/
StatisticViewerData *
-gui_statistic(MainWindow *parent_window)
+gui_statistic(MainWindow *parent_window, LttvTracesetSelector * s, char* key)
{
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
gtk_widget_show(statistic_viewer_data->text_v);
gtk_widget_show(statistic_viewer_data->hpaned_v);
+ g_object_set_data(
+ G_OBJECT(statistic_viewer_data->hpaned_v),
+ key,
+ s);
+
g_object_set_data_full(
G_OBJECT(statistic_viewer_data->hpaned_v),
"statistic_viewer_data",
return s;
}
+char * lttv_traceset_name(LttvTraceset * s)
+{
+ return s->filename;
+}
+
LttvTrace *lttv_trace_new(LttTrace *t)
{
LttvTrace *new_trace;